Uncategorized

Self Made Jokes

Every once in a while I think of jokes which I find funny, but always forget to write down, so they get lost. As part of my rants, it is appropriate to write down these jokes as well.

June 03, 2009
You know why churches had so many murals or paintings of naked people in Medieval Times? Cause the church owned the porn industry.

April 05, 2009
Have you heard the saying "Keep your friends close and your enemies closer"? That's why I sleep with deadly snakes.

Mar 25, 2009
You can tell someone is in a relationship when he/she uses "we" when it's you who has to do the work.

Jan 02, 2009
Q: Why are C-level execs not subjected to drug tests?
A: Because there was more turnover at the top than at the bottom.

My Wise Sayings

Here are things that I sometime think about but never write down. So, I'm starting to write them down.

  1. Question your question before speaking.
  2. Good artists do not look foolish when they wear strange things, bad artists do.
  3. People who are obsessed with their outer appearance and perception are either empty inside or really messed up.
  4. Religion is like a sword. The big question is who is handling it and who will it kill or defend next.
  5. As days go by and family members die, most emigrants feel like a boat whose ties to the land are being severed one at a time. Drifting is very unsettling.
  6. Most Norwegians are very reserved people. Getting to know one is like waiting for an iceberg to melt.

UIKit and delegates

roland's picture

It turns out that a delegate is just an object that others can talk to. The following is an extract from the documentation in apple's site as they define what the UIApplication is.

The application object is typically assigned a delegate, an object that the application informs of significant runtime events—for example, application launch, low-memory warnings, and application termination—giving it an opportunity to respond appropriately.

Bouncing Ball using Flash and ActionScript 3.0

roland's picture
I am learning ActionScript and I have been wanting to simulate a bouncing ball scenario, but this wasn't that easy. I had to define first the container, ball, direction, reflection and more. Anyway. The code ended up being a little more than I thought originally, but it is very easy to increase the number of balls or define custom containers. Preview: Download: Bouncing Balls Source Code

Testing Firefox 3.1 Beta 2

roland's picture

Javascript speed is almost doubled. Pretty cool!
It actually scored 93/100 on acid3.acidtests.org vs. 71/100 on the 3.0 series. Awesome!

Many addons won't work in the beta version so be aware if you are a web developer. You might need to hold off for a while. Or just install flock for the time being so you can enjoy the fast browser.

Blogged with the Flock Browser

Why do women wear skirts?

roland's picture

Everyone seems to have some weird preconception as to why women wear skirts. These people below were featured in this news item http://news.yahoo.com/s/nm/20081115/tv_nm/us_obama_4 .

It bothers me that all the men are dressed up and the woman as got her legs out. WTF? How about guys start wearing these

Women wear skirts because they want to be fuckable all the times. But it doesn't make sense, because guys don't want to have sex with any girls that show off their stuff. Only the pretty ones!

How about low cut blouse:

What is wrong with women? Seriously. Just the sexual innuendos of wearing things like that are so clear. I mean, it screams, I am me and I have boobs.  I want you to care about me and not look at my boobs. It doesn't make sense.

When someone dresses like that, skirts and low cut shirts to show off their boobs, they shout out to the world, here I am ready to fuck, come by and talk to me. We can have sex right now if you are worth it. See, I am almost naked. No pants to take off just a skirt that doesn't need to come off. Come on people!

Now, I am not try to make womend dress differently but I am not stupid. Men aren't that stupid. Wear what you like but don't expect much respect in return or maybe getting stared at.

URL length by browser?

roland's picture

Have you wondered how many characters does your browser allow you to enter in the Address Bar ?

Well, I was interested so I messed around:

Opera 9.6:  65,531

Firefox: Unlimited but you will soon run out of RAM. Mine spiked two 700MB in just less than a minute duplicating the url length

Chrome: 12,140

IE7: 2,048

Safari: Unlimited - Truly. It gets slightly slow but it doesn't take loads of RAM like firefox

Doing some Cross App Authentication with php

roland's picture

You will need the HTTP_Request library.

<?php
require('HTTP/Request.php');
$url = "http://app.domain.com/login.php";
$req =& new HTTP_Request($url);
$req->sendRequest();
// Grab the html text
$html = $req->getResponseBody();
// Scrape the form
preg_match("/<form(.*)?<\/form>/ms", $html, $matches);
$form = $matches[0];
// Scrape all inputs
preg_match_all("/<input.*?\>/ms", $form, $matches);
?>

<form action="http://app.domain.com/app2/authenticate.php" method="post" id="frm1">
<?php foreach($matches[0] as $input) :?>
<?php print $input; ?><br/>
<?php endforeach; ?>
</form>

Finally add some javascript to populate the form fields and submit the form as you need.

There are several reasons why this might not work if you are doing XSS stuff.

1. A token maybe assigned to the session. Then you will need to grab the cookies and send them over to the user.

2. The cookie handling might not work because the Webserver might record the IP of the host and associate it with the cookie. Now this is not part of HTTP but it surely sounds very secure.

3. Javascript is used to alter the DOM tree. Then you need a rendering engine.

Syndicate content