I downloaded an ebook, it contains hundreds of one-page pdf files. I certainly don’t want to upload all of these one-pagers to my Kindle. To concatenate these files, there is no simply and easy way. Commercial software packages are available from $14.00 to 20Euro.
A simply perl hack does the job:
perl -MCPAN -e 'install("PDF::Reuse")'
use strict;
use PDF::Reuse;
prFile(”output.pdf”);
for(@ARGV) {
prDoc($_);
}
prEnd();
————–
As a side note, it is really easy to concatenate mp3 files on mac, just do:
cat *.mp3>output.mp3
Dr. Tsien Hsue-shen (also spelled as Qian Xuesen) passed away yesterday.
To me, he is as legendary as John Nash. A movie based on his life would also be highly appropriate named “A Beautiful Mind”.
Interestingly, both Nash and Tsien were affiliated with MIT. It was 2008 when I last visited Hang Zhou, the hometown of Tsien, I visited the memorial museum (called Qian King Temple) dedicated to Tsien’s ancestor Qian Liu. I found Tsien’s Certificate of Master of Science, conferred in December, 1936. The design hasn’t changed a bit for so many years. It looks exactly the same as my certificate which I got in 2006, almost 70 years after Tsien got his. I cannot express how proud I was while looking at that certificate.
Tsien is a very typical Chinese scientist, smart, hard-working and humble. He kept a very low profile despite his great achievements. Great achievements comes with great social responsibility, he sets a great example for anyone who cares to call himself/herself a scientist.
Just wrote the most complicated SQL query I’ve ever encountered. Since the table “clicks” has more than 5 million records, I’m going to wait till tomorrow to get the result.
The reason I have to write this is that I was trying to use a PERL program to do the same, and so far, after two days, it is still running with very slow progress.
create table sqlhistory as
SELECT a.inc, a.clicktime, (SELECT MAX(clicktime) FROM clicks b
where a.keyid=b.keyid and a.adid=b.adid and b.clicktime<a.clicktime
) as bctime, a.keyid, a.adid, a.bid, a.price, a.rank, a.reserve_price, a.reserve_price_new
FROM clicks a
where a.bid<>(select c.bid from clicks c
where a.keyid=c.keyid and a.adid=c.adid and c.clicktime=(SELECT MAX(clicktime) FROM clicks b
where a.keyid=b.keyid and a.adid=b.adid and b.clicktime<a.clicktime
)
limit 1
)
======Update====
Sun Wei suggested a new way to do it, and the productivity increased almost 1000 fold
1.
create table clickorder as
select * from clicks
order by keyid, adid, clicktime
2.
create an auto_increment field called ‘inc’, and a new field called lastbid
3.
update clickorder a, clickorder b
set a.lastbid=b.bid
where b.inc=a.inc-1 and a.keyid=b.keyid and a.adid=b.adid
I added an empty passcode to my phone by accident and samsung approved it in the first place. But when I tried to restart the phone, it prompts for a passcode, when I input an empty string, it says the passcode is too short. So there seems to be no way to get over the first screen.
I figured out a way to reset the phone so I can clear the passcode like this:
remove all sim cards from the phone and type:
*2767*2878#
or
*2767*3855#
It worked.
Need to add the following lines to ssh config (~/.ssh/config or /etc/ssh/ssh_config depending on your desired scope)
ServerAliveInterval 300
ServerAliveCountMax 3

Copyright Xiaoquan (Michael) Zhang, 2004-2010. All rights reserved.
All trademarks property of their owners.