Log in

No account? Create an account

commie coder's journal


page example Sep. 3rd, 2004 @ 08:18 pm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    $limit = 5;                
    $pageValue = 5;
    $modulo = 3;
    $totalrows = $limit * $pageValue + $modulo;            
    if (empty($_GET['page'])) {
        $page = 1;
        $start = 1;
        $end = $limit;    
    } else {
        $page = $_GET['page'];
        $start = ($page - 1) * $limit;
        $end = ($page * $limit) -1;
    for ($i = 1; $i <= $totalrows; $i++) {
        $fakeResultArray[] = $i;
    echo "<table border=1 cellpadding=2 cellspacing=0>";
    echo "<tr>\n<td>\n";       
    echo "<b>Fake Result Array Table</b>\n";
    echo "</td>\n</tr>\n";
    echo "$start $end";     
    for ($i = $start; $i <= $end; $i++) {
        if ($bgcolor == "#E0E0E0"){
            $bgcolor = "#FFFFFF";
            $bgcolor = "#E0E0E0";
        echo "<tr bgcolor=$bgcolor>\n<td>\n";
        echo "<b>value = " . $fakeResultArray[$i] . "</b>\n";
        echo "</td>\n</tr>\n";
    echo "</table>\n";

    if ($page != 1) {
        $pageprev = $page - 1;
        echo("<a href=\"script.php?page=$pageprev\">PREV".$limit."</a>&nbsp;");

    $numofpages = $totalrows / $limit;
    for($i = 1; $i <= $numofpages; $i++){
        if($i == $page){
            echo("<a href=\"script.php?page=$i\">$i</a>&nbsp;");

    if(($totalrows - ($limit * $page)) > 0){
        $pagenext = $page+1;
        echo("<a href=\"script.php?page=$pagenext\">NEXT".$limit."</a>");

Robatsch defense: Pseudo-Austrian attack Apr. 8th, 2004 @ 08:14 pm
at least that's was spat out by the ICC's automatic game record saver thingy, but i think it is best described as:

this was a game i really enjoyed, played black, 0 minutes +7 seconds a move on the clock:

1. e4 g6
2. d4 Bg7
3. Nc3 d6
4. f4 Nf6
5. Nf3 Bg4
6. Bd3 O-O
7. O-O Nbd7
8.Be3 c5
9. dxc5 Nxc5
10. Kh1 Nxd3
11. cxd3 a6
12. Qd2 Rc8
13. Rae1 Bd7
14. d4 Bc6
15. e5 dxe5
16. fxe5 Ne4
17. Nxe4 Bxe4
18. Ng5 Bc6
19. b3 h6
20. Nh3 Kh7
21. Rd1 e6
22. Nf2 Qh4
23. h3 Rcd8
24. Qc3 Rc8
25. Qb2 Bb5
26. Rfe1 Bc6
27. Kh2 f5
28. g3 Qe7
29. Nd3 Be4
30. Nc5 Bd5
31. Rc1 f4
32. Bxf4 g5
33. Qb1+ Kh8
34. Be3 Rf3
35. Rf1 Rcf8
36. Rxf3 Rxf3
37. Rf1 Rxe3
38. Qg6 Re2+
{White resigns}

2nd job update Mar. 22nd, 2004 @ 10:43 am
just got offered 40hrs a week making coffee and waffles at the airport - meeting the manager for a trial tomorrow. will probably take the job for a while at least.

should make my income ~$600 a week - debt retirement and second computer here we come!

but i'll have to make a serious effort to a) maintain my coding momentum and b) keep the waffle-generated pudge enhancement to a minimum.

i like my chances of doing a) more than b), particularly if i get to take home old stock...

JASP Mar. 18th, 2004 @ 09:50 am
or Justin's Acronym Soup Post

decided to use the lj to chart some of my learning. not goin to do computer science at uni this year - am only able to get 6 months of austudy, then i'd have to study part time. and finish the degree in 2010. not gonna do it that way!

i'm enjoying coding way too much to consider not making it what i do for a living, so i'm considering my options.

one option is to get some money this year so i can do the degree 3 years fulltime off my own bat if i still want to do it by this time next year. so i've got some leads on a second job - should have one by this time next week.

the if comes from not knowing how well i'll go at learning more this year. there's every chance that i wont need to go to uni to become a good enough programmer/sysadmin/web developer to be employable. have learnt a lot at a rapid rate largely on my own over the last 12 months. but i now know people (thru sydney linux user groupand sydney php user group) who can help me move from knowing enough to be dangerous to knowing enough to be a real, employable geek.

this is one of the things that makes the open source community so great. nasty individuals aside, collaboration is *built in*. will have to post more about the oss community later - the more i learn the more i want to learn. it's a fascinating beast. can't think of an encapsulating metaphor or analogy yet - partly because i'm a newbie, partly because i don't think its possible to do its dynamics justice in a few sentences.

anyway, back to JASP. i've decided to try and use lj like i used wall mirrors in a gym to work on my basketball skills. i don't want this to just be a reflection of what i'm learning, but something i can use to aide in the quality of what i'm learning. practice makes perfect is *bullshit*. perfect practice makes perfect.

don't know how often, but summaries, acronyms, landmarks, acronyms, goals and acronyms will start appearing here. to kick off:

XUL: XML User Interface Language (XUL)
a markup language for describing user interfaces. With XUL you can create rich, sophisticated cross-platform web applications easily. one of my sydney php user group friends is working with this and gave me a rundown the other night/early morning via icq. its cool, and i've started making myself familiar with the basics of it.

class based rewrite of www.socialist-alliance.org:
have started rewriting www.socialist-alliance.org using php classes. classes are cool! so much more planning is needed, but so much more code re-use, and the code is so much more intuitive and therefore easily maintainable.

tonights best game Mar. 10th, 2004 @ 12:48 am
this time as white:
more fun than last nights...
1. c4 e5
2. d3 Nf6
3. Nf3 Bc5
4. Nc3 d6
5. a3 Ng4
6. e3 Nc6
7. Be2 f5
8. O-O O-O
9. b4 Bb6
10. Nd5 Ne7
11. Nxb6 axb6
12. Bb2 Ng6
13. Qb3 Kh8
14. e4 f4
15. d4 Nh4
16. dxe5 dxe5
17. Nxh4 Qxh4
18. Bxg4 Bxg4
19. f3 Be6
20. Qc3 Rae8
21. Qxe5 Qh6
22. Qxc7 Qg6
23. Qxb6 Rf7
24. Rad1 h5
25. Rd8 Rxd8
26. Qxd8+ Kh7
27. Qh4 Bxc4
28. Rc1 Be2
29. Rc5 Bxf3
30. Qh3 Bxe4
31. Rxh5+
{Black resigns} 1-0
Other entries
» zzzzzzzz (now i hope)
time to go to bed. had a fun chess game playing black at chessclub.com:
1. d4 d5
2. c4 dxc4
3. a4 Nf6
4. Nc3 g6
5. e4 Nc6
6. Bxc4 Bg7
7. Nf3 O-O
8. O-O Bg4
9. Be2 Bxf3
10. Bxf3 Nxd4
11. Be3 Nxf3+
12. Qxf3 c6
13. Rac1 Qa5
14. Bg5 h6
15. Bxf6 Bxf6
16. b3 Rad8
17. Rfe1 Bg5
18. Rcd1 Bd2
19. Qh3 Bxe1
20. Rxe1 Kg7
21. e5 e6
22. Ne4 Qxe1#
{White checkmated} 0-1

» can't sleep
so i made my first php class:

class form {
    var $form_name, $action, $method, $value, $submit_name;
    function open_form($method, $action, $form_name) {
        $this->form_name = $form_name;
        $this->action = $action;
        $this->method = $method;
        echo "<form method=\"$method\" name=\"branches\" action=\"$action\">\n";
    function close_form($submit_name, $value) {
        $this->submit_name = $submit_name;
        $this->value = $value;
        echo "<p><input type=\"submit\" name=\"$name\" value=\"$value\">\n</form>\n";

i've stuck my toe in the object-oriented water and i like it. time to dive in and hope this is the deep end...
» hello livejournal

hello, is there anybody* out there...

that's the primary idea motivating me to use livejournal.

so hello. i might drop by some time. i hope you'll do the same.

* interested in basketball, chess, chocolate, coding, coffee, communism, linux, mysql, open source, perl, php, programming, socialism - not necessarily in that order.

Top of Page Powered by LiveJournal.com