f



How to extract words containing 'ab' & 'cd' in a text file?

Can anyone do it? ARMY1987- what say?

0
5/30/2007 5:00:17 AM
comp.lang.c 30657 articles. 5 followers. spinoza1111 (3246) is leader. Post Follow

17 Replies
875 Views

Similar Articles

[PageSpeed] 34

On May 30, 10:00 am, Umesh <fraternitydispo...@gmail.com> wrote:
> Can anyone do it? ARMY1987- what say?

Please do not post homework.
Show the code.

thanks

0
5/30/2007 5:01:43 AM
>>>>> "U" == Umesh  <fraternitydisposal@gmail.com> writes:

    U> Can anyone do it? ARMY1987- what say?  

If you have to ask, it's obvious that not anyone can do it, but as I
can do it, I know someone can.

Perhaps you should attempt it and see what you come up with.

Charlton


--
Charlton Wilbur
cwilbur@chromatico.net
0
cwilbur2 (421)
5/30/2007 3:15:23 PM
"Umesh" <fraternitydisposal@gmail.com> ha scritto nel messaggio 
news:1180501217.621345.186920@r19g2000prf.googlegroups.com...
> Can anyone do it? ARMY1987- what say?
>
What? Why am *I* supposed to do that?

After having opened the files, etc., etc...

while (read a word)
    if (the word contains "ab" && the word contains "cd")
        write the word;

close the files, etc., etc...

Look up for the %s format for fscanf(), and for strstr(). 


0
please.ask (434)
6/1/2007 1:22:44 PM
This should do it...

int main(void) {
    FILE *open;
    char word[64]

    open = fopen("file.txt", "r");
    if(!open) return -1;

    while(fscanf(open, "%s", word) != EOF) {
          if((strstr(word, "ab") != NULL) || (strstr(word, "cd") !=
NULL)) {
             printf("gotcha [%s] !\n", word);
          }
    }

    fclose(open);
}





0
6/1/2007 11:40:59 PM
On Fri, 01 Jun 2007 23:40:59 -0000, dimitris.papastamos@gmail.com
wrote:

>This should do it...
>
>int main(void) {
>    FILE *open;
>    char word[64]
>
>    open = fopen("file.txt", "r");
>    if(!open) return -1;
>
>    while(fscanf(open, "%s", word) != EOF) {
>          if((strstr(word, "ab") != NULL) || (strstr(word, "cd") !=
>NULL)) {

The word "about" satisfies the if and will be printed but it does not
meet the criteria specified in the subject.  Only words containing ab
AND cd should be extracted.

>             printf("gotcha [%s] !\n", word);
>          }
>    }
>
>    fclose(open);
>}
>
>
>
>


Remove del for email
0
schwarzb1 (913)
6/2/2007 12:27:26 AM
dimitris.papastamos@gmail.com writes:

> This should do it...
>
> int main(void) {
>     FILE *open;
>     char word[64]
>
>     open = fopen("file.txt", "r");
>     if(!open) return -1;
>
>     while(fscanf(open, "%s", word) != EOF) {

At least write: fscanf(open, "%63s", word);
The %s format with no field width is a Really Bad Idea(TM).

>           if((strstr(word, "ab") != NULL) || (strstr(word, "cd") !=
> NULL)) {
>              printf("gotcha [%s] !\n", word);
>           }
>     }
>
>     fclose(open);
> }

The other errors are left as an exercise to the reader :-) 

-- 
Ben.
0
ben.usenet (6790)
6/2/2007 12:32:24 AM
dimitris.papastamos@gmail.com wrote:
> 
> This should do it...
> 
> int main(void) {
>     FILE *open;
>     char word[64]
> 
>     open = fopen("file.txt", "r");
>     if(!open) return -1;
> 
>     while(fscanf(open, "%s", word) != EOF) {
>           if((strstr(word, "ab") != NULL) || (strstr(word, "cd") !=
> NULL)) {
>              printf("gotcha [%s] !\n", word);
>           }
>     }
>     fclose(open);
> }

I suggest you at least try code you suggest, or mark it untested.

Obvious Faults:
    return -1 is illegal.  Use EXIT_FAILURE and #include <stdlib>.
    The test for fscanf should be "== 1".
    Nothing makes cd follow ab.
    Failure to return 0 (or EXIT_SUCCESS) at completion.

-- 
 <http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
 <http://www.securityfocus.com/columnists/423>
 <http://www.aaxnet.com/editor/edit043.html>
 <http://kadaitcha.cx/vista/dogsbreakfast/index.html>
                        cbfalconer at maineline dot net



-- 
Posted via a free Usenet account from http://www.teranews.com

0
cbfalconer (19194)
6/2/2007 3:49:16 AM
CBFalconer <cbfalconer@yahoo.com> writes:

> dimitris.papastamos@gmail.com wrote:
>> 
>> This should do it...
>> 
>> int main(void) {
>>     FILE *open;
>>     char word[64]
>> 
>>     open = fopen("file.txt", "r");
>>     if(!open) return -1;
>> 
>>     while(fscanf(open, "%s", word) != EOF) {
>>           if((strstr(word, "ab") != NULL) || (strstr(word, "cd") !=
>> NULL)) {
>>              printf("gotcha [%s] !\n", word);
>>           }
>>     }
>>     fclose(open);
>> }
>
> I suggest you at least try code you suggest, or mark it untested.
>
> Obvious Faults:
>     return -1 is illegal.

You are very harsh!  Returning an int != 0, EXIT_SUCCESS or
EXIT_FAILURE is implementation defined so one might call it ill
advised, but "illegal"?

>  Use EXIT_FAILURE and #include <stdlib>.
>     The test for fscanf should be "== 1".

I agree as a general rule (well, testing for n successful matches) but
in the case of a lone "%s" is it an error?  I can't see how a
conforming fscanf can return anything but EOF or 1.  Even as I type
this I can see library writers checking their code for paths that
return 0 for this format.

>     Nothing makes cd follow ab.

The rather limited specification did not require this.

-- 
Ben.
0
ben.usenet (6790)
6/2/2007 5:10:43 AM
CBFalconer <cbfalconer@yahoo.com> writes:
> dimitris.papastamos@gmail.com wrote:
>> 
>> This should do it...
>> 
>> int main(void) {
>>     FILE *open;
>>     char word[64]
>> 
>>     open = fopen("file.txt", "r");
>>     if(!open) return -1;
>> 
>>     while(fscanf(open, "%s", word) != EOF) {
>>           if((strstr(word, "ab") != NULL) || (strstr(word, "cd") !=
>> NULL)) {
>>              printf("gotcha [%s] !\n", word);
>>           }
>>     }
>>     fclose(open);
>> }
>
> I suggest you at least try code you suggest, or mark it untested.

I see no evidence that he didn't try it; the errors you point out are
ones that could easily be missed by insufficiently careful testing.

> Obvious Faults:
>     return -1 is illegal.  Use EXIT_FAILURE and #include <stdlib>.

return -1 is perfectly legal; it's merely non-portable.

>     The test for fscanf should be "== 1".

Yes, it should, but fscanf with a "%s" option reads the next
space-delimited word, and it will return the value EOF when it reaches
the end of the file.  As far as I tell, it will never return a value
other than 1 or EOF.  Just checking for EOF is poor style, but it
happens to work in this case.

>     Nothing makes cd follow ab.

Is that required?  The only problem statement I've seen is in the
subject header: "How to extract words containing 'ab' & 'cd' in a text
file?".  This could mean either
    Extract words containing 'ab' and words containing 'cd'
or
    Extract words containig both 'ab' and 'cd'

In either case, I see no implication of a required order (though the
problem statement is bad enough that that may well have been the
intent).

>     Failure to return 0 (or EXIT_SUCCESS) at completion.

Which happens to be harmless on many systems.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
San Diego Supercomputer Center             <*>  <http://users.sdsc.edu/~kst>
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
0
kst-u (21963)
6/2/2007 6:08:13 AM
"CBFalconer" <cbfalconer@yahoo.com> ha scritto nel messaggio 
news:4660E8BC.C282D8A2@yahoo.com...
> dimitris.papastamos@gmail.com wrote:
>>
>> This should do it...
>>
>> int main(void) {
>>     FILE *open;
>>     char word[64]
>>
>>     open = fopen("file.txt", "r");
>>     if(!open) return -1;
>>
>>     while(fscanf(open, "%s", word) != EOF) {
>>           if((strstr(word, "ab") != NULL) || (strstr(word, "cd") !=
>> NULL)) {
>>              printf("gotcha [%s] !\n", word);
>>           }
>>     }
>>     fclose(open);
>> }
>
> I suggest you at least try code you suggest, or mark it untested.
>
> Obvious Faults:
>    return -1 is illegal.  Use EXIT_FAILURE and #include <stdlib>.
s/illegal/implementation-defined
>    The test for fscanf should be "== 1".
What else could it be, other than 1 and EOF?
>    Nothing makes cd follow ab.
So what?
>    Failure to return 0 (or EXIT_SUCCESS) at completion.
In C99 this is allowed.

And you didn't even say that it should be "%63s", that it prints
words containing "ab" OR  "cd".

Then (not an error, but...):
the test strstr(word, "ab") != NULL hurts my eyes. We are merely
using strstr as a boolean expression, emphatising it is a pointer
is not very useful, also considering that he used if (!open), and
there if (open == NULL) *does* "look better", and does *not*
uselessly make a line 76 characters long, causing it to be wrapped. 


0
please.ask (434)
6/2/2007 8:11:35 AM
Trolling square Umesh was jivin' on 29 May 2007 22:00:17 -0700 in
comp.lang.c.
How to extract words containing 'ab' & 'cd' in a text file?'s a bad
trip that Umesh has trolled before! Dig it!

>Can anyone do it? ARMY1987- what say?

  Ladies & gentlemen, please do not respond to trolls. Ignore them and
they will go away.

-- 

Dig the even newer still, yet more improved, sig!

http://alphalink.com.au/~phaywood/
"Ain't I'm a dog?" - Ronny Self, Ain't I'm a Dog, written by G. Sherry & W. Walker.
I know it's not "technically correct" English; but since when was rock & roll "technically correct"?
0
phaywood (258)
6/3/2007 5:45:42 AM
phaywood@alphalink.com.au.NO.SPAM (Peter 'Shaggy' Haywood) writes:

> Trolling square Umesh was jivin' on 29 May 2007 22:00:17 -0700 in
> comp.lang.c.
> How to extract words containing 'ab' & 'cd' in a text file?'s a bad
> trip that Umesh has trolled before! Dig it!
>
>>Can anyone do it? ARMY1987- what say?
>
>   Ladies & gentlemen, please do not respond to trolls. Ignore them and
> they will go away.

And yet you are the only one doing so on this mornings news feed. Well done.
0
rgrdev (1814)
6/3/2007 10:40:23 AM
How to modify the program so that it can extact words starting with
'ab', ending with 'cd' but not containing 'ef'?

0
6/3/2007 10:54:58 AM
In article <1180868098.621655.268060@z28g2000prd.googlegroups.com>,
Umesh  <fraternitydisposal@gmail.com> wrote:
>How to modify the program so that it can extact words starting with
>'ab', ending with 'cd' but not containing 'ef'?

The state machine approach I showed earlier can handle -all- of the
text processing problems that you have posed so far. Did you 
try it? Did you research state machines? Once you know how to use
state machines, you will know how to sit down and rattle off the
solution to each of these kinds of questions in about 5 minutes.

State 0: 'a' -> State 1; '\n' -> State 0; otherwise -> State 99
State 1: 'b' -> State 2; '\n' Discard word -> State 0; otherwise -> State 99
State 2: 'c' -> State 3; '\n' Discard word -> State 0; 'e' -> State 9;
 otherwise -> State 2
State 3: 'd' -> State 4; '\n' Discard word -> State 0; 'e' -> State 9;
 otherwise -> State 2
State 4: '\n' Output word, Discard word -> State 0; 'e' -> State 9;
 otherwise -> State 2
State 9: 'f' -> State 99; '\n' Discard word -> State 0;
 otherwise -> State 2
State 99: '\n' Discard word -> State 0; otherwise -> State 99
-- 
   "No one has the right to destroy another person's belief by
   demanding empirical evidence."              -- Ann Landers
0
roberson2 (8602)
6/3/2007 5:30:51 PM
On Jun 3, 3:54 pm, Umesh <fraternitydispo...@gmail.com> wrote:
> How to modify the program so that it can extact words starting with
> 'ab', ending with 'cd' but not containing 'ef'?

Hi Umesh,

How will you write a program which accepts a word from user and prints
some "blah blah" if it starts with "ab".
similiarly how will you write a program which will print "foo bar"
when it finds "cd" as the last two letters in the word.
and on the similar lines how will you write a program which will do
nothing which finds "ef" anywhere in the word?

Combine all the three tests together.
HTH
Thanks

0
6/4/2007 3:14:34 PM
"blufox" writes:

> On Jun 3, 3:54 pm, Umesh <fraternitydispo...@gmail.com> wrote:
>> How to modify the program so that it can extact words starting with
>> 'ab', ending with 'cd' but not containing 'ef'?
>
> Hi Umesh,
>
> How will you write a program which accepts a word from user and prints
> some "blah blah" if it starts with "ab".
> similiarly how will you write a program which will print "foo bar"
> when it finds "cd" as the last two letters in the word.
> and on the similar lines how will you write a program which will do
> nothing which finds "ef" anywhere in the word?
>
> Combine all the three tests together.

As far as I can tell umesh sees the world as consisting of a blur of 
amorphous things: words and strings and lines and they seem to be synonyms 
of some sort or other.  Until he is willing to sit down and decide on 
*definitions*  for these three things that have some *invariant* meaning, he 
is doomed to wander in the wilderness.

He should finish this table:

word - A word is ...
string - A string is ...
line - A line is ....

He seems to be searching for a needle in a haystack but, unfortunately, he 
has no means of identifying what a needle is! 


0
r124c4u1022 (2303)
6/4/2007 3:32:58 PM
On Jun 4, 8:32 pm, "osmium" <r124c4u...@comcast.net> wrote:
> "blufox" writes:
> > On Jun 3, 3:54 pm, Umesh <fraternitydispo...@gmail.com> wrote:
> >> How to modify the program so that it can extact words starting with
> >> 'ab', ending with 'cd' but not containing 'ef'?
>
> > Hi Umesh,
>
> > How will you write a program which accepts a word from user and prints
> > some "blah blah" if it starts with "ab".
> > similiarly how will you write a program which will print "foo bar"
> > when it finds "cd" as the last two letters in the word.
> > and on the similar lines how will you write a program which will do
> > nothing which finds "ef" anywhere in the word?
>
> > Combine all the three tests together.
>
> As far as I can tell umesh sees the world as consisting of a blur of
> amorphous things: words and strings and lines and they seem to be synonyms
> of some sort or other.  Until he is willing to sit down and decide on
> *definitions*  for these three things that have some *invariant* meaning, he
> is doomed to wander in the wilderness.
>
> He should finish this table:
>
> word - A word is ...
> string - A string is ...
> line - A line is ....
>
> He seems to be searching for a needle in a haystack but, unfortunately, he
> has no means of identifying what a needle is!
Because, unfortunately he is sitting on the needle.
Umesh, apply simple primary school mathematics to figure out how do
you read a word letter by letter.

Will help, may be...

thanks

0
6/5/2007 12:53:25 PM
Reply:

Similar Artilces:

'is not' or '!='
A newbie question to you; what is the difference between statements like: if x is not None: and if x != None: Without any context, which one should be preferred? IMHO, the latter is more readable. On 2014-08-18 21:35, ElChino wrote: > A newbie question to you; what is the difference between statements > like: > if x is not None: > and > if x != None: > > Without any context, which one should be preferred? > IMHO, the latter is more readable. > "x == y" tells you whether x and y refer to objects that are equal. "x is y" tells you whether x and y actually refer to the same object. In the case of singletons like None (there's only one None object), it's better to use "is". "ElChino" <elchino@cnn.cn>: > A newbie question to you; what is the difference between statements > like: > if x is not None: > and > if x != None: Do the following: take two $10 bills. Hold one bill in the left hand, hold the other bill in the right hand. Now, the bill in the left hand "is not" the bill in the right hand. However, the bill in the left hand "==" the bill in the right hand. > Without any context, which one should be preferred? > IMHO, the latter is more readable. In almost all cases, both tests would result in the same behavior. However, the "is not" test is conceptually the correct one since you want...

'^=' and '~='?
Hello, What is the difference between '^=' and '~='? Thanks, Duckhye ...

'ab\c' and 'ab\\c'
I encountered a rather peculiar behavior of strings today. Here is my irb session: ------------------------------------------------------------------- irb(main):001:0> 'ab\c' irb(main):002:0' ' SyntaxError: compile error (irb):2: unterminated string meets end of file from (irb):2 irb(main):003:0> 'ab\\c' => "ab\\c" irb(main):004:0> 'a\b' => "a\\b" irb(main):005:0> ------------------------------------------------------------------- As you can see when I typed 'ab\c' my irb didn't return. It was expecting...

'&' or '&&' ??
In an if statement which operator & or && is best to used for and? In article <fmgr8a$a5s$1@news.net.uni-c.dk>, saneman <yyyy@dd.com> wrote: >In an if statement which operator & or && is best to used for and? && if you are working with scalar values, and & if you are working with a vector. -- "I will speculate that [...] applications [...] could actually see a performance boost for most users by going dual-core [...] because it is running the adware and spyware that [...] are otherwise slowing down the single CPU that user has...

'''''''''''''The Running Update/Append Queries Using VBA code Ordeal''''''''''''''
Hello fellow programmers, I am trying to run an append/update query from code, a command button on a form initiates the queries. the format i am using is; _____________________________________________________ SELECT "criteria" FROM "criteria" WHERE "criteria" UPDATE/APPEND "field selections" RecordSource "qryExample" = above text strings" _______________________________________________________________________ When i am running a SELECT query in this manner it works fine with no problems, and accepts the values of specified linked form fields. This never works when doing an APPEND/UPDATE query. It can never find the values of linked form fields, Access always asks for the parameter value of the field(s) in question, or Access comes up with an error 3323 - No recordset. I am sure there are other people that have had this problem. What is the difference between Select queries and append/update queries? the append/update queries never seem to be able to find values in linked form fields. Can anyone shed any light on this or point to a knowledgebase Item, or even recommend a book focusing on this subject, I will go and buy it now. I have been for up 2 nights trying to acomplish this and now considering suicide, please help. Thanks In advance, Aaron. I know of two ways you can accomplish this. 1. You can create the SQL script for you append or update query and run the script with DoCmd.RunSQL. 2. You can create a...

'''''''''''''The Running Update/Append Queries Using VBA code Ordeal'''''''''''''' #2
Hi, Thanks for ur help there HJ. I know how to do the tasks you specified there. I would like for the update query to use field values from some of the fields on the form (frmInvoices) such as InvoiceNumber, DateFrom, DateTo. My problem is that an append/update query can't find the values in the open Form (frmInvoices) when I specify them as; [Forms]![frmInvoices]![InvoiceNumber] a select query has no problem finding the field values on a form. please help. Aaron Hi Aaron, Could you post the entire code that you are having trouble with? Now it is not possible to see what goes wrong. HJ "Aaron" <aaron@rapid-motion.co.uk> wrote in message news:260d7f40.0408120245.2f3d01f8@posting.google.com... > Hi, > > Thanks for ur help there HJ. > > I know how to do the tasks you specified there. > > I would like for the update query to use field values from some of the > fields on the form (frmInvoices) such as InvoiceNumber, DateFrom, > DateTo. My problem is that an append/update query can't find the > values in the open Form (frmInvoices) when I specify them as; > > [Forms]![frmInvoices]![InvoiceNumber] > > a select query has no problem finding the field values on a form. > > please help. > > Aaron First off, if you are not always using all the parameters specified in your form, then you have to add parameters to your query on the fly. Also, you can't just do something like qdf.SQL = "SE...

if str_mo not in ('','.') and str_da not in ('','.') and str_yy not in ('','.') Any shorter ?
Hi, there. =20 I'm just curious if it ever dawned on anybody how to abbreviate this line : if str_mo not in ('','.') and str_da not in ('','.') and str_yy not in ('','.')=20 =20 Igor Kurbeko Clinical Programmer Analyst 678 336 4328 ikurbeko@atherogenics.com =20 no brain no pain =20 how about: if not (str_mo in ('','.') or str_da in ('','.') or str_yy in ('','.')) OR if not (missing(str_mo) or missing(str_da) or missing(str_yy)) Eric On 22 Oct 03 21:13:37 GMT, ikurbeko@ATHER...

A function with 'and' , 'not' , 'null' , 'car' and 'cdr'
What's this ? (defun enigma (x) (and (not (null x)) (or (null (car x)) (enigma (cdr x))))) "I suppose I should learn Lisp, but it seems so foreign." - Paul Graham, Nov 1983 On Wed, Oct 07 2015, CAI GENGYANG wrote: > What's this ? > > > (defun enigma (x) > (and (not (null x)) > (or (null (car x)) > (enigma (cdr x))))) Bad taste? It returns T if the list X contains nil as an element. It would be clearer to write (some #'null x). Helmut CAI GENGYANG ...

Calling 'foo.c' or 'foo2.c' from my 'main_code.c'
Hello. I don't know if following is possible. I've got 'main_code.c': ............................ char * another_code; another_code = "foo.c"; ............................ I've got 'foo.c': ............................ #include <stdio.h> int main() { printf ("Hello world from 'foo.c'!\n"); return 0; } ............................ I would like to call 'foo.c' main function from 'main_code.c'. Is this possible? Thank you very much and best regards. Francesco Moi <francescomoi@europe.com> scribbled the ...

'&&', '||' and '!' operators allowed in template arguments?
Hi, Was looking over this paper by Bjarne Straustrup 'http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1510.pdf' and saw this syntax: template<Std_printable && value_type T> class X { /* & */ }; (page 19) Is this real syntax, or am I missing something? "Asfand Yar Qazi" <see@message.body.com> wrote in message news:30pvhgF324b2nU1@uni-berlin.de... > Hi, > > Was looking over this paper by Bjarne Straustrup > 'http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1510.pdf' > and saw this syntax: > > template<Std_printable && value_type T> class X { /* & */ }; > > (page 19) > > Is this real syntax, or am I missing something? I haven't read this paper yet, and www.open-std.org seems to be down, but "&&" here appears to be a "concept intersection operator". It might help if you read page 1 before page 19. Jonathan Jonathan Turkanis wrote: > "Asfand Yar Qazi" <see@message.body.com> wrote in message > news:30pvhgF324b2nU1@uni-berlin.de... > >>Hi, >> >>Was looking over this paper by Bjarne Straustrup >>'http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1510.pdf' >>and saw this syntax: >> >>template<Std_printable && value_type T> class X { /* & */ }; >> >>(page 19) >> >>Is this real syntax, or am I missing so...

error: expected '=', ',', ';', 'asm' or '__attrib
Hi I'm trying to compile an ADC Driver & come acrosss the following error. I've no experience writing drivers before, and hence have no clue how to fix it. Hope someone out there has encountered the problem & suggesst a fix for the same. The Error is I get is : qadc.c: At top level: qadc.c:97: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'qadc_read' make: *** [qadc.o] Error 1 [root@localhost qadc]# ########################################################################### ADC Driver Code ########################################################################### #define MODULE #define __KERNEL__ #include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> /* printk */ #include <linux/fs.h> / #include <linux/errno.h> /* error codes */ #include <linux/types.h> /* size_t */ #include <linux/proc_fs.h> /* proc file system */ #include <linux/fcntl.h> #include <asm/system.h> /* cli, flags */ #include <asm/uaccess.h> /* copy from/to user */ /*Registers to get qadc access*/ volatile unsigned short * qadcmcr = (unsigned short *)0x40190000; volatile unsigned short * qacr0 = (unsigned short *)0x4019000a; volatile unsigned short * qacr1 = (unsigned short *)0x4019000c; volatile unsigned short * qacr2 = (unsigned short *)0x4019000e; volatile unsigned short * qasr0 = (unsigned short *)0x40190010; volatile unsigned short * qasr1...

error: expected '=', ',', ';', 'asm' or '__attrib
Hi I'm trying to compile an ADC Driver & come acrosss the following error. I've no experience writing drivers before, and hence have no clue how to fix it. Hope someone out there has encountered the problem & suggesst a fix for the same. The Error is I get is : qadc.c: At top level: qadc.c:97: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'qadc_read' make: *** [qadc.o] Error 1 [root@localhost qadc]# ########################################################################### ADC Driver Code ##...

'!' vs. '.'
Is there an advantage to using the '!' notation to represent form/ control relationships? (eg. Me!text1 vs Me.text1) I am currently using the '.' notation exclusively (for code completion in the VB Editor), but much of the high-quality code that I've seen (in Duane Hookom's Query-by-Form db, for example) uses the other. Here's one opinion for you: http://doc.advisor.com/doc/05352 robert.waters wrote: >Is there an advantage to using the '!' notation to represent form/ >control relationships? (eg. Me!text1 vs Me.text1) > >I am currently using the '.' notation exclusively (for code completion >in the VB Editor), but much of the high-quality code that I've seen >(in Duane Hookom's Query-by-Form db, for example) uses the other. -- HTH - RuralGuy (RG for short) acXP WinXP Pro Please post back to this forum so all may benefit. Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/databases-ms-access/200704/1 Here's my $0.02 worth on this. I tend to copy the notation style and naming conventions that I see being used in the Help files. That would be Me![text1] for a control on a form. I am of the belief that this notation explicitly refers to a control itself rather than a field in the form's recordset. Here's an example: I have a parts inventory app that uses a "Line" code, which is usually a 3-character abbreviation for a brand name, and is the na...

logical to 'on' / 'off'
Hi, is there a function implemented doing this conversion? my Problem is, that I want to use the following code: set(handles.edit_curr_trq_sl,'Enable',get(hObject,'Value')) where get(hObject,'Value') gives the state of a checkbox thank you! function [str]=tf2oo(logic) switch logic case 0 str='off'; case 1 str='on'; end%switch end%function tf2oo() while i do not know a built in function, I use my own:) meisterbartsch wrote: > > > function [str]=tf2oo(logic) > switch logic > case 0 > str='off'; &g...

Difference between 'is' and '=='
Hey guys, this maybe a stupid question, but I can't seem to find the result anywhere online. When is the right time to use 'is' and when should we use '=='? Thanks alot~ mwql: >Hey guys, this maybe a stupid question, but I can't seem to find the >result anywhere online. When is the right time to use 'is' and when >should we use '=='? http://docs.python.org/ref/comparisons.html -- Ren´┐Ż Pijlman mwql wrote: > Hey guys, this maybe a stupid question, but I can't seem to find the > result anywhere online. When is the right time to ...

Override 'and' and 'or'
Is it possible to override 'and' and/or 'or'? I cannot find a special method for it... __and__ and __rand__ and __or__ and __ror__ are for binary manipulation... any proposals? Have marvelous sunday, Marco Dekker <m.aschwanden@gmail.com> wrote: > Is it possible to override 'and' and/or 'or'? I cannot find a special > method for it... __and__ and __rand__ and __or__ and __ror__ are for > binary manipulation... any proposals? If you want to customize the truth value testing you have to implement __nonzero__ " __nonzero__( self) Call...

replacement for '{' and '}' ?
I am still playing around with what kind of syntax I would like to mark up my documents. Are there equivalent long substitutes for { and } when they are not used to describe arguments to functions? Something like \begin{group} and \end{group}. In other words, if I could force myself to write, say, \begin{group} \it ... \end{group} instead of {\it ... }, then I believe I could identify from the markup context what is an argument that belongs to a just invoked macro and what is text. {Of course, in this context, \textit{...} would be better.} No more ambiguity whether a in \myfunction{a} is an argument or just text. Is there a way to make latex barf when it sees an ordinary '{' in text, rather than \begin{group}, but not barf when I want it (to denote macro arguments)? Regards, /iaw On Aug 16, 6:01=A0pm, "ivo...@gmail.com" <ivo...@gmail.com> wrote: > Is there a way to make latex barf when it sees an ordinary '{' in > text, rather than \begin{group}, but not barf when I want it (to > denote macro arguments)? What do you mean exactly? I don't understand. Do you have in mind your- to-be-new-syntax or just regular latex? Cheers, Tomek ivowel@gmail.com wrote: > I am still playing around with what kind of syntax I would like to > mark up my documents. > > Are there equivalent long substitutes for { and } when they are not > used to describe arguments to functions? Something like \begin{group} > and \end{gr...

Does '!=' equivelent to 'is not'
I'm a bit confusing about whether "is not" equivelent to "!=" if a != b: ... if a is not b: ... What's the difference between "is not" and "!=" or they are the same thing? pirata wrote: > I'm a bit confusing about whether "is not" equivelent to "!=" > > if a != b: > ... > > if a is not b: > ... > > > What's the difference between "is not" and "!=" or they are the same thing? No, they are not the same thing. == and != test to see if the *value* of two variables are the same. Like so: >>> a = 'hello world' >>> b = 'hello world' >>> a == b True a and b both have the value of 'hello world', so they are equal is and is not, however, do not test for value equivalence, they test for object identity. In other words, they test to see if the object the two variables reference are the same object in memory, like so: >>> a is b False a and b are assigned to two different objects that happen to have the same value, but nevertheless there are two separate 'hello world' objects in memory, and therefore you cannot say that a *is* b Now look at this: >>> c = d = 'hello world' >>> c == d True >>> c is d True In this case, they are again the same value, but now the is test also shows that they are the same *object* as well, because...

'[OFF]' as in 'offensive'???
Hi, given that 'off-topicness' is indicated as '[OT]' and taking a look at those postings that started the threads indicated as '[OFF]' (which may both be seen as being somewhat offensive) may lead to the conclusion that '[OFF]' stands for offensiveness. I don't think that this is the intended meaning so what actually *does* '[OFF]' mean? I never came across that abbreviation before (although I have been around on the USENET for quite some time) but maybe it is worth knowing? Josef 'Jupp' Schugt NOTE: mails >100 KiB are ignored -- German edition of comp.lang.ruby FAQ - http://oss.erdfunkstelle.de/ruby/ Aurox Linux - http://qurl.net/7q | http://qurl.net/7r - Firefox Thunderbird - http://qurl.net/7s | http://qurl.net/7t - Liferea Enigmail - http://qurl.net/7u | http://qurl.net/7v - GnuPG [Josef 'Jupp' Schugt <jupp@gmx.de>, 2004-12-10 23.20 CET] > I don't think that this is the intended meaning so what actually *does* > '[OFF]' mean? Off-topic. ...

'a'..'z'
Is it possible to achieve something like this? switch (mystring.charAt(0)) { case 'a'..'z': // do something break; } "cruster" <cruster@gmail.com> wrote in message news:1151319731.988814.326200@m73g2000cwd.googlegroups.com... > Is it possible to achieve something like this? > > switch (mystring.charAt(0)) { > case 'a'..'z': > // do something > break; > } > There are times when an if statement may be more appropriate ;) Sorry - java is not VB :) -- LTP :) cruster schreef: > Is it possible to achieve somethi...

Converting 'C' to an 'M-file'
After spending some time converting a 'C' program into a MATLAB script file in order to incorporate it into our suite of MATLAB based data processing routines, I am now wondering if I could run the 'C' program in MATLAB? It would need to access data created from another MATLAB script stored locally. I thought translating it into MATLAB would improve it's efficiency as it would be running on MATLAB, but having read something about 'MEX-files' I am becoming uncertain. Any quick-start guide to running 'C' programs as M-file scripts would be most helpful. &q...

Re: '^=' and '~='?
Duckhye, According to the doc ( http://xrl.us/befwjx ) they, and one other set of characters, and the mnemonic 'NE' all represent 'NOT EQUAL'. Art ------- On Wed, 11 Feb 2009 16:52:40 -0600, Duck-Hye Yang <dyang@CHAPINHALL.ORG> wrote: >Hello, >What is the difference between '^=' and '~='? > >Thanks, >Duckhye ...

difference between ',' and 'a,'
Small question. In gforth is there a difference between the words ',' and 'a,'? I'm thinking not, so perhaps another question, why have both ',' and 'a,'? Thanks Should be the same, in gforth: see , : , here cell allot ! ; ok see a, : , here cell allot ! ; ok On Friday, January 9, 2015 at 5:46:04 AM UTC-8, beeflo wrote: > Small question. In gforth is there a difference between the words ',' and 'a,'? > > I'm thinking not, so perhaps another question, why have both ',' and 'a,'? > > Thanks beeflo <beeflobill@gmail.com> writes: >Small question. In gforth is there a difference between the words ',' and 'a,'? > >I'm thinking not, so perhaps another question, why have both ',' and 'a,'? In Gforth itself, there is no difference. In Gforth's cross compiler, "a," is there for addresses, and "," is there for other cells; addresses can then be relocated when loading the image. - anton -- M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html New standard: http://www.forth200x.org/forth200x.html EuroForth 2014: http://www.euroforth.org/ef14/ ...

We Are Selling The Nextel I930 For Just $130usd'''''''''''
Dear Customer We have all brands of Mobile Phones,Ipods,Sidekicks,Nextel phone,Laptops for sell at cheap an affordable prices, they ranges from Nokia/Samsung/LG/Son Ericsson/Motorola/Alcatel/panasonic With Bluetooth, al Brands and Models of Nextel Phones, we want you to get bac to us with your quote so that we can begin a good busines relationship. Note they are all Brand New T2 Euro specs unlocked, no operator logo, come in thei original sealed box, With 1 year international warrant from the manufacturer, English & Spanish manual, Finlan made We want to assure you that you will never regret buyin from us because the delivery will be to your doorstep vi FedEx Courier service.And the Tracking number shall be sen to you upon acknowledgement of your payment Kindly acknowledge the reciept of our mail and get back t us at mobiledealer_ltd@yahoo.co -- lolasam whats your url? lolasam wrote: > Dear Customers > > We have all brands of Mobile Phones,Ipods,Sidekicks,Nextels > phone,Laptops for sell at cheap and > affordable prices, they ranges from Nokia/Samsung/LG/Sony > Ericsson/Motorola/Alcatel/panasonic With Bluetooth, all > Brands and Models of Nextel Phones, we want you to get back > to us with your quote so that we can begin a good business > relationship. Note they are all Brand New T2 Euro specs, > unlocked, no operator logo, come in their > original sealed box, With 1 year international warranty > from the manufacturer, English &a...

Web resources about - How to extract words containing 'ab' & 'cd' in a text file? - comp.lang.c

Resources last updated: 3/22/2016 8:16:12 AM