Friday, July 29, 2011

Google Music vs. Amazon MP3 (so far at least)

So Google Music finally built a linux-compatible music manager, so I finally got started playing with Google Music. Amazon MP3 has a similar gripe with linux, but they at least allow uploads via the Amazon Cloud Drive.


Side By Side

So far the breakdown goes as follows:
- Google Music does not have a web-based way to upload my music
+ Amazon MP3 (though through Amazon Cloud Drive) can do web-based uploads
- Google Music does not have a way for me to download my music (really?! but, they're my files!)
+ Amazon MP3 has a download ability (a little buggy for linux users it seems, but it's there)
- Google Music capped my music library (is this just for beta?)
+ Amazon MP3 [so far] has given me unlimited storage for music. (this is basically paid for though, since I have purchased Amazon MP3 music)


I still can't eliminate carrying around local mp3 files on my phone since NYC subways don't have internet access [yet]. But, having the ability to stream through my albums is super helpful whether at work, home, at a friend's house, etc.


Cheers!

Tuesday, July 26, 2011

Python: Getting Line Counts of Files and Reading Directories

I have a bunch of little scripts to help out with day-to-day tasks (don't we all?). For some reason, (probably because I've been busy) I never posted anything tagged with "python". Whoa! Sharing is caring, so here it is.


import sys
import os

def lines_in_file(f):
    return len(open(f).readlines())

files = os.listdir(sys.argv[1])
totalcount = 0
for f in files:
    totalcount += lines_in_file(sys.argv[1] + f)

print totalcount

Why would this be helpful?

Well, it may or may not to you, but maybe you're just looking for a python example on how to get a line count of a file:
def lines_in_file(f):
    return len(open(f).readlines())

Or maybe, you're just looking for a python example to list files in a directory:
files = os.listdir(sys.argv[1])
for f in files:
    print f ## modified from the original script, to show you an example

How I Use It In Case You Were Curious...

So, we have this one cron job that parses through a directory that contains CSV files. So essentially, each line is a python run. Or I can also think of it as, X number of accounts are participating in Job Y.

That's it! Cheers!

Wednesday, July 20, 2011

Google+ Blurb: After I Logged Into Facebook

So I had to log in to facebook for some fun app debugging today (code rolled out today btw, yay!) and decided to poke around and see what's going on there and...not missing much at all! I've heard some chatter about Google+ being too noisy, but I seriously think facebook is noisier. Yes, the "main" stream on Google+ is definitely noisy, but you gotta remember that's all of your circles! To be honest, I pretty much only check my circle streams to filter out cruft. "What are my friends up to?": friends circle; simple. Doing the equivalent in facebook... I technically can do that, but that's only in those fb groups; otherwise, I need to go to each of my friends' pages and stalk see their recent activity, etc. but even in doing that, I'm already seeing too much. I could really care less if my friend likes "Nose-picking" or "I leveled up in Farmville". I can probably go on, but i won't. Just my $0.02. 8-)


P.S. I do, however, miss one thing: band/musician updates. I started following bands on facebook to get updates on new shows, albums, etc. here, it's all technology (for now).

Tuesday, July 5, 2011

There's a Bikeshed In The Forest

Into The Forest We Go

So lately I've been inundated with a (IMHO) very aggressive project schedule; and when I say "project", I mean projects plural since the ending of the first one overlapped with some of the discovery & design portion of the second one. Which is fine, since I've done that many of times. Though, somewhere along the schedule of the second project I started having more and more bikeshed'ing talks. Be it that I was busy or if I wasn't completely focused due to personal reasons, I fed into these bikeshed'ing talks and they kept coming and I sunk like quicksand.


Painting the Bikeshed

For those of you who come from a BSD background, you all have probably heard the "painting the bikeshed" phrase. If not, go and give it a read; even if you aren't part of the *nix scene or even if you're not an engineer; the thread will shed some light on managing projects whether personal or work-related.

Anyhow, in a brief summation: somewhere, somehow, I got sidetracked with tasks of changing certain language of front-end and etc. design-related issues as opposed to working on core-code functionality. In turn, the project needed to delay a bit.

Lesson learned: Be more vocal. Yes, let the PM know that there are bigger issues at hand and you'll get back to the miniscule issues at a later time.


Forest? Huh?

So what's the bikeshed have to do with the forest? Well, another phrase has been echoing in my brain a lot lately, and that's "can't see the forrest for the trees". It has a similar premise behind it and I thought it was very fitting, being that I've caught myself (twice now), wasting time debugging code to only later see that there was a simple error that was causing issues; the more recent issue was actually a human error and not code-related at all.

Lesson learned here: it's okay to step away for a bit to rest your brain (and your eyes!) from code.


Cheers! Code. Debug. Repeat.


Post Script

* My one delayed project was only delayed three days. We are now just maintaining code and debugging small bugs.