@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2



Comments:

<0> 0.3333 == 0.6666E-1?
<0> printf ("\n%Lg %i\n", frexpl(right, &val), val);
<0> or visa versa
<1> Alternativly, american express versa too.
<1> Heya winkey
<1> winkey, you're playng with &val so frexpl() can and surely does modify it.
<1> And at the time of call to printf, args have to be pushed on stack.
<1> So depending on when the evaluation occurs you may get weird results.
<0> darko`` isn't the inside function call evaluated before the outside?
<1> That surely is.
<1> But val and frexpl(right, &val) will likely yield different values of val.
<1> erm
<1> How to put this in English.
<1> If frexpl modifies val, i doubt there is guarantee by standard in which order will things happen and args be pushed on stack.
<1> So what you p*** to print as 'val', your last arg, might have different value than what you thought it has.



<0> ohh duu it was right
<0> If the argument value is not zero, the return value is value times a power of two
<0> i should learn to read
<0> .6666 * 2^-1
<1> ot sure what you meant, but anyway, avoid these ambiguoities.
<0> it was just a debug line btw
<0> i am toying around like strstr()
<0> lookinbg for a needle in a haystack ;-)
<1> declare frexpl as void frexpl(int right, int *val) {*val++;} and you should see what i mean.
<0> {} is evaluated first?
<1> you'll get unused arg and stuff, but this is just idea.
<0> ohh nm
<1> boy i don't think i wrote a line of C since.. a year ago :(
<1> Well, except here
<1> Good night.
<2> http://rafb.net/paste/results/8Qlofu85.html
<3> deconstruct: "What's wrong?" is a completely useless question in that context.
<3> there's no reference to anything remotely standard in that code
<3> one could only guess
<2> can u help me?
<2> :b
<4> hello, whats the better way to put an entire file in memory?
<4> without having to malloc(10^100)? i dont know the size of the file ...
<5> ftell, and malloc.
<4> like with fseek i go to the end of the file? and then with ftell i know the file size?
<5> right
<4> mmm ok thanks
<4> it worked just fime :D thanks ewick
<4> ls
<4> ups
<6> Good Night Peoples
<4> Hi, does anyone have any experience with jpeglib?
<4> im geting a strage segfault ...
<7> misuse of a pointer.
<4> i cant understand why
<7> lots of possible specific reasons.
<8> estebon: I read above how you were using ftell and fseek. You may consider stat instead.
<7> char *p; use(p);
<7> that uses p before its value is set, and generally will be bad.
<4> im calling a function that asks for a pointer where its going to store the decompressed data ... when i compile just as it is
<7> then my example may be close to your issue.
<4> i dont get the right information in the array, but the program runs, but when i put something like *p=0;
<4> before the function
<7> well, i'm done guessing.
<4> pum! segfault ...
<7> consider using a debugger of some kind.
<7> either general or specific to memory addressing.
<4> :( im not very familiarized with debuggers
<7> e.g., dtrace, or gdb, or valgrind.
<7> if you are going to write programs you should get used to using some.
<8> possibly truss too, depending on the nature of the problem
<4> when i do bt with gdb it says the problem is in a function within the library
<7> that is common when you p*** something to a library function that is broken.
<4> mmm but i p*** it a pointer, just like it asks, the memory is allocated just in the way the library docs says :( i dont get it
<8> at least try the poor-man's debugger: printf()
<4> is there a way to find out what is the function trying to do when it crash?
<7> you can usually decipher it from the backtrace.
<4> mmm its just that i dont know how the library works
<7> you don't need to know.
<7> you should consider putting your code on the paste site.



<4> ok
<7> but while you fidget, did you write code similar to my example, i.e., a pointer that is never ***igned a value which you p*** to the library?
<4> hemm, no, there is a malloc before calling the function
<4> mm the code is 140 lines long :(
<7> doesn't seem too bad.
<4> it is in http://rafb.net/paste/results/mwyjig81.html
<4> the source manager part seems to be ok, the jpeg_read_header() function works, and fills the cinfo struct properly , so the manager is reading the data from the memory
<7> you should increase your compiler's warning level.
<4> with -Wall it doesnt say nothing about the read_scanlines or the pixel pointer
<4> any ideas?
<7> you call to jpeg_read_scanlines looks like the issue.
<4> aha
<8> estebon: how come you have this ``JSAMPARRAY pixel;'' as a global, but then ``pixel=malloc(cinfo.output_width * cinfo.output_components);'' in that function?
<4> :(
<4> i dont know really
<4> i cant malloc a global poibter?
<8> yes you can. I was wondering what it is and how it relates to jpeg_read_scanlines().
<4> pixel is a pointer to the place where jpeg_read_scanlines is going to put a row of pixels
<7> it looks to me like an array of pointers to places to put row data.
<8> yes
<4> aha
<7> and you don't put anything in pixel[0] that points anywhere.
<8> I just started looking at this example -> http://www.it.usyd.edu.au/~graphapp/package/src/imgfmt/readjpg.c
<4> mmm so pixel is of the right kind?
<8> It appears so, but I'm not sure the array is sized correctly in your code... and that might explain the issue.
<4> :D well yes you were right! i was reading it wrong
<9> you mean twkm was right?
<9> Gosh
<7> i seems unlikely. but, i should probably have a cookie just in case.
<4> when you change the prinft function in the for cicle and put *(*pixel+i) you can read the RGB data :D
<7> err, it seems
<9> That makes 18,237 times in a row. He's bound to screw up eventually. Law of averages.
<4> thank you very much people!
<9> And 18,237 cookies, too!
<7> this treo 600 leads to immediate rsi. and the keyboard for it looks to be, if possible, worse.
<9> Immediate RSI is a contradiction in terms, in an Einsteinian universe.
<9> You can't travel faster than light, so you can't repeat /anything/ immediately, including strain.
<7> no worries, i'm obviously in a quantum universe.
<9> Then it must be a really, really tiny keyboard.
<9> Latest laptop, presumably.
<7> even smaller from the picture.
<7> the treo's keyboard is about 50% of the size needed for finger tips.
<7> 3 rows of 11 keys in the same space as my normal keyboard has 2 rows of 3 keys.
<9> stylus supplied?
<7> they are little bubbles, you are supposed to use your fingertips.
<7> and the keyboard you can plug in looks to be about 20% smaller than the usual sort for a lapdog.
<9> They've already exceeded the usability limits in that direction. Time they started investing seriously in VRT.
<4> hemm i need some help with the compilations now :O, when i add the -static flag ld cries about udefined references to the libjpeg functions, but the libjpeg.a is in the right place ... any ideas?
<7> i should probably just hunt for a way to enable the pen strokes
<7> estebon: perhaps you don't have a static c library.
<4> isnt that the libjpeg.a?
<7> no, i mean libc.a
<10> HI C_Dreamer how are you ?
<9> Fine, I think. All bits still attached.
<10> Heh, cool
<4> well thank you guys
<4> im going to bed now
<11> hello
<11> any best sorting algo?
<12> Quick sort is okay.
<12> Insertion sort tends not to be so good.
<12> Bubble sort is terrible.
<3> if you're doing C, just use qsort()
<3> i have a page...
<11> robsort?
<3> http://www.cs.ubc.ca/spider/harrison/Java/sorting-demo.html
<3> http://www.cs.rit.edu/~atk/Java/Sorting/sorting.html
<11> does robsort ****s?
<11> there is a built-in qsort function in c?
<3> c-bot qsort
<13> dbtid, here you go: qsort - #include <stdlib.h> void qsort (void *array, size_t count, size_t size, comparison_fn_t compare) Array Sort Function (ISO) see - http://www.msunix.co.uk/manual/glibc-2.2.3/html_chapter/libc_9.html#SEC142
<3> that's its name
<3> it's not necessarily implemented as a quicksort
<3> despite the seeming implication in the name


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #c
or
Go to some related logs:

#linuxhelp
#c++
#java
#c++
mydomain outtage
#AllNiteCafe
spydgirl
#linux
#c++
_u2pop_ hotmail



Home  |  disclaimer  |  contact  |  submit quotes