Tweet-button for website

Yeah, completely in twitter-fever! Just developed a tweet-button.

You can see the button at the end of every post. The button itself of course isn’t my work, I just copied it from twitter, but when you click the link around it you can tweet the actual post directly to twitter! Feel free to try it! ;)

It’s more than easy. All the code you need is (replace […]):

<a href="http://twitter.com/share?url=[URL_TO_THIS_SITE]&amp;lang=[en|de|..]&amp;via=[NAME_OF_YOUR_TWITTER_ACCOUNT_FOR_@_LINK]&amp;text=[TEXT_FOR_TWITTERMSG]" >
      Tweet it <img src="[TWITTER_IMAGE]"/>
</a>

So the code that I wrote in my theme is:

if ( is_singular() )
{
	$tweet = '<span id="tweetit"><a href="http://twitter.com/share?url=https%3A%2F%2F'.$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"].'&amp;lang=en&amp;via=binfalse&amp;text='.the_title('', '', false).'" >
	<span id="tweetittext">Tweet it</span>
	<img src="/wp-content/uploads/2010/08/btn_tweet_mini.png"/>
	</a></span>';
	$tweet .= "<br />";
}

After that just using the $tweet variable at any position I like ;)

Here you can find a documentation.

Journey to Usedom

The last two weeks I took a time out. The first week I visited my sister living on Usedom, Rumpel came with me.

Those of you who are following me on Twitter may have noticed the one or other story, it was one of the best trips I made! Very funny and of course much too short ;)

We cycled a lot of km’s, climbed on trees, swum in the Baltic Sea, took sunbathes on the beach, went to Poland and so on. Detailed reports would blow up the framework of this website, but I’ll provide some pictures at Picasa, here is also a YouTube video from Poland.

And I’ve prepared a funny animated gif of an interesting evening ;)

So, if you ever have the chance to go to Usedom: Do it!!

Usedom - Aug 2010
Usedom - Aug 2010

Entering next level: Wordpress 3.0.1

The yellow bar on the top of the administration panel was very annoying, so I just decided to update the Software.

Nothing special happened, please tell me if anything seems to be wrong!

Btw. I installed another plugin that tweets news from this blog. Let’s see if it works.

Expiration dates of hash functions!?

Just read the so called Algorithmencatalog (maybe Algorithms Catalog in English!?), published by our German Bundesnetzagentur. They seem to know exact expiration dates for hash functions ;)

In this PDF file I found the following table (see original screen-shot):

* i.e. for creation of qualified certs, not for creation or verification of other qualified signed data. ** i.e. for creation of qualified certs with at least 20 bit entropy in its serial number, not for creation or verification of other qualified signed data. *** exclusively for verification of qualified certs
Creation of qualified certs*: suitable til end of 2009 Creation of qualified certs**: suitable til end of 2010 suitable til end of 2010 suitable til end of 2015 suitable til end of 2016
SHA-1 SHA-1 RIPEMD-160 SHA-224 (SHA-1, RIPEMD-160)*** SHA-256, SHA-384, SHA-512

So I hope there is anybody out there that has started to crack SHA-1 to get finished this year :P

(maybe it’s the recounter’s turn!?^^)

Smart game

Yesterday, while waiting in a traffic jam, I implemented a small game. I read about this game in a book and to not get too annoyed about the waiting time I opened the lid of my laptop and wrote this game. This morning I completed it with some usual stuff to increase the usability..

It’s written in C++ and you can play against the CPU. There is a strategy that makes you win in almost every case! This game is a classic in game theory, but if I provide you with it’s original name it’ll too easy for you to solve the problem with help from Wikipedia or something like that. So just try it on you own ;)

The aim of the game is to clear all the stacks that are filled with o ‘s. The stacks may look like this:

stack   size
0:      ooooo (5)
1:      oooooo (6)
2:      ooooooo (7)
3:      ooooooo (7)
4:      oooo (4)
5:      oooooooo (8)
6:      oooooo (6)

Now it is your turn to choose one of these stacks and remove some or all o’s of it. Notice that you have to remove at least one of them and you can only remove o’s from one single stack! After your turn, the artificial intelligence will do the same. Afterwards it’s again your turn, until all stacks are cleared. Winner is the one who cleared the last stack, so try to get the last o ;) Here is the download.

You can choose the number of stacks and the maximum number of o’s a stack can carry:

USAGE:
        -n      number of stacks [2..30]
        -m      maximal stack size [5..50]

If anybody knows the strategy, feel free to tell me!

Download: C++: NIM - the game (Please take a look at the man-page. Browse bugs and feature requests.)


Martin Scharm

stuff. just for the records.

Do you like this page?
You can actively support me!