As far as my experience with the iPod and Iphone goes, I have been inspired to put up a list of my favorite apps on the Apple store, basically for the Iphone and Ipod touch models.

Let’s start with the best paid apps practically suited for my needs as a computer programmer particularly on web development.

1. Touch Term Pro

This is the best Ipod Touch/Iphone App when you talked about SSH client. The interface is really good and it allows you to customize alot of stuff. One prominent feature of this app is the ability to store ssh accounts, so you don’t need to enter username and password over and over again everytime you connect to an SSH server. Also, one important feature is the ability of this app to detect hand gestures. For example you can increase the font size of the console by doing the tap and swipe gesture or you can activate the additional keyboard keys such as the function keys by tapping 3 times on the left edge of the screen. What you can do normally with your desktop ssh client can be mostly done on this cool Ipod Touch/Iphone App. Be warned though that this may cost a bit higher compared to other similar iPhone apps. This costs around 8USD to 9USD as of this writing. So, for those geeks out there who want to access remote boxes even they’re not home, this app is worth checking.

2. Ftpdisc

This is by far the best iPhone/Ipod touch for transferring files between your computer to your iPod/iPhone. You must have a client FTP on your desktop or laptop such as WinSCP in order for you to upload and download files to or from your Ipod/Iphone.

3. Documents

This is somehow an efficient mobile document editor. This Ipod touch/Iphone app is best for creating or editing documents such as text files and excel files. This is worth a try.

4. FTP on the Go

This is a sophisticated iPhone/iPod version of a full-blown FTP client. Take note, a “full-blown” FTP client. There are lots of features that you can check with this app. This costs around 7USD as of this writing, kinda expensive though.

To be continued..

pixelstats trackingpixel

Recently, a friend of mine tried using the Google Adwords interface on my Ipod touch 3G 8gig. He was on the verge of deciding whether he’d buy an Ipod Touch for his own use, particularly for his Adwords campaign. It was a revealing moment and we were excited as the Google Adwords dashboard was starting to render, and everything was still fine. Unfortunately, when he tried to view a particular campaign, suddenly, the Safari browser of the Ipod touch crashed. We were curious about what happened and we even tried to fire up Safari browser again and visited the Google Adwords site, yet, it seemed Safari couldn’t cope with the over-bloated Google Adwords page. We came into conclusion that this could be a bug in the Ipod Touch’s version of Safari. It could be some memory-leaks or merely due to system requirements of the Google Adwords interface. Well, I guess, time can tell or Apple can tell what could be the possible reason.

pixelstats trackingpixel

Recently, I was installing memcached on a CentOS server and found out that I could not use the command phpize, for a quick solution, here’s how to do it,

yum install php-devel
Yum is simply the best. ;-)

pixelstats trackingpixel

Recently, I was installing memcache libraries and the memcache extension for PHP on one of our Linux boxes. Unfortunately when I tried to run a sample code just to test if everything was successful with the installation, I got an error instead which say Memcache not found. I digged for a couple of days looking for solutions to my problem and Googling it didn’t even help me at all.

Without losing my patience, I tried reading the error logs of httpd(usually in /var/log/httpd/error_log) and somewhere it showed this message,

PHP Warning:  PHP Startup: Unable to load dynamic library ‘./memcache.so’ – ./memcache.so: cannot open shared object file: No such file or directory in Unknown on line 0

After that, I tried to check the php.ini (usually in /usr/local/lib/php.ini) and made sure that the extension=memcache.so was there, and on the extension_dir property, it looked like this,

extension_dir=”./”

seeing that, I tried a lucky guess and I changed it to a full path instead,

extension_dir = “/usr/local/lib/”

Next, I simply restarted httpd with,

service httpd restart

Then I again checked the httpd error_log and I noticed that the error is gone! With that information, I immediately tried the test PHP code again and Voila! My memcache extension is running perfectly!

Hope this helps.

JM Aliling

pixelstats trackingpixel

Reader Question: You write about making money online, but I’ve never seen you post any actual figures. Just how much do you make from your blog?

Answer: not a lot, actually. There, I said it. Admitted live, for the whole world to read.

This may strike you as a strange admission, given as this blog is partly positioned as a “make money from blogging” blog, but I hardly make any money from blogging, at all. To be honest, my first ever AdSense cheque only just got mailed out a month ago. Text Link Ads bring in about $70 a month. So I’m not exactly living off the fat of the Internet Land.

Now, before you unsubscribe because I’m not the “expert” you thought I was, let me do some explaining. The Get Rich Project is about making money online, personal finance, and working towards financial independence. The personal finance bit has taken a back seat recently because I simply have nothing worthwhile to add at the moment.

So that leaves making money and working towards financial independence. Kinda the same thing, if you look at it one way.

Most of the online work I do is experimental. It’s trying out ideas. Some of these work, some don’t. It’s entrepreneurism., I’m looking to build a real business, not rely on advertising dollars. So I’m not making much just now. I don’t care. I’d rather make something worthwhile than have some short-lived “get rich quick” scheme.

The reader who asked the question above threatened to “out” me as a fraud if I didn’t tell all. Guess what chump, I seem to have outed myself. Oh dear, what ever shall I do? Keep on keepin’ on, that’s what.

You can still unsubscribe, if you like. I’ll be sad to see you go, but I think you’d be making a mistake. Would you rather learn with someone, or be preached at by Yet Another Guru (YAG)?

Sponsor: Create Money-Earning websites with Article Underground

ShareThis

pixelstats trackingpixel

Before I return to some regularly scheduled programming, I want to take a moment to post a link to something important to me.

2 years ago, I suffered a brain hemorrhage. The specialist Neurology department saved my life. Now the Scottish Government is considering closing the department and “centralizing” services to a new center 150 miles away. On my personal blog I have written an Open Letter to the Minister with the final say on the matter. My hope is to raise public awareness and support against the plans for closure. Please take a moment to read the letter and Digg, Stumble or link it.

At the very least, you’ll get to see a wicked picture of the bad-ass scar I have on the side of my head :-)

Thanks.

ShareThis

pixelstats trackingpixel

These were done using Turbo C for DOS. I’ve missed those good ol days!

These were the times where  CPU cycles of a function really mattered.

The lesser the cycle, the faster the execution of codes.

Plasma Effect 1

Plasma Effect 1

I like the second one better,

Plasma Effect 2

Plasma Effect 2

How about this?

Fire Demo

Fire Demo

Fire demo has been my greatest demo I have created.

My Starfield Simulation

My Starfield Simulation

I was inspired by Windows 95 Screensaver back then, it’s the  Starfield Simulation, so

I did something similar like above. But the direction of the stars can be

manipulated with the keyboard, and it’s really like you’re traveling through the

outer space if you try to turn off the lights.

The following couple of shots were made when we were having Geometry subject back then.

Once again, this was due to boredom.

Sine Effect

Sine Effect

Nice eh?

Sine Effect 2

Sine Effect 2

This next screenshot was the most creepiest of my creations.

I had a book before named, the Magic Machine, and Benoît Mandelbrot was featured and

his famous “mandelbrot set” was explained in detailed and the steps on how you can express it

in a programming language were clearly discussed. This was the by-product of that sleepless night of reading and code-crunching..

Mandelbrot Set

Mandelbrot Set

If you want a copy of the source codes of these stuff, kindly contact me and I will give them freely.

Enjoy!

-Joemarie Aliling

pixelstats trackingpixel

Here’s a code to scrape for links/url of a webpage using PHP cURL, PHP DOMDocument and PHP DOMXPath.

<?php

$target = “http://joemarie-aliling.com/category/php-programming/”;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_AUTOREFERER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, “Firefox (WindowsXP) – Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.6)  Gecko/20070725 Firefox/2.0.0.6″);           //pretend that we are a browser..
$page = curl_exec($ch);
$dom = new DOMDocument();
@$dom->loadHTML($page);       //@ suppresses any errors..
$xpath = new DOMXPath($dom);
$hrefs = $xpath->evaluate(“/html/body//a”);        // evaluate everything inside the html and body tags and extract the anchor tag. Read this
for ($i = 0; $i < $hrefs->length; $i++) {
$href = $hrefs->item($i);
$url = $href->getAttribute(‘href’);
if($url[0] == “/” || $url[0] == “#”) $url = $target . $url;  // this is to correct relative URLs and page anchors. try to remove this line and        see the effect.
echo $url . “<br>”;
}

?>

There you have it! Hope this helps with your screen scraping projects.

-JM

pixelstats trackingpixel

Hi everyone,

Let me share this wonderful PHP snippet to you. Its function is to take the base domain of a given url. For example,

say,

$url =  http://www.joemarie-aliling.com/php-programming-tutorial.php

the return value is a string =   joemarie-aliling.com

Also this works even if the URL has a subdomain, like http://subdomain.joemarie-aliling.com/php-coding-tips.php

I’ve tested this on PHP 5.2.5, but I believe, it would work with older versions of PHP.

This is a GNU Licensed, so you may use it freely.
function get_base_domain($url){
$debug = 0;
$base_domain = ”;

// generic tlds (source: http://en.wikipedia.org/wiki/Generic_top-level_domain)
$G_TLD = array(
‘biz’,'com’,'edu’,'gov’,'info’,'int’,'mil’,'name’,'net’,'org’,
‘aero’,'asia’,'cat’,'coop’,'jobs’,'mobi’,'museum’,'pro’,'tel’,'travel’,
‘arpa’,'root’,
‘berlin’,'bzh’,'cym’,'gal’,'geo’,'kid’,'kids’,'lat’,'mail’,'nyc’,'post’,’sco’,'web’,'xxx’,
‘nato’,
‘example’,'invalid’,'localhost’,'test’,
‘bitnet’,'csnet’,'ip’,'local’,'onion’,'uucp’,
‘co’ // note: not technically, but used in things like co.uk
);

// country tlds (source: http://en.wikipedia.org/wiki/Country_code_top-level_domain)
$C_TLD = array(
// active
‘ac’,'ad’,'ae’,'af’,'ag’,'ai’,'al’,'am’,'an’,'ao’,'aq’,'ar’,'as’,'at’,'au’,'aw’,'ax’,'az’,
‘ba’,'bb’,'bd’,'be’,'bf’,'bg’,'bh’,'bi’,'bj’,'bm’,'bn’,'bo’,'br’,'bs’,'bt’,'bw’,'by’,'bz’,
‘ca’,'cc’,'cd’,'cf’,'cg’,'ch’,'ci’,'ck’,'cl’,'cm’,'cn’,'co’,'cr’,'cu’,'cv’,'cx’,'cy’,'cz’,
‘de’,'dj’,'dk’,'dm’,'do’,'dz’,'ec’,'ee’,'eg’,'er’,'es’,'et’,'eu’,'fi’,'fj’,'fk’,'fm’,'fo’,
‘fr’,'ga’,'gd’,'ge’,'gf’,'gg’,'gh’,'gi’,'gl’,'gm’,'gn’,'gp’,'gq’,'gr’,'gs’,'gt’,'gu’,'gw’,
‘gy’,'hk’,'hm’,'hn’,'hr’,'ht’,'hu’,'id’,'ie’,'il’,'im’,'in’,'io’,'iq’,'ir’,'is’,'it’,'je’,
‘jm’,'jo’,'jp’,'ke’,'kg’,'kh’,'ki’,'km’,'kn’,'kr’,'kw’,'ky’,'kz’,'la’,'lb’,'lc’,'li’,'lk’,
‘lr’,'ls’,'lt’,'lu’,'lv’,'ly’,'ma’,'mc’,'md’,'mg’,'mh’,'mk’,'ml’,'mm’,'mn’,'mo’,'mp’,'mq’,
‘mr’,'ms’,'mt’,'mu’,'mv’,'mw’,'mx’,'my’,'mz’,'na’,'nc’,'ne’,'nf’,'ng’,'ni’,'nl’,'no’,'np’,
‘nr’,'nu’,'nz’,'om’,'pa’,'pe’,'pf’,'pg’,'ph’,'pk’,'pl’,'pn’,'pr’,'ps’,'pt’,'pw’,'py’,'qa’,
‘re’,'ro’,'ru’,'rw’,’sa’,’sb’,’sc’,’sd’,’se’,’sg’,’sh’,’si’,’sk’,’sl’,’sm’,’sn’,’sr’,’st’,
’sv’,’sy’,’sz’,'tc’,'td’,'tf’,'tg’,'th’,'tj’,'tk’,'tl’,'tm’,'tn’,'to’,'tr’,'tt’,'tv’,'tw’,
‘tz’,'ua’,'ug’,'uk’,'us’,'uy’,'uz’,'va’,'vc’,'ve’,'vg’,'vi’,'vn’,'vu’,'wf’,'ws’,'ye’,'yu’,
‘za’,'zm’,'zw’,
// inactive
‘eh’,'kp’,'me’,'rs’,'um’,'bv’,'gb’,'pm’,’sj’,’so’,'yt’,’su’,'tp’,'bu’,'cs’,'dd’,'zr’
);

// get domain
if ( !$full_domain = get_url_domain($url) )
{
return $base_domain;
}

// now the fun

// break up domain, reverse
$DOMAIN = explode(‘.’, $full_domain);
if ( $debug ) print_r($DOMAIN);
$DOMAIN = array_reverse($DOMAIN);
if ( $debug ) print_r($DOMAIN);

// first check for ip address
if ( count($DOMAIN) == 4 && is_numeric($DOMAIN[0]) && is_numeric($DOMAIN[3]) )
{
return $full_domain;
}

// if only 2 domain parts, that must be our domain
if ( count($DOMAIN) <= 2 ) return $full_domain;

if ( in_array($DOMAIN[0], $C_TLD) && in_array($DOMAIN[1], $G_TLD) && $DOMAIN[2] != ‘www’ )
{
$full_domain = $DOMAIN[2] . ‘.’ . $DOMAIN[1] . ‘.’ . $DOMAIN[0];
}
else
{
$full_domain = $DOMAIN[1] . ‘.’ . $DOMAIN[0];;
}

// did we succeed?
return $full_domain;
}

// get domain from url

function get_url_domain($url)
{
$domain = ”;

$_URL = parse_url($url);

// sanity check
if ( empty($_URL) || empty($_URL['host']) )
{
$domain = ”;
}
else
{
$domain = $_URL['host'];
}

return $domain;
}

Sorry for not indenting this and it looks ugly. But I guarantee you it works!

-Joemarie

pixelstats trackingpixel

Welcome to my Blog! Like any other computer programming textbooks out there, the first program is always a Hello World program and in fact most programmers from all walks of life went through that very very simple program. So for this part, let me welcome you all to this yet another world of computer programming. This blog will be updated with techniques and tips I have gathered since I was still doing Pascal programming when I was still a kid back in the 90s. Now the technology has evolved so fast that we could barely  perfect a subset of a particular trend. The only way to gain momentum in the midst of ever-changing computer world  is to not stop ourselves from learning. I hope this site would somehow contribute to the development of anyone pursuing his/her career with this vigorous field of science.

This blog is dedicated to the most prettiest girl in the world, Beverly, my special someone who supported me through good and bad times. Also I would like to mention the one who molded me to become what I am now in this era of bits and bytes, to Mr. P, the Mad Scientist, thanks for everything, you’re just pure genius!

-Joemarie Aliling

pixelstats trackingpixel