Err... what about Internet Explorer? I mean x-mixed-replace is Netscape technology, right?
From the summary on this page:
The Netscape Web browser implements a proprietary technology known as Server Push to send a type of dynamic page updates to a client. This technology is not supported by Microsoft Internet Explorer. However, you can use Server Push with Microsoft Active Server Pages (ASP), or you can Client Pull as an optional method of displaying dynamic page updates in Internet Explorer.
So... any idea how to do a server push in Internet Explorer?
I'm not equiped to comment on the Korean society. I tried to give you a feel of what's going on but even that is difficult. All in all, Korea is a very advanced country, maybe not socially quite yet.
If you have a "good job", wages are anything but low. But it's what you have to give in return that is the killer... 8AM to 10PM at school translates into 8AM to 8PM at work (but paid 9 to 5). Different system I guess...
You're not getting it. Try to picture studying from 8AM to 11PM... Every day of your life from when you're 6 until you get a job... and then do the same during military service (for 3 years) and then as a programmer/ lawyer/ doctor/ whatever. Do you get a feel of how scary this is?
My brother in law is 16. He wakes-up at 6.45 and leaves home at 7.15 to get to school by 8AM. He studies until 6PM then goes to after-school class until 8PM then has another 3 hours of after-class to do his homework (supervised). He comes back at quater to midnight (thankfully his school is only 45 minutes away from home). He sleeps 5-6 hours a night. How long could you go on like this? To me, that would amount to mental torture. I can't go without sleep for very long... or I'd just walk around like a zombie for the rest of the day, being rubbish at my job.
Let's go back to my brother: If he didn't study like that in middle school, he wouldn't have gotten in a good high-school. If he doesn't study now, he won't get into a good university. If he doesn't get good university grades, he won't get into Samsung (or whatever it is he wants to become... Samsung is every Korean's dream of a good job).
You know where it all stops: When (if) you get a good job, then you can breath. If you don't get a good job, there's always suicide.
When does it start,though? How hard is it to get into a good middle school or primary school? or a good kinder garden?
Pre-natal english lessons with speakers against the mother's belly aren't unheard of. That cruel operation supposed to give kids a more agile tongue so necessary to speak english is also something practised in Korea. Peer-pressure leading to stupid diets and crave for plastic surgery or women injecting engine oil in their face or intentional self-mutilation... Yes, it is all happening in Korea. The whole society is going out of control. I'm telling you, parents don't understand what their kids are becoming. How could they when they only see their kids for 1 or 2 hours a day? But somehow, they know it's for their own good and that things will turn-out ok... or not.
If you've never been immersed in the Korean society, you won't get what's happening. Let's just say... it's not about the kids being a bit overworked and needing some Prozac and Councelling help, it goes much deeper than that.
In April 2000, a victim of habitual wife-beating shared her story and photos through the Internet, shedding light on the severity of inhumane violence in Korean homes. The perpetrator, who suffered from the delusion that his wife was unfaithful to him, had been torturing her in the most despicable way. He tied her up and thrashed her, poured boiling water on her body, disfigured her face with a knife, tortured her with electric shocks, pulled out her teeth with pliers, and stabbed her in the abdomen with a butcher knife.
The Inchon branch of Korea Women's Hotline took charge of the case and launched an on-line signature collecting campaign. It collected a daily average of 1,000 signatures, succeeding in putting the eradication of domestic violence on the social agenda.
Women groups had demanded that the perpetrator be charged with attempted murder, but the Inchon District Court sentenced the man to 15 years imprisonment for violence. This is the highest sentence that can be given for domestic violence that does not result in death.
So you're saying that everyone should become a hippy because 0.001% of the students are committing suicide? Perhaps it would be more productive to just get the depressed kids some counseling and Prozac?
Am I reading this right? Are you trolling or seriously mis-informed? It's Korea we're talking about about, not the US. Maybe your kids are given Prozac or Ritalin or whatever the magic drug of the day is, but the Korean society doesn't work like that. Koreans have a serious problem with over-education. Less jobs means more competition means kids from their youngest age go to school from 8AM... to 8PM... every fucking day.
Actually, with kids locked in the school until they finish their homeworks, it's more like 8AM to 11PM. Again, every freaken day but Sunday. That doesn't include pre-school classes like English or Piano.
Then of course, Bad Things happen when kids fail even one exam (and their parents get upset) or when they are bullied (because kids don't learn how to interact with each other in a non-destructive way) or simply, when they just can't take the pressure anymore.
Tell me, Mr HappyEngineering, do you think (you're giving a professional opinion, right? and it's only 0.001% after all, right? 1 in a 1000?)... do you think, after his third attempt at slashing both his wrists, a six year old should be given Prozac or councelling? Both, maybe?
Those I found, were interesting reads (if you are indeed willing to learn more).
[...] While the students' performances look good on paper, the report does not show the emotional impact of high-pressured education. South Korea has the fastest-rising suicide rate in the world. Eight out of every 100,000 15- to 19-year-olds killed themselves in 2003. The stakes are high.
[...] That Korea's suicide rate took first place among OECD countries last year should make us reflect seriously on our lives and society. The National Statistical Office's 2004 mortality figures are especially embarrassing since suicide is rampant through all age groups at a time when the nation is most democratized and affluent. It may be these dizzying social changes that forced some troubled individuals to take life's final option.
I wanted to play with AJAX too, but I decided that the X in AJAX (unless I'm completely mistaken) is a bit heavy to process in javascript. So I looked into JSON and decided it was still too heavy... Eventually, I went for CSV. Yup, that's right, comma separated values.
So now I'm using A Caching XmlHttpRequest Wrapper with something that can be easily done in javascript: Splitting a string into an array. In my callback, I use something like
r = result.status; if (r == Http.Status.OK) { arr=result.responseText.split(","); }
I've just picked-up javascript so if I'm doing something wrong, please tell me while I'm still learning!
Same happened (still happening?) with the article on the Tokto Islands (google earth: 37deg14'N 131deg52'E although, that probably won't mean much to anyone outside Korea/Japan/China).
Basically, Japan is trying to claim some Korean territory as theirs. To the Koreans, this is the Japanese occupation all over again.
Over a year, the Wikipedia articles about Tokto (aka Takeshima / Liancourt Rocks) witnessed some very childish behaviour from both some Korean and Japanese people.
Anyway, would I be showing bias by saying that given a chance, some countries would love to rewritetheirhistory? More importantly, does Wikipedia gives them a chance to do so?
Yes, I am going down the multiple mice route myself.
I am using a nifty windows project called cpnmouse.
I just bought a few optical/usb mini mice from ebuyer (2 quid each) to make myself a 3DOF trackball.
I am using a marble mouse shell and was hoping I could put in the mice guts inside... that's going to take a bit of thinking, eventhough the mice are "mini", the optical bits inside are quite big. Good news is that the mice have no problem detecting the black dots on the ball.
I first tried the trackball as a 2DOF device and I can see it working quite well with 3DOF (when I'm done with the glue gun;). The way you manipulate the ball in a trackball is quite different from a space ball: you keep rotating the ball until you're done. From what I gather, the spaceball acts more like a joystick (push - wait - stop pushing).
This is for a medical application, so I don't care much for the 3 translations, just the 3 rotations (and as I say, I did get away with 2).
With 3 rotations though, you can do something quite cool.
Glue a little disk on the ball for your index finger to rest on and you get something in between a joy and knob: the index finger gently controls the axis of rotation while your other fingers do the rotation around the locked axis. If this were a professional bit of kit, you could have a ball with a few evenly spaced dips and your finger would rest in one of the dip (you would then reset the rotation axis with the main mouse).
I run daemons for logging my data into the database
I use a web server on the database side (thttpd) with cgis that let me access the database in certain ways.
I have cgis written in both c and python
Keep it simple: each cgi is self contained, small and does only one thing well.
The front-end (written in wxpython) queries the database over the web and display pretty graphs
Replies from the webserver can be compressed/encrypted if need be
I wanted to access the database with an easy protocol (http) rather than writing my own socket stuff (I tried but... why bother?). I don't need full database acess either (like ODBC), just acess to data for a given time interval.
At the moment, I have my mind set on using sqlite. If I decide to change database for X reason, I don't want to get screwed. I found a wrapper called libsdb which I may use... the same SQL queries can be proxied to a variety of databases (oracle, progresql, sqlite...). The one thing I could lose in sqlite3 is the ability to join records in a table spanning across different files. Well... I don't know if that could speed-up my queries or not. Will need to try and check.
>Is that 120K/s for the first 10s, or will it keep that up for a few months?
That, I want to know as well
>Is it all in memory or can I have serveral GB of data?
Definitely GB of data stored on the disk:
All I have now is an athlon 1.7 with 512 megs of ram (debian).
I don't care that much for fast inserts, more like, I have HUGE quantities of images (png+32bit timestamp) which I grab and store in a sqlite database (insert rate could go up to gigabytes of data per hour for 5 image/sec, I need to check if the rate goes down).
I then try to locate images using their timestamp. takes up to a couple of seconds to locate an image in a multigig database (from my experience if you wanted to extract a sequence of consecutive images, only the first image would take a long time to find). I use an index on the timestamps, need to check whether that helps or not.
Anyway, I just bought a 400 gig hd which I formated in ext3 to store my database, so I'll be able to tell if i notice a slowdown in reading/writing for a 10-100 gig sqlite database (I'll put something in my journal if that's of any interest).
I really like working with sqlite (both in c and python with apsw) so when I saw the thread, I kind of remembered the 120000 inserts/sec tests (the guy provided source code for the test, so that's something you could try for yourself).
Although a number of people have shown some interest in recent times in doing work on StegFS or developments of the idea (e.g. http://stegfs.sourceforge.net/), no-one seems to have had enough energy to actually do anything.
The FS had an arbitrary number of layers which were completely hidden from each other (running the risk of files in one layer overwriting files in a layer below).
Anyway, this is (was) mentioned on./ a couple of times before.
I have to say, i didn't really read the article about california. But I did see a report once on BBC about birth defects in kazakhstan and it was sad as fuck. The russians were going for bigger and bigger rockets and the end result was the local population ending up with raising birth defects and cancer. Googling for sources was an interesting exercise:
You can either find some.mil or.gov documents refuting the link between propelants and birth defects or alarmist reports that don't take simple maths into account. Yeah, even water absorbed in big enough quantity could be leathal (this is the way some of these experiments are carried, lets inject water in rat's brain and see if it dies... duh! ).
Presence of chemicals in the air may or may not be toxic enough to cause sad things to happen. Just purely denying it is not the way to go. I guess that's what I was trying to say.
now they are trying to put down even conventional chemical rockets?
Considering how many of the propellant residues are carcinogenic and teratogenic, just maybe you should try and listen to what the tree-huggers have to say. Remember, there's no harmin listening.
Does anyone know if any of the bits of the Silicon Graphics accelerating apache project were ever rolled into Apache 1.3.x or 2.x?
Reading you link...
Unfortunately the ASF rejected the work
presented here and SGI terminated the project. It has a new home now on
SourceForge, courtesy of SGI, and it seeks a new owner and a fresh
start. Want Apache to run faster? Want to take a different approach to
appealing to the ASF? Perhaps simply presenting the ASF with a
different spokesperson would improve the odds of adoption. Apply to the
current owner for project ownership or to sponsor me to revive the project.
Nonetheless, this project's aggressive optimizations make Apache/1.3
up to ten times faster and Apache/2.0 up to four times faster on the SPECweb96 benchmark.
12. Will the ASF adopt the patches?
We contributed the patches to the Apache Software Foundation but the ASF has refused to include the patches in future releases of Apache/1.3 or 2.0, citing "unnecessary" typecasts and complication associated with the warning-free 64-bit port, and incompatible license terms with the state-threaded MPM.
For tunnelling in 'doze, I use putty (which allows encryptes/compressed tunnels) and follow the instructions here or here (instructions for tunnelling samba traffic, but you'll get the picture, rabbit works of port 9666, so use 222.222.222.222:9666 as your web proxy).
This could be quite useful if you connect via GPRS and pay data by the megabyte... or if you're travelling to an unfriendly country and don't want unfriendly people to snoop on your browsing habbit.
Say you want a green saber. All you need is a signal generator in the terahertz region and a 1.5m antenna with a nice handle. Thanks to the formula
f=c/lambda
You find (for a 535nm green wavelength)
f=3e8/535nm = 560THz (more colours converted to frequency in here)
Now wack your sig generator amplitude up and watch your saber glowing green light. Wave around to impress the ladies.
Fair enough, 500-600THz is a bit of a stretch in terms of technology... but we're getting there.
However, what does happen is that you may not have enough "lines" to display well at a larger resolution. What looked good with 200 lines at a small resolution may look like total crap at a high resolution.
Depends how you define your path data (how you describe the curves that link your points). SVG defines more than straight line segments. Say, instead of your 200 lines, you may only need two curved segments which you can zoom in as much as you want.
[...] Paths can be made up of any combination of the following:
Straight line segments
Cubic bezier curved segments
Quadratic bezier curved segments
Elliptical and circular arcs
No other curve types (Other curve types such as splines or nurbs are either technically very difficult, industry-specific and/or have not established themselves as industry standards as much as beziers.)
You may want to check tools like autotrace and their output if you're not entirely convinced;-)
USB Humidifiers? Cup Warmers? Christmat trees? Ash trays? Cell phone chargers? USB was designed to allow your computer to *control* things, not act as a glorified wall-wart!
You think that's weird? what about a plugging in a freaken toothbrush?:-)
I think i am gonna start all my C functions with some extras free(NULL);free(NULL);free(NULL); statements from now on!:)
and that gets recognised by GCC and compiled into NOP NOP NOP... so unless you want to introduce a 3 instruction delay, there is no much use to it;-)
sure I could put
if (ptr!=NULL) free(ptr);
and there would be harmony in the universe again.
But that's pretty much the first test performed in any free.c function (handy example with uclibc):
/* Check for special cases. */
if (unlikely (! mem)) return;
free(NULL) doesn't trash memory. freeing a uninitialised pointer does. I don't expect a int *ptr; to initialise a ptr to NULL (why should it) but I do expect reasonably well written (up to iso specs) malloc, free, realloc functions in all modern compilers. That's the basics. It's been the basics for what, 15 years now? Probably even longer... Yes, even microsoft!
Sure C doesn't hold your hand the way java does, but that's part of the fun I guess.
Did you actually read what I wrote? Read again, you might learn something!
I am perfectly aware that my code is only portable if free(NULL) is handled correctly. Guess what? It's part of the fucking ANSI C spec. That's how standard it is. As in:
ISO/IEC 9899-1990 7.10.3.2 "The free function":
#include
void free(void *ptr);
That section states "If ptr is a null pointer, no action occurs."
If you don't believe in ISO specs, do check out the linux man page for malloc:
free() frees the memory space pointed to by ptr, which must have been
returned by a previous call to malloc(), calloc() or realloc(). Otherwise, or if free(ptr) has already been called before, undefined
behaviour occurs.
If ptr is NULL, no operation is performed.
So there... you don't like the construct, don't use it. I'm not forcing you now, am I? You don't understand it or have concerns, fine, say so...
But don't just dismiss something as a "fantastic piece of crap code" without explanation, it doesn't reflect favourably on your intelligence.
Any function that needs allocating memory is problem prone.
I don't need to know where exactly the code failed, just that it failed.
The compilers I use free NULL pointers gracefully.
The last one reduces the error handling to a minimum: just one label to go to (although, be careful, you do need to initialise them pointers as NULL).
Important point, the same freeing code is used by the function as part of the normal, non-error flow. This is why the returned error_code variable is first initialised to 0 (all clear). goto statements are used to escape the normal flow when an error occurs, just like a break statement breaks out of a loop.
int foo()
{
int error_code=0; int *stuff_ptr1=NULL; int *stuff_ptr2=NULL;
Okay, this is a longshot, but could something like the foveon sensor be applied to LCDs? How long before we get real square pixels from RGB or RGBE stacked LCDs?
If you have a "good job", wages are anything but low. But it's what you have to give in return that is the killer... 8AM to 10PM at school translates into 8AM to 8PM at work (but paid 9 to 5). Different system I guess...
My brother in law is 16. He wakes-up at 6.45 and leaves home at 7.15 to get to school by 8AM. He studies until 6PM then goes to after-school class until 8PM then has another 3 hours of after-class to do his homework (supervised). He comes back at quater to midnight (thankfully his school is only 45 minutes away from home). He sleeps 5-6 hours a night. How long could you go on like this? To me, that would amount to mental torture. I can't go without sleep for very long... or I'd just walk around like a zombie for the rest of the day, being rubbish at my job.
Let's go back to my brother: If he didn't study like that in middle school, he wouldn't have gotten in a good high-school. If he doesn't study now, he won't get into a good university. If he doesn't get good university grades, he won't get into Samsung (or whatever it is he wants to become... Samsung is every Korean's dream of a good job).
You know where it all stops: When (if) you get a good job, then you can breath. If you don't get a good job, there's always suicide.
When does it start,though? How hard is it to get into a good middle school or primary school? or a good kinder garden?
Pre-natal english lessons with speakers against the mother's belly aren't unheard of. That cruel operation supposed to give kids a more agile tongue so necessary to speak english is also something practised in Korea. Peer-pressure leading to stupid diets and crave for plastic surgery or women injecting engine oil in their face or intentional self-mutilation... Yes, it is all happening in Korea. The whole society is going out of control. I'm telling you, parents don't understand what their kids are becoming. How could they when they only see their kids for 1 or 2 hours a day? But somehow, they know it's for their own good and that things will turn-out ok... or not.
If you've never been immersed in the Korean society, you won't get what's happening. Let's just say... it's not about the kids being a bit overworked and needing some Prozac and Councelling help, it goes much deeper than that.
Want something to chill out and help you sleep?
It'll only get worse. Trust me.Actually, with kids locked in the school until they finish their homeworks, it's more like 8AM to 11PM. Again, every freaken day but Sunday. That doesn't include pre-school classes like English or Piano.
Then of course, Bad Things happen when kids fail even one exam (and their parents get upset) or when they are bullied (because kids don't learn how to interact with each other in a non-destructive way) or simply, when they just can't take the pressure anymore.
Tell me, Mr HappyEngineering, do you think (you're giving a professional opinion, right? and it's only 0.001% after all, right? 1 in a 1000?)... do you think, after his third attempt at slashing both his wrists, a six year old should be given Prozac or councelling? Both, maybe?
Those I found, were interesting reads (if you are indeed willing to learn more).
Pushed to the limit here
Specter of Suicides hereSo now I'm using A Caching XmlHttpRequest Wrapper with something that can be easily done in javascript: Splitting a string into an array. In my callback, I use something like
I've just picked-up javascript so if I'm doing something wrong, please tell me while I'm still learning!The main use for USB on the go (its first intended purpose) is to both
You just found a new use for USB on the go! Well done
Exactly! That's the concept behind crank radios. From the article:
I don't see anything wrong with this. It makes perfect sense. Now... How come I can't buy one of them computers for 200-300$?Basically, Japan is trying to claim some Korean territory as theirs. To the Koreans, this is the Japanese occupation all over again.
Over a year, the Wikipedia articles about Tokto (aka Takeshima / Liancourt Rocks) witnessed some very childish behaviour from both some Korean and Japanese people.
Anyway, would I be showing bias by saying that given a chance, some countries would love to rewrite their history? More importantly, does Wikipedia gives them a chance to do so?
I just bought a few optical/usb mini mice from ebuyer (2 quid each) to make myself a 3DOF trackball. I am using a marble mouse shell and was hoping I could put in the mice guts inside... that's going to take a bit of thinking, eventhough the mice are "mini", the optical bits inside are quite big. Good news is that the mice have no problem detecting the black dots on the ball.
I first tried the trackball as a 2DOF device and I can see it working quite well with 3DOF (when I'm done with the glue gun ;). The way you manipulate the ball in a trackball is quite different from a space ball: you keep rotating the ball until you're done. From what I gather, the spaceball acts more like a joystick (push - wait - stop pushing).
This is for a medical application, so I don't care much for the 3 translations, just the 3 rotations (and as I say, I did get away with 2).
With 3 rotations though, you can do something quite cool.
Glue a little disk on the ball for your index finger to rest on and you get something in between a joy and knob: the index finger gently controls the axis of rotation while your other fingers do the rotation around the locked axis. If this were a professional bit of kit, you could have a ball with a few evenly spaced dips and your finger would rest in one of the dip (you would then reset the rotation axis with the main mouse).
- I run daemons for logging my data into the database
- I use a web server on the database side (thttpd) with cgis that let me access the database in certain ways.
- I have cgis written in both c and python
- Keep it simple: each cgi is self contained, small and does only one thing well.
- The front-end (written in wxpython) queries the database over the web and display pretty graphs
- Replies from the webserver can be compressed/encrypted if need be
I wanted to access the database with an easy protocol (http) rather than writing my own socket stuff (I tried but... why bother?). I don't need full database acess either (like ODBC), just acess to data for a given time interval.At the moment, I have my mind set on using sqlite. If I decide to change database for X reason, I don't want to get screwed. I found a wrapper called libsdb which I may use... the same SQL queries can be proxied to a variety of databases (oracle, progresql, sqlite...). The one thing I could lose in sqlite3 is the ability to join records in a table spanning across different files. Well... I don't know if that could speed-up my queries or not. Will need to try and check.
This tutorial I also found useful.
That, I want to know as well
>Is it all in memory or can I have serveral GB of data?
Definitely GB of data stored on the disk:
All I have now is an athlon 1.7 with 512 megs of ram (debian).
I don't care that much for fast inserts, more like, I have HUGE quantities of images (png+32bit timestamp) which I grab and store in a sqlite database (insert rate could go up to gigabytes of data per hour for 5 image/sec, I need to check if the rate goes down).
I then try to locate images using their timestamp. takes up to a couple of seconds to locate an image in a multigig database (from my experience if you wanted to extract a sequence of consecutive images, only the first image would take a long time to find). I use an index on the timestamps, need to check whether that helps or not.
Anyway, I just bought a 400 gig hd which I formated in ext3 to store my database, so I'll be able to tell if i notice a slowdown in reading/writing for a 10-100 gig sqlite database (I'll put something in my journal if that's of any interest).
I really like working with sqlite (both in c and python with apsw) so when I saw the thread, I kind of remembered the 120000 inserts/sec tests (the guy provided source code for the test, so that's something you could try for yourself).
here. Effects of filesystem/RAM/CPU/SCSI on the results are discussed.
Any takers on gimping Balmer's face onto robocop's or would that be taboo (robocop being the good guy and all)
Sorry...
It's kernel 2.0 or 2.2 only if I remember...
The FS had an arbitrary number of layers which were completely hidden from each other (running the risk of files in one layer overwriting files in a layer below).Anyway, this is (was) mentioned on ./ a couple of times before.
You can either find some .mil or .gov documents refuting the link between propelants and birth defects or alarmist reports that don't take simple maths into account. Yeah, even water absorbed in big enough quantity could be leathal (this is the way some of these experiments are carried, lets inject water in rat's brain and see if it dies... duh! ).
Presence of chemicals in the air may or may not be toxic enough to cause sad things to happen. Just purely denying it is not the way to go. I guess that's what I was trying to say.
Reading you link...
So I presume... no- sshd / ssh access on a machine "at work" (preferably, don't use port 22)
- Install rabbit
- Tunnel the port 9666 to your browsing machine
For tunnelling in 'doze, I use putty (which allows encryptes/compressed tunnels) and follow the instructions here or here (instructions for tunnelling samba traffic, but you'll get the picture, rabbit works of port 9666, so use 222.222.222.222:9666 as your web proxy).This could be quite useful if you connect via GPRS and pay data by the megabyte... or if you're travelling to an unfriendly country and don't want unfriendly people to snoop on your browsing habbit.
Now wack your sig generator amplitude up and watch your saber glowing green light. Wave around to impress the ladies. Fair enough, 500-600THz is a bit of a stretch in terms of technology... but we're getting there.
From Appendix A: SVG Requirements
[...] Paths can be made up of any combination of the following:
- Straight line segments
- Cubic bezier curved segments
- Quadratic bezier curved segments
- Elliptical and circular arcs
- No other curve types (Other curve types such as splines or nurbs are either technically very difficult, industry-specific and/or have not established themselves as industry standards as much as beziers.)
You may want to check tools like autotrace and their output if you're not entirely convincedsure I could put
and there would be harmony in the universe again. But that's pretty much the first test performed in any free.c function (handy example with uclibc): free(NULL) doesn't trash memory. freeing a uninitialised pointer does. I don't expect a int *ptr; to initialise a ptr to NULL (why should it) but I do expect reasonably well written (up to iso specs) malloc, free, realloc functions in all modern compilers. That's the basics. It's been the basics for what, 15 years now? Probably even longer... Yes, even microsoft!Sure C doesn't hold your hand the way java does, but that's part of the fun I guess.
Anyway, bedtime...
I am perfectly aware that my code is only portable if free(NULL) is handled correctly. Guess what? It's part of the fucking ANSI C spec. That's how standard it is. As in:
If you don't believe in ISO specs, do check out the linux man page for malloc: So there... you don't like the construct, don't use it. I'm not forcing you now, am I? You don't understand it or have concerns, fine, say so...But don't just dismiss something as a "fantastic piece of crap code" without explanation, it doesn't reflect favourably on your intelligence.
- Any function that needs allocating memory is problem prone.
- I don't need to know where exactly the code failed, just that it failed.
- The compilers I use free NULL pointers gracefully.
The last one reduces the error handling to a minimum: just one label to go to (although, be careful, you do need to initialise them pointers as NULL).Important point, the same freeing code is used by the function as part of the normal, non-error flow. This is why the returned error_code variable is first initialised to 0 (all clear). goto statements are used to escape the normal flow when an error occurs, just like a break statement breaks out of a loop.
int foo()
}{
html code copy-pasted from the vim html output.
Okay, this is a longshot, but could something like the foveon sensor be applied to LCDs? How long before we get real square pixels from RGB or RGBE stacked LCDs?