Better HN
topnewbestaskshowjobs
Log inSign up

rcoder

2,116 karma · joined Aug 14, 2007 (19y ago) · 566 submissions

Submissions

comment 17y ago · link · parent

Without a GIL, you not only have to make sure that your entire VM + runtime are re-entrant, but that every library you call into is, too. You can call it "lazy," but it's a fairly standard + pragmatic way to safely layer multi-threading atop arbitrary C libraries.

332.

Rails won(withoutane.com ↗)

47 points · by rcoder · 17y ago · 70 comments

comment 17y ago · link · parent

I work on the Project Kenai (http://kenai.com/) team at Sun, and we provide hosted source code repositories, ticketing, wikis, and a variety of other tools for project management.

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

Honestly, calling this VC, or even an incubator, is probably a misnomer. This is an entrepreneurial bootcamp. Whether or not the training you receive in the program is worth $1500 is up for discussion, of course.

comment 17y ago · link · parent

A simple one-way hash will provide sufficient security for most cases. Assuming you're representing items for sale in a Javascript array, you might send data like this to the browser:

  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

I think you sort of missed the point of _why's original article, though. He's not lamenting the difficulty for computer-savvy adults to get started programming -- the main thrust of his article is towards our failure to provide an easy-to-use, freely-included sandbox for kids to experiment with programming.

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 10

comment 17y ago · link · parent

AFAIK, none of the add-on replication mechanisms you mentioned can guarantee total consistency across multiple database backends: OIDs are not replicated, and there are no hard guarantees against external modifications taking your databases out of sync.

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:

http://www.postgresql.org/docs/8.2/static/wal.html

comment 17y ago · link · parent

We use JRuby on Rails for my main project at work, but I've been doing some Clojure hacking in my personal time, and thinking about using it for some of our asynchronous job-processing needs. Using JRuby + ActiveMQ + Clojure would potentially let us cluster all our core infrastructure in the same JVM, while still getting nice concurrency across all our available cores.

comment 17y ago · link · parent

My point is precisely that most state employees are not free to interpret law as they see fit. The rules defining hiring, retention, pay raises, etc., are written quite precisely across the board, not just for teachers. Trying to game the system is a breach of ethics, if not an outright crime.

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

There's one critical area where assessment of teachers varies from those in medicine, law, etc.: many states require consistent salary and retention policies across all their schools. Given the limited resources available to do any sort of meaningful performance measurement, that pretty much means that any "pay for performance" model will necessarily require a single set of standardized tests that can be delivered to every student in the state.

...and we all know how well those sorts of tests measure real learning and intelligence, right?

comment 17y ago · link · parent

As someone who spent most of my primary school years in "gifted student" magnet programs (like, I suspect, many other HN readers), this appeals to me personally. However, I have it on good authority from actual teachers that separating students according to interest and aptitude disadvantages the average and below-average students greatly, while providing only minimal benefit to the best students.

comment 17y ago · link · parent

This argument still makes no sense to me. Teachers are in an obvious and direct way responsible for producing the next generation of doctors, lawyers, and computer programmers. How can we then in good conscience refuse to pay them as much as people working in those fields?

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

> What is the relevant difference between axe-handles and music?

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

There is more than one axis on which coffee shops compete, though. Price is one of the least-critical, IMHO -- ambiance, service, and "extras" like a decent menu or late-night hours will earn you a lot more loyal customers than a $0.25 price cut on coffee. Remember, if cost was the major deciding factor, people would be making their coffee at home. Going to a coffee shop is a social act, so the "scene" matters at least as much as the product.

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 noticed that, too -- it really looks like they want a single individual who can both make high-level technical decisions and implement + support a bunch of infrastructure at the same time.

I would call that person a co-founder, not a CIO, and a particularly over-burdened one, at that.

comment 17y ago · link · parent

Look, I'm the last person who would assert that a liberal undergraduate education is a necessity for everyone -- I dropped out of a high-priced, prestigious liberal arts college after a year, started coding for a living, and think I made the right decision. That being said, there is real value to be found even in the "soft" classes at such institutions.

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

> There are few applications of, say, category theory to real life.

...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

Apple's app store supports charging for applications. Google's does not. Given that the work involved in developing an app for either platform is roughly comparable, it's not at all surprising that there would be more offerings for the iPhone/iTouch ecosystem.

comment 17y ago · link · parent

Do you have a source for this? I'm genuinely curious, since I thought the "crypto == munitions" policies all died off years ago.

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

There are a limited subset of the jQuery core functions which function much like a monoid (though not strictly a monad), but the lack of strictness means that you can escape the "monadic" container at any time. Utility functions, global assignments, etc., further compound the issue.

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

When the Monad shell was announced (back in the days when Longhorn was going to have a database filesystem, uber-cool widgets, and unicorns that puked rainbows), I actually found myself seriously considering installing Windows on a machine again just to play with it. The idea of a command shell that could be extended in any CLR-hosted language, with pipes that supported structured objects, not just text streams, was pretty damn exciting.

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

ACLs (and RBAC, and most capability security models) are limited for a reason -- they allow you to prove that certain security properties will hold for your application. Without a solution to the halting problem, no such assertion can be made about security mechanisms expressed using Turing-complete languages.

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

Actually, there's an even easier fix: don't put those tools outside the firewall. Use VPN, or even just a tunneling proxy or SSH to protect your admin console.

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

"In that scenario, your only source of new users for your app is the ONE webste [sic]..."

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

"OK, I think I get the advantage in terseness and power relative other static languages. Does it, or how does it, give you any of the other advantages of Duck-typing (such test functions that equally use mocks, stubs or the real objects?"

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 barrier many JVM-hosted languages (including JRuby) are quickly coming up against when targeting Dalvik is the incompatible DEX bytecode format. Pure interpreters are fine, since they don't do any runtime bytecode emission, but the faster, more mature implementations tend to compile their source to bytecode at runtime. That won't work on Dalvik, since the Java bytecode->DEX translation tool is only available on a system running the SDK, not the handset itself.

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

"So I'm waiting for the article that shows why this is cool, I.E., what concrete problems the Hindley-Milner algorithm would be useful for."

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

The names you listed read like the definition of "outlier". If you paid attention only to the salaries that are often mentioned in the press, you would probably see these four, and a handful of those infamous Fortune 500 CEOs who see compensation on the order $30+ million.

Taking an average from that sample, I guess you'd want to pay yourself $15,000,000.50.

comment 17y ago · link · parent

I think it's better to "fish" for your fellow techies (rather than potential executives) for a couple of reasons:

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.

1
111213
19