Past is new future

Past Present Future traffic sign on a sky background Stock Photo - 13599282Do you ever heard “past is new future” ? maybe yes maybe no. But somehow I realize since few years back the saying is true. As a human, we expect to get new experience, but not all of us are imaginary person like Rowling or other fictional series author, hence we need reference to build new experience. And the best reference is actually our own history. Thus, technically our new idea to build the new future is most likely an adjustment fro what we have on the past, or even worst identically same with the past but with new price hehehe.

————————

When first time I know cell phone, it was big and heavy. For some year after, prestige of cell phone could be seen from it’s size, smaller the phone, the more prestige owner would have. But after a decade, luxury come when phone size was big, remember Nokia 9 series anyone ? the first black and white smart phone.

After that era, again cell phone back to smaller and smaller. It is time when first camera technology and colorful screen embedded into cell phone.

When BlackBerry ruled the world with their communication strategy. The need of QWERTY keyboard arised. Big cell phone with QWERTY keyboard become new standard of prestige. And with new innovation on screen technology, cell phone again have new demand to be on larger dimension.

————————

What happened to cell phone is just an example about how past is our new future. There are many other we can use as case study of this hypothesis. Automotive industry, music, fashion design and many more.

So how is your past ? and which one will be your new future

When melodious Qur’an recital disturb another muslim

Maybe because too boring at home during holiday season, bunda and both princess visited me at office today at end of office hour. They said would like to force me to buy new pants, because some of mine had been unsuitable and I always delay to buy new one. We decided to go to Pavillion Shopping Center, which about few steps away from my office. After bought 2 pieces of pants at my favorite fashion outlet, we went to Surau for Maghrib Pray.

Surau at Pavillion located on 5th floor, the place is nice and convenient. However, the space is too small for big shopping center like Pavillion, especially today when the mall been crowded with so many persons due to long holiday season.

After took my wudhlu, I queued for pray. It was long queue, when some of them able to go inside the surau to perform their pray, I was stuck at surau’s entrance waiting for first group to finished theirs. The Imam, pray leader, was a middle eastern 40th years old, he has a very nice voice when recited Qu’ran, it made me so complacent. But it was not for long, I realize the Imam recite long verses and looked like has no stop, while maghrib time is considered as shortest pray time for moslem. I observe the queue, it get longer and longer.

Finished with first rokaat, the Imam did again for second rokaat, he recite long verses of Qur’an. Some of us who queue for pray began to grumble. We try to code to Imam, and some middle eastern voiced loud enough in their language asks the Imam to finish their prayer.

Finally after 25 minutes of waiting, this group finishing their prayer and we can overtake the Surau for us to pray. Though, still some people need to wait longer, because by that time we had about 35 people outside.

I am not best muslim, my Qu’ran recital is far from melodious, my pray can’t be considered as khusyu. But I am quite furious when my right to pray persecuted by certain person who feel have higher knowledge, or perhaps indeed they have better knowledge than me, but really they don’t know how to apply those knowledge on real life.

Second Imam who lead my Maghrib pray was another middle eastern 40th years old, he also had nice voice of recital, but this time he choose only short verse of Qur’an to be recited … ah finally … an Imam who understand.

If I am a CEO, I will make all “kecepit” day as holiday

imageThere is a phrase “hari kecepit” in Bahasa Indonesia, a definition for a date between 2 holidays. Dec 24th 2012 and Dec 31th 2012 are examples of those days. From my business point of view, during this day, pace of business is slowing down. People are tends to plan their annual leave around the dates. Those who doesn’t, most likely will come to work with motivation half than regular day they normally have. Plan to go home early for another agenda, good quality time with loved one, hunting for long await items, or simply just hangout with best friend forever are things roam in their mind when work during so called “kecepit” day. Hence I get an idea and post as status update on my Facebook and Twitter, “If I am a CEO, I will make all ‘kecepit’ day as holiday.

Continue reading If I am a CEO, I will make all “kecepit” day as holiday

Enable and disable white-space dots appearance on Visual Studio

Accidentally when worked with Visual Studio I pressed a magic combo button and turned my Visual Studio Editor looked like below:

image

See that white-space dots before first character of each line ? It is probably helpful to see alignment and indentation level for each line, but for my eyes: monitor is fully crowded with characters. I already been fuzzed by readable character that builds my algorithm, and now I get more character which really I can’t read. So, what is the point having this white-space dots ?

Since this is new for me, I am trying to revert it back. Playing around for some time with all the menu and configuration. Started from Tools –> Option –> Editor and bunch of view item have no luck. Until for about next 10 minutes, I get the answer:

Edit –> Advanced –> View white space (Ctrl + E, S)

Ahaaa, now my screen looks clear again.

Handling ASP.NET MVC JsonResult Date Type

Working with MVC, JSON and jQuery is fun. Lots of challenges and solutions can be explored. But there always a nightmare on every challenge, and for this case is date data type returned by JSONResult of ASP.Net MVC. 

When I populate a date data type using ASP.Net MVC and return it through JSON, somehow it is serialized as something like below.

image

See that funny representation of date “\/Date(1333209600000)\/” which equals to 1-Apr-2012. I don’t know why Microsoft decided to use this lousy pattern as their data serialization for date type variable. Yes, PHP won’t do that, but currently my solution is based on Microsoft technology and port it to PHP or Java would be a big efforts if root cause is just to avoid data serialization issue.

After removing “\/” and “Date” and remains only number part, it turns the number is big integer number for date type until ticks level of accuracy.

I can’t change the way MSFT serialized their JsonResult, it is their call. But I can manage to change it on script level. And since I am a lazy programmer, rather than do like “select field1, field2, doSomeFancyDateToStr(field3) as date from some table” I will prefer to run “select * from some table”. I still need to do some data manipulation to follow local date pattern anyway on UI level. Hence I decided to change the way data represented on UI level. And I choose JavaScript as my media to change it.

So I create a simple JavaScript function and attach it to any script needs data translation from any JSON output. The script is a simple as below:

 

   1:  function jsonDate(strDt) {
   2:      return new Date(parseInt(strDt.substr(6)));
   3:  }

Then, when I want to use it on my MVC, i just call the function as neccessary. For example as below, where I use KendoGrid UI for my UI framework:

   1:  $("#gridLine").kendoGrid({
   2:      dataSource: dsLine,
   3:      columns: [
   4:          { field: "TimeSheetLineId", title: " ", 
   5:              width: 30,
   6:              template: '<input type="checkbox" id="checkme" 
   7:                  dataId="#= TimeSheetLineId #">'
   8:          },
   9:          { field: "TransDate", title: "Date", 
  10:              width: 100, 
  11:              template: '#= kendo.toString(jsonDate(TransDate)
  12:                  ,"dd-MMM-yyyy") #' }
  13:      ],
  14:      resizable: true,
  15:      autoBind: false
  16:  });

And screen will loks like as below

image

Problem solved.

Dream high, be motivated but manage expectation

MotivationIt is legal to have a dream, because without a dream there won’t be a goal and without a goal there won’t be motivation for us to do our activity.

For me, biggest dream I have is to become successful technopreneur. With my expertise and connection I have in information technology in last 15 years of my tenure, I believe this dream is not a passive dream, I have potency to make this dream come true. What I need now is constantly working step by step to turn this dream closer to reality. And again motivation is an imperative foundation to manage sustainability of my work towards the goal.

Talking about motivation. It is always up and down. Sometime when we excite much with our dream due to any factor, motivation will be boost exponentially but when it is time to review our output and things are not per our expectation, motivation will sliding down drastically.

Up and down are normal, but drastically going up or down is not good, and most of time if motivation easily going up and down will make us further with final goal. We need to manage our motivation stable. When motivation stable, our action will also be stable, and dream will be reached eventually.

There are 3 keys to manage our motivation stable, those are:

Visualize the dream

Sets our mind to see what will be the end of our journey. Be very details on this and it will helps us to know what is our main reason work so hard.

Solution oriented not problem oriented

Problem will always be there. It is law of nature. Question is not how many problem will make us far from our goal, but what learning we can get from solving the problem.

Manage expectation

Dream high, do the best, but there always a supreme power to control other else. And sometime it is not along with our expectation. Hence, manage it. Be ready with worst possibility.

So what is your dream ?

Check object existence on SQL Server using object_id function

This function will come handy to check existence of specific object in SQL Server. It commonly be used on deployment script to check if specific object need to be deployed had been exist, then further action would be assigned (ie. delete, copy and backup). It is also being used frequently on stored procedure with virtual table, to avoid if stored procedure would be stop at middle before virtual table being deleted.

Example of usage:

 1: if object_id('LedgerTransaction_Rate') is not null
 2:     drop view LedgerTransaction_Rate
 3: go
 4: 
 5: create view LedgerTransaction_Rate
 6: as
 7: select
 8:     L.*
 9:     , Year(TransDate) as TransYear
 10:     , Month(TransDate) as TransMonth
 11:     , datepart(qq, transdate) as TransQuarter
 12:     , dbo.ExchangeRate_get(C.CurrencyFunctional,
 13:         'Closing', L.TransDate) as ClosingRate
 14:     , dbo.ExchangeRate_get(C.CurrencyFunctional,
 15:          'MthAvg', L.TransDate) as AverageRate
 16: from
 17:     LedgerTransaction L
 18:     left join Company C on L.CompanyId=C.CompanyId
 19: go