Share This

Thursday, August 7, 2014

You can be a cartoonist using a Ball Pen.

Not so professional, but using just a paper, a ball pen and a little photoshop trick will turn yourself into a cartoonist. Below, you will see a few sketches I drew with a ball pen on a paper, then I took those pictures with my phone's camera.

2NE1 sketch using ballpen2NE1 sketch character using ballpen2NE1 character sketch using ballpen
After opening the picture in photoshop, press Ctrl+L or open Image > Adjustments > Levels and the Photoshop Levels Tool Dialogue box will be shown. At the Input Level pane, adjust the sliders which map the black point and white point in order to correct the tonal range and color balance something like below.

Wednesday, August 6, 2014

The fate of Myanmar Telecommunications - Ooredoo vs Telenor vs MPT

ooredoo vs telenor the future of Myanmar telecommunication

That's another picture I drew using a ballpen and a little photoshop :) cause recently, Ooredoo, one of 3 giant telecommunications providers in Myanmar has been selling SIM cards in the cheapest price ever in Myanmar at 1500 Kyats targeting the market of 60 millions population. The news and feedbacks have been spreading across media and socialnetwork but still, Telenor, another giant, remains silent.

History
Below articles will provide you the recent details about the 3 service providers.

Sunday, May 18, 2014

Tomcat and port 80 problem on Windows

Normally, if we want to make Tomcat to listen to port 80, we only have to change its server.xml as below,

<Connector port="80" protocol="HTTP/1.1" 
           connectionTimeout="20000" 
           URIEncoding="UTF-8"
           redirectPort="8443" />

But sometime for some reason, we can't just get it right spending a few hours on it. I used to face this problem while helping out my coworker configuring the Tomcat to use port 80. I also tried installing Apache httpd to apply it as a Reverse Proxy for Tomcat but to no avail showing "service not installed" error, after checking netstat command as described below,

Friday, May 9, 2014

My thoughts on developing hybrid Android app

It's easier said than done!
Do not ever dream of developing hybrid app for complicated and responsive UI on Android prior to KitKat.

Thinking JQM or Cordova could be a life saver?
NO WAY!!

It will also screw your time and budget trying to embed ChromiumView or What? GeckoView?
... asking your customer to use chrome or to upgrade the Android is also a bad idea.

Wednesday, January 8, 2014

Iframe Communication, SOP and Cross-window messaging

With conventional javascript API or jQuery, one cannot make cross document messaging between iframes or windows because of the SOP (Same Origin Policy).
There used to be some tweaks like applying sandbox attribute, for eg.
<iframe sandbox="allow-scripts allow-same-origin" src="" />
or browser specific commands like --disable-web-security while lunching chrome
and some jQuery functions like
$('iframe#myIframe').contents().on("click","input#clickme",function(){alert('u click me');});
Unfortunately, those may no longer work on modern browsers, one may want to apply further tricks to deal with security measures.

Thanks to HTML5 API's window.postMessage, below is a working example for Cross Domain - Html5 postMessage.

Let's say I'm running two web servers locally on port 81 and 8080,
we'll have something like http://localhost:81/site1/index.html
<input type="button" id="clickme" value="click me" onclick="doPostMessage();" />
<span id="data" style="color:red;"></span>
<iframe id="site2" height="180" src="http://localhost:8080/site2/index.html" width="100%"></iframe>
<script type="text/javascript"> 
 function doPostMessage(){
  frames[0].postMessage("Hello child!","http://localhost:8080/");
 } 
 window.onmessage = function(e) {
  console.dir(e);
  var data = "Parent: i ve got sth from child.\n Data: ";
  if(e.origin == 'http://localhost:8080') {
    data += e.data;
  }
  document.getElementById('data').innerHTML = data;   
 }
</script>
And we have another page at http://localhost:8080/site2/index.html
<input type="button" id="clickme" value="click me" onclick="doPostMessage()"/>
<span id="data" style="color:red;"></span>
<script type="text/javascript">
 function doPostMessage(){
  parent.postMessage("Hello parent!","http://localhost:81/");
 }
 window.onmessage = function(e) {
  console.dir(e);
  var data = "Child: i ve got sth from parent.\n Data: ";
  if(e.origin == 'http://localhost:81') {
    data += e.data;
  }
  document.getElementById('data').innerHTML = data;
 }
</script>

Also, for security concerns, a must read article you can find it here.

Let's see a few slides embedded below if you want to read more about iframe communication.