Tuesday, February 15, 2011

Valentines Day in India

For Valentines Day, the majority of TWUers went to the restaurant Healthy Affairs, which is affiliated with the Sukrupa organization. The tablecloths were made by Sukrupa Creations, as were the lovely red centerpiece candles, as was the epic 3ft tall candle in the entranceway.

Healthy Affairs recently got their liquor license, and they sell local champagne and wine. I very much enjoyed the champagne, and I hear that the red wine was quite nice. The special valentines day menu was delicious. Personally, I had the garlic shrimp (i.e. prawns), the watermelon and mint mocktail, a non-veg salad (delicious mozzarella cheese, small pieces of tart green apples, firm watermelon balls, chopped head lettuce, and basalmic vinegar), and the pineapple spiced chicken, followed with a desert of strawberries dipped in chocolate and caramel.

The band that played was called The Windmills, and they did excellent renditions of love songs, mostly in English and with several great Beatles-era classics. On the walls there was an art exhibition by local Bangalore cartoonists Balraj KN and Rasheed Kappan.

healthyaffair@gmail.com
reservations or delivery: +91 80 41255073
Address:
2041, 1st Cross, 17th Main, HAL 2nd Stage, Indra Nagar, Bangalore-560008

Monday, February 14, 2011

Iteration 4, Mon

Jetty login basic authorization is not actually secure; it only concatenates the username and password and base 64 encodes. Anything that can be done in XML can be done in Java, but shouldn't always be.

If you get into hashes, you're still not particularly secure. Only when you start using salts in your hashes is it possible to escape the problem of malicious rainbow tables. And if your project is open source, then it's unwise to include your salt in the source which is going open, unless your salt generator is unpredictable. Cookie based sessions over SSL will follow logically when true security is needed.

Since iteration 1 is drawing to a close, we're planning to branch and continue development after we achieve our release candidate, so the candidate can be tested end to end.

I've been playing with EC2 for things unrelated to work, namely the git bash recursion script Maypole... which is still very basic.

Getting a working handover for the next team is an interesting problem. In general, good code explains itself, but the same doesn't really apply to build systems and to configuring local development systems.

Future TWUers: if you have Windows, dualboot Linux, ideally before development starts so you won't have to do everything twice. Keep in mind that Sonar and Twist sometimes don't keep up with refactorings of package structure and paths. Pay attention to our build monitor. And always, always check and update Mingle. Get everyone to the client site as early in the project as possible. Always invite the devs to the showcase but don't require attendance. Try to stack informative sessions immediately after standup. And remember that the buffet at the Mercurial is the best lunch you can find. Ask for feedback- it's pull, not push. Have a code review weekly and review your technical debt, but timebox it.

Apache Ivy is a .jar dependency manager, and it solves a lot of problems where we need several versions of one package for different functionalities. Without Ivy, you can get difficult to track errors if your .jars are called in an unexpected order.



And remember... there will always be "The technical TWer who likes to write their own and doesn't believe in anything." 


Friday, February 11, 2011

teaching programming

Spent part of today teaching kids to program using Scratch. I think that it's an excellent learning tool for young beginning programmers, to introduce basic if else logic and cause-effect ideas. It also has more advanced capabilities like variable manipulation. 

Thursday, February 10, 2011

Iteration 3, Thurs

Today I learned lots about PayPal in India and Etsy in general. I believe that the government of India is trying to force market pressure for a homegrown version of PayPal.

There is a Javascript plugin for intelliJ called JS Test Driver. It is useful although for small projects I guess it's just as good to use TextMate if you have it.

I also learned (from a place where I previously worked) that searching email logs can answer most of your "but what is my username?" questions.

Good client relations are very important. Sometimes this means giving small children a stuffed lion and some tennis balls, and refraining from ordering pizza. Other times, it means practicing endlessly for a short presentation so as to be ready for as many questions as possible.


Wednesday, February 9, 2011

Iteration 3, Weds

UX/UI is complicated to describe and implement. JavaScript is fun, but takes lots of lines of code. CSS is fantastic but you can fiddle with it forever.

Inspiring speakers are inspiring because they are involved in their topic.

KFC in India has veg options.

Pecha Kucha are awesome.

Tuesday, February 8, 2011

Iteration 3, Tues

Today had more string templates and more MVC pattern in Java. Lots of little details to meet sometimes volatile acceptance criteria.

An after hours project led to me teaching some basic computer skills today, and it was very rewarding and also taught me some things about teaching- namely, that doing it once is great for an introduction but won't work for skill retention. Always give the student opportunities to ask questions, because what they ask will teach you how to teach them.

DevOps is an important part of everything that we do, and I think that these articles are a good introduction to a little bit of the why and how.

A showcase is an interesting beast, and the style of it depends heavily on your audience. Technical, nontechnical, big picture, speedy, audience-driven, drawing out the audience...

Big displays on walls made out of post-its and notecards are very valuable, and there are many types of them. An iteration priority overview has a "priority line" and every time a client wants to add something to the "must do now, this iteration, today" pile, they have to take a card and put it below the priority line (which represents what will happen during this next stage of the project). As I understand it, this helps the client understand that the resources are limited and that scope creep cannot all be fulfilled in the original time period... 

Monday, February 7, 2011

Iteration 3, Mon

Giving feedback is one of the most useful things that you can do, but sometimes it's difficult to know what to say or type.

Today I learned that vimdiff exists, and that it's great for comparing long log files to see where exactly things go wrong. (It's a different matter that for some reason this one particular server behaved differently depending on where you call it from.)

I've been delving into the complexities of string templates and HTML logic as they're used in forms, and I'm becoming rather fond of both of them as much for what they won't let you do (insert logic, much, often) as for what they will let you do (put data on the screen, iterate over arrays or sets for you, and let the CSS have something to grip onto). The rationale behind the way that string templates are designed is also interesting. Hidden fields in string templates are very useful for passing data without showing the data.

To get the Ruby gem which is parsing .xls files into our database to interface nicely with the Java/Hibernate system, the current least-work solution is to export each Ruby-generated Insert statement into the large SQL file of insert statements, and then run the file from the Java code.

Bash and testbed - extracurricular stuff that I'm working on (including the somewhat messy Maypole project, which is unconnected to work- or, indeed, anything "useful" other than keeping me entertained)

Future TWUers: Cafe Thulp sells burgers made with beef. After a few weeks in India, you or your coworkers may crave these. It's a pretty short walk from the office- only about 5 blocks. Prices are reasonable, considering the rarity of what they're selling.

Thursday, February 3, 2011

Iteration 2, Weds


I will be working more with the Ruby gem roo, and also jruby. I'm looking forward to it and I believe that my teammates also welcome this opportunity.

To add a .jar file (or a directory of them) to the IntelliJ filepath, in your module dependancies tab (in the project structure dialog) add a "Module Library". There you can select a Jar Directory (from your local computer) to add. Then make sure the run profile is using the Classpath and JDK of the correct module when it runs (this is in the run config dialog).


In Java, the Date and GregorianCalendar objects are verboten when following best practice unless you have a "good reason" (i.e. not ignorance or laziness) and really Jodatime is much better and more intuitive anyway.

I've been reading through the documentation of guava, which Google's favorite java libraries.

Axure for wireframes is doing good things to my understandings of stories right now, and it seems pretty simple for the analysts to use.


Iteration 2, Thurs

Hibernate is an interface layer between Java (or .NET) and a database. Saving a change in a record in a table from Java through Hibernate to a database is as easy as creating a Session, then a SessionFactory which is a new Configuration, which you configure using buildSessionFactory. The session is your new factory, and you open a session with it. Then, create a new transaction which begins a transaction in the session. 
Dog dog = (Dog)session.get (Dog.class, new Long(1)); 
Then update your object, say Dog, with the parameters you want, like .setBark and .setFurColor. Then use the .update function of your session, the .commit on your transaction, and finally close the session. 

CCMenu is a nice small and clean build monitor. And it turns out that with a plugin you can rig it up to play a music clip which changes depending on whether the build is red or green. 

Git is an interesting beast. Hard reset is useful, and revert is easy to misuse but is still the best way to fix a broken build and get out of everyone's way (if it's not a merge that you're trying to revert).  Fetch is useful for seeing the differences between your most recent pull and the most recent state of the origin master without having to commit and stash your local changes to prevent being overwritten.




Tuesday, February 1, 2011

Iteration 2, Tues

A long morning retrospective is an unintuitive event to schedule, but sometimes a good idea, and my pair and I still got a nice chunk of work done before lunch. As part of the learning process, our team has been leveling up to the point where we self-start our internal processes without trainer (i.e. boss) supervision.

The ruby gem roo imports data from spreadsheets into wherever you want to send it- usually a database of your own. Some experimentation with it today revealed two important things:

  1. roo 1.9.3 does not appear to install its own dependencies. When using roo, write a script to take care of that.
    Dependencies of roo:
    bones (3.6.2)
    builder (3.0.0)
    google-spreadsheet-ruby (0.1.2)
    little-plugger (1.1.2)
    loquacious (1.7.0)
    nokogiri (1.4.4)
    oauth (0.4.4)
    rake (0.8.7)
    ruby-ole (1.2.11.1)
    rubyzip (0.9.4)
    spreadsheet (0.6.5.1)
  2. roo can import data from .xls or .xlsx and parse it into the variable types that we need.
An alternative to roo is Apache POI, which is written in Java and thus will interface with our system through fewer layers than roo would have to. A third alternative which we may or may not explore is to use the java bindings provided by OpenOffice. 

When it comes time to use these with parts of the real dataset, we may expedite redumping the .xls by dumping csv and checking md5sums to validate the cache. i.e, find /path/to/spreadsheets -name '*.xls' |md5sum > checksums.txt, and then use a diff to compare to the last run. 

To open any file in mac terminal, open filename.extension will accomplish the task. 

Quote: "learning what you're dong rather than how to do something" (in relation to how to find and adjust paths of inputs and outputs rather than how to do so for a specific program)

In connection with roo, I spent some time getting several haphazard installs of rvm into a more understandable state, setting a default ruby (1.8.6 because of the OSX support) and examining the different places where gems can be installed to, and the possibility of automagically-generated symlinks from all installed rubies to the system ruby's gem folder. However, it seems too complex for our current problem, and perhaps unwise in general if versions of gems become a relevant concern. 

IntelliJ library dependency filepath complexities are deceptively simple, and some of the error messages are verbose but unilluminating because in this case the desired classpath seems to match the existing classpath but the error persists, which leads me to believe that the error is symptomatic of a different problem. Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/xmlbeans/XmlException