The new movie of Darren Aronofsky will open the Venice Film Festival this year. And it will be beautiful movie about ballet and Natalie Portman. This time no math, no science, just pure art, art about art. By "beautiful" I mean.. "beautiful" in the Aronofsky kind of way.
I like the first Aronofsky movie - "Pi". Numbers, Kabalah, the simple well known message, that the more you know, the better you know how sad the story of life is. When I was a teenager, once a friend of mine (Christophor) said to me: "How can you be so happy? There are only 2 ways - either you are very stupid, or you know something we all don't." (I suppose, it was the first one :) )
However, I love art.. and I love science. But I'm agree, that artists should stay artists and they better be no scientists. Otherwise we miss a lot of beautiful stuff.. Like.. Imagine that the frontman of Pearl Jam was thinking about logic, when he wrote the song "I am mine". Then he would stumble upon the sentence "North is to south what clock is to time". And he would probably throw his manuscript in the bin, because anyone who has a basic knowledge of logical expressions would notice how it does not make any sense. But fortunately, Eddie Vedder' s last priority when writing the song, was logic.
And for the fans of Queen, the good news is, Freddy also hasn't put his statements under deep consideration. Otherwise he would notice, that you can't fall in love for the first time knowing that this time it's for real (because you don't have a basis to compare and because "this time" implies the fact you already was in love at least once before).
Anyway..
In 2 weeks I'm changing my home temporary. I got my J1 visa 2 weeks ago and now I'm preparing my stay in Pittsburgh. The good news is, I have the unique chance to learn plenty of new things at one of the best computer science universities in the world - Carnegie Mellon University and I have the support of 2 very important professors, moreover very kind persons. The bad news is, that I had so much stress and disappointments last few months, that I'll be too tired to enjoy completely my stay in Pittsburgh. And I'll miss the good old Europe as well. I hope it's worth...
Friday, September 3, 2010
Monday, August 16, 2010
ascii pictures
Yesterday, I wanted to experiment a little bit with ascii art and was searching for a nice simple piece of software that converts image in ascii art console output. After a while I decided to write some simple java class that do the job (not because there were no such nice programs, but I was tired of searching). It works simple, outputs the image in the console and in a txt file, takes as input argument an image file, but it is not (still) suitable for large images (> 50px each side). Works good with pictograms. And it is not quite ascii, just sign art :) If I find some free hours in the next week, I'm gonna improve it to do more and better job, but for now that's not the case. And here it is:


import java.awt.image.BufferedImage;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import javax.imageio.ImageIO;
public class Visualizer {
public Visualizer(File file)
{
try
{
// the line that reads the image file
BufferedImage image = ImageIO.read(file);
int height = image.getHeight();
int width = image.getWidth();
System.out.println("Picture width: "+width);
System.out.println("Picture height: "+height);
int i, j;
String output = "";
for (i=0; i < height; i++)
{
for (j=0; j < width; j++)
{
int pixel = image.getRGB(j, i);
int grayscale = convertToGrayscale(pixel);
//writes the string for the txt file
output = output+" "+getASCIIforGrayscale(grayscale);
//prints the image in the console
System.out.print(" "+getASCIIforGrayscale(grayscale));
}
output = output+"\n";
System.out.print("\n");
}
writeToFile(output);
}
catch (IOException e)
{
// log the exception
// re-throw if desired
}
}
public int convertToGrayscale(int pixel)
{
//int alpha = (pixel >> 24) & 0xff;
int red = (pixel >> 16) & 0xff;
int green = (pixel >> 8) & 0xff;
int blue = (pixel) & 0xff;
int grayValue = (red + green + blue) / 3;
return grayValue;
}
public String getASCIIforGrayscale(int grayValue){
String ascii = ".";
ascii = lookupTableGray(grayValue);
return ascii;
}
public void printPixelARGB(int pixel) {
int alpha = (pixel >> 24) & 0xff;
int red = (pixel >> 16) & 0xff;
int green = (pixel >> 8) & 0xff;
int blue = (pixel) & 0xff;
System.out.println("argb: " + alpha + ", " + red + ", " + green + ", " + blue);
}
public String lookupTableGray(int gray){
if (-1 < gray && gray < 40)
{
return "@";
}
else if (40 < gray && gray < 60)
{
return "#";
}
else if (60 < gray && gray < 80)
{
return "%";
}
else if (80 < gray && gray < 100)
{
return "0";
}
else if (100 < gray && gray < 160)
{
return "*";
}
else if (160 < gray && gray < 210)
{
return "o";
}
else if (210 < gray && gray < 256)
{
return ".";
}else
{
return ".";
}
}
public String lookupTableBinary(int gray){
if (-1 < gray && gray < 170)
{
return "@";
}
else if (170 < gray && gray < 256)
{
return ".";
}
else
{
return "_";
}
}
public void writeToFile(String output) throws IOException
{
BufferedWriter out = new BufferedWriter(new FileWriter("asciitest.txt"));
out.write(output);
out.close();
}
public static void main(String[] args) {
File file = new File(args[0]);
new Visualizer(file);
}
}


import java.awt.image.BufferedImage;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import javax.imageio.ImageIO;
public class Visualizer {
public Visualizer(File file)
{
try
{
// the line that reads the image file
BufferedImage image = ImageIO.read(file);
int height = image.getHeight();
int width = image.getWidth();
System.out.println("Picture width: "+width);
System.out.println("Picture height: "+height);
int i, j;
String output = "";
for (i=0; i < height; i++)
{
for (j=0; j < width; j++)
{
int pixel = image.getRGB(j, i);
int grayscale = convertToGrayscale(pixel);
//writes the string for the txt file
output = output+" "+getASCIIforGrayscale(grayscale);
//prints the image in the console
System.out.print(" "+getASCIIforGrayscale(grayscale));
}
output = output+"\n";
System.out.print("\n");
}
writeToFile(output);
}
catch (IOException e)
{
// log the exception
// re-throw if desired
}
}
public int convertToGrayscale(int pixel)
{
//int alpha = (pixel >> 24) & 0xff;
int red = (pixel >> 16) & 0xff;
int green = (pixel >> 8) & 0xff;
int blue = (pixel) & 0xff;
int grayValue = (red + green + blue) / 3;
return grayValue;
}
public String getASCIIforGrayscale(int grayValue){
String ascii = ".";
ascii = lookupTableGray(grayValue);
return ascii;
}
public void printPixelARGB(int pixel) {
int alpha = (pixel >> 24) & 0xff;
int red = (pixel >> 16) & 0xff;
int green = (pixel >> 8) & 0xff;
int blue = (pixel) & 0xff;
System.out.println("argb: " + alpha + ", " + red + ", " + green + ", " + blue);
}
public String lookupTableGray(int gray){
if (-1 < gray && gray < 40)
{
return "@";
}
else if (40 < gray && gray < 60)
{
return "#";
}
else if (60 < gray && gray < 80)
{
return "%";
}
else if (80 < gray && gray < 100)
{
return "0";
}
else if (100 < gray && gray < 160)
{
return "*";
}
else if (160 < gray && gray < 210)
{
return "o";
}
else if (210 < gray && gray < 256)
{
return ".";
}else
{
return ".";
}
}
public String lookupTableBinary(int gray){
if (-1 < gray && gray < 170)
{
return "@";
}
else if (170 < gray && gray < 256)
{
return ".";
}
else
{
return "_";
}
}
public void writeToFile(String output) throws IOException
{
BufferedWriter out = new BufferedWriter(new FileWriter("asciitest.txt"));
out.write(output);
out.close();
}
public static void main(String[] args) {
File file = new File(args[0]);
new Visualizer(file);
}
}
Wednesday, August 11, 2010
ConQuest 2010
Back from ConQuest... That was my first LARP, but definitely not the last one.
Here's the story, in pictures and words, although these two are far more insufficient to describe what happened:
Day 1:
After 9 hour train trip, we finally got there and my first impression was: Oh, God! No internet, no electricity and cow shits everywhere. I have to survive somehow until Sunday..

Der Sieger baut ab :)

The town
Day 2:
As in all stories, the world is inhabited with good and evil. At the beginning, there was only good - the pure elements: earth (avatar: Terra), water (avatar: Aqua), air (avatar: Aeris), fire (avatar: Ignis) and magic (avatar: Magica).
But then, of course, in order to preserve the balance, the evil was created. And that's us - the banished, the evil children of the second creation: Schwarzes Eis, Untotes Fleisch, Leere, Pestilenz and Technische Ratio.

Schwarzes Eis

Untotes Fleisch

Leere
The Technische Ratio is part of the story, but there are no players indeed, because it is too powerful and therefore buried.
Doerchgardt is the fortress of the Untotes Fleisch and our mission is to defend it from the attacks of the elements.

Fortress Doerchgardt

An'nai Herr von Doerchgardt

The throne of the Knochen-Königin
2 years ago, we buried the avatar of Terra under a pyramid in Doerchgardt and now, the elements want to set her free. To do that, they first have to conquer our fortress.
In this first day of the play, our swarm (Schwarm 7) of Schwarzes Eis had duty from 21 p.m to 4 a.m. We had to defend the fortress, but there wasn't much to defend at all, because the players had party and didn't care much of attacking at this time. They also didn't have the necessary equipment to damage the walls of our fortress. Therefore we succeeded in stealing a big army gun from the Neutral camp.




Day 3
Day 3 was really hard, since we had duty till 4 a.m. previous night. After long hours of defending, at the end the players invaded Doerchgardt. Which was actually good, because otherwise we had to stay till 4 a.m. again. I was very sad, but our Sharun - Andy told me that it is not a big deal and we will get our fortress right on next day. So it was…
Day 4
Early in the morning we organized a little invasion in the Air Camp, just to wake up the players and prepare them for the fight. After lunch, we all marched in Doerchgardt and in approximately 20 min the fortress was ours again. However, it wasn't for a long, because in the late afternoon the players got together and Doerchgardt fell gain. And again, it was good, because they freed us of duty during the night.
Although the fortress was theirs, they couldn't set Terra free, because the players didn't succeeded in fulfilling their plots. Moreover, the group responsible for the instructions how to free Terra was dead.
Day 5
The players seem to learn very slow, since they left not more than 20 people to defend Doerchgradt again. And again, early on Saturday, 2 swarms marched in the fortress and in 10 min it was ours. At this point, the story was black for the elements, but the rest of the day everything changed.
We attacked the Magic and Fire Camps, because we received the mission instructions to bring back 7 prisoners. A hard fight under the midday sun, but we succeeded. Moreover, we captured another Avatar (but I'm not sure which one). We were already very very tired and it was pretty clear, that we cannot keep the fortress till the end of the day… And the end of the day was also the end of the play.
On the right side - me, dead


We lost the final fight, indeed. 3 holes in the fortress wall and a burning tower. Aching muscles everywhere, sun burn and unconquerable sleep drive.. We've lost the fortress.. They freed Terra.. it's part of the game.. but in practice, when you give 100% of you, nobody can call you a loser :)
Here's the story, in pictures and words, although these two are far more insufficient to describe what happened:
Day 1:
After 9 hour train trip, we finally got there and my first impression was: Oh, God! No internet, no electricity and cow shits everywhere. I have to survive somehow until Sunday..

Der Sieger baut ab :)

The town
Day 2:
As in all stories, the world is inhabited with good and evil. At the beginning, there was only good - the pure elements: earth (avatar: Terra), water (avatar: Aqua), air (avatar: Aeris), fire (avatar: Ignis) and magic (avatar: Magica).
But then, of course, in order to preserve the balance, the evil was created. And that's us - the banished, the evil children of the second creation: Schwarzes Eis, Untotes Fleisch, Leere, Pestilenz and Technische Ratio.

Schwarzes Eis

Untotes Fleisch

Leere
The Technische Ratio is part of the story, but there are no players indeed, because it is too powerful and therefore buried.
Doerchgardt is the fortress of the Untotes Fleisch and our mission is to defend it from the attacks of the elements.

Fortress Doerchgardt

An'nai Herr von Doerchgardt

The throne of the Knochen-Königin
2 years ago, we buried the avatar of Terra under a pyramid in Doerchgardt and now, the elements want to set her free. To do that, they first have to conquer our fortress.
In this first day of the play, our swarm (Schwarm 7) of Schwarzes Eis had duty from 21 p.m to 4 a.m. We had to defend the fortress, but there wasn't much to defend at all, because the players had party and didn't care much of attacking at this time. They also didn't have the necessary equipment to damage the walls of our fortress. Therefore we succeeded in stealing a big army gun from the Neutral camp.

Day 3
Day 3 was really hard, since we had duty till 4 a.m. previous night. After long hours of defending, at the end the players invaded Doerchgardt. Which was actually good, because otherwise we had to stay till 4 a.m. again. I was very sad, but our Sharun - Andy told me that it is not a big deal and we will get our fortress right on next day. So it was…
Day 4
Early in the morning we organized a little invasion in the Air Camp, just to wake up the players and prepare them for the fight. After lunch, we all marched in Doerchgardt and in approximately 20 min the fortress was ours again. However, it wasn't for a long, because in the late afternoon the players got together and Doerchgardt fell gain. And again, it was good, because they freed us of duty during the night.
Although the fortress was theirs, they couldn't set Terra free, because the players didn't succeeded in fulfilling their plots. Moreover, the group responsible for the instructions how to free Terra was dead.
Day 5
The players seem to learn very slow, since they left not more than 20 people to defend Doerchgradt again. And again, early on Saturday, 2 swarms marched in the fortress and in 10 min it was ours. At this point, the story was black for the elements, but the rest of the day everything changed.
We attacked the Magic and Fire Camps, because we received the mission instructions to bring back 7 prisoners. A hard fight under the midday sun, but we succeeded. Moreover, we captured another Avatar (but I'm not sure which one). We were already very very tired and it was pretty clear, that we cannot keep the fortress till the end of the day… And the end of the day was also the end of the play.
On the right side - me, dead


We lost the final fight, indeed. 3 holes in the fortress wall and a burning tower. Aching muscles everywhere, sun burn and unconquerable sleep drive.. We've lost the fortress.. They freed Terra.. it's part of the game.. but in practice, when you give 100% of you, nobody can call you a loser :)
Friday, July 23, 2010
On average..
"Announcing that on average, people have an average intelligence is kind of boring. What's interesting about intelligence and what is interesting about things like personality is the variation around the mean and the explanation about that variation. And that's what we need to start talking about now.
Oh, btw. well, it is, of course, by definition the case, that on average, people have average intelligence, they don't believe it. If you ask people "Do you think that you are more intelligent, less intelligent or about of average intelligence compared to the rest of the population, you'll get some distribution around that, too. But you'll find that the average perception of intelligence is that we're all above average.
This goes for a variety of other questions like "How good looking are you? Above average, below average or average?". Well, we're all little above average there, too. It turns out, that there is one group that gets the answer correct. And if you ask this group of people on average "Are you brighter or dumber than average, they'll come out in the middle. Asked "Are you cuter or uglier than average?", they'll come out, you know, average. Anybody knows who that group is? ….. Yes, it's the depressed. Depressed people have an accurate assessment of their own intelligence and good looks. In fact, it has been seriously argued, that part of what keeps us undepressed is an unrealistic assessment of the world. Right? We're smart, we're good looking … if we knew the truth, we all will be depressed. But that's a topic for another date. …."
Extracted from the Jeremy Wolfe's lecture "Intelligence: How do we know you are smart?"
Oh, btw. well, it is, of course, by definition the case, that on average, people have average intelligence, they don't believe it. If you ask people "Do you think that you are more intelligent, less intelligent or about of average intelligence compared to the rest of the population, you'll get some distribution around that, too. But you'll find that the average perception of intelligence is that we're all above average.
This goes for a variety of other questions like "How good looking are you? Above average, below average or average?". Well, we're all little above average there, too. It turns out, that there is one group that gets the answer correct. And if you ask this group of people on average "Are you brighter or dumber than average, they'll come out in the middle. Asked "Are you cuter or uglier than average?", they'll come out, you know, average. Anybody knows who that group is? ….. Yes, it's the depressed. Depressed people have an accurate assessment of their own intelligence and good looks. In fact, it has been seriously argued, that part of what keeps us undepressed is an unrealistic assessment of the world. Right? We're smart, we're good looking … if we knew the truth, we all will be depressed. But that's a topic for another date. …."
Extracted from the Jeremy Wolfe's lecture "Intelligence: How do we know you are smart?"
Subscribe to:
Posts (Atom)