This file contains 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
关于临港地区首批限价商品住房 | |
申请细则的通知 | |
相关区域管委会、各有关单位: | |
根据《临港地区限价商品住房供应管理工作实施方案》文件要求,对临港地区首批限价商品住房申请细则,通知如下: | |
一、供应对象条件: |
This file contains 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
#include <signal.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <error.h> | |
#include <string.h> | |
#include <unistd.h> | |
void sig_handler(int signum) | |
{ | |
printf("in handler\n"); |
This file contains 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
import sys | |
import signal | |
from threading import Thread | |
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler | |
class PUTHandler(BaseHTTPRequestHandler): | |
def do_PUT(self): | |
print "----- SOMETHING WAS PUT!! ------" | |
print self.headers | |
length = int(self.headers['Content-Length']) |
This file contains 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
hfeng@ubuntu-rvm-ct:~$ rvm list | |
rvm rubies | |
ruby-1.9.3-p547 [ x86_64 ] | |
=* ruby-2.1.1 [ x86_64 ] | |
# => - current | |
# =* - current && default | |
# * - default |
-
Given an array of integers, find two numbers such that they add up to a specific target number.
-
The function twoSum should return indices of the two numbers such that they add up to the target, where index1 must be less than index2. Please note that your returned answers (both index1 and index2) are not zero-based.
-
You may assume that each input would have exactly one solution. > Input: numbers={2, 7, 11, 15}, target=9
This file contains 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
# http://mailcatcher.me/ | |
SMTP_SERVER = 'localhost' | |
SMTP_PORT = 1025 | |
SMTP_USERNAME = 'myusername' | |
SMTP_PASSWORD = '$uper$ecret' | |
SMTP_FROM = '[email protected]' | |
SMTP_TO = '[email protected]' | |
TEXT_FILENAME = '/Users/i309511/tmp/hello.py' | |
MESSAGE = """This is the message |
This file contains 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
[].methods.grep /^re/ # => [:replace, :reject, :reject!, :respond_to?, ... |
This file contains 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
################################################################################################# | |
# This is probably the most tricky one - # | |
# {} is also syntax for blocks, but only when passed to a method OUTSIDE the arguments parens. # | |
# When you invoke methods without parens, ruby looks at where you put the commas to figure out # | |
# where the arguments end (where the parens would have been, had you typed them) # | |
################################################################################################# | |
1.upto(2) { puts 'hello' } # it's a block | |
1.upto 2 { puts 'hello' } # syntax error, ruby can't figure out where the function args end | |
1.upto 2, { puts 'hello' } # the comma means "argument", so ruby sees it as a hash - th |
This file contains 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
def test(*arr) | |
arr.each do |a| | |
puts "a is #{a}, #{a.class}" | |
end | |
end | |
test :title, :description, :image_url, presence: true | |
################################################## | |
# <===================OUTPUT===================> # |