Better HN
topnewbestaskshowjobs
Log inSign up

Rust

281 karma · joined Mar 13, 2010 (16y ago) · 188 submissions

Starting up, what else :)

http://www.hackernewsers.com/users/Rust.html

Submissions

61.

Nully Nullson - Shit Our Staff Sez (Twitter)(twitter.com ↗)

1 points · by Rust · 14y ago · discuss

comment 14y ago · link · parent

That's just throwing complexity (IDE or SCM has to support that functionality) at a problem that doesn't need to be there in the first place (just use tabs instead of spaces).

Even so, I would still need to tell my editor how many spaces to convert to a single tab, and use the same number to convert tabs to spaces when I save or commit. God help us all if someone else forgets to do that too...

comment 14y ago · link · parent

Always, always with the tabs, never spaces.

The main reason is that on my widescreen monitor, indents of 4 characters or less are hard to visually parse in dense areas of code.

If the original author of this code (the actual code I am setting fire to myself over right now) had used tabs instead, then I could set my editor to display indents as 8 or 12 spaces instead, and he can still use 2 spaces if he wants. This is strictly a display issue - he can use 2 and I can use 8, and the file is not different between our two computers.

With spaces, I'm stuck with whatever number of spaces he chose to use for indentation instead of being able to make the code easy to read on my machine.

We're not using 40-column terminals anymore folks. It's all right to uses tabs for indentation.

64.

The Redis Manifesto(antirez.com ↗)

131 points · by Rust · 14y ago · 5 comments

comment 14y ago · link · parent

Cars, sex and music, depending on the audience.

After that, I explain the idea.

Edit: (to clarify) Cars, like you said, because a certain amount of car knowledge is already in the popular mob-brain. It's fairly easy to describe your web server, load balancer and scripting language as either car or engine parts.

Sex is useful when describing 3rd party API interfaces, particularly Facebook. This one can get pretty damn funny when the API is either poorly designed or unreliable. Also if you need to do weird things to make it work.

Music is good for the high-level stuff. Associating the front-end with the vocals, business tier with the guitars, database with the (wait for it) bass, and the server as the drums. There are bands with two or more of any of those roles (and keyboardists, and cow bell hitters, etc.), so this analogy tends to hold up very well as long as you avoid the details.

comment 14y ago · link · parent

Ironically, I just spent a bunch of time this weekend looking for MtG apps for Android. I installed and tried M:tG Tracker (only used it as a life tracker so far, but it worked well) and couldn't find anything else useful.

I wonder how much trouble it would be to build something like Decked Builder (OSX) for Android tablets?

comment 14y ago · link · parent

Hehe - to actually answer the question, though, the method you are describing might work with enough good planning behind it. Unfortunately, it doesn't sound like your lead dev is willing to do that. You will probably find that the amount of work required to fix the existing system is within a stone's throw of the work required to rewrite it.

I wouldn't call your described plan a "good" way of doing things, necessarily.

comment 14y ago · link · parent

Wow, sounds like my workplace - pretty much the same story, except the two devs who wrote the 300,000 line monstrosity are already gone (worst page record: a page with one topic and 300 comments generates over 10,000 - yes, ten thousand - calls to MySQL, AFTER caching).

In our case, we're squeezing in a complete rewrite of the codebase around existing client work using the old platform. We're writing it as a few separate services (authorization service, content service, front-end, reporting service, and administration front-end) instead of a huge, monolithic app. To do this in a decent time frame (a few months), we're adding 5 or 6 contractors to a 3-person dev team, leaving 3 other devs able to deal with the existing platform.

comment 14y ago · link · parent

FLV is a holdover from a less civilized time.

The new regime requests the following in at least 3 different bandwidths (mobile, standard, HD) each:

* MP4 (h.264 Main Profile w/AAC audio) * OGG (Theora with Vorbis or MP3 audio) * WEBM (WebM with Vorbis audio)

This is from memory, so I could be mistaken about the specific codecs used for those last two, but those three file types combined with a player (or JS library) that detects bandwidth capabilities should let you play a video back on virtually any modern device (ie. most phones, tablets and browsers), and fall back to Flash using MP4 for browsers without HTML5 video element support.

I've used VideoJS and JWPlayer in the past (and recently!) with great success. There is no need for an FLV version of the video unless you expect your users to be using Flash before version 9 (or was it 8?).

comment 14y ago · link · parent

I'd be happy to give an opinion or two! russ at indyarmy dot com

comment 14y ago · link · parent

#1 - ALWAYS encrypt passwords, no exceptions. Implementing SHA1 salted hashes is trivial.

#2 - Dates should be stored in UTC (make sure the server has the timezone correctly set), and display in the user's TZ or a reasonable default. The language will worry about DST. Don't let SQL touch it (in fact, you should probably store a UNIX timestamp - uint - instead of a datetime).

I would argue the above as "best practice" for storing that info. The douchebag is the developer who won't spend 5 minutes implementing either solution.

comment 14y ago · link · parent

Ahhhh, I just transferred three domains there a couple of days ago! Sorry EFF! If I'd known they were going to do this, I'd have waited.

Guess I'll just have to donate directly...

comment 14y ago · link · parent

Clickers:

http://lolcode.com/specs/1.2

http://icanhaslolcode.org/

74.

Ask HN: How Can I Create an RNG Without a Seed? In LOLCode?

1 points · by Rust · 14y ago · 1 comment

comment 14y ago · link · parent

Web apps generally need to be accessible on port 80, and only a single service can claim an IP address and port combination. If web apps were distributed as services, each one would need to run on a unique IP/port combination. In order for outside users to access those apps through the default HTTP or HTTPS ports (80 and 443, respectively), you would still need to be running at least a reverse proxy server that could remap incoming traffic to the correct internal port. On top of that, your web app would have to include an FPM or UWSGI service, increasing the size of the distributed binary.

Frankly, it's much easier just to leave that aspect of things to the server admin, and distribute your web app as a PHAR or Egg or Gem or whatever.

comment 14y ago · link · parent

Like @lucisferre, I've been enjoying my 15" MBP for dev work. I miss my old 17" Dell for the higher resolution and vertical space, but it's a small price to pay.

comment 15y ago · link · parent

https://github.com/indyarmy/MDW

This has the limitation of not being able to chain queries via OOP, but does use PDO and is tested enough to be considered stable.

comment 15y ago · link · parent

Clicks:

http://angelhack.com/

http://angelhacksf.eventbrite.com/

comment 15y ago · link · parent

I went through almost exactly the same situation a few weeks ago - Air for portability, Pro for speed.

In the end, I went with the 15" Pro for two reasons - I can stuff 8GB of RAM in it for my web and audio work, and the 15" screen is way easier to read a pile of code on.

Then I pulled the SSD out of my old laptop and replaced the crappy 5400rpm drive in the Pro, and now I'm a very happy camper :)

comment 15y ago · link · parent

Is this a commercial copy of Flightgear? http://www.flightgear.org/

It seems odd that Flightgear is never mentioned on the site, even though much of the text seems to be lifted directly off their site...

comment 15y ago · link · parent

In about 3 months, one of the startups I'm involved with will be operating in this space, including the availability of a white-label service tier and REST API. I can send you info if you're interested (my email is in my profile) in waiting that long.

comment 15y ago · link · parent

http://noostr.com/ - it's older, but not abandoned. An update is coming in the next couple months with some much needed patches and additions.

comment 15y ago · link · parent

The IndyArmy link is just the "skeleton" that gets loaded when a site is created but has no other content. No redirect involved, and it's meant to let my clients know their site is working and to get something on it quickly :)

Thanks for the input - I'll look into your idea for iwriters.net and see if I have the time to create/maintain such a community.

84.

Ask HN: What to do with several unused domains?

1 points · by Rust · 15y ago · 2 comments

comment 15y ago · link · parent

I will argue that ORMs are not useful to the majority of good developers.

The PHP app I am currently saddled with generates anywhere from 100 (absolute minimum) to 40,000 MySQL queries on every single page view thanks to a developer who didn't know what ORMs are for and was clearly behind the curve when it came to architecting scalable applications.

I have never seen a PHP application abuse a database connection so thoroughly in my life. If he had just stuck to a nice, lightweight PDO wrapper and been able to craft some decent SQL statements, we wouldn't be rewriting this thing right now.

comment 15y ago · link · parent

Isn't that what building in a plugin or extension pattern enables?

comment 15y ago · link · parent

For the web, you want MP4 (h.264), OGG (Theora) and WebM to be able to play in all browsers using Flash as a fallback (Flash will use the MP4 file).

If the computer viewing the Powerpoint presentation has Quicktime installed, an MP4 (or MOV) can be embedded in the PPT.

Acrobat can also embed MP4 files within a PDF, and seems to use Flash to play it back.

So, using an MP4 h.264 will get you a number of browsers, Flash, PDF files (assuming Acrobat is used to view them - I suspect Foxit and other 3rd-party readers won't do this), with the caveat that the person viewing the file may need to have both Quicktime and Flash installed. OGG and WebM will get you the rest of the browsers (see http://diveintohtml5.org/video.html for more info).

comment 15y ago · link · parent

It does seem to vary a lot between about 2 minutes and 5 minutes of inactivity. Like I can read or even nicely skim 30 articles in 2 minutes...

comment 15y ago · link · parent

No argument from me - but how many people are using it? Just from watching SO for a few days it seems that nearly all of the people having trouble with their code (tagged 'mysql' and 'php') are using the old methods. Almost no one is using PDO for their projects (in that limited demographic, at least).

MDW is just to lower the barrier to entry a little bit for people like that. Easy to use, easy to understand, and thanks to the helper pattern, the interface won't change if something better than PDO comes along.

comment 15y ago · link · parent

This project is just a simple wrapper for accessing a database. It simplifies things for people who might tend to forget sanitizing their inputs (particularly INSERT/UPDATE/DELETE) while providing a convenient, class-based interface.
1234567