Tag Archives: hands-on

Sculptor’s Log

There was once a log, ready to have a meeting with the Sculptor, getting ready for the grind!
Casually it approached the scene, not knowing what is to happen to it next,
Waiting to see who/what is the Sculptor is and what can he do for it?
Seeing a couple of wasted logs around the scene, it could not resist but ask their state!
They said in chorus – “One word, Do as the sculptor says” as they were tossed out of the view.
“Ahh, What could the Sculptor ask me to do” was the only thought pacing up and down the log’s mind!

Log being chiseled!

And the moment of the log’s meeting arrived…
Placed in the hands of the Sculptor, the log could not giggle profusely!
And then.. Bam! Sculptor’s chisel tore apart a big chunk from the log.
And the log screamed to the Sculptor, “What are you doing, please stop”
The Sculptor stopped, and asked whether the this log did not have a chatter with other logs?
The log said, “They said only-to listen to you,they did not tell you’ll make me undergo this chisel”
The Sculptor looked clueless, and the log asked itself to be excused.

After some time of pondering…
The log thought of going through the process as one strike a day…
And the deal was made…
Days,Weeks,Months passed and the log took the blow daily and frowned and complained..
And then one fine day, the Sculptor said to the log, I’m done with you.
And then the sculpted-log was moved to a different place — not knowing where and for what, it cooperated!

Being sculpted

A few days later…
The log was placed at a higher platform, and then by chance it got to see itself in a mirror!
And it could not believe what it could see — A beautiful deity crossed its sight.
Not believing that was It, the log waited for another such day and then the belief was confirmed.

Outcome of fore-bearing the chiseling

The log had a good after thought..
All the suffering, the chiseling, was given to it for its shaping.
Had it complained and not gone through the grind, it might have become another wasted log…
Thanking the Sculptor, (and the wasted logs for the advice), for his efforts, it just smiled.

(This post is inspired from a story over-heard — all images are googled, no claim on ownership)

Autos hold the key to the future of self driving cars!

This is part-2/epilogue to an earlier post title Why is new-style(apps based) cab booking still a mess?

In my recent bad-experience with the cab booking scenario, I decided to try out the autos on a similar route of commute! Fortunately, I can shout out to an auto-walla from my home and there is never a dearth of options thanks to the auto-wallas agreeing to go by the meter!

Time for a good detour of the main route?

What is the most weird mode of transportation you have ever been subject to?

My 7 km long most weird transport medium! [PS: I was not driving! ;-)]

While keeping a tab on the state of self driving cars, and the experiments being done, no wonder the google-car looks so much like a delhi-auto!

Delhi-auto as google-driverless-car!

And having experienced first-hand the skills of an auto driver, I am inclined to suggest,for any thinking future self driving company, if you are looking out to train your cars, reach out to the auto-wallahs!

Here are the motivations:

  1. Lowest ground distance — matching to the sef-driving car’s design.
  2. They know the best routes — Point A to Point B, you end up spending 500 bucks or 250 bucks!
  3. They know how to best absorb a speed breaker cruising @ 25 kmph and make you feel as if you’re flying!
  4. They know how to best wake you up(in case you start to feel dizzy) by bumping you in a pot hole!
  5. I have never heard/read about an auto wallah being involved in an accident( a quarrel is not an accident) — Best premise for self driving cars!

What I am suggesting is have the driverless cars minds trained by putting an Augmented Intteligence chip in an auto! First ride, they just learn what is the route all about, good roads, bad roads,bumps,breakers. In latter rides, they should pick up: speed up/slow down suggestion,collision detection, collision prevention, safe stopping etc. All this should happen in shadow mode, where in realtime the chips response and the actual response should be monitored! Once an acceptable level of confidence is arrived at, let the chip start talking about its suggestions. Once the driver starts trusting the suggestions, go auto-pilot! 🙂

Also, I doubt if the driverless cars are made to ride as a sensitive travellers? Like lets say someone cannot handle bumps as efficiently as a child can, Do these vehicles cater to this requirement?(PS: auto wallah do cater to this requirement!)

The future of driver-less cars is exciting, but the possibility of breaking it down is also very high, as someone can use a VR thingy and make the AI sensors of the car sense that an obstacle is coming and in reality there is no obstacle and eventually a future race of hacking driver less cars where you’ll come across advt like “Make the other driver-less cars around you go automatically slow”

My car makes other cars give me more way!

In closure, The roads will be way too full of cars and quarrels, we should look up! 🙂

Why is new-style(apps based) cab booking still a mess?

I assumed this new style will beat my old/traditional way of the whole cab experience, but HELL NO!

Every riders woes – Minutes before boarding a cab!
  1. Booking beforehand
    • Apps:You cannot book the app based cabs beforehand. One service allows, but only 0000 to 0700 hrs ? That’s superb customer service, Their systems maybe do not take peak hour requests!
    • My Way: Go ahead and book the cab even two weeks ahead and the cab will be right there for your need!
  2. The day of the booking
    • Apps: You forget about your last minute travels plannings, instead dedicate one human to constantly check for cab availability.
    • My Way:No problemo sire! We’ll be there and we’ll also carry your luggage from your house to the cab!
  3. At the 11th Hour of the booking
    • Apps: Hope you get through “ride now” option! And if you cancel, you are logged out of making any further bookings! Grr!
    • My Way: We will be there in exactly 10 minutes! Unfailingly!! (beat this experience!)
  4. The cab is there — where?
    • Apps: I am standing here, where are you (happens atleast 2 times) + Sir I thought booking was for 1130 hrs, you are coming after half hour, please cancel your request + Sir, you please cancel as you are not coming + Once I had this cab driver run away,with the cab, right infront of my eyes! That was so sorry look on my face!
    • My Way: The cab is visible right infront of your gallery!(Beat that! again? anyone??)
  5.  The ride begins
    • Apps: Sir, which route?. Hope you know where to go. We’ll ask someone there.(spend 15 minutes searching and asking everyone around)
    • My Way:Sit back, relax, sleep, They tell me when the spot is reached!(They use their phone for reaching the destination! -Ain’t that smart!)
  6. Post-The-Ride :: Tu Kaun?
    • Apps: me:Thank you for not abducting me and extorting money!
    • My Way: me:Thank you for taking care of my traveling woes!

Although “My Way” is 2x cost wise, but other comforts are simply not comparable! I can quote 10 more other problems with the apps. It’s still not my preferred way of traveling!

Driving dislikes me! I am interested to reach my destination with least hiccups!

I’ll post a follow-up with the state of self driving cars!

The Sound Experiment ~ Internet Radio setup

Internet Radio

 

Internet radio is an age old concept, that I first got awed using my nokia e 51(RIP). Getting advt free 24×7 guitar songs was a super surprise! And this week I got the opportunity to help set up the infra for a similar requirement!

Here are the lessons:

Enter Windows:

If you are a windows user, you have lots of quick support setting up a winamp backed shoutcast dsp based streaming solution, right from your desktop! Select a playlist and redirect it to the dsp, Viola: You have your local playlist being streamed to the world to enjoy!

Enter mac:

Coincidently, the winamp software is not available at its full fledged version for anything other than a windows! So the previous solution falls on its face!(You get winamp, but not plugins et al). So you have to try:

1/Broadcast Using This Tool

Screen Shot 2016-01-10 at 2.21.29 pm

The problem with this tool is it cannot hijack a running audio, instead, it can only take an input from a device(like mic). Any 3rd party tool that mocks a running audio into a once coming from a device might make this tool very useful! Its a super trimmed down version for anything broadcast!

2/Nicecast

Screen Shot 2016-01-10 at 2.23.04 pm

Nicecast is good for the naive user, but it has a limitation of noise messing(deliberate overlay of a noise sound) after 60 mins of broadcast. The quality of broadcast with Nicecast was even better as compared to winamp solution and aint it cool they provide you with a url in realtime! Sadly their trial version does not let you play with shoutcast streamings!

Update 3: No need to buy the licence :-(, you can link shoutcast servers from nicecast in their trial!

Enter Linux:

Did not try it, but if you are on a linux system, you have to try liquid soap, for the pure fun of command line!

This is what liquid soap does from the command line — Thats autoDJ mixing powers! Way too cool 🙂 Muse is another option worth checking out on a linux distro!

I did not go full fledged to try out unattended hosting(autoDJ), but there are host of plans/providers for that requirement(links shared below).

Useful links:

Video Tutorial: https://www.youtube.com/watch?v=K_rMNo4tkJc

Get free hosting — http://myradiostream.com/get-started/

Another free hosting — http://www.caster.fm/

Not India specific(free autoDJ) — http://free-shoutcast.com/

Free/Small AutoDJ account — https://shoutca.st/

THE STREAMING SOFTWARE — https://www.dyne.org/software/muse/

THE STREAMING COMMANDLINE — http://liquidsoap.fm/index.html

Streaming options — http://blog.wavestreaming.com/5-best-client-broadcasters-to-stream-live/

Various baud rate files — https://www.fastserv.com/kb/article/mp3_bitrate_selection_and_samples/

Talk on baud rates — http://blog.codinghorror.com/the-great-mp3-bitrate-experiment/ and http://sound.stackexchange.com/questions/26222/are-there-any-audible-differences-between-192-and-320-kbit-s-mp3-files

I wish we had more native radio streaming service providers on the web (esp India), why that is not the case maybe due to radio not being accepted as a medium people prefer to hear!No doubt it is the one with max reach!

Also basic things like, why a low encoded audio only does not play well on one stream and a high encoded music play flawlessly on the same stream -Are questions that still bewilder me to an extent! Time to pick up the baud rate/bit rate/encoding/decoding concepts and revise!

Any sound engineer around!?(pun intended!) 😛

Update: The super fast audio hiccup, could be due to chipmunk effect!

Update 2: This experiment is not complete without referencing to podcasts! And here is the magic portion! 🙂

Further monetizing the audio is also an option which shoutcast provide by stealing 2 mins of your stream time and plugging in their advts! IMO, with things that go straight from the ear to the heart, advts should be avoided! Even if its the extreme nuisance of hard rock music or the sound of rain drops & thunder and anything in between! A way better option is get the subscription based model upfront(maybe with a trial of a week or two) and then people choose to keep or trash!? 😀 🙄 ??

Update 4:

AND THE WINNER IS: http://shoutca.st !

Reason:

  1. They give you 50 mb free auto dj.
  2. They give you servers in France(most reliable country in tech!)
  3. They run liquid soap underneath! Yay!
  4. Their solution is cross-platform.(read:cloud)
  5. Their interface is typical of a french mindset! 😛
  6. You can switch to live telecast whenever you want!
  7. They offer icecast and shoutcast v2!

Take my word for it, go for it, for a truely awesome streamed internet radio( minus podcasts) setup solution!

DejaVu : Web Services!

For the un-initiated, I am working on my lesser liked topics in the programming world, JS and WS!

I had recently started appreciating the WS without XML/Annotations a few weeks back, but to my surprise, the XFire implementation is no more supported in Spring 3.x hence I had to fall back on XML and Annotations.

I could come up with a working example of contract first WS development from here, and I was happy to see things working as expected, except for the inherent pain of seeing and using XML/Annotations.

This made me re-visit my understanding of whether to use java-first or wsdl-first approach for development.

I was initially a supporter of java-first simply due to my dis-liking for XML, now it seems a wsdl-first approach can keep the concentration of implementation towards the data structure of the messages that go to-and-fro.

That said, if I develop a java-first implementation, and give the 3rd party implementation team the link to the wsdl, does the 3rd party implementor stand to loose anything?

Either way’s even if they are using something other than java to consume the services, they have to wrap the response as per their conveneince, the only tradeoff that I seem to have is the structure of the wsdl message is not the fundamental change item, but the java method arguments become the items that define/control the change.

The only flexibility that I might be loosing here is the power of functional programming language, as-in imagine if a functional programmer implements a wsdl as per my current understanding, I question, does that programmers changing of the wsdl based on the arguments that come and go, affect(ease/pains) my implementation?

To conclude, do I stand to loose anything if I *still* go the java-first implementation way?

Your thoughts?

~rohit.

Debugging JSP Request/Session Variable

Of all times debugging jsp code is the most challenging of all times to me that anything else.

And for that, I came across the linked jsp and the following code snippet in the footer jsp of the application:


      <%@include file="/WEB-INF/jsp/debug_session.jsp"%>

keep the debug_session.jsp as per the path defined in the above snippet.
To check all request & response variable while developing, just update the current url as:

  
http://localhost:8080/context-path/login.jsp?debug=jsp

And you can easily check all variable without trying to search them in the request object on your IDE, while debugging!

Here is the debug_session.jsp

~rohit.

Requirements Tracking- Yet Another Format!

Couple of days back at work, I got my first opportunity to document the requirements for a particular moderation flow.As a practice we document everything in microsoft project management tool(read: ms word).

And the pain of tracking the changes, without review/comments is unacceptable!

Hence with the motivation set in, this is the template that I could come up after a *lot* of thinking:

As a I want to do … So that… Only If… My action affects…

and here’s an instance of an entry derived from that template:

moderator See new artefacts  entered by users I can validate the contents. There are new artefacts available in the system. Displaying the artefacts with ability to go to next artefact and/or approve/disapprove them.

I have modified the actual text that was prepared for generality and not keeping office work in public!

Incase you have not already guessed, this instance deals with viewing artefacts for moderation.

While preparing this template, I was not cent percent aware of the domain that I was dealing with and also, I was new to this module, maybe that can work in favour of most people in similar situation!

What do you think? Does this template gives you the ability to cover all/most scenarios in your development story?

Feedback welcome!

~rohit.

The social media thing!

Recently at work, I was given the task of implementing social engagement buttons for the likes of Google +1, Twitter, Facebook, LinkedIn.

And the successful implementaion was in two phases.

The first phase: Installing/Configuring the scripts for inclusion and second was testing them out!

Here comes the comparison of their usage:

Ease of finding share buttons.

Here LinkedIN fared last(it took me some time to reach the actual page)), while facebook came second last(it was simply not intuitive to see what changes were getting affected) and google just beat twitter for better placement of the generated script.

Basis: Easy finding + Instant display of customization + Zero extra effort.

Size of included JS

Here FB was last with 100+KB of script, while other three were quite okay, seemingly under 29KB all three combined.

Basis: Don’t know why FB is pushing so much client side javascripts?

Ease of understanding the tag’s

Here the clear winner is twitter, as they simple do a script include and use an anchor tag! It can not get simpler than this. Google came second by making it complex by adding their own custom tag. FB was ugly, while LinkedIN was pathetic, as there was not handle that I could find in their code!

Basis:I am a non-UI guy, so and anchor tag + js include sounds like I am at home!

Alignment on the UI

Twitter and Google fared quite well here, as placing them in a span/div tag, did not distort their buttons, whle FB and LinkedIN folks seems to have done a sloppy job here. Try putting a div around them and you might see their button’s vanishing at times!

Basis:I should be given complete freedom to place the button’s where I like’em.

Getting them to work!

All 4 of these scored 0 on this front. I wasted one whole day trying to figure-out the reason for these tag’s not working on localhost. Surprisingly they require a live public url for them to work fine!

Very dis-appointing!

Basis:I suppose I should be able to test on local how these buttons look for testing!

After getting them to work!

Al most all of these have a bug that if I delete the publicly promoted link/url/etc, the count does not seem to come down accordingly.Strange, but true.

No – Thank You!

For incorporating all of them I had to create a new id and register. I am glad I did it that ways, because LinkedIN was all over me pouring all their corporate tie-ups link/spam/trash all to me and making me a subscriber by default. Also reading the fine print LinkedIN seems like they are selling all infromations to 3rd party affiliates without a clear consent!

Going through FB and twitter settings was also a pain, did not go through details on +1!

Basis: No thanks for the spam!

The inclusion codes for each of these are available on these sites:

1/Google +1 2/Twitter  3/Facebook 4/LinkedIN

Well after checking out the code on a live public url, I suppose the feature would easily come out, but this was an interesting learning experience about how do folks at big public organizations code!

Twitter seems to be leading in this front by keeping it really simple!

~rohit.

Zero Fat( read: XML), Zero Cholestrol(read: Annotations) Web Services!

I have never been an advocate of XML per-say.
And I was faced with the difficulty of writing one recently overwhelmed by the amount of XML and Annotations, well I was looking forward to a hard day ahead. 

Then motivated to defeat XML in my own war, and reducing its footprint in the codebase I am working on, I put on the searching glasses and XFire came to the rescue(credits to them for integrating WS in the most cleanest manner done with Spring, that I know of!)

Now that the plot is set, here’s simple how to:

Presumption: You have two different projects one is the WS other is the consumer of the WS.

Step 1/ Write your service and its implementation in the WS project.
(eg: XXXService/XXXServiceImpl for the project YYY)

Step 2/ Configure the usual project as a spring web project.

Step 3/ Add the following snippet into the web.xml(append incase you have contextConfigLocation predefined.). This makes your project XFire aware.

  
    contextConfigLocation  
    classpath:org/codehaus/xfire/spring/xfire.xml  

Step 4/ Expose the service as Http WS through XFire Exporter:

    
                
                
                
        XXXService    

Step 4.2/ Inject the Service Impl Bean.


Step 4.3/ Configure the Url for accessing the Service.

    
        
                                                

Step 5/ Deploy the WS project an tomcat/jboss.

 

|| End of Server Side Configuration||

Step 6/ Test using the soap url:: http://localhost:8080/YYY/XXXws?wsdl

Step 7/ Configure the XFire client on the other project as follows:

    
      XXXService        
      http://localhost:8080/YYY/XXXws?wsdl    

Step 8/ Inject it in your client

  
      

Step 9/ The client should be configured as::

public class WsClient{    private XXXService xxxService;}
|| End of Client Side Configuration||

Step 10/ Done!

Things to remember::
1/The Java Interface XXXService needs to be shared with the client.
One can overcome this by creating a third common project shared for the WS Provider and WS Consumer.

2/Any changes in the WS provider, would require re-deployment of the first project.
This is the least a java developer(xml unfriendly) can absolutely live with!

3/Once these configurations are done, forget that you ever need to look into the xml’s!
Also any change addition/removal of the methods that needs to be exposed will be purely a java exercise, without requiring to smell XML.
Well you won’t be able to find any xml!!!, thanks again to the wonderful folks at XFire!

PS: All these steps are written here with the help of http://xfire.codehaus.org/Spring+Remoting and implementing this in a production environment!

Hope this helps you in reducing the amount of unnecessary XML’s in your java projects!

~rohit.

Stable Dev Environment?

Once upon a time there was a Q&A that happened as follows…

Q:So when can you say that your local dev environment is ready?
A:When you have run a comprehensive unit test, pre-existing or drafted yourself.

Q:What is a comprehensive unit test?
A:One that covers all major components of the architecture you are working on.

Q:What can be the major components of an architecture, one may be working on?
A:Layer Code, deployment, DB, Jndi context, orm context, 3rd party API context.

Q:What’s your point?
A:You environment ain’t ready until all your environments are not accessible from your box. The best way to ensure this is with a unit test and know thy environment!