Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

5.08.2008

Stop Waiters From Thieving Your Money By Kicking Their Asses

I bet you all saw how to do checksum tips several months ago (I'm linking to Punny because Punny is awesome. Go read it). Something about this has always bothered me. It's not the math; I fucking love math. Whenever I walk into someone's kitchen I always count the tiles along the edges and multiply them together; I can recite a whole lot of powers of 2 in one breath; one time I got a math question wrong on a test and my teacher was so dismayed, he made everyone else answer it wrong too. Et cetera, et cetera. The point being, I love math.


However, I am also a creature of habit, and I always tip the same way: the lowest multiple of $5 that is at least 15% of the bill; 20% if the service was memorable (and I wouldn't forget a memorable service). Yes, that means I tip $5 on $20 worth of food. No checksum required. I'm not about to sit around, paranoid, clutching my bank statement in my hand, wondering if some idiot waiter decided to give themselves a cash bonus. Life's too short to think about everyone stealing from you. When it's obvious somebody's ripping you off, don't rely on some arcane formula where it's not required; this is one of the fundamental aspects of programming, to take the simplest, most elegant solution, and kick the asses of everyone who breaks your shit. Or, you know. Buys themselves a pack of smokes on your dime.

4.25.2008

Small Things

The roommates have FINALLY removed their filthy stoner marijuana weed plant from my upstairs window, where it had an uptime of 2d 22h 4m 10s. In addition, after three months without ATV love, my tagged linkdump at xplor.in is back, online, where it will outlast the human race. Because I know you missed it so much. Liars.


At least Tweetcret loves me, because they're gonna use xplor.in for... something. Perhaps. I dunno. I was just pimping their site cuz they asked so nice-like.

3.26.2008

The Future Is Tomorrow

Geez, the freaking internet.


I remember when I was a kid, and they were showing the MOUSE on Saturday morning television as the newest, most revolutionary invention yet. The mouse. And now, all of a sudden, I can make loans through Prosper; I can get a more or less accurate account of anything in the world via Wikipedia or the Urban Dictionary; I can see more naked women then I thought could possibly exist.

So, obviously, I'm bored like ninety percent of the time.

When I'm not writing code or doing simple administration work, I'm surfing the web while my mind crunches the next hurdle I have to navigate. There are like six billion channels, literally, and nothing is on. There's not much point in taking a day off (I already got marked down for unexcused awesomeness) because at home, I'm pretty much using the same internet. And you manager types who think I should be quantizing my time or carpe-ing my diem need to die in a fire. Programming well is thinky work. And thinking requires webcomics. It's all in the Bible, somewhere.

I really wonder what my life would have turned out like if I'd grown up in the rock-beating, wheel-inventing days of Before The Internet. I probably would have gotten addicted to laudanum or absinthe or something and done whatever the prehistoric version of "checking my email over and over" was.

But then I would have invented rocket lasers and killed everyone, twice.

3.17.2008

Rounding An Integer

Apparently, to ORDER BY and LIMIT an INT field in MySQL 5.1, you need to change:


SELECT * FROM table ORDER BY int_field LIMIT 1
To:
SELECT * FROM table ORDER BY ROUND(int_field) LIMIT 1
This is per [redacted], who was told so by his company's contact at MySQL.

I don't know about you, but I think it's completely sexy that a field of type INT needs to be rounded just so you can order a limited post by it. I'm hoping with all my heart that you need to UNROUND() floating-point fields so that the database engine doesn't think you're sorting by color, or something.

1.02.2008

My Macbook Thinks It's So Fucking Awesome

So, I've been a Mac user for almost a full year now. During early spring last year, my three-year old frankenstein of a computer, Ophelia, died. (I name all my computers after Shakespearean heroines or the actresses known for playing them). Since I can. not. live without a computer, I ordered a MacBook Pro (Sybil, if you were wondering).

Flash forward to today. In less than a year, I have designed and implemented five different website ideas, cobbled out a plan to lead to my eventual financial freedom, and regaled you with over a hundred and forty entries full of lies from my twisted manic brain. I am more productive than I think it's legal to be; I'm sure that as soon as I turn away from this post, the Conformity Police will be here with a pair of handcuffs and that painful-ass probe (or, you know. Painful ass-probe) to punish me for being so much better than the rest of society.

When I ran a windows box, well, I knew exactly what to do when something went wrong. It usually involved uninstalling, because windows picks up problems like stupid hookers pick up crotch rot. I was intrigued by the concept of running a nice visual windowing system on top of the stable, safe, sexy core that is Unix. I was tired of configuring Xfce4 and fluxbox. (Dear non-techies: "Me no like work. Windows am dumb."). And now, here I am, driven into a cycle of shame and humiliation by my sexy-ass notebook, the one that makes everyone else's laptops look like they were developed by Tonka.

The problem is that there are about a thousand different things that I could be doing with my laptop, and I am ashamed to only be using it for web design. You can write applications rapidly and easily in OS X... but I don't particularly want an application that isn't readily available. You can make widgets with CSS and Javascript; you can explore the mighty world of BSD; you can dance upon the heads of angels and kick Jupiter around the moon. Geez. The glossy widescreen means that at the very least, I should at least be downloading high quality porn.

I think this is the point where the machines take over.

12.10.2007

Quote Addiction

I thought I was so clever adding the magic hate ball to this site (which also shows up at the bottom of each page on Brave Little). But now, I'm deeply in love with the concept of the random quote.

When I first added the Magical ATV to Xplor.In, the reasons were pretty obvious: I thought Xplor.In was a stupid idea, and I hate ATVs. Originally, the caption was a static "Riding roughshod across the internet.". However, after coming up with the creative error messages, I decided that having static text under the ATV was nowhere near as cool as having messages of love and world peace displayed to the whole internet.

So, I made a database table called atv_love.

Right now, there are around 25 messages of hope, magic, and wonder under the ATV. As soon as I can think of more, they'll be going in as well. Go ahead. Experience the magic.

11.29.2007

Even More Programming Goodness

It's like I fell asleep in class one day, except that then I woke up as Haskell Curry. Xplor.In is going through a pretty interesting transition right now, where it functions less as a means of obscuring your urls and more as a method of seeing what all my friends feel is worth posting to it. (Now that I've got the bookmarklet in my bookmarks bar, I just sort of post anything that looks slightly interesting).

People make fun of me because of my total lack of design skills, as is certainly evidenced by Xplor; the color scheme looks like somebody's retarded kid won the web design trophy in the Special Olympics. Somehow, I thought that owning a Mac would make me effeminate, trendy, and especially good at interior design, but it turns out that while I know exactly what color any random hex string will give me, I have a lot to learn about making them not look like a melted box of crayons.

Obviously, I can't take criticism on any level without trying to do something about it. I was just going to urinate in the coffeepot, but then someday I might forget and drink coffee, so instead I made sure everyone knew I could fake pretty by designing my really-truly home page in shades of grey. Mostly because you can get away with being a color moron if everything is in black and white.

11.28.2007

I Am Having Way Too Much Fun

So, Xplor.In is up, and I'm having way too much filthy fun doing error messages. I'm not sure how i'm going to make links more permanent yet.

11.27.2007

Sometimes You Just Wanna Code

I could have been thinking about swearing and misogyny like usual, but instead today I decided that there should be a TinyURL service with descriptive links, so I built one here. It lets you put in a url and a text string, and then let it link like this: http://bravelittle.net/redirect/braver_and_littler. Next step, of course, is to stick it on a domain.

Update: Apparently, we're going to be hosting this tagging service at [yeah right i wish] as soon as the dns resolves.

Update: Nice dream, apparently. Derek's domain registrar doesn't appear to actually be running whois. We've tried two domain names and they just sort of belong to other people. Frantically typing in other domain names to try to get something succinct.

Update: I come up with a bunch of decent domain name ideas. Derek disappears.

Update: Derek reappears. Domains? Perhaps.

Final Update: We're up at xplor.in.

11.13.2007

100th Post Celebration

It's been such a long and lovely time, and now What I Actually Hear has turned 100. As part of the celebration, I added a bunch of new quotes to the Magic Hate Ball (the ID goes up to 59 but I deleted a few). You know you want to see them all.


There's still a couple of weak ones in there, but I'm flexible. Let me know which ones you don't like or whether there are any clever bits of hate you want to add.

11.05.2007

Review: Agile Web Development With Rails, Second Edition

Agile Web Development With Rails is a book about programming Rails, which is a web framework written in Ruby, which is the language that octopuses would write freaking sweet video games in all the time if they weren't so busy eating sharks. Ruby on Rails came from the Basecamp project written by David Heinemeier Hansson, who is very loud and kind of annoying but it's okay because he wrote Rails.


Ruby As A Language
If you've ever written anything in Ruby then you already know that it's impossible to stop programming after you start. Soon you're inventing dumb, complex projects just because Ruby translates thoughts to programming so incredibly well that you can't help yourself. I have written strange, unspeakable magicks in Ruby that I'm pretty sure you have to be a twentieth-level wizard to cast. I can cast them because I cheat on my rolls.

The Book Itself
When I got in my car to come home from work tonight, suddenly this gigantic moth started buzzing around inside my windshield. At least, I think it was a moth. From the size of it, it might have been a small dragon. 

Immediately, I screamed like a girl and rolled down all my windows and tried to get it to get out of my car by begging and swerving my car around. I'm pretty sure everyone who saw me leaving the parking lot just thought I was a badass driver because I'm all asian and I drive a Nissan, but really I was just trying to keep the moth from flying in my ears and laying its eggs in me. It's really hard to drive when you have your hands over your ears, but I managed to make it to a parking lot a few buildings down. Then, I looked for a book to smash it with.

Learning Perl 5 (Revised Edition) could have wasted the moth, but it's seriously like six inches thick and my arms are too girly to pick it up. Ajax on Rails is a smaller book and I could have gotten it down into the corner where my windshield and dashboard meet, but I didn't have it in the car, because seriously, who tries to do something in Ajax and pulls out a book? People just go to the website for prototype.js and read that stuff there. I don't even know why I own that book.

Luckily, David Heinemeier Hansson's fantastic book was there. I didn't want to sit in my car in the parking lot while everybody drove past me, so I just kept swerving down the road and launching the Rails book at my windshield trying to get the moth. For a while, I kept missing and I thought it was going to fly in my ears while I was holding the book, but eventually I got a lucky splat and killed it and gained a billion experience. The cover is so shiny that the moth just fell off onto the passenger seat, so I left it there to scare girls away. I was so excited that I forgot about driving over to Fancy's to inject blendered girl scouts into my femoral artery, like I was going to do, and instead just thought about Rails all the way home.

The Pretty Cover
AWDwR(SE) has a very pretty cover, with a skateboarder doing a totally awesome rail slide in blurry motion. The skateboarder represents Web 2.0. In the bottom left corner is a really neat little icon that says "Rails" underneath a picture of an octopus's engorged tentacle. This represents the octopus-like versatility of Rails.

In the bottom right hand corner, there are the names of the people who wrote the book, which includes the guy who invented Wendy's and David Heinemeier Hansson, who has a very long middle name.

The Words Inside
I mostly have this book for reference, because I already know how to write things in Rails. However, having had the last edition of this book (which is called AWDwR(FE)), I was surprised that Rails now has RJS, which is a way to code Javascript without looking as stupid as you would by actually writing things in Javascript. I find this has tremendous value even if I never ever code anything in RJS, because it gives me more reasons to tell people why Rails is important and good.

At work, we use a framework called creovel, which is kind of like Rails' retarded younger brother who owns a Vincent Black Shadow and always beats him in races. (Rails drives a Vespa.) Creovel is a very good framework for not having to wait for another Ice Age for your page to come up, which is what happens if you use Rails. Also, I had to say something good about creovel because all my bosses wrote it and they could potentially form some kind of Boss Voltron and beat me up.

Final Score
David Heinemeier Hansson   8.6/10
Ruby 11/10
Octopus Logo 14/3.14159265358979323846 (yes i know this by heart i win)
Creovel f(n)
Moth Killing Powers 46/52

Total Score: Eleventy Billion

10.12.2007

Part Of The Family

Reading Joolz' recent posts reminds me why I'm not working with Mike. Mike works at a very large internet apparel company whose name rhymes with Zappo's, and they work very hard to make you feel like part of a big, utopian corporate family.


I hate family. I don't talk to my family, I am horribly confused about what to do around my wife's family, and if the place where I work doesn't want me to go bugnuts at the very mention of me being a part of theirs then I'd better be working for the fucking mafia. The way I see it, all the time companies spend coming up with little get-togethers and team builders to bring people closer together can be used for something much more important- supporting my raging drug habit so I have something to be grateful for.

Where did team-building exercises come from? Well, let's say you work at the most obvious sort of establishment you can possibly work at here in Las Vegas (not the fucking brothels, losers). Let me tell you, working at a corporate casino is the epitome of living your life in total fear. You are reminded how little you mean to the company every day. They have reduced the concept of a pay raise to that of a beautiful insult; they will literally tell you the average pay raise percentage per year and give you less out of spite. The reason they do this is because the corporate casinos could care less how much you bust your ass for them; they care about something called seniority, which is business-ese for "rewarding the people who don't work enough to hate their jobs after ten years".

One day long ago, during the Golden Age of Corporate Fear, your best option was to work for a huge corporation, because people needed benefits to survive. At some point, a company tried a team building exercise which nobody liked, then asked each employee to say how much they gained. Each employee, afraid of losing their lifelines, painted the whole process with glowing praise, and this result was written down as Law in the annals of business history.

Let me tell you something. After three years of being told how expendable I was as a person, I quit my job on the spot and got a job at a small company with zero benefits and paychecks which sometimes disappeared when the business was going through rough patches. I was paid more than I'd ever made previously in my life just because I knew Perl. I never met more than four people who worked outside of the programming department and company rules were that non-programmers had to treat us like gods among men and harbingers of ill fate. I'm sure it sucked for everybody else, but when you're literally being paid to go across the street to the bar and get smashed for six hours straight before coming back and cranking out an application (projected time was always about twenty times how long it took to actually write it), you cease caring about other people. You cease even acknowledging other people have names. And if someone has the audacity to address you by name when they are far beneath your station, you start to do some pretty crazy things. Like inventing team-building exercises to punish them.

9.14.2007

Web Entrepreneurs Are Idiots

So, I'm working on this website for Fancy. Let's say it's a home-study college course (it isn't). Let us also say that some of the most fantastic idiots in the history of humanity come up with these half-cocked ideas for websites as if though their brains were wired to occasionally just spit neurons into the vast depths of space.

I've met some people with brilliant concepts. Heck, I'm friends with more than a couple. These are people who understand how consumer markets work and aim to fully achieve the realization of their dreams via the intertubes. Then there's this guy, whose ideas are so fundamentally retarded that it's like his mother missed with the coat hanger somewhere in the first trimester.

Imagine that you're a consumer who has no idea what a diploma mill is, and therefore think it's a good idea to take an online college course. This represents ignorance on your part, but it doesn't make you an idiot. Now, let's say you're hard at work trying to learn your advanced physics through html, reading equations that really don't make much sense and trying to cram them all in your brain so you can pass a joke of a test.

You're really concentrating, right? You open up TextEdit and jot down some notes. You drink coffee, and you stare at this screen until your eyeballs rupture.

And then this window pops up asking you about some tramp you nailed back in high school while you were rolling on ecstasy. Seriously. Just to make sure you didn't stop studying, and to make sure you are who you really say you are.

Suddenly, your train of thought is derailed. It's like somebody just pissed on your exposed, demyelinized spinal cord. Whoops. What was a Lagrange Multiplier again? So you've got to rewind and go up a paragraph and try and get back on track.

And then the fucking window asks you what you ate for breakfast. Now, whenever you think about the loci of stationary points in a constraint algorithm, your mind is inevitably drawn towards the image of a Bacon McGriddle in your hand while you drive to work from the point on the side of the highway where you decided you were too drunk to keep going.

Brilliant work, gentlemen. Future generations will praise you. You are truly the golden standard of what it means to be a man.

7.31.2007

The Universe

If superstring theory is real, that leaves us with a few shocking facts to sift through:

  • All reality is made of tiny, one-dimensional strings.
  • Reality is therefore null-terminated.
  • Reality is strongly typed.
  • Reality at its lowest level is not subject to recursion.
  • Thanks to Einstein, we know that time() returns char*[].

7.16.2007

Have you seen PEAR?

Just because I have to write PHP instead of an actually decent language doesn't mean I care in the least what advances are being made to it.

If somebody had to create a CPAN-like repository for a language that Zend has optimized to have eight different completely useless recursive array diff-ing functions with conflicting argument structure just because they couldn't be arsed to dig through the layers of the PHP manual for the one magic function that actually does exactly what you need, well, that's like putting a swiss army knife gadget IN A SWISS ARMY KNIFE.

Actually, I sorta want that.