Live data from Hacker News

Ask HN: What's your proudest hack?

news.ycombinator.com

261–270 of 414 posts

Re: Ask HN: What's your proudest hack?

#262
post #256

In my first job I work on a database product in development that leaked memory slowly, leading to crashes after hours of usage. The software was written in C and there were no tools like Purify or Valgrind back then to deal with memory problem. It was a vexing problem that got punted until release time, when it became a show stopper. I looked into the problem and found that the memory allocation used malloc and free.…

You know, that's surprisingly an elegant hack. I'm sure it's obvious to some folks, but for some reason I never came up with it during my old C programming days.

Re: Ask HN: What's your proudest hack?

#263
When I was 18 I found an offshore online casino that had a video poker game that paid out slightly over 100% if played perfectly. I don’t remember exactly why I couldn’t just reverse engineer the API so I wrote a program that would scrape the screen for the cards, determine which cards to hold, and physically move the mouse and click the correct buttons. I had the program running on a laptop in my mom’s kitchen all day and night, it drove her crazy (I liked having the sound effects on so I knew it was running 24/7). Made the house sound like a casino, lol. I was skeptical that it would actually work, I figured this random offshore casino probably rigs the RNG anyway, but it actually did pay out as expected. I logged every hand and it was pretty amazing seeing the royal flushes actually come up once every ~40,000 hands - needed those to make the whole thing work, obviously.

They eventually caught on after around 10 million hands I think, banned me, stopped me from cashing the remaining funds out (wasn’t that much since I withdrew frequently), and changed the odds of the game.

Re: Ask HN: What's your proudest hack?

#264
I hacked a running magazine’s online poll for “best high school runner of all time in $homeState” to have my friend (who was extremely talented and went on to run at Stanford) as #1. I don’t remember exactly what I did but there was a nonce related to epoch time and I had to rate limit it. Everyone’s friends and family were obviously voting multiple times but I was the only one to automate it

Re: Ask HN: What's your proudest hack?

#265

Earlier quoted context omitted.

Most USB cameras send JPEG frames because USB 2.0 isn't nearly enough to support raw frames: 60 frames/second * 1920*1080 pixels/frame * 4 bytes/pixel = ~475MiB/s, while maximum USB 2.0 bandwidth is ~60MiB/s. You also don't want to store raw frames on the cloud storage, your bill would skyrocket. Those are some of the reasons for using JPEG. If you're using dockerized services (which are a must for NVidia-based CV, s…

Yea you're right of course, I was being glib. Glad it worked out in the end for you. For the record I don't think RabbitMQ was overkill, I think it's just way too much overhead to work for something like sending frames of video (which I think is the moral of your story). Anyway I'm guessing this was for a school project and you won't have to live with it so it's moot.

It was actually a production system we built on my first job. It wasn't just sending frames from A to B, it did have a few moving parts. It eventually got stable and stopped changing, so in a way, I don't have to live with it. But it's up and running and does its job.

Re: Ask HN: What's your proudest hack?

#266

A few jobs ago I was working on printer firmware. There was some bug where after so many pages were printed the colors would start to band. Anyways, the fix ended up changing a == to a <=. I looked up an ascii table and it was literally a 1-bit change. I like to brag about that one on occasion but it also put things into perspective how the difference between something working or not can literally come down to a sing…

Yeah, most software cracks on x86 used to involve changing a byte's value from 0x74 to 0x75 or vice versa, literally a single bit change making it a cracked program or not :)

Re: Ask HN: What's your proudest hack?

#267
post #262
post #256

In my first job I work on a database product in development that leaked memory slowly, leading to crashes after hours of usage. The software was written in C and there were no tools like Purify or Valgrind back then to deal with memory problem. It was a vexing problem that got punted until release time, when it became a show stopper. I looked into the problem and found that the memory allocation used malloc and free.…

You know, that's surprisingly an elegant hack. I'm sure it's obvious to some folks, but for some reason I never came up with it during my old C programming days.

Oh I was desperate. I was the most junior guy in the team on my first job after school whom got thrown with a hard problem. Luckily I remembered __FILE__ and __LINE__ in C, and it was a matter of working backward to link those to malloc and free somehow. My Unix command-fu (sort, uniq -c) learned back in school came through in dealing with the huge log file.

It was a huge boost to my confidence on my job and earned my cred with the team.

Re: Ask HN: What's your proudest hack?

#268
post #112

An early Samsung phone had a small bug. When you tried to dial an invalid emergency number, the home screen was briefly visible. I discoveted that, with a lot of tapping at exactly the right time, I could launch the marketplace. With a lot of tapping at the right time I could trigger a voice search. I then told it to install an app which disabled the lock screen. With, again, a lot of tapping at just the right time a…

That reminds me of a hack I did. In the fairly early days of Android I realised you could install an app to a device from the Play Store using the website on the PC, and have it auto-run when triggered by an event such as the charger being plugged in. Combined with the API to disable the lock screen (eg when receiving an incoming call so the user can answer) it was a way to remotely disable the lock screen.

I created my first ever Android app in one evening and released it for free. It was the first one of its kind and was quite popular, mainly for parents who let their kids play with their phone and accidently lock it, or for people who wanted access to their loved ones device after they died.

However I received loads of bizarre and abusive support requests from people who demanded I help them, and even call them personally. Eventually I got fed up and started to charge a nominal amount and the support requests suddenly became much more polite and intelligent, filtering out the toxic support requests.

I read a post on HN about how increasing price on something can result in higher sales because people value it more. I decided to increase the price as an experiment, and sure enough the sales went up!

For 3 hours of work one evening creating the app, it made a few £10ks over a few years.

Eventually Google prevented the ability to auto-run newly installed apps due to malware using the same vector, now you have to launch the app manually the first time. While it still worked on older devices I eventually removed it because it failed more than it worked.

Re: Ask HN: What's your proudest hack?

#269
post #258

I hosted a server, in my bedroom back in the late 90s. By server, I mean a desktop running Slack, connected to the internet and allowing me to SSH into it. It could recover just fine from a power outage, but unfortunately due to a RAM issue it would just randomly die - and RAM just wasn't something the local computer store was ready to bring in. Enter my Lego Mindstorm. I effectively built a box, on wheels with a big…

For the confused: Slack isn't just the modern messaging platform.

Re: Ask HN: What's your proudest hack?

#270
post #262
post #256

In my first job I work on a database product in development that leaked memory slowly, leading to crashes after hours of usage. The software was written in C and there were no tools like Purify or Valgrind back then to deal with memory problem. It was a vexing problem that got punted until release time, when it became a show stopper. I looked into the problem and found that the memory allocation used malloc and free.…

You know, that's surprisingly an elegant hack. I'm sure it's obvious to some folks, but for some reason I never came up with it during my old C programming days.

The eternal curse of the C programmer is knowing that macros are Right There, just waiting for you to take them up and craft the most elegant… footgun.
Post reply on HN