Showing posts with label coding. Show all posts
Showing posts with label coding. Show all posts

Tuesday, October 26, 2010

It's a marathon, not a sprint

Alright, it has been a little over two weeks since I started pounding the pavement, and I quickly discovered that a kickass attitude is no match for burnout.

The first week was easy. Well, it was technically easy. It was hard to get out of bed, and get to Starbucks, but once I was there, and my brain was in gear, there was no stopping me. I may have been more tired than I was used to at the end of the day, but it wasn't that bad.

But after the first week, I started to notice that not only was I more physically tired, I was also mentally tired. Code I had written days before made no sense to me, which wouldn't be the first time, but probably the first time for code I had written so recently, and definitely the first time I could not grok after a few minutes. Frustrated with the confusing code I had written, I decided to just start work on a different segment of code. Except... Nothing was coming out. I just sat there, unable to put two thoughts together. I started just writing whatever came to mind so I could keep track of what I was doing, but I'd forget where I was after a few lines. Then I got really angry with myself for forgetting how to code, and surfed the net idly, stopping periodically to see if I remembered how to code. I didn't. Then I got mad at myself for wasting time, and opened my list of things to read, and started reading about some perl methods I wanted to try out. Except... That didn't make sense either... I was broken, frustrated, and angry. I went home.

The following week I started sleeping through my alarm. No matter how much I turned it up, I slept right through it. And when I woke up an hour or two late, still with time to work, I didn't want to go to Starbucks because I felt like it would be a waste of time and money. So I tried to work at least one hour at home. But I had the same problem. So I just wound up playing Fallout New Vegas. More metaphorical comfort food, but it didn't matter to me, because I knew i wouldn't be able to code.

When the weekend rolled around, I wanted to code, but something always got in the way. I played obscene amounts of Fallout, and honestly had fun doing it. But I still knew time was passing me by.

I overdid it on Sunday, and stayed up too early playing, and fucked up my morning. I still work up early, and actually woke to my alarm this time, but I knew I wouldn't be able to do anything but play Fallout. So I thought about it a bit, and decided to sleep in as much as I could because I was going to work Tuesday.

So two weeks after I declared war on sleep, I slept.

After about 10 hours of sleep, I woke up a new man. Feeling refreshed, and ready to work. I didn't though, because I didn't want to jinx it.

I went to a particularly vexing day of work, came home, unwound with some teevee with the wifey, and got to bed at a reasonable hour.

This morning, I was up on time, got ready for work early, headed into Starbucks, got 2.5 hours of serious coding done, and still had a half to write this post, and head in to work.

tl,dr; I need to start pacing myself. I don't think I've ever worked as mentally hard as I did that week, certainly not on that little amount of sleep. I just didn't think I could induce burnout in a little over a week. Honestly, I'm kind of impressed. But I'm not in it for the short game, and I certainly shouldn't expect to take off at a full sprint with no training. I'm going to try doing half-mornings of non-business stuff in between my business mornings, and generally figuring out the maximum I can do without going over that threshold.

Thursday, July 29, 2010

Android ASE Perl dialogGetResponse() example

use Android;
my $a = Android->new();
my @choices=('omg','wtf','bbq');
$a->dialogCreateAlert("make a selection");
$a->dialogSetItems([@choices[0],@choices[1],@choices[2]]);
$a->dialogShow();
my $selection = $a->dialogGetResponse()->{'result'}->{'item'};
print "you selected @choices[$selection]\n";

Enjoy!

Tuesday, July 27, 2010

Clever girl...

It seems Google's insidious plan to provide a scripting environment for your favorite language that is technically implemented and barely documented has had the desired effect. The same effect of eating a single potato chip, then realizing the bag is empty.

I knew I was going to do some development for the droid, but I didn't know that scripting for it would make me more excited about the prospect.

Google, you coy little minx...
Is there a (long-term) goal to permit writing Android apps in these other supported languages, or is it just for quick and dirty experimentation?

This is possible. However, the first priority is to make the existing system stable, more user friendly, and to provide more comprehensive access to the Android APIs.

I'll play your game...

Tuesday, July 13, 2010

Had some serious coding problems last night

Had some fun last night.

Part of why it made sense for me to start a company for which I would have to write scrapers and scrubbers is because I really love the challenge.

Well, last night it got just hard enough for me to have fun. (that's what she said!)

I put on the headphones, cranked up the music, and stared at the code until I figured out a way to change the architecture to work within the updated requirements without rewriting the program flow (or the whole thing!).

It was a fun, creative, challenging process, and along the way I got to see how much money our program was going to save our customer by minimizing the delta between his prices and those of his competitors.

At the first small business class we went to, when asked the question "Why go into business?" I was surprised that my immediate answer was "To provide a service." I actually want to help my customers, and I know my partner does too. That's how I know we're going to go far.

Excelsior!

Thursday, July 23, 2009

Your Serve - DJ Fear

Since I'm in the coding mood, and there was a request, I've decided to post an example of what is affectionately called "Happy Hardcore," which seems to have gotten its name from Anabolic Frolic's "Happy 2B Hardcore" albums.

These albums were all we listened to when we my friend and I did any kind of work, including some serious construction. The average 140 beats per minute is like brain crack. For people like me, it also shuts down the constant unnecessary thinking in my mind, and lets me focus 100% on my task.

So now; an example...

Your Serve - DJ Fear

direct link
For more information about Happy Hardcore music, consult your local library, or click here to pump it into your ears right now.

Wednesday, July 22, 2009

Simple Math

      

            

Monday, June 16, 2008

NO! BAD! STOP!


NO, performance systems international; we do NOT sanitize our input in java!
That is how we get our boxes hacked!

Java is on a different layer than the traffic transmission. Setting a java script to limit input of a record search number from 1-100 will do nothing when someone modifies the HTML POST on its way out, and changes 50 to 1000000, instantly tying up your database with a single request. Or perhaps you are trying to remove special characters? Can you say; SQL INJECTION?

We sanitize our input on the BACK END...
Say it with me; BAAAAACCCKKKK EEEENNNNDDD

You know how you defeat back end limits?
If you code it right; you can't.

NETWORK SECURITY IS EVERYONE'S RESPONSIBILITY.

YES, EVEN LAZY CODERS.

Wednesday, May 21, 2008

Speaking of Swordfish

I spoke earlier of Swordfish coding, and how silly it was.

I forgot to mention that I have been accused by a coworker of pretending to be programming Swordfish style.

When you type as fast as I do, and do your coding in an entirely keyboard-controlled editor, it just sounds like you're exaggerating your typing speed... Grossly.

Now whenever he sees me coding, he always comes up behind me and says, "...enhance..."

Tuesday, May 20, 2008

Program for Google... TO THE EXTREME!!!!!11

I'm a great coder, but I don't know if I'm an
EXTREME PROGRAMMER!!!!1111ONE

What the hell is "extreme programming"? Is it anything like extreme ironing?

I dunno, maybe they should hire this guy. His programming in Swordfish could have been described as "extreme." They probably could have hired a computer consultant to give an idea what programming is REALLY like, and how to make it more exciting, but I think they might have ran out of money after bribing Halley Berry to show her sweater puppies.

Friday, April 25, 2008

I <3 Screen (again)

GNU Screen is civilization.
GNU Screen is god.

GNU Screen is godilization.

GNU Screen is GODZILLA!!!

I need to find out if it's legal to marry a computer program in California. (shit it probably is)

Maybe I'll just print the source code out, and bind it into a book so we can hang out.

And video tape it.

And dub over it with Best Friend.


...


....hmmmmmm...


Beloved Screen

Thursday, April 24, 2008

Too much coding.

I'm coding so much I end my IM messages with semi-colons.

Monday, April 21, 2008

Holy shit!

Whatever you do, don't accidentally hit caps lock in command mode while working in vi.

Shit goes crazy!

Wednesday, April 09, 2008

*sigh* Back into coding mode.

Not that I mind coding mode... It's just that it takes a bit to switch into it.

I was in coding mode yesterday writing some SQL queries for about 3 hours. Today, my coworker said he couldn't run the code. Somehow the stored procedure was cached for me, or something, because I would run the procedure with an EXEC, and it would work, but when he would run it, it wouldn't. The error seemed easy enough because the code broke in a way that made sense, and after about an hour of cursory testing, I finally got it working... Except the output was wrong, and in a way that DIDN'T make sense. Bugger.

I must reenter my brain's code-mode, where all the crazy shit I write makes perfect sense.

I swear, one day I'm going to be working on a particularly tough problem, and slip into a vegetative state, only to emerge days later in the hospital with the perfect code in my head. Or more likely I'll go insane, and emerge days later in a mental institution with my code written on the padded walls in crayon.

Headphones: ON
Hardcore trance: ON
Volume: UP
Zone: OUT

Wednesday, March 26, 2008

Bifocal Brainery

For the first time in a long time I sat down to write a two page paper. An ROI for some code I'm writing. I didn't expect it to be a problem, since I knew plenty of reasons why my code was a good investment, and knew my boss would agree. (it was really just an exercise, but I was taking it seriously) So I sat down at the table, and got started with the short notes I had written Friday. My significant other began playing Bully, and turned on a CD to listen to while playing. The CD had songs I vaguely knew, and as I stared at the mostly blank screen, I realized I wasn't writing anything. I had plenty of points to make, I just wasn't writing them. Man! Why can't I concentrate? AP English was a while ago, but I can't be totally useless! I got up and stretched, got some water, and sat back down. Nothing. It was like my brain was stuck. Why can't I think?! Getting frustrated, I closed my eyes and focused on how to expand upon my first note... I sat quietly, and suddenly I realized what my brain was doing. It was singing along to the CD.

Well that's stupid. Forget the song I barely know, I need to think about this. I stare at my notes and concentrate, but can only sing along. Ok, I'm getting earplugs. I plug my ears and sit down to concentrate. Beyond the ringing of silence I can still pick out the lyrics, and can't think about anything other than those lyrics. I get frustrated and grab my The Saint - Soundtrack CD (my first CD and most favorite CD) and a pair of headphones. Quickly all outward noise is drowned out by The Chemical Brothers - Setting Sun blasting in my ears.

Suddenly my mind is clear. I focus on my notes, and an hour later, I'm done.

I can't do this with a song with a lot of lyrics, speech part of the brain can only focus on so much and still allow me to talk to myself. When coding I only listen to hardcore electronica (http://tinyurl.com/ccsps), and it helps me think. Obviously it's not just for coding. I like the idea of both sides of my brain working at the same time.

This experience reminded me of when I used to live with some friends, and came home with my girlfriend to find one of my friends asleep on the couch, with the stereo blasting heavy metal. I wondered aloud how she could possibly sleep with all that noise (this was before I liked metal). My girlfriend reminded me that I can fall asleep to my favorite music. I understood what she meant, but it still seemed odd at the time. Now, it makes perfect sense.

Thursday, February 14, 2008

Please enter banking info to continue

There seems to be a lot of interest in checking your bank balance from your phone. Enough that I considered turning it into a service, but I keep wondering if people would be willing to provide their banking info to a unknown service just for the convenience. Though, being in the computer security field, I fear more that people WOULD be willing. That was why I supplied the code, so people could run it on their own boxes without having to trust someone else with their info. Also, I just remembered the legal requirements for storing that data. Bugger.

Maybe I'll just try to make the programs easier to run, and more accessible to regular users.

Friday, January 25, 2008

Semi-coders and pseudo-code

Coworker: Hey, really quick, I need you to write a quick script to generate a config file for, like 800 elements.
Me: Give me the data, and an example of the output you want, and give me three minutes.
Coworker: Three minutes? Ok, only if it's really quick, though.
Me: I'm waiting for the data really quickly.
Coworker: Yeah yeah...

Minutes pass

Me: Hey, I'm almost done.
Coworker: Huh?
Me: Actually, I'm not, because you haven't sent the data over.
Coworker: Ahh, shaddap... So, can you just send me an example of your code so I can write it?
Me: What?
Coworker: Just send me an example, and I'll just write it. I just need an example of a loop.
Me: You want me to send you an example of the most basic programing function a language could have, so you can write some pseudo-code and then make me troubleshoot it when it doesn't work? No deal.
Coworker: But-- fine.