Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Monday, July 18, 2011

Cuddling with cat > [insert activity here]

Anyone can understand programming, just look at this:

public class Cat extends Pet {

public void getAttention(mistress) {

if(attention==false){
try{
sitOnKeyboard();
if(attention==true)
break;
pokeObject(breakable);
if(attention==true)
break;
chewOnCables();
if(attention==true)
break;
} catch (OverProvocationException op) {
runAwayHide();
}
}

}

public void main(String[] args) {
Cat.getAttention(me);
if(attention==true) {
purr();
}
}

}

Thursday, July 14, 2011

beta test

EDIT: Graphical UI now implemented, it was many easier than I thought. And the "bunny" type will work now, and this time I mean it :P The window looks kinda funny... because well, it was easy enough to make it work, but to make it look like I wanted... whole other story./EDIT


I've been playing around with java and have managed to generate something that might work, so now I'd like to see if it really is something to bounce about like a bunny over.

You'll find it here.

I'd love it if some people would like to try the program so I can get some beta test results :) For windows it should be just double-clicking the Evolution.jar file. For Linux, either double click it, but if that just opens a folder you open terminal and go to the file's locaton and write "java -jar Evolution.jar". For mac I have no idea :p

Oh and you need JRE but you should already or I'll be a fat surprisedcat. Otherwise just get it, you'll need it for other things.

Wednesday, January 5, 2011

bah

Internet slow. Blogging from phone also slow.
Damn ubuntu. Lost several days work. Then spent entire day reinstall bc internet slow. Then another day bc you dont install in ubuntu, you get a list of libraries that you by hard work and mercy of the internet find and install by command lines after reading up on forums how to survive w/o the ones not found. Then possibly you get a .tar, god forbid they give you a .bin, and once you figure what to do with it and all the command line arguments necessary, it still wont work bc you didnt clean out everything and start over that one time you mistyped something.
Why on earth would we give you a program where the whole thing is included and that you can just run?
Did I mention its a text editor Im trying to install?

Tuesday, December 1, 2009

Less than 3

Uppgift 8.42 Vilka ord i samma fil har högst åtta
bokstäver och har två dubbeltecknade bokstäver i
rad, så som t. ex. »rättssal«.


8.42 egrep "^.{0,2}([[:alpha:]])\1([[:alpha:]])\2.{0,2}$|^([[:alpha:]])\1([[:alpha:]]).{0,4}\2$|^.{0,4}([[:alpha:]])\1([[:alpha:]])\2$|^.{0,1}([[:alpha:]])\1([[:alpha:]])\2.{0,3}$|^.{0,3}([[:alpha:]])\1([[:alpha:]])\2.{0,1}$" /local/dict/dsso-list.txt

Uppgift 8.43 Använd sed för att lösa om uppgiften
med att vända ordningen på us-states.txt från
överst på s. 70.

8.43 sed -r "s/([0-9]{4}-[0-9]{2}-[0-9]{2})([[:blank:]])([[:alpha:]]+.*)/\3\2\1/g" us-states.txt | sort

Uppgift 8.44 Tänk dig att en text har använt deci-
malpunkt istället för decimalkomma, dvs. där står
t. ex. »3.14« istället för »3,14«, men det ska ändras
till decimalkomma. Skriv ett sed-kommando som
byter ut sådana punkter som står mellan två siffror
till komman (men inte byter ut andra punkter!).

8.44 sed -r "s/([[:digit:]]+)(\.)([[:digit:]]+)/\1,\3/g"


Victory is mine! Mine mine mine mine!

It's also 19.30 and this took me like 3 hours... buuut...

^_________________________^

I have a gnawing feeling there is an easier way to do 8.42, cuz it's really ugly, and I really hope all of this is right... buuut....

I have concluded that I really like regular expressions. They are ultimate logic.

PS: sorry this totally invaded on the attention for your birthday cake, nallenon! I am a terrible friend!