2,116 karma · joined Aug 14, 2007 (19y ago) · 566 submissions
332.
47 points · by rcoder · 17y ago · 70 comments
comment 17y ago · link · parent
We're still in beta, so you'll need an invite in order to actually create a project. Hit me up via email (my HN username at gmail.com) and I can pass along an invite if you're interested.
comment 17y ago · link · parent
var forSale = {
"book": {"price": 19.95, "description": "a book", "checksum": "c6da835c1fd2ee98d68eee3912dd199e41c82a32"}
}
The value for 'checksum' is just a SHA1 hex digest of the ('book', '19.95', 'secret'), joined by tab characters. It can be included as a hidden form field or invisible element within your page; it doesn't matter so long as you can capture it and POST is along with the item + price.In your order-processing logic, just check that the hash verifies with your secret key ('secret' in the above), and you know with a reasonable degree of certainty that the original page was one generated by your server.
comment 17y ago · link · parent
How many of the other folks here started out just as described in this article: namely, writing silly little BASIC programs for early Commodore, Apple, or DOS systems?
There are a handful of projects aimed at just this niche (Scratch and Greenfoot, for example) but none of them come standard on any new system. That lack of immediate availability means that kids have to actively seek out the tools + have the ability/privileges to install new software before they can even start experimenting with something like this:
10 PRINT "JENNY HAS COOTIES!"
20 GOTO 10comment 17y ago · link · parent
As an alternative, you can use Point-In-Time-Recovery (PITR), also known as "log shipping", to transfer copies of your write-ahead log files from a master server to a warm standby. PITR allows you to have an exact replica of your master database, modulo whatever delay you incur in the log transfer itself.
For those who haven't aren't familiar with write-ahead logs, they function much like the logging in modern filesystems: changes are written there before being flushed to disk, so any incomplete transactions can be replayed from the logs if the server goes down unexpectedly.
Of course, the log-shipping method doesn't allow your secondary server to serve as a read-only replica as MySQL's built-in replication does. Largely for that reason, (depending on your workload and requirements, of course) MySQL may be a better choice. However, I've found Postgres PITR to be an excellent option for low to medium-traffic databases in those cases where I'm willing to trade the possibility of the loss of a few seconds' updates for guarantees that my DDL, object identities, and constraints will be maintained consistently between my replicas.
For those who are curious, the PostgreSQL docs online have a decent introduction into the use of write-ahead logs for replication and backups:
comment 17y ago · link · parent
comment 17y ago · link · parent
I'm not trying to defend the public-sector model -- there are obvious inefficiencies, and many of the best potential hires would never even consider a government job for many of the same reasons you suggested. I'm just not sure how better to balance the need to be accountable to the taxpayers with the desire of administrators to pay their staff according to ability, not just seniority.
comment 17y ago · link · parent
...and we all know how well those sorts of tests measure real learning and intelligence, right?
comment 17y ago · link · parent
comment 17y ago · link · parent
Think of it this way: in private firms, employees who demonstrate mastery of both their own specialization and "people skills" are promoted to management, so that they can guide and support the next generation of workers. They are paid more for this than their employees, in part due to the fact that not everyone can do what they do. Similarly, teachers have to balance knowledge of the actual material being taught, and all the "soft" skills of classroom management: facilitating discussions, maintaining discipline, keeping emotions and energy on an even keel.
Any manager who could effectively herd 30+ techies would be lauded as worth their weight in gold; why then isn't a teacher who does the same thing with as many children (a harder task, to be sure) appreciated as the deft administrator they must be?
comment 17y ago · link · parent
Music is more than a product -- live performance is a social experience, not just private consumption. People go to see bands live for many reasons other than the rendition of notes they could get from a recording: they flirt with other concert-goers, they experience mistakes and improvisations by the artists, and they drink and dance in public.
Similarly, good teaching is not a solitary or entirely reproducible event. The best teachers I've ever had were the ones who could get students talking to each other, generating and assessing ideas faster than any one pupil could alone. You can't get the same experience reading a textbook or watching time-delayed streaming video of a lecture. I'm not even entirely convinced that online interaction can pull it off, at least in areas like history and the arts, where subjective and emotional arguments are just as critical as hard logic.
comment 17y ago · link · parent
The problems (and attempted solutions) the article's author described sound to me like they all stemmed from a lack of interest in paying any attention to the market. He admits that the most prominent and loyal types of coffee shop customers (commuters who just want to grab a cup for the road, and laptop warriors who want to sit tight and work for several hours) weren't interested in his business, and then seems surprised that he failed to make a profit? Color me unsurprised.
You can make money in the service industry, eventually -- but you have to provide something that people want. Simply being in love with your own clever ideas is seldom a good path to profitability.
comment 17y ago · link · parent
I would call that person a co-founder, not a CIO, and a particularly over-burdened one, at that.
comment 17y ago · link · parent
While any college likes to tell potential students and parents that they'll teach their students "how to learn," the truth is that most kids do still have a lot of cognitive development to do at 18 years old, and even more social and professional. Being able to spend several hours a day arguing about complex and nuanced subjects with other bright young people (all under the supervision of a facilitator with a very high level of expertise in the subject under discussion) is an almost priceless experience.
That being said, it shouldn't cost $50k/year just to be able to have those discussions. Moving some of the content online will help (though some amount of face-to-face interaction is still a must to develop good social graces IMHO). Cutting down on the level of pampering should be a first step, too -- at 19 years old, there's little excuse for someone to be unable to cook for themselves, or find a place to live.
comment 17y ago · link · parent
...and there you have nicely summed up why CS appeals to me as a field: it is an arena in which interesting, contemporary mathematics can have an immediate and practical application in solving real-world problems.
comment 17y ago · link · parent
As far as maintaining proper records of who has which device, I say "bravo!" Just like stolen and lost laptops fueled much of the last 5-6 years' ID theft fears, I think mis-appropriated mobile devices will cause a whole lot of people a whole lot of stress as more and more critical information finds its way into pockets and purses.
comment 17y ago · link · parent
That being said, presenting monadic designs in this fashion could well help understand the basics, which is to be applauded.
351.
ActiveRecord.js(activerecordjs.org ↗)
2 points · by rcoder · 17y ago · discuss
comment 17y ago · link · parent
Then MS delayed it, split Monad (renamed PowerShell) from the OS-that-is-now-Vista, and sat on the technology for a few more years before quietly launching it as an Exchange Server admin tool. Meanwhile, I found myself using IRb and IPython more and more, and never really got around to setting up that Windows box.
comment 17y ago · link · parent
That's not to say that ACLs are the last word -- they were defined and analyzed in depth in the 60s and 70s, and work in security theory marches on. Models such as information flow analysis, object capabilities, etc., allow for much richer policy definition while still making stronger guarantees about the security of the finished system.
While I actually like most of what Zed has to say in this talk, I think he's doing a grave disservice to the security theory community by dismissing out of hand everything they've done in the last 40 years.
comment 17y ago · link · parent
This is a classic security failure, and their response was both typical and appropriate: take the tools offline, restore the affected accounts, and admit your mistake (in that order).
comment 17y ago · link · parent
And that, right there, explains why I won't go anywhere near the App Store, or support the Apple/iTunes/iPhone dev ecosystem with my time or code. There might be money to be made, but only as long as Apple likes you and allows you to continue to play in their sandbox.
comment 17y ago · link · parent
First, having a robust type system (whether simplified for the programmer by the presence of type inference or not) makes a large number of the types of tests performed in scripting language code unnecessary. Return types, errors raised, bounds checks, etc., are all implicit in the type signature of a function, and so do not need to be checked.
Secondly, at least in a pure language like Haskell, stateful code must be delimited via monads. Good program design dictates that you make those stateful components as small as possible, which then allows you to test the remainder of your code without resorting to mocks and stubs at all.
As a basic example, instead of passing a mocked file handle object between multiple methods, you might change your API to use a sequence of strings representing lines in the source file. At test time, you can simply pass any such sequence to your functions rather than mocking or stubbing all the potential behaviors of a "real" file.
That being said, your real question seems to be, "can I substitute X for Y, as I can in Ruby/Python/etc.?" My answer to that would be "yes, as long as there are (potentially trivial) implementations of all the required functions in the typeclass(es) of Y that we care about."
Haskell typing, at least, acts a lot more like an abstract interface than a concrete class, and a single datum is likely to be a member of many different typeclasses. However, each parameter to a function is constrained by a single typeclass, so you need not provide for every possible operation on a piece of data in order to mock it for testing.
comment 17y ago · link · parent
One solution to this would be to create a self-hosting Dalvik DEX translator, so that apps running on an Android device could generate bytecode on the fly; another would be to switch to pre-compilation of your JVM-hosted language, with all runtime code evaluation handled via a simple interpreter.
An interesting example of the second type is Scala -- the Scala compiler generates class files directly, which can then be converted for use in Dalvik on the development host. It won't give you the runtime dynamism of a Scheme or JRuby environment, but it will at least spare you from having to write plain Java.
comment 17y ago · link · parent
Here's a quick take:
Ruby programmers (and, to a lesser extent, other dynamic OO coders) tend to get very excited about concepts like "duck typing" -- 'if it walks like a duck, it may as well be a duck' -- and tend to use it heavily for polymorphism, future-proof APIs, and other nifty "agile" programming techniques.
However, with HM type inference and either modular programming (ala ML) or typeclasses (ala Haskell), you can gain most of the same terseness and dynamism of your "duck-typed" Ruby code, while still having strong compile-time checks that your "duck-like" objects in fact satisfy all the requirements of "duck-ness".
The biggest trade-off, IMO, is that you now have a little logic programming language embedded in your type system, and can't compile your program until all the type constraints can be resolved.
Also, unlike Java, where such problems are (from the production code I've seen, anyway) usually handled with a runtime cast through the Object ground type, languages with HM type inference usually require there to actually be a valid type-conversion function between the mis-matched types in question.
None of this is unique to Hindley-Milner type inference, of course; HM is just the standard algorithm for languages which implement the simply-typed lambda calculus.
comment 17y ago · link · parent
Taking an average from that sample, I guess you'd want to pay yourself $15,000,000.50.
comment 17y ago · link · parent
1. You're likely to learn more (at least about your craft) in casual users' group meetings than you are in a business lunch
2. Good programmers and meetup organizers have a tendency to become the next business cycle's project managers and CIOs, so having a network made up of them is a great way to improve your chances at snagging your next great job
Also, in my experience at least, good managers are usually much more pro-active about getting to know their reports than the reverse. Regardless, it's not a very effective means of expanding your professional network, since your boss already knows you from your work together, and is unlikely to recommend you more or less enthusiastically because you sat down for a club sandwich together.