Exceptions vs method missing in Ruby and Rails
- May 19th, 2010
- Write comment
Archive for the ‘Uncategorized’ Category
I looked all over the web and found some links to this but it was not easy to find so i thought i would write a little article about it.
You will see this error:
Abort class-pclzip.php : Missing zlib extensions
This is because in the file class-pclzip which is in your wordpress directory
at ${wordpress_root}/wp-admin/include
wordpress looks for gzopen and now in php that is called gzopen64 so just find all occurances of gzopen and replace it with gzopen64.
Now you can install plugins and themes again. Good luck and hope this helps others.
As i have been doing more webos app development, i thought i would just keep little snippets of things i learned as i was developing. One thing that i really wanted to do was to have a spinner in as a button in the command menu (aka the button bar at the bottom). First you need the code to setup the commandMenu. This is called in the setup method of your assistant. In this case, i have a menu with a new button on the left and 2 buttons on the right and a spinner in the last spot (aka the dynamic content).
this.cmdMenuModel = { items: [
{
items: [{label: $L('New'), icon: 'new', command: 'new'}]
},
{},
{
items: [
{label: $L('undo'), icon: 'refresh', command: 'undo'},
{label: $L('search'), icon: 'search', command: 'search'},
{example: 'A', template: 'common/spinner'}]
}]
};
this.controller.setupWidget(Mojo.Menu.commandMenu, undefined, this.cmdMenuModel);
this.controller.setupWidget('spinner', {
spinnerSize: Mojo.Widget.spinnerSmall,
},
sceneAssistant.spinnerModel = {
spinning: true
});
this.spinnerWidget = this.controller.get('spinner');
The template for something to show up in the button bar looks like this. This makes it still look like a button but you can show your content. The main thing to notice is that the item from the command model above is passed to the template for variable expansion.
Now you should have something that looks like:
Also, you can now enable and disable the spinner with:
this.spinnerModel.spinning = false; this.controller.modelChanged(this.spinnerModel);
I have been thinking a lot about what it takes to start a company or even start anything in the world. Starting a website, a blog, a project or even something as simple as an exercise schedule. For all of these things it takes something very simple, it just takes the first step towards doing it. The larger the task the harder it is to take that first step, but i have also realized that once you take the first step, the second, third, etc become exponentially easier. I don’t think this is something that just I have discovered. If you read any self help book or talk to any motivational speaker they tell you this and yet its hard. Its hard to internalize it, its hard to step out. Some of it is fear, some of it is just laziness. Somehow, a single step just seemed subtly simple. I hope that all of you have the ability to take your first step….
I just spend the last week or so reading about all different type of lenses and which one does what and is how good etc. There are a lot of reviews but there are very few that really talk about whats good/bad in simple terms that an average SLR camera consumer can understand. So here is my take on the subject
. You need to know some basics before you break it all down:
The ultimate lens that a consumer would want but does not exist is:
If you say okay lets look around see what we can find, you will see a number of lenses that are close but not exact.
You notice that you can get a super zoom lens but the F stop is so high that you might not really get great pictures in terms of light. I searched high and low for a 24-200 or a 18-200 with F2.8 and they just dont exist. So now that you have come to picking something that is based on what is available you have two choices.
Choice 1: Get 2 lens one for 24-70 and one for 70-200
Choice 2: Get 2 lens one that is a 18-270 and then get a 18-55 2.8
I went with choice 1 mostly because i want to start with the 28-75 and see if that is good enough zoom for most cases for me. If it is then i am done with one lens, if not then i have to get the 70-200 F2.8 but at least i have 2.8 across the whole range and that makes for some nice pics.
OH!!! The last thing that is super important that no one tells you about is the flash. If you get a 430EX2 flash then the indoor portrait pictures can come out amazing. The lighting for photos is half the photos beauty. With a simple flash you can get some amazing shots of people and things and not need perfect sunlight to get the beauty you want.
I could write more about each lens and good/bad etc but then it wouldn’t be short a simple would it?
Well it took me a bit of time to get this blog/webpage up and running and during the process I learned a lot about domain names, hosting and what is good/bad. I tried to find this information on Google and there are bits here and there but the big problem is that no one just puts it into a simple breakdown. I think the Web Hosts are actually working to make it harder to figure this stuff out. In any case here are the few simple things i learned. There are really 3 main web hosting types and charging models that i looked at:
Examples: JustHost, GoDaddy, etc..
The idea here is that these companies have large farms of servers and they are renting out part of it to you. In general you dont get to pick the OS running on it and you don’t get to install custom software. You get a set of software choices that they have like WordPress, PHP5 scripts that have predefined, Site Creators that they have chosen etc.. This looks really too good to be true because it says Unlimited Space, Unlimited Bandwidth and only $5. It is unlimited in those areas but it limits your ability to really use it because the tools and services they have are highly restricted. For example, you can install wordpress but only install their “accepted plugins”. You can run PHP scripts but none that write to the disk. They try to glitz and glamor you into buying their hosting solution by giving you “a free domain name” or “Free Google AdSense money”. I would really recommend that you just ignore the hype here and go with simple and easy. This is a great example of something being subtly simple. This looks simpler because its all setup and you have choices to install your apps and you are going to up and running in minutes. But then you want to make this small change, you don’t like the way the UI looks or you want to store images there and suddenly all the shackles of these sites show up.
Pros:
Cons:
Examples of this type of service are LiNode (the one i went with) or slicehost. With this type of host you are paying a monthly fee for a pre defined amount of space and bandwidth. You can usually get the lowest version of this for about $20. The general idea is that you are just getting a virtual machine in the sky. You can install whatever operating systems that they support and then you get root access and you install whatever you want and configure whatever you want. There is usually a small admin UI that allows you to setup the virtual machine and manage it but you really only use that when you can get to your own machine through SSH because something is really broken in your own setup.
Pros:
Cons:
Examples: Amazon EC2, Rackspace
This is the same as the VPS Monthly Pay but they charge you based on the amount of space and bandwidth that you use. This seems like a good idea when you are doing tons of data or tons of bandwidth but its hard to figure out what it is going to cost you monthly. It is not just $X monthly it might be very little or a lot depending on how your site does. While this could be much more ecconomical in the long run i would suggest you just start with simple and then can worry bout all the math to figure out how much your site traffic and storage will cost you.
Pros:
Cons:
There are many other types of hosting like co-locate and dedicated hosting etc. These are more for companies and people who really want to get into the hardware of hosting and not just the software. If you look at the above choices, would really recommend going with a VPS – Monthly and then switching to a VPS – Measured when you have more stats about what it will cost you.