HNHacker News
TopNewBestAskShowJobs

hs

348 karma · joined March 6, 2008

submissionscomments
hs··on Ask HN: Hack a healthy, yet not expensive, meal.
fruit - nature's fast food

as a bonus, the waste is bio-degradable

hs··on Just launched Scholar spot.com free educational videos
errr ... scholars' pot?
hs··on Exclusivity contracts are killing entrepenenurs - can we kill them?
you can make an 'opposite' service to break exclusivity

for example, a site that compares different insurance policies/companies, etc

in my case (not from the US), i wanted to sell mutual funds and claim 1% marketing fee :) ... i even passed mutual-fund-manager-certificate-govt exam (just in case, also out of curiosity)

to my surprise (6 months and 1 web app later), only bank is allowed to sell investment packages to individuals (for security reasons)

so not only i cannot take 1% cut (i'm not a bank), banks also do not want to deal with unproven small fry

eventually, i changed my site into site that compares various mutual funds (tables, graphics - love jquery+flot)

but alas, most of them performs below the index; so comparing them shows how bad the funds actually are

anyway i ended up making it a non-profit site ... users love it and i got various feedbacks applicable to my other web apps

hs··on Learning Lisp: Start with Scheme, CL, or Arc?
hmmm lisp ... i use newlisp
hs··on Ask YC: A measurable way to decide between names for a startup?
How will you decide about possible combo of characters? Do you pick one or just buy everything ... just in case?

for example: 'reddit" can be redit, readit, red-it, read-it, red.it, read.it, redd.it "funbox" can be funboxes, funboks, funboss, fun-box, funnybox, funnyboxes, etc

hs··on Top 10 ways to save PC computing energy
# sysctl hw.setperf=0
hs··on 5 Regular Expressions Every Web Programmer Should Know
don't worry, the htmls are ads pages where people deliberately put phone and email to contact to (public info)

the correct regex can indeed produce noise, consider this string in an ads where the poster uses '+' to join info: "please contact the owner, her info: 4041234567+owner@gmail.com ... thx!"

the correct 'boilerplate' regex will happily take 4041234567+owner@gmail.com ... which is not what i want; thus, noise

the less pedantic regex i use will just take owner@gmail.com, which is what i want

similarly with "?" char (legal for local part), the correct regex will catch "sendIM?owner@gmail.com"; which again, not what i want ...

the 'busted' regex will only take 'owner@gmail.com' ... which is what i want

that's the main reason the omissions of +,? and other legal chars in local part of my email regex, the second reason is speed

for email validation where what u get is just a string of less than 100 chars, it's fine to use complete email validation regex; however, for email scrapping of close to 1gb data, boilerplate won't cut it

i'm willing to sacrifice completeness for speed

my regex doesn't allow empty string, there's metachar '\s' for spaces, equivalent to [^ \t\n]

and i was wrong, '\w' is [^a-zA-Z0-9_] ... i forgot '^' and '_' are included in metachar '\w'

thx, your criticism forced me to reopen my regex book

hs··on 5 Regular Expressions Every Web Programmer Should Know
actually i didn't use PHP, the code i submitted is 'ported' using /regex/ ... i haven't tested it in PHP (i don't have) ... but that what i might use if i were forced to use PHP

the actual code is in newlisp: <code> (set 'p1 (regex-comp {[-\.\w]@\w+(\.\w+)+})) ;compile (map (lambda (f) (replace p1 (read-file f) (push $0 E) 0x10000) ) (directory "." "php|htm|html")) (set 'E (unique E)) (save "email.db" 'E) </code>

my newlisp code is not used for validation, it's for scrapping emails from ~30000 html pages totalling 870 MB <pre> ~/dl $ find . | wc 29546 29548 1423727 ~/dl $ du -h 870M </pre>

I used more complex regexes (slow) but only marginal improvement (< 0.1%) and a lot of noises

This code is pretty fast, almost an order magnitude faster than more complex, complete email regex

[-\.\\w] means ... match - or \. or word (a-zA-Z0-9) character ad nauseum (can put more chars inside [] but the regex is slower)

i didn't use it for validation, so no anchoring needed ... but it's an easy modification

anyway, this is the code i use for real world - i won't pretend that it's perfect for every corner cases, but hey it works fast for me :D short code solving 90+% cases

hs··on 5 Regular Expressions Every Web Programmer Should Know
i use this for email:

/[-\.\\w]*@\\w+(\.\\w+)+/

hs··on Be A Man, Run As The Root Account
love afterboot(8)

i also changed default ssh port to non-22 to prevent most brute force attacks

i can't stand GNU/linux folks bashing OpenBSD over trivialities like the root only first-ever boot

hs··on Be A Man, Run As The Root Account
in default install, OpenBSD never asks you to create user

The first-ever boot you can only log in as root

This 'reckless (read: diff from linux distro)' installation practice made OpenBSD got 1 point deducted from a linux review article

Despite the root thingy, OpenBSD is "Only two remote holes in the default install, in more than 10 years!"

hs··on Most Important Programmer Skills: Communication Skills? Uh. No.
it reminds me about an article of comparing US and German customer support

The US CS have better communication than technical -> "your call is important, the problem will be resolved within 24 hours bla bla bla" ... but things rarely get done

The German CS don't talk much but their competency is high so things get done quickly ... much faster than the US

hs··on The Fourth Quadrant: a Map of the Limits of Statistics (by Nassim Nicholas Taleb)
this part is relevant to startups: (see figure 7)

"A biotech company (usually) faces positive uncertainty, a bank faces almost exclusively negative shocks. I call that in my new project "concave" or "convex" to model error."

concave to model error: Bank, Short volatility, security

convex to model error: Long options, biotech, technology, entrepreneurship, etc

hs··on Hacker News vs Reddit and Digg
me too; however, i sometimes check slashdot too ... the comments are wittier and funnier (while still being thoughtful) than hn
hs··on Shoestring Budget? Starting to feel growth issues on your back-end? Embrace unix and C
i used an implementation of cilk when i crawled ~1000000 htmls from a social network in 2 hours (can't disclose -- the site went into maintenance during/after my experiments ... just to exercise my curiosity)

had to be root to raise the user's maxproc-max (previous experiments locked me out --- "sh can't fork" messages ... can't even ssh in)

it's done in a 100mbps amd2000+ 256 mb 40 GB IDE OpenBSD colo ... but i don't think the hardware matters that much (the cilk is really the key)

hs··on Ask HN: Secret military technology as groundbreaking as the tank and airplane were
Despite these military improvements, the largest empire ever was built on bow+arrow ... and such barbaric nation lasted for centuries
hs··on Ask HN: What does your room look like?
i have a leafless bookshelf which is placed next to a bed

that way i no longer need chair+table (i sit on the bed and readjust the shelf's height to put my laptop on)

hs··on Laptops: Mac vs WinXP/Ubuntu?
I work on various hardwares (laptops, desktops, macs) so sometimes i need to move an installed hard drive on one mobo to another different mobo

win98 hd can be used across, good luck with XP / Vista

iBookG4 tiger hd can be swappable to mac mini

ubuntu hd, i had occasions when it's not swappable (always kernel panic on other mobo - must reinstall from scratch)

OpenBSD always works (tm) on every mobo, even on my 10 yo XD380 thinkpad

BUT YOU CAN USE VMWARE!!! errr, i use simpler, OS / hardware independent tech: VNC

my setup now is: win98 for legacies, win-only software / hardware mac mini for fancier hardwares bluetooth, firewire, DVI etc

OpenBSD for development, VNC to win98 and Mac Mini (powerPC)

It used to be OpenBSD+Ubuntu ... However, time tweaking Ubuntu is better invested in win98+mac ... i feel ubuntu is trying to be win/mac/BSD* and it's weak in the three fronts -- weak identity, designed by committee for mass

you may think supporting 3 OS is more complicated; however it's not true

if the OS misbehave and need complete reinstallation: win98: i could just dd if=win98 of=/dev/disk2 and it's ready in 10 mins shrug osx: reboot from install disc, format tiger partition, map the tiger-image and it's ready in ~30 mins OpenBSD: just do ftp reinstall, untar Site44.tgz and it's production ready in 15 mins Ubuntu: i dunno, ... i'll prolly waste another hour+half or two reinstalling it

NB: Can u operate 3 OS (Win/OSX-powerpc/Unix) on a single machine? * BSD is more powerful than linux ... err GNU/linux ... or should i say GNU/BSD ? ... I dunno, i just want to hack and use the most powerful tools available, no time for silly nerd politics

hs··on Ask HN: How do you share screenshots?
import (ImageMagick) + hg (mercurial)
hs··on Death to Javascript Rock Stars
along with jquery.ui-1.6b
hs··on Thank goodness we don't have downmods on HN
or ignoring upmod altogether, it's faster

i rarely use point because it's an easily gamed metric

nowaday i filter news based on #comments (and title)

and only follow comments with <= 3 levels deep (5 if interesting)

and start searching /pg /paul /nickb if it's a >50+ comments

hs··on Be a JavaScript Rockstar (jQuery site redesign)
i prefer ninja, but then u won't see anything
hs··on Mousers vs. Keyboardists
as expertise goes, keyboard > mouse
hs··on Applications Programmer seeks Scheme/Lisp Guidance
try newlisp, it works in bsd, linux, osx, xp/98 (i tried)

you may not be able to use the syntax/examples from other lisp/scheme books coz it's a bit different (people say it's a broken lisp)

but it's hell a lot of fun to program in it

hs··on Gnu screen with split screen
I haven't used screen for about a year or two. I can't stand the GNU/EMACS keybinding. Naturally I chose dwm+mrxvt

The only thing I miss is attach/detach ... Does anyone know any alternative to Screen?

Thx!

hs··on Ask HN: How do you organize your code?
OpenBSD + dwm + vnc here

alt+1: my main coding using vim (no mouse, no arrow key) alt+2: vncviewer to my mac mini for safari, ff3 (mouse) alt+3 ... alt+9: almost never used

i 1-1-map ~/www/pages/webapp{1,...,n) to my OpenBSD colo hg push/pull/update

i'm reconsidering attach/detach screen session between servers, but i can't stand emacs/GNU key-binding (even after xmodmap my caps to ctrl) ... anyone knows screen-like program that uses vi-keybinding?

hs··on Ask HN: Web server development platform, Red Hat or Ubuntu
i'm alway wary about 'great support' ... it implicitly means the product is broken people always ask for help

and to be fair less / no support may mean the product is so good that noone complains (it just works TM) or it's simply dead

on topic: contrast ubuntu and openbsd

hs··on Ask HN: Web server development platform, Red Hat or Ubuntu
try OpenBSD, it's simpler

fast install: ~5 mins default + ~5 mins untar my-essentials.tgz + ~5 mins mercurial sync ... my box is production ready (sans user database)

easy upgrade: untar the tgzs, kernel, sync /etc from newer OpenBSD

no automatic update: it makes default install uniform, when $hit happens, just order another colo server with default install, ftp my-essential and resync

package & port & source: complete freedom ... for contrast, try to build (then patch) vim from source in ubuntu (you can't)

now the 'bad' thing: few forums: but most questions are answerable from OpenBSD's FAQ, afterboot and man pages

less new driver: good luck installing bluetooth (can't)

older software: only firefox 2, no ff 3 in packages and snapshot port (ff3 site lists binaries for xp, osx, and .mar? source ... no idea how to compile .mar)

i use OpenBSD as server (colo) and desktop ... then vnc my mac mini for ff3+firebug (i don't bother with linux emulation, dual boot, vmware etc)

old simple vnc works across OS/arch ... i avoid fancy newer tech. Can you run i386-ubuntu and powerpc-tiger in one desktop?

i had enough of ubuntu, can't install from source, auto-update always break things (i finally quit after my ubuntu retarded to 800x640 and failed attempts at xorg.conf)

oh wait, did i mention about the quality of the OS by OpenSSH maker? Last time my colo lasted 4xx+ days without reboot

hs··on You don't have to sell your company to have financial security
I meant to say u get taxed at 15% flat on capital gain after holding the stock for more than 1 year (in the US)

in my country, the capital gain tax is only 0.1%, automatically included when one sells stock (0.15% fee for buying and 0.25% fee for selling any amount any time); however, income tax from working is 35% top

but the trend is ... tax on investment is substantially lower while it's much higher on working income ... social control perhaps?

hs··on Coding Without Comments
Most of the time I deleted my own comments after things become more obvious - I hate 'moving parts' in my code

The trick is to highlight comments with bright & contrast fg/bg color combo that hurts your eyes (it also serves to say 'hi i'm comment, i'm important, but delete me when u understand me')

← PreviousPage 11 of 13Next →