Change screen and update css

// if screen changed in ID(section), then update something..

var screensize= $( window ).width();
    if(screensize<=992){

            if($('#post-814').length>0)
            {
                $('.fw-col-md-3').addClass('col-xs-6');
            }
        }
changething = function(screensize){
        if(screensize<=992){

            if($('#post-814').length>0)
            {
                $('.fw-col-md-3').addClass('col-xs-6');

            }
        }
        els...
                    

slide two images

   <div style=" height:auto" id="top_ads" class="containerimg">
        <div> <a href="http://nexbits.com">
        <img src="ads/ads_big.jpg" class="img-responsive">
         </img> 
         </a>
        </div>
        <div>
          <a href="http://nexbits.com">
        <img src="ads/ads_res.jpg" class="img-responsive">
         </img>
         </a>
         </div>
     </div>

     $(document).rea...
                    

A non-typical challenge in Web development

An exprience in troubleshooting problems caused by access speed gaps

This is about my exprience as a Web developer in 2014. I call it non-typical because we don't often have to troubleshoot the problems in Web applications constrained by access speed gaps in different countries or continents. It was when I worked remotely for Unetizen last year. We were working on a knowledge-sharing network project. The main target users are in China, Canada and US.

..................

LeetCode195 solution

Printing out Tenth Line

The original problem is https://leetcode.com/problems/tenth-line/. This is a basic application of bash: just get the 10th line from a file. Many methods can solve this simple question.

..................

LeetCode194 solution

How to transpose a file with bash

The original problem is https://leetcode.com/problems/transpose-file/. This question is difficult for one who is not familiar with the bash tools, such as awk. The first time I tried with a column-by-column handling with sed:

..................

LeetCode193 solution

Valid Phone Numbers

The original problem is https://leetcode.com/problems/valid-phone-numbers/. The basic problem here to match lines of telephone numbers in form of 123-456-789 (123) 456-789

..................

LeetCode192 solution

Printing out Word Frequency

The original problem is https://leetcode.com/problems/word-frequency/. In fact, counting word frequency is a typical application of bash. For example, Example 16-12 in this bash guide.

..................

What is a closure in javascript

Once, I was asked in an interview, how to define a closure in Javascript. I was lost at that time. I thought it was somehow like an anonymous function.
I was wrong. It turns out that I hadn't yet written a closure manually. I later looked up for the definition of closure in js. It turns out a closure is a function in which another function defined within it is returned.

..................

markdown test

detailed tests for emoji, markdown, codes

emoji

:) :( :'(

:laughing: :flushed: :stuck_out_tongue_closed_eyes:

code lines

javascript

var s = "JavaScript syntax highlighting";
import {x, y} as p from 'point';
const ANSWER = 42;

class Car extends Vehicle {
  constructor(speed, cost) {
    super(speed);

    var c = Symbol('cost');
    this[c] = cost;

    this.intro = `This is a car runs at
      ${speed}.`;
  }
}

for (let num of [1, 2, 3]) {
    /* handle exception */
    var e4x =
        <div>Example
            <p>1234</p></div>;
  console.log(num + 0b111110111);
}

..................

A recap of python basics

Data structures

list

list is the most useful collection type. e.g.

a=[1,2,3]

list is a mutable type, unlike a string.

indexing and slicing

a[-1]  #the last one

a[:]  #all the elements
a[1:] #from the index 1 to the end
a[1:3] # from index 1, to index 3-1
a[1:-1] # from index 1, to index -1-1

..................