Category Archives: Talk

Talk about politics, society, science, computers, internet, psychology, and philosophy.

Game of Thrones, season 2 – one month to go!

To celebrate there’s only a month (unfortunately a long month, but still) left until season 2 of Game of Thrones premieres (April 1, 2012), I’ve collected some trailers and teasers from youtube!

I like this trailer the most, it just has this… we’re-plotting-to-kill-each-other-feel to it, however these two are also very nice:

Game of Thrones Season 2 HBO GO Trailer

Game Of Thrones: Season 2 “Cold Winds” Tease

 

This year they’re travelling a lot to get to all the good places, like Croatia, Iceland and Belfast!

Game Of Thrones Season 2: In Production – Croatia

Game Of Thrones Season 2: In Production – Belfast

Well, perhaps I can spend the remaining 31 days (oh! actually more or less 30 days now!) reading the book and revisiting season 1?

 

Pure silence is added whenever possible.

Couldn’t help myself! I’m using some random text (Lorem Ipsum) in an application (I took a couple of sentences, split them up into words and randomized them into a new “text”), and I got curious about what would happen if I took my random text and run it through Google Translate. Here are some golden nuggets!

Love in the digital era?

To love short or long description, nor in the more powerful marriage with a sample in a data center.

Yep! Random generators and Google Translate are against copyrights:

Rights helping take your life.

How about this one for your door mat?

Welcome to here.

Letter of complaint?

Not just your products but you need a no mourning.

Ah, yeah, my GTD-aspirations in a nutshell:

Sometimes you make your list, but more than dwell.

Is this about relations?

Want this torture to make your life but no more singles in itself.

Above the entrance to your local university?

More members of the street unless you just read here.

Is this what AI will bring us?:

You bowel is a download box.

Beware of the Intel Core teens?

Read more here by the Intel Core teens, as at the price of the month. Your wish is for none. Read more in pain. Click for more. Wishes to you for they do not want that by the disease.

Be original!

More What’s New in your reply.

Give me a raise – I need a new car!

This is my base vehicles, need some price Employment.

Um, intermarriage?

We here in the free right of intermarriage.

Yeah, I hear this one when I’m tired or talking to someone that pretends to know what they’re talking about…:

Administrator ligula viverra viverra this some more.

Why write tons of books about requirements specification when all you need is:

System Requirements silence, the author of a comment.

But well, who pays your bills?

Client Forms live element.

Pure silence:

More more more more more more pure silence is added whenever possible.

Shakespearian lust?

My hunger for my lion, nor life at your sauce and your region.

First you’re young and full of ideas, then you start working for the man…

Employment class you need in your life here, pure torture to your bow before the process and initiatives.

Something for the diet book?

Who the menu is more to love, but sometimes more change to hate.

Um… deep and poetic… I think…

Shoes, your wishes to be this way.

I hate it when that “no happier more” arrives!

This no happier more, is here.

A whiff of the good old days?

Marriage to accept and silently.

Aging sucks?

Dwell in old age, and the author of various torture.

Freedom!… to compare products…

As before by no more you make your home the trophy for freedom is just. Compare Products.

The School of Life goes online…

T​he shores of life pain Elementary School is now online.

Those pesky customers…:

Customer Care Center for just more hatred.

Abstain, or at least use protection!

Loves the bed, enabling a sample now, you know the author of your disease started with more initiatives.

Hmmm …

By way of our, Blockquote: disease free.

The suffering poet:

Paragraphs break my pain.

 

 

How do you log to the Windows event log from C# .NET?

This seems to do the trick if you want to log to the Windows event log:

private void logError(string message, string source)
{
	System.Diagnostics.EventLog log = new System.Diagnostics.EventLog();
	log.Source = source;
	log.WriteEntry(message, System.Diagnostics.EventLogEntryType.Error);
	log.Close();
}

private void logError(Exception exception, string source)
{
	logError(exception.ToString(), source);
}

Put it in your class, or in a special logging class.

Read more:

Internt/Egna SharePoint – Miniprojekt Utveckling/Design Lookup fält programmagiskt… / ContentTypes

Happy 09-09-09 09:09

Summer is nearing its end, autumn leafs are everywhere, yellow, red and brown… unless you’re in australia… eh or by the equator?

Regardless, this is kind of a hoax since I’m writing this in March.  But still, I’ve discovered the timed post, and so, this hour being very special I’ve decided to take advantage of that.

So happy ninth of the ninth of the ninth of….  well you get the gist of it…

Is Java pass-by-value or pass-by-reference?

The question if Java passes parameters by value or by reference seems to be one of the things newcomers to the Java language stumble upon quite often.

In general the answer is simple: Java is always pass-by-value.

What does this mean?

Pass-by-value means that you get a copy of the passed in object to work with, as opposed to a reference to it.

Let’s exemplify.  Assume we have a method that manipulates a List object:

public void updateList(List list) {
    ..;
}

Now, assume we’d like to replace the passed-in list with another list we’ve created inside the method.  We might like to do something like:

public void updateList(List list) {
    List myList = new ArrayList();
    // add objects to myList
    list = myList; // replace list with my new list? *WRONG*
}

However, if we test this new method we’ll find list has not changed at all.

This is because list is a copy of the object we passed-in to the method, and not the passed-in object itself.  list has been passed-by-value!

So, are we unable to change variables that are passed-in to a method in Java?  Can we only change them by returning a new object?

No.

And this is where the confusion sets in, because while we’re unable to replace the passed-in object list with another object, we’re perfectly allowed to manipulate it’s member objects.

Basically this means if we want to replace a passed-in list with our own list we must do:

public void updateList(List list) {
    List myList = new ArrayList();
    // add objects to myList
    list.clear(); // empty passed-in list
    list.addAll(myList); // replace passed-in list with my new list!
}

Since we never try to replace list itself, the whole method works just fine and does what we expect.

Black pointer: Never lose track of your mouse pointer again

I’ve tried several ways to keep track of my mouse pointer.  It’s kind of hard from time to time.  Adding more than one monitor does not help at all!

Recently a colleague gave me the tip to make the mouse pointer black… and larger. I tried this and found that the mouse pointer was much easier to spot.  No surprise there, really.  After all, white on white tends to become a bit hard to keep track of, tiny silhouette outline or not.

I was told how to do this in Windows (Control Panel > Mouse > Pointer, but that’s another story).

In Gnome (I’m running Ubuntu 8.10) you do it in the System > Preferences > Appearance dialog (see below).  In my version of Window’s there’s no settings under Appearance > Mouse.

Appearance Preferences

Next you click the “Customize” button:

Customize Theme

In the new dialog select the “Pointer”-tab and select the color of pointer you want.  In order to resize it, see the “size slider” below the list of pointers (there seems to be three distinct sizes to choose from).

Click “Close” once you’re done, and voila, you have a new and much easier to spot mouse pointer!