Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- Map



  How I explained MapReduce to my Wife?

Yesterday I gave a presentation at Xebia India office on MapReduce. It really went well and audience was able to understand the concept of MapReduce (as per their feedback). So, I was happy that I did a good job in explaining MapReduce concept to a technical audience (mainly Java programmer, some Flex programmer and few testers). After all the hard work and a great dinner at Xebia India office I reached back my home. My wife (Supriya) asked me “How was your session on …ââ‚...

   Java,MapReduce,Java Flex     2011-08-28 04:22:53

  Restore mocked variables in GoLang unit test

One of the guarding principles of writing unit test is that there should be no real external calls for dependant services. Unit test should run by its own and can run without issues on any environment including local, build, test environment. This indicates there should be some mock responses whenever an external call is needed so that different unit test scenarios can be covered. How can this be done in GoLang? In GoLang, anything can be assigned to a variable even including functions. A variab...

   GOLANG,UNIT TEST,MOCK FUNCTION,RESTORE MOCK     2021-12-10 20:43:00

  Why accessing Java HashMap may cause infinite loop in concurrent environment

HashMap in Java is frequently used to handle key/value pairs. But it is not a good candidate to be used in concurrent environment where ConcurrentHashMap should be used instead. If used in concurrent environment, it may cause lots of unexpected behavior even including make the program getting into an infinite loop situation. To understand how this can happen, let's first discuss how HaspMap works internally. In this post we will use implementation of HashMap before Java 8 as example, Java 8 prov...

   JAVA,HASHMAP,INFINITE LOOP     2020-03-29 01:47:00

  Can Your Programming Language Do This?

One day, you're browsing through your code, and you notice two big blocks that look almost exactly the same. In fact, they're exactly the same, except that one block refers to "Spaghetti" and one block refers to "Chocolate Moose." // A trivial example: alert("I'd like some Spaghetti!"); alert("I'd like some Chocolate Moose!"); These examples happen to be in JavaScript, but even if you don't know JavaScript, you should be able to follow along. The repeated code looks wrong, ...

   Programming,Maintainability,Reusable     2011-05-31 07:42:41

  Difference between ConcurrentHashMap and Hashtable

Both ConcurrentHashMap and Hashtable are Collection classes for storing key value pairs and they both provide fast element search with a supplied key. They have much in common. However, we will not discuss the similarities between them here, instead we will focus on the differences between them. ConcurrentHashMap and Hashtable are both thread safe. But the mechanism for thread safe is different between them. Hashtable is synchronized, it utilizes the synchronization mechanism; while ConcurrentHa...

   ConcurrentHashMap,Hashtable     2013-11-18 08:06:54

  Top 5 Reasons Not to Use Hadoop for Analytics

As a former diehard fan of Hadoop, I LOVED the fact that you can work on up to Petabytes of data.  I loved the ability to scale to thousands of nodes to process a large computation job.  I loved the ability to store and load data in a very flexible format.  In many ways, I loved Hadoop, until I tried to deploy it for analytics.   That’s when I became disillusioned with Hadoop (it just "ain't all that"). At Quantivo, we’ve explored many ways to deploy H...

   Cloud computing,Hadoop,Analytics     2012-04-17 13:43:26

  OpenLDAP Proxy -- Introduction

OpenLDAP is an open source project which is intended to provide some commercial-grade, fully featured applications and development tools based on the well known Light-weight Directory Access Protocol(LDAP). Hence corporations which want to manage their user and group information can freely use these tools.  OpenLDAP provides ldap servers, ldap clients and corresponding tools to work on LDAP. The LDAP server is called slapd(Stand-alone LDAP  daemon). And it would serve as the server whi...

   META,OPENLDAP,OPENLDAP PROXY,SLAPD,SLAPD.CONF,LDAP     2017-10-28 11:20:00

  Focus of Baidu in the future

In addition to the new generation "Baidu ladies", The biggest highlight of the annual meeting of Baidu is undoubtedly the passionate speech delivered by CEO Yanhong Li with a "Zoro" suite. He emphasized four business focus of Baidu in the future, i.e the traditional search, mobile cloud, LBS and international strategy. Although the strategy is clear, but what's more important is that there must be some corresponding products to align with these focus. How will Baidu carry out four key business?...

   Baidu, Anuual meeting, LBS,Baidu Cloud     2013-01-23 03:51:09

  Cool HTML5 matrix effect

Do you still remember the movie The Matrix? Do you still remember the cool matrix effect in that movie? How is that effect achieved? Shaun Dunne shared a piece of HTML5 code which displays a cool matrix effect. The matrix demo can be found here. Below is the code which he achieves this effect: with var s = window.screen; var width = q.width = s.width; var height = q.height = s.height; var letters = Array(256).join(1).split(''); var draw = function () { q.getContext('2d').fillStyle='rgba(0,0,...

   Matrix,HTML5     2013-08-14 08:03:34

  Python Patterns - An Optimization Anecdote

The other day, a friend asked me a seemingly simple question: what's the best way to convert a list of integers into a string, presuming that the integers are ASCII values. For instance, the list [97, 98, 99] should be converted to the string 'abc'. Let's assume we want to write a function to do this. The first version I came up with was totally straightforward: def f1(list): string = "" for item in list: string = string + chr(item) return string ...

   Python,Optimization,Anecdote,Loopup,ASCII     2011-12-18 10:52:49