Wednesday, October 3, 2012

Sharing engineering resources with oversight

Our team recently loaned out engineers to another team in need. Apparently the other team is burried in work. In order to make sure their time was used efficiently we also attached a Lead to the loan. The lead was able to shoot down a few ideas that were over designed and not making good use of public libraries already available.

Thought it was a great idea adding the lead

Unit tests getting an NPE on build.properties in Eclipse

Make sure you have run a build all in eclipse. Project -> Build All. Also make sure you have changed your build path and removed the "exlude *.*" from all the sections of the Source tab

Getting Pidgin to work w/Google Talk for your own domain

What a pain in the arse. I use gmail to host my own domain and getting Pidgin to work with it took a little extra effort.

Click Accounts -> Manage Accounts -> Add

Protocol: XMPP
Username: <username>
Domain: <your-domain>
Resource: Home
Password: <password>

Click Advanced Tab.
Check Force old(port 5223)SSL
Connect port: 443
Connect server: talk.google.com

Html Checkboxes

I always have trouble passing checkboxes to the server and I always forget how to do it again later. For this example we have a check boxe for the field Master . We are calling setters on the server in a Criteria object.

-In the Criteria Object

void setMaster( Boolean master ) {
this.master = master;
}
Boolean getMaster() {
return this.master;
}

-In the velocity page

<input type="checkbox" name="criteria.master" value="true">

This ensures we send true when the checkbox is checked, instead of the default "on"
If the checkbox is not checked we send nothing to the server Criteria object.

Concat/append json

This was a tough nut to crack. I scoured the internet for about an hour. This solution owes a thanks to Nikhil Dvivedi. The Javascript master.

var langObj = {
 a : one,
 b: two
}

var langObj2 = {
 c:three,
 d:four
}

for( var key in langObj2 ) {
 langObj[ key ] = langObj2[ key ];
}

langObj2 will be:
{
 a:one,
 b:two,
 c:three,
 d:four
}
If you want to get see the unicode codes of a regular varchar2 field on select in your oracle database you need to do this.

select ASCIISTR(name) from entity_table

this will display codes like this:

\30AF\30E9\30C3\30B7\30E5\30FB\30D0\30F3\30C7\30A3\30AF\30FC

instead of this:

クラッシュ・バンディクー ( actually it's a row of blocks in the oracle client )