Nett zu lesen. Unter anderem interessant:
“We did create unwritable registry keys and file names, by exploiting an “impedance mismatch” between the Win32 API and the NT API. Windows, ever since XP, is fundamentally built on top of the NT kernel. NT is fundamentally a Unicode system, so all the strings internally are 16-bit counter Unicode. The Win32 API is fundamentally Ascii. There are strings that you can express in 16-bit counted Unicode that you can’t express in ASCII. Most notably, you can have things with a Null in the middle of it. That meant that we could, for instance, write a Registry key that had a Null in the middle of it. Since the user interface is based on the Win32 API, people would be able to see the key, but they wouldn’t be able to interact with it because when they asked for the key by name, they would be asking for the Null-terminated one. Because of that, we were able to make registry keys that were invisible or immutable to anyone using the Win32 API. Interestingly enough, this was not only all civilians and pretty much all of our competitors, but even most of the antivirus people.”
Hier lesen 
November 9, 2008 at 10:28 pm.
Abgelegt unter:
Coding,
p300
guruz @ 10:28 pm
I have spent some hours with Hell4You debugging an issue with p300 connectivity on his network. The result of the issues were that browsing and chatting sometimes worked, sometimes it didn’t. By looking at the p300-generated hostfinder webpage and debugging around with the Eclipse debugger we were able to track it down: Some of his hardware / software is duplicating UDP packets and using its own IP as the source IP of the duplicated packet. Really really weird stuff. This resulted in connectivity sometimes not working because the wrong IP was used by p300.
The latest p300 version that will come in some weeks will fix this issue: It will always be checked with HTTP if some ip:port is really running p300. If you experience the same problem as described here, I can send it earlier
For the record, he is using a 3com OfficeConnect and a SpeedTouch 780wl.
Lesson learned? Never trust UDP!
I had some trouble with this (updated my Eclipse for my p300 development), however this works for me on 10.4.x:
- Install the CollabNet SVN package from http://www.collab.net/downloads/community/
- Install Eclipse Ganymede
- In Eclipse, in Help -> Software Updates -> Add Site http://subclipse.tigris.org/update_1.4.x
- Check the latest Version of Subclipse and JavaHL and have it installed
- Restart Eclipse.. and you don’t get “unable to load default SVN client” anymore
The svn binaries are now in /opt/subversion, so maybe you also have to adapt your PATH variable in $HOME/.profile
August 8, 2008 at 8:49 am.
Abgelegt unter:
Coding,
Web
guruz @ 8:49 am
Wenn ihr gerne euren Layerads-Verdienst im Feedreader anzeigen wollt, koennt ihr mit diesem PHP Skript einen Feed erzeugen:
<rss version="2.0">
<channel>
<title>Layer-ads.de Kontostand</title>
<?
$contents = file_get_contents ("http://layer-ads.de/api/BLABLABLA");
$simplexml = simplexml_load_string ($contents);
$amount = $simplexml->xpath ("//layerads/stats/balance");
foreach ($amount as $a)
{
print "<item>";
print "<title>Layer-ads.de Kontostand: " . $a . " EUR</title>";
print "</item>";
}
?>
</channel>
</rss>
Die URL fuer oben findet ihr im Layer-Ads Webinterface bei “Statistiken”.
Ich habe uebrigens auch ein aehnliches Skript fuer Affilinet geschrieben.
April 21, 2008 at 8:42 pm.
Abgelegt unter:
Coding,
Web
guruz @ 8:42 pm
April 17, 2008 at 1:05 pm.
Abgelegt unter:
Coding,
p300
guruz @ 1:05 pm
I’m currently changing the windows in p300 to a MDI interface.
While doing this, I have found a nice Java thing: setLocationByPlatform enables you to let your JVM choose the position of a new Window. This means that windows won’t be placed at 0,0 but will be overlapped according to what your platform thinks is nice.
April 4, 2008 at 12:01 pm.
Abgelegt unter:
Coding,
p300
guruz @ 12:01 pm
I’ve recently spent some hours to track down a mysterious bug and I just couldn’t find it. Since my application is using a lot of Threads/Workers it came to my mind that a RuntimeException I did not catch could be the cause. I wrote a global handler for it and found where the problem was
The code in p300 I am using:
Somewhere in main():
Thread.setDefaultUncaughtExceptionHandler(new P300UncaughtExceptionHandler ());
The class:
public class P300UncaughtExceptionHandler implements Thread.UncaughtExceptionHandler {
public void uncaughtException(Thread t, Throwable e) {
System.err.println ("Uncaught exception by " + t + ":");
e.printStackTrace();
}
}
How to test it:
new Thread () { public void run () { throw new RuntimeException ("x");}}.start ();
April 3, 2008 at 1:44 pm.
Abgelegt unter:
Coding,
p300
guruz @ 1:44 pm
For p300 I am currently using a Selector to check if I can read from or write to a socket.
However this lead me to a weird problem: I am selecting for at most 30 seconds and I have received a timeout for writing even though this can’t really be and only happens with some OS combinations. I’ve found this thread in the Sun Forums and adapted my internal logic to the information from this thread:
Instead of always selecting for OP_WRITE when I want to write, I just try to write. If i was not able to write everything (that is, buffer.remaining () > 0) I select for OP_WRITE.
This seems to work fine
(That fix is not in p300 619 yet, it will come with the next bugfix release in the next days)
März 27, 2008 at 4:46 pm.
Abgelegt unter:
Coding,
Jabber
guruz @ 4:46 pm
You can use guruzJabberd14ToOpenfireExport.jar to convert userfiles from Jabberd 1.4 to the format Openfire understands. Just run it with the directory with the XML-files as parameter. The file for Openfire will be put out on stdout.
März 25, 2008 at 12:44 pm.
Abgelegt unter:
Coding
guruz @ 12:44 pm
I’ve had an interesting problem with the two above mentioned classes. If I understand the API correctly, it is enough to position(pos) on a FileOutputChannel and then use transferFrom. However transferFrom always returned 0. Then I used setLength on the RandomAccessFile the where the FileOutputChannel was derived from and then it worked.
Hope this helps
(Java 1.6 developer preview on OS X 10.4)
Februar 18, 2008 at 7:17 pm.
Abgelegt unter:
Coding,
Funny,
Web
guruz @ 7:17 pm
“I wrote the first version of Gmail in one day. It was not very impressive. All I did was stuff my own email into the Google Groups (Usenet) indexing engine. I sent it out to a few people for feedback, and they said that it was somewhat useful, but it would be better if it searched over their email instead of mine. That was version two.”
(Paul Buchheit)
Februar 17, 2008 at 3:12 pm.
Abgelegt unter:
Coding,
p300
guruz @ 3:12 pm
A stupid thing about Java NIO and using blocking sockets (Who does that? Me in p300 because I want to use the increased performance of using FileChannel.transferFrom) is that the SO_TIMEOUT is not used anymore even if you set it.
However, switching to nonblocking IO is not that hard. You can use one Selector per SocketChannel and select() for OP_READ or OP_WRITE before every read or write. This way you can have a select (timeout in msec).
Februar 2, 2008 at 4:02 pm.
Abgelegt unter:
Coding,
Funny
guruz @ 4:02 pm
Ich beschaeftige mich zur Zeit u.a. mit oben genanntem (englischen) Buch. Im Kapitel ueber Lokalisierung sieht man als Beispiel-Screenshot ein deutschsprachiges Web-Formular mit so tollen Begriffen/Saetzen wie “Geslecht” oder “Registriert den Gewichtkonverter mit dem Konverterbezeichnung Gewicht”. Ich hoffe doch so internationalisiert man nicht
Januar 29, 2008 at 10:45 pm.
Abgelegt unter:
Coding,
Jabber
guruz @ 10:45 pm
Change some lines and be able to merge users instead of having to delete and re-import them.
Januar 29, 2008 at 10:28 pm.
Abgelegt unter:
Coding,
Jabber
guruz @ 10:28 pm
Januar 21, 2008 at 9:34 pm.
Abgelegt unter:
Coding,
Meta
guruz @ 9:34 pm
Add this into your theme file:
<?php
if (is_category())
{
?>
<link rel="alternate" type="application/rss+xml"
title="RSS 2.0 for category"
href="<?php print $_SERVER['REQUEST_URI'] . '/feed' ?>" />
<?php
};
?>
Januar 11, 2008 at 8:16 am.
Abgelegt unter:
Coding
guruz @ 8:16 am
I think I have spent at least 5 hours to get a selectManyCheckbox working properly in JSF (Validation errors and more). However I have found a great source of information. On some other websites you can read that you should use an array instead of a List for the getter/setter of the backing bean.
Maybe these two clues will help you 
Januar 10, 2008 at 1:16 pm.
Abgelegt unter:
Coding
guruz @ 1:16 pm
I had some problems using the id-Attribute to identify a JSF component from Javascript. The reason is that naming containers of JSF modify the id of their contained components. This has advantages and disadvantages. If you are using Javascript or CSS and need to identify a component, it is a disadvantage
The problem is known and the solution I used was using forceId of Tomahawk/Myfaces. It was the simplest thing to do, although it is not that nice to have really static ids.
You can use the Tomahawk components by changing the XML-prefix of your components in your JSF-Code from h: to t: .. that’s it 
Januar 4, 2008 at 8:56 pm.
Abgelegt unter:
Coding
guruz @ 8:56 pm
… with JAutoDoc. You can even update the header for all files
Update 13.3.2008: JAutoDoc sucks. It adds multiple same headers to my files 