- Thermometer
- Barometer
- Plug PC: One that has a battery, networking and can be connected to a wall socket. Refer: [Plug computer][1] OR [Intel Compute Stick][2] (but of course with Linux)
- Water purifier
- Induction cooker
- AC
- Pen drive
- Hard disk
- Desktop speakers
- Car entertainment sets (MP3 player + speakers)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function()%7Bvar%20el=document.createElement(%22div%22),b=document.getElementsByTagName(%22body%22)%5B0%5D,otherlib=!1,msg=%22%22;el.style.position=%22fixed%22,el.style.height=%2232px%22,el.style.width=%22220px%22,el.style.marginLeft=%22-110px%22,el.style.top=%220%22,el.style.left=%2250%25%22,el.style.padding=%225px%2010px%22,el.style.zIndex=1001,el.style.fontSize=%2212px%22,el.style.color=%22%23222%22,el.style.backgroundColor=%22%23f99%22;function%20showMsg()%7Bvar%20txt=document.createTextNode(msg);el.appendChild(txt),b.appendChild(el),window.setTimeout(function()%7Btxt=null,typeof%20jQuery==%22undefined%22?b.removeChild(el):(jQuery(el).fadeOut(%22slow%22,function()%7BjQuery(this).remove()%7D),otherlib&&(window.$jq=jQuery.noConflict()))%7D,2500)%7Dif(typeof%20jQuery!=%22undefined%22)return%20msg=%22This%20page%20already%20using%20jQuery%20v%22+jQuery.fn.jquery,showMsg();typeof%20$==%22function%22&&(otherlib=!0);function%20getScript(url,success)%7Bvar%20script=document.createElement(%22script%22) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ZAlgorithm | |
def z | |
@z = Array.new(length, 0) | |
@z[0] = length | |
left = right = 0 | |
(1...length).each do |k| | |
if k > right | |
@z[k] = length_of_longest_prefix(k) | |
unless @z[k].zero? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */ | |
/* ========================================================================== | |
HTML5 display definitions | |
========================================================================== */ | |
/** | |
* Correct `block` display not defined in IE 8/9. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Original | |
movies.group_by do |movie| | |
movie.genre | |
end.map do |month, list| | |
[month, list.size] | |
end.sort_by(&:last).reverse | |
# Alternative |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Email Email | |
Land Land | |
Mobile Mobile | |
Address Address | |
FeedBack FeedBack | |
Enter (case Enter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'curb' | |
require 'nokogiri' | |
require 'date' | |
CURRENT_DATE = Date.today.strftime("%Y-%-m-%d") | |
link = "http://www.hongkongairport.com/flightinfo/eng/real_arrinfo.do?fromDate<wbr>=#{CURRENT_DATE}" | |
USER_AGENT = "Mac / Firefox 29: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:29.0) Gecko/20100101 Firefox/29.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SittingDuck | |
include Robot | |
def tick events | |
turn_radar 5 if time == 0 | |
fire 3 unless events['robot_scanned'].empty? | |
turn_gun 10 | |
@last_hit = time unless events['got_hit'].empty? | |
if @last_hit && time - @last_hit < 20 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'minitest' | |
# require 'minitest/reporters' | |
# Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new({color: true})] | |
class Range | |
include Comparable | |
def <=>(other) | |
self.begin <=> other.begin | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Base | |
def initialize(alphabets) | |
@alphabets = alphabets | |
end | |
def base | |
@alphabets.length | |
end | |
def to_decimal(number) |