thaivn

What technology is used to generate pinterest.com’s absolute div stacking layout? (Having open source for implementation)

Answer from Evan Sharp, Co-founder I wrote the Pinterest script. Here’s the base of how it works: Beforehand: Absolutely position the pin containers Determine column width Determine margin between columns (the gutter) Setup an array: Get the width of the parent container; calculate the # of columns that will fit Create an empty array, with […]

What is the best way of storing hierarchical data within a MongoDB database?

Answer from Ankit Utreja, @ webengage.com You can apply any hierarchical data modelling on MongoDB, as it is done on any relational db. Here are few methods illustrated : An example hierarchical tree: 1) Storing references in the document. a. Parent reference in the child node. {ele: “b”, parent: ref_a} b. Child node references in […]

MongoDb Architecture [Part2]

From Ricky Ho Storage Model Written in C++, MongoDB uses a memory map file that directly map an on-disk data file to in-memory byte array where data access logic is implemented using pointer arithmetic. Each document collection is stored in one namespace file (which contains metadata information) as well as multiple extent data files (with […]

MongoDb Architecture [Part1]

From Ricky Ho Last Friday I was very lucky to meet with Jared Rosoff from 10gen in a technical conference and have a discussion about the technical architecture of MongoDb. I found the information is very useful and want to share with more people. One thing I am very impressed by MongoDb is that it […]

Random Forests: How do random forests work in layman’s terms?

Answer from Edwin Chen, Data Scientist at Twitter Suppose you’re very indecisive, so whenever you want to watch a movie, you ask your friend Willow if she thinks you’ll like it. In order to answer, Willow first needs to figure out what movies you like, so you give her a bunch of movies and tell […]

What are the most learner-friendly resources for learning about algorithms?

Answer from Alex Kamil Online resources: http://openclassroom.stanford.ed… http://www.topcoder.com/tc?modul… http://courses.csail.mit.edu/6.0… http://news.ycombinator.com/item… http://cslibrary.stanford.edu/ http://algorithms.openmymind.net/ http://www.cs.uiuc.edu/~jeffe/te… http://blog.palantir.com/2011/09… http://www.samba.org/~tridge/phd… http://www.strchr.com/links http://www.cs.sunysb.edu/~skiena… Introductory textbooks: Lafore, Data Structures and Algorithms in Java: http://www.amazon.com/Data-Struc… Harris & Ross, Beginning Algorithms: http://www.amazon.com/Beginning-… Schaum’s Outline of Data Structures with C++: http://www.amazon.com/Schaums-Ou… Sedgewick’s Algorithms in C: http://www.amazon.com/Algorithms… Dasgupta, Papadimitriou & Vazirani, Algorithms: http://www.cs.berkeley.edu/~vazi… Skiena, The Algorithm […]

What compression algorithms have robust and efficient open source implementations?

Answer from Adam D’Angelo, former algorithms TA The ones I generally consider are: LZO (http://www.oberhumer.com/opensou…) – decompression is very, very fast; around 15MB/s on a Pentium 133. – compression depends more on the level you choose, but is around 2MB/s on a Pentium 133. – there is a command-line program called lzop which operates like […]

How does Facebook determine which images to show as thumbnails when posting a link?

Answer from Ray C. He, engineer on the Facebook Platform team The current share scraper returns a list of candidate images. This list includes the single image specified by <meta property=”og:image” content=”…”/> if it exists, followed by <link rel=”img_src” href=”…” />. If neither source exists, it provides all <img> tags on the page. To see […]

What does a web application architecture include?

Answer from Ken Saggy, Senior Infrastructure Developer I see architecture as flow diagram. From where the user enters all the way down to the CPU of the server and the power cord connected to it. The technologies, methods, and how everything is arranged to form a complete product is what I think about when architecture […]

How is epoll implemented?

Answers from Nelson Elhage, Kernel hacker, builder and breaker of software. The main difference between epoll and select is that in select(), the list of file descriptors to wait on only exists for the duration of a single select() call, and the calling task only stays on the sockets’ wait queues for the duration of […]