Archive

Archive for the ‘Programming’ Category

Debugging a segfault in PHP

April 1st, 2010 Lloyd Leung No comments

debugging segfaults is not fun.

My low key technique:

  1. place a printf(“made it here: %s, %s+ %s\n”, __METHOD__, __LINE__, __FILE__); everywhere…
  2. put “DIE(‘something’);” to figure out the exact line that fails.  If dies, good.  move it further down.  If it segfaults, move the die statement up.  Until you’ve found the exact line that fails.
  3. Figure out why it’s segfaulting…  uh… good luck with that.  Google, and look at the changelog in PHP to see if it’s been fixed.

An easier option, if I were the one controlling the box — Update to the latest PHP.

Categories: Programming Tags:

little project ideas

March 1st, 2010 Lloyd Leung No comments

Just found a need to access my home server… however, it’s powered down… how can I overcome this problem in the future.  To answer my own question…  I should go lookup how to send a wake-on-lan command to the box. As well as know what my IP is…

project ideas:

1.) Current IP notifier – send to my webserver, what my home server IP is. (Dynamic). I could use a dynamic dns service… this maybe interesting to learn how to do this, if I have my own VPS… have the home-server, notify the web-server to update the DNS setting. So I would have something like: homelan.lloydleung.com or whatever.

2.) wake on lan commands.
3.) vpn to the network instead… with a combo on 1. This way, everything is encrypted…

My current extension list for firefox 3.0.1

September 17th, 2008 Lloyd Leung No comments
Categories: Programming, Technology Tags:

ajax form submits problem

May 8th, 2007 Lloyd Leung No comments

yesterday was a few hours of frustration.

Make sure your your <form> tag is within the same <td> cell element.  Otherwise it’s not XML compliant.

You can have the form outside the <table> — but not between it, and a <td> element.

Categories: Programming Tags:

Gallery is fixed.

January 23rd, 2007 Lloyd Leung No comments

My old gallery is fixed now…

debating on writing a new gallery, or make a plugin for wordpress to have a gallery.

How the plugin would work…
1.) Create a keyword, to enable the gallery.
2.) grab uploaded files, that are images via mime type, and display them.
3.) display the images via lightbox2, or something else that’d be suitable.
4.) Get titles, and descriptions for files

Pretty handy utility, not much else needed. All the hard parts are already handled by WP.

Categories: Programming Tags:

Ubuntu + Mysql setup

January 4th, 2007 Lloyd Leung No comments

Wow, that was so painless.

Original Post

Use your favourite means to install mysql, probably apache, php, phpmysqladmin as well…


sudo /etc/init.d/mysql start
mysqladmin -u root password myPassword

where myPassword is your actual password.

to test
mysql -u root -p

enjoy

Categories: Linux, Programming, Technology Tags:

PEAR::DB_DataObject_FormBuilder howto

February 18th, 2006 Lloyd Leung No comments

Wow, I refactored my calendar web app and used PEAR::DB_DataObject_FormBuilder to make the backend.

One thing I have to admit, the documentation for certain PEAR applications lacks dearly. Just like all OSS packages. It’s just the nature of things.

The personal support I recieved from irc://efnet.org/pear was great. After a little guidance, the members in that chat channel were able to help me out. After my refactoring, I decided to write a basic howto. Read more…

Categories: Programming, Technology Tags:

Blowfish

February 1st, 2006 Lloyd Leung No comments

Do that whole login password setup. Encrypt everything text… I’ll try and figure out a way to encrypt pictures as well, but there’s really no point in doing that either. Images will be product images… I just don’t want the data will be useful at all. The page will be all managled anyways.

blowfish… the saviour. Read more…

Categories: Programming, Technology Tags:

flash dynamic preloader

September 18th, 2005 Lloyd Leung 2 comments

Flash has a nice tendency to not load stuff properly. This is because I’m so used to linear processing, as opposed to parallel taskes to be done at the same time.

With this in mind, flash causes start/finish issues. Flash will try to use an object that hasn’t been completely loaded yet. So checks all these checks have to be put in place.

The alternative to checks, is to preload that objects. Which, if you know nothing about actionscript is a little daughting.

I’m in the middle of writing a modular preloader for dynamic content in actionscript 2. At least the dynamic content’s size can be calculated.

This really shouldn’t be that hard, except the fact that I don’t know the scruture of actionscript. Perhaps this will be the new thing I’m going to learn…

Categories: Programming Tags:

New pet project, simple group schedular

August 9th, 2005 Lloyd Leung No comments

- Allow user to login/register.

- Select what days they are free to do this project.

- Colate Dates which are good.
- Different shades from Red to Green, where the more green something is, more people can show.

User: ID / Login / Password / email / IM contact

Event: ID / Description /Map / Date Start / Date Finish / Notes (Unique rows)

Event_User: Event.ID / User.ID (Unique rows)

Attendence: User.ID / Attending_bool / Note

Populate Calender:
Given: Event.ID
Select * from attendence, Event_User where Event.ID = $EventID

Categories: Programming, Technology Tags: