Mathematics

Je kent het wel je heb weer eens zo spannende les op school met als onderwerp wiskunde en niet zo maar wiskunde maar specifiek over 3D algoritmes. Neem je basis wiskunde en maak het 2 keer moeilijker. En dan heb je ook nog een docent waarbij Nederlands zijn 2 de taal is wat het niet makkelijker maakt. Het is in ieder geval beter dan een docent die wiskunde gestudeerd heeft en in zijn les alles behandeld wat niet te maken heeft met wiskunde.

Maar acht life must go on en blijf hopen dat ik het ooit ga snappen!

The description of a engineer

When considering the behavior of a howitzer: A mathematician will be able to calculate where the shell will land. A physicist will be able to explain how the shell gets there. An engineer will stand there and try to catch it.
Engineers Explained People who work in the fields of science and technology are not like other people. This can be frustrating to the nontechnical people who have to deal with them. The secret to coping with technology-oriented people is to understand their motivations. This chapter will teach you everything you need to know. I learned their customs and mannerisms by observing them, much the way Jane Goodall learned about the great apes, but without the hassle of grooming.
Engineering is so trendy these days that everybody wants to be one. The word “engineer” is greatly overused. If there’s somebody in your life who you think is trying to pass as an engineer, give him this test to discern the truth.
ENGINEER IDENTIFICATION TEST;
You walk into a room and notice that a picture is hanging crooked.
You…
A. Straighten it.
B. Ignore it.
C. Buy a CAD system and spend the next six months designing a solar-powered, self-adjusting picture frame while often stating aloud your belief that the inventor of the nail was a total moron.
Read more »

AutoLoader PHP Classes

Normaal als je een Php-class gaat inladen moet je hem eerst inladen via een “include” en daarna oproepen als een class in je php code. Hieronder zie je hoe het in zijn werk gaat.

<?php
include(‘classes/classname.class.php’);

$class = new classname();
?>

Stel je voor dat je 10 php classes allemaal moet inladen op deze manier!
Je zal er snel achterkomen dat het veel tijd en code regels kost. Er is namelijk ook een veel makkelijkere manier om dit voor elkaar te krijgen. Dit is mogelijk door de “__autoload” functie die is ingebouwd in php 5. Deze functie wordt automatische uitgevoerd waneer er bijv. een class wordt ingeladen.

Hieronder zie je het complete script om classes in te laden met een __autoload.

<?php
function __autoload($clname){
include(“libs/”.$clname.”.class.php”);
}

$class = new classname();

?>

Hiermee wordt een class automatische ingeladen. In de autoload functie hebben wij de naam van de class in een variabel gezet en hiermee kunnen we dan het bestand vinden dat ingeladen moet worden.
Het is dus belangrijk dat je de naam van de file het zelfde is als die je in je code gebruikt.

Neem dit voorbeeld en ga er vooral mee spelen pas bijvoorbeeld de include path aan of zet er eens een var_dump in zodat je ziet dat de class is ingeladen.

“var_dump is het zelfde als een echo of een print alleen krijg je erbij wat voor soort variable het is”

Blijf deze website in de gaten houden snel zullen er nog meer tutorials en tips & tricks verschijnen.