Inspiring
Although it can come across as cliche and hackneyed, the story of the underprivileged youth working their way up in society can still be quite inspiring as it is here.
Although it can come across as cliche and hackneyed, the story of the underprivileged youth working their way up in society can still be quite inspiring as it is here.
… you look at a digital clock, see 4:04, and think, “Oh no! My clock is broken!” And then right after, “Lol, that’s so funny, I should blog about it…”
I have no idea how people in the past survived without being able to purchase the following items from a single online store (with free shipping):
So I’m trying to create a subscriptions feature for the new Manna website that I’ve been overworking myself on for the past several months. Seriously, if I applied my hourly rate from my last job to the number of hours I’ve spent on that site, I’d have made about… $28,000. Yikes, I just calculated that and even I’m surprised. Anyway, back to the topic. The website has user generated content– blogs, wall (think facebook), photos– and I wanted to allow users to subscribe to content from other users. The steps involved:
For this last step, there were two methods I could take:
I started with the first option, but soon realized that because users can set a future “publish date” for their items, the hook idea wouldn’t work, since it can only take action at the time that the content is created or modified. The idea is for subscribers to be notified whenever content is “published,” which does not have to coincide with when they are created.
So, I had to pursue the second option. The funny thing about Princeton’s server is that the user account does not have access to its own database. (Right now you should be saying, “wtf?!”) Apparently the user accounts are stored on one server, and httpd, mysql, and other web services are run off another server. The user accounts on the first server have access to the second server via a pseudo clone account, which gives you a home directory and lets you edit files, etc. However, only accounts native to the second server (i.e. apache) have access to the database. That means any script you add to your cron (which is stored on the first server) will not have permission to access the database, which makes option (2) impossible. Unless, of course, I’m a genius (haha, ok, I’m not, but let me gloat here for once. I’ve just realized I’ve given up over $28k for something I’m basically doing pro bono, and it’s making me feel nauseous, so I’ll take whatever delusional ideas of self grandeur I can that will take my mind off that.) Anyway, my solution was to use wget to make apache run the script instead of the local user, and add the wget to the cron. That way, the script is always run by apache which does have access to the database. Problem solved.
A friend asked me this question earlier today, which can be described as follows. Given any set of numbers, find a way to identify all subsets within that set that add up to a given number. Simple enough, right? My solution– featuring simple recursive functions and AJAX (ya, I know, it’s no longer hip)– can be found here. The code can be found on my wiki, which I just re-discovered today.
My desktop is like my room. Usually I keep it pretty clean. Then at some point a switch goes off, I suddenly don’t care anymore, and junk ends up all over the place– random media files, shortcuts, readme files to programs I don’t remember installing, etc.. I can tolerate this state for a while before I get fed up and go on a cleaning rage. I’ve just now completed one such cycle, having spent a large part of the day cleaning up my desktop.
It’s funny how software preferences and opinions on sensible computer usage evolve over time. For example, I used to think blogs were the most retarded idea and that “bloggers” were those who had failed at life. Now look at me. Pretty sad, huh? Then there’s the view of Windows Media Player users as misguided souls who need to be shown the light (e.g. foobar2k–in right screenshot–, mplayerc, VLC, etc.), similar to the perception online bourgeoisie now have of people who still use IE.
But even software choices that used to reveal technical savvy are being corrupted. My favorite text editor for a long time, UltraEdit, seems to be killing itself by becoming bloated with more and more useless features while failing to fix existing bugs. Still, I prefer it over the alternatives like TextPad, Notepad++, etc, although not by much anymore. My new love is AutoHotkey, which allows you to create macros and assign them to global hotkeys. I can now automatically launch PuTTY, login, start a shell, and cd to my project directory with a single key, and I’ve also configured a macro to perform KDE-style moving and resizing of windows (ALT+leftclick anywhere in window to move it, ALT+rightclick to resize it). How sweet is that?
I’m writing a web application that requires me to use PHP to output Javascript code, and one of my lines is the following:
echo “fund.Data={$ydata};\n”;
This caused a Javascript error, which didn’t make sense to me until I realized that the squiggly brackets weren’t being printed, so the output was actually:
echo “fund.Data=$ydata;\n”;
This was strange, because squiggly brackets aren’t the type of characters you normally escape in a double-quoted string. However, if placed around a variable name, they apparently mean something special and aren’t printed. So in the end, I just broke up the string:
echo “fund.Data={” . “$ydata};\n”;
And that worked fine.
I’ve written 2,104 lines of PHP in the past 48 hours. It may not be the most efficient code, and there are a good number of comments in there, but for someone who’s not really a programmer, that’s still kind of a lot. And no, I don’t think writing tons of lines of code is an accomplishment, let alone a measure of coding ability. On a good day, you delete lines of code. So, basically, I’ve had a terrible past two days. :\
BTW, I’m not sure what they’re called, but the one-liner if/else statements (i.e. $a = ($b > $c) ? $b : $c) are a great space saver.
I just finished reading Cryptonomicon by Neal Stephenson, which I must say is one of the more enjoyable books I’ve read in a long time. It revolves around cryptanalysis during the WWII era and various top secret Axis codes concerning a German-Japanese conspiracy. With three major story lines developing in parallel– one from the POV of an insanely brilliant American codebreaker (personal friend of Alan Turing), another with a US marine involved in numerous highly secretive and dangerous missions, and a third with a present day silicon valley entrepreneur who stumbles across the aforementioned top secret codes from WWII– there’s plenty of interesting plot developments and suspense to go around.
While Cryptonomicon has all the makings of a great high tech hacker thriller, there is one overall issue I had with the book. Although the author apparently knows a great deal about cryptanalysis (he provides satisfying details regarding the theories and mathematics behind various code schemes), some parts of the book come across like a story about hackers written by a non-hacker. For example, in one section, Randy Waterhouse– the modern day hacker– is tyring to anonymously wipe data from a server before the feds get to it. So, according to the book, he types in:
telnet laundry.org
(Laundry.org is an anonymous proxy.) The author then goes on to say:
[Randy] logs onto laundry.org using ssh– “secure shell”– a way of further encrypting communications between two computers.
Then, when logged into laundry.org, Randy types:
telnet crypt.kk
Okay, so who in their right mind would use telnet for security-sensitive activity? And the fact that the book says he types “telnet server.tld” and then “logs onto server.tld using ssh” simply does not make any sense. Randy, or any hacker worth two cents, would instead have typed:
ssh laundry.org
ssh crypt.kk
There are other incidents in the book that remind you, if you actually do work in some of the high tech fields discussed in the book, that this is written by someone outside said field. At least that was the case for me when it came down to topics on telecommunications and, to a lesser extent, “hacking” (I hate that term). That issue aside, however, this has got to be one of my favorite books in recent history– a worthy high tech intellectual thriller that makes The Da Vinci Code look like a third grade picture book.