Tag Archives: environment

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)

Bots – BOring Tasks Systematized!

We are surrounded and supported by a bots ecosystem. I will try to bring that into perspective to evaluate the current rate of explosion of bots and newer solutions coming around it — and how to stay human still!

Connected with the Bot Ecosystem!
  • When we wake up,with help from an external alarm clock , we are taking help of a Bot.
  • When we are parking our car and when reversing it, there is a smart system that warns us for the exact safe-distance to keep going. That’s a smarter Bot!
  • Notice the cool soap dispenser that spits soap when we put our hand under it? That’s a Bot!
  • Recall the automated vacation response you configured in your favorite email client? Well, you have guessed, that’s also a …Bot!

We have never thanked these systems for their existence, for we know they are physics concepts glued together mechanically. A Thank-You comes and goes via a heart! 🙂

Coming back to the topic, now imagine all of those Bots, fusing into a single system with a human structure!

SuperBot
Hey, I am SuperBot and can do everything that was listed above & much more!
  • What was your reaction when the last time, your car backing system told you incorrectly that you were 1 meter from an obstacle while there was a gap of roughly 5 meters!
  • When was the last time your alarm clock did not wake you up?(battery out or way too low?)
  • Isn’t it way irritating when the mechanical soap dispenser does not spit the soap, instead only throws out the air?
  • Haven’t we all misfired a wrongly configured vacation response and feeling way embarrassed and apologizing for it for all day long to colleagues and co-workers!?

As for the premise, these bots *independently* do their job perfectly. But when they break, nothing else is affected around it. Well I am yet to hear about misconstruing a vacation response due to a non working soap dispenser!(all right that’s way too much exaggeration — but we get the point!).

The fact that they are disconnected, allows us, the user of that system to fallback/switch to another means. Say the car backing system is down, well ask a passerby to help you. Your alarm clock is out, well start working on your body’s alarm clock(no excuse here!).

I will construct two hypothetical views that are actually happening in the bots eco-system and obviously I am opposed to such developments. Hence suggesting a way out, as I cannot stop these movements.

  1. Once these systems are connected, and one of its components starts acting strange(see I elevated it to a human), the whole behavior might be eccentric to say the least. If your SuperBot is out of battery, it might just get you to wake you up but might not be able to help you with and send the vacation responses.
  2. Add the internet to the mix!

    I’m out of order but controlled via the internet.

The take away from the whole story:

  1. Let us as individuals, not try to fuse all our bot dependency into a single system. It makes it highly probable to fail and although it gives us lot of convenience, but at a high cost of dependence. This whole connected thing is a convenience at the cost of our freedom.
  2. The most secure sites are still subject to theft/fraud ( I am only referring to financial losses). When a fused bot with the thinking of the whole internet is there, and one small error/condition unchecked/unnoticed will be not safe, to say the least.

As for the bots ecosystem, I would love to see

  • a centralized parking bot, letting a big relief to all humans from this petty job
  • an aerial bot that delivers newspapers

But then again, I won’t allow either of them talk to each other, A single Bot good for One Task. 🙂

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! 🙂

Javascript muggles don’t mess with Java’s strong type def structure!

Yes, this is going to be a rant post!

If you are in sync with the recent developments happening in/around open jdk you might have come across the JEP-286 | Local-Variable Type Inference

This JEP has been authored by none other than Brian Goetz and endorsed by Mark Reinhold himself(Yikes!).

I will straight away come to the points why I(no-one) vehematically (n:vehement) oppose this improvement!

  1. Code is read more than just written.
  2. There is max context when someone is writing an implementation for a method! All context needs to be dumped then and there. By bringing in this change, all this context will be lost for ever!
  3. This change introduces the idea of “I know its suppose to return X”, there will be no way to verify the claim, except the compiler-interpretation.
  4. Such changes belittle the language semantics! Well remember this: Milk of a lioness can be held in a gold container only else it goes sour! Java respects this semantics as of now! (Its really cool!).
  5. You can leverage power of automatic type suggestions while one is on RHS of the equation/statement, which has given a great boost to the language via lambdas. LHS *has* to be clearly defined.

Following are demo videos showing how easy and quickly one can do an alt-enter in your favorite ide and have the LHS of the assignment automagically inferred!

1/Simple example from the JEP

 

2/Complex examples using files from the same JEP

local_var_file

 

There are couple of surveys seeking public opinion on the same here are their links:

  1. Survey 1
  2. Survey 2

Finally, if you have seen Mark’s Java 9 intro speech, he starts off by talking about

1/No copy pasting a feature from any language just because its cool!

2/ Readability:

This JEP is not only killing Readability, but its not consistent across the language.!? There goes universality and compatibility into the garbage collector!

Let’s just keep evolving without giving up the things that make Java really stand strong on its feet! #DieJEP286

Brute force AI : You don’t train the robots!

Isaac Asimov established three laws for the AI world:

  1. A robot may not injure a human being or, through inaction, allow a human being to come to harm.
  2. A robot must obey orders given to it by human beings except where such orders would conflict with the First Law.
  3. A robot must protect its own existence as long as such protection does not conflict with the First or Second Law.

While studying A.I. we never questioned the validity of the 3rd law! What is existence — for a robot? Did we ever question the existence of the refrigerator and ever wondered how it *felt* when we are away for a long holiday? How is a robot different from a refrigerator?

Automatic Doors Have Feelings?

For most of us human-kind we are yet to understand consciousness at an individual/self level, forget re-imagining it(ha ha ha ha ha!) for a mechanical thing! And now we come to the moot point of this post – Why on earth are we training the robots?

Allow me to put things in perspective:

We train things where there is scope of learning. Try to picture this: need to learn = knowing you’re lacking something + you value what you want to arrive at!

Can a robot fit into this definition?

Would you ever want to teach your refrigerator to not give ice cold water to the elderly guest coming for the evening?

Would you ever want to teach your television to turn the volume down during the wee hours of the day?

Just because the refrigerator and the television have evolved to the structure of a human body, do we start believing them as humans?

Why should a human body only evoke human feelings of caring/empathy?

As the robots evolve in physical,analytical capabilities, we as humans are bound to develop attachment to them! Its our nature to en-lifen what crosses our path!

The problem comes when the thing starts to get reciprocated and we go into the spiral!

That cannot happen!

We waste precious time thinking/exchanging human feelings with a machine trained & programmed to behave as humans! Already there are dozens of problems to be solved and addressed at the individual level and we bring an inconsequential no-op to the equation!

Bigger / Better Things to figure out?

Human-Kind put to shame at the end of the following video:

For the sake of humanity, we should not do such things! We are trying to train the robot to complete its work, inspite of the human obstructing it to complete its task? I leave the dark consequences of this dare for you to figure out! I will summon The Terminator to my help!

Call this guy now!

To summarize:

  • You don’t train a robot (You are wasting your time if youre doing this)
  • You program a robot (You do it once and forget it for-ever!)
  • You can train a human (You may come across donkeys too!)
  • You cannot program a human (Except self, tread with caution!)

Please don’t code the heart into a machine!

(Brought to you by yet another reflection/inspiration via @ideapreneur)

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!

Securing your AWS instance!

A daunting task of getting the things secured in the app! Here’s a plethora of links that can help anyone lost/looking to get it done!

  • Cant trust https? Well, roll out your own, AT YOUR OWN RISK!(A must for even https GET calls)
    http://dacrazycoder.blogspot.in/2013/09/encrypt-url-parameters-using-aes-in.html
  • openssl | Getting started with the certificate
    https://www.digitalocean.com/community/tutorials/how-to-install-an-ssl-certificate-from-a-commercial-certificate-authority
  • Look here if nothing works!
    http://www.thefarmdigital.com/blog/technology/how-do-i-setup-ssl-on-aws-elactic-load-balancerelb/
  • FF issue(double check in the browser too!)?
    https://sslanalyzer.comodoca.com/
  • AWS docs(perfect example of information overload)
    http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/configuring-https-elb.html
    http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.managing.elb.html
    http://serverfault.com/questions/356598/why-cant-i-reach-my-amazon-ec2-instance-via-its-elastic-ip-address
    http://serverfault.com/questions/238976/cname-to-aws-public-dns
    http://pushentertainment.com/rds-connections-by-instance-type/(DB)
  • Testing what you have
    http://mxtoolbox.com/productinfo/domainhealth
    https://www.sslshopper.com/ssl-checker.html
    https://sslanalyzer.comodoca.com/
  • Small things(Hacks!)
    http://stackoverflow.com/questions/22290821/using-a-wildcard-ssl-with-a-cname-pointing-to-ec2-instance
    http://passwordsgenerator.net/

Dont forget, if you have a front controller for your aws, you need to apply the certificates there also!

And finally once all is set up turn off your http listeners for port 80! 🙂

And here’s a link to end the atrocities of the monopoly of the so called CA’s : https://letsencrypt.org/ 😀

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.

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.