Friday, March 29, 2013

Job Search Dos and Don’ts

I’m sure you’ve seen one of those articles about “10 tips for job seekers”. They usually speak to some analysts or hiring managers and get some choice quotes about what they thing job seekers should do to improve their odds of finding a job. I actually had an entire college course similar to this. The problem is, hiring isn’t scientific. There’s no “best way” to hire, so different hiring managers will give different answers.

In my course it was explained that the job seeker should always ask for when a hiring decision will be made and if they haven’t heard back by then, they should call back to follow up. My instructor explained that a job seeker should never call before then, because it would be seen as needy or bothersome to the interviewer. About a month into my job search I read an article explaining the same tip. However, the article explained one should call up before the decision date, in order to remind the interviewer of their qualifications. Clearly, these two people have a different job selection process.
So, with that in mind, I’ll try to avoid specifics, and keep in mind, every interviewer is different.

Always research the company you’re interviewing with. Be informed of recent news and what their business does.
Have questions. There’s always a “do you have any questions” section of the interview. Always have a question, even if it’s “what’s it like to work here”.
Never bring up salary. Until the offer, be as vague as possible about your price. Say you have to research it.
Be timely. Arrive on time to interviews, if not early.
After an interview, send a thank you email to the interviewer. The idea is it will remind the interviewer about you. Don’t be afraid to list some of your qualifications.
Have a 2 minute ad for yourself, as short story about your qualification. In case the interviewer asks to “tell me about yourself” or another open ended question.

Thursday, March 28, 2013

The Power of C in the Cloud

In my last post, I introduced you to the cloud IDE Codenvy. The primarily reason I used it is because it has a simply way to hook into Google App Engine. However, for a more robust cloud IDE, I would recommended Compilr. Compilr has support for many of the languages Codenvy does (Ruby, Java, PHP, Python) but it also has support for Objective-C and C# as well as low level languages like C and C++.
That last point leads to some interesting results. Because we have access to such low level languages, we can use the Compilr servers for general computing. From what I can tell, the Compilr servers that execute the code are running a Unix-like operating system on x86 hardware. So if you’re in a pinch and need access to a Unix like environment, Compilr can be very useful. I happened to run into such a situation while trying to make use of WoLF PSORT for a rather long sequence and lacking the necessary Linux PC to compile and run the program locally.
So, how do you execute commands on commands on Compilr’s servers? First, create your C++ project. Your program will be run in the “content” folder of your project so if you have any external files you need, place them there:
 

If you get an error message when uploading, but you also get “Upload complete”, you upload has finished. Refresh the page for the files to show up in the project panel.

The key to our program is the system function. Simply hand it commands to execute and it will do so. To untar our WoLF PSORT file execute the following:
system ("tar -zxf WoLFPSORT_package_v0.2.tar.gz");
Remember to mark the files for execution if nessessary:
system ("chmod 777 ./WoLFPSORT_package_v0.2/bin/psortModifiedForWolfFiles/psortModifiedForWoLF");
There are a few restrictions Compilr has placed on free accounts.
First, you are forced to make public project and you are restricted to 50 builds/runs. These aren’t huge problems and you can always create a new account and port code if you go over 50 builds. In fact I have noticed the build counter often reset after refreshing the page, so this never became an issue for me.
Second, you are limited to 4000 characters of output. A very simple solution, pipe output into a log file by appending > log.txt to your command:
system ("./WoLFPSORT_package_v0.2/bin/psortModifiedForWolfFiles/psortModifiedForWoLF -t ./WoLFPSORT_package_v0.2/bin/psortModifiedForWolfFiles/all.seq > log.txt");
You may also need to pipe errors and warning, in which case you can log to the same file by appending >log.txt 2>&1 to your command. Or you may wish to disable errors and warnings completely while still capturing output, in which you would append the following 1>log.txt 2>/dev/null .
Third, if your program has not accepted input in 40 seconds, it will be terminated. This requires a tricky work around. I ended up spawning a child process to accept input while the parent process was busy. The child process will send an alert for input every 30 seconds. If you choose to do something similar, remember to flush stdout before sleeping. The syntax is as follows:
fflush(stdout);
sleep(30);
Interestingly, this method triggers a security measure when one process exits before the other and will terminate the program. So make sure no process exits before your program has finished doing it’s work.
Some final points about Compilr:
Much like Codenvy, Compilr has issues with Internet Explorer. I managed to get it working in Firefox.
The first compile of every session will fail with “Lost connection to server”. Simply use a dummy application to trigger it and continue your work. If you run an application that takes a long time and it loses connection, it could block you from running further applications until it finishes.
Always backup your progress! I can’t stress this enough. If the server that stores the code loses connection to the server that runs the code while “Syncing application data”, you can lose large chunks of your work.
Finally, I’ve attached some sample code on the download website.

Tuesday, March 26, 2013

Programming with Java on Google App Engine

I wrote a draft post about Google App Engine many moons ago when it was Python only. As I’m not a Python man, the post isn’t very technical. Anyway, things have changed and GAE now supports Java. Albeit a customized subset of Java, which I’ll go into later.
Google App Engine is a cloud computing service: run your programs on their servers and pay by CPU usage. It’s similar to Amazon’s EC2 and Microsoft’s Azure, but unlike them in there is an absolutely free trial. You’re only required to provide a telephone number when signing up.
Step 1: Create the proper account
Sign up for a Google account here and a Google App Engine account here. After the GAE account is created, you should be prompted to create a new Google App Engine ID.
Now, if you’re like me, I won’t want to have to download and install the various SDKs and IDE to make your GAE app. So, I suggest Codenvy. Be sure your logged in to your Google account and click “Connect with Google”. Be sure you’re not using Internet Explorer, Codenvy seems to have issues with it.
Step 2: Create a project
On the welcome screen, choose “Create a New Project From Scratch”

Choose  Java Web Application (WAR) -> Google App Engine

You have to select the sample project, but you can skip using the JRebel plugin.

Use the Google App Engine ID you just created.

Step 3: Clear out the sample code

Click the project tab in the left menu (next to the Package Explorer tab)
Delete the src\main\java\com folder.
Delete the src\main\webapp\display.jsp file.
Open src\main\webapp\WEB-INF\web.xml and empty the “servlet” and “servlet-mapping” items. You can add java code to the src\main\java folder at a later time and add the proper information in these tags to specify it as a servlet.
Add the following in the “web-app” item after the “servlet-mapping” item:
<welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
 </welcome-file-list>
Open src\main\webapp\WEB-INF\appengine-web.xml and make sure the “application” has enclosed your Google App Engine ID
 Customize src\main\webapp\index.jsp as you wish.
Step 4: Run your app on Codenvy servers
Make sure you save! Codenvy does not auto save changes when building.

Run -> Run Application

Step 5: Load your app into Google App Engine:
Make sure you save! Again, Codenvy does not auto save changes when building.
Go to Project -> PaaS -> Google App Engine

Select Application Update


If you get an Oath token error:

PaaS -> Google App Engine -> Logout

PaaS -> Google App Engine -> Login

Also, see this link for setting up cron jobs.