PHP and Python Function Arguments

Categories: blog



While doing some work, I tried to find about function arguments in PHP. I still prefer python ways of doing things

PYTHON:
  1. def test(tmp1, tmp2)
  2.   print tmp1
  3.   print tmp2
  4.  
  5. test(tmp2='woot2', tmp1='woot1')
  6.  
  7. >>woot1
  8. >>woot2

 

Thats a nice feature that I wished PHP had.  So that I dont have to remember the order of arguments and just type in the "key" and its "values". Its kinda natural that way.

(While I was trying to find a nice syntax highlighting plugins for WP, I tried iG:Syntax Hiliter, works like a charm.)

The best way I can do for php is...

PHP:
  1. textfield(array('name' => 'username', 'size' => 30));
  2.  
  3. // tried using the python way..
  4. test($tmp2='woot2', $tmp1='woot1');
  5.  
  6. woot2
  7. woot1

func_get_args() just doesnt cut it.

I traveled this path when I wanted to differentiate between list and associative array. Which leads me to a drupal issues page. Differentiate between associative and numeric php arrays.

*Apparently there's some issues regarding html formatting of symbols > (greater than) which bothers me. It doesnt bother me enough to fix it at this moment. Ah.. priorities.. priorities.


I experimented a little. This is the best that I can do for the moment..

Continue reading PHP and Python Function Arguments...

Marvel Ultimate Alliance.. a nice change of view

Categories: blog

I've played X-Men 2 Legends.. it was mediocre. Camera angle, graphics.. not as impressive as Marvel Ultimate Alliance. Yeah.. this game is the kind of game I needed after the let down of Ghost Rider's movie. Yes.. the fight scenes in ghost rider was poor I left eh cinema with disappointment.

I've played the hell out of Deadpool and Ghost Rider in Marvel Ultimate Alliance, deadpool with his jumping teleport, blazing guns and katanas (or maybe its just a sword). Yeah. The anti-hero personality was a real nice change. The cutscenes was nice too.

Other than playing MUA, some small tasks which proves to be quite bothersome... although it needs to be done to survive this month. Uh.. back to work.

Run Forest! Run!

Categories: blog
Allak Swivel Chair

Yes, a new comfy chair. I've always wanted a comfy chair. Previous chair is killing me, back hurts like hell.

 

Other than that, I decided to go for a jog and got chased by a dog in the middle of it. Still.. a refreshing activity. 

 

I'm going into Drupal 5. New stuff and quite nice interface. 2 of my project will be using it. 

By the power vested in me, HTML to Wiki.. CONVERT!

Categories: blog

As usual, I crawl through the web looking for noteworthy news.. or something like that.

Reddit's programming section caught my interest nowadays. There's much more stuffs going on there from which I found an article on the register, an interview with Stefan Esser (php security expert). And so.. I need to keep this information rather than saving it in html form and make a mess of my folders and files (cant keep-up, too many) I put it on my wiki.

Since wiki requires all this syntax to display it correctly, I chose the print option on the interview page, copy all of it, paste it into a WYSIWYG web editor (formats such as bold etc will be automatically converted to html tags), copy the source and paste it into my wiki. The result was horrible, no surprise there.

I googled HTML WIKI CONVERT, and found list of HTML to Wiki Converter. I used the Seapine lab's HTML to Wiki Converter, works perfect. Now, I just have to set it up on my server.. well I use my wiki a lot.

Programmers Dont Like to Code?

Categories: blog

I havent had the chance to read Brook's book (Mythical Man-Month). I'll try to get it this month. 

As usual, my google hompeage (http://google.com/ig) lists O'Reilly Network Articles and Weblogs. There's some nice short posts which caught my attention which leads me to rentzsch.com: Programmers Dont Like to Code.

I guess I'm just not good at expressing myself. There are some issues that have been bothering which I dont really understand it myself. Sometime I though it was just procrastination at work.. some other time.. that wasnt the case. Argh.. what the hell am I talking about.

So.. Rentzsch's note / post, holds some truth in it.. well.. maybe lots of it, that problem solving is the driving motivation of doing programming, well at least for me. Even if it wont be used by lots of people.. I'd still do it just for the fun of solving it, if I'm being paid for it, thats a bonus.

Right now, I'm reading up on patterns. Searching.. collecting.. understand it and use it where its applicable. :D

Any findings will end up on my wiki.

GimpStyle Theme design by Horacio Bella.