Showing posts with label Google. Show all posts
Showing posts with label Google. Show all posts

Saturday, October 22, 2016

Work: Psychological Safety -- an ingredient, not a recipe

This was a while back, early in the year, when someone on my team email an article published by Google about what make a good team.  The one buzzword that got thrown around was psychological safety.  Basically,the ability to express thoughts without being shamed and fail without being blamed.  If you have not read about it yet, try reading it at NYTimes or reWork
  • http://www.nytimes.com/2016/02/28/magazine/what-google-learned-from-its-quest-to-build-the-perfect-team.html
  • https://rework.withgoogle.com/blog/how-to-foster-psychological-safety/
I do think psychological safety is an essential part of a good team.  Innovation requires a lot of experiments and failures.  Getting blamed for each and every failures is very detrimental.  It would be like living with a family member who points out all your imperfection on a daily basis -- that dish is not clean, you are driving too slow, the housework is not done yet, the bill is still unpaid, there is dust on the table, the grass is (few inches) too tall now, the food is too salty/sweet/tough/bland/cold/unhealthy, etc.  Yeah... nothing said love than being reminded about every troubles and flaws.

At the same time, I have a feeling that psychological safety will ended up being the grand philosophy to create a perfect project instead of an ingredient of a good project.  Eventually, it will be re-interpret, exploited, and deemed as a wrong idea.  I like to compare this to a sugar in any cake.  Yes, all cakes need sugar, but it is not the only ingredient and too much can be bad...

After reading the articles, I have been thinking for a while about my own situation in life, and came to the conclusion that the three ingredients that make a good team are...
  1. Knowledge -- the logical thinking and technical ability to get things done.
  2. Passion -- the drive to bring people together and motivation to get things done.
  3. Compassion -- the openness to changes and acceptance of failures.
From my own 11 years in software development, I have worked on 12 teams (the privilege of being in a Tiger Team), two of my top three managers have nothing to do with Computer Science major.

In shortness of time, I have to stop this post now...  Who know when will I ever blog again...

Friday, July 04, 2014

Work: Dependencies Analyzer

Recently, there is a post by Google on Venture Beat regarding causes for build failures.  If there is one thing about Google I give credit for is the hunger and drive beyond the current standard.  They want perfection, or at least as much as possible.  Anyways, the article break down the causes and one of which for Java and C++ is libray dependency.  So, that should not shock anyone working with Java and C++ long enough.  You forgot to include a file and kaboom! A compiler failure five minute later and back to typing one line, and recompile everything again... (@__@)

However, one idea just popped up in my head few minutes ago.  Another big reason for a major breakage is library upgrade.  If you ever work on any software project, you will realized that libraries get updated consistently due to additional features, fixed bugs, or security issues (like HeartBleed).  So, how can you make sure that dependencies upgrade will not break anything?  Smoke tests and unit tests, of course!

If those builds have tests in-place, then it should detect the unexpcted anomalies.  However, current build systems (ex: Jenkins) do not know anything about dependencies.  This is a drawback and a big deterrent to updating to a new library.  It goes against "Do not fix something that did not break" philosophy.  The reason is not because upgrading is bad, but upgrading takes work!  A lot of tedious and no appreciation work. 

My proposal would be to have a build system that can recognize each project's dependencies.  It could be a link to some folder and a script to parse the version number.  It could be manually entered URL, like GitHub.  It could anything really.  If the build system can understand each build's dependencies, then it can be expanded further to do mini-jobs like... find new builds, auto test each new dependency with the current source code, back-port a dependency library to an older version (useful for security fixes, and detect which older versions can be updated to the latest library), report version numbers of each dependency library, test if a specific version is compatible with the latest libraries.  Once these jobs are created, library update/upgrade would be a simple problem.

Obviously, this is an ideal situation.  Most project in most company still does not have a unit test, let alone a smoke test or a validation test.  Again it takes effort and support from management to really do this.  But once it is done, the team can achieve a speedy development with fewer maintenance!!


Sunday, October 06, 2013

Detour and Under The Radar

It has been over three years since I posted anything here.  Most of my followup websites are long dead with no chances for revival.  So what did I tried during all these times?
  • FortuneCity -- dead
  • HelioHost -- dead after a month of inactivity
  • WordPress -- alive, but not updated (ZeroInsight)
  • GoogleDrive -- alive, but not updated
It was a good run for all those sites.  But it would have been better if I had kept it all in a single source.  There was no grand plan to create a site servicing anyone, or any marketing ploy to draw viewers.  That never was the goal of all these blogs.  However, the journey taught me lots of things, and in that perspective, it was fruitful despite the lack of success.

Here are the three old blog during 2010 to 2013:  FortuneCity(left), WordPress(middle), and GDrive(right).  Maybe I will copy the posts to there someday:



Monday, December 31, 2012

Reblog: GoogleDrive - 2012

Date: Tag: Website

      And so the work on this page slowly continues. On a better note, recently I discovered AppFog and gave it the free account a try. In case you have not heard about it, AppFog is a PaaS(Platform as a Service). Basically, PaaS is similar to a fancy free hosting, but a bit different. The workflow is as follow: create an app/project, select a service (PHP, NodeJS, Rail, etc), select a cloud service to create a VM, done! Unlike a free hosting, you don't transfer files via FTP. You need Ruby command line to install "af" command line tool. Using af, you can upload your code for the project to the host. Another difference is the app/project/service system. On a free hosting, you own a folder and manage everything under. In PaaS, each project is its own folder.

      Anyways, give it a try and see how you like it. In fact, I have setted up a personal MediaWiki on it.


Update Website

Date: Tag: Website

      So GoFreeServe took down my site after a month of inactivity, just like most free host... So, I am back to hosting static pages with CSS and javascript. Just few weeks ago I heard about Site44 web hosting. However, it is unique than other free hostings because it is free hosting via *your* DropBox's public link. But since I am using DropBox for something else, I ended up using a similar service but with Google Drive. The service is called http://gdriv.es/. You can find more details at http://gdriv.es/massmind


Site and Progress

Date: Tag: C++, Blog

      So, the last couple weeks I have been somewhat occupied with Olympics (and the lack of coverage by NBC). In the mean time I finally got around to writing base64 encoding and decoding (see [1] and [2]) in C. These functions only take the input chars and split out the values. You can extend this to be a class that takes a file or a stream (as a filter).

      As for this site, it is a work in progress. You can see it here -- http://kainr2.gofreeserve.com/blog/latest

Reference:

[1] Encode base64: Show | Hide

//------------------------------------------------------------------------------
/// Convert given 3 bytes of characters to 4 chars in base64
///
/// @args[out] output  An array for storing the output
/// @args[in] input  An array of chars (3 bytes)
/// @args[in] nBits  How many bytes of valid input
///
/// @return  Number of bytes written
///
int encode64(char output[], const char* const input, int nBytes)
{
   // Define binary map for each of the three chars
   // 0000-0011 1111-2222 2233-3333
   // * http://en.wikipedia.org/wiki/Base64
   static const int BYTE0  = 252;
   static const int BYTE1A = 3;
   static const int BYTE1B = 240;
   static const int BYTE2A = 15;
   static const int BYTE2B = 192;
   static const int BYTE3  = 63;

   static const char TERM_CHAR = '=';
   static const int  MAX_OUTPUT = 4;

   // Error check: Check for how many bytes are going to be read
   if (nBytes < 1 || nBytes > 3) {
       printf("Error: incorrect amount of bytes (%d)\n", nBytes);
       return 0;
   }

   // Error check: size of output
   if (sizeof(output)/sizeof(char) < static_cast(MAX_OUTPUT)) {
       printf("Insufficient amount of output buffer (%d)\n", 
        sizeof(output)/sizeof(char));
       return 0;
   }


   // Read each char input
   int nBytesOut = nBytes+1;
   if (nBytes>=1)
   {
       output[0] = (input[0] & BYTE0) >> 2;
       output[1] = ((input[0] & BYTE1A) << 4) + ((input[1] & BYTE1B) >> 4);
       output[2] = output[3] = TERM_CHAR;
   }

   if (nBytes>=2) {
       output[2] = ((input[1] & BYTE2A) << 2) + ((input[2] & BYTE2B) >> 6);
   }

   if (nBytes==3) {
       output[3] = (input[2] & BYTE3);
   }


   // Convert to base64 -- five sets
   // (1) 0-25 [A-Z]=[65-90]
   // (2) 26-51 [a-z]=[97-122]
   // (3) 52-61 [0-9]=[48-57]
   // (4) 62 [+]=[43]
   // (5) 63 [/]=[47]
   // * http://en.wikipedia.org/wiki/Base64
   // * http://www.asciitable.com/
   for (int i=0; i < nBytesOut; i++)
   {
       if (output[i]<=25) {
           output[i] += 65;
       } else if (output[i]<=51) {
           output[i] += 71;  // 97-26
       } else if (output[i]<=61) {
           output[i] -= 4;   // 48-52
       } else if (output[i]==62) {
           output[i] = 43;
       } else if (output[i]==63) {
           output[i] = 47;
       }
   }

   return nBytesOut;
}
   

[2] Decode base64: Show | Hide

//------------------------------------------------------------------------------
/// Convert given 4 chars to original 3 bytes
///
/// @args[out] output  Output buffer (3 bytes)
/// @args[in] input  An array of chars (4 chars)
/// @args[in] nBytes  How many bytes to read from input
///
/// @return  Number of bytes written
///
int decode64(char output[], const char* const input, int nBytes)
{
   // Define binary map for each of the three chars
   // 0000-0011 1111-2222 2233-3333  -- output-input bit map
   // 7654 3210 7654 3210 7654 3210  -- bits index of output
   //
   // 000000 001111 111122 222222 -- input-output bit map
   // * http://en.wikipedia.org/wiki/Base64
   static const int BYTE0  = 63;
   static const int BYTE1A = 48;  // 32+16
   static const int BYTE1B = 15;
   static const int BYTE2A = 60;
   static const int BYTE2B = 3;
   static const int BYTE3  = 63;

   static const char TERM_CHAR = '=';
   static const int  MAX_OUTPUT = 3;


   // Error check: Check for how many bytes are going to be read
   if (nBytes < 2 || nBytes > 4) {
       printf("Error: incorrect amount of bytes to read(%d)\n", nBytes);
       return 0;
   }

   // Error check: size of output
   if (sizeof(output)/sizeof(char) < static_cast(MAX_OUTPUT)) {
       printf("Insufficient amount of output buffer (%d)\n", 
          sizeof(output)/sizeof(char));
       return 0;
   }

   // Convert from  -- five sets
   // (1) 0-25  <- [A-Z]=[65-90]
   // (2) 26-51 <- [a-z]=[97-122]
   // (3) 52-61 <- [0-9]=[48-57]
   // (4) 62    <- [+]=[43]
   // (5) 63    <- [/]=[47]
   // (*) Skip terminal char
   // * http://en.wikipedia.org/wiki/Base64
   // * http://www.asciitable.com/
   char buffer[4];
   for (int i=0; i < 4; i++)
   {
       buffer[i] = (i < nBytes) ? input[i] : TERM_CHAR;

       if (buffer[i]>=65 && buffer[i]<=90) {
           buffer[i] -= 65;
       } else if (buffer[i]>=97 && buffer[i]<=122) {
           buffer[i] -= 71;
       } else if (buffer[i]>=48 && buffer[i]<=57) {
           buffer[i] += 4;
       } else if (buffer[i]==43) {
           buffer[i] = 62;
       } else if (buffer[i]==47) {
           buffer[i] = 63;
       }
   }



   // Read each char input
   int nBytesOut = nBytes-1;
   output[0] = output[1] = output[2] = 0;  // clear the buffer
   if (nBytes>=2)
   {
       // Take th lower 6 bits from buffer[0] to highest bits 7-2 of output[0]
       output[0] = ((buffer[0] & BYTE0) << 2)
           + ((buffer[1] & BYTE1A) >> 4);
   }

   if (nBytes>=3 && buffer[2]!=TERM_CHAR) {
       output[1] = ((buffer[1] & BYTE1B) << 4)
           + ((buffer[2] & BYTE2A) >> 2);
   }

   if (nBytes==4 && buffer[3]!=TERM_CHAR) {
       output[2] = ((buffer[2] & BYTE2B) << 6)
           + (buffer[3] & BYTE3);
   }


   return nBytesOut;
}
   


BBC Documentary -- 'The Men Who Made Us Fat'

Date: Tag: Documentary, Health

      Earlier this week, I saw part of the three hours BBC documentary called 'The Men Who Made Us Fat' on youtube. This documentary looks into the causation of why obesity is spreading rapidly among the British (and American) people. Looking at U.S. stat alone, the percentage of obese adults (age: 20 to 74) rises from appoximation 10% in 1950s to 30% early 2000s [See Wiki:Obesity_in_the_United_States]. Here are some of the key highlights I have seen so far:

  • Critical United States' public policies including the conversion of industrialize farming in the 1970s, and the beginning of fructose production
  • The undermining of public health policies and guidelines (ex: sugar consumption doesn't contributes to diabete) by corporate lobbies
  • Marketing strategies that change the social norm in U.K. to be a snacking and eat-on-run society
  • Ideas and innovation in business which push consumers to eat more, the healthy food paradox
  • And some suprising facts, like low-fat products use more sugar than normal to compenstate for the taste

      In my opinion, this documentary is pretty bias against corporations and in favor of more government oversight. It doesn't ask much for a personal accountability, but this IS a U.K. documentary afterall. The European philosophy of safety net is pretty strong. Anyways, this documentary is still worth taking a look. You can check it out on youtube also!

  • http://www.youtube.com/watch?v=iE-H__aIEFE&list=PLA0E2B2461B536A26&index=1&feature=plpp_video


Zend Framework and the Genius Teacher Problem

Date: Tag: Zend, PHP

      I think most people has this experience before. There you are in a classroom furiously writing down what the physics professor had on the board, while trying to understanding his explanation of an abstract physics theory. Every once in a while he provides examples that give a glimp of hope to understanding it. More often, everything just look confusing and incoherent. Your mind already give up after 10 minutes into the session. When you look around, other students are doing EXACTLY the same things -- taking notes and look confused. At the end of the class, the professor gets up and goes back to his research.

      For the last few weeks I have been learning Zend Framework for PHP. After hearing so much praises about its MVC framework, and how so many companies uses it, I decided to try it out. The concept and theory I read in the introduction were great -- MVC, convention overs configuration (a concept from Ruby on Rail), bootstrap, etc. Learning practical examples turned out to be a bad experience.

  • Zend's official quick tutorial throws you into the water of VC in MVC without a proper explanation about how a regular index.php is linked to a controller. Assuming you can get it working, you still have no understanding about why MVC framework without knowing how or why it works
  • Zend's API Document is not available offline. You are forced to use their online API Document web-app (generated by DocBlox). It run like a snail on my Firefox, and sometimes crash it also. This is my first time that an API Document crashes my browser! In contrast to Java, which has giant amount of documents, but able to keep it simple (KISS)
  • Zend's API Document is incomplete. It has the usual prototype of the constructor and public functions, but it really lack thoughtful explanation, examples, pitfalls, and exception thrown
  • Sheer out wrong information about certain concept. This is probably the part that scare me the most about Zend. I was looking at Zend to see if it can be used to provide a RESTful web service. Google points me to this document on Zend_Rest_Client & Zend_Rest_Server classes. It is almost as if they mistook REST for RMI. Nothing about CRUD or resource operation via URL

      Adding to these problems, the documents are not updated. Comments from 2009 pointing the flaws and complains on the poor documents are still valid. To be honest, giving how much it is being used in the industry, I am surprise that no one tried to create a better document for them yet. So, how is this relate to the story I mentioned earlier? You should know by now, Zend is like the Physics teacher that students that nobody quite understand. Zend's official document is like those ambiguous lessons that students merely follow but not master. I could on with my analogy, but it only going to sound bitter.

      In the past, Zend was the only big MVC framework in town, so people were forced to adopt it. However, serveral new PHP framework are popping up and gaining lots of momentum (See CssReflex.com). They are leaner, faster, and better documented. Any hope to redeem Zend is almost pointless. If Zend really want to compete and stay in business, they better fix all these document issues in Zend Framework 2.0.



Saturday, March 03, 2012

Reblog: WordPress - Little Known Features

Mar 3, 2012

Hi, my name is Kittipong. Each month, I will try to bring my (near zero) insight on a different aspect of life and different points in programmings. And today, I will write a bit about Yahoo! Search. Specifically, about the different little features that many people might have seen once or twice, but not quite sure about it.

You may wonder why on earth I pick Yahoo! Search for feature on this blog. Well, the fact is that everyone knows about all the google-fu for Google Search. There are so many people talking and using it, which led to publication of books dedicated to hacking of Google search engine: Google Hacking for Penetration Testers, Google Hacks: Tips & Tools for Finding and Using the World’s Information, etc. You can find them on Amazon. All of this is great; except there is nothing about it on Yahoo! or Bing search engines. In fact, did you know that Yahoo! first have the mini-drop-down keywords suggestion? When I first saw it, I thought, “What a great idea!!”, except… nobody talks about it. When Google copies the feature few months later, there were a slew of articles and comments congratulating Google for its innovation. At that moment, I saw Yahoo! in a different light. In the public eyes, Yahoo! was like the unwanted child. The one that the parents have no expectation, or really care for. The one that can do no right. Over time, Yahoo! has come to believe the public’s opinion that it is not worthy of being great. Thus, it sold part of its soul.

But…

All the great things that has been done, should not be forgotten. Here is a little something to show for…

(A) Do you remember Google’s original search box (before the tab or the crazy Google+ drop down menu)? No fat, no frill. Yahoo! decided to get one too.

(B) Search for a specific car brand and model, and you should get a full auto review.

(C) Celebrity is one of Yahoo!’s prime features. There are few ways the results can be returned. It depends on who the celebrity is (singer, actor, politician), and the current trend.

(D) Enter a metropolitan name (or any famous city), and there will be a little box with the name, the current weather, a photo-op, and little details about the city.

(E) Golf tournament?! Seriously? Anyways, search for a golf tournament, and you get the score. Although, to be honest, I am not sure why would anyone use Yahoo! search for it.

(F) Search for a local brand or a restaurant name, and you should see a mini map with location. Nothing exciting. Personally, I would use yelp with Google map.

(G) Oh, boy. This is something I see a Google search also. You do the math.

(H) Mobile app was something they added a year ago. Enter an app name, and you will see it. Probably useful on a mobile device.

(I) This seems pretty standard for me. A movie title, a poster, and a little box to search for play time.

(J) A query for a music band search produces albums and songs lists. I was going to enter Justin Bieber for the heck of it. But I think we had enough of him AND his songs… ~~Baby baby baby Ohhhh~~~ Baby baby baby NOOOO!!!~~~

(K) Blah, blah, blah. News

(L) If you ever enter product name, or an auto parts, you may get Yahoo! shopping results in a slideshow.

(M) Before internet, we all eats food, but majority of the people don’t know how to cook. Unfortunately, internet still does not solve the biggest cooking problem — cooking skill.

(N) Sport player. Sport team. One will give you the score. Another will give you the recent statistics.

(O) If you enter a stock symbol, you can get the stock price. But more likely, you will find yourself looking at news…

So, there you go. I have revealed Yahoo!’s hidden features that so many people never bother to look at, or share with the world! Some of you may question, what do I gain from sharing these functionality of a second-rated search engine? And the answer? No, it is not acknowledge; certainly, not respect nor personal ego. It is simpler, but deeper than that. Sometimes when I get to know a person or watch an entity that shares a similar experience, I begin to cheer for it too.

End of messages


Monday, January 21, 2008

Google Ranking

So, how many Kittipong are there on internet? A lot. To be rank lower than a tennis player, or a film director is not a bad thing, but to be rank lower than some random people is just not cool. Just few days ago, I did a search on "Kittipong", and tada...



On 11th page of Google search engine is this website! Impressive, considering how relatively new this site really is. By the way, I dug deeper to see if my old website was there. After 50 pages of zero result, I basically called it a day.

Sunday, January 20, 2008

Google's Free 411

Google just seems to have a knack for being involved with services and programs that have nothing to do with the search engine. Just a couple days ago, I came across one of them. This time it is a free 411 service from Google. Yes, Google is now competing with the 411 directory service. The number is 1-800-GOOG-411, or 1-800-466-4411. Being a free service mean, of course, that you are talking to a machine instead of a real human. So, without any hesitation, I gave it a try.

The first thing it asks me is the name of the city.

"San Gabriel, California," I said.

"San Diego, California," it repeated.

I cancel the confirmation, and repeat it again. The same sequence was played few times before I gave up. As a last resort, I ended up typing in the zip code, and at least that work well enough. I tested the system by asking for few places locations around my area, and it works about 75% of the time. It listed all 99 Ranch Markets, and found well known Thai restaurants in this area.

Google 411 service can also forward your call to the store's telephone. If you wish, you can receive the address of the business by a text message. This would work really well if you have a GPS system in your car. In conclusion, Google 411 is an impressive free service that anyone should try before dialing 411.

For more detail, look at this link: