Writing to file is usually not considered a usable form of interprocess communication. What you are looking for is probably Sockets, or even better Channels.
The difference of course being that the C/C++ will still compile, and the Perl actually puts the error handler on the same line:
I wouldn't call instantly ending a program with an error message "handling" a problem. If you have no demands on program reliability, you can always throw a RuntimeException("No such file: + fileName") in Java too.
The only way to read the filechannel is a bytebuffer. Has anyone ever used them? I had to once and it sucked....
I've used them. What did you not like about them?
FileReader (or BufferedInputStream) are still awkward because tehy use byte and string arrays. Those really are hard to work with w/o doing conversions in java, where in C the char arrays are usfule w/o conversion.
Ok, there is also RandomAccessFile which gives you methods for reading all primitives, byte arrays, UTF-8 Strings, whole lines....
Used for instance here to do high performance Linux Cluster Monitoring. Doing a C implementation saved them a whopping one second per day of processor time.
No, that was actually quite deliberate. When people say they can open and read a file in Perl or C with only one line, they haven't included any error handling, so I think it's only fair to do the same here.
Yes, moving parts can always kill a careless animal of course, but I think their point was that this is easier to spot and looks like a building, so it is less likely that a bird flies into it. Nice, but from what I have heard it is actually very rare that propeller wind turbines kill birds either.
Another obvious advantage of this design is that unlike a propeller, you don't have to turn them around when the direction of the wind changes...
A couple of years ago I talked with an engineer friend about this when we got on the subject of alternative energy. This isn't a new idea of course, variations have been used above chimneys for a long time for instance. He told me then about the large number of advantages to this design. I don't remember if I asked him the question that pops up in my head now - why did the propeller design become the norm?
Don't forget the transparency and maintainability you get from a "tight integration of web server, database, and application content", coupled with a high dependence on JavasScript magic for client views, server controller AND networking!
I feel bad bashing enthusiastic startups, but really, they need to come up with some better selling arguments than quick prototyping and eye candy. I am getting SOOO fed up with the Ajax and "Web 2.0" hype.
Before making assumptions that Sun are merely "chasing publicity" you could drop in and have a chat about the project. #opensolaris is reasonably active most of the time.
Yes, I was being sarcastic, perhaps I wasn't being clear enough... My point was that Sun actually contributes a lot to open source, GNOME and Mozilla projects for instance.
a hint that they may just be playing games and chasing publicity as usual rather than showing a serious commitment to f/oss.
Yes, giving us Open Office and paying many full time developers to work on it, and porting DTrace to BSD is obviously not a commitment. They ought to be ashamed of themselves!
What I don't understand is exactly what advantage is Java providing on the server-side. Do you really need cross-platform bytecode at that level?
Certainly. Being cross-platform is always a big plus, didn't you read the Slashdot article about the large British retail chain that switched over all their POS terminals to Linux? They could do that thanks to Java. Of course, it is not COMPLETE platform independence, you are of course tied to the Java platform. You gain hardware and OS independence though, good enough for most.
As a language Java is certainly not easier to use than the higher-level languages like PHP, Perl, Ruby, etc. It's very verbose and complicated (relatively speaking). I can understand using scripting languages, it's Java that doesn't make any sense.
I mean really, is it just because Java provides a lot of easy to use API's?
Speaking from my own experience, the number one advantage Java has is that it is maintainable. The strict typing and verbose exception handling is annoying if you just want to get something done quick. However, if you have a large team of programmers (of varying skill levels) and a large code base, you start to appreciate that the language tries to force good programming practice, and that a lot of bugs are caught not at runtime but at compile time (or even as you are typing if you use a tool like Eclipse). This is a lot more important than raw performance, since a lot more time is spent on maintaining a product than building it in the first place (90% is number often cited).
Someone on Slashdot in a post way back said it drove him mad in Java to always have to declare "what he was going to do" in advance, and what he wanted to do if something went wrong - "Now I am going to open a connection" "Now I'm opening a connection" "If error type one happens then..." "If error type two happens then..." and claimed that we don't do that in real life. Someone else pointed out a counter example - in the military and other large teams that does critical work they DO work like that. If a large ship is approaching a harbour, they don't just run in and hope nothing is in the way, they ask "Harbour, permission to dock?" "Deck team, all clear?" "Engine team, all clear?" "Ok, commencing docking..."
Of course, there is still a lot of garbage written in java, I just think it is somewhat simpler to spot in advance. I.e. someone is catching general Exceptions and ignoring them all over the place, is using a lot of static methods, etc...
What useful science has the "Earth Simulator" produced?
Yes, better climate models and weather forecasts are obviously not needed. A little rain never hurt anyone, as this years hurricane season clearly shows.
This latest news together with the recent "war against porn" makes me wonder if the US administration isn't running out of things to distract the publics attention with away from their failures.
Perhaps they might have a special dislike for The Onion too. Their headline the day after the 2000 election: "Bush - our long national nightmare of peace and prosperity is finally over!"
Well, your reaction is not very restrained either.
Hang on. Is it hyperbole day on Slashdot and no one told me? obBart: "This is the greatest injustice in the history of mankind!"
Re:Too bad the installation is failing for people.
on
Quake 4 Linux
·
· Score: 3, Interesting
SecureROM seems like an awesome product. The guys at Penny Arcade had been looking forward to F.E.A.R. for a long time, and last update said "Well, we would love to tell you if it is any good, but since it refuses to install... I guess we will just have to play something else". Some really great marketing there!
Violence, as the ultimate virus, might be seen as injecting plasmids into each sides cultural DNA.
Oh, so suddenly war has become an act of love? This must be one of the most repugnant apologies for violence I have heard since a guy tried to convince me war was good because it stimulated the economy.... Turned out he had confused an increase in industrial output as a country switches to a war economy, with economic growth.
In the second Matrix film, Trinity uses nmap to find a vulnerability in an old SSH version that she then exploits. Probably the first realistic hacking depiction in a major film. Fyodor said something along the lines of "It was so awesome, my jaw dropped when I saw it in the theaters. A sexy woman uses my program. I think that means we are married."
Java Web Start does a lot of what you want.... Platform independent, distributed, automatic updates without any extra work for the user OR the programmers. Limited to a specific programming platform though.:-)
Puzzle Pirates is a neat game that uses it. It was amusing to see how astonished a lot of posters on Slashdot were when it was announced that they were releasing a game simultaniously for PC, Mac, Linux, BSD... "How is it possible!?!"
I have some friends who are doing alright making Java games for mobile phones. As I mentioned in a previous post, since graphics on mobile phones and other limited devices are so cruddy development focus tends to be on addictive gameplay rather than eyecandy. It is possible to be a small independent game studio, since there are a lot of free tools for J2ME programming and the APIs are simple (what is difficult is making them run well on all different phone models). There is also no need for a big art studio to render orchestral music, hours of CGI, etc. At least not yet.
It seems most of the money in that market is not trying to sell your game through a portal (though if you get a really big hit you can rake in the cash), or even worse trying to sell it yourself, but to make ad games that companies can make available for free as part of a competition. I think there is a big potential market for really innovative and addictive mobile games, as at the moment a lot is just re-releases of games for old platforms, with slightly updated graphics.
Is it possible to run J2ME games in a PC using free software, proprietary software available at no charge, or proprietary software available for less than 100 USD for one seat?
Yes, just google for J2ME emulators, I think Sun even has one included when you download the J2ME development kit. I know for sure Sony Ericsson/Nokia/Motorola et al have emulators. You might have to register at their developer sites first, but it should be free if you are a student or doing non-commercial development. After all, they want developers to make software that works as good as possible for their own devices.
Does this Bluetooth thing work even with phones sold by prepaid service providers? Or does, for instance, Virgin lock its phones so that I can't just buy a Virgin phone and a Bluetooth adapter for my PC and transfer games that way?
I don't know how things work in the US, but I haven't heard of anyone locking Bluetooth file transfers on the phone, it would defeat the whole purpose of having Bluetooth. So you should be able to buy a simple Bluetooth USB dongle for your PC ($20) and then use a OBEX push program to transfer the game. The phone senses what the file is (game, image, mp3...) and where to put it, and will ask you if you want to accept it.
Over the air transmission though (OTA) is often locked to the service provider you got the SIM from.
I used Mandrake 10.1 when I was playing around and all drivers and programs were available as official packages on the CDs. No compiling or configuring needed after install to get Bluetooth working, everything worked like a charm.
Writing to file is usually not considered a usable form of interprocess communication. What you are looking for is probably Sockets, or even better Channels.
The neat thing about "die" in Perl is that it instantly converts into an exception just by wrapping the function call inside an "eval { }"
:-)
Ahh. Didn't know that. You are right, that is pretty nifty. Still prefer the Java way though.
The difference of course being that the C/C++ will still compile, and the Perl actually puts the error handler on the same line:
I wouldn't call instantly ending a program with an error message "handling" a problem. If you have no demands on program reliability, you can always throw a RuntimeException("No such file: + fileName") in Java too.
The only way to read the filechannel is a bytebuffer. Has anyone ever used them? I had to once and it sucked....
I've used them. What did you not like about them?
FileReader (or BufferedInputStream) are still awkward because tehy use byte and string arrays. Those really are hard to work with w/o doing conversions in java, where in C the char arrays are usfule w/o conversion.
Ok, there is also RandomAccessFile which gives you methods for reading all primitives, byte arrays, UTF-8 Strings, whole lines....
Used for instance here to do high performance Linux Cluster Monitoring. Doing a C implementation saved them a whopping one second per day of processor time.
You've forgotten the exception catcher.
No, that was actually quite deliberate. When people say they can open and read a file in Perl or C with only one line, they haven't included any error handling, so I think it's only fair to do the same here.
Java, in which everything is an object except for primitives and it takes ten classes and wrappers just to read a file,
Eh?
File inputFile = new File("temp.txt");
FileReader in = new FileReader(inputFile);
Or if you want to use the new IO library from 1.4 which gives you memory mapping and locking on sections of files,
FileChannel in = new FileInputStream("temp.txt").getChannel();
So if cook your chicken soup well, or roast correctly your roasted chicken, you're safe, at least from virii and bacteria.
And when the pandemic starts, remember to roast people thoroughly before talking to them and you will be safe!
Also - the word you are looking for is viruses. It has always been "viruses".
Yes, moving parts can always kill a careless animal of course, but I think their point was that this is easier to spot and looks like a building, so it is less likely that a bird flies into it. Nice, but from what I have heard it is actually very rare that propeller wind turbines kill birds either.
Another obvious advantage of this design is that unlike a propeller, you don't have to turn them around when the direction of the wind changes...
A couple of years ago I talked with an engineer friend about this when we got on the subject of alternative energy. This isn't a new idea of course, variations have been used above chimneys for a long time for instance. He told me then about the large number of advantages to this design. I don't remember if I asked him the question that pops up in my head now - why did the propeller design become the norm?
Don't forget the transparency and maintainability you get from a "tight integration of web server, database, and application content", coupled with a high dependence on JavasScript magic for client views, server controller AND networking!
I feel bad bashing enthusiastic startups, but really, they need to come up with some better selling arguments than quick prototyping and eye candy. I am getting SOOO fed up with the Ajax and "Web 2.0" hype.
>>You can almost sense his disgust when talking about the environmental standards the new system has to live up to:
>Really? I didn't get that at all. I thought he sounded proud of its environmental credentials.
Agreed. I think the GP is projecting his own opinions onto the engineer.
Before making assumptions that Sun are merely "chasing publicity" you could drop in and have a chat about the project. #opensolaris is reasonably active most of the time.
Yes, I was being sarcastic, perhaps I wasn't being clear enough... My point was that Sun actually contributes a lot to open source, GNOME and Mozilla projects for instance.
a hint that they may just be playing games and chasing publicity as usual rather than showing a serious commitment to f/oss.
Yes, giving us Open Office and paying many full time developers to work on it, and porting DTrace to BSD is obviously not a commitment. They ought to be ashamed of themselves!
What I don't understand is exactly what advantage is Java providing on the server-side. Do you really need cross-platform bytecode at that level?
Certainly. Being cross-platform is always a big plus, didn't you read the Slashdot article about the large British retail chain that switched over all their POS terminals to Linux? They could do that thanks to Java. Of course, it is not COMPLETE platform independence, you are of course tied to the Java platform. You gain hardware and OS independence though, good enough for most.
As a language Java is certainly not easier to use than the higher-level languages like PHP, Perl, Ruby, etc. It's very verbose and complicated (relatively speaking). I can understand using scripting languages, it's Java that doesn't make any sense.
I mean really, is it just because Java provides a lot of easy to use API's?
Speaking from my own experience, the number one advantage Java has is that it is maintainable. The strict typing and verbose exception handling is annoying if you just want to get something done quick. However, if you have a large team of programmers (of varying skill levels) and a large code base, you start to appreciate that the language tries to force good programming practice, and that a lot of bugs are caught not at runtime but at compile time (or even as you are typing if you use a tool like Eclipse). This is a lot more important than raw performance, since a lot more time is spent on maintaining a product than building it in the first place (90% is number often cited).
Someone on Slashdot in a post way back said it drove him mad in Java to always have to declare "what he was going to do" in advance, and what he wanted to do if something went wrong -
"Now I am going to open a connection"
"Now I'm opening a connection"
"If error type one happens then..."
"If error type two happens then..."
and claimed that we don't do that in real life. Someone else pointed out a counter example - in the military and other large teams that does critical work they DO work like that. If a large ship is approaching a harbour, they don't just run in and hope nothing is in the way,
they ask
"Harbour, permission to dock?"
"Deck team, all clear?"
"Engine team, all clear?"
"Ok, commencing docking..."
Of course, there is still a lot of garbage written in java, I just think it is somewhat simpler to spot in advance. I.e. someone is catching general Exceptions and ignoring them all over the place, is using a lot of static methods, etc...
What useful science has the "Earth Simulator" produced?
Yes, better climate models and weather forecasts are obviously not needed. A little rain never hurt anyone, as this years hurricane season clearly shows.
This latest news together with the recent "war against porn" makes me wonder if the US administration isn't running out of things to distract the publics attention with away from their failures.
Perhaps they might have a special dislike for The Onion too. Their headline the day after the 2000 election:
"Bush - our long national nightmare of peace and prosperity is finally over!"
Hyperbole day? That's the most ridiculous thing I've ever heard in my entire life!
Of course, on Slashdot, every day is hyperbole day!
Rancid tabloid hyperbole more like.
Well, your reaction is not very restrained either.
Hang on. Is it hyperbole day on Slashdot and no one told me? obBart: "This is the greatest injustice in the history of mankind!"
SecureROM seems like an awesome product. The guys at Penny Arcade had been looking forward to F.E.A.R. for a long time, and last update said "Well, we would love to tell you if it is any good, but since it refuses to install... I guess we will just have to play something else". Some really great marketing there!
Violence, as the ultimate virus, might be seen as injecting plasmids into each sides cultural DNA.
Oh, so suddenly war has become an act of love? This must be one of the most repugnant apologies for violence I have heard since a guy tried to convince me war was good because it stimulated the economy.... Turned out he had confused an increase in industrial output as a country switches to a war economy, with economic growth.
Thanks for the correct quote... I Googled awhile for it but was unable to find it.
In the second Matrix film, Trinity uses nmap to find a vulnerability in an old SSH version that she then exploits. Probably the first realistic hacking depiction in a major film. Fyodor said something along the lines of
"It was so awesome, my jaw dropped when I saw it in the theaters. A sexy woman uses my program. I think that means we are married."
Java Web Start does a lot of what you want.... Platform independent, distributed, automatic updates without any extra work for the user OR the programmers. Limited to a specific programming platform though. :-)
Puzzle Pirates is a neat game that uses it. It was amusing to see how astonished a lot of posters on Slashdot were when it was announced that they were releasing a game simultaniously for PC, Mac, Linux, BSD...
"How is it possible!?!"
I have some friends who are doing alright making Java games for mobile phones. As I mentioned in a previous post, since graphics on mobile phones and other limited devices are so cruddy development focus tends to be on addictive gameplay rather than eyecandy. It is possible to be a small independent game studio, since there are a lot of free tools for J2ME programming and the APIs are simple (what is difficult is making them run well on all different phone models). There is also no need for a big art studio to render orchestral music, hours of CGI, etc. At least not yet.
It seems most of the money in that market is not trying to sell your game through a portal (though if you get a really big hit you can rake in the cash), or even worse trying to sell it yourself, but to make ad games that companies can make available for free as part of a competition. I think there is a big potential market for really innovative and addictive mobile games, as at the moment a lot is just re-releases of games for old platforms, with slightly updated graphics.
A few links if you are interested in getting started on J2ME programming:
J2ME.org discussion board
J2ME Gamer
Midlet.org
Is it possible to run J2ME games in a PC using free software, proprietary software available at no charge, or proprietary software available for less than 100 USD for one seat?
Yes, just google for J2ME emulators, I think Sun even has one included when you download the J2ME development kit. I know for sure Sony Ericsson/Nokia/Motorola et al have emulators. You might have to register at their developer sites first, but it should be free if you are a student or doing non-commercial development. After all, they want developers to make software that works as good as possible for their own devices.
Mobile developer sites:
Sony Ericsson
Nokia
Samsung
Motorola
Some good intro sites:
J2ME Gamer
Midlet.org
Does this Bluetooth thing work even with phones sold by prepaid service providers? Or does, for instance, Virgin lock its phones so that I can't just buy a Virgin phone and a Bluetooth adapter for my PC and transfer games that way?
I don't know how things work in the US, but I haven't heard of anyone locking Bluetooth file transfers on the phone, it would defeat the whole purpose of having Bluetooth. So you should be able to buy a simple Bluetooth USB dongle for your PC ($20) and then use a OBEX push program to transfer the game. The phone senses what the file is (game, image, mp3...) and where to put it, and will ask you if you want to accept it.
Over the air transmission though (OTA) is often locked to the service provider you got the SIM from.
I used Mandrake 10.1 when I was playing around and all drivers and programs were available as official packages on the CDs. No compiling or configuring needed after install to get Bluetooth working, everything worked like a charm.