I wrote this:
in Java
import java.util.*;
class StackTest
{
public static void main (String[] s)
{
Stack stack = new Stack ();
stack.push ("a");
stack.push ("b");
stack.push ("c");
Iterator itr = stack.iterator ();
while (itr.hasNext ())
System.out.print (itr.next () + " ");
System.out.println ();
stack = null;
}
}
and C#
using System;
using System.Collections;
class StackTest
{
public static void Main ()
{
Stack stack = new Stack ();
stack.Push ("a");
stack.Push ("b");
stack.Push ("c");
IEnumerator e = stack.GetEnumerator ();
while (e.MoveNext ())
Console.Write (e.Current + " ");
Console.WriteLine ();
stack = null;
}
}
The result:
$ javac StackTest.java
$ java StackTest
a b c
$ mcs StackTest.cs
$ mono StackTest.exe
c b a
What the heck? This is confused, but I like more the
.NET framework implementation. So, here is my own stack implementation:
Stack.java alongside with the test
program StackTest.java.
Okay, here is also a similar example in C++:
#include <iostream>
#include <string>
#include <list>
using namespace std;
int main ()
{
list<string> stack;
stack.push_back ("a");
stack.push_back ("b");
stack.push_back ("c");
for (list<string>::const_iterator itr = stack.begin ();
itr != stack.end (); itr++)
cout << *itr << " ";
cout << endl;
for (list<string>::reverse_iterator itr = stack.rbegin ();
itr != stack.rend (); itr++)
cout << *itr << " ";
cout << endl;
return 0;
}
$ g++ StackTest.cc -o StackTest
$ ./StackTest
a b c
c b a
Notice that I didn't use <stack>,
because it is a container adapter and it doesn't provide the iterators.
Found PBase, a really nice
photo database. It has many interesting galleries and provides a good search engine
where you can search photos by keyword, by
country (and city), and even by a camera
type.
Some quick links:
A lot of rants
about Google's recent proprietary
Desktop Search tool. Right now, it's poor and MS Windows-only. It sucks,
but we can use Beagle
instead!
Update: It is a very good album.
The more I listen to it, the more I like it.
GNU Anubis 3.9.96 Released
I think the most important addition is a new automatic
test suite for the Dixie mode, because doing manual tests
takes a lot of time and it is drudging. As I already mentioned
it earlier in my blog, we have adjusted the format of plain
text database, which allows now for inclusion of empty fields.
I'm also very happy to see those less user-visible changes,
like the XELO
extension, the use of MD5 checksums
when checking user configuration file on a remote machine,
and the recent error handling improvement.
According to our roadmap, version 4.0 will be
released on December 15th, 2004. Uhm, so less than 3 months remain,
but we are going to hit that date, you can bet on it :).
Translucent Windows in X.
See the remarkable samples.
I like this one
best as it's quite impressive for me.
libmu_cpp hacking
A lot of new stuff... Added new classes (but not always
complete): List
, Iterator
, Mailer
,
Pop3
, and improved rest of the code.
Anubis
Jim Cheetham suggested an interesting thing in his
post
on bug-anubis.
I converted all my previous 4:3 photos to 3:2 format,
which I prefer more.
| The Good Old Times |
Thanks to ScummVM,
once again I was able to run hilarious The Secret of Monkey Island
game. Last time I played it about 10 years ago! It reminded me of the good
old times :).
I love this game's specific
humor!
Hah, I even ran
the second part...
I have moved my home page to a new location at wilk. Thanks Bartek!
The new iMac G5
looks pretty!
libmu_cpp hacking
Today I added the FilterStream
class that
derives from the Stream
and provides filtering mechanism, i.e.
quoted-printable, base64, etc. Now I am able to run the exemplary
iconv.cc
. Moreover, I extended the Stream
class and successfully ran new murun.cc
.
I think the project work is slowly going in the right
direction, but there is still a lot of work to be done. I definitely must
put more effort into this. I wish I had more free time...
A reflection upon...
It's almost a rule that every music band releases an album
of singles, often calling it "The best of ...", etc.
This !@#$#*. First of all, because it is
(I believe) only about money. Second of all, if you're a fan of any group,
then you usually have all the albums and you don't need the stuff like this.
It's even more annoying when, as an addition, the singles collection contains
a bonus material, like one or two new songs never released before. Sigh.
This time it is Placebo. The band announced that
on 25 October they will release a collection of their singles-to-date, entitled
Once More With Feeling: Singles 1996-2004. I have all their four albums
(each absolutely great) and normally I wouldn't do that, but this time
I'm going to make an exception and buy it (but of course only if I will
like the two new songs).
Anyway, I don't like the idea of releasing the singles
collection when a band or artist is still active.
Yeah, nice rumor.
Don't fool yourself, kids ;).
As every week this summer, I spent the Saturday outside
the city. This time I took fifty new photos. I'll put some of them here
in a future.
libmu_cpp hacking
I added overloaded []
operator
to Mailbox
and Header
. This small hack
allows to replace the code like this:
Message msg = mbox.GetMessage (1);
Header hdr = msg.GetHeader ();
cout << hdr.GetValue ("From") << " "
<< hdr.GetValue ("Subject") << endl;
with this:
Message msg = mbox[1];
Header hdr = msg.GetHeader ();
cout << hdr["From"] << " "
<< hdr["Subject"] << endl;
I think it's quite nice :). I will also use this scheme
in other parts of the library.
blogRight!
Sergey hacked the code for generating the calendar.
Good work, man! I just adjusted it to generate the layout I use here.