PHP | Lecture 1 | Introduction to PHP

Posted on: July 17th, 2012 by 1 Comment

  • What is PHP?
  • Why should we use it?
  • What websites use it?

PHP – PHP Hypertext Preprocessor

What is PHP?

PHP is a server-side scripting language.

Why should we use it?

PHP is used to create dynamic content on a website.

What websites use it?

Facebook, for example, combines PHP with a database system, usually using MySQL.

Documentation:

php.net/manual

Stanford University | Programming Methodology | Lecture 2

Posted on: July 17th, 2012 by 3 Comments

Stanford University
Programming Methodoloy
CS 106A – Lecture 2
Mehran Sahami

cs106a.stanford.edu
cs198.stanford.edu/section

Eclipse

Karel the Robot

4 Commands (methods):

  1. move – Move 1 spot forward in the direction currently facing.
  2. turnLeft – Changes direction in 90 degrees counter-clockwise.
  3. pickBeeper – Pick up and store beeper if beeper exists on current space.
  4. putBeeper – Put down a beeper if beeper does not exist on current space.

We’re invoking/calling a method on Karel.

Algorithm – recipe for doing something.

Program – something valid syntactically.

  1. move();
  2. turnLeft();
  3. pickBeeper();
  4. putBeeper();

<code>import stanford.karel.*;

public class OurKarelProgram extends Karel {

public void run() {

(code)

}

private void turnRight() {

turnLeft(); turnLeft(); turnLeft();

}

}</code>

Karel is implemented in Java.

Karel is defined in a class.

<code>public class OurKarelProgram extends superKarel {</code>

Philosophical Question:
Q: What is the downfall of the modern College student?
A: Snooze!

For loop:

<code>for ( int i=0;  i<n; i++) {

(body of for loop gets executed n times)

}</code>

While loop:

<code>while ( condition ) {

(body of while loop)

}</code>

Conditions that Karel can test:

  • frontIsClear() / frontIsBlocked()
  • leftIsClear() / leftIsBlocked()
  • rightIsClear() / rightIsBlocked()
  • beepersPresent() / noBeepersPresent()
  • beepersInBag() / noBeepersInBag()
  • facingNorth() /notFacingNorth()
  • facingEast() / notFacingEast()
  • facingSouth() / notFacingSouth()
  • facingWest() / notFacingWest()

If statement:

<code>if ( condition ) {

(body of if statement runs once if condition is true)

} else {

(body of else statement runs once if condition is false)

}</code>

boilerplate

Programming is about:
Programming is not just about writing a program that the computer understands.
Programming is about writing a program that people understand.

 

Stanford University | Programming Methodology | Lecture 1

Posted on: July 17th, 2012 by 4 Comments

Stanford University
Programming Methodoloy
CS 106A – Lecture 1
Mehran Sahami

cs106a.stanford.edu
cs198.stanford.edu/section

Eclipse

Karel the Robot

Our economy vs barter system economics

Posted on: July 16th, 2012 by 1 Comment

There was a time when a man could offer a reduction in a single monthly payment of rent in exchange for services performed. There was a time when a man could send his kid $1,000 without reporting it to the government. There was a time when value flowed freely in open trade, untaxed but for the gates they’d locked down. Today, they’ve locked down every gate we’ve come to suffer in taxation. Every recordable movement of value, most especially monetary, is taxed as easily as a software program is written. This amongst many other things is one of the most stifling doomfalls of our economy and governmental policies that overshadow business and entrepreneurship.

Barter system entrepreneurship

An entrepreneur in the days of trade skills and barter, could conjure of some natural resource an entity of greater value through his craftsmanship. That object could be exchanged for goods of any sort, not excluded to or excluding precious metals which most closely mirror our monetary system today as it’s passed through printed items on materials of negligible value. There were seldom taxes save for border crossings, most developedly along the silk road, and as it should be to some degree to provide services such as roads and safety in travel. And there is of course a long-standing history of tax on property, even in the form of goods produced in the time of serfdom and tithes.

[link]E barter systems[/link]

Today, we use an arsenal of tools which keep us at the cutting edge of government and law, laying way to new worlds as the leeches catch up. We trade via proxies and torrents and blogs and misquoting and outright plagiarism, and not only has it become common-place but no one is still as much as batting an eye at it. Open source, free world, sharing is caring and here to stay.

New entrepreneurs with timeless values

The new angles, new approaches, improvements to any part of a system, the product or service, in quality or value, creates opportunity for value gained to be filtered into your life, most notably through payment for services, income or commissions. New value comes not only in the form of content but in the apparatus for its delivery, as the interface of Anachroblog.com will soon shape to be.

It’s the mind of a wandering man

Posted on: July 16th, 2012 by No Comments

It’s the mind of a wandering man that understands the space between the lines.
From your side you’ll never see the forest through the trees,
until your down, dirty, crawling on your knees toward a vision,
of some or many worthy worlds beyond division.

How much of me can I give

How much of me can I give you here?
Could in legal text, stories stripped of dripping blood,
my flesh to hang for your tears like a flood,
And how much sense do I need to buy your love?