Thursday, April 28, 2011
Ant copydir -> copy
copydir is deprecated
<copydir src="${emma.out.dir}" dest="${basedir}" forceoverwrite="true"/>
<copydir src="${emma.out.dir}" dest="${basedir}" forceoverwrite="true"/>
use copy
<copy todir="${basedir}/report" force="true">
<fileset dir="${emma.out.dir}"/>
</copy>
EMMA: RPC failure while executing
when run get coverage task
Exception in thread "main" com.vladium.emma.EMMARuntimeException: coverage.get:
RPC failure while executing [coverage.get]
at com.vladium.emma.ctl.CtlProcessor._run(CtlProcessor.java:242)
at com.vladium.emma.Processor.run(Processor.java:88)
at com.vladium.emma.ctl.ctlCommand.run(ctlCommand.java:151)
at emma.main(emma.java:50)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
- Check if there are duplicated emma jars in the system
- Could be caused by there's no yet any run against the server, hence there's no coverage.ec generated on the server port
- Check if the gen/metadata.emma is the latest, i.e. if it is the result of instrumentation of the current code on the Server
Exception in thread "main" com.vladium.emma.EMMARuntimeException: coverage.get:
RPC failure while executing [coverage.get]
at com.vladium.emma.ctl.CtlProcessor._run(CtlProcessor.java:242)
at com.vladium.emma.Processor.run(Processor.java:88)
at com.vladium.emma.ctl.ctlCommand.run(ctlCommand.java:151)
at emma.main(emma.java:50)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
- Check if there are duplicated emma jars in the system
- Could be caused by there's no yet any run against the server, hence there's no coverage.ec generated on the server port
- Check if the gen/metadata.emma is the latest, i.e. if it is the result of instrumentation of the current code on the Server
Monday, April 25, 2011
bypass proxy
export the proxy env first:
export http_proxy=http://webproxy:3128
redhat
e.g.
wget http://ant.apache.org/bindownload.cgi/apache-ant-1.8.2-bin.tar.gz
NOTE: wget usually give header problem to .tar.gz files
ubuntu:
gem (—http-proxy root:balmor@webproxy:3128) install rails --debug
export http_proxy=http://webproxy:3128
redhat
e.g.
wget http://ant.apache.org/bindownload.cgi/apache-ant-1.8.2-bin.tar.gz
NOTE: wget usually give header problem to .tar.gz files
ubuntu:
gem (—http-proxy root:balmor@webproxy:3128) install rails --debug
Wednesday, April 20, 2011
ssh without password
How to do it (NOTE: sometimes it uses 'dsa' instead of 'rsa')
First log in on A as user a and generate a pair of authentication keys. Do not enter a passphrase:
a@A:~> ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/a/.ssh/id_rsa): Created directory '/home/a/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/a/.ssh/id_rsa. Your public key has been saved in /home/a/.ssh/id_rsa.pub. The key fingerprint is: 3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 a@A
Now use ssh to create a directory ~/.ssh as user b on B. (The directory may already exist, which is fine):
a@A:~> ssh b@B mkdir -p .ssh b@B's password:
Finally append a's new public key to b@B:.ssh/authorized_keys and enter b's password one last time:
a@A:~> cat .ssh/id_rsa.pub | ssh b@B 'cat >> .ssh/authorized_keys' b@B's password:
From now on you can log into B as b from A as a without password:
a@A:~> ssh b@B hostname B
Thursday, April 7, 2011
Spreadsheet sum with condition of value of a column
I want a spreadsheet function that will produce a sum of all values in column B for when column A is equal to 'X' and when it is equal to 'Y' The output should look like the following (where 39 & 16 are the results of the formulas):
|
Sunday, April 3, 2011
Array to list and vice versa
Convert an array to a list.
On the fly list construction:
Convert a list into an array:
List<Date> listOfDates = Arrays.asList(arrayOfDates);
On the fly list construction:
List<Date> listOfDates = Arrays.asList(new Date[]{date1, date2});
Convert a list into an array:
Date[] arrayOfDates = listOfDates.toArray(new Date[]{}); -------------------------
Date[] arrayOfDates = listOfDates.toArray(new Date[0]);
Subscribe to:
Posts (Atom)