• Subscribe to the RSS feed! RSS icon
  • Subscribe by Email
  • home
  • blog
  • dev
  • Recent Posts

    • Automatically upload screenshots in XFCE4
    • Zend Framework full page cache tips
    • No more Wordpress
    • Xdebug is full of awesome
    • Creating a chat bot with PHP and Dbus
    • A year in review: 2011
    • Notes on shell scripting
    • Listening to Dbus signals with PHP
    • Configuring 2 monitors with xrandr
    • A quick note on Dojo's data grids and dojox.data.HtmlStore
  • Recent Comments

    • Robert on Zend Framework full page cache tips
    • Stephen S. Musoke on Zend Framework full page cache tips
    • David on Zend Framework full page cache tips
    • Anon on A quick note on Dojo's data grids and dojox.data.HtmlStore
    • James on Communicating with Pidgin from PHP via D-Bus
    • Robert on A Zend Framework 2 EventManager use case
    • Jowee on A Zend Framework 2 EventManager use case
    • Jurian Sluiman on A Zend Framework 2 EventManager use case
    • Jurian Sluiman on A Zend Framework 2 EventManager use case
    • djozsef on Webkonf 2011 recap
  • Tags

    php, about, random, framework, zend, example, ubuntu, blog, site, zend framework, book, conference, me, python, wordpress, apache, introduction, lamp, linux, open source, review, script, setup, signals, ape, community, contributing, dbus, dojo, events, hack, mysql, netbeans, pidgin, plugin, pyqt, security, shell, svn, talk
  • Categories

    • Blablabla
    • Development
    • Free time
    • Places on the web
    • Programming
    • Software
    • Uncategorized
  • Archives

    • February, 2012
    • January, 2012
    • December, 2011
    • November, 2011
    • October, 2011
    • September, 2011
    • August, 2011
    • July, 2011
    • May, 2011
    • April, 2011
    • March, 2011
    • January, 2011
    • December, 2010
    • November, 2010
    • October, 2010
    • July, 2010
    • June, 2010
    • April, 2010
    • February, 2010
    • January, 2010
    • December, 2009
    • November, 2009
    • October, 2009
    • August, 2009
    • May, 2009
    • March, 2009
    • February, 2009
    • January, 2009
    • December, 2008
    • November, 2008
    • October, 2008
    • September, 2008

Archives for September, 2008

Smush your images!

by Robert Basic on September 30th, 2008

I just found a nice web site where you can “smush” your images — Smushit.com. SmushIt takes an image and removes all unnecessary information about it: when was it last edited, what image editor was used etc., but keeps the quality of the image! This is more than useful for sites where there are lots of images.

The result of smushing

The result of smushing

There are several ways to provide images to SmushIt:

  • Upload an image
  • Provide an URL to the image
  • Use the Firefox SmushIt add-on

The first two ways are quite obvious; provide an image and it'll process it in a few seconds.

The Firefox add-on is pretty cool: open up a web page where are the images you want to smush, click the SmushIt add-on icon (it'll be in the right corner of the status bar), it will take you to their site and process all the images found on your web page.

When the processing is complete, there will be a table showing details about the smushing. Also a download link will be provided, to download the smushed images in one zip file.

Now run little lurker and smush your images :)

Tags: image, optimize, site, web.
Categories: Development, Places on the web.
Comments: 4 comments.

Creative License

by Robert Basic on September 25th, 2008

A few days ago, I wrote about Freelance Freedom, a design related comic by N.C. Winters. Now, he's here with another comic, called Creative License, which will also be a weekly comic. Since the first number came out on Wednesday, I think all the following numbers will come out on that day. I hope it's gonna be good as Freelance Freedom :)
Enjoy it, I'm sure I will!

Tags: comic.
Categories: Blablabla, Free time.
Comments: None.

Facebook registration, part 2

by Robert Basic on September 23rd, 2008

A few days ago I wrote about a problem with registering an account on Facebook. This morning, I've got the reply:

Hi Robert,
Welcome to Facebook. We have confirmed your account, and you should be able to access it now. Sorry for the delay!
Login:
New Password:
Please note that Facebook passwords are case sensitive (FACEbook is not the same as facebook). If you're having trouble with this login/password combination, I suggest copying and pasting the login and password into the appropriate fields.
Once logged in, you can change your password from the "Settings" tab of the Account page. Let me know if you have any further questions.
Thanks for contacting Facebook,
Sadie
User Operations
Facebook

Not a word on what was causing the system to reject my registration. At least, I've got one “sorry”.

Well, I have my Facebook account now, so if you'll excuse me, I'm off to find some long lost friends :)

Tags: facebook, registration.
Categories: Blablabla, Free time.
Comments: None.

Regular expressions with PHP

by Robert Basic on September 22nd, 2008

I just want to write some real examples. These regexps are (and always will be, 'cause I plan to write several posts on this topic) for the PHP's PCRE library. Here's a good PHP PCRE cheat sheet, it's an excellent resource for regexps. If you know nothing about regexps, first read this Wiki page.

Regexps for <a> tags

A common case is when you have a source of some web page and you want to parse out all the links from it.
An anchor tag goes something like this:

<a href="http://example.com/" title="Some website">Website</a>

Also it can have more attributes, like class, target etc. Knowing how it's built up, we can start writing a pattern, depending on what we want.
Here are some examples, some explanations are in the comments:

<?php
// Regexp examples for <a> tags

/**
* Different combinations...
* $matches_comb[0] contains the whole <a> tag
* $matches_comb[1] contains what's inside the "href" attribute
* $matches_comb[2] contains what's after <a> and before </a>
* with the "s" modifier mathces <a> tags that are broken in several lines,
* ie. matches <a> tags with newlines
* without the "s" modifier, matches only <a> tags without a newline
*/
preg_match_all(
    '#<a\s.*href=["\'](.*)["\'].*>(.*)</a>#isxU',
    $string,
    $matches_comb
);

/**
* Match only what's inside the href attributes...
*/
preg_match_all(
    '#<a\s.*href=["\'](.*)["\'].*>.*</a>#isxU',
    $string,
    $matches_href
);

/**
* Match only what's inside the href attirbutes,
* only when it starts with http:// and includes http://
* $mathces_href_http[0] contains some trash also, nevermind,
* $mathces_href_http[1] contains exactly what we need
*/
preg_match_all(
    '#<a\s.*href=["\'](http://.*)["\'].*>.*</a>#isxU',
    $string,
    $matches_href_http
);

/**
* Match all Email addresses - mailto:
*/
preg_match_all(
    '#"mailto:(.*)"#',
    $string,
    $matches_emails
);

?>

Play around with these patterns, see what's for what, experiment, that's the best way to learn regexps.
Do you have some more regexps for links? Some better ones than these here?
Happy hacking!

Tags: example, pcre, php, regex, regexp.
Categories: Development, Programming.
Comments: None.

Facebook registration

by Robert Basic on September 18th, 2008

I tried to register on Facebook. I filled up the register form, typed all the information, double-checked for errors... Clicked "Sign up", and they gave me a big read box saying:

Our automated system will not approve this name. If you believe this is an error, please contact us.

Wtf?! My name is wrong?! How could it be wrong?! I checked it again, refilled the form, and... same error again. OK, their system is messed up, I don't like those troubleshooting systems, those are never helpful, so I'll try again later. A few minutes after, I tried again. Same thing. Weird. Then I did a Google search on "Robert Basic Facebook" terms. First hit: a Facebook profile for Robert Basic. Yep, there's a person, with same name as mine, registered on Facebook. So, I used their troubleshoot system, which ended up writing them an E-mail:

Hi there!
I am Robert Basic, from Serbia, age 22.
Well, I'm having trouble registering on Facebook. There is already a guy registered on Facebook, we share the same name, so maybe that's the problem. Anyway, we are two separate persons, he lives in Germany, I live in Serbia. Is there a solution for this problem? Oh, and the error I got was:
"Our automated system will not approve this name. If you believe this is an error, please contact us."
So there. I've made contact. I come in peace.
Regards,
Robert

The E-mail is sent, now I'm waiting to see what will happen next.

Frankly, I don't give a damn about having a Facebook profile; well, not anymore. Now, I just want to know, how could this happen? They never thought about this scenario when two persons have same names? OK, maybe, I'm wrong and this error comes up because of something else, but for me, this is the only reasonable explanation.

Tags: error, facebook, registration.
Categories: Blablabla, Free time.
Comments: 4 comments.

Freelance freedom

by Robert Basic on September 16th, 2008

Freelance freedom is an awesome comic about freelancers and freelancing, published every Monday on Freelance Switch. The author is N.C. Winters. If you have the time, be sure to go through the archives, you won't regret it ;)

Do you know some other freelance design—developer related comic?

Enjoy :)

Tags: comic, freelance, freelancing.
Categories: Blablabla, Free time.
Comments: None.

about:license

by Robert Basic on September 13th, 2008

I don't know about you, but I'm not really good with all the legal mumbojumbo. All these licenses and agreements, they sound to me like they are not written to be read by human beings. Not to mention a bunch of terms that sound similar, but are not at all. As a person who makes and uses all kind of software, I feel like I should know more about licenses; what can and what can not be done under a specific license.

There are 2 major group of licenses: for proprietary and for open source software. Currently, I'm not interested in proprietary licenses, so, I won't write about them; you can read more on Wikipedia: Proprietary software.

On the other hand, I'm very interested in Open Source Licenses...

Some terms explained...

It is easy to mix terms like free software, open source software, freeware and such, so I'll try to explain them as I understood them. My main reference for this is Wikipedia.

  • Free software (FS) — “free” as in “free” speech, not as in free beer. FS must be free to run, copy, distribute, study, change and improve by users. With every distribution of a FS, it's source code must be provided also. FS can be charged. Read more detailed about the philosophy of FS.
  • Open source software (OSS) — the difference between FS and OSS is very little: if I got it right, besides the philosophy, the difference is that OSS can not be charged. Read more about OSS definition and about the differences here and here.
  • Freeware software (FWS) — in most cases FWS is a proprietary software made available free of charge, but the source code is not published.
  • Shareware software (SWS) — this kind of software in most cases is available on a trial period, or it's use is limited in some other way. To use the full software, without trial periods and limitations, users must buy the license for that SWS.

More about software categories can be found on the GNU Project page.

The reason we are here...

On the website of Open Source Initiative there is a list of (probably) all open source licenses out there. I won't get into all of them, just the most popular ones and ones that interest me.

GNU General Public License

Probably the most used one is the GNU General Public License, with it's latest version 3.0. The author of this license is Richard Stallman, the founder of the Free Software Foundation.

This license guarantees freedom for software authors and users; freedom to (re)distribute, modify, give and receive source code of the software and use parts of its code in other free software. If wished, free software can be charged, but must guarantee these freedoms to users of this software. Any redistributed or modified version of the original free software must stay under this license. If a free software is changed by another author, it must be marked as changed, so if any problem occurs with the changed version, the problems will not be attributed by mistake to authors of previous versions.

Software under the GNU GPL can be linked only to other software which is also licensed under the GNU GPL. Software that links to a software under the GNU GPL must also be under the GNU GPL.

If someone sees a violation of a GNU GPL, here's what he should do: Violations of the GNU Licenses.

GNU Lesser General Public License

GNU LGPL is a more permissive version of GNU GPL. It is mainly used for software libraries, but can also be applied to some stand-alone applications. A software under the GNU LGPL can be linked with software that is not under the GNU GPL or GNU LGPL; that software can be another free software or even a proprietary software.

Using GNU LGPL for libraries is discouraged.

The BSD License

The BSD License is a permissive license; conditions are that the original copyright notice, the list of conditions and the disclaimer must be included with every redistribution of the software. The software can be, with or without modifications, redistributed and used. It can be used in other free software or in a proprietary software. Another restriction is that the author of the software can not be used to promote modified versions of the original software, without his or hers written permission.

The MIT License

The MIT License is also a permissive license; it is very similar to the BSD License. Difference is that the author of the original software can be used for promotion without permission, if not stated otherwise in the license.

Other licenses

I found these 4 licenses to be the most interesting ones. Others are very similar, so I will not go into them — maybe in some future post.

I hope someone will find this little reading helpful. Any thoughts on this topic?

Btw, I recommend a good documentary movie, Revolution OS. It tells about the free software movement and the open source. Notable speakers are Linus Torvalds, Richard Stallman, Eric Raymond, Bruce Perens and others. Enjoy :)

Tags: free, free software, licence, open source, proprietary.
Categories: Development, Software.
Comments: 2 comments.

Look, Ma...

by Robert Basic on September 4th, 2008

... I have a Blog too! Well, it was damn time to get yourself one of those.

Actually, this is my third blog. The first lasted about a day or two. The second went alright for a time, but then the hosting company started to play around with settings, so the whole thing fell apart. This time, I'm serious. Kinda.

Until now I was foolin' around a lot. Tried this and that, experimenting. Heck, I even got a job. A real one. For real money. It lasted about 5 months, but then I quit, 'cause I still have some bloody exams @school, and I commuted every day to work, so it was pretty hard to concentrate on both. Now, I'm back to freelancing. Studying hard to get these exams off my back, and working on some projects; nothing big.

Sooo... What to expect from me and my blog? Tutorials, screencasts, reviews, freebies, random writings... Anything that is connected with the Internet, it's development and me. I'll try to show up with some quality and creative stuff, hopefully, on a regular basis.

Ramble on!

Tags: about, introduction, random.
Categories: Blablabla.
Comments: 2 comments.
1
Robert Basic © 2008 — 2012
Design & graphics by: Livia Radvanski
Coded by: Robert Basic
Home page last updated on November 30th, 2009.
Frameworks used: Zend Framework, Dojo, 960 Grid System