belief: I can create a web game
20% external: (*70%) = 14%
50% amount of spare time available (*80%) = 40%
50% ability to work on it productively (*60%) = 30%
80% internal: (*100%) = 80%
100% ability to program the game (*100%) = 100%
final outcome: 94% belief
zondag 18 oktober 2009
simplified point of view
external:
0% - pure pessimism - person believes that the universe is their enemy and everything happens exactly opposed as to what they want
100% - pure optimism - person believes they are in charge of the universe and everything happens exactly the way they want
internal:
0% - person believes that he is capable of nothing and can't do anything right
100% - person believes that he is capable of doing right anything, anywhere, anytime
balance:
0% - person believes that external factors will decide the final outcome no matter what
100% - person believes that he can always overcome external factors with his actions
'external' consists of all external factors that influence the person's actions.
'internal' consists of all personal factors that influence the person's actions.
0% - pure pessimism - person believes that the universe is their enemy and everything happens exactly opposed as to what they want
100% - pure optimism - person believes they are in charge of the universe and everything happens exactly the way they want
internal:
0% - person believes that he is capable of nothing and can't do anything right
100% - person believes that he is capable of doing right anything, anywhere, anytime
balance:
0% - person believes that external factors will decide the final outcome no matter what
100% - person believes that he can always overcome external factors with his actions
'external' consists of all external factors that influence the person's actions.
'internal' consists of all personal factors that influence the person's actions.
woensdag 16 september 2009
PHP event listener C# way example
Beware as it is untested.
// The event object
class DelegateObject
{
public $InvocationString;
public __construct( $InvocationString )
{
$this->InvocationString = $InvocationString;
}
public Invoke( )
{
eval($this->InvocationString);
}
}
class EventObject extends DelegateObject
{
public $EventSource;
public $Listener;
public __construct( $EventSource, $Listener, $InvocationString )
{
$this->EventSource = $EventSource;
$this->Listener = $Listener;
$this->InvocationString = $InvocationString;
}
}
class EventDispatcher
{
public AddListener( $EventName, $Listener, $FunctionName )
{
$e = new EventObject( $this, $Listener, '$this->Listener->' . $FunctionName . '($this->EventSource)' );
$ListenerProperty = $EventName . '_Listeners';
$this->$ListenerProperty[] = $e;
}
public FireEvent( $EventName )
{
$ListenerProperty = $EventName . '_Listeners';
foreach($this->$ListenerProperty as $Listener)
{
$Listener->Invoke( );
}
}
}
// the Classes:
class SmokeAlarm extends EventDispatcher
{
public $Location;
public __construct( $Location )
{
$this->Location = $Location;
}
public Smoke( )
{
$this->FireEvent( "Smoke" );
}
}
class HouseAlarm
{
public Fire( $SmokeAlarm )
{
echo 'Fire ' . $SmokeAlarm->Location . '!';
}
}
$SmokeAlarm_2ndFloor = new SmokeAlarm( 'on the second floor' );
$SmokeAlarm_LivingRoom = new SmokeAlarm( 'in the living room' );
$HouseAlarm = new HouseAlarm( );
// Binding the listener
$SmokeAlarm_2ndFloor->AddListener( "Smoke", $HouseAlarm, "Fire" );
$SmokeAlarm_LivingRoom->AddListener( "Smoke", $HouseAlarm, "Fire" );
// test
$SmokeAlarm_2ndFloor->Smoke( );
$SmokeAlarm_LivingRoom->Smoke( );
// The event object
class DelegateObject
{
public $InvocationString;
public __construct( $InvocationString )
{
$this->InvocationString = $InvocationString;
}
public Invoke( )
{
eval($this->InvocationString);
}
}
class EventObject extends DelegateObject
{
public $EventSource;
public $Listener;
public __construct( $EventSource, $Listener, $InvocationString )
{
$this->EventSource = $EventSource;
$this->Listener = $Listener;
$this->InvocationString = $InvocationString;
}
}
class EventDispatcher
{
public AddListener( $EventName, $Listener, $FunctionName )
{
$e = new EventObject( $this, $Listener, '$this->Listener->' . $FunctionName . '($this->EventSource)' );
$ListenerProperty = $EventName . '_Listeners';
$this->$ListenerProperty[] = $e;
}
public FireEvent( $EventName )
{
$ListenerProperty = $EventName . '_Listeners';
foreach($this->$ListenerProperty as $Listener)
{
$Listener->Invoke( );
}
}
}
// the Classes:
class SmokeAlarm extends EventDispatcher
{
public $Location;
public __construct( $Location )
{
$this->Location = $Location;
}
public Smoke( )
{
$this->FireEvent( "Smoke" );
}
}
class HouseAlarm
{
public Fire( $SmokeAlarm )
{
echo 'Fire ' . $SmokeAlarm->Location . '!';
}
}
$SmokeAlarm_2ndFloor = new SmokeAlarm( 'on the second floor' );
$SmokeAlarm_LivingRoom = new SmokeAlarm( 'in the living room' );
$HouseAlarm = new HouseAlarm( );
// Binding the listener
$SmokeAlarm_2ndFloor->AddListener( "Smoke", $HouseAlarm, "Fire" );
$SmokeAlarm_LivingRoom->AddListener( "Smoke", $HouseAlarm, "Fire" );
// test
$SmokeAlarm_2ndFloor->Smoke( );
$SmokeAlarm_LivingRoom->Smoke( );
maandag 13 juli 2009
vrijdag 10 juli 2009
vrijdag 3 juli 2009
donderdag 2 juli 2009
maandag 29 juni 2009
donderdag 21 mei 2009
Super Interpreter
This is just a random idea I was having.
I am a big fan of programming language features such as reflection, inheritance and traits.
The reason for this is that it makes your code a lot more structured and easier to use.
However, usually, overusing these features also results in a huge drop in performance and memory usage spikes.
I assume this is because the processor has to continuously switch contexts, which requires a lot of memory and computing power (ie. the processor likes large stacks of code statements the most)
In order to solve this problem, there should be one program that has knowledge of this programming language features, and can also convert code to assembly.
Now what this program should do, is foresee which code is going to be executed.
Then it has to pick all the code from the functions, traits and whatever and build assembly code.
It should then merge several fragments of code into one long list (much like js-minify or css-minify) and execute it.
Anyone having thoughts about this? Feel free to reply.
I am a big fan of programming language features such as reflection, inheritance and traits.
The reason for this is that it makes your code a lot more structured and easier to use.
However, usually, overusing these features also results in a huge drop in performance and memory usage spikes.
I assume this is because the processor has to continuously switch contexts, which requires a lot of memory and computing power (ie. the processor likes large stacks of code statements the most)
In order to solve this problem, there should be one program that has knowledge of this programming language features, and can also convert code to assembly.
Now what this program should do, is foresee which code is going to be executed.
Then it has to pick all the code from the functions, traits and whatever and build assembly code.
It should then merge several fragments of code into one long list (much like js-minify or css-minify) and execute it.
Anyone having thoughts about this? Feel free to reply.
maandag 18 mei 2009
CSS stealing
If you have to deliver a proof-of-concept quick, it can come in handy to borrow CSS from other websites.
Just visit the sites with a layout similar to what you are looking for and use Firebug to inspect on the elements you want to copy.
Then just select all the css in the right part and copy it to your css file.
Then you can remove the obsolete styles and clean it up a little.
Save your file and tadaa! View your brand-new goodlooking website :)
Just visit the sites with a layout similar to what you are looking for and use Firebug to inspect on the elements you want to copy.
Then just select all the css in the right part and copy it to your css file.
Then you can remove the obsolete styles and clean it up a little.
Save your file and tadaa! View your brand-new goodlooking website :)
zondag 17 mei 2009
Creating a PHP Loading screen
Here is an example of how you can add a loading screen to your PHP page.
The main reason for doing this is when your PHP code will take a long time when executing. Things that will slow your code down enough to consider using a loading screen:
We will also be using the flush() command to post javascript that updates the loading screen.
We will be using the jquery library to enhance browser support.
Download the code as a zip-file
Click here to see a live example
Note that you can use the parts individually. So here is the source:
The main reason for doing this is when your PHP code will take a long time when executing. Things that will slow your code down enough to consider using a loading screen:
- Use of external websites (ie. you are posting user data to Youtube, Myspace, Google ea.)
- A server script that is executed (however you might want to use an AJAX loader when this happens)
We will also be using the flush() command to post javascript that updates the loading screen.
We will be using the jquery library to enhance browser support.
Download the code as a zip-file
Click here to see a live example
Note that you can use the parts individually. So here is the source:
loadingscreen.php
<?php
function LoadingScreen_create( )
{
require_once 'loadingscreen.html';
flush();
}
function LoadingScreen_setPercentage( $percent )
{
?><script type="text/javascript">
LoadingScreen_setPercentage( '<?=$percent?>' );
</script><?php
flush();
}
function LoadingScreen_hide( )
{
?><script type="text/javascript">
LoadingScreen_hide( );
</script><?php
}
?>
loadingscreen.html
<link type="text/css" rel="stylesheet" href="loadingscreen.css" />
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="loadingscreen.js"></script>
<div id="loading-screen">
<div class="title">
<h1>Loading...</h1>
</div>
<div class="percentage">
<p>0%</p>
</div>
</div>
loadingscreen.js
LoadingScreen_setPercentage = function( percent )
{
$( '#loading-screen' ).find( '.percentage' ).html( percent + '%' );
}
LoadingScreen_hide = function( )
{
$( '#loading-screen' ).fadeOut( 'slow' );
}
loadingscreen.css
#loading-screen
{
position:fixed;
left:0px;
top:0px;
background-color:white;
height:100%;
width:100%;
}
#loading-screen .title
{
font-family: "URW Chancery L", "Apple Chancery", "Monotype Corsiva", "Georgia", serif;
font-size: 44.8px;
text-align: center;
}
#loading-screen .percentage
{
font-family: "URW Chancery L", "Apple Chancery", "Monotype Corsiva", "Georgia", serif;
font-size: 44.8px;
text-align: center;
}
zaterdag 16 mei 2009
Use recruiters to find the best job
When you are looking for a new job, you basically want to find the best job.
I am guessing the two determining factors are:
Now lets assume I am still working at a company and I want to spend only some hours in the evening evaluating other positions.
I do not have time reviewing all the applications I can find, so I am forced to review and take interviews for only a small set of applications.
In this example I will be spending 2 hours an evening having going to job interviews for five days plus some time making appointments, which is spread over the day.
That means I can have exactly 5 interviews in one week.
From my past experience I can say that having five job interviews a week a period of longer then one week can be very exhausting. You don't want this to happen.
Therefore, we must choose those five interviews wisely.
If we choose them all by ourselves, we will have a lot of work to do, and will only be able to evaluate a small number of positions.
Now if we let others do this work for us, we will have some advantages:
But, using recruiters also has some disadvantages:
They are taking a part of your money
They need payment, and you and the company will pay for them. As a result, your income will be lower for that position. If you are also looking for jobs yourself you can always choose the best paying one in the end
They want exclusivity (is that a word in English?)
They permit you to look for other positions or use other recruiters. My advice is: don't do it. It expires many of the advantages mentioned earlier. You can even lie about it, because it is pretty much impossible for them to find out.
Conclusion
Actions:
http://www.vault.com/nr/newsmain.jsp?nr_page=3&ch_id=242&article_id=3154998&cat_id=1184
http://stackoverflow.com/questions/26088/should-i-use-a-recruiter
I am guessing the two determining factors are:
- How much you like the job in general
- Did you like the manager
- Was the office looking nice
- etc.
- Payment
- Salary
- Secondary (ie. car, phone, laptop, gym)
Now lets assume I am still working at a company and I want to spend only some hours in the evening evaluating other positions.
I do not have time reviewing all the applications I can find, so I am forced to review and take interviews for only a small set of applications.
In this example I will be spending 2 hours an evening having going to job interviews for five days plus some time making appointments, which is spread over the day.
That means I can have exactly 5 interviews in one week.
From my past experience I can say that having five job interviews a week a period of longer then one week can be very exhausting. You don't want this to happen.
Therefore, we must choose those five interviews wisely.
If we choose them all by ourselves, we will have a lot of work to do, and will only be able to evaluate a small number of positions.
Now if we let others do this work for us, we will have some advantages:
- We might get more information right away (ie. the recruiter already had an interview with the company)
- We will be able to evaluate a lot more positions in a much shorter time (the recruiter already has a list of positions)
- We might look a lot more professional (if the recruiter has done his or her job right, a lot of thing might already have been taken care of, like a good structured CV, secondary terms etc.)
- They can negotiate for us, and get the best possible offer.
- If we are also looking for positions ourselves, we will extend our "reviewing range" even more.
But, using recruiters also has some disadvantages:
They are taking a part of your money
They need payment, and you and the company will pay for them. As a result, your income will be lower for that position. If you are also looking for jobs yourself you can always choose the best paying one in the end
They want exclusivity (is that a word in English?)
They permit you to look for other positions or use other recruiters. My advice is: don't do it. It expires many of the advantages mentioned earlier. You can even lie about it, because it is pretty much impossible for them to find out.
Conclusion
Actions:
- Use recruiters for finding new office jobs.
- Also look for positions yourself.
- Choose a small number of positions for an interview.
- Your reviewing range will be much larger, which heightens the chance of finding a good position.
- The amount of preparation you will have to do will be minimal.
http://www.vault.com/nr/newsmain.jsp?nr_page=3&ch_id=242&article_id=3154998&cat_id=1184
http://stackoverflow.com/questions/26088/should-i-use-a-recruiter
List of online tools
I have seen many of those lists online, but they never came up with the sites that I like.
So here is my list:
simplegtd.com
A webservice that helps you in implementing GTD (Getting Things Done) in your life. A must see!
symbaloo.com
Your own personal desktop. You can add links to other sites, and give them an icon. You can also add RSS feeds or search engines.
joesgoals.com
Set your goals, and easily monitor them. You can add positive and negative goals, and you can add markers to them which are ordered by day.
zoho.com
Online office suite. Similar to what Google does, but much more advanced. There are document editors, PM tools, forms and more.
mindomo.com
Without a doubt the best mind-mapping tool out there. It can add urls, images, videos, share, publish and has many graphic options. It also has offline support.
grooveshark.com
Listen to an online MP3 player that can create playlists, shuffle and automatically add similar music to your playlist.
A very good source of music now that last.fm is not free anymore.
calendar.google.com
The best calendar out there. It has a great ease-of-use, supports meetings, addding locations, sharing calendars and more.
getsatisfaction.com
Allows customers to have easy contact with companies (for request, bugs, complaining, etc.).
evernote.com
An application that allows you to write notes.
wridea.com
Lets you store your ideas.
huddle.net
Your personal workspace online. Has file storage, document editor, agenda, meetings, chat.
imgspark.com
Create your own moodboard online. Drag-drop images into your moadboard.
pixlr.com
Image-editing tool. Look a lot like Adobe Photoshop.
Well, I have now just run out of thought. Maybe I will add some in the future. If anyone else has ideas, they are welcome, too :)
So here is my list:
simplegtd.com
A webservice that helps you in implementing GTD (Getting Things Done) in your life. A must see!
symbaloo.com
Your own personal desktop. You can add links to other sites, and give them an icon. You can also add RSS feeds or search engines.
joesgoals.com
Set your goals, and easily monitor them. You can add positive and negative goals, and you can add markers to them which are ordered by day.
zoho.com
Online office suite. Similar to what Google does, but much more advanced. There are document editors, PM tools, forms and more.
mindomo.com
Without a doubt the best mind-mapping tool out there. It can add urls, images, videos, share, publish and has many graphic options. It also has offline support.
grooveshark.com
Listen to an online MP3 player that can create playlists, shuffle and automatically add similar music to your playlist.
A very good source of music now that last.fm is not free anymore.
calendar.google.com
The best calendar out there. It has a great ease-of-use, supports meetings, addding locations, sharing calendars and more.
getsatisfaction.com
Allows customers to have easy contact with companies (for request, bugs, complaining, etc.).
evernote.com
An application that allows you to write notes.
wridea.com
Lets you store your ideas.
huddle.net
Your personal workspace online. Has file storage, document editor, agenda, meetings, chat.
imgspark.com
Create your own moodboard online. Drag-drop images into your moadboard.
pixlr.com
Image-editing tool. Look a lot like Adobe Photoshop.
Well, I have now just run out of thought. Maybe I will add some in the future. If anyone else has ideas, they are welcome, too :)
Labels:
list,
online tools,
sites,
useful sites,
webservice
Abonneren op:
Posts (Atom)