2,077 karma · joined October 28, 2012
> If it takes more than 10 minutes it can't be done
is a little harsh, but sometimes you just want to get something done in 10 minutes.
By far the biggest misconception about GPS is that the GPS satellites somehow know where you are, or that your device transmits something to the satellite. I don't think this article does a good job of making that clear. It's kind of pandering to the paranoid. Granted, if you have a phone with a GPS receiver, it's totally possible/probable that your location is being reported through some other means (like the cell network).
I also use AWS for some personal hosting.
func 5, {
event: -> 45,
val: 10}
Is reasonable but func 5, {
event: (e) ->
if e.something
36
else
45,
val: 10}
Really ought to be split up for readability no matter what programming language you use. And besides, the only issue is the extra comma causes it not to compile.To be fair, the `->` vs `=>` (which `this` is `this`?) for class members is confusing. I'd almost prefer class members didn't give you the option and defaulted to `=>`.
The "variable capture" section is overblown, though. You're a lot less likely to run into this issue than the classic JavaScript "I forgot `var` and now my variable is global.
My biggest complaint is actually the implicit returns. Sometimes I forget a return statement but it works anyway because of this feature. Then I come back later and modify the function slightly only to spend a bunch of time figuring out why it's returning `undefined`.
And experimental fusion-power plant or two will already exist in 2014. (Even today, a small but genuine fusion explosion is demonstrated at frequent intervals in the G.E. exhibit at the 1964 fair.) Large solar-power stations will also be in operation in a number of desert and semi-desert areas -- Arizona, the Negev, Kazakhstan. In the more crowded, but cloudy and smoggy areas, solar power will be less practical. An exhibit at the 2014 fair will show models of power stations in space, collecting sunlight by means of huge parabolic focusing devices and radiating the energy thus collected down to earth.
Especially considering how people always get a little overexcited about how close we are to nuclear fusion.
http://www.jpl.nasa.gov/news/news.php?release=2013-325
The software reset and booted back into the older version. There are some really good safeguards against bricking anything, but it's still scary. Especially with the data latencies involved - in this case the team had several hours between knowing "something's wrong" and getting more data.
I do agree that the default return behavior is probably a bad idea. It probably came from Ruby, and I can see the appeal, but I've often created bugs by accidentally using the implicit return, then adding something to the end of a function. It's not really that big of a deal - I just as a policy always use an explicit return.
It's a different approach, but it doesn't require ES6 or any libraries (once compiled). Forgive the slight funkiness with the indentation.
try
wait for tweets from getTweetsFor "swannodette"
url = parseUrls(tweets)[0]
wait for responseBody from httpGet url
print "Most recent link text: " + responseBody
catch error
console.error "Error with the twitterverse: " + errorAlso, performance is terrible unless you cache aggressively, which most people don't because it's a lot of work, even with W3. The nice thing about real hosted solutions is they can handle extra load if it happens.
I get why it's popular. The blogging interface is very good, but trying to setup/maintain a server makes me want to pull my hair out.
I chose it because in Hebrew it means simple/easy/BASIC.
wait for data from fs.readfile 'test.txt'
print data.toString
and readFile calls back with an error (the first argument is non-null), the error will be thrown just before the print statement. So print will not execute and you'll get a stack trace. The cool thing is that you can do these async calls within try blocks: try
wait for data from fs.readfile 'test.txt'
print data.toString()
if data.length > 0
wait for data2 from fs.readfile 'test2.txt'
print data2.toString()
else
print 'too short'
catch e
print 'there was an error'
wait for resp from db.save()
Will do what you expect - abort after either wait for if it fails and run the catch clause. Think about how you'd do that in JS: var error = null;
var data, data2, resp;
fs.readFile('test.txt', function (err, data) {
if (err) return handleErr(err);
console.log(data.toString())
if (data.length > 0) {
return fs.readFile('test2.txt', function (err, data2) {
if (err) return handleErr(err);
console.log(data2.toString());
return closeout();
});
} else {
console.log('too short');
return closeout();
}
});
function handleErr(err) {
console.log('there was an error');
return closeout();
}
function closeout() {
return db.save(function (err, r) {
if (err) throw err;
resp = r;
});
}