C++ for RunawaysBecause of neuroinformatics I try to write a little neural network in C++. I am not a big C++ expert so I had to review some things.
If you would like to stream a file C++-like with std::ifstream file(filepath); and you put it into a function which needs the filepath as an argument you need to use char* filepath instead of std::string filepath. That surprised me much because char* is bad C++ style somehow.
Another problem was the output of real numbers.
Firstly I used std::cout to print these using the float type. But it shows me only
six decimal places.
Then I tried the C style with
printf.
The solution was, to use double (it is really enough for our purposes) and
printf("%.10E\n", input);.
That surprised me, too, because I used a C element just another time instead of C++.
After it I've done a really bad mistake. I used the << operator together with an ifstream variable. But it is not defined with that. I had to use ofstream of course.
Another thing was that you cannot declare a variable y1 and y2 if you use math.h, because they were already declared there. Interesting. I didn't know that...
Please notice that we'll reboot nanofortnight
on Thursday, 07.02.2008, 15:00 +0100 because of a kernel switch.
This will be a switch between 2.4 and 2.6.
Gentoo stopped the support of the 2.4 kernels. We used this upgrade guide for the migration. Hopefully the downtime will be as short as possible. We'll hope the best.
Hardware failure of nanofortnight
Almost one week ago we've got a hardware failure on
nanofortnight. One heat sink lost contact.
Now we tried a little bit of thermal grease to fix it. After a downtime to cool down we've got problems with almost all of our
services.
The problem was based upon the fact that we replaced dnscache with the nameservers of our provider.
But we forget that /etc/resolv.conf is overwritten with the config of /etc/conf.d/net on startup. So everything couldn't be resolved at this time anymore.
Today I was at the data center and fixed it myself. Everything should be up, running and just fine. Sorry for any inconviences. If you still notice some strange things, please report it.
At the end I want to thank again the team of mammutware
for the great support.
Haskell: AdvantagesAt the end of our Haskell excurs I would like to list some advantages of this really nice functional language.
Haskell: Intro
This
semester we must study
Haskell.
It's a functional language.
This means that you have to use in Haskell a lot of
functions to program.
It also has got pattern matching,
lazy evaluation,
monads and so on
as features.
At present I read the tutorial
Haskell Tutorial for C Programmers
. Hopefully I'll understand this
paradigm at some time.
It's a nice language nevertheless to do something absolutely different to C or C++ or the whole procedural programming languages.
Change of nanofortnight
During Thursday (01.03.2007) nanofortnight
will be shut down. That's why my provider the MGLCom skips housing private servers.
I will travel on Friday to Hanover and move nanofortnight into another date center.
Sorry for any inconviences and for the downtime. See you all l8er.
347 days uptimeToday I reconstruct which uptime nanofortnight had got while the power failure happened. Nanofortnight had been up for 347 days on 2006-11-26 (+/- 1 day).
And I would like to congratulate nanofortnight, because on 12-12-2005 the project started in the server rooms in Hannover. Without the lose of power it would has got now an uptime over one year.
I never expect a so long time. Thanks to all people who made (and still make) this project possible!
Downtime nanofortnightYesterday there was a downtime of nanofortnight.org. The logs said that the server was unavailable between 2006-11-26-05:17 and 2006-11-26-09:18:42. It doesn't look like a hard disk failure but like a lose of power. But there isn't any information provided by the ISP...
Our smokeping says that nanofortnight was later on between 09:00 and 10:00 also not available. The logs look like there was no link available on eth0 in this periode of time. But no information about this either.
Nanofortnight is now syncing its raid disks and I am really happy that the server came up again after the power failure.
Services which are not affected by this were IRC, DNS and mail/mailman. Thanks again to the forkbomb guys for the redundant support. :-)
Update: All information of the ISP. (German edition)
Logserver vs. GirlfriendI don't know if you know, but I work for the FeM on a central logserver. It's not a huge project. I should realise that every server/client at the FeM net could log on that logserver. Furthermore the logserver should look into the log files and then warn the admin, if him's server/client did strange things.
At some time I compared this logserver and a girlfriend. I figured out that
Florian seted up a
Debian virtual machine in a few days. It runs very
stable, it's connectable all the time and I have got a lot of fun with it.
But what about a girlfriend?
You need a lot of time to find a girl and you never know if she's the right one. Then the girl isn't connectable all the time by you, and sometimes you will have got a huge delay in her responses. Furthermore the relationship to her can change very fast...
I prefer the logserver this time. ;-)
Hating JavaThis is a story about hating Java. If you like Java, stop reading! It's the story about my personal try to get on a Gentoo based PPC machine Java to run.
Firstly, I searched for the JDK (Java Developer Kit) on Sun's java page and IBM's page. Simply they have got no binaries for PPC. You may ask you why I searched for binaries? That's why Java is not free software so I've got no chance to compile anything.
Then I've got a look at the Gentoo ebuilds for the JDKs and figured out why they are masked. Simply, it doesn't exist any PPC binary, so the ebuilds only download x86 and amd64 ones. No surprise.
Secondly, I imaged a free alternative: Blackdown. I even saw that they had got no PPC binary for the latest version(s). But I downloaded the JDK-1.3.0 tarball. And then I tried to execute some binary stuff of it. That seems to work well - let's try the IDE.
I decided to have a try with Eclipse. You must notice that Eclipse was written in Java and it's an IDE for almost everything. I tried to get the installer run:
platinum-iridium eclipse # /tmp/j2sdk1.3/bin/java -Xms40m -Xmx256m -jar \ /tmp/eclipse/./startup.jar -os linux -ws gtk -arch ppc \ -launcher /tmp/eclipse/./eclipse -name Eclipse -showsplash \ 600 -exitdata 280007 -vm /tmp/j2sdk1.3/bin/java \ -vmargs -Xms40m -Xmx256m -jar /tmp/eclipse/./startup.jar /tmp/j2sdk1.3/bin/ppc/native_threads/java: relocation error: /tmp/j2sdk1.3/jre/lib/ppc/libjava.so: symbol __libc_wait, version GLIBC_2.0 not defined in file libc.so.6 with link time reference
You see my problem? My JDK is much older than my latest GNU C Library. What the hell?
But what could be the alternatives? GCJ? GNU Classpath? But Eclipse needs the JDK(!) and the development of an Eclipse installation based on GCJ and GNU Classpath is very alpha... If someone could help - please let me know... (but any hint with proprietary software or emulation will be ignored ;-))
>300 days uptimeOh. I missed the 300th day that nanofortnight is up.
nanofortnight:~# uptime 20:13:40 up 305 days, 8:33, 18 users, load average: 0.02, 0.02, 0.00
Java: Hello WorldToday I tried to compile my first Hello World program in Java with the help of the GCJ (GNU Compiler for Java).
At first I've looked at the Hello World java page of the Wikipedia and then wrote the file:
sebastian@nanofortnight ~ $ cat HelloNewWorld.java
public class HelloNewWorld {
public static void main(String[] args) {
System.out.println("Hello New World!");
}
}
After this I began with the compilation:
sebastian@nanofortnight ~ $ gcj -c -g -O HelloNewWorld.java; \
gcj --main=HelloNewWorld -o HelloNewWorld HelloNewWorld.o
sebastian@nanofortnight ~ $ ./HelloNewWorld
Hello New World!
It is unimaginable how long it took to start the simple program...
Hello guys out there! Sorry for being inactive these days - but there are much of work. :-/
First I had to redesign a layout for a webpage and worked there together with doomed on it - much work, and some really nasty CSS things. But it looks now not too bad in the end. ^_^
Today I worked on my old school website and added there a new category and some new articels. Hopefully someone enjoy it.
Only 2 days left until holidays for our pupils in Thueringia. So I wish everybody a great summer and lot of fun!
Today I am proud to tell you that my server nanofortnight.org has got an uptime of 200 days.
nanofortnight:~# uptime 14:53:02 up 200 days, 3:17, 17 users, load average: 2.46, 2.12, 1.87
Today my server nanofortnight.org has got an uptime
of 100 days.
root@nanofortnight:~# uptime 21:55:58 up 100 days, 11:25, 12 users, load average: 0.00, 0.00, 0.00
I would like to thank everyone who is involved in this project and may GNU/Linux be with you all...
Another highlight of the history of nanofortnight.org is that at the moment
all IRC server in Forkbomb's network link
against nanofortnight.
--- irc.nanofortnight.org (1) 11 --- |-thor.asgard.ch (1) 20 --- |-forkbomb.ch (3) 10 --- | `-services.forkbomb.ch (8) --- |-dugong.forkbomb.ch (0) 22 --- |-killerfox.home.forkbomb.ch (3) 23 --- |-irc.blubb.li (0) 21 --- `-moloch.forkbomb.ch (4) 24 --- End of /MAP