Helping as a TA for the MongoDB M102 Spring class

I have a quick exciting announcement! I wrote about taking 10gen’s M101 and M102 online courses last fall, and about excellent quality of their videos and content.

Well, after the course completion, I was happy to learn that I got to be one of the top graduates for M102 (MongoDB for DBAs track). I did pretty good in M101 but mis-submitted one of the answers by checking an option that was too similar to the correct answer, but was incorrect.

10gen asked top graduates if they would like to offer assistance in the next round of classes, and of course I said that I’d love to help, since I’ve been really impressed by the company, their product and the education portal they put together. A few conversations later, they invited me to participate in the M102 Spring course as a TA (teaching assistant).

I’m helping out by answering questions in the discussion board and clarifying details on home work and quizzes. It’s really cool that some other discussion participants are so knowledgeable and willing to help other fellow students out.

If you’d like to learn more – 10gen Education blog is a great resource where Andrew Erlichson, 10gen’s VP of Education, writes about how they created the courses, cost and equipment involved, and even some interesting stats on the Fall semester (about 19% of students enrolled graduated with scores 65% or higher, for both M101 and M102). Check it out.

And of course, definitely sign up for the online classes – such invaluable in-depth content, and anyone who successfully completes them will get cool certificates, just like I did :P

GOOD challenge finalists announced

A couple of months ago I wrote about a great iniative from Coding for GOOD, where applicants from any background, even without prior programming experience, could take online classes and submit their projects for a chance to get a cool job in LA!

The other day Robbyn from GOOD Worldwide, reached out to me on Twitter letting me know that the finalists have been chosen! So exciting! And what’s really cool is that one of the finalists is from NYC – Ada Ng from Brooklyn. Definitely read about the finalists and their projects on the GOOD website.

And check back tomorrow, because the last round (a weekend hackathon) has been completed, and the winner is being chosen today and will be announced tomorrow! Who do you think it will be? In any case – I think it’s a really big achievement for all finalists, big congrats to each of them and kudos to GOOD for organizing this. Can’t wait to find out who the winner is and follow their brand new career gig at GOOD!

Book recommendations: January 2013

In the past month or so I managed to read 4 more books. Interestingly enough, they can be grouped by 2 themes: life stories with historical background narrated by women and World War 2 .

â??The Red Tentâ? and â??Someone Knows My Nameâ? will probably appeal more to the female audience, as there are a lot of mother-daughter lines, although the history angle might interest guys as well. I liked the 2nd book more, because of a better story development and fascinating historical background (slave trade from Africa to the Americas), but both are really good reads.

The WW2 books are â??Those who save usâ? and â??Leningradâ?. The first one is a fiction novel revolving around a life story of a German civilian during and after the war.

The â??Leningradâ? book is actually an amazing compiled non-fiction work shedding light on so many facts about the blockade (siege) of Leningrad, that were previously hidden or lied about. Now the whole picture of that horrible time, based on archives and witnessesâ?? diaries, available to the English-speaking audience. A lot of the details are really grim (and so was the reality of that time), but I just could not stop reading, sometimes late into the night. I lived in St. Petersburg for 4 years, and just trying to imagine the places I know back in 1942 was a haunting experience. Highly recommended, especially for a steal price of around $3 for a Kindle edition.

The 5th book I included is just a recommendation for the WW2-theme, a great engaging fiction novel called â??The Invisible Bridgeâ?. I really enjoyed it.

If you have any suggestions for similar books (or even anything else unrelated) – let me know in the comments, as Iâ??m always on a lookout for great reads.

Find and delete files older than X days in Unix

I wrote about setting up a cron job on my work machine to process some files in a shared Dropbox folder.

After a while, old files will start to accumulate there and I’d want to delete them, by adding another command to the crontab.

The criteria for deleting files in my case are:
– File is older than 5 days
– File has an extension .csv (keep other files like readme)
– Do not delete a few example .csv files

So HGH the HGH Unix command will look like a pipe that first finds the files, then deletes them.

find  X -exec rm {} ;

Tip from

It’s pretty easy to find all .csv files older than 5 days:

find /path/to/files/*.csv -mtime +5

And then, to exclude certain CSV files that I want to keep, I used -not and -and operators to specify filenames (test.csv, test_out.csv and input_example.csv):

find /path/to/files/*.csv 
-not -iname test* -and -not -iname input*  -mtime +5

Tip from

Make yourself dispensable?

As it often happens, had a conversation with Mike about one topic and somehow arrived to Rand Fishkinâ??s blog. In one of the posts, Rand writes about outdated advice to employees on â??making yourself indespensableâ?. This means that your company will supposedly need you so damn much, it will not be able to function without you or replace you. Evil sysadmins come to mind, or programmers that hoard their secrets and obfuscate their code, or sales people who will not share their leads with anyone.

I think itâ??s silly to protect whatever it is you do, only to make your job â??secureâ?. You shoot yourself in the foot, because if youâ??re guarding your current tasks, you canâ??t really move forward. Wouldnâ??t it be better to instead share what you do with the team, and see if they can improve on it, and have a chance to work on something else? Iâ??d also argue that job security does not really depend on how well youâ??re doing whatever youâ??re doing now/hired to do, it is how quick you can figure out new ways to do things better, how good youâ??re with your team and how much you can give to them and help them grow.

Sean, who runs Fluent, talks about it often, and heâ??s mastered the art of sharing and delegation. I remember when they just started he used to be involved in day-to-day tasks, but in the course of couple of years, by sharing what he does and delegating, he was able to move to his strategic role and do bigger things (grow and run the company), while his team keeps day-to-day work going. So I see him as a captain who started as a deckhand :) Imagine if he insisted on staying an indespensable deckhand?

*Captain who mastered the art of delegation

This is another reason why I enjoy meetups and our weekly Show&Tell meetings, because thatâ??s where you find the smartest and most generous folks sharing their knowledge. They are not afraid to lose their â??powerâ?, because their power is in their curiosity, ability to learn and teach. And this can not be taken away.

Visit Randâ??s post for his take on employersâ?? point of view and some interesting comments.

Noise vs focus

My new desk at work has very bad feng shui. In other words – it’s noisy, faces the wall and makes it almost impossible to focus. The constant buzz from the air ducts above our heads never stops. Not sure how previous tenants dealt with the situation, but I can’t last more than a few hours there.

For now I’m camping out in one of the former offices that has not yet been claimed as a conference room. And I hope I never have to leave (except for walks outside and lunches).

And it got me thinking (because my thinking is no longer interrupted) about noise. Living in the city like New York by default means dealing with noise. We have subway not only undeground but sometimes above our heads, constant flow of traffic and people, crowded streets and apartment buildings with lots of neighbors. So to keep your sanity, sometimes you have to block out all the noise and find or create some quietness.

Clutter is another kind of noise, created by physical objects around you. That’s why I’m a big fan of decluttering and not owning lots of physical stuff, because it weighs you down and lessens your ability to focus.

Same with people. Instead of trying to keep up with never-ending streams of chatter on Facebook and other “social” places, I think it is better to maintain few high quality, real-life, authentic relationships with people who truly enrich your life.

I like how in the winter after a big snowstorm, everything is muffled when you step out into the street. Snow covers all with whiteness, quiet and peace. So I wish all of us take some time this winter, and reduce all kinds of noise in our lives.

How to get great ideas

By interacting with smart people

If youâ??re lucky, you have this amazing kind of friends and with them you talk freely about anything. Absolutely anything. And when you do, randomly and magically, great ideas just pop into your head, based on the conversations you have, and you canâ??t wait to write them down and act on them.

By doing things

Working and tinkering with things leads you to other great ideas, sometimes not even related to your project. When Iâ??m working on a project, thereâ??s suddenly a lot of stuff I want to write about. And conversely, whenever I feel like I have nothing to write about – it means itâ??s time to start working on something new.

By traveling to new places

Thereâ??s no better way to break free from routine and conventions, than going to the other side of the world. And even though in this day and age, there are comforts of civilization almost everywhere, it is still amazing how immersing in different cultures, sampling different cuisines, hearing (and maybe even speaking!) another language shifts something within your mind and gets your creativity going.

By reading

Books have this magical ability to transport you in space and time, without you physically moving anywhere. And as your mind travels, it opens up to new ideas, you learn how people did things in the past, or how they are potentially dealing with events of the future, or on a totally different continent… Just make sure you read great quality literature, donâ??t waste time on vampires, nothing really you can learn from the things that could never exist.

By being annoyed

While it is not pleasant being irritated by some process that is broken, it gives you ideas on how to improve it, so that you, and everyone after you, donâ??t have to go through this pain anymore. Example: submitting paperwork in the world of electronic communications, doing timesheets, redoing same thing over and over… the list can go on.

Just make sure that you capture your ideas when they come – write them down.

How do you get great ideas? I heard people come up with them in dreams sometimes… curious to hear real world stories.

Cron job on Mac OSX that saves files to Dropbox

My work machine is on all the time, and I figured it might work well for simple tasks like text file processing:
– Take input file
– Do something with it (add information, transform text, add columns, etc)
– Save file (either overwrite old one, or create a new output file)

I used Dropboxâ??s shared folder functionality to let multiple people submit their files for processing. Your Mac will see those shared folders as local, and if you set up a cron job, you are pretty much done.

Here are some steps that can help:

  • Write your script
  • Create a folder on Dropbox. Share it with people who will need access
  • Edit your crontab. Hereâ??s a great detailed blog post on how to do this
  • Confirm itâ??s working
  • Sit back and relax, as your work is done :)

Note: remember to use absolute paths for your scripts and if youâ??re passing file/folder paths as parameters, make sure those paths are also absolute.

Hereâ??s my example:

0,30 8,19 * * 1-5 python /Users/[name]/Dropbox/ 

This runs the script every half hour, between the hours of 8am and 7pm, Monday-Friday and processes all .csv files in the designated Dropbox folder.

And here’s a simplified Python script, maybe some will find it helpful.

import csv
import sys
import os.path

for filename in sys.argv[1:]:
  # don't need to process my example file 
  # or anything with the _out in the file name, 
  # since my script creates them     
  if (filename.find('example.csv') == -1) and (filename.find('_out')== -1):  
  	# also check if script already ran 
        # and you have _out.csv file saved in your folder
  	if os.path.isfile(filename.replace('.csv', '_out.csv')) == False:
          with open(filename) as f:
	    input = csv.reader(open(filename, 'rU'), delimiter=',', quotechar='"')
	    output = csv.writer(open(filename.replace('.csv','_out.csv'), 'ab'), 
                     delimiter=',',quotechar='"', quoting=csv.QUOTE_MINIMAL)
	       rowcount = 0
		for row in input:
		  if rowcount ==  0:  # skips the first header row
		       rowcount += 1 
			# do your file processing here
			rowcount += 1

Sometimes the solution is easier than you think

I’m lazy. But in a good way. The way that makes you simplify, automate, and get rid of unncessary work.

Here’s a quick example. Our insights team had a task at hand that could not be done manually. Writing a script to do it took half an hour. They were happy. Once in a while they would send me a file to be processed, I run a simple command, and the script spits out the file with results, which I send back.

But that’s too much work. How do I remove myself out of the picture and let them handle it all? I figured let’s use Dropbox. Users drop their files into a shared folder, the script checks every so often if anything new was placed there, then processes the files and saves results.

Somehow in the beginning I got too entangled in details, thinking about a server where I’d put the script (probably Heroku), then having to add Dropbox API integration, then making sure all the dependencies are installed… Then it occured to me: my work machine already sees the Dropbox directories as local folders. Why not just run the cron job on my work machine and be done with it?

So with a little script tweaking, instruction writing and cron job testing, this is done, and I’ve just removed a task from my list (however simple it might be).