Ubuntu 12.04 is my primary OS, however, there doesn’t appear to be many guides on installing the Sun/Oracle JDK on Ubuntu.
In case someone else finds it useful, here’s what I did on my 64 bit Ubuntu 12.04 install:
1. Download the Java SE Development Kit 6 Update 38 for Linux x64 from http://www.oracle.com/technetwork/java/javase/downloads/jdk6u38-downloads-1877406.html (The [...]
Ubuntu 12.04 is my primary OS, however, there doesn’t appear to be many guides on installing the Sun/Oracle JDK on Ubuntu.
In case someone else finds it useful, here’s what I did on my 64 bit Ubuntu 12.04 install:
1. Download the Java SE Development Kit 6 Update 38 for Linux x64 from http://www.oracle.com/technetwork/java/javase/downloads/jdk6u38-downloads-1877406.html (The filename should be jdk-6u38-linux-x64.bin and NOT jdk-6u38-linux-x64.rpm.bin)
2. Make the file executable: chmod +x jdk-6u38-linux-x64.bin
3. Extract the file ./jdk-6u32-linux-x64.bin
4. Create a directory called jvm in /usr/lib: sudo mkdir /usr/lib/jvm
5. Move the extracted JDK directory into /usr/lib/jvm: sudo mv jdk1.6.0_38 /usr/lib/jvm/jdk1.6.0_38
6. Make it the default JDK in the system:
sudo update-alternatives –install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_38/bin/javac 1
sudo update-alternatives –install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_38/bin/java 1
sudo update-alternatives –install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_38/bin/javaws 1
sudo update-alternatives –config javac
sudo update-alternatives –config javaws
sudo update-alternatives –config java
If you want, you can add the JAVA_HOME environment variable to point to your new JDK installation as:
export JAVA_HOME=/usr/lib/jvm/jdk1.6.0_38/
and now you can put the JDK binaries like java, javac etc. as:
export PATH=$PATH:$JAVA_HOME/bin
Sticking those two statements in your .bashrc would ensure they always stay in your path across.
Edit: You can also enable the Java plugin for Chrome and Firefox as:
sudo ln -s /usr/lib/jvm/jdk1.6.0_38/jre/lib/amd64/libnpjp2.so /usr/lib/mozilla/plugins
Some of the developers I have worked with on smaller projects have never used Git (shocking, I know), and I always end up having to give them a very basic tutorial just to help them get up to speed.
Since I’ve already done it more than a couple of times, I thought I [...]
Some of the developers I have worked with on smaller projects have never used Git (shocking, I know), and I always end up having to give them a very basic tutorial just to help them get up to speed.
Since I’ve already done it more than a couple of times, I thought I should write a post about the absolute minimum every developer should be aware of when starting to use git to collaborate with other developer(s) on a software development project.
Note: I prefer using git from the command line. Most linux distributions should come with git pre-installed. If you don’t have it or you’re on a mac, you can download it from the official git downloads page. If you’re on windows, you can use mysysGit, which comes with bash. (Secret: if you’ve always missed bash on Windows, this can replace cmd.exe for most command-line work)
First, you should know how to clone a repository. Most of the times, if the repository is hosted on a hosting service like GitHub or Bitbucket, this consists of copying and pasting one git command from the website, like in the screenshot I took from bitbucket below:
Now, you should have the files for your project in the directory you cloned your repository.
Then, once you’ve worked on your project (i.e. added/modified/removed files), you can do:
git add -A
which basically tells git “hey, I’ve modified stuff and I want you to know about them”.
Then you can commit your changes as:
git commit -m "message"
where ”message” is a little note describing what you’ve changed.
After this step, you want to pull for any new changes that may have been made. This is important, and is often forgotten by beginners. Between the last time you cloned/pulled from a remote repository, there may have been changed committed to the files by another member of your team, and you want to get those changes and deal with any conflicts at this step. I thought this tutorial had a great discussion on handling merge conflicts in Git.
After you’ve taken care of any merge conflicts you may have had, it’s push time. This is as easy as
git push origin master
which tells git now that you know what I changed (using git add -A) and how I described what I did (using git commit -m “message”), I want you to take my changes and send it to the remote server where everything is hosted.
This, in my opinion, is the bare minimum that every developer should know about git. While what I’ve described is in no way comprehensive, it should be enough to get started on a project that’s using Git for source control.
Once you feel comfortable with all this, I recommend you check out some tutorials available online. If you like videos, O’Reilly has a great one hour video tutorial on Git. If you like traditional books, the Git Community Book is probably the most authoritative, comprehensive and up-to-date guide, and it’s available for free (I had their chapter on branching and merging bookmarked for many months when I was first learning this stuff).
I also have a printed copy of this Git Cheat Sheet on my desk, and I find myself frequently looking up stuff at Everyday GIT with 20 Commands Or So. I also found the Git Workflow essay by Benjamin Sandofsky a good introduction to basic workflow.
Update: The Git Basics Tutorial by CodeForAmerica/Skillshares is really good for beginners as well.
I’ve been trying to switch to Vim from TextMate as my default text editor, and I’m constantly stumbling and learning in the process.
One quirk I dealt with recently was spaces. Well, yeah, spaces.
I liked using Monaco as my default font on TextMate and Xcode when I’m working on Python scripts or on iOS [...]
I’ve been trying to switch to Vim from TextMate as my default text editor, and I’m constantly stumbling and learning in the process.
One quirk I dealt with recently was spaces. Well, yeah, spaces.
I liked using Monaco as my default font on TextMate and Xcode when I’m working on Python scripts or on iOS apps, mainly because characters are distinct, and it is difficult to confuse 0 (figure zero) and O (uppercase O), or 1 (figure one) | (Vertical bar) I (uppercase i) and l (lowercase l) – which are all characters that occur a lot in programming. So I wanted to set it up as my default font on GVim on Ubuntu. I got a copy of it and installed it just fine, and set it as my font on GVim using the menu.
To make it my default font, I went ahead and opened my .vimrc file, and when I looked it up on GVim (using set guifont?), I saw this:
Then I added the same line to my .vimrc as
and it wouldn’t work. Whenever I started GVim, it would complain that it didn’t understand the .vimrc file.
After searching online and looking up a lot of forum posts, I learned that Vim does not recognize spaces in arguments. So I actually had to add a backslash (\) after the first word if I wanted vim to treat the next word as part of the same argument.
And it worked!
Now I’ve been using it in more places where it’s appropriate. For example, if I have a long piece of text and I wanted to replace apples with yellow oranges, I could just do
:%s/apples/yellow\ oranges/g
and voila, every occurrence of apples will be replaced with yellow oranges.
Maybe this will help another struggling Vim user someday!
I’ve programmed both in the academic setting and in industry. In college, I’ve been in research projects, directed readings with professors, developed apps and an autograder, and had a great experience doing so. I’ve also done programming in industry, actually worked on products that have shipped to users. Most of my work in industry has [...]
I’ve programmed both in the academic setting and in industry. In college, I’ve been in research projects, directed readings with professors, developed apps and an autograder, and had a great experience doing so. I’ve also done programming in industry, actually worked on products that have shipped to users. Most of my work in industry has been either embedded systems programming or enterprise application programming.
A lot of people seem to think that programming in academia isn’t real world programming. While I agree that four years programming in academia solving theoretical problems in C or Matlab isn’t going to make you a rockstar in implementing RESTful web services in Java or .NET, I do think the core programming skills and principles carry over nonetheless.
In this post, I would like to highlight some of the differences I’ve noticed in my experiences with both so far.
One of the major differences in my experience between the two domains has been guidance. If I’m stuck on something in college, even if this is as trivial as figuring out the best practices, I can bounce ideas off my professors, and they understand that I’m learning by doing and are usually accommodating. An elegant solution is preferred over a hacked together solution, and you are encouraged to learn best practices doing it.
Now, I’m not talking about a programming assignment for class here. I’m talking about projects done under the guidance of a faculty advisor.
My experience in industry tells me that the some product is better than no product rule takes precedence over anything else. If you cannot figure out the most elegant way to do something, hack something together to have a working solution. If time and budget permit, you may have a chance to later go back and fix it, although sometimes you may not. You may have a mentor assigned to you, but he’s busy doing his stuff and will usually try to point you to something, and if it doesn’t help, and you are on your own to figure it out. If you ask TOO MUCH, you’re probably a bad hire.
Another difference I’ve discovered is documentation (comments in code). While programming in academia, if you do not document your code, someone’s going to get upset because they do not know the language you’re using and can’t figure out the algorithm, or just because you’re not following what has been taught in your courses. In industry, regrettably, no one has the time for extensive source code documentation. Maybe it’s just that I’m working under experienced professionals who know what the code does by just looking at ten lines out of a 500 lines class implementation, but such has been my experience. After all, were you hired to produce products and services or to write pre- and post-conditions for your methods?
I’m sure I’m not the only person who’s wished that this would change. For a developer, comments in source code are more helpful than external documentation any day.
Academic programming also tends to have evolving designs and architectures. Trial and error is better than something set in stone. A professor would rather work on an interesting problem than have meetings to discuss an architecture document. After all, wasn’t I supposed to have taken a software engineering class?
Programming in industry will always have written architecture, design and other documentation. If not, it’s probably not a real project.
I will admit that I’ve programmed more in an academic setting than in industry, but so far, I think there’s pros and cons with both, and both would do themselves a favor if they learned from each other.
UPDATE: I also posted this question on the stackexchange programmers community, and I received some very interesting answers. Here are some of them:
In a traditional undergraduate computer science program you learn just programming. But industry doesn’t want people who are just programmers, industry wants real software engineers. I know many job descriptions don’t seem to know the difference which only confuses the matter, but in the real world you need to be able to:
Gather and analyze requirements, when they aren’t directly given to you
Design and analyze architecture, with near endless possibilities
Create test plans and act on them, to evaluate and improve the quality of a system
Work collaboratively on a team, of people with different backgrounds and experience levels
Estimate and plan work, even if you don’t know exactly what to build
Communicate effectively with stakeholders, who have different needs that don’t necessarily align
Negotiate schedule, budget, quality, and features, without disappointing stakeholders
Oh yeah, and you also have to be able to write code too, but that’s, on average, only 40 – 60% of a software engineer’s time.
So, it’s not that freshly minted computer science undergrads don’t know how to program (many are in fact, very good programmers) – it’s that many of them don’t know how to do anything else!
University
(I call this scenario university, because programming as an actual computer scientist is also different than what you do while studying)
Your teacher gives you:
A well defined, isolated problem, the solution of which can be provided within a short and well defined time span and will be discarded afterward
A well defined set of tools that you were introduced to prior to assignment
A well defined measure for the quality of your solution, with which you can easily determine whether your solution is good enough or not
“Real World”
In this scenario:
The problem is blurry, complex and embedded in context. It’s a set of contradictory requirements that change over time and your solution must be flexible and robust enough for you to react to those changes in an acceptable time.
The tools must be picked by you. Maybe there’s already something usable in your team’s 10 year old codebase, maybe there’s some open source project, or maybe a commercial library or maybe you will have to write it on your own.
To determine whether the current iteration of your software is an improvement (because you’re almost never actually done in a software project), you need to do regression testing and usability testing, the latter of which usually means that the blurry, complex, contradictory, context-embedded requirements shift once again.
Conclusion
These things are inherently different to a point where there’s actually very little overlap. These two things work at to completely different levels of granularity. CS will prepare you for “real world” software development like athletics training would prepare an army for battle.
Academia is mainly focused on the “science of programming” thus studying the way to make efficient particular algorithm or developing languages tailored to make certain paradigms more expressive. Industry is mainly focused in producing things that have to be sold. It has to rely on “tools” that are not only the languages and the algorithms, but also the libraries, the frameworks etc.
This difference in “focus” is what makes a academic master in C practically unable to write a windows application (since we windows API are not in the C99 standard!), thus feeling as it is “unable to program”. But, in fact, he has all the capabilities to learn itself what he’s missing. Something that -without proper academic studies (not necessarily made in Academia)- is quite hard to find.
I work from home for a company where we write enterprise Java web applications using Spring, Hibernate for Tomcat and use Maven. A couple of months ago, when I started working from home, my manager agreed to buy me a copy of IntelliJ IDEA so I could be more productive [...]
I work from home for a company where we write enterprise Java web applications using Spring, Hibernate for Tomcat and use Maven. A couple of months ago, when I started working from home, my manager agreed to buy me a copy of IntelliJ IDEA so I could be more productive than when I was when I was using Eclipse (which is an IDE I love and still use for other projects, but is also a memory hog).
While I have been using IntelliJ for sometime now, I haven’t had a lot of success in configuring Tomcat to run through the IDE. I followed the steps on the official help page, but it didn’t seem to work with my Maven project. So I added a configuration descriptor to Tomcat to load the target directory of my Maven project each time it loads and when I want to run my code, I produce an exploded war through IntelliJ and then run Tomcat externally.
When I had to debug my code, I would print out debugging statements which would help me narrow down the places in my code where the bug was, and then I would just inspect it manually. Not really the best way to debug code, but I really didn’t have the time to integrate Tomcat into IntelliJ.
Last night, I had a NullPointerException in a Java Spring project I’ve been working on for a couple of months now, and this approach didn’t work, and I set out to integrate Tomcat with IntelliJ once and for all.
When I had first tried to integrate Tomcat with IntelliJ, I had followed the steps on the Jetbrains Wiki and that worked just how it was described, but when I tried to run or debug my Maven project through IntelliJ, it just would not work.
After a lot of Googling and Binging *wink*, I had found no single source that explained how this should be done, and I spent a major part of last night just playing with different combinations of the different settings and was finally able to set it up correctly (I hope). Now, I am able to run and debug Maven projects directly through Tomcat and trust me, life is better.
I’m not sure if there’s other people who’ve been through the same experience as I have, so I’ve decided to put together this guide. Hope someone who is in the same position as I was yesterday will get something out of it.
1. Add your Tomcat configuration to IntelliJ through Settings -> Application Servers -> Add. Both Tomcat Home and Tomcat Base Directory should be set to your tomcat installation directory (e.g. C:\Tomcat6.0.33)
2. Add a Run/Debug Configuration to your IntelliJ project.
3. Click the + and add a new Tomcat local default configuration. Give it a name and you can have it start your browser automatically and go to a startup page.
4. On the Before Launch frame, check Make.
5. Click the ellipses (….) button next to Build Artifact and check exploded war.
6. Similarly for Maven, click the ellipses (…) button next to Run Maven Goal and select package.
7. On the Deployment tab, in the Deploy at Server Startup section, add a new Exploded war Artifact.
(Steps below show how to configure the IntelliJ debugger to connect to Tomcat)
8. On the Startup/Connection tab, Select Debug from the left pane and set the port to 8000.
9. Create two new environment variables (Directions here for *nix and Windows)
JPDA_ADDRESS=8000 JPDA_TRANSPORT=dt_socket
And you’re set. Now when you click Run or Build, you should see maven packaging the project and work it’s ‘magic’, and then Tomcat should run with the new app!
While now it seems simple, this was not at all intuitive when I was first tried to set all this up. But now that I have got this set up, my workflow is a lot improved and I can go back to focusing on the code!
Alternatively, if you wanted to run your project outside of IntelliJ, you can put a configuration descriptor into your tomcat/conf/Catalina/localhost directory to automatically look in a directory and deploy it every time it starts. For my QEF project, I have a file qef.xml that looks like this:
<?xml version="1.0" encoding="UTF-8"?> <Context docBase="/programming/appQef/target/qef"> <Manager className="org.apache.catalina.session.PersistentManager" maxInactiveInterval="600" saveOnRestart="false"/> <ResourceLink name="jdbc/qef" global="jdbc/qef" type="javax.sql.DataSource" /> <ResourceLink global="config/machine" name="config/machine" type="java.lang.String"/> <ResourceLink global="config/envType" name="config/envType" type="java.lang.String"/> <ResourceLink global="config/envLocation" name="config/envLocation" type="java.lang.String"/> </Context>
Now whenever I want to execute my program, I build an exploded war through IntelliJ and start Tomcat, which looks for the exploded war in the given directory and automatically deploys it.
Thanks to this and this, I was able to figure it all out. Thanks Matt and Piotr!
Hope this will help somebody out as well.
Here are some screenshots of WritingBuddy, available for iOS devices (iPhone, iPod, iPad).
Here are some screenshots of WritingBuddy, available for iOS devices (iPhone, iPod, iPad).
Here are some screenshots of Paigow (full version), available for iOS devices (iPhone, iPod, iPad).
The graphics for this game were created with the help of Ayushman Das, my 13 year old brother!
Here are some screenshots of Paigow (full version), available for iOS devices (iPhone, iPod, iPad).
The graphics for this game were created with the help of Ayushman Das, my 13 year old brother!
Here are some screenshots of Paigow Lite, available for iOS devices (iPhone, iPod, iPad).
The graphics for this game were created with the help of Ayushman Das, my 13 year old brother!
Here are some screenshots of Paigow Lite, available for iOS devices (iPhone, iPod, iPad).
The graphics for this game were created with the help of Ayushman Das, my 13 year old brother!


























