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

SEARCH KEYWORD -- Array



  PHP buffer: output_buffering and ob_start

buffer is one piece of memory section, it is usually 4Kb in Linux. It is mainly used between different devices with different speed or different priorities. With buffer, the waiting time between different processes will be reduced. Here is one simple example, when you type something in a text editor, every time when you type a character, the operating system will not write it to the disk directly, instead it will write it to buffer first When the buffer is full, the data in the buffer will be wr...

   PHP buffer,output_buffering,ob_start     2013-06-20 22:54:15

  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

  Currying in Python

What is Currying? Currying is like a kind of incremental binding of function arguments. Let’s define a simple function which takes 5 arguments: 1def f(a, b, c, d, e):2    print(a, b, c, d, e) In a language where currying is supported, f is a function which takes one argument (a) and returns a function which takes 4 arguments. This means that f(5) is the following function: 1def g(b, c, d, e):2    f(5, b, c, d, e) We could emulate this behavior the...

   Python,Curring,Binding,Implement     2012-03-19 12:59:10

  How to play with cross domain request

What is cross domain request In simple, cross domain request is to request resource from other domain in one domain. Note, the "other domain" doesn't just mean domain name only, it includes much more. If the protocol, domain name, port is not the same, two domains will be considered different.  Below example describes what is considered as different domain. http://www.a.com/a.jshttp://www.a.com/b.js               # Same domainhttp://www.a.com/lab/a.js &nb...

   FRONT END,JSONP,CROSS DOMAIN,CROSS ORIGIN,CORS,DOCUMENT.DOMAIN,WINDOW.NAME     2016-11-06 00:48:54

  How Speeding The "Most Important Algorithm Of Our Lifetime" Could Change This Modern World

Math breakthroughs don't often capture the headlines--but MIT researchers have just made one that could lead to all sorts of amazing technological breakthroughs that in just a few years will touch every hour of your life. Last week at the Association for Computing Machinery's Symposium on Discrete Algorithms (SODA) a new way of calculating Fast Fourier Transforms was presented by a group of MIT researchers. It's possible that under cert...

   FFT,Speed-up,Fast fourier transform     2012-03-20 07:47:04

  Getting started with C++ TR1 regular expressions

Overview This article is written for the benefit of someone familiar with regular expressions but not with the use of regular expressions in C++ via the TR1 (C++ Standards Committee Technical Report 1) extensions. Comparisons will be made with Perl for those familiar with Perl, though no knowledge of Perl is required. The focus is not on the syntax of regular expressions per se but rather how to use regular expressions to search for patterns and make replacements. Support for TR1 ext...

   Regular expression,Replace,TR1,Extension     2011-08-14 07:25:20

  Popular Golang JSON libraries evaluation

JSON (Javascript Object Notation), a prevailing data exchange format, is widely used in various platforms and languages. Golang, of course, will never miss the support for JSON. And with its own standard library, such as those interfaces like the REST API from the API Service in Kubernetes, it can easily process JSON. Although Go’s library works great, we can still seek those open-source JSON libs in Github to maximize our efficiency. Then the features, performance, applicability of these ...

   FASTJSON,JSON LIB,JSON LIB COMPARISON,GO-JSON     2021-12-11 23:13:23

  Reducing Code Nesting

"This guy’s code sucks!" It’s something we’ve all said or thought when we run into code we don’t like. Sometimes it’s because it’s buggy, sometimes it’s because it conforms to a style we don’t like, and sometimes it’s because it just feels wrong. Recently I found myself thinking this, and automatically jumping to the conclusion that the developer who wrote it was a novice. The code had a distinct property that I dislike: lots of ...

   Code nesting,Readability,Maintainability,Reduction     2012-01-02 08:13:46

  I'm Retiring from PHP

I am retiring from PHP as my language of choice for personal side projects and new programming ventures. This was not an easy decision to come to, but one that I think is necessary for my love of programming to continue. You see, I'm not only a programmer because I love programming, but because I can not do anything else. History It all started in 1999 when I was in 8th grade. The Internet was really starting to get interesting and I wanted to start programming. I had picked up...

   PHP,Scala,Programming,Language     2011-06-27 07:36:25

  PHP: a fractal of bad design

Preface I’m cranky. I complain about a lot of things. There’s a lot in the world of technology I don’t like, and that’s really to be expected—programming is a hilariously young discipline, and none of us have the slightest clue what we’re doing. Combine with Sturgeon’s Law, and I have a lifetime’s worth of stuff to gripe about. This is not the same. PHP is not merely awkward to use, or ill-suited for what I want, or suboptimal, or...

   PHP,Design,Analysis     2012-04-11 13:46:57