Saturday, December 10, 2011

Backlog 3: DB, JS, Bad Code

I'm not a DB admin or DB anything, I'm just a dev
So it's no shock I have tons to learn about databases, especially Oracle
And so I was surprised to hear when Oracle would ignore indexes
Based on stats/sampling of data to determine if the index would be useful. But the sample picked might not be representative, leading to a bad plan and a SLOW query.

Recent converting of Richfaces to JQuery, attempting to use a newer JQuery than the version packaged with Richfaces. Found it needed to be loaded before Prototype but couldn't change the JS load ordering with older Richfaces version. So solution was to just remove Richfaces components which removed dependency on Prototype (so it wasn't loaded anymore).
Then multiple JQuery versions could be loaded properly using no conflict.
And the Richfaces components, like a modal, could be replaced by JQuery plugins.
In the end it worked out, but after many attempts to fix the script load order.

Another pain point that has persisted is rounded corners and being restricted to CSS2 (using flying saucer and meeting older browsers). Also annoying are browser optional display of background images on printing (seen in IE/Firefox and needed to be configured in page setup).
A nice feature I was able to use with Flying saucer for PDF rendering was image caching by url. Instead of fetching images remotely, load them from a cache by url. Especially useful for generated images (not stored to file - my use case).

I've mentioned it before, but the lone developer is dangerous,
especially without unit tests or code reviews or good sample data for testing.
How bad can it be? How about killing a production server with an endless loop?
Not just a slowdown, I mean dead and out of use.
How about causing an all day investigation taking up tons of resources?
And what is the cause? A simple condition not checked for.
It just took the right set of data to break the algorithm.
But I guess the lesson is to expect the edge cases/bad input since people are messy and defensive coding is important. And unit tests!

Backlog 2: PAX, TV

Finally catching up on some PATV and DnD.
Watched the PATV s03e01 on PAX.
Also watched the DnD videos on youtube from PAX prime 2011 with the always great Chris Perkins from Wizards of the coast. It was entertaining, but overall not as great as previous. Lots of talking with less action and the music was distracting.

Also finally signed up for PAX East in Boston and booked a hotel room.

Enjoying Fringe and the Fringe podcast.
With only 1 episode left before the 2 month break.

Also watched Supernatural (on Hulu!)
and what? no more Castiel?!
The Leviathan and black ooze reminded me of Venom or XFiles (both alien references).
Also the body duplicates / dopplegangers reminded me of earlier episodes (covered in this wiki)

Backlog 1: Computer Bug

Another bug on the computer referenced in this older blog post

To review,
It caused ping.exe traffic on port 18504, repeating sometimes every 20 seconds, and requests random IPs with the browser sometimes opening random pages as well.

Anti-virus was dead for many tried. Existing was AVG but also failed for Symantec. Sophos and MSE found nothing. Malware bytes found some leftover/trace malware (defender.exe/svchost.exe). Super anti-spyware found a rogue dll.
None of these helped, the problem persisted, with the ping exe running whenever the network was connected.

I researched and found some references that sounded familiar related to Java.blacole. And although there was an older Java JDK/JRE on the system, the browser plugins were up to date.

In the end, I just formatted and reinstalled. It was long overdue anyway from the last rebuild.
And now it is back, cleaner, up to date, and working (using MSE now).

Tuesday, November 1, 2011

Timelines and alternative universes

Another theme, especially with the latest season of Fringe.
What verse are we in again? blue, red, amber/yellow/gold? This show really likes to show different sides of the same characters.
I've been watching on Hulu, despite the week delay before episodes are available.
This has put me behind on the show and the podcasts.
At the moment, I'm loading up the last 3 podcasts, getting prepared to listen along with watching the last episode s04e04.
Being behind worked out well, I've avoided waiting during this 2 week break between episodes.

In a related note is the recent Community episode s03e04, Remedial Chaos Theory.
I really enjoyed this one, where the 6 different outcomes of a die roll are shown (and the 7th outcome of the original timeline).
And where the evil study group is created in the worst outcome, which I hope does make a return later (fake goatees and all). Which reminded me of Bizarro Sealab 2021 somehow.

Apocalypse

Seems to be one theme I've been into lately.

I was gifted Darksiders on steam for my birthday and became obsessed with it until I finally finished it.
Horseman against demons and angels. I enjoyed the story.
The Portal-ness was okay (yes portals and puzzles) as were the Dune/Tremors worms.
But I mostly enjoyed the atmosphere, and taking out a ton of zombies.

I've also been reading a book from the library called Good Omens on the similar end of the world topic.
It's good, I'm about half way through. I don't quite get all the England references, but the humor makes me think Dogma (or what little I remember).
Actually the beginning of the book made me think it should be called "A Hitchhiker's Guide to the End Times".
Angel, demon, witch, son of satan, horsemen. All with a nice modern twist, not unlike...

Supernatural, if only I was still watching it as well (to complete this trifecta), but it's on hold at the moment. I still haven't had a change to finish the last season.

Saturday, October 8, 2011

JavaOne Day 7

Traveling back home.

Checked out of the hotel.
Took the cable car at 7:15am to head back downtown with my luggage.

Hopped on the BART train that was about to leave.
Rode it for a while but had to switch to continue.
Really had to pee.
Finally was able to after I arrived at the airport.




Walked around looking at the long lines for international flights before realizing I was in the wrong area (and glad, since I didn't want to wait in that line).

Quick ride on the airport air train, walk to the domestic flights check-in.
Found also long lines, probably even longer than international.
I was also to get into a shorter line for only checking baggage by using my mobile boarding pass.
Then I was thankfully moved to a shorter security line, after a bit of a walk.
The security line was moving along and I went through the screening super fast.

Walked and found my terminal.
Picked up 2 bagels (sadly no jelly this time) and an OJ at the nearby cafe. Kept the bag to eat later.
Then sat and waited for my flight.



Flight from California is of course long just like before (5-6 hours).
I watched two movies (Green Lantern and the Prestige) with no audio on someone else's screen ahead of me (in between falling asleep). Also ate my food and read a little of my book.
Prestige made no sense to me, mostly confusing. I'll have to rewatch Green Lantern sometime, I missed chunks of that.

Arrived in New Jersey. Walked to my terminal.
Found my flight was delayed 1 hour.
Coded on laptop listening to music for a bit.
Moved after terminal was changed.
Then the flight was delayed even more, almost 2 hours.
Walked around looking for food, found a pizzaria. Picked up penne marinara and apple juice.
Went back to the terminal, played some Terraria listening to Enter Shikari until the laptop battery was empty.

Finally flew back to Portland.
Listened to the Cutting the Cable Podcast.
Got a ginger ale to drink even though I said "I'm good"



Arrived at the Portland Jetport. Waited for baggage.
Called a taxi (the same company from my travel out).
Directed the way back home (no GPS?).
Had to pay with credit card over the phone (driver didn't like this, strange since the other driver on my way out was fine with it).

Finally I was home just before 1 AM.
I had a package arrive in the mail. I opened it and found a free GSOC 2011 tshirt to add to my JavaOne collection.

Friday, October 7, 2011

JavaOne Day 6

Final day. Another full one of sessions.

Awake.
Took the cable car in to OracleWorld/JavaOne.


Walked around trying to find breakfast.
Ran into a guy on a corner suggesting breakfast/dinner places for me, after telling me about his attempts to find a job and get his resume out. Eventually he got to the point, that he wanted to get some food. I asked if he'd come with me, he said no, he just wanted the money. I said I don't have money. He said there is an ATM nearby. I said I just have the credit card. And so that was it, we went our separate ways.
So anyways, I didn't find a place to get breakfast.

Time for the Java community keynote. Here it is filling up while we find a seat:

First part was basically an IBM ad for cloud products. (did I mention how I hate the word "cloud" now).
Next was lots of pushes to use/improve OpenJDK and attend local JUGs (java user groups). I did enjoy the online voting here during the discussions (no we are not using OpenJDK, no I am not attending JUGs since I don't have time at nite).

I got a glass of OJ to drink at one of the breakfast areas. Yay, something. I didn't see anything else vegan. But thankfully I had a bar on me to eat.

Session on HTML5, JavaScript, and Java. Very disappointing. Basically definitions, update on Nashorn, and a demo of running JavaScript on JVM. I wanted the current state of HTML5, browser support, using HTML5 on Java like JSF. I wanted something relevant to me.

Session on enterprise REST. Apparently meant for architects, which is not currently me.
Thankfully there was some code (SSL using Jersey client and basic HTTP auth) but that's it.
Discuss on OAuth, versioning in URI, state in links using HATEOAS, ActiveMQ.
Didn't feel super useful.

Picked up some lunch at Golden Era nearby.
Ordered from the same girl as Loving Hut (both are apparently all vegan!)
Gourmet rice. potstickers. blueberry cheesecake.
Carried the food with me to go, next sessions coming up soon.


Session comparing the speed/performance of web frameworks (world wide wait) supporting an increasing number of users.
Fancy presentation, created demo application to review results, had hundreds of millions of records, over 16 gigs of data.
Most of the discussion was on the methodology to compare the frameworks based on cpu, memory, load time, etc. It was easy to tell that the crowd just wanted the results.
In the end for resource usage, JSF was worst, GWT was best, Spring with jQuery and JSP was right after GWT.
JSF (mojarra) was the only one that had a bad outlier result, error stuck in loop for Map access.
Cost to scale these frameworks for more users was also discussed for the memory/CPU and of course JSF was worst.
For initial browser rendering, Spring/jQuery/JSP was best and flat, JSF grew worse with more users, GWT was worst and flat (for initial load, would be better on following page loads).
Overall, GWT came out on top but is also more complex to develop. The Spring combination was second.

Ate the first half of my Golden Era food. finally!

Last session on Spring 3.1 vs Java EE 6 shootout.
Spring lost (of course) for the amount of configuration XML and code.
But it was also mentioned how Spring is more flexible and allows more configuration and freedom from container (easier to upgrade Spring library version).
And mentioned how these two can coexist.
It was a fair assessment of Spring, but I look forward to seeing where Spring goes in later versions with the CDI standard.

Finally ate the second half of my food (mostly leftover rice).

Took the cable car back to the hotel as usual.

Thursday, October 6, 2011

JavaOne Day 5

Another full day of JavaOne sessions.

And tons of rain.

Went to a session on moving from Java EE 5 to EE 6.
Discussion on what EE 6 includes (CDI, newer EJB/JPA, JAXRS), creating a war instead of an ear, removing EJB interfaces and less layers, JSF metadata and flash, Servlet 3 security authentication managed by container, JPA annotation for removing orphan from collection, cron scheduling annotation, Stateless annotation for REST JAXRS, and criteria API instead of JPA QL.

Session on API paradoxes by Netbeans architect. Dicussion on sustaining V1 of API to not break clients or use cases, process to change API, space in API for changes, handling incompatible changes for bug fix, handling versioning, behavior dependent on API consumer, moving deprecated code to optional module.

For lunch, had the same free meal from JavaOne / Mason Street. Potatoes, grapes, strawberry, wraps, soda. Again slow to get and waiting.

Played Frogger game on one of the glass top tables at the cafe. Got a new high score.

Session on Spring and WebLogic.
Touched on the WebLogic admin/monitoring web interfaces, especially those related to Spring. Used a demo parcel application using JMS with Java EE 5 and spring implementations.

EE6 best practices session! Remove 80% of legacy code!
Discussed how to cleanup code in switching to EE6. Remove interfaces unless needed. Remove DAO, less layers. Remove configuration if is default convention, not needed.
One of the best sessions, fun and entertaining.

CDI best practices session.
Review of CDI (in EE 6) based on Spring/Seam. Extended persistence context, begin and end conversation, EJB only for transaction manager and overhead.

Session on performance and scaling. Discussions on synchronization and locking (focus on path most used), volatile, thread local, concurrency version, data resizing, tools for memory and stack monitoring (mention of VisualVM, but mostly selling other tools), cache misses, more threads/CPU, false sharing. Not all that great.

Again, Loving Hut for dinner. This time with a different selection from the buffet and piece of chocolate cake for dessert.


And again the cable car back to the hotel.

Wednesday, October 5, 2011

JavaOne Day 4

The second real day full of JavaOne sessions.

Overslept till almost 8am.
Both my work and personal phones were on silent or vibrate.
Missed the Java strategy keynote.
Picked at squished, leftover carrot/nut muffin from yesterday's loving hut visit.
Hopped on the bus about 9:45am.
It followed the scenic route and I passed by huge sapphire princess boat in the harbor.
Bus dropped me off at the OracleWorld moscone buildings:


Went to a Twitter session on memory. It was interesting. Lots on JVM and code tuning. Garbage collection, eden size, primitive types instead of objects, factoring out common data, string interning

Had lunch at the JavaOne makeshift Mason Street cafe using one of my lunch cards.
Waited about 15 minutes for the food (special request I guess to get a vegan one).
Picked up an orange soda as well, even though I don't usually drink soda.
I ate and skipped my WebLogic session.


Played some pinball, game called Getaway. Walked around the exhibition room. Picked up a Spring thumbdrive and Jfrog tshirt and pen.

Went to a session on event processing (instead of my balancing performance/quality session). It was on Apache camel, I was bored and walked out.
Went next door to the balancing performance/quality session. It was discussing using the IBM jvm and tracing data. Also boring.

Back to playing pinball, tried 3 different ones.

Walked down to the Marriot for an OracleWorld session on Java EE6, WebLogic and Eclipse.
This was a lecture instead of a hands on lab. There was also no speaker. I left after waiting 15 minutes as did others.

Went to session on JAXB. It was okay, a little dry and not super useful.

Dinner at Loving Hut in mall. Got some food off the buffet this time. Potato curry, sweet and sour stuffs, brown rice. Reminded me a lot of Green Elephant. Especially with the pumpkin pie cheese cake for dessert (not quite as good).

Caught the second half of a session on security. Mostly discussing extreme password restrictions (no surprise there). Also the bads of default logins for containers and returning stack trace info on errors. Followed up by a Q&A (security dicussions are always heated/touchy).


Session on web service security. Only stayed for first half. No code samples, mostly definitions on WS-Sec, SSL, OAuth, and LOTS on OSI.

Caught the second half of the heavy loaded REST session. Not super impressed. Showed code examples of replacing a massive amount of code with a single method call in a REST service. I assume all or most of that complex code still existed behind that one method call.


I think the most useful sessions include real code samples and a good Q&A at the end.

Went to catch the bus back to the hotel.
But there was no bus (well there was, the guy said service had stopped already).
Which begged the question: Why was there sessions so late then?
I was not alone (others from OracleWorld), there was now a group of us that needed to travel back to the same Fisherman's wharf area.
So we banded together.
First idea was to get a taxi. There happened to be a line for taxis at the Intercontinental hotel.
This line was super slow and there were no normal taxis coming back (hardly any traffic on that road).
So next idea, walk around to the busier streets to get a taxi. But there were lots of others trying to get taxis.
And we kept walking until we were so close to the cable car that we decided to take that.
The group went to stand in line to get tickets.
There happened to be a cable car about to leave and since I already had my pass I hopped on.
One of the guys, a bit confused, was going to follow me on, I had to point him back to the booth to get a ticket.
It was a slow ride back around town. I was glad to finally get back. It was a long nite.

Tuesday, October 4, 2011

JavaOne Day 3

The first real day of JavaOne will all day presentations/session.
Up at 6am and out to catch but at 7am to get down to moscone and walk up to the javaone keynote.
Best and most interesting part of keynote was Mark Reinhold's with code snippets for new Java 7 features.

After this I skipped the Spring to Java EE session at 11am (and apparently didn't miss much) to get some breakfast finally.
Walked back down to the little bird coffeehouse and got another breakfast sandwich and oj. good as usual.

Then another great presentation by Adam Bien for the Java EE cool parts session. Fun, actually got me laughing. A lot of the EE features discussed sounded like Spring to me, so the shootout later this week should be good.

Next we walk down to oracle world for a weblogic applications session. This was a super fast run through using Maven to build and the Maven weblogic plugin to deploy, doing these same steps in Eclipse, and setting up this Maven build in Hudson (deployed on weblogic) using Subversion.
Most people in the session had not used and did not even know what Maven was (ugg).
We went through the PDF steps on our own, which was the only way to get through it all during the session.



On my way back, stopped at Loving Hut downstairs at a mall foodcourt. Was so excited to get to an all vegan place. I ordered the sandwich, tenders and fries, and a cupcake to go. Threw it in my bag to eat a little later.


Next was JAX-RS 2.0 session. I was mixed on it, some good new features that I found use but nothing surprising or too exciting. For example, I would use the bean validation integration to replace my custom validation, and possibly also async.

I finally sat down and ate my loving hut food for dinner.

Then I caught the end of the NFL performance session. Interesting things, I enjoyed it. Talked about use of Spring LazyDataSource to avoid checks for available database connection, using specific type in hql query when using inheritance to avoid many joins (like 12), adding indexes in the database for often used functions on columns (upper).

I went up to one of the ballrooms where I expected the Jersey session to be. Caught the end of the Jigsaw presentation when it was on Q&A. This was a bit rough with comparisons to OSGI. A lot of the talk reminded me of Maven (repos, dependencies, version ranges). I am interested to see this added if only for OpenMRS to be using a standard module system (jmod).

Finally the last session of the day at 7pm was for Jersey new features. Again nothing too exciting. Disappointed by avoiding to talk about the async server side and just plugged going to another presentation later to hear about it, and also that most of the talk was on WADL. The JAX-RS and Jersey talks were almost stepping on each others toes with the talk of async.

Back on the bus and back to the hotel.