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

SEARCH KEYWORD -- Header



  Tips of Drafting an R Markdown Document

When presenting the data summary and exploratory analysis, we used to copy a lot of tables, charts from Rstudio to PowerPoint, which makes the presentation preparation painful. It becomes essential for data scientists to make use of better reporting tools, such as R markdown, Jupyter notebook to prepare the analysis presentation in a more efficient and organized way. Of course, we want this to be reproducible! In this post, I would like to share some tips of using the right tools to draw tables,...

   R PROGRAMMING     2020-11-01 23:09:45

  Mutli-inheritance bug between python 2.7 and 3.7

When we have run a py3.7 code under py2.x or a py2.x code under 3.x ,if a class do mutli-inheritance from 2 parent and the 2 parents also got inheritance from same parent, the different way to handle inheritance chain between python 2 and 3 will cause some running time bug: Assume we got this sample program inheritTest.py : # Purpose: Test mutli-inheritance different between python2 and 3 # Author: Yuancheng Liu # Created: 2019/05/16 class A: def getVal(self): print("cal...

   PYTHON,PYTHON 3,INHERITANCE     2019-05-16 08:33:52

  template function in class in C++

We can define template function in a class, but one thing we should pay attention to is that the member function template definition (in addition to the declaration) should be in the header file, not the cpp, though it does not have to be in the body of the class declaration itself.Example //Sorter.h#pragma onceclass Sorter{public:    Sorter(void);    ~Sorter(void);    template <class type> static void qsort(type arr[],int start,int end);};templ...

   C++,template function,class,definition,d     2011-08-07 09:39:56

  How To Optimize Your Site With HTTP Caching

I’ve been on a web tweaking kick lately: how to speed up your javascript, gzip files with your server, and now how to set up caching. But the reason is simple: site performance is a feature. For web sites, speed may be feature #1. Users hate waiting, we get frustrated by buffering videos and pages that pop together as images slowly load. It’s a jarring (aka bad) user experience. Time invested in site optimization is well worth it, so let’s dive in. What is Caching? ...

   Website performance,Speed,HTTP Cache,Hash code     2011-12-10 06:11:33

   Move.Me Writing Your Own WebSocket Server

The WebSocket protocol has applications beyond plain vanilla web development.  I will explain how the protocol works, how to implement your own server and share some insights I had along the way. Before we get down and dirty, I will explain what I’ve been doing with it. At this point I expect many of you are saying “I’m not working on a web game this doesn’t seem relevant to me.” Well, neither am I. I embed a WebSocket server into my game engine and wit...

   Socket,NetWorking,WebSocket,Server development     2012-01-28 07:06:43

  JavaScript programming style

Douglas Crockford is a JavaScript expert, he is the inventor of JSON. In November 2011 he made a speech "Youtube", during the speech he talked about what JavaScript programming style is.I recommend this speech to everyone, it not only helps you learn JavaScript but also make you enjoying because Crockford is very humorous and he made audience laugh frequently.Next I will summarize JavaScript programming style according to this speech and his article code convention. The so-called programming ...

   JavaScript, programming style,Curly braces,Equal     2015-10-14 10:16:44

  How big are PHP arrays (and values) really? (Hint: BIG!)

Upfront I want to thank Johannes and Tyrael for their help in finding some of the more hidden memory usage. In this post I want to investigate the memory usage of PHP arrays (and values in general) using the following script as an example, which creates 100000 unique integer array elements and measures the resulting memory usage: <?php $startMemory = memory_get_usage(); $array = range(1, 100000); echo memory_get_usage() - $startMemory, ' bytes'; How much would you expect it to ...

   PHP,Array,Memory occupation,Garbage collection     2011-12-16 10:06:04

  Why Objective-C is Hard

As an active member of "The Internet" and vocal Objective-C coder, I get a lot of questions surrounding the language. They're often framed around thinking about learning the language or trying to write an app, but they also usually involve a phrase like "Objective-C looks really hard" or "what are all those minus signs about?" Both of these are pretty good questions, and I'd like to address why someone might be more hesitant to jump into iOS or OS X development compared to, say, Ruby or J...

   Objective-C,difficult,hard,reason,analysis     2012-03-07 05:11:28

  How does PHP session work?

This article is about how PHP session works internally. Below are the steps : 1. Session in PHP is loaded into PHP core as an extension, we can understand it as an extension. When session extension is loaded, PHP will call core functions to get the session save_handler, i.e interface or functions for reading and writing session data. By default, PHP will handle session data by writing and reading files on the server. But PHP also supplies custom methods for handling session data, we can use sess...

   PHP, session, mechanism     2012-12-28 13:36:49

  7 misunderstandings of DNS resolution

DNS resolution is generally considered as providing mapping between domain name and IP address, for example www.google.com maps to 74.125.71.103. There are two important reasons for doing DNS resolution: IP address is hard to remember, while domain name is human friendly Virtual host may access different contents according to the header of the host domain name(sub-domain name) Some webmasters may have some unreasonable requirements when doing DNS resolution. It mainly because they are not very...

   DNS resolution,misunderstanding     2012-10-20 12:57:16