Blog Archive

Tuesday, April 26, 2016

The 15 Best Places to Live in the United States

http://www.thestreet.com/story/13291294/6/the-15-best-places-to-live-in-the-united-states.html



1. Rochester, Minnesota
Population: 108,179
Median Household Income: $62,575
Median Home Price: $163,700
According to Livability, the Best Place to Live in the United States is Rochester, due to the rapid growth in its schools, civil engagement and entertainment options. The city is home to the esteemed Mayo Clinic, which creates increased job opportunities and health care advantages.


2. Bellevue, Washington
Population: 129,209
Median Household Income: $90,333
Median Home Price: $525,000
Throughout the year, residents of Bellevue can enjoy the beautiful parks, bike paths, museums, restaurants, and music venues. This city also has highly rated schools, famous festivals and fairs and a rising downtown area.

3. Madison, Wisconsin
Population: 237,395
Median Household Income: $53,464
Median Home Price: $214,100
With one of the top rated health care systems in the country, Madison has been named one of the best places to live for the third year in a row and is also one of the top college towns in the U.S. The economy of the city is driven by its 33% minority population and high percentage of college-educated workers.

4. Santa Barbara, California
Population: 89,062
Median Household Income: $65,034
Median Home Price: $832,100
The beautiful weather, beaches and mountain views of Santa Barbara are not only a major attraction not only for tourists, but also for residents. The interesting culture, great health care, unique restaurants and top schools amplify the city’s appeal.
5. Boulder, Colorado
Population: 100,363
Median Household Income: $56,312
Median Home Price: $489,400
Boulder, another one of the best cities for liberals, offers a strong support of local farms, a prominent arts scene, a wide-range of shopping options and unparalleled scenic views. Most residents are very active and spend their time hiking, rock climbing, mountain biking, fishing and skiing in and around the city.

6. Palo Alto, California
Population: 65,234
Median Household Income: $121,465
Median Home Price: $1,000,000

Residents of Palo Alto are active in the community and local politics, and many work at one of the prominent technology companies in the area. The beautiful parks and open spaces throughout the city provide residents with great places to unwind.
7. Bismarck, North Dakota
Population: 63,353
Median Household Income: $54,969
Median Home Price: $163,900 
An affordable housing market and a strong healthcare system make Bismark one of the best places to live in the U.S. The city, which is located on the east bank of the Missouri River, also has over 80 miles of trails, multiple golf courses and a lively downtown area for residents to enjoy.
8. Ann Arbor, Michigan
Population: 115,331
Median Household Income: $55,003
Median Home Price: $230,700
Named one of the best cities for liberals in 2014, Ann Arbor is also one of the best college towns in the country, thanks to the events and activities offered by the University of Michigan. Residents can also find countless ways to occupy their time in the city’s restaurants, bookstores, art galleries, performance venues or one of the more than 150 parks throughout the area.
9. Iowa City, Iowa
Population: 69,314
Median Household Income: $41,410
Median Home Price: $180,900
The University of Iowa provides a number of opportunities for people to explore interesting classes and workshops, and the various different arts and entertainment options throughout Iowa City demonstrate the creativity of its residents. Iowa City is also known for its excellent health care and school district in addition to its great restaurants and shops.

10. Sioux Falls, South Dakota
Population: 157,675
Median Household Income: $51,672
Median Home Price: $152,200
Throughout the year, residents of Sioux Falls can take advantage of the city’s great schools, sporting events, live music, art shows, festivals and hundreds of restaurants. The city also boasts more than 70 parks and greenways and a 1.3 million-square-foot shopping center, in addition to beautiful views of the cascades of the Big Sioux River.


'via Blog this'

Wednesday, April 20, 2016

"We couldn't update the system reserved partition" on Win10 upgrade from win7

"We couldn't update the system reserved partition" on Win10 upgrade. : Windows10: "We couldn't update the system reserved partition" on Win10 upgrade."





I found a solution to this problem. The solution is for Win8.1/win7, but it works for Win10 upgrade as well.
  1. Press win+r and type diskmgmt.msc
  2. Click on your C: drive
  3. Below the list of drives there will be a partition map, the first partition will be Data or some such, listed at 100MB, right click on it and go to change drive letters and paths -> add -> now choose Y: for the drive letter
  4. Right click the CMD.EXE start menu icon and choose 'Run as Administrator'. Or, to open an admin cmd prompt, in win8 you can press win+x and choose command prompt (admin), in win7 you have to create a shortcut for cmd.exe, then go to compatibility in the shortcut properties, and choose run as admin.
  5. Type: Y: <enter> in the cmd window
  6. Run these commands:
    takeown /f . /r /d y
    icacls . /grant administrators:F /t <see note below>
    attrib -h -s -r bootmgr
NOTE: for the icacls command you can use your username instead of administrators, to find out your username type 'whoami'
  • Now open explorer (win+e) go to the Y: drive under computer, Make sure hidden files and system files are visible through folder options. Then go into the Boot folder, and delete all languages other than en-US. Languages are in the form xx-XX. Make sure to shift+delete and not just delete so they don't go to the recycle bin. Empty the recycle bin afterwards just in case.
  • now go back to the admin command prompt, and type this command:
    chkdsk Y: /F /X  /L:5000
this truncates the NTFS log to 5MB, it can be very very big, not leaving enough space for the install. At the end of the output it should tell you that you have at least 50MB of free space on the partition
  • proceed with the windows 7 installation
  • once booted into 10 and set up, you can go back into diskmgmt.msc and remove the drive letter for the boot partition
'via Blog this'

Saturday, April 9, 2016

END-TO-END SPEECH RECOGNITION



EESEN: END-TO-END SPEECH RECOGNITION USING DEEP RNN MODELS AND
WFST-BASED DECODING



paper:

http://arxiv.org/pdf/1507.08240v3.pdf



Code:

https://github.com/srvk/eesen

'via Blog this'

Friday, April 8, 2016

阿里巴巴成为全球最大零售商 | 联合早报网

阿里巴巴成为全球最大零售商 | 联合早报网: "(联合早报网讯)阿里巴巴集团6日透露,截至2016年3月31日财年底,该集团交易总额超全球前三大零售商 ,成为全球最大零售商.

新华社报道, 阿里巴巴集团数据显示,截至2016年3月21日下午2点58分37秒,该集团交易总额已达到3万亿元人民币(约合4758.9亿美元);这相当于在2016财年已经过去的350多天里,阿里巴巴日均交易额超过13亿美元。

此前公开的数据显示,在2015年全球零售商排行中,排名前三的分别是沃尔玛、好市多和家乐福。三家零售商最近一个财年的总营收分别为4821亿美元、1161亿美元和近900亿美元。

专家指出,这意味着全球最大零售体从线下迁移到线上。成长于数据技术处理时代的阿里巴巴,通过对大数据 、云计算、互联网支付体系、互联网信用体系、智能物流体系等基础设施建设,在新实体经济时代实现了弯道超车。

阿里巴巴指出,下一个目标是到2020财年,交易额达到6万亿元人民币,帮助90%的零售商业提高效率,用网上新实体经济的力量来推动商业变革。

据了解,阿里平台的交易量已占中国社会零售总量的10%,并带来超过1500万人的直接就业和超过3000万人 的间接就业,带动了上下游产业新增纳税近1800亿元人民币。"



'via Blog this'

Stock algorithm for fun

Quantopian Help:





https://www.quantopian.com/help#api-doco



'via Blog this'

Grammar Checker

http://www.gingersoftware.com/grammarcheck

Tuesday, April 5, 2016

Awesome examples for Perl one-liner

Good coders code, 

great coders reuse



1) Let's look at several examples to get more familiar with one-liners. Here is one:

perl -pi -e 's/you/me/g' file
This one-liner replaces all occurrences of the text you with me in the file file. Very useful if you ask me. Imagine you are on a remote server and have this file and you need to do the replacement. You can either open it in text editor and execute find-replace or just do it through command line and, bam, be done with it.
The -e argument is the best argument. It allows you to specify the Perl code to be executed right on the command line. In this one-liner the code says, do the substitution (s/find/replace/flags command) and replace you with me globally (g flag). The -p argument makes sure the code gets executed on every line, and that the line gets printed out after that. The -i argument makes sure that file gets edited in-place, meaning Perl opens the file, executes the substitution for each line, prints the output to a temporary file, and then replaces the original file.
How about doing the same replacement in multiple files? Just specify them on the command line!
perl -pi -e 's/you/me/g' file1 file2 file3
Now let's do the same replacement only on lines that match we. It's as simple as this:
perl -pi -e 's/you/me/g if /we/' file
Here we use the conditional if /we/. This makes sure that s/you/me/g gets executed only on lines that match the regular expression /we/. The regular expression here can be anything. Let's say you want to execute the substitution only on lines that have digits in them. You can then use the /\d/ regular expression that matches numbers:
perl -pi -e 's/you/me/g if /\d/' file
2) How to find all repeated lines in a file?
perl -ne 'print if $a{$_}++' file
3) How about numbering lines? Super simple! Perl has the $. special variable that automatically maintains the current line number. You can just print it out together with the line:
cat someFile.txt | perl -ne 'print "$. $_"'


4) How about finding all repeated lines in a file?

perl -ne 'print if $a{$_}++' file
5) How about we combine the previous two one-liners and create one that numbers repeated lines? Here we go:

perl -ne 'print "$. $_" if $a{$_}++' file


6)  How about generating an 8 letter password? Again, solvable elegantly with a one-liner:

perl -le 'print map { (a..z)[rand 26] } 1..8'
The a..z generates a list of letters from a to z (total 26). Then we randomly choose one of the characters through generating a random number in range 0-25, and then we repeat this whole process 8 times!


7) Let's find the sum of the numbers in the first column:

BEGIN { ... } and END { ... } let you put code that gets run entirely before or after the loop over the lines.

For example, I could sum the values in the second column of a CSV file using:

perl -F, -lane '$t += $F[1]; END { print $t }'

cat SomeFile.txt | perl -lane '$sum += $F[0]; END { print $sum }'


8) How about getting a list of the names of all users on the system?



perl -a -F: -lne 'print $F[4]' /etc/passwd
it is the same as:



perl -a -F':' -lne 'print $F[4]' /etc/passwd

9) .. operator:  It is a stateful operator -- it remembers state between evaluations. 


Perl's .. operator is a stateful operator -- it remembers state between evaluations. As long as its left operand is false, it returns false; Once the left hand returns true, it starts evaluating the right-hand operand until that becomes true, at which point, on the next iteration it resets to false and starts testing the other operand again.

What does that mean in practice? It's a range operator: It can be easily used to act on a range of lines in a file. For instance, I can extract all GPG public keys from a file using:

perl -ne 'print if /-----BEGIN PGP PUBLIC KEY BLOCK-----/../-----END PGP PUBLIC KEY BLOCK-----/' FILE

Example 2: (The following command print out line 2 through 4 (inclusive))

cat someFile.txt | perl -lane 'print "$_" if $.=~m/^2/..$.=~/^4/'


10)  $ENV{}: bridge between environment and Perl
When you're writing a one-liner using -e in the shell, you generally want to quote it with ', so that dollar signs inside the one-liner aren't expanded by the shell. But that makes it annoying to use a ' inside your one-liner, since you can't escape a single quote inside of single quotes, in the shell.

Let's suppose we wanted to print the username of anyone in /etc/passwd whose name included an apostrophe. One option would be to use a standard shell-quoting trick to include the ':

perl -F: -lane 'print $F[0] if $F[4] =~ /'"'"'/' /etc/passwd
But counting apostrophes and backslashes gets old fast. A better option, in my opinion, is to use the environment to pass the regex into perl, which lets you dodge a layer of parsing entirely:

env re="'" perl -F: -lane 'print $F[0] if $F[4] =~ /$ENV{re}/' /etc/passwd
We use the env command to place the regex in a variable called re, which we can then refer to from the perl script through the %ENV hash. This way is slightly longer, but I find the savings in counting backslashes or quotes to be worth it, especially if you need to end up embedding strings with more than a single metacharacter.


Reference:

Introduction to Perl one-liners - good coders code, great coders reuse

http://www.catonmat.net/blog/introduction-to-perl-one-liners/

Monday, April 4, 2016

How to claim Form 8233 income deduction?

Ref:



  1. Go to the Federal Taxes tab, click on Wages and Income. 
  2. Click I'll choose what to work on.   (If you do not see this, just skip this step is fine)
  3. On the “Your Income Summary Screen” scroll down to Less Common Income
  4. Next to Miscellaneous Income click on  Update  or Start.
  5. On the screen "Let's Work on Any Miscellaneous Income" choose Other reportable income (start or update)
  6. Answer yes, and then enter "China-US tax treaty, exemption under article 20" in the description and the amount as negative number next to your name. Now you said in another post that you cannot enter a negative number, I tried and it worked, see screenshot.

Claim U.S./China tax treaty on resident return | International Office

Claim U.S./China tax treaty on resident return | International Office:



'via Blog this'