Friday, December 09, 2011

Many worlds theory

I have recently become very obsessed with the many worlds theory. The theory that says there exists an infinite number of universes, which also means there exists an infinite number of versions of me which are all a little bit or a lot different. It started after re watching some episode of The Big Bang Theory where Sheldon mentions this theory. I started doing some research, wikipedia, YouTube videos and eventually found an episode of "The Universe" about this. So it turns out there's some scientists who are pretty serious about it. Actually there's theories about four different kinds of multiple universes, meaning infinite^4 universes.

I forgot if there was anything I wanted to say with this. Anyway I find it quite an interesting philosophical subject. That there might be some version of me that has done things a bit differently makes you really wonder what those differences could have affected. It also gives a kind of calm, knowing that if there's something I don't get done there will always be a version of me that does. So that thing still get's done in some universe somewhere. Maybe even in multiple other universes. Something that also hit me at one point, is that I really owe the other versions of me to not chicken out of doing something, because even if I'm not successful there will always be a version of me that is. Ofcouse the theory would suggest that even if I don't try some versions of me will.

I just saw "Another Earth" which deals with something like this, however it's a mirror version of earth that suddenly appears close to earth. And they ask at some point what would you do if you met the mirror version of yourself. And I thought what would I do if I met another version of me from a multiple universe. And I would ask him about how he is different from me and find out how those differences has changed his life, what he has learned from them that I haven't because I did something different. So as to learn from him, learn more about myself.

Sunday, September 11, 2011

4th Annual Golden Kopas

 Yada yada late than never.. Eligable movies are movies I saw in 2010 and that are form either 2009 or 2010.

Best Motion Picture - Drama

Winner
The Time Traveler's Wife

Nominees:
The Last Song
Flipped
Harry Potter and the Deathly Hallows: Part 1
Ondine


Best Motion Picture - Comedy

Winner
Toy Story 3

Nominees:
The Invention of Lying
Alice in Wonderland
All About Steve
Easy A


Best Performance by an Actor in a Motion Picture - Drama

Winner
Daniel Radcliffe (Harry Potter) for Harry Potter and the Deathly Hallows: Part 1

Nominees:
Denzel Washington (Eli) for The Book Of Eli
William Jøhnk Nielsen (Christian) for Hævnen
Callan McAuliffe (Bryce Loski) for Flipped
Rupert Grint (Ron Weasley) for Harry Potter and the Deathly Hallows: Part 1


Best Performance by an Actress in a Motion Picture - Drama

Winner
Rachel McAdams (Clare Abshire) for The Time Traveler's Wife

Nominees:
Miley Cyrus (Ronnie Miller) for The Last Song
Emilie de Ravin (Ally Craig) for Remember Me
Madeline Carroll (Juli Baker) for Flipped
Emma Watson (Hermione Granger) for Harry Potter and the Deathly Hallows: Part 1


Best Performance by an Actor in a Motion Picture - Comedy

Winner
Heath Ledger (Tony) for The Imaginarium of Doctor Parnassus

Nominees:
Matthew Goode (Declan) for Leap Year
Bradley Cooper (Steve) for All About Steve
Michael Cera (Nick Twisp / Francois Dillinger) for Youth In Revolt
Penn Badgley (Woodchuck Todd) for Easy A


Best Performance by an Actress in a Motion Picture - Comedy

Winner
Emma Stone (Olive) for Easy A

Nominees:
Jennifer Garner (Anna McDoogles) for The Invention of Lying
Amy Adams (Anna Brady) for Leap Year
Mia Wasikowska (Alice Kingsley) for Alice In Wonderland
Sandra Bullock (Mary Horowitz) for All About Steve


Best Performance by an Actor in a Supporting Role in a Motion Picture

Winner
John Mahoney (Chet Duncan) for Flipped

Nominees:
Johnny Depp (Mad Hatter) for Alice In Wonderland
T.J. Miller (Stainer) for She's Out Of My League
John Krasinski (Harley) for It's Complicated
Clifton Collins Jr. (Romeo) for The Boondock Sants II: All Saints Day


Best Performance by an Actress in a Supporting Role in a Motion Picture

Winner
Bonnie Wright (Ginny Weasley) for Harry Potter and the Deathly Hallows: Part 1

Nominees:
Brooklynn Proulx (Clare at Six and Eight) for The Time Travler's Wife
Rachel McAdams (Irene Adler) for Sherlock Holmes
Anne Hathaway (White Queen) for Alice In Wonderland
Jennifer Beals (Claudia) for The Book Of Eli


Best Screenplay or Previously Released Material - Motion Picture

Winner
Audrey Niffenegger (novel) for The Time Traveler's Wife

Nominees:
Nicholas Sparks (screenplay) for The Last Song
John Lasseter and Andrew Stanton & Lee Unkrich (story) for Toy Story 3
Wendelin Van Draanen (novel) for Flipped
J.K. Rowling (novel) for Harry Potter and the Deathly Hallows: Part 1

Saturday, April 16, 2011

Best of 2010

Movie

The Time Travelers Wife

Toy Story 3
Harry Potter and the Deathly Hallows: Part 1
Easy A
The Last Song



TV Show

Lost

Greek
How I Met Your Mother
Fringe
The Pacific


Song

Katy Perry - Firework

Taylor Swift - Enchanted
Yohanna – Beautiful Silence
Sharon Corr – So Long Ago
Lena – Satellite


Music

Taylor Swift

Sharon Corr
Katy Perry
Jennifer Paige
Yohanna


Hottie

Ashley Tisdale

Eve Muirhead


Website

MDPC Family

SCC
Elma Online
Twitter

Monday, February 28, 2011

Groceries

A look at the groceries I bought today.

Sunday, February 20, 2011

Kopa teaches PHP: URL routing done simple

URL routing is to have an url called something like "kopasite.net/records/pack/TKT/" instead of "kopasite.net?records.php?pack=TKT", using somewhat same principle as the $_GET variables to include pages. It can be done pretty complicated, but in the end it's just a matter of dividing the url into a number of variables that you use to include pages ect.

To do URL routing modrewrite needs to be turned on in your PHP installation.

First off you need to add some stuff to your .htaccess file.
RewriteEngine on
RewriteRule ^ajax - [L]
RewriteRule !\.(js|ico|txt|gif|jpg|png|css)$ index.php
 First line turns the rewriting on. Second line makes an exception that the folder ajax will not be used for rewriting. I'm doing that as I have an actual folder called ajax with php files in it, that I otherwise will not be able to call with ajax functions as it would redirect them to index.php. Third lines redirects any files except the file types mentioned to your index.php file. So that means whatever link you make on your site it will redirect to index.php.

When it does that you can in your index.php file make an include that will include another .php according to the url.

So in your index.php or some route.php that is included in index.php you make the following code:
$already_there = str_replace('index.php', '', $_SERVER['SCRIPT_NAME']);
$slightly = str_replace($_SERVER['SCRIPT_NAME'], "", $_SERVER['REQUEST_URI']);
$uri = str_replace($already_there, '', $slightly);
This part does some manipulation with the url and gives a string with anything after your domain name, the part that will decide which page to include.

if($uri != ""){
    $pieces = array_filter(explode("/", $uri));
    if(count($pieces) == 3){
        $s = $pieces[0];
        $p = $pieces[1];
        $t = $pieces[2];
    }elseif(count($pieces) == 2){
        $s = $pieces[0];
        $p = $pieces[1];
    }elseif(count($pieces) == 1){
        $s = $pieces[0];
    }
}
This parts sets up to three variables that you can use to include pages or do other stuff with, like you'd use $_GET values. First line checks if the string is empty, if it is we don't set any variables ofcourse. Second line divides the url into an array, dividing by /'s, as well as removes any empty values from the array, which can happen if the url ends with an /. You can also use any other symbol like a dot or whatever if you like. You could stop now and use the variables $pieces[0] ect. in your scripts. I don't want to have them in an array so I do some more. The next if else part makes sure we don't set any values if we have nothing to put into them. It simples makes the variables $s for section, $p for page and $t for tab in that order if they exists, which I in turn use to include other pages.

For example on index.php I have this code:
$sections = array("records", "news", "info", "contest", "download", "community", "tools");
      if(in_array($s, $sections)){
              include "$s.php";
      }
First line is the different sections I have on my site, which I use to make sure it doesn't include a page that doesn't exist. Next it checks if $s exists in this array I made and then include a php file with that name.

And that's it.

There is just one more thing to remember. When you are on the url "kopasite.net/records/pack/TKT/" for example it will still think you're inside a folder. So if you have any pictures or css files ect. you need to set an absolute link to these. Like:
<img src="/images/logo.png">
Instead of:
<img src="images/logo.png"> 

Friday, February 18, 2011

The wonder that is jQuery

After someone asking wether I had any plans for use some jQuery stuff on EOL site, I got curious and checked it out. This resulting in me using it for some features on NAVOK I've had planed for a long time. Some rather simple showing and hiding of something, but with jQuery it was quite a lot simpler than it usually would be. I can only recommend it for your future javascript and ajax needs. I have not yet tried it out for ajax but it seems as straight forward.