Friday, February 3, 2012

svn: how to ignore certain directories recursively


Wanted to use something like the .gitignore method to recursively ignore all files and folders inside a certain path, which in my case is "troy/RobosoftWrapperTest/branches/Build06/Test/robotium/bin"

Here's how you do it (thanks to SO) in svn:

svn propset --recursive svn:ignore '*' troy/RobosoftWrapperTest/branches/Build06/Test/robotium/bin  

Here's how you can confirm/view the changed properties:
$ svn propget svn:ignore -R
RobosoftWrapperTest/branches/Build06/Test/robotium/bin - *

RobosoftWrapperTest/branches/Build06/Test/robotium/bin/res/drawable-ldpi - *

RobosoftWrapperTest/branches/Build06/Test/robotium/bin/res/drawable-mdpi - *

RobosoftWrapperTest/branches/Build06/Test/robotium/gen - *

[...]

Tuesday, January 24, 2012

"mimeomorphic" actions?

Discovered a brilliant site on the art and science of software testing: developsense.com

Encountered a new word while reading about the nature of testing on this blog: "mimeographic."

The usual define: mimeomorphic google query didn't yield the usual dictionary/wikipedia definition, so had to look around a bit more.

Google searches led to connections to AI and perhaps even phenomenology! The terms, "mimeomorphic action" and "polimorphic action" seem to have been coined in a computer science book:


Collins, H. M.; Kusch, M., (1998) The Shape of Actions: What Humans and Machines Can Do , Cambridge, Mass: MIT Press.
This book develops and explores the idea of polimorphic and mimeomorphic actions in great detail following on from the initial distinction which was explored in Artificial Experts and then called regular actions and machine-like actions. Cases dealt with include bicycle riding, love-letter writing, writing in general, McDonalds and the mechanisation of air-pumps.
(source)

More info from scrounging around the Net:
What can humans do? What can machines do? How do humans delegate actions to machines? 

Polimorphic actions (such as writing a love letter) are ones that community members expect to vary with social context. Mimeomorphic actions (such a swinging a golf club) do not vary. Although machines cannot act, they can mimic mimeomorphic actions. Mimeomorphic actions are thus the crucial link between what humans can do and what machines can do.
(source)

 And finally from the point-of-contact website itself (developsense.com):
In The Shape of Actions, Collins and Kusch describe key differences between two kinds of intentional human actions that they call mimeomorphic and polimorphic. In both words, “morph” refers to shape, or form. “Mimeo-” refers to copying. (The grey-haired among us may remember that stencil printing machines used to be called mimeographs.) Mimeomorphic actions are actions that we want to do the same way every time, almost as though we were machines. Collins and Kusch use the example of a golf swing, a kind of action in which we want to eliminate variation and emphasize precision, regularity, and smoothness. “Poli-” is a pun, referring to two similar-sounding Greek roots. The Greek word polys refers to many, much, or several. The Greek polis—a different word entirely— literally means the city, so Collins and Kusch use “poli-” to emphasize the collective and diversified nature of human actions. Polimorphic actions are naturally and appropriately variable, and are rooted in social and human interactions and goals. Conversation is a canonical example of polimorphic action.
(source)

Monday, January 9, 2012

soapui: logging request and response to a file

Note: this code snippet only works within a groovy script assertion for a test step. It will not work for a groovy script test step itself, because messageExchange is not available in a script test step :P


def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )

def d = new Date()
newdate = d.format("yyyy-MM-dd'T'HH-mm-ss")


def myOutFile = "/home/ambar/.loadui/ambar/TrybeSoapUITest." + newdate + ".log"
def f = new File(myOutFile)

f.write("STARTING LOG...\n\n", "UTF-8")

def rawRequest = new String( messageExchange.getRawRequestData() )
f.append("\n\n\n[INFO] RAW Request Data: " + rawRequest)

/*context.currentStep.properties.each { key, value ->
  f.append("${key} : ${value.value}\n")
}*/

//f.append("\n\n\n")

//def requestHeaders = messageExchange.getRequestHeaders()
//f.append("[INFO] request headers: " + requestHeaders)

f.append("\n\n[INFO] response: " + messageExchange.getResponseContent() )
f.append("\n\n[INFO] time taken: " + messageExchange.timeTaken)

assert messageExchange.timeTaken < 10000

Wednesday, January 4, 2012

nginx: simple proxy_pass usage

Problem: send incoming requests containing "/trybe" in the URL on the "enkomion" hostname to the  Trybe REST server locally hosted on tomcat (which is listening on port 8080).

Example:
input="http://enkomion/trybe/..."
output="http://localhost:8080/trybe/..."
(simply have to convert enkomion to localhost:8080 in the hostname part of the URL, but only for /trybe/ location)

Solution:
server{

        ...

        server_name localhost enkomion

        ...

        location /trybe {     
  proxy_pass http://pts;
        }

        ...
}

Friday, December 30, 2011

my eclipse.ini

Just discovered how to tweak and optimize eclipse startup and running performance:

startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.100.v20110505
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Djava.library.path=/usr/lib/jni
-Dosgi.requiredJavaVersion=1.5
-XX:PermSize=256m
-XX:MaxPermSize=256m
-XX:+UseParallelGC
-Xms1024m
-Xmx1024m
-Xss4m

sources:
http://stackoverflow.com/a/7776565/376240

http://www.beyondlinux.com/2011/06/25/speed-up-your-eclipse-as-a-super-fast-ide/

Thursday, December 8, 2011

java's shortcomings

Will keep adding to this list as and when I get more information.

Here are some things I take for granted in Python (and sometimes in C++ too) that aren't available in Java:

- it doesn't have support for multiline strings
- it doesn't support switching on strings (at least until jdk7)

Wednesday, November 30, 2011

linux: network manager keeps removing the nameserver i set in resolv.conf!

I want to always have Google's public DNS servers (8.8.8.8, 8.8.4.4) in my /etc/resolv.conf

However my WiFi settings are set to DHCP (for both office and home) and whenever I get a DHCP address, I also get the DNS servers configured on the DHCP server. These server settings overwrite my /etc/resolv.conf and I lose the

Having to set the nameservers manually in /etc/resolv.conf on each DHCP connection is too painful, so I found a simple and effective solution to this problem:

$ sudo vim /etc/dhcp3/dhclient.conf
# ensure the following line is uncommented in dhclient.conf:
# prepend domain-name-servers 8.8.8.8,8.8.4.4;

$ sudo service network-manager restart



This configures the DHCP client to always prepend the list of DNS servers obtained from DHCP with "8.8.8.8, 8.8.4.4" - and it works like a charm!