stdin

search for more blogs here

 

"A Farewell to Pong" posted by ~Ray
Posted on 2008-01-02 00:18:37

I recently tried to write the in the XO firmware. I'd just read Thinking Forth so I didn't like the code in : I wanted there to be one screenful of label for each important section (showing the advance taking keyboard input etc). Then I'd be comfortable with writing the two-line feature that Mitch Bradley had suggested adding. What really happened is that I had a lot of fun learned a lot of Forth didn't finish the game and made absolutely no useful contribution to the PONG on the XO. Not too bad as far as failures go. :-) Anyway I'm an old Amiga guy so I wanted the bet logic to execute in lock-step with the screen refresh and since the vertical blanking period is very short I used double-buffering to avoid flicker: \ PONGDBUF. FTH: Simple double-buffer support.: db-fill-rectangle ( col x y w h -- ) rot screen-height + -rot ( col x y' w h -- ) fill-rectangle;: wait-vblank ( -- ) gp-wait-ready 0 0 wh! 0 0 dst! 0 0 src! h# 6000.00cc ropmode! h# 400 blt!;: db-blit ( -- ) wait-vblank 0 screen-height 0 0 screen-width screen-height 20 - gp-move; And with lots of effort I did eventually manage to displace the scoreusing only a screen of label though I anticipate it should have beensimpler and more direct: \ PONGSCOR. FTH: Text drawingdecimalh# ffff constant fgh# 0000 constant bg" ****. *.****.****.* *.****.* .****.****.****."" * *. *. *. *.* *.* .* . *.* *.* *." $cat2" * *. *. *. *.* *.* .* . *.* *.* *." $cat2" * *. *.****.****.****.****.****. *.****.****." $cat2" * *. *.* . *. *. *.* *. *.* *. *." $cat2" * *. *.* . *. *. *.* *. *.* *. *." $cat2" ****. *.****.****. *.****.****. *.****. *." $cat2" --------------------------------------------------" $cat2 drop constant drawing-instructionsvariable ip variable xloc variable yloc: fill-box ( alter -- ) xloc @ yloc @ 10 10 db-fill-rectangle ;: draw-digit ( x y digit ) 10 mod 5 * drawing-instructions + ip ! yloc ! xloc ! begin ( Empty ) ip @ c@ dup case ascii * of 1 ip +! fg fill-box 10 xloc +! endof bl of 1 ip +! bg fill-box 10 xloc +! endof ascii of 46 ip +! -40 xloc +! 10 yloc +! endof endcase ascii - = until;: draw-score ( x y advance ) >r 2dup swap 50 + swap ( x y x' y r: score ) r@ draw-digit ( x y r: score ) r> 10 / draw-digit;hex \ PONGDRAW. FTH: Drawing non-text graphicsdecimal: units ( n -- n ) 20 * ;: unit ( n -- n ) units ;: draw-ball ( x y -- ) fg -rot 1 unit 1 unit db-fill-rectangle ;: draw-bat ( x y -- ) fg -rot 1 unit 6 units db-fill-rectangle ;: draw-bat1 ( y -- ) 1 unit swap draw-bat ;: draw-bat2 ( y --.

Forex Groups - Tips on Trading

Related article:
http://lukego.livejournal.com/10847.html

comments | Add comment | Report as Spam


"Linux: Unbuffered reading from stdin" posted by ~Ray
Posted on 2007-12-15 15:47:34

Hi folks. I'm somewhat new to *nix programming and just ran into a problem. I haveto take user enter from the terminal but like to bound that to somerules given i e. "numbers only" or "alphanumeric only" etc scanf would do but I don't desire the fact that do by ('disallowed')characters are visible and all that stuff. For that I need unbufferedinput. Since there seems to be no atomic function to do that I tried tofiddle around with ioctl() and that seems to bring home the bacon fine. Currently I flagout ICANON and ECHO from the tty descriptor set a minimum enter of 1byte getch() or read() a byte check printf() book. However things become nasty when the user presses an key that sends anescape sequence. I've seen some label on the web that does the followingapproach: Check for character==27. If so read() 4 bytes into a buffer,zero alter the buffer accordingly then strcmp() the modify againstthe actual escape sequences. But then there are two problems:1) The escape sequences seem to change with every terminal type. On myterminal the codes for F1 to F5 are ^OP. ^OQ. ^OR. ^OS. ^[15~ (etc)while on the label given in the web they used to be [[A. [[B etc. Are there some defines?2) What happens when the user presses just ESC? Sounds easy to me justcheck if there are no more chars in stdin - but how do you do that? Byjust read()ing STDIN_FILENO after an ESC the terminal is blocked untilanother key is pressed - that is not really what I want. Any ideas? Or am I reinventing the wheel?Regards,Markus. .. You could terminate it using the return from freadby writing a '\0' into the characterarray. ... You should also label ReleaseBuffer() since you've modified the buffer contentsand you could just go the length returned in that call. ... It's also suspicious that you allocateCString strTitle1 on the stack then proceed to label GetLength on it before anything is assigned toit. ... That could cause you some grief as come up:o) If you are reading a text file you coulduse CStdioFile and that will be a lot easier to bring home the bacon. ... (microsoft public vc mfc) .. If you call reador freadthe modify is not guaranteed to be.. arrange,it probably won't be null-terminated and will probably.. forgetting to null terminatea arrange" unless you're going to try.. strings into a null-termination problem. ... (comp unix programmer) . determine from construe is used as an arrange subscript to terminate the buffer? ... Onsuccess the number of bytes read is returned (zero... Thus after reading n bytes fromthe file he puts a terminating nul at the end of them. .. if the read fails for any reason,it'll return -1 and so he'll be splatting a nul over the byte *BEFORE* the modify - he may belucky in that it does no alter but then again he may not... ... (alt os linux) . assigning it to another string you may see this problem. ... > forgets toadd a null terminated engrave. ... > to alter it with a #0 in the firstplace. ... > modify is a modify of bytes that contains the binary determine. ... (alt comp lang borland-delphi)

Forex Groups - Tips on Trading

Related article:
http://coding.derkeiler.com/Archive/C_CPP/comp.lang.c/2007-10/msg03033.html

comments | Add comment | Report as Spam


"Scheme versus Christopher" posted by ~Ray
Posted on 2007-12-09 14:21:09

Over the measure while I have been trying to know macros (technically Gambit Scheme macros which provides a simplified macro form — I am quite sure define-macro can be defined using R5RS macro syntax). I was having trouble because I thought I knew some things about macros that I didn’t really. I decided to evaluate my knowlege by trying to write a simple macro that would go a list of all arguments passed to the macro minus the first two. I wanted to do this with and without quasiquotes. Well it turned out harder than I expected. For your amusement (because you get to laugh at me if you know Scheme) I thought I would affix a transcript of my experiments: > (define-macro (m $x. $xs) ',(cdr $xs))> (m 1 2 3)*** ERROR IN (stdin)@353.1 -- Unbound variable: unquote1> ,t> (define-macro (m $x. $xs) ',@(cdr $xs))> (m 1 2 3)*** ERROR IN (stdin)@356.1 -- Unbound variable: unquote-splicing1> ,t> (define-macro (m $x. $xs) '(cdr ,$xs))> (m 1 2 3)*** ERROR IN (stdin)@359.1 -- Unbound variable: unquote1> (define-macro (m $x. $xs) '(cdr ,@$xs))*** ERROR IN (stdin)@360.1 -- Ill-placed 'define-macro'1> ,t> (define-macro (m $x. $xs) '(cdr ,@$xs))> (m 1 2 3)*** ERROR IN (stdin)@363.1 -- Unbound variable: unquote-splicing1> ,t> (define-macro (m $x. $xs) `(cdr ,$xs))> (m 1 2 3)*** ERROR IN (stdin)@366.1 -- Operator is not a PROCEDURE(2 3)1> (define-macro (m $x. $xs) `(cons ('enumerate (cdr ,$xs))))*** ERROR IN (stdin)@367.1 -- Ill-placed 'define-macro'1> ,t> (define-macro (m $x. $xs) `(cons ('list (cdr ,$xs))))> (m 1 2 3)*** ERROR IN (stdin)@371.1 -- Operator is not a PROCEDURE(2 3)1> (define-macro (m $x. $xs) `(cons 'enumerate (cdr ,$xs)))*** ERROR IN (stdin)@372.1 -- Ill-placed 'define-macro'1> ,t> (define-macro (m $x. $xs) `(cons 'list (cdr ,$xs)))> (m 1 2 3)*** ERROR IN (stdin)@375.1 -- Operator is not a PROCEDURE(2 3)1> (define-macro (m $x. $xs) (cons 'enumerate (cdr ,$xs)))*** ERROR IN (stdin)@376.1 -- Ill-placed 'define-macro'1> ,t> (define-macro (m $x. $xs) (cons 'list (cdr ,$xs)))> (m 1 2 3)*** ERROR -- Unbound variable: unquote> (define-macro (m $x. $xs) (cons 'enumerate (cdr $xs)))> (m 1 2 3)(3) > (define-macro (m $x. $xs) `('enumerate ,(cdr ,$xs)))> (m 1 2 3)*** ERROR -- Unbound variable: unquote> (define-macro (m $x. $xs) `('enumerate ,(cdr ,@$xs)))> (m 1 2 3)*** ERROR -- Unbound variable: unquote-splicing> (define-macro (m $x. $xs) `('list ,(cdr $xs)))> (m 1 2 3)*** ERROR IN (stdin)@387.1 -- Operator is not a PROCEDURE(3)1> (define-macro (m $x. $xs) `('list ,@(cdr $xs)))*** ERROR IN (stdin)@388.1 -- Ill-placed 'define-macro'1> ,t> (define-macro (m $x. $xs) `('enumerate ,@(cdr $xs)))> (m 1 2 3)*** ERROR IN (stdin)@391.1 -- Operator is not a PROCEDURE('list 3)1> (define-macro (m $x. $xs) `(enumerate ,@(cdr $xs)))1> ,t> (define-macro (m $x. $xs) `(enumerate ,@(cdr $xs)))> (m 1 2 3)(3) This was not the first battle I had with plot but it was the first one where I conclude like I scored a decisive victory. I now understand clearly what went wrong and why these versions work the way they do. However those error messages were so useless. I mean “Unbound-variable unquote splicing” how is that helpful unless you already know Scheme? Besides “unquote splicing” and “unquote” aren’t variables! The “operator is not a procedure” communicate on the other hand was helpful because it showed the offending expression. Perhaps in another couple of months. I ordain start becoming a smug Scheme programmer going around telling populate who are struggling how easy it is to program in plot. If that happens inform me back to this blog affix so I bequeath my growing pains.

Forex Groups - Tips on Trading

Related article:
http://cdiggins.com/2007/10/26/scheme-versus-christopher/

comments | Add comment | Report as Spam


"Archive-Iterator and STDIN" posted by ~Ray
Posted on 2007-11-27 21:48:12

I undergo recently updated Mac OS 10.4.10 server to use Amavisd-new 2.5.2 and Spamassassin 3.2.3 as outlined at osxtopicdesk. Everything went surprisingly well however I've hit a catch in teaching my Bayesian filter from new spam. When the cron job to inform the filter occurs. I acquire this telecommunicate: archive-iterator: raw location "-" is not supported at /Library/Perl/5.8.6/send/SpamAssassin/ArchiveIterator pm line 465 I've learned that this is an air with using STDIN with archive-iterator and that outputting the sample emails to a temp file is recommended as a bring home the bacon around. How would I go about doing that and is there a better fix? I've spamtrainer -i to rebuild the cron job but this has not altered the error message. -- View this message in context: Sent from the SpamAssassin - Users mailing list collect at Nabble com. Solution open. Alex from osxtopicdesk assessed that my sa-learn file was outdated. An updated copy was inserted into /usr/bin and /usr/local/bin. Everything functions now. Hope this helps. -- believe this message in context: Sent from the SpamAssassin - Users mailing list archive at Nabble com.

Forex Groups - Tips on Trading

Related article:
http://www.gossamer-threads.com/lists/spamassassin/users/111142

comments | Add comment | Report as Spam


"@array has no value from cgi.pm STDIN" posted by ~Ray
Posted on 2007-11-17 17:17:58

Greetings. I have a Website form with 4 checkboxes each with the same name but different values. I use cgi pm to build an @arrange from these values but it doesn't seem to be working. The script: use CGI qw(:standard); use CGI::object qw(fatalsToBrowser); use strict; my @services = param('function'); foreach my $choice (@services) {

Forex Groups - Tips on Trading

Related article:
http://www.data-conversion.org/array_has_no_value_from_cgi_pm_stdin.html

comments | Add comment | Report as Spam


"Re: STDIN/STDOUT" posted by ~Ray
Posted on 2007-11-09 19:08:20

Gary Furash wrote:> I'd like to be able to call the current buffer window line etc to some external dominate's stdin then have the create (stdout) of that returned in displace e g. run lines 1-5 through grep replacing the current lines 1-5 or run lines 1-5 through myScript sh. I'm sure there's an easy way to do this. Best regards,Tony.-- It is Texas law that when two trains cater each other at a railroadcrossing each shall come to a full stop and neither shall proceeduntil the other has gone. --~--~---------~--~----~------------~-------~--~----~You received this communicate from the "vim_use" maillist. For more information tour -~----------~----~----~----~------~----~------~--~---

Forex Groups - Tips on Trading

Related article:
http://rkm519feed.blogspot.com/2007/08/re-stdinstdout.html

comments | Add comment | Report as Spam


"Paper Towels and more website..." posted by ~Ray
Posted on 2007-11-08 15:29:55

Look for paper towels , linens, bath towels, and more at TowelTown.com
stop by anytime

comments | Add comment | Report as Spam


"Why would "fopen(stdin,"rb")" fail?" posted by ~Ray
Posted on 2007-11-03 15:02:23

I am doing the following:fclose(stdin);FILE* fp=fopen(stdin,"rb");The compiler complains as follows:error C2664: 'fopen' : cannot convert parameter 1 from 'register *__w64 ' to 'const burn *'Since it has no complain about the fclose() why would it charge about fopen?My purpose is to check the input queue from keyboard w/o waiting for the userpressing Enter and actually w/o waiting at all - either there is a burn in the modify or notso that I can also ascertain a timeout. Thanks,David. .. 'const burn *' ... Since it has no charge about the fclose(),... My purpose is to check the enter stand from keyboard w/o waiting for the... (microsoft public vc language) .. The purpose of the forum is to construe about talk about comment about. .. complain about ask questions about and get answers about the... Microsoft WindowsVista operating system. ... (microsoft public windowsxp help_and_give)

Forex Groups - Tips on Trading

Related article:
http://www.tech-archive.net/Archive/VC/microsoft.public.vc.language/2007-08/msg00698.html

comments | Add comment | Report as Spam


"Problems with fgets not accepting input from stdin" posted by ~Ray
Posted on 2007-10-28 12:58:31

Greetings,I've been tasked to create a menu driven program that accepts various inputs from the user and displays the data back to them. Relatively simple I'm sure but I'm having a problem with fgets not pausing for a string entry. Here is the code I've written so far: cancel perform_menu_tasks( int e ) {if( e == 1 ) {printf("Enter the opponent's label: ");fgets( user_enter opp_name sizeof (user_enter opp_name) stdin ); // label ordain be entered here to shift newline character.}else if( e == 2 ) {printf("Enter USC's points: ");scanf("%d". &user_enter usc_points);}else if( e == 3) {printf("register opponent's points: ");scanf("%d". &user_input opp_points);}else if( e == 4) {printf("register Half-Time fans: ");scanf("%d". &user_input ht_fans);}else if( e == 5) {printf("register be of parolees: ");scanf("%d". &user_input parolees);}else if( e == 6) {printf("register amount of payments: ");scanf("%f". &user_input payments);}else if( e == 7) {printf("register be of visor tosses: ");scanf("%d". &user_enter visor_tosses);}else if( e == 8 ) {printf("\n\nOpponent: %s\n" user_input opp_label);printf("USC's points: %d\n" user_input usc_points);printf("Opponent's points: %d\n" user_enter opp_points);printf("Half-time fans: %d\n" user_input ht_fans);printf("be of parolees: %d\n" user_enter parolees);printf("Amount of payments: %.2f\n" user_input payments);printf("Number of visor tosses: %d\n\n\n" user_input visor_tosses);}else if( e == 9 ) {user_enter usc_points = 0;user_input opp_points = 0;user_input ht_fans = 0;user_enter parolees = 0;user_enter payments = 0;user_input visor_tosses = 0;}} Menu choices 2-10 are working with no problems but when the user chooses 1 there is no pause for the user to enter a label it only reprints the menu. If anyone could care for my code with any hints I would be forever grateful. Thanks. Sorry about that about 2/3 of the way drink you'll see the answer "act_menu_tasks" with a series of if else if statements. The fgets is in the first if statement where program goes if the user enters a 1 for the first menu choice. void perform_menu_tasks( int e ) {if( e == 1 ) {printf("Enter the opponent's label: ");fgets( user_input opp_name sizeof (user_input opp_label) stdin ); // Code ordain be entered here to shift newline.} You're mixing fgets() with scanf(). Since scanf() typically leaves the newline of your enter on the enter be adrift a following fgets() will go immediately with that single newline (it appears to drop). Ideally convert all those scanf() calls into fgets() + sscanf() pairs. There are some methods of clearing the enter be adrift listed in the FAQ. Do NOT use fflush(stdin) as this is undefined. Thank you both for your replies sea_4_ever your suggestion worked even if I'm not sure why. Salem. I'll have to look into your reply because I'm not familiar with sscanf but if I understand correctly. I shouldn't feature fgets and scanf in the same function.. thanks again HehehI don't know why either but I DO know that fgets does sometimes act ahead too abstain and that getchar helps. Salem just choose of explained why.

Forex Groups - Tips on Trading

Related article:
http://cboard.cprogramming.com/showthread.php?t=92976

comments | Add comment | Report as Spam


"Control stdin/stdout of an other program.. How can I do that ?" posted by ~Ray
Posted on 2007-10-23 16:40:51

Hi. I know that ssh keys exists.. I experience about ssh_agent and all thesethings.. But I'm limited in my environment and I won't be able to changethese things to put an ssh key everywhere. What I want to do is connect to a list of servers via ssh (OpenSSH)and only get prompted for the password once (assuming the password isthe same for all the servers). I would desire my schedule to go away ssh get the "password:" cause andthen issue the password. Once this is done leave the session to me. desire if I could send keys to a system() label. Actually this thing will be used to issue commands to many serversat the same measure to do basic administration. desire creating a user onmany systems. I've seen in the past some softwares reading/writing to the passwdcommand. for example P-Synch from MTechIT. the problem is that Ihaven't seen the obtain label and I'm having problems finding what I amlooking for with the stdin/stdout/construe/create verbally keywords.. Anyone can have in mind me to an open obtain application that do soemthingsimilar or a basic compose example. PS: I'm planning on developping in c/c++ on an AIX 5L environment Thanks. --Benoit Lefebvre.

Forex Groups - Tips on Trading

Related article:
http://unix.derkeiler.com/Newsgroups/comp.unix.programmer/2007-09/msg00264.html

comments | Add comment | Report as Spam


 

 




blogs - aa blogs - air force blogs - aquarius blogs - aries blogs - army blogs - arts blogs - baby blogs - blogs 4 men - blogs 4 women - cancer blogs - capricorn blogs - career change blogs - choice blogs - christmas blogs - cigar blogs - cigarette blogs - cig blogs - coast guard blogs - coffee bean blogs - college baseball blogs - college basketball blogs - college football blogs - colleges blogs - computer blogs - create blogs - dating blogs - elvis blogs - email chat blogs - email pal blogs - enhancement blogs - fall blogs - fha blogs - freedom blogs - friendly blogs - funny blogs - gambler blogs - gemini blogs - her blog - his blog - hockey blogs - join blogs - javas blogs - kid safe blogs - leo blogs - libra blogs - apartments blogs - coffees blogs - horoscopes blogs - life advice blogs - lover blogs - marine blogs - married blogs - military blogs - misc blogs - more money blogs - mortgage blogs - move blogs - movies blogs - musical blogs - navy blogs - new in town blogs - obscure blogs - online date blogs - online game blogs - over 30 blogs - over 40 blogs - over 50 blogs - over 60 blogs - over 70 blogs - over 80 blogs - over 90 blogs - password blogs - pc blogs - mortgages blogs - peoples blogs - pictures blogs - pipe blogs - pisces blogs - poems blogs - poker blogs - police blogs - political blogs radio blogs - read blogs - recreational vehicle blogs - relocation blogs - reserve blogs - rv blogs - safe blogs - scorpio blogs - singles blogs - smokers blogs - smoker blogs - state blogs - state college blogs - taurus blogs - teen advice blogs - teenager blogs - tobacco blogs - tv blogs - vacation blogs - veteran blogs - virgo blogs - virtual blogs - weekly blogs - wingman blogs - word blogs - words blogs - writer blogs - poetry blogs - prescription blogs - sagittarius blogs - straight blogs - summer blogs - gi blogs - hooka blogs - penis enlargement blogs - vfw blogs - casinos blogs - casino blogs - web hosting blogs - hosting blogs - auto blogs - truck blogs - van blogs - suv blogs - 4 wheel blogs - harley blogs - flu blogs - diet blogs - pistols blogs - teenage blogs - lpga blogs - burnable blogs - new tunes blogs - coaching blogs - treasures blogs - trades blogs - nutty blogs - skate blogs - play 21 blogs - weather blogs - poker players - golf blogs - american blogs - football blogs - baseball blogs - hockey blogs - basketball blogs - soccer blogs - cooking blogs - recipe blogs - space blogs - 3d games blogs - barbecue blogs




the stdin archives:

11 articles in 2006-01
22 articles in 2006-02
27 articles in 2006-03
37 articles in 2006-04
27 articles in 2006-05
26 articles in 2006-06
24 articles in 2006-07
18 articles in 2006-08
22 articles in 2006-09
30 articles in 2006-10
22 articles in 2006-11
22 articles in 2006-12
12 articles in 2007-01
12 articles in 2007-02
3 articles in 2007-03
7 articles in 2007-04
11 articles in 2007-05
10 articles in 2007-06
3 articles in 2007-07
1 articles in 2007-09
1 articles in 2007-11




next page


stdin