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

SEARCH KEYWORD -- BLOB



  Facebook open sources its C++ library named Folly

Recently, Facebook open sourced its low level C++ function library for its internal use named Folly. Folly is an open sourced C++11 component library, it provides functions similar to what boost and std libraries provide, including string, vector and memory allocation, bit operation etc, to fulfill large scale high performance requirements.Currently Folly is tested with gcc4.6 on some 64 bit systems such as Fedora 17, Ubuntu 12.04 and Debian wheezy, it may also be OK on other 64 bit platforms wi...

   Facebook,Folly,C++,open source     2012-06-05 08:31:12

  Function Pointers in C are Underrated

The function pointer in C is, in my opinion, one of the most ignored gems of the language. It’s the kind of feature you rarely need, and then suddenly, one day, you find yourself in dire need of it, as evidenced by the real-life use-case below. If you don’t know what a function pointer is in the first place, here’s the meat of it: it gives you the ability to pass a function around like a normal variable. If you know Python / Ruby / Lisp, you might know it by the name...

   C,Pointer,Analysis     2012-03-24 05:23:09

  Ubuntu and GNOME jump the shark

I upgraded to Ubuntu 11.04 a week or so back in order to get a more recent version of SCons. 11.04 dropped me into the new “Unity” GNOME interface. There may be people in the world for whom Unity is a good idea, but none of them are me. The look is garish and ugly, and it takes twice as many clicks as it did before to get to an application through their supposedly “friendly” interface as it did in GNOME Classic. No, dammit, I do not want to text-search my applic...

   Ubuntu,GNOME,Open source,Unity     2011-10-17 11:19:00

  Using JavaScript to operate clipboard

Browsers allow JavaScript to read and write data on clipboard. Generally script should not modify user's clipboard to avoid impacting user expectation, but there are cases where this can indeed bring convenience to users. For example, for some code snippet, user can copy it to clipboard with one click instead of select and copy manually. There are three options for clipboard operation provided in JavaScript/browser: document.execCommand() Asynchronous Clipboard API copy and paste events This p...

   JAVASCRIPT,CLIPBOARD,NAVIGATOR.CLIPBOARD     2021-01-23 23:23:34

  XMLHttpRequest Level 2 user guide

XMLHttpRequest is a web browser interface, it makes it possible for JavaScript doing HTTP(s) communication. Microsoft's IE5 first introduced XMLHttpRequest, because it's so useful that many other browsers also adopted this. AJAX came to the front since. However, this interface is not standardized, implementation among different browsers is different, with the emerging of HTML5, W3C is considering to standardize this interface. In February 2008, they proposed a XMLHttpRequest Level 2 draft. This ...

   XMLHttpRequest, progress, upload, binary data     2012-09-19 11:51:50

  Our Go Cache Library Choices

In Build a Go KV Cache from Scratch in 20 minutes, I walked you through what matters when writing a local cache, and eventually implemented one, whose performance was beaten badly by that of the popular go-cache on Github though. However, the bright side is that we can learn a lot from those excellent Github Go cache products, studying their features, applicable scenarios, and implementations, and extracting what we need. In this article, I will mainly analyze and compare the four...

   GOLANG,CACHE,GO-CACHE,BIGCACHE,GOURPCACHE     2022-04-16 07:48:11

  noConflict mechanism in jQuery

Many JavaScript frameworks like to use $ as function or variable name, jQuery is one of them. In jQuery, $ is just a reference to window.jQuery, so even if $ is deleted, window.jQuery will still be available to ensure the whole library can work normally. jQuery API design takes fully consideration of multiple frameworks conflicts, we can use jQuery.noConflict function to easily handle control. jQuery.noConflict accepts one optional boolean parameter[1] to determine whether to hand jQuery object ...

   jQuery,noConflict,$     2013-03-14 19:40:36

  Emacs adventures

I have been using Emacs for over a year now. I actually didn’t learn a lot when I started using it (just the basics to get going and then some relatively common keyboard shortcuts), but lately I have been reading and learning much more about it. I’m so grateful by everything I’ve learned from different people on the net that I wanted to share a couple of things I’ve learned, and a simple major mode for editing AsciiDoc documents. As a long-time VIM user, I f...

   Editor,Linux,Emacx,VIM,Shortcuts     2011-11-30 11:56:49

  The First Bite on etcd Code

Etcd, one of the crucial components of Kubernetes. If APIServer is the heart, then etcd is the blood vessel that sends the end state of Kubernetes resources to various “organs”, providing high-speed, stable storage, and supporting APIServer’s high load performance. What if the etcd is not working properly? Just the condition as someone has a vascular disease. The deeper you know about them, the better diagnose you can make when issues occur. from unspl...

   SOURCE CODE,ETCD     2022-02-12 01:03:14

  Use pdb to help understand python program

  As I have mentioned in Why do I need a debugger?: (3) Debugger is a good tool to help you understand code. So when I come across difficulty to understand vfscount.py code in bcc project, I know it is time to resort to pdb, python's debugger, to help me. The thing which confuses me is here: counts = b.get_table("counts") for k, v in sorted(counts.items(), key=lambda counts: counts[1].value): print("%-16x %-26s %8d" % (k.ip, b.ksym(k.ip), v.val...

       2017-08-22 22:42:37