I must say this video is hilarious -- please put it at the start of every DVD (unskippable of course) and make it a part of every game's intro. Piracy will surely decline to 0 in no time.
In Java, it's the same thing. Just make sure that you have no non-constant static members of your classes. That's it. That's all you need to do for your code to be thread-compatible. As a side-effect, you'll have much less bugs and strange interactions in your code.
I beg your pardon? You really believe that if you have no static members in your class that it is thread-safe?
Let's take a very simple class, which keeps track of an X/Y location. It has only two private fields, an int x, and int y. There's a method like this:
public void setLocation(int x, int y) { this.x = x;// point A this.y = y; }
and another method that returns the coordinate:
public Location getLocation() { return new Location(x, y); }
What do you think will happen when Thread 1 calls the setLocation method, is interrupted at Point A then a Thread 2 starts to run and calls the getLocation method on the same object? You'll get a Location object with the new x location, but still using the old y location.
The correct code would involve either externally synchronizing the Location object or by adding a synchronized block on this object around the setLocation code.
Another solution would be to make your class Immutable (by making all fields final). The setLocation method would return a new Location object with the new Location, but would not alter the current Location object. Any other methods that do modifications will return a new Object as well. See the BigDecimal class for how this works; it is Immutable.
I would suggest going with the Immutable pattern, unless the overhead of creating a new Object of the same type for each modification is too great. Otherwise use synchronized blocks. Using synchronization is a bit more tricky to get right however.
I just noticed my Philips monitor has the 2nd icon (circle with a line inside it) above the power button. It's a power button though, as it doesn't go stand-by or anything (there's no other way to activate the monitor except pressing the button again). The button is also a fairly heavy robust type.. no clicky dip switch or anything.
Actually, bandwidth just keeps increasing. It seems reasonable to assume that in the near future we could have gigabit lines in every home (they've already started the roll out of 10mbit+ connections here). It does not seem as likely that the bandwidth needs of video/audio will go up anytime soon (especially not audio).
So basically it won't be long before we'll have more bandwidth than we know what to do with... then you install Freenet (or some other P2P app that does its own routing).
Ah, I found a way around that. Everything on my linux machines of value is heavily encrypted. It uses a password of 30 characters for this encryption. The password is unknown to me, but I can find it by opening my computer case and reading it on a set of 30 dice I have stored inside it.
The idea is that if you turn the machine off, and move it (and you're not VERY careful moving it), the dice will fall and the password will be lost forever. That oughta show Big Brother when they try take my stuff by force!
There are definitely some good sources. One thing to keep in mind is that you should only try downloading stuff that is out on DVD. Before that you are far more likely to get fakes or bad camera rips -- I just save myself the trouble, since there's plenty out there on DVD -- if desperate I just visit the cinema (and laugh at the warnings to not bring camera's...).
Downloading isn't hard either. Either use Google to find some torrents (I'm sure you'll find tons of sites) or use EMule. All of 5 minutes of work to get a few movies, and a few days of waiting (or just a few hours sometimes with BitTorrent).
I said, if the software is really WORTH using, then someone will write a different/better version. If it is not, well, who cares. Just look at the tons of BitTorrent clients, who is paying their bills?
Plus depending on your internet connection speed and the server's download speed, it could take a lot of time or effort to download the movie.
What does it matter how long it takes? My ISP connection is 24/7. With that I can download close to 200-300 GB a month... that's around 200-300 movies.
I've had to cut back on downloading, simply because I donot have the storage capacity or even the time to watch what I download. Simply plan ahead.
...and there will a thousands others writing the same software and making it available for free with source IF your product is innovative enough that others will want it.
Abolishing Copyright will do more good than bad. The GPL will simply no longer be needed.
Yes, of course it is the US that is to blame. The movies are created there, why would Finnish people even care about lost profits in the US unless there was somekind of external pressure?
In the long term (hopefully 100 years) we should be able to duplicate physical objects as easy as operating a the average microwave oven.
Then the manufacturing industry will face the same problem as the software/music/movie industries have now. However, given that such devices could almost completely eliminate world hunger and poverty it will be accepted. At that point we will realize how ridiculous copyrighting certain bit patterns really is.
"Anyone who uses BitTorrent and is under the illusion that they are anonymous are sorely mistaken," Malcolm said. "There is no reason why those lawsuits wouldn't include BitTorrent" users.
Actually, there is a reason why the lawsuits wouldn't include BitTorrent users. It is much harder to sue BitTorrent users for multiple infringements at once, which (I think) is what makes the current lawsuit approach cost effective.
When you find a BitTorrent user participating in a big swarm, you can only sue them for that single infringement, not for sharing hundreds of movies or music files via programs like Kazaa. In order to make it cost effective they would have to keep track of your online BitTorrent activity for quite a while to collect multiple infringements.
Looks like you didn't quite get it installed properly. I'm running software RAID5 with 6 drives on a Linux 2.6.7 kernel (have been for over 6 months, migrated kernels several times now). None of the data is damaged, not even during a rebuild of the array when I had to replace a drive.
That's ridiculous. The only advantage a hardware controller offers is reduced PCI bus and CPU usage. If you however have a dedicated server, that doesn't have anything else to do, software raid is perfectly acceptable and can easily perform as well as hardware raid.
I run a 6 drive software raid, and put encryption on top of it, and I STILL get 10-15 MB/sec performance... plenty to feed a 100 mbit HOME network.
I have the above setup running on my home linux system, a 2.4 GHz P4. The performance is around 10-15 MB/sec reading and writing. The CPU is the bottleneck because of the 256 bit blowfish encryption I use. It is however not relevant as the server is only equipped with a 100 mbit network card.
The most important thing when setting up such a server is to have sufficient cooling. I have 7 drives mounted in this server, and apart from the PSU fan I installed one extra fan. I used a midi tower case, with 4 drives installed in the top 3 5,25" slots, and 3 more (with atleast 0.5" space between them) in the 3.5" bays below. I left the top 5.25" slot and the floppy drive slot open for better ventilation (I removed the CD-ROM and floppy drive as they're not needed).
Cooling is very important, without keeping some of the slots open, temperature of the top drives could easily go above 55C, which is the max operating temp of the drives I use. Operating them above this will significantly reduce their life span. With the slots open I can keep them all below 40C.
Temperature is easily monitored with SmartMonTools. This package can also be used to run regular self tests of your drives, which will help detecting drives that are about to fail (happened to me once already and as it was within warranty I got a free replacement). I didn't lose any data because the drive was only about to fail, but hadn't failed yet when the replacement arrived. After replacing the drive, the raid array automatically reconstructed the drive I took out, working just as expected.
Re:Java 1.5 vs c# 2.0?
on
Java 1.5 vs C#
·
· Score: 4, Insightful
C's implementation of abstracting machine code is just a compiler hack, the underlying machine code has not changed. The only benefits are some compiler errors and warnings and not performance and storage efficiency that real machine code can offer.
Seriously, I couldn't care less about better performance. I care about being able to avoid probably 75% of all casting that goes on in our 10.000+ source file project and being able to specify our API even tighter and catch more problems before it hits our customers.
I just wish Sun had done this 3 years ago, but better late than never.
Re:I code C# for a living
on
Java 1.5 vs C#
·
· Score: 5, Informative
Seriously, I tried most of the IDE's you mentioned and then some, but Eclipse just blows them all away. The fact that it builds a complete syntax tree of your project which can basically be queried in any way you see fit makes refactoring so easy.
It can rename method calls for an entire project, add new parameters, reorder parameters, change return code, display what methods call what method in tree form (especially if you suspect the code is dead), displays lots of very useful compiler warnings (unused parameters, variables, methods, unneeded casts, often surprising how many you can find of those in non-Eclipse projects and the possible subtle bugs they introduce).
That's just scratching the surface really... it's very evident that Eclipse was written by programmers for programmers, and even after using it for more than a year it still manages to surprise me:)
Sound is simply not that interesting. I have 2 speakers of medium quality (not PC speakers, real speakers hooked up to an amp), and an onboard soundcard does just fine with those.
For some tracks I can hear the difference between 192kbit and 256kbit mp3's so I'm not quite tone deaf, yet I feel absolutely no urge at all to shell out $$ for a 5.1 soundsystem with 15 speakers all around my PC setup.
For a more immersive experience, good quality head phones will do just fine with medium quality sound hardware, especially if all you need sound for is playing AVI's, MP3's or playing the occasional action game.
I for one was glad when they finally started putting audio as standard on mainboards.
I own about 2 Terabyte of space as an individual. Surely it wouldn't be too hard for a company to invest in a few Terabytes to store this data.
Simple 300 GB IDE drives are fast, cheaper than tape storage, last longer than a DVD+R when stored and are still easy to access (use either SATA drives or fit a USB adapter box around the drives).
Another option would be to store the data using a lossless codec (they exist).
Re:Framerate (Re:Dumb terminals? Cluster computing
on
Ethernet at 10 Gbps
·
· Score: 1
A cinema movie is 24 fps, and it generally looks smooth because it has motion blurring. Freezing a frame will show you that it isn't a perfect sharp picture but the moving parts are actually blurry, which helps give the impression of smooth movement (but only when played at the recorded rate of 24 fps).
If you however render perfect pictures (like your desktop does, but also games depicting a 3d world), then you need to go up to 70 Hz or more to make the animation look perfectly smooth.
On your desktop this is especially easy to see when dragging windows or moving your mouse pointer; if you ever thought your mouse seemed to stutter a bit instead of appearing perfectly smooth, then that's because in early windows versions your mouse update rate was fixed at 30 Hz. In newer versions you can actually change how often it is updated, making it appear smoother.
In games (and some movies) it is also easier to see stuttering when the camera moves from side to side or up and down (try strafing in a 3d game which is running at say 40-50 fps, and you'll notice it stutters, even though you would never notice it when you simply run forward).
Our eyes can easily see stuff up to 100-200 Hz, depending on how it is displayed. For example, the human eye can easily see a bright white flash lasting only 1/200th of second in an otherwise dark room...
I wonder how well RFID scanning will work when I start collecting them and carrying around with me... is it even possible to read hundreds of them at once and find the one that indicates my license plate number?
Re:Caps Lock? Who cares about Caps Lock?
on
Is Caps Lock Dead?
·
· Score: 1
Scroll Lock prevents my mouse from going off the screen when using Synergy:)
I must say this video is hilarious -- please put it at the start of every DVD (unskippable of course) and make it a part of every game's intro. Piracy will surely decline to 0 in no time.
Let's take a very simple class, which keeps track of an X/Y location. It has only two private fields, an int x, and int y. There's a method like this:
and another method that returns the coordinate:What do you think will happen when Thread 1 calls the setLocation method, is interrupted at Point A then a Thread 2 starts to run and calls the getLocation method on the same object? You'll get a Location object with the new x location, but still using the old y location.The correct code would involve either externally synchronizing the Location object or by adding a synchronized block on this object around the setLocation code.
Another solution would be to make your class Immutable (by making all fields final). The setLocation method would return a new Location object with the new Location, but would not alter the current Location object. Any other methods that do modifications will return a new Object as well. See the BigDecimal class for how this works; it is Immutable.
I would suggest going with the Immutable pattern, unless the overhead of creating a new Object of the same type for each modification is too great. Otherwise use synchronized blocks. Using synchronization is a bit more tricky to get right however.
If you need that long, your music is probably crap :-)
I just noticed my Philips monitor has the 2nd icon (circle with a line inside it) above the power button. It's a power button though, as it doesn't go stand-by or anything (there's no other way to activate the monitor except pressing the button again). The button is also a fairly heavy robust type.. no clicky dip switch or anything.
What if she was doing the exact same thing? ie, not participating in the transfer, just gathering statistics...
So basically it won't be long before we'll have more bandwidth than we know what to do with... then you install Freenet (or some other P2P app that does its own routing).
The idea is that if you turn the machine off, and move it (and you're not VERY careful moving it), the dice will fall and the password will be lost forever. That oughta show Big Brother when they try take my stuff by force!
Downloading isn't hard either. Either use Google to find some torrents (I'm sure you'll find tons of sites) or use EMule. All of 5 minutes of work to get a few movies, and a few days of waiting (or just a few hours sometimes with BitTorrent).
I said, if the software is really WORTH using, then someone will write a different/better version. If it is not, well, who cares. Just look at the tons of BitTorrent clients, who is paying their bills?
I've had to cut back on downloading, simply because I donot have the storage capacity or even the time to watch what I download. Simply plan ahead.
Abolishing Copyright will do more good than bad. The GPL will simply no longer be needed.
Yes, of course it is the US that is to blame. The movies are created there, why would Finnish people even care about lost profits in the US unless there was somekind of external pressure?
Then the manufacturing industry will face the same problem as the software/music/movie industries have now. However, given that such devices could almost completely eliminate world hunger and poverty it will be accepted. At that point we will realize how ridiculous copyrighting certain bit patterns really is.
Unless of course the tracker is running PeerGuardian...
When you find a BitTorrent user participating in a big swarm, you can only sue them for that single infringement, not for sharing hundreds of movies or music files via programs like Kazaa. In order to make it cost effective they would have to keep track of your online BitTorrent activity for quite a while to collect multiple infringements.
Looks like you didn't quite get it installed properly. I'm running software RAID5 with 6 drives on a Linux 2.6.7 kernel (have been for over 6 months, migrated kernels several times now). None of the data is damaged, not even during a rebuild of the array when I had to replace a drive.
I run a 6 drive software raid, and put encryption on top of it, and I STILL get 10-15 MB/sec performance... plenty to feed a 100 mbit HOME network.
The most important thing when setting up such a server is to have sufficient cooling. I have 7 drives mounted in this server, and apart from the PSU fan I installed one extra fan. I used a midi tower case, with 4 drives installed in the top 3 5,25" slots, and 3 more (with atleast 0.5" space between them) in the 3.5" bays below. I left the top 5.25" slot and the floppy drive slot open for better ventilation (I removed the CD-ROM and floppy drive as they're not needed).
Cooling is very important, without keeping some of the slots open, temperature of the top drives could easily go above 55C, which is the max operating temp of the drives I use. Operating them above this will significantly reduce their life span. With the slots open I can keep them all below 40C.
Temperature is easily monitored with SmartMonTools. This package can also be used to run regular self tests of your drives, which will help detecting drives that are about to fail (happened to me once already and as it was within warranty I got a free replacement). I didn't lose any data because the drive was only about to fail, but hadn't failed yet when the replacement arrived. After replacing the drive, the raid array automatically reconstructed the drive I took out, working just as expected.
Seriously, I couldn't care less about better performance. I care about being able to avoid probably 75% of all casting that goes on in our 10.000+ source file project and being able to specify our API even tighter and catch more problems before it hits our customers.
I just wish Sun had done this 3 years ago, but better late than never.
Seriously, I tried most of the IDE's you mentioned and then some, but Eclipse just blows them all away. The fact that it builds a complete syntax tree of your project which can basically be queried in any way you see fit makes refactoring so easy. It can rename method calls for an entire project, add new parameters, reorder parameters, change return code, display what methods call what method in tree form (especially if you suspect the code is dead), displays lots of very useful compiler warnings (unused parameters, variables, methods, unneeded casts, often surprising how many you can find of those in non-Eclipse projects and the possible subtle bugs they introduce). That's just scratching the surface really... it's very evident that Eclipse was written by programmers for programmers, and even after using it for more than a year it still manages to surprise me :)
For some tracks I can hear the difference between 192kbit and 256kbit mp3's so I'm not quite tone deaf, yet I feel absolutely no urge at all to shell out $$ for a 5.1 soundsystem with 15 speakers all around my PC setup.
For a more immersive experience, good quality head phones will do just fine with medium quality sound hardware, especially if all you need sound for is playing AVI's, MP3's or playing the occasional action game.
I for one was glad when they finally started putting audio as standard on mainboards.
Simple 300 GB IDE drives are fast, cheaper than tape storage, last longer than a DVD+R when stored and are still easy to access (use either SATA drives or fit a USB adapter box around the drives).
Another option would be to store the data using a lossless codec (they exist).
If you however render perfect pictures (like your desktop does, but also games depicting a 3d world), then you need to go up to 70 Hz or more to make the animation look perfectly smooth.
On your desktop this is especially easy to see when dragging windows or moving your mouse pointer; if you ever thought your mouse seemed to stutter a bit instead of appearing perfectly smooth, then that's because in early windows versions your mouse update rate was fixed at 30 Hz. In newer versions you can actually change how often it is updated, making it appear smoother.
In games (and some movies) it is also easier to see stuttering when the camera moves from side to side or up and down (try strafing in a 3d game which is running at say 40-50 fps, and you'll notice it stutters, even though you would never notice it when you simply run forward).
Our eyes can easily see stuff up to 100-200 Hz, depending on how it is displayed. For example, the human eye can easily see a bright white flash lasting only 1/200th of second in an otherwise dark room...
I wonder how well RFID scanning will work when I start collecting them and carrying around with me... is it even possible to read hundreds of them at once and find the one that indicates my license plate number?
Scroll Lock prevents my mouse from going off the screen when using Synergy :)