Well, yeah it is annoying to have to write if (x!=null) all the time. I guess there are ways you could fix it in an HLL. You could make the language not use references and make everything pass-by-value. A lot of languages do this, but it involves inefficiency and duplication. Unless you want to work at a really high level and don't care too much about efficiency, you have to be able to handle things by pointing to them. Even if you can't do pointer arithmetic, pointers are way more efficient than handling everything by value. Or, you could keep the references and avoid the exception throwing part, by taking the approach used with other primitives like int, float, etc. If you divide by zero in Java you don't get a "DivideByZeroException", you just get NaN. So null would become a sort of magic default object that takes the form of whatever reference type it's being handled as. (A null String would return null from substring() instead of throwing an exception, etc.) But that doesn't make much sense. Calling a void function on a null would have no symptoms at all. And it would duplicate the headaches with NaNs. If you divide x+y by x-y and add it to z, and x and y happen to be 0, z is set to NaN. If you add the NaN to something else, you get NaN. Soon the NaNs are spreading all over the place and you can't figure out where they came from! So that's a bad idea. The exception is better. Although it is running virtually, and is always hyped as being high level, Java isn't really a high level language. It's much higher up than C or C++, and if you listen to people who use those languages, you would think Java is like Tcl or Lisp. But it's designed for midlevel processing, where you aren't working on bare metal but speed and algorithmic efficiency are still concerns. So there will always be issues with pointers.
certain types of people rail on C and C++ for having pointers, and consequently being susceptible to null-pointer bugs, comparing at the wrong level of indirection, etc, and yet here is an equally subtle and unfortunate situation in Java, a language much hyped for its improved safety.
The stuff that happens when you dereference a null pointer in Java is nothing like what happens in C. If you think it's "equally subtle and unfortunate" you're crazy. The JVM instantiates a NullPointerException and propagates it up the call stack. You can catch it at any level and even use the exception for flow control purposes (although this only seems clever and really isn't a good idea for anything besides last minute emergency bug fixes). In C, dereferencing a bad pointer is like pissing on an electric fence. It's nondeterministic. You're not running bytecode- that's real machine code.
The issue with == and equals() just comes from unfamiliarity with the language. The == operator in Java compares pointer values. Once you learn how that works, the problem goes away.
Surely, though, it would be better for most applications if higher level languages prevented such things happening at compile-time, rather than leaving you to clean up the mess in debugging (assuming, of course, that you actually hit the code in question during your testing). Until then, threads like this will forever feature bugs that should never be able to happen...
It sounds like what you want is more checked exceptions. Java could easily have been made to be like this. They could have defined NullPointerException, ArrayIndexOutOfBoundsException, ClassCastException, etc. as being checked exceptions (which don't extend RuntimeException). So every single method call, field access, or array element expression would have to be wrapped in a try{...}and have a "catch (NullPointerException e) {...}" or "catch (ArrayIndexOutOfBoundsException e) {...}" block underneath, or else the compiler would complain. And you'd go nuts! You would swallow the exceptions the way people always swallow checked exceptions, just to make the compiler shut up. Then your program would silently fail and continue... then fall flat on its face some time later and you wouldn't know why. Checked exceptions are good in theory but they have problems that have a lot to do with psychology. Impatient people don't like to spend time writing error handling code. And it only takes one guy in a development team who swallows checked exceptions to make the whole idea useless. Microsoft decided to completely do away with checked exceptions in C#. You can compile anything without writing a single try/catch. That's actually probably going too far. Some checked exceptions are useful (SQLException, IOException, etc.) and force you to write error handling code you should really be writing. But Java really has too many of them. CloneNotSupportedException? Why am I forced to catch that one? That's ridiculous.
When will the American people wake up? It's so blatantly obvious to the rest of the world that your corporations are out of control. When are you going to finally realize it's time to put a leash on them?
We have more important things to worry about. The evil liberals took God out of the Pledge of Allegiance!!!
You have a monopoly in a given market. A company creates a groundbreaking product and establishes a new, completely different market. Assuming you cannot buy the company, how do you smash it and extend your monopoly in the old market to the new one?
How would you go about designing an email client that executes any code that is sent to it?
If you could remove any of the fifty states (thus rendering federal antitrust statutes inapplicable to corporations in that state) which state would you remove and why?
How would you go about designing an operating system for people who hate computers and who just want to use their machines for pay-per-view entertainment?
An End User License Agreement (EULA) appears in a window with "I Agree" and "I Disagree" buttons. The text area in which the EULA appears is eighty columns wide. How many lines of text can be included in the EULA before a computer that just meets your system requirements is unable to load it into memory?
At a fork in the road between two cities, you see 2 people. One always tells the truth, and comes from the city of safety. The other person always lies and comes from the city of cannibals, where they will eat you. Which one do you hire to write up licensing agreements for your legal department?
An Arab sheikh is old and must will his fortune to one of his two sons. He makes a proposition. His two sons will use their computers, and whichever computer gets a blue screen of death first will win the fortune for its owner. During the race, the two brothers do nothing on their computers, neither willing to risk a blue screen of death. In desperation, they ask a wise man for advice. He tells them something; then the brothers immediately jump onto the computers and start installing new hardware, sharing files, and downloading hastily written security updates. What did the wise man say?
What, so you can tell me what the electron's position and velocity are?
Actually this is a good illustration of why absolute zero is unattainable. But electrons are a bad example. It seems someone thinks electrons only move because of thermal motion.
Electrons are still moving quite fast at absolute zero. In fact, electron speed is not hugely affected by earthly temperatures. And as things heat up and the crystal gets hotter, thermal scattering starts interfering with electron mobility. They travel a shorter mean free path before bouncing off at some weird angle, so they don't get as far as they do at colder temperatures.
Nuclear motion does die down near 0 Kelvin, but actually reaching absolute zero would require a violation of the uncertainty principle as you suggest.
This is really old news. I first noticed this last year when my wife complained about it. (She used medieval in a sentence, and someone asked her what "mediereview" meant. Mediereview?) I mentioned it here once and people didn't even believe me.
Steps to reproduce:
1. Open a Yahoo mail account if you don't have one, and log on to it. 1a. Uncheck the checkboxes on the privacy policy page. 2. Click on "Compose", to compose a message. 3. Look for a link on the "compose" screen that says "Add Color and Graphics", and click on it. 4. Your screen should now have a link (in the same place) that says "Switch to Plain Version". You will also see a pretend MS-Word-type toolbar for bold, italic, background color, etc. 5. Type a one-line email to yourself (meaning send it to your same Yahoo account). Type in something with "medieval" and "expression", e.g.
Her expression was medieval
6. Go back to your inbox, and click on "Check Mail". 7. Read the email. The above sentence becomes
Her statement was medireview
8. Optionally, forward it from there to a real email account. The message will have no body, and it will come with an attachment. Open the attachment, and you will see it back in its original form:
Right to peaceably assemble? Erm, how about when the cops tell me and my buddies to "move along"? How exactly does that play?
I assume you haven't heard of the "First Amendment Zone". These are specially designated "free speech" areas that are placed at least several miles away from wherever anyone is looking during major political events (like Bush visiting a city).
You still have all your First Amendment rights, but only as long as you stay inside your "zone".
Actually that "train track near my backyard" line was meant as a joke. I don't have any kids or SUVs, I don't own any real estate, and I have never cried NIMBY for any reason.
My point was that a nuclear submarine wouldn't be subject to the same NIMBY political pressures as a nuclear train, since submarines can be placed further away from residences.
Actually- I believe I heard this idea floated during the power crisis here last summer- there were tentative plans to park a nuclear submarine in a harbor and run power cables from its reactor to help meet demand during peak hours. I think this is a much better idea than putting a nuclear reactor on a train, since we already have years of experience with nuclear reactors in submarines. Also, there is a train track near my backyard.
This however, oversteps their bounds. What are they doing telling a non-government related business how to advertise, or what to put on their website? Don't they have a certain aspect of freedom of speech when it comes to composing and editing their websites as they see fit?
This is a simple application of truth in advertising laws that have applied to other media like newspapers and TV for a long time. That's why drug companies have to ruin those pretty commercials with talk about all those nasty effects like diarrhea and vomiting. "And if your immune system is not normal due to advanced HIV infection, make sure your doctor knows to avoid a possible complication! Improvement was similar in patients that took a sugar pill." They try to distract you with high pressure flowers / colors / babies / fields / pretty people, but they have to say this stuff- it's the law. One type of ad that appears often in newspapers uses the format of a fake newspaper article- like "Amazing New Investment Makes Investors Rich". They try to make the fake article look as much as possible like the other, real articles. When they do this, they have to put the word "ADVERTISEMENT" in the corner, so you know it's an ad and not a real article. If you show a commercial with fat people turning into thin people, or poor people turning into rich people, you have to show "Results Not Typical" on screen. It's been that way for years without anyone making a stink about their First Amendment rights being violated. If you're going to advertise to me you'd better tell me what you're doing. You have the right to say anything you want but you have no right to deceive and there are laws in place to protect the public that prevent you from doing it.
Now, of course I'm against any corporation defrauding the public as to what they do or how they operate, but is saying that a link was paid for really fraud?
No, fraud is not saying that a link was paid for when it was.
Yeah, it sucks that they can lie to you, but anyone can lie to you, it's your responsibility to be paying attention, not the government's to make sure that lies don't happen.
Ha ha ha, yeah. "It sucks they can shoot you, but anyone can shoot you, it's your responsibility to be paying attention, not the government's to make sure that nobody gets shot." Uhh, I think it is the government's responsibility to regulate fraud. What are the responsibilities of government supposed to be, then? To maintain a standing army, and nothing else? You must be a troll. It fits with the big deal you make about being a Republican and how of course people are going to flame you for being a Republican.
Now I'm not insane, I'm glad that I'll know that a particular link was a paid advertisement, but do we have to go to the lengths of legislating such a thing? Cut the red tape already...
The FTC hasn't even said the sites broke the law. They're sending out a letter saying hey, point out your paid links, we don't think you should hide the fact that these are paid links if you are going to call yourself a "search engine", because that is not what a search engine does. The search engines show every indication that they will comply, and it looks like this story is over. The FTC did its job. The current no-bullshit standard for a "search engine" was preserved. The Internet's value as a public resource was conserved. And as even you yourself note, you're glad that you'll know if a particular link was a paid advertisement. So what is your problem? What is your point? Any regulation is evil?
If Microsoft built prison walls instead of computer software...
Re:Our leader gets it.
on
Baked Alaska
·
· Score: 1
Two different people. My dad studders, I don't. Does that make my dad an idiot, while I'm smarter by virtue only that I don't studder? Great argument. So people who studder have below average intelligence?
What does "studdering" have to do with it? Stuttering doesn't reflect on one's intelligence. But what W does isn't stuttering at all. Where in "Our priorities is our faith" or "Is our children learning?" do you hear a stutter?
He doesn't understand what he's saying. There is a difference.
Re:Our leader gets it.
on
Baked Alaska
·
· Score: 1
Guess what? You don't speak in complete sentences either. Also, all those "umms" and "aahs" aren't words. Do you still think that's a great measure of intelligence? Didn't think so.
Oh please. Everyone stammers when they talk a little, but this is ridiculous. And it's not like GWB exists in a vacuum. If you're suggesting that the average American President talked like W, you must be crazy. Do you remember his father sounding like this? Didn't think so.
Re:Our leader gets it.
on
Baked Alaska
·
· Score: 2
Bush realizes that it has nothing to do with human activity. Bush has a problem here of wanting to stick to the truth while ignorant people who are even dumber than him insist on greenhouse fairytales.
Pretty impressive realization, for a guy who can't speak in complete sentences. Maybe the brain cells in his head that normally help with grammar and keep singular/plural and past/present/future tense consistent are busy performing climate simulations instead.
What, no potshot against evolution?
on
Baked Alaska
·
· Score: 2
You say global warming is nonsense, but you fail to follow up with the standard non-sequitur about how evolution is "stupid". Maybe you forgot to use the "Preview" button. Please spend more time on Free Republic until you learn how to write posts that fall in lock-step properly.
We are having an effect on the climate, but its not quite as bad as you freak extreme-left alarmists would have us believe. (If you voted for Al Gore, you are a freak, end of story)
Leaving aside where you're getting your inside information on climate change, this is a pretty broad definition of "freak"- it includes the majority of the U.S. voting population.
From what I understand, Bioinformatics is basically "data mining of biotech databases" - more or less.
Not quite. That is a part of it, but there is more to it than that. For example, an experimental technique called microarray analysis was developed in 1998 for finding expression profiles for thousands of genes at once. Companies manufacture "chips" with thousands of spots on them, and each spot has a specific piece of probe DNA on it, chemically bound to the chip substrate. You take a biological sample with unknown mRNA, attach a dye to the mRNA, and expose the chip to your sample. The unknown dyed mRNA hybridizes only to the specific probe sequence that one spot on the chip has. You then rinse the chip, put it in a fluorescence scanner, and whammo, you know the intensity of mRNA concentration (i.e. the level of gene expression) in your sample for thousands of genes in the genome. Just doing this for one or two genes used to be a lot of work. Repeat this procedure with a bunch of chips (mitosis phase, day of treatment, patient, etc.) and you have an immense pile of expression profile data to sift through! But somewhere buried in there may be a good lead for a drug target that can be teased out with the right statistical algorithm. So a niche market exists for good gene expression analysis software, which is what my company makes. There exist only a few customers for software like this, but they're all biotech and pharmaceutical companies (and some universities) for whom the cost of the software is trivial. We have a large market share built up by word-of-mouth. So life is pretty good right now for us.
Bioinformatics doesn't automatically mean easy money. The field has already seen companies fail (e.g. DoubleTwist). And it seems like everyone and his brother is trying to form a dot-com style bioinformatics startup. I personally know two guys who are busy launching startups that are bound to fail. The time to start a bioinformatics startup was 1998-1999 during the dot-com boom. Now it's too late. Being in a trendy field won't save you if you have no product to sell.
I know there are a few books available on the subject (including one by Oreilly).
The O'Reilly book has some good information, but keep in mind it is mostly targeted toward the biotech researcher (the end-user) and not the programmer who is developing tools for biologists to use. It tells you how to use the software that's already out there. They have a Perl book out too, again targeted at biologists. There is a lot of string manipulation in bioinformatics. But there is also a lot of numerical analysis which is not exactly Perl's strong suit. In theory, a biologist who understands statistics well and knows how to do his own ANOVAs and clustering can probably do everything he needs to do with Perl and Excel. Thankfully for us, most of the people with expression data to analyze are not quite as industrious as that.:)
The main problems with "breaking into the scene" is most positions, when offered, require you to have some kind of science degree (biology related, generally) - even though it is just data-mining.
First of all, like I said, it usually isn't just blind data-mining, there is also some intense numerical analysis. Second, if they've got a clueless HR dept. who demands that programmers have some sort of bio degree, they're completely Dilberted and going under soon anyway so it's no big loss to you. A general biology background is easy to pick up. If you skim through a college-level textbook and learn how DNA/RNA works, what open reading frames, promoters, and introns are, you're basically all set as far as that stuff is concerned. You'll still need to learn about how to interact with the messy public databases out there (GenBank, Homologene, UniGene, LocusLink, Gene Ontology, etc.) that suffer from missing or incomplete data and/or non-unique identifers. You also have to cope with the lack of data format standardization in the industry and the proliferation of oddball formats to be parsed. Familiarity with all that stuff is much more important, and a biology degree doesn't help you much with it. And good programmers are way too rare for us to be picky about who's got a bio degree. Of the programmers here, not a single one is a biologist (actually, all the programmers here have physics and EE backgrounds). If you interview here we won't even talk to you about biology. We ask people simple programming questions, like how to raise two to a small integer power (to generate a bit mask, for example). You'd be amazed at how many people immediately convert the 2 to floating point and call pow().
Re the second amendment: I differ in opinion. What you've called a trade-off in human lives is more indicative, I think, of a recognition of the infeasibility of gun control with respect to limiting said gun-related deaths.
Yes, that's a valid argument. But it goes both ways. Ashcroft has been eviscerating the Fourth Amendment ostensibly to protect us against terrorism, but I don't feel any safer. In fact, I think this business of arresting anyone with a turban is more of a show for us to make us feel safer than any real strategy.
This is a complete and total non-sequiter. What does the rate of deaths by car accident have to do with anything???
First of all, it's non-sequitur, not "non-sequiter".
Second, you only think it's a straw man or a non-sequitur because you don't get his point. Let's put it this way. Something like 10,000 people die every year from gun-related deaths. We have not implemented gun control, because we have a Second Amendment. We have decided that 10,000 casualties per year is a price that we are willing to pay for the Second Amendment. Whatever your feelings about the Second Amendment are, you have to concede that the casualties we tolerate on its behalf are somewhat illustrative of the value we place on it.
Sept 11 comes, there is a terrorist attack that kills a mere 3000 people, and all of a sudden people are "forefeiting" their Fourth Amendment rights. Does this not concern you? The going rate for a constitutional right should be much higher than this. You can make an argument that possibly saving lives should be worth more than worrying about the civil rights of crazy Islamic black guys. But if you're going to view civil liberties via this public safety perspective, you should at least be consistent with it and favor gun control with as much enthusiasm. That would save way more lives, wouldn't it?
I haven't heard any sensible argument in favor of this guy's incarceration. They've all been variations of "oh so you would like a dirty bomb in your neighborhood then huh!" Which is like saying "Why are you defending whichcraft? Why are you in favor of witches?" to accusations of a witch hunt. We've got a guy who's in jail for wishing he could build a dirty bomb. He's doing time for surfing the web as far as I can tell. For typing "dirty bomb recipe" into Google and "researching" their construction. (1. Wrap deadly isotope around dynamite. 2. Light dynamite. 3. Run away.) Merely planning to do something is not a crime. You now live in a country where citizens are put in "indefinite detention" with no trial for a thought crime. This is a major milestone toward a police state. You should be alarmed that this is happening.
And it's not as if wanting to build a dirty bomb means you're going to do it. Does he have any radioactive material with which to make one? "Planning" to build a dirty bomb doesn't amount to a hell of a lot if you don't have any dirt. It's fairly obvious the only reason he's being held in military detention is because Ashcroft knows this crappy evidence would be laughed out of any legal court. They wouldn't even have enough for an indictment. And by arresting rather than monitoring and following this guy, they screwed up one of the only good leads they've gotten from their Camp X-Ray interrogations- which have otherwise been a complete fiasco. All they can do to cover their asses now is keep the guy in jail forever by inventing new laws for themselves as they go along.
that means what we are seeing of Palomar 5 actually took place around 75,000 years ago. I am no astronamer or astro physisist but is it possible that Palomar 5 is already gone.
The velocities of stars in the cluster are very low compared to c and they won't drift too far in the 75,000 years it takes light to get halfway across the galaxy to us. Now 75,000,000 years- that would be a long time. 75,000 years is practically the same as right now.
Of course those GoF patterns can make life hell for the maintenance developer or app framework user, when people turn it into a contest to see how many design patterns they can fit into a single project. The overall "Design Patterns" philosophy is really "how can I defer as many decisions as possible from compile time to run time?" This makes the code very flexible, but the flexibility is wasted when a consultant writes code using lots of patterns to puff up his ego and then leaves without leaving adequate comments or documentation. Without insight into how the system works, the configurability and flexibility that these patterns offer is lost. The system hardens into an opaque black box. Deferring decisions to runtime makes code hard to read. Inheritance trees can get fairly deep, work is delegated off in clever but unintuitive ways to weird generic objects, and finding the code you're looking for is impossible, because when you're looking for the place where stuff actually happens, you eventually come across a polymorphic wonder like
object.work();
and the trail ends there. Simply reading the code doesn't tell you what it does; the subtype of object isn't determined until runtime. You basically need a debugger.
You can take a really simple program and screw it up with aggressive elegance like this. Here is Hello World in Java: public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, world!");
} }
But this isn't elegant enough. What if we want to print some other string? Or what if we want to do something else with the string, like draw "Hello World" on a canvas in Times Roman? We'd have to recompile. By fanatically applying patterns, we can defer to runtime all the decisions that we don't want to make at runtime, and impress later consultants with all the patterns we managed to cram into our code:
public interface MessageStrategy {
public void sendMessage(); }
public abstract class AbstractStrategyFactory {
public abstract MessageStrategy createStrategy(MessageBody mb); }
public class MessageBody {
Object payload;
public Object getPayload() {
return payload;
}
public void configure(Object obj) {
payload = obj;
}
public void send(MessageStrategy ms) {
ms.sendMessage();
} }
public class DefaultFactory extends AbstractStrategyFactory {
private DefaultFactory() {;}
static DefaultFactory instance;
public static AbstractStrategyFactory getInstance() {
if (instance==null) instance = new DefaultFactory();
return instance;
}
public MessageStrategy createStrategy(final MessageBody mb) {
return new MessageStrategy() {
MessageBody body = mb;
public void sendMessage() {
Object obj = body.getPayload();
System.out.println((String)obj);
}
};
} }
public class HelloWorld {
public static void main(String[] args) {
MessageBody mb = new MessageBody();
mb.configure("Hello World!");
AbstractStrategyFactory asf = DefaultFactory.getInstance();
MessageStrategy strategy = asf.createStrategy(mb);
mb.send(strategy);
} }
Look at the clean separation of data and logic. By overapplying patterns, I can build my reputation as a fiendishly clever coder, and force clients to hire me back since nobody else knows what all this elegant crap does. Of course, if the specifications were to change, the HelloWorld class itself would require recompilation. But not if we are even more clever and use XML to get our data and to encode the actual implementation of what is to be done with it. XML may not always be a good idea for every project, but everyone agrees that it's definitely cool and and should be used wherever possible to create elegant configuration nightmares.
Seriously, why do they think that if they keep sending me five copys of the same email EVERYDAY, eventually I will answer?
If you didn't reply the first 100 times, maybe you'll reply on the 101st. Remember, a spammer might have paid good money ($0.000001) for your email address and when you don't reply he's forced to eat the loss, damn it. And when you're running a prestigious nonaccredited university, every microdollar counts. So it's quite cost effective to hammer you with the same spam using a hundred different subject lines because someday you might go crazy and decide you do need a larger penis (or that you have a penis to enlarge at all), which would give the poor guy a return on his investment.
Why 5 duplicates? Most of the real money in spam comes from selling your list of addresses, because that's the only thing a spammer has to sell. (It's the only thing he pays for besides the throwaway dialup accounts, cable modems, address harvesting software, and sex, and none of those has a comparable resale value.) A spammer typically runs around buying or stealing all the lists he can find from other spammers, so he can compile them into one big list and resell it to other spammers. He obviously can't be bothered to remove duplicates, because 1. that would require him to use his own computing resources, which is forbidden in the spam business, 2. the guy he bought his lists from didn't bother to remove the duplicates, so why should he remove them from the compiled list he's selling? and 3. when you remove duplicates the list gets shorter and commands a smaller price, so what's the motive in doing it anyway? To avoid pissing off the recipients? Ha, ha, ha, ha. A list of 1,000,000 email addresses in which each address is duplicated 5 times will sell just as easily as a list of 1,000,000 addresses with no duplicates. In fact the difference between "200,000 email addresses!" and "1,000,000 email addresses!" is usually four Control-Vs.
Or why would I answer if they use a completly misleading subject line so that it gets through my filters?
Why would you answer if they used a subject line that doesn't get through your filters?
You're assuming the Apollo Moon landings actually occurred. Please present your evidence that allows you to reach that conclusion.
1. No stars in the pictures. If the landings had been faked, they would have painted stars on the backdrop to make the moon hoax idiots happy. Everybody knows that when you take pictures in the daytime you don't see stars, even with no atmosphere, because of the shutter settings required to avoid overexposure.
2. The mirror left on the moon by the astronauts, which has been reflecting lasers from earth ever since.
3. The requirement of an elaborate conspiracy that all moon hoax theories require. Almost any theory can be made logically consistent if you can explain away all contrary evidence with an elaborate conspiracy.
4. To hold their theories together, the moon hoax people usually insist that all space travel is impossible, the Van Allen radiation belts will kill you, the shuttle orbits are faked as well, and that Christa McAuliffe was murdered because she found out the truth and wouldn't keep it a secret, etc.
5. The only major network to take the moon hoax idea seriously has been FOX, which aired a one-hour special on it hosted by Mitch Pileggi from the X-Files (!). Fair and balanced as usual, FOX presented a show that was dominated by moon hoax nutcases like Kaysing and that concluded that yes, the moon landings were faked.
To see a refutation of all the moon hoax conspiracy arguments see Bad Astronomy.
Well, yeah it is annoying to have to write if (x!=null) all the time. I guess there are ways you could fix it in an HLL. You could make the language not use references and make everything pass-by-value. A lot of languages do this, but it involves inefficiency and duplication. Unless you want to work at a really high level and don't care too much about efficiency, you have to be able to handle things by pointing to them. Even if you can't do pointer arithmetic, pointers are way more efficient than handling everything by value.
Or, you could keep the references and avoid the exception throwing part, by taking the approach used with other primitives like int, float, etc. If you divide by zero in Java you don't get a "DivideByZeroException", you just get NaN. So null would become a sort of magic default object that takes the form of whatever reference type it's being handled as. (A null String would return null from substring() instead of throwing an exception, etc.) But that doesn't make much sense. Calling a void function on a null would have no symptoms at all. And it would duplicate the headaches with NaNs. If you divide x+y by x-y and add it to z, and x and y happen to be 0, z is set to NaN. If you add the NaN to something else, you get NaN. Soon the NaNs are spreading all over the place and you can't figure out where they came from! So that's a bad idea. The exception is better.
Although it is running virtually, and is always hyped as being high level, Java isn't really a high level language. It's much higher up than C or C++, and if you listen to people who use those languages, you would think Java is like Tcl or Lisp. But it's designed for midlevel processing, where you aren't working on bare metal but speed and algorithmic efficiency are still concerns. So there will always be issues with pointers.
certain types of people rail on C and C++ for having pointers, and consequently being susceptible to null-pointer bugs, comparing at the wrong level of indirection, etc, and yet here is an equally subtle and unfortunate situation in Java, a language much hyped for its improved safety.
The stuff that happens when you dereference a null pointer in Java is nothing like what happens in C. If you think it's "equally subtle and unfortunate" you're crazy. The JVM instantiates a NullPointerException and propagates it up the call stack. You can catch it at any level and even use the exception for flow control purposes (although this only seems clever and really isn't a good idea for anything besides last minute emergency bug fixes). In C, dereferencing a bad pointer is like pissing on an electric fence. It's nondeterministic. You're not running bytecode- that's real machine code.
The issue with == and equals() just comes from unfamiliarity with the language. The == operator in Java compares pointer values. Once you learn how that works, the problem goes away.
Surely, though, it would be better for most applications if higher level languages prevented such things happening at compile-time, rather than leaving you to clean up the mess in debugging (assuming, of course, that you actually hit the code in question during your testing). Until then, threads like this will forever feature bugs that should never be able to happen...
It sounds like what you want is more checked exceptions. Java could easily have been made to be like this. They could have defined NullPointerException, ArrayIndexOutOfBoundsException, ClassCastException, etc. as being checked exceptions (which don't extend RuntimeException). So every single method call, field access, or array element expression would have to be wrapped in a try{...}and have a "catch (NullPointerException e) {...}" or "catch (ArrayIndexOutOfBoundsException e) {...}" block underneath, or else the compiler would complain. And you'd go nuts! You would swallow the exceptions the way people always swallow checked exceptions, just to make the compiler shut up. Then your program would silently fail and continue... then fall flat on its face some time later and you wouldn't know why.
Checked exceptions are good in theory but they have problems that have a lot to do with psychology. Impatient people don't like to spend time writing error handling code. And it only takes one guy in a development team who swallows checked exceptions to make the whole idea useless.
Microsoft decided to completely do away with checked exceptions in C#. You can compile anything without writing a single try/catch. That's actually probably going too far. Some checked exceptions are useful (SQLException, IOException, etc.) and force you to write error handling code you should really be writing. But Java really has too many of them. CloneNotSupportedException? Why am I forced to catch that one? That's ridiculous.
When will the American people wake up? It's so blatantly obvious to the rest of the world that your corporations are out of control. When are you going to finally realize it's time to put a leash on them?
We have more important things to worry about. The evil liberals took God out of the Pledge of Allegiance!!!
Guess I won't be interviewing candidates at Microsoft!
You have a monopoly in a given market. A company creates a groundbreaking product and establishes a new, completely different market. Assuming you cannot buy the company, how do you smash it and extend your monopoly in the old market to the new one?
How would you go about designing an email client that executes any code that is sent to it?
If you could remove any of the fifty states (thus rendering federal antitrust statutes inapplicable to corporations in that state) which state would you remove and why?
How would you go about designing an operating system for people who hate computers and who just want to use their machines for pay-per-view entertainment?
An End User License Agreement (EULA) appears in a window with "I Agree" and "I Disagree" buttons. The text area in which the EULA appears is eighty columns wide. How many lines of text can be included in the EULA before a computer that just meets your system requirements is unable to load it into memory?
At a fork in the road between two cities, you see 2 people. One always tells the truth, and comes from the city of safety. The other person always lies and comes from the city of cannibals, where they will eat you. Which one do you hire to write up licensing agreements for your legal department?
An Arab sheikh is old and must will his fortune to one of his two sons. He makes a proposition. His two sons will use their computers, and whichever computer gets a blue screen of death first will win the fortune for its owner. During the race, the two brothers do nothing on their computers, neither willing to risk a blue screen of death. In desperation, they ask a wise man for advice. He tells them something; then the brothers immediately jump onto the computers and start installing new hardware, sharing files, and downloading hastily written security updates. What did the wise man say?
the electrons are frozen and fixed.
What, so you can tell me what the electron's position and velocity are?
Actually this is a good illustration of why absolute zero is unattainable. But electrons are a bad example. It seems someone thinks electrons only move because of thermal motion.
Electrons are still moving quite fast at absolute zero. In fact, electron speed is not hugely affected by earthly temperatures. And as things heat up and the crystal gets hotter, thermal scattering starts interfering with electron mobility. They travel a shorter mean free path before bouncing off at some weird angle, so they don't get as far as they do at colder temperatures.
Nuclear motion does die down near 0 Kelvin, but actually reaching absolute zero would require a violation of the uncertainty principle as you suggest.
This is really old news. I first noticed this last year when my wife complained about it. (She used medieval in a sentence, and someone asked her what "mediereview" meant. Mediereview?) I mentioned it here once and people didn't even believe me.
Steps to reproduce:
1. Open a Yahoo mail account if you don't have one, and log on to it.
1a. Uncheck the checkboxes on the privacy policy page.
2. Click on "Compose", to compose a message.
3. Look for a link on the "compose" screen that says "Add Color and Graphics", and click on it.
4. Your screen should now have a link (in the same place) that says "Switch to Plain Version". You will also see a pretend MS-Word-type toolbar for bold, italic, background color, etc.
5. Type a one-line email to yourself (meaning send it to your same Yahoo account). Type in something with "medieval" and "expression", e.g.
Her expression was medieval
6. Go back to your inbox, and click on "Check Mail".
7. Read the email. The above sentence becomes
Her statement was medireview
8. Optionally, forward it from there to a real email account. The message will have no body, and it will come with an attachment. Open the attachment, and you will see it back in its original form:
Her expression was medieval
Right to peaceably assemble? Erm, how about when the cops tell me and my buddies to "move along"? How exactly does that play?
I assume you haven't heard of the "First Amendment Zone". These are specially designated "free speech" areas that are placed at least several miles away from wherever anyone is looking during major political events (like Bush visiting a city).
You still have all your First Amendment rights, but only as long as you stay inside your "zone".
Actually that "train track near my backyard" line was meant as a joke. I don't have any kids or SUVs, I don't own any real estate, and I have never cried NIMBY for any reason.
My point was that a nuclear submarine wouldn't be subject to the same NIMBY political pressures as a nuclear train, since submarines can be placed further away from residences.
Actually- I believe I heard this idea floated during the power crisis here last summer- there were tentative plans to park a nuclear submarine in a harbor and run power cables from its reactor to help meet demand during peak hours. I think this is a much better idea than putting a nuclear reactor on a train, since we already have years of experience with nuclear reactors in submarines. Also, there is a train track near my backyard.
Wrong- the human body has about 1/4 the salinity of seawater.
This however, oversteps their bounds. What are they doing telling a non-government related business how to advertise, or what to put on their website? Don't they have a certain aspect of freedom of speech when it comes to composing and editing their websites as they see fit?
This is a simple application of truth in advertising laws that have applied to other media like newspapers and TV for a long time. That's why drug companies have to ruin those pretty commercials with talk about all those nasty effects like diarrhea and vomiting. "And if your immune system is not normal due to advanced HIV infection, make sure your doctor knows to avoid a possible complication! Improvement was similar in patients that took a sugar pill." They try to distract you with high pressure flowers / colors / babies / fields / pretty people, but they have to say this stuff- it's the law. One type of ad that appears often in newspapers uses the format of a fake newspaper article- like "Amazing New Investment Makes Investors Rich". They try to make the fake article look as much as possible like the other, real articles. When they do this, they have to put the word "ADVERTISEMENT" in the corner, so you know it's an ad and not a real article. If you show a commercial with fat people turning into thin people, or poor people turning into rich people, you have to show "Results Not Typical" on screen. It's been that way for years without anyone making a stink about their First Amendment rights being violated. If you're going to advertise to me you'd better tell me what you're doing. You have the right to say anything you want but you have no right to deceive and there are laws in place to protect the public that prevent you from doing it.
Now, of course I'm against any corporation defrauding the public as to what they do or how they operate, but is saying that a link was paid for really fraud?
No, fraud is not saying that a link was paid for when it was.
Yeah, it sucks that they can lie to you, but anyone can lie to you, it's your responsibility to be paying attention, not the government's to make sure that lies don't happen.
Ha ha ha, yeah. "It sucks they can shoot you, but anyone can shoot you, it's your responsibility to be paying attention, not the government's to make sure that nobody gets shot." Uhh, I think it is the government's responsibility to regulate fraud. What are the responsibilities of government supposed to be, then? To maintain a standing army, and nothing else? You must be a troll. It fits with the big deal you make about being a Republican and how of course people are going to flame you for being a Republican.
Now I'm not insane, I'm glad that I'll know that a particular link was a paid advertisement, but do we have to go to the lengths of legislating such a thing? Cut the red tape already...
The FTC hasn't even said the sites broke the law. They're sending out a letter saying hey, point out your paid links, we don't think you should hide the fact that these are paid links if you are going to call yourself a "search engine", because that is not what a search engine does. The search engines show every indication that they will comply, and it looks like this story is over. The FTC did its job. The current no-bullshit standard for a "search engine" was preserved. The Internet's value as a public resource was conserved. And as even you yourself note, you're glad that you'll know if a particular link was a paid advertisement. So what is your problem? What is your point? Any regulation is evil?
If Microsoft built prison walls instead of computer software...
Two different people. My dad studders, I don't. Does that make my dad an idiot, while I'm smarter by virtue only that I don't studder? Great argument.
So people who studder have below average intelligence?
What does "studdering" have to do with it? Stuttering doesn't reflect on one's intelligence. But what W does isn't stuttering at all. Where in "Our priorities is our faith" or "Is our children learning?" do you hear a stutter?
He doesn't understand what he's saying. There is a difference.
Guess what? You don't speak in complete sentences either. Also, all those "umms" and "aahs" aren't words.
Do you still think that's a great measure of intelligence? Didn't think so.
Oh please. Everyone stammers when they talk a little, but this is ridiculous. And it's not like GWB exists in a vacuum. If you're suggesting that the average American President talked like W, you must be crazy. Do you remember his father sounding like this? Didn't think so.
Bush realizes that it has nothing to do with human activity. Bush has a problem here of wanting to stick to the truth while ignorant people who are even dumber than him insist on greenhouse fairytales.
Pretty impressive realization, for a guy who can't speak in complete sentences. Maybe the brain cells in his head that normally help with grammar and keep singular/plural and past/present/future tense consistent are busy performing climate simulations instead.
You say global warming is nonsense, but you fail to follow up with the standard non-sequitur about how evolution is "stupid". Maybe you forgot to use the "Preview" button. Please spend more time on Free Republic until you learn how to write posts that fall in lock-step properly.
We are having an effect on the climate, but its not quite as bad as you freak extreme-left alarmists would have us believe. (If you voted for Al Gore, you are a freak, end of story)
Leaving aside where you're getting your inside information on climate change, this is a pretty broad definition of "freak"- it includes the majority of the U.S. voting population.
From what I understand, Bioinformatics is basically "data mining of biotech databases" - more or less.
:)
Not quite. That is a part of it, but there is more to it than that. For example, an experimental technique called microarray analysis was developed in 1998 for finding expression profiles for thousands of genes at once. Companies manufacture "chips" with thousands of spots on them, and each spot has a specific piece of probe DNA on it, chemically bound to the chip substrate. You take a biological sample with unknown mRNA, attach a dye to the mRNA, and expose the chip to your sample. The unknown dyed mRNA hybridizes only to the specific probe sequence that one spot on the chip has. You then rinse the chip, put it in a fluorescence scanner, and whammo, you know the intensity of mRNA concentration (i.e. the level of gene expression) in your sample for thousands of genes in the genome. Just doing this for one or two genes used to be a lot of work. Repeat this procedure with a bunch of chips (mitosis phase, day of treatment, patient, etc.) and you have an immense pile of expression profile data to sift through! But somewhere buried in there may be a good lead for a drug target that can be teased out with the right statistical algorithm. So a niche market exists for good gene expression analysis software, which is what my company makes. There exist only a few customers for software like this, but they're all biotech and pharmaceutical companies (and some universities) for whom the cost of the software is trivial. We have a large market share built up by word-of-mouth. So life is pretty good right now for us.
Bioinformatics doesn't automatically mean easy money. The field has already seen companies fail (e.g. DoubleTwist). And it seems like everyone and his brother is trying to form a dot-com style bioinformatics startup. I personally know two guys who are busy launching startups that are bound to fail. The time to start a bioinformatics startup was 1998-1999 during the dot-com boom. Now it's too late. Being in a trendy field won't save you if you have no product to sell.
I know there are a few books available on the subject (including one by Oreilly).
The O'Reilly book has some good information, but keep in mind it is mostly targeted toward the biotech researcher (the end-user) and not the programmer who is developing tools for biologists to use. It tells you how to use the software that's already out there. They have a Perl book out too, again targeted at biologists. There is a lot of string manipulation in bioinformatics. But there is also a lot of numerical analysis which is not exactly Perl's strong suit. In theory, a biologist who understands statistics well and knows how to do his own ANOVAs and clustering can probably do everything he needs to do with Perl and Excel. Thankfully for us, most of the people with expression data to analyze are not quite as industrious as that.
The main problems with "breaking into the scene" is most positions, when offered, require you to have some kind of science degree (biology related, generally) - even though it is just data-mining.
First of all, like I said, it usually isn't just blind data-mining, there is also some intense numerical analysis. Second, if they've got a clueless HR dept. who demands that programmers have some sort of bio degree, they're completely Dilberted and going under soon anyway so it's no big loss to you. A general biology background is easy to pick up. If you skim through a college-level textbook and learn how DNA/RNA works, what open reading frames, promoters, and introns are, you're basically all set as far as that stuff is concerned. You'll still need to learn about how to interact with the messy public databases out there (GenBank, Homologene, UniGene, LocusLink, Gene Ontology, etc.) that suffer from missing or incomplete data and/or non-unique identifers. You also have to cope with the lack of data format standardization in the industry and the proliferation of oddball formats to be parsed. Familiarity with all that stuff is much more important, and a biology degree doesn't help you much with it. And good programmers are way too rare for us to be picky about who's got a bio degree. Of the programmers here, not a single one is a biologist (actually, all the programmers here have physics and EE backgrounds). If you interview here we won't even talk to you about biology. We ask people simple programming questions, like how to raise two to a small integer power (to generate a bit mask, for example). You'd be amazed at how many people immediately convert the 2 to floating point and call pow().
Re the second amendment: I differ in opinion. What you've called a trade-off in human lives is more indicative, I think, of a recognition of the infeasibility of gun control with respect to limiting said gun-related deaths.
Yes, that's a valid argument. But it goes both ways. Ashcroft has been eviscerating the Fourth Amendment ostensibly to protect us against terrorism, but I don't feel any safer. In fact, I think this business of arresting anyone with a turban is more of a show for us to make us feel safer than any real strategy.
This is a complete and total non-sequiter. What does the rate of deaths by car accident have to do with anything???
First of all, it's non-sequitur, not "non-sequiter".
Second, you only think it's a straw man or a non-sequitur because you don't get his point. Let's put it this way. Something like 10,000 people die every year from gun-related deaths. We have not implemented gun control, because we have a Second Amendment. We have decided that 10,000 casualties per year is a price that we are willing to pay for the Second Amendment. Whatever your feelings about the Second Amendment are, you have to concede that the casualties we tolerate on its behalf are somewhat illustrative of the value we place on it.
Sept 11 comes, there is a terrorist attack that kills a mere 3000 people, and all of a sudden people are "forefeiting" their Fourth Amendment rights. Does this not concern you? The going rate for a constitutional right should be much higher than this. You can make an argument that possibly saving lives should be worth more than worrying about the civil rights of crazy Islamic black guys. But if you're going to view civil liberties via this public safety perspective, you should at least be consistent with it and favor gun control with as much enthusiasm. That would save way more lives, wouldn't it?
I haven't heard any sensible argument in favor of this guy's incarceration. They've all been variations of "oh so you would like a dirty bomb in your neighborhood then huh!" Which is like saying "Why are you defending whichcraft? Why are you in favor of witches?" to accusations of a witch hunt. We've got a guy who's in jail for wishing he could build a dirty bomb. He's doing time for surfing the web as far as I can tell. For typing "dirty bomb recipe" into Google and "researching" their construction. (1. Wrap deadly isotope around dynamite. 2. Light dynamite. 3. Run away.) Merely planning to do something is not a crime. You now live in a country where citizens are put in "indefinite detention" with no trial for a thought crime. This is a major milestone toward a police state. You should be alarmed that this is happening.
And it's not as if wanting to build a dirty bomb means you're going to do it. Does he have any radioactive material with which to make one? "Planning" to build a dirty bomb doesn't amount to a hell of a lot if you don't have any dirt. It's fairly obvious the only reason he's being held in military detention is because Ashcroft knows this crappy evidence would be laughed out of any legal court. They wouldn't even have enough for an indictment. And by arresting rather than monitoring and following this guy, they screwed up one of the only good leads they've gotten from their Camp X-Ray interrogations- which have otherwise been a complete fiasco. All they can do to cover their asses now is keep the guy in jail forever by inventing new laws for themselves as they go along.
that means what we are seeing of Palomar 5 actually took place around 75,000 years ago. I am no astronamer or astro physisist but is it possible that Palomar 5 is already gone.
The velocities of stars in the cluster are very low compared to c and they won't drift too far in the 75,000 years it takes light to get halfway across the galaxy to us. Now 75,000,000 years- that would be a long time. 75,000 years is practically the same as right now.
Of course those GoF patterns can make life hell for the maintenance developer or app framework user, when people turn it into a contest to see how many design patterns they can fit into a single project. The overall "Design Patterns" philosophy is really "how can I defer as many decisions as possible from compile time to run time?" This makes the code very flexible, but the flexibility is wasted when a consultant writes code using lots of patterns to puff up his ego and then leaves without leaving adequate comments or documentation. Without insight into how the system works, the configurability and flexibility that these patterns offer is lost. The system hardens into an opaque black box.
Deferring decisions to runtime makes code hard to read. Inheritance trees can get fairly deep, work is delegated off in clever but unintuitive ways to weird generic objects, and finding the code you're looking for is impossible, because when you're looking for the place where stuff actually happens, you eventually come across a polymorphic wonder like
object.work();
and the trail ends there. Simply reading the code doesn't tell you what it does; the subtype of object isn't determined until runtime. You basically need a debugger.
You can take a really simple program and screw it up with aggressive elegance like this. Here is Hello World in Java:
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, world!");
}
}
But this isn't elegant enough. What if we want to print some other string? Or what if we want to do something else with the string, like draw "Hello World" on a canvas in Times Roman? We'd have to recompile. By fanatically applying patterns, we can defer to runtime all the decisions that we don't want to make at runtime, and impress later consultants with all the patterns we managed to cram into our code:
public interface MessageStrategy {
public void sendMessage();
}
public abstract class AbstractStrategyFactory {
public abstract MessageStrategy createStrategy(MessageBody mb);
}
public class MessageBody {
Object payload;
public Object getPayload() {
return payload;
}
public void configure(Object obj) {
payload = obj;
}
public void send(MessageStrategy ms) {
ms.sendMessage();
}
}
public class DefaultFactory extends AbstractStrategyFactory {
private DefaultFactory() {;}
static DefaultFactory instance;
public static AbstractStrategyFactory getInstance() {
if (instance==null) instance = new DefaultFactory();
return instance;
}
public MessageStrategy createStrategy(final MessageBody mb) {
return new MessageStrategy() {
MessageBody body = mb;
public void sendMessage() {
Object obj = body.getPayload();
System.out.println((String)obj);
}
};
}
}
public class HelloWorld {
public static void main(String[] args) {
MessageBody mb = new MessageBody();
mb.configure("Hello World!");
AbstractStrategyFactory asf = DefaultFactory.getInstance();
MessageStrategy strategy = asf.createStrategy(mb);
mb.send(strategy);
}
}
Look at the clean separation of data and logic. By overapplying patterns, I can build my reputation as a fiendishly clever coder, and force clients to hire me back since nobody else knows what all this elegant crap does. Of course, if the specifications were to change, the HelloWorld class itself would require recompilation. But not if we are even more clever and use XML to get our data and to encode the actual implementation of what is to be done with it. XML may not always be a good idea for every project, but everyone agrees that it's definitely cool and and should be used wherever possible to create elegant configuration nightmares.
Seriously, why do they think that if they keep sending me five copys of the same email EVERYDAY, eventually I will answer?
If you didn't reply the first 100 times, maybe you'll reply on the 101st. Remember, a spammer might have paid good money ($0.000001) for your email address and when you don't reply he's forced to eat the loss, damn it. And when you're running a prestigious nonaccredited university, every microdollar counts. So it's quite cost effective to hammer you with the same spam using a hundred different subject lines because someday you might go crazy and decide you do need a larger penis (or that you have a penis to enlarge at all), which would give the poor guy a return on his investment.
Why 5 duplicates? Most of the real money in spam comes from selling your list of addresses, because that's the only thing a spammer has to sell. (It's the only thing he pays for besides the throwaway dialup accounts, cable modems, address harvesting software, and sex, and none of those has a comparable resale value.) A spammer typically runs around buying or stealing all the lists he can find from other spammers, so he can compile them into one big list and resell it to other spammers. He obviously can't be bothered to remove duplicates, because 1. that would require him to use his own computing resources, which is forbidden in the spam business, 2. the guy he bought his lists from didn't bother to remove the duplicates, so why should he remove them from the compiled list he's selling? and 3. when you remove duplicates the list gets shorter and commands a smaller price, so what's the motive in doing it anyway? To avoid pissing off the recipients? Ha, ha, ha, ha. A list of 1,000,000 email addresses in which each address is duplicated 5 times will sell just as easily as a list of 1,000,000 addresses with no duplicates. In fact the difference between "200,000 email addresses!" and "1,000,000 email addresses!" is usually four Control-Vs.
Or why would I answer if they use a completly misleading subject line so that it gets through my filters?
Why would you answer if they used a subject line that doesn't get through your filters?
Catcher in the Rye was written by J.D. Salinger, douchebag.
Did I imply somewhere that Catcher in the Rye was written by Hunter S. Thompson?
You're assuming the Apollo Moon landings actually occurred. Please present your evidence that allows you to reach that conclusion.
1. No stars in the pictures. If the landings had been faked, they would have painted stars on the backdrop to make the moon hoax idiots happy. Everybody knows that when you take pictures in the daytime you don't see stars, even with no atmosphere, because of the shutter settings required to avoid overexposure.
2. The mirror left on the moon by the astronauts, which has been reflecting lasers from earth ever since.
3. The requirement of an elaborate conspiracy that all moon hoax theories require. Almost any theory can be made logically consistent if you can explain away all contrary evidence with an elaborate conspiracy.
4. To hold their theories together, the moon hoax people usually insist that all space travel is impossible, the Van Allen radiation belts will kill you, the shuttle orbits are faked as well, and that Christa McAuliffe was murdered because she found out the truth and wouldn't keep it a secret, etc.
5. The only major network to take the moon hoax idea seriously has been FOX, which aired a one-hour special on it hosted by Mitch Pileggi from the X-Files (!). Fair and balanced as usual, FOX presented a show that was dominated by moon hoax nutcases like Kaysing and that concluded that yes, the moon landings were faked.
To see a refutation of all the moon hoax conspiracy arguments see Bad Astronomy.