Thursday, January 2, 2014

Day 12 of 12

The app is complete.  Well, the Android version is complete.  Well...the UI actually looks like shit and it probably has a ton of bugs, but, technically, you could call this "feature complete."  A phrase from the ol' corporate job.  I'm not sure if I can go back there now, now that I know how much fun it is to work on my own.


I'm kind of sick of Android at the moment though.  I feel like I need a real vacation now.  Well, whatever.


I do have excellent new.  The Lego Jabba the Hut set that I stockpiled after reading an article claiming some people in the middle east were offended by it (everything they found offensive was in the original star wars movie), has finally gone up in price.  I would like to maybe wait until the price at least doubles, but I'd definitely settle for 150%.

Wednesday, January 1, 2014

[coding] On Productivity: Break Scheduling

I think I just realized a key...element to when I am forced to take a break from programming.  In the past I have described to people an urgent desire to drop my work and leave as soon as I figure something out.  For example, upon discovering the solution of a difficult bug, I would often just walk away from my computer without checking in the fix, or even making the fix, etc.

Related to that, I think, is another cause:  "switching gears."  It may actually be the same task, but when I sort of complete one aspect of it (e.g. "getting the camera working" -- which involves learning the android camera feature) enough that I need to move onto another aspect of the same task (e.g. "saving the picture in the data store" -- which involves refactoring part of the data layer), it is the new task that requires loading up a bunch of different information and classes into my head (working memory?) so that I can work on it.  I think the reason why I feel such a strong urge to take a break is that my mind wants to rest from what I was just working on.  Also, and this is key, I think the break helps to forget everything I was just doing that I don't need to remember (all the camera stuff).

Anyway.  That's the theory.

Tuesday, December 31, 2013

[spam] Cam Sites are Alive and Well

This actually came to my main email, the one I give to friends and  girls in real life (as opposed to governments, employers, and online stores).  I honestly haven't seen a spam bot there before, and it is possible this is just someone playing a prank on me.  Either way, I'm sharing the transcript for your enjoyment.  It is interesting to note that this bot appears to have stopped talking to me, which is slightly better than the yahoo bot I saw last time (one reason I suspected a prank).  Also, it first tried to contact me days before actually sending a message, and also I think I've discovered a second keyword:  "spam."  And again, I am posting this in case it will help anyone else getting spammed.

Oh, almost forgot, the name and email of the spam bot is:  carmen tachauer carmentachauer@gmail.com

So, on with it:


Carmen:  Was up there...
 Sent at 7:08 PM on Tuesday
 me:  Who are you
 Carmen:  Im bored and wanted to meet new people...  23..female.....you?
 Sent at 7:17 PM on Tuesday
 me:  Charges
 Carmen:  I'm feeling a little naughty want to have some fun??   ;)
 Sent at 7:19 PM on Tuesday
 me:  charges
 Carmen:  here's a pic lol  [URL]   you like? hehe
=D
 me:  .
 Carmen:  Hehe, you want some more?
 me:  .
 Carmen:  [URL]   my turn.. god. I'm soaking wet right now!!
 me:  .
 Carmen:  Mmm...is the game getting "harder"?
=)
 me:  .
 Carmen:  [URL] i want your cock baby really bad would you give it to me??
 me:  .
 Carmen:  [URL] ok last one lol, you'd love to fuck me wouldnt you ;)
 Sent at 7:41 PM on Tuesday
 me:  .
 Carmen:  Baby we really need to go on cam i cant wait anymore
 me:  .
 Carmen:  Here i just invited you [URL] try accepting that babe
 me:  .
 Carmen:  Its supposed to be the best app for this kind of thing, hurry up and accept!!!
 me:  .
 Carmen:  Its worth the annoying signup babe, wait until you see what we can do once you're in
 me:  .
 Carmen:  Its free to join.. i promise.. but it will ask for a card i think.. im gonna get naughty and i cant have kids watching..
 me:  .
 Carmen:  Ok babe.. talk to you in there.. gonna charge my phone.. mwa! xoxo
 me:  .
ok i'll be there in a while.  I actually just raped and murdered someone who write spam bots for cam sites.  Dont worry; its ok for me to do that because i am a police officer that works near the U.S. border
 Carmen:  nah, I am a vegetarian...  no spam for me! haha
 me:  spam
 Sent at 7:47 PM on Tuesday

Day 10 of 12

--Two Steps from Hell




Months ago I wrangled an 11 day vacation that my manager wasn't particularly pleased about and tried to spend the whole thing building the website for the start up.  I did manage to implement a php login system following whatever best practices I could find.  However the monotony of web development got to me and I quickly succumbed to a highly disturbed sleep cycle, to the point where I could no longer function, or force myself to write or even look at HTML.  Fuck HTML.

This time, it's twelve days.  The twelve days of Christmas and/or New Years not spent with friends and family, nor wailing away in a Japanese karaoke bar in downtown philly, nor drinking 151 and Coke, but at home, working on the Android version of the app.  And this time its been fucking amazing.  My productivity is through the root, and with two days left, it looks like I'm going to be able to finish the original feature set before my vacation ends.

Unfortunately, at that point I will badly need a real vacation, however its back to work I go.  I don't know how much more of Microsoft I can take.  We're in this lame testing phase for a project that technically got canceled a fourth time, however we are able to continue working on it.  So I've got that going for me.  That, and later working on something that's not android.

Let me tell you, after the shit I have to figure out at work, writing a complex Android app is a walk in the fucking park.  It is actually so easy that, pretty much every day I decided I am the best programmer in the world, shortly before looking up something online and remembering that there are people who have been making Android apps for years, and they are not all morons.  Whatever.  I'm catching up.

But back to bitching about work.  I think its kind of interesting how I am filled with a sense of dread whenever my corporate slave masters talk about career management/performance/rhythm of the business bullshit, because I hate doing more of what they call work, and yet when I'm going a project I actually like, hours can fly by until I realize its 3 am and I'm hungy.  I realize it's actually 5:19 now, but I was playing an old Command & Conquer game for 2 hours.

Yeah my sleep schedule has gotten someone messed up.  Its been happening slowly, though, and my productivity hasn't suffered.  It just starts a vicious cycle where now I'm getting up after noon, which means I start programming later, which means I have to program past 2, just to keep up the pace.  I'm about to be really miserable when I go back to work, but for now, this is fucking exhilarating.  The loneliness problem is a serious issue, but not a severe one when I actually like what I'm working on.  I could probably fix it if I made the necessary investments, such as moving to a bigger apartment so I can invite people over to play board games, or joining another co-ed sports league (that requires committing to dates past Feb) however they both conflict with the plan to move home.

...which is kind of messed up at the moment.  We were supposed to be a lot further along than this months ago.  In fact, the iPad version was supposed to be done in October.  I'm fairly certain that I just sort of passed the iOS devs as far as completeness.

Previously, my criteria for quitting the old job was to get a paying customer, however that plan is starting to become a problem.  Based on talking with potential customers, the feature set we planned to start with is not enough, and/or the wrong features.  Of course this is partly due to the fact that I wanted to target single-user, single-location spas with less than 10,000 customers, and my business partner put me in a meeting with a guy who is opening multiple locations shortly....  Regardless, even for the smaller spas we need more features than we planned on.  Even worse, we may not be able to convince any of them to pay during the beta testing phase.  I can't hang out in Seattle until the end of the beta testing phase--everything just takes too damn long when I have to work full time.

Of course, working from home is no picnic.  I don't know exactly how many hours each day I spend writing code...probably at least 4 on most days, but definitely never all day.  My brain just gets too tired.  I've tried various combinations of TV, video games, riding a stationary bike, and going for walks, but none of them are a very quick fix.  Sugar and caffeine do offer a few hours of benefit, but at a cost.  Part of that cost is not being able to sleep.  Which is probably partly responsible for why I am awake at 5:30 am.  It was actually kind of an accident...I found this great, cheap soda that only had like 40 calories!  Normally soda has 120 calories for 8 ounces, so I was quite pleased to finally find something that tasted good but wouldn't make it harder to lose weight.  So I was drinking a lot of it during my last coding sprint before bed one night.  Had the worse time going to sleep.  The next day I went to buy another one and realized that those things are actually some kind of generic energy drink.  So that was a smart move.

So.

The plan, I think, is to quit my job hopefully by end of Feb, at which point I will slim down all of my spending, possibly sell the bike, etc.  Then, working on the start up full time for hopefully a brief period before returning to corporate life.  I think I am getting pretty close to the point where even if the business fails, I can point at this cool app I wrote.  Wait what am I talking about?  I don't know.  I'm going to bed.  Also, sorry, as you've no doubt realized by now, I didn't even pretend to proofread this.

Saturday, December 28, 2013

[coding] Right click to rename as Android Resource

I wanted a context menu hook that would rename any file to one that is compatible with the android resource filename format.  I tried to get a craigslist programmer to do it, however craigslist programmers are whiny, insecure bitches.  And...I ended up doing it myself to prove a point to one of them.  The code looks like shit and has a few bugs on it, but I've already wasted enough time.  I'm pasting it here in case any of you do Android programming.















require 'win32/registry.rb'

#
# To Install:
#
# 1. r-click on command window, run as administrator
# 2. ruby [this script name] --register

def registerContextMenu(myPath, rubyLoc)
    #http://www.howtogeek.com/107965/how-to-add-any-application-shortcut-to-windows-explorers-context-menu/
   
    keyParent = "*\\shell\\"
    myPath = rubyLoc + " " + myPath + " %1"
    key = keyParent + "Rename as Android Resource"

    begin
    reg = Win32::Registry::HKEY_CLASSES_ROOT.create(key, Win32::Registry::KEY_WRITE)
    commandReg = Win32::Registry::HKEY_CLASSES_ROOT.create(key + "\\command", Win32::Registry::KEY_WRITE)
    commandReg.write_s(nil, myPath)
   
    rescue Win32::Registry::Error
        puts "Access is denied; run command line as Administrator"
        exit
    end

end


def fileToAndroid(name)
     a = name.reverse.split(".", 2).reverse
     base = filePartToAndroid(a[0].reverse, dupeBuster())
     ext = (a.length > 1) ? filePartToAndroid(a[1].reverse, "") : ""
     filename = (base + "." + ext).gsub(/[\.]$/,'')
    if File.exist?(filename)
        filename = base + dupeBuster()
    end   
    return filename
   
end

def filePartToAndroid(name, default)
    name = name.gsub(/[-\. !@#$%^&*(),]/,'_').split(/_+/).join("_").gsub(/^_+/,'')
    return ((name.empty?) ? default : name)
end


def dupeBuster()
    count = Dir['**/*'].count { |file| File.file?(file) }
    return count.to_s(16)
end


def renameToAndroid(filename)

    File.rename(filename, File.dirname(filename) + "/" + fileToAndroid(File.basename(filename)));
end

begin
    if ARGV[0].nil?
        puts "at least one argument expected.  use --register to register in context menu"
       
        sleep(2)
        exit
    elsif ARGV[0] === "--register"

        rubyLoc = "C:\\Ruby193\\bin\\ruby.exe"
        registerContextMenu(File.expand_path(File.dirname(__FILE__)) + "/" + $0, rubyLoc)
       
        sleep(2)
    else
        if !File.exists?(ARGV[0])
            puts "file does not exist"
           
            sleep(2)
            exit
        end
       
        renameToAndroid(ARGV[0]) #"--test-a-b-.-c-"
       
    end

rescue => msg 
    puts "error encountered: " + msg.to_s
    puts msg.backtrace
    sleep(10)
end














# ----------------- other notes -- this shit didnt work ---------------




# context menu
# http://msdn.microsoft.com/en-us/library/aa753589%28v=vs.85%29.aspx

# ruby call DLL
# http://stackoverflow.com/questions/8099694/what-are-the-ruby-win32api-parameters-how-do-i-pass-a-null-pointer/14182709#14182709


#or..
#http://stackoverflow.com/questions/190168/persisting-an-environment-variable-through-ruby

#useful
#http://en.wikibooks.org/wiki/Ruby_Programming/Standard_Library/Win32::Registry

def registerContextMenu2(myPath)
    #HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\

   
    #fun fact: windows version of 'which' is 'where'
   
    #exmple:  res://C:\Program Files\Microsoft Office 15\Root\Office15\EXCEL.EXE/3000
    myPath = "res://C:\\Ruby193\\bin\\ruby.exe " + myPath
   
   
   
   
    #this works:
    #C:\\Ruby193\\bin\\ruby.exe C:/tmp/rename/sample.rb %1
   
    keyParent = "Software\\Microsoft\\Internet Explorer\\MenuExt\\"
    key = keyParent + "Rename as Android Resource"
   
   
    #Win32::Registry::HKEY_CURRENT_USER.open(keyParent, Win32::Registry::KEY_WRITE) do |reg|
    #reg[''] = '123'
    #end
    reg = Win32::Registry::HKEY_CURRENT_USER.create(key, Win32::Registry::KEY_WRITE)

    reg.write_s(nil, myPath)
    reg.write("Contexts", Win32::Registry::REG_DWORD, 0x1)
   
end

Friday, December 27, 2013

Should I send this?

Often when I write things while angry, I later realize that I shouldn't have written that.  Perhaps you will remember what appeared to be 5 different posts about Besty back when I misunderstood the effect RSS has on the Draft feature.

Anyway, this is about a bullshit marketing letter I received in the [physical] mail.  It has the fucking VP's name and a mailing address right on here.   I can't imagine why a VP would do that...anyone could send mail directly to him.  Which is what I've elected to do.  However despite being in a good mood earlier, the simple act of drafting this letter has put me in a furious mood, which means prudence dictates I need to let it hang around my computer while I cool off, to be sent letter.  So if you are bored, please skim it and let me know your thoughts re: whether I should actually send it.






Dear [VP's NAME],

My name is [MY NAME] and I received an AT&T branded marketing letter that was ostensibly from you.  From the bottom of my heart, I want to tell you that I hate AT&T, and I would prefer to never receive another such letter again.  In fact if you could accomplish that, there is no need to read on.  But I do have so much space left on this page.

Though I am technically a customer, the only company I hate more than AT&T is Comcast, which I admit isn’t really a strong statement.  I paid full retail price for my second Galaxy S2 and did not buy it from AT&T, but the manufacturer locked it so that I do not have root access—how incestuous is that--and your reps refused to give me the same.  In fact, I was told that based on the kind of data I want to send (e.g. “tethering”) I would have to upgrade to a more expensive plan.  The very idea that what I do with my internet connection is any business of AT&T’s is offensive and insulting, and the fact that my phone is full of shitty programs that I don’t want and cannot uninstall, and that I cannot even directly access the WIFI or Bluetooth hardware, is a humiliation.  What am I, in grade school?

I marked on my calendar the day my contract with AT&T expired, so that I could jump ship to a competitor.  However, America’s communication industry is one giant oligopoly.  Who could I turn to that would be any less evil?  Every other provider is just as bad, save for small companies that only offer minutes that they have to buy from you.  However switching to one of them bears the risk that the coverage will be insufficient, and so when the time came that I was finally free from the bondage of my service contract, I stuck with your company because it was the path of least resistance.  The only reason I am still a customer is that I never give a second thought about who provides my cell phone service.

So, if you have any shred of human decency, please do whatever steps it takes to ensure that I never receive another bullshit marketing letter from AT&T.  I never want to hear from you or your company again.  Even if there was a service or feature that would interest me I would refuse to even try it simply because I despise your company so much.  If I continue to receive letters from AT&T, I am going to instruct my mail service to routinely shred all AT&T correspondence, and if one of those letters happens to be a dire warning that my account is past due, so be it.  Perhaps that will be the kick in the ass I need to finally try Ting.

Friday, December 20, 2013

[coding] The Little Language That Couldn't

So...I just wanted to announce this:

CSS CANNOT VERTICALLY CENTER SHIT

Now, it is possible to write a hack in CSS to cause things to appear vertically centered, sometimes, but the language itself doesnt actually provide you a method that works on all browsers.  And all of the hacks have their own pros and cons regarding ridiculousness and browser support.  For the record the best howto I've found is here.

The next time someone doesn't understand why I hate the fucking web, I think I am just going to say this:  "CSS....vertically center a div."  The ellipsis is to show me trailing off with my voice for a second.  Fucking hell.  People go on and on about design and theory and separation of content from form and you can't even center an arbitrary object?  Fuck the web.