Wednesday, May 15, 2013
Lithium First Glimpse
I decided to review my PHP and now I’m interested with the Lithium project. I wanted to get my hands on it just to see what it can do and what are the good stuff in it. Lithium by the way is a PHP web framework, it’s RAD. If you don’t know what a PHP web framework is, I don’t think I can help you. But a Google with the topic can result to many useful resources.
I almost forgot most of my PHP background because it’s been 2 years since I coded it. And it was with 4.3 and Oracle. I’m not too sure about what to do next. Instead of installing everything from scratch, I decided to install XAMPP. It’s easy and good stuff (I think). Unlike before, installing PHP and Apache, make Apache recorgnized PHP, add a module to it, install MySQL… You know what I mean. It’s a hassle. But with XAMPP, it’s just a single install and everything is in there. Of course, this doesn’t help if you’re a geek and pretend to know everything and installing everything by hand makes you happy. But for me, it’s fine. For now.
When I got Lithium source, I just pasted it in the htdocs directory and there it goes. It’s slick. It also has some good tutorial in their site. Everything is good. Until I decided to check on Contribution. Not that I can contribute but who knows. I bumped into an error with the coverage. I never knew PHP has coverage. That’s interesting. So I Google a bit and read a few statements in lithium’s wiki about xdebug. There it is. XDebug is actually and extension for PHP and has good stuff. It has code coverage and everything useful for developing PHP applications. God, I never knew this is coming. The more I surf the net, the more I know things I don't know.
So back with the error, it has something to do with xdebug_start_code_coverage method not found. I ran into xdebug installation and it’s just adding the extension to the Apache. That’s simple, I think I can do that. But when I look into the XAMPP’s PHP installation, I noticed php.ini has the extension but commented. Ha! That’s even simpler. I uncommented it and voila. When running lithium test cases it fetched off the call stack with information I found some useful. Although I’m not too sure I’m too familiar with it. :)
Labels:
lithium,
php,
programming,
xampp,
xdebug
Learning Python Hydrology
Recently I'm learning Python and encountered the Hydrology book. Had to upgrade some of python packages and some libraries needed to get working with the book. There is an instruction though about mostly using pip install packages need for the book. The problem is I can't get it work. It's missing some things so I did a little google and hopefully this is a compilation of the things I need to work with the examples of the book.
First off, I updated the apt-get
$ sudo apt-get update
Next is I installed the pip package manager. I'm not too sure but I have Ubuntu 10 and it doesn't have the pip installed. So I installed using the command below.
$ sudo apt-get install python-pip
Now the development packages for python.
$ sudo apt-get install python-dev
Most of the examples uses the scientific number packages so I installed numpy and other packages I'm not quite aware of. It's just that some of the examples probably in the later part of the book uses the other two packages aside from numpy.
$ sudo pip install numpy
$ sudo pip install xlrd
$ sudo pip install xlwt
Scipy needs some compilation and I think it has some packages built on top of fortran and some C++ source so I instlaled the essential and fortran packages with the commands.
$ sudo apt-get install libatlas-base-dev gfortran
$ sudo apt-get install build-essential
After installing these prerequisites, install the scipy with the command below.
$ sudo pip install scipy
For some plotting, installing the plot library is useful. There are also lots of examples using the plot.
$ sudo apt-get install python-matplotlib
This one I found the most useful package. It can be used as good reference to execute plotting some equations. At the very first stage of the book I encountered simple plotting of an array of x with the sin(x) as y coordinates and it's really helpful to visualize the equations with the plotter.
Labels:
development,
hydrology,
learning,
matplotlib,
numpy,
programming,
python,
scipy
Tuesday, May 14, 2013
Introduction to CodeIgniter
Introduction
I've been playing around with CodeIgniter as my PHP web framework for a while now and I would like to share my simple steps in getting started with the tool. I think it's maybe too late to post this one up on the internet as there are lots of articles describing the said tool. But anyway, I'll just post this one so that I have some reference in the future how I did things to work with CodeIgniter.
CodeIgniter is a simple, light and fast web framework.
And web frameworks are encapsulation of the repetitive tasks we do when developing a website. One of the many important issue solved by this framework is maintenance. We get to have our code separated so that we have proper maintenance of our site. When I say separation of code, it's a conceptual thing. Web framework, most if not all, are implementation of the MVC pattern where we separate logic from presentation. It's model and view respectively. And CodeIgniter does that with ease.
Let me demonstrate. Mostly we do have actions as our PHP scripts, i.e. listcustomers.php to list all our customers. And we have code inside like so:
For some simple sites this works but imagine we'll have other scripts that does similar to this like listvendors.php, listitems.php. I'd imagine we'll separate the part where the connection is and include it in all of these scripts. Yes it solves the problem.
Download and Install
You need to have a web server and a PHP interpreter to run PHP and optionally we can install MySQL. I know these are lots but need not to worry. There's XAMPP to help us. Download and install XAMP and we've got all three working and ready to use.
Visit CodeIgniter website to download the said package. Assuming we put XAMPP to C:\xamplite, we can unzip the package to C:\xampp\htdocs\codeigniter and that's it. We can now access the page through our browser. Open up your browser of choice and go to http://localhost/codeigniter/. Voila! We have a codeigniter website up and running.
Labels:
codeigniter,
mvc,
php,
programming
Reasons why you don't apply to some Companies
Just a note, this is just a joke. So for some companies, I would ask you to evaluate me first not base your judgement for hiring me in this post. :)
Recently, I planned on getting another job. This time with programming languages I'm not familiar with. Just to get my hands on. Something like Python or Ruby, or JS and NoSQL. You know what I mean.
Then came, job posts at some Ads. Recruiters really think they are smart. They're not even reviewing what they're posting and not getting consultation from experts offering a job. For example
SEO Experts (20k to 30k)
with
GREAT “DAYTIME” CAREER OPPORTUNITIES
A NEW COMPANY soon to expand OPERATIONS in CEBU!!!
I'm sure 30k is not that great. And what's with the DAYTIME? Also
- Perfect Worklife Balance: “Daytime Work” and Guaranteed 5 day work week only
- Easy to Manage Accounts
- Excellent Compensation based on expertise, we are only looking for top talent and pay accordingly
- Performance and Attendance bonuses, Leave Benefits (Cash Convertible), HMO, Educational Assistance, Meals, etc.
- Fast Regularization of Employment Status (3 months Proba only)
- Friday Night Gimmicks
- Free “Starbucks Coffee Coupon for Two” hiring bonus
- Nice and fun work environment and work culture
Well they have a nice work environment. That's good but Night Gimmicks? And Starbucks? What the hell.
Another company is hiring PHP Developers. Check this out.
Senior PHP Developers ( Object-Oriented PHP )
We'll yeah, PHP supports object-oriented programming. That's good. They require extensive of most stuff. PHP, MySQL but basic on SQL.
Requirements :
- Web Application Development Experience
- 3+ Years of Relevant Work Experience
- Extensive experience with in Object-Oriented PHP
- Extensive experience with MySQL database programming and optimization
- Strong knowledge on CSS, HTML, and Java Script
- Basic knowledge on SQL
Extensive of MySQL but basic knowledge of SQL. Now that's contradiction. Also they prefer
- Symphony Frame Work is a Plus
- JQuery knowledge is a plus
It's Symfony and it's Framework not "Frame" and "Work".
Labels:
comedy,
evaluate,
job,
joke,
opportunity,
programming
Subscribe to:
Posts (Atom)