Archive for April, 2009

never never give up

Tuesday, April 28th, 2009 by dreamluverz




Since last sabbath I’ve been hearing this famous line “never give up, never give up never never never” 0f Winston Churchill from the pastor’s sermon. And again from the author of my morning devotional today he also quoted it. What a coincidence in time of crisis. Does it trying to tell me something? I’m actually in the verge of giving up but hearing it  twice for the past days…makes me think a million times about the decision I’m gonna make… Oh help me God!

regex: backreferences

Monday, April 27th, 2009 by dreamluverz

Backreferences

Perhaps the most powerful element of the regular expression syntax, backreferences allow you to load the results of a matched pattern into a buffer and then reuse it later in the expression.





In a previous example, we used two separate regular expressions to put something before and after a filename in a list of files. I mentioned at that point that it wasn’t entirely necessary that we use two lines. This is because backreferences allow us to get it down to one line. Here’s how:

s/\(blurfle[0-9]+\)/fraggelate \1 >>fraggled_files/

The key elements in this example are the parentheses and the “\1″. Earlier we noted that parentheses can be used to limit the scope of a match. They can also be used to save a particular pattern into a temporary buffer. In this example, everything in the “search” half of the sed routine (the “blurfle” part) is saved into a buffer. In the “replace” half we recall the contents of that buffer back into the string by referring to its buffer number. In this case, buffer “\1″. So, this sed routine will do precisely what the earlier one did: find all the instances of blurfle followed by a number between zero and nine and replace it with “fragellate blurfle[some number] >>fraggled files”.

Backreferences allow for something that very few ordinary search engines can manage; namely, strings of data that change slightly from instance to instance. Page numbering schemes provide a perfect example of this. Suppose we had a document that numbered each page with the notation <page n=”[some number]” id n=”[some chapter name]“>. The number and the chapter name change from page to page, but the rest of the string stays the same. We can easily write a regular expression that matches on this string, but what if we wanted to match on it and then replace everything but the number and the chapter name?

s/<page n="\([0-9]+\)" id="\([A-Za-z]+\)">/Page \1, Chapter \2/

Buffer number one (“\1″) holds the first matched sequence, ([0-9]+); buffer number two (“\2″) holds the second, ([A-Za-z]+).

Tools vary in the number of backreference they can hold. The more common tools (like sed and grep) hold nine, but Python can hold up to ninety-nine. Perl is limited only by the amount of physical memory (which, for all practical purposes, means you can have as many as you want). Perl also lets you assign the buffer number to an ordinary scalar variable ($1, $2, etc.) so you can use it later on in the code block.

More details here: http://etext.virginia.edu/services/helpsheets/unix/regex.html

pdflib

Monday, April 27th, 2009 by dreamluverz
Package Information
Summary Creating PDF on the fly with the PDFlib library
Maintainers Rainer Schaaf <rjs@pdflib.com> (lead) [details]
Uwe Steinmann <uwe@steinmann.cx> (lead) [details]
License PHP
Description This extension wraps the PDFlib programming library
for processing PDF on the fly, created by Thomas Merz.

PDFlib is available for commercial licensing and under the PDFlib Lite License
(see http://www.pdflib.com/fileadmin/pdflib/pdf/license/PDFlib-Lite-license.pdf)

More info on how to use PDFlib with PHP can be found at

http://www.pdflib.com/developer-center/technical-documentation/php-howto

Homepage www.pdflib.com

YOu can get the pdflib here http://pecl.php.net/package/pdflib

pecl extensions for windows

Monday, April 27th, 2009 by dreamluverz

Downloading PECL extensions

There are several options for downloading PECL extensions, such as:

  • » http://pecl.php.net/ The PECL web site contains information about the different extensions that are offered by the PHP Development Team. The information available here includes: ChangeLog, release notes, requirements and other similar details.
  • pecl download extname PECL extensions that have releases listed on the PECL web site are available for download and installation using the » pecl command. Specific revisions may also be specified.
  • CVS Most PECL extensions also reside in CVS. A web-based view may be seen at » http://cvs.php.net/pecl/. To download straight from CVS, the following sequence of commands may be used. Note that phpfi is the password for user cvsread:
    $ cvs -d:pserver:cvsread@cvs.php.net:/repository login
    $ cvs -d:pserver:cvsread@cvs.php.net:/repository co pecl/extname
  • Windows downloads Windows users may find compiled PECL binaries by downloading the Collection of PECL modules from the » PHP Downloads page, or by retrieving a » PECL Snapshot or an extension DLL on » PECL4WIN. To compile PHP under Windows, read the appropriate chapter.

YOu can get the pdflib here http://pecl.php.net/package/pdflibsource: http://pecl.php.net/package/pdflib

God of the impossible

Friday, April 24th, 2009 by dreamluverz

I’m actually about to sleep now but because i’m troubled with thoughts in my head, I decided to open my devotional book and read the next page of my readings.

I wanted to write it now while the thought is still fresh. I’ve had experienced before where I just wrote it the next day and the feeling/thought is not already the same as I’ve felt on that moment.

So going back to my readings, when I opened the book the title of the page is God of the IMPOSSIBLE, of (In times like these) devotional. I was wondering if this is a sign of things that’s bothering in my head and telling me not to quit and and not to give up. Just keep on hanging on and everything will be ok.

I had these things I’ve been praying for eversince and actually one of it was mentioned on that page, …when we’re praying for someone… and also I wanted to mark this moment so that when the time comes that my prayers have been answered, it would remind me how and what I’ve been through. I’m not saying it’s impossible because I believe it’s POSSIBLE ofcourse with God’s help but just be patient.

I cannot enumerate all of them here but God knows what are those…the most crucial are {comp++, snob, dawn, bro+}

Ok, time to sleep now and I’ll just wait for God’s answer.