涛+
facebookgithubportfoliodouban

  • Blog
  • Readings
  • Tech
  • Travel
    AlljQueryJSpropagationES6LRUArrayData StructureSortingAlgorithmRaspberry PiRestoreDatabasejsmandrillemailpythondjango
  • preventDefault and stopPropagation in JS

    IntroductionWhen we deal with event on DOM, jQuery always very helpful. But javascript has this mechanic called event bubbling is quite annoying. So be careful when you deal with them. Event BubblingWe all know DOM elements can be nested inside each other which is great for structure. But it causes some troubles when y...
    TaoAlphatechjQueryJSpropagation Th, November 19, 20155 minutes to read
  • Strict Mode in JavaScript

    Introduction'use strict' is a new feature introduced from ECMAScript 5, it is not a subset of js, it has some different semantics from normal code. So be careful to use it. What is the difference?After you insert the 'use strict' into the head of your entire code or in the beginning of the function code...
    TaoAlphatechJS We, November 11, 201511 minutes to read
  • ES6 General Summary

    This post is a copy of Luke Hoban - ES6Features repo IntroductionECMAScript 6, also known as ECMAScript 2015, is the latest version of the ECMAScript standard. ES6 is a significant update to the language, and the first update to the language since ES5 was standardized in 2009. Implementation of these features in maj...
    Luke HobantechES6JS Fr, November 6, 201543 minutes to read
  • Implement LRU Cache in JavaScript

    IntroductionLRU which is short for least recently used is a popular algorithm in cache. The basic idea is always put your items in order of used time, and when you insert new item into the fullfilled chache,remove the least recently used item in your memory. ImplementationO(n)At first, I plan to use a hashtable and a l...
    TaoAlphatechJSLRU Tu, November 3, 201515 minutes to read
  • Array Operation Cost in JavaScript

    Introductionconcat(),splice(),slice(),push(),pop(),shift(),unshift()… all these handy functions belong to Array. We are using them everyday, but do you really know about them ? Time cost of a function in language like JavaScript is not easy to measurement, since different browsers use different javascript engine which ...
    TaoAlphatechJSArrayData Structure Fr, October 30, 201515 minutes to read
  • Sorting Algorithm in JavaScript - Bubble Sort and Merge Sort

    IntroductionBubble sort is really cool but not so useful, it seems that you will never use it… But merge sort is really cool since it is really fast. Bubble SortSo what is bubble sort, according to wikipedia: Bubble sort, sometimes referred to as sinking sort, is a simple sorting algorithm that repeatedly steps throug...
    TaoAlphatechJSSortingAlgorithm Th, October 29, 201511 minutes to read
  • Sorting Algorithm in JavaScript - Insertion Sort and Selection Sort

    Sorting AlgorithmAs the most important and fundamental algorithm, sorting algorithm is always the best start to learn algorithm. Among all the different sorting algorithms, we have 10 algorithms which are used a lot in practice, and I will introduce all these ten algorithms one by one. Today we will talk about: Select...
    TaoAlphatechJSSortingAlgorithm Th, October 29, 201515 minutes to read
  • Restore your database in Raspberry Pi from kernel panic error

    BackgroundMy Raspberry Pi suddenly stopped running(connection lost when I was connecting with my pi through ssh) when I was doing something really normal(like modifying a file…) And then I tried to connect my pi with a screen and it showed the mysterious Kernel Panic error… Possible SolutionsFrom the communityI did som...
    TaoAlphatechRaspberry PiRestoreDatabase We, October 14, 201511 minutes to read
  • Use only JavaScript to send email

    Want to send an email in your static website without any server languages support? Seems impossible. But now you can do that using only JavaScript. Wonderful? I will show you how to do that. Tools we need Mandrill: they provide the mail service that you can call using javascript; website: the website you want to do thi...
    TaoAlphatechjsmandrillemail We, September 30, 20156 minutes to read
  • Use Django with Bower and Pipeline

    IntroSince I decided to focus on python and JS, I started to dig into these two babies. I use django as my web framework in python, so how to build a website easier is what I most concerned. I used yeoman for a while, pretty amazing and convenient, especially the bower and compressor, compiler. So I did some search and...
    TaoAlphatechpythondjango Mo, September 7, 201515 minutes to read
« Prev123456Next »