Archive for category Programming
Browser Extensions For Developers and Internet Marketers
Posted by Randy in Internet, Programming, SEO, Web Development on May 3, 2010
I'm on the fence when it comes to my favorite browser. I've recently started using chrome much more, due to some bad performance issues in Firefox. Firefox on my 64-bit Windows 7 installed sits and eats memory. I've seen it use nearly 2gb of RAM. This was after it had been open on the computer for a few days, and a restart of the browser fixed the issue. However, I'm not sure why this leak is there. The last time I can remember truly liking Firefox completely was back in the version 1.5 days, and even then there was supposedly a huge memory leak. Back then I didn't notice a memory leak, but these days I do.
It could be that Firefox utilize memory different, and it may be the new way Windows 7 display memory usage. I still see sluggishness. Thus, my move to Chrome. There area a few different things that could have caused the slowness, such as the added extensions in Firefox. After installing about seven extensions in Chrome, however, I see no performance hit. So, I still suspect that there is an issue with the browser itself. Even with all of these woes, it is still better than using IE. I hate that browser. I don't necessarily hate using it, but it is difficult to write web sites that work well in it along with all other browser. It's the odd ball which never works the way I want.
For web development, Javascript is necessary for client-side scripting. However, Javascript is difficult to debug. Luckily, we have the Firebug extension for Firefox. This is the uber-extension for web developers. I've used it quite a lot, so much so that it has become a necessity. I probably couldn't write Javascript without it. There are also other features to this extension, like being able to examine the DOM and such. Internet Explorer has a similar tool set but it's slow and hard to utilize. I would dare say that there are some IE users who installed Firefox just so they can use Firebug. One setback here is that IE's Javascript engine has certain nuances that do not readily show up in Firebug. So, while you can debug a majority of javascript errors with Firebug, it will miss certain IE javascript issues.
The next must-have extension for web development is the Firefox Web Developer extension. It gives you a host of options to example page elements and CSS rules within the page itself. This plugin along with Firebug have saved me TONS of time, while working on websites.
SEO is important to not only marketers but web site developers as well. Getting a site online is one thing. Getting it to show up in search results is another. A couple of excellent extensions for examining the search engine optimization of a site are the Firefox SearchStatus extension and the Chrome SEO extension for Chrome. The Chrome SEO extension is great for getting a brief synapsis of your site's backlinks, pagerank, and indexed pages at various search engines. Neither of these offer a lot of advice for SEO, but they do show some stats to get your started.
These are only a few of the extensions available for Firefox and Chrome. There are many others. They are a good reason to switch from IE. PLEASE DO!
Resetting WordPress Passwords Manually
Posted by Randy in Open Source, SQL, technology, Web Development on January 10, 2010
I've had to do this for my wife and her mom both, so I thought I would share this with anyone who needs to reset a WordPress password. I personally love WordPress. You can build any type of site with it, not just a blog. If you have created a WordPress site but haven't visited the admin dashboard in a while, you may have forgotten your password. I thought that WordPress would email you a lost password, but maybe they didn't put in their correct email address. It could have also been the installation script they used through cPanel. Whichever the case, they couldn't get into their dashboard and they needed their passwords sent to them.
There's a very easy way to reset that password through SQL. Whether you are using phpmyadmin or some other SQL client to access your databases, you'll want to use the following SQL statement to reset your password:
UPDATE wp_users SET user_pass=md5('password1') WHERE ID=1;
You can change password1 to whatever you want. I'm amazed that WordPress passwords aren't stored with more encryption than a simple MD5 hash. It's secure enough, don't get me wrong. I'm just surprised that the WordPress developers didn't opt for more.
Oh well, I hope that helps someone in a pinch.
ExtJS Bug – Form doesn’t submit
Posted by Randy in Programming, Web Development on October 22, 2009
Let me start off by saying that I love the ExtJS framework and it has been a pleasure to learn it over the last few days. It is probably the most professional JavaScript framework I've seen, thus the reason I wanted to add it to my latest app. The documentation is very thorough and it's very easy to learn.
However, I've spent most of my day (when not taking care of kids and doing school work) trying to figure out why a simple form I've created doesn't submit. The thing that really had me perplexed is that almost the exact same code worked for another form on another page. It was frustrating because I just knew it was something I was doing wrong.
Perhaps the most frustrating part about it was the fact that it was a bug in the framework itself. From what I've since found by researching on their forums, the bug was reported a few versions ago. There's a work-around and I'll get to that in a bit, but I want everyone to see the code.
var dbPanel = new Ext.form.FormPanel({ id : 'dbPanel', name : 'dbPanel', height : 'auto', width : 'auto', standardSubmit : true, layout : 'form', method : 'POST', url : 'db_verify.php', border : false, bbar : tb, keys : [{ key : Ext.EventObject.ENTER, fn : verifyDB }] });
This is the code that doesn't work. It's a basic form and it should POST data to the db_verify.php page. The "standardSubmit : true" sets the form panel to use the old standard submit instead of Ajax. Here is another example that works:
var loginPanel = new Ext.form.FormPanel({ id : "loginPanel", height : 'auto', width : 'auto', layout : 'form', border : false, standardSubmit : true, url : 'login.php', method : 'POST', bbar : tb, keys : [{ key: Ext.EventObject.ENTER, fn : doSubmit }] });
There's very little different in these two instances of FormPanel. The only difference I could find was that the first one doesn't work and the second one does. In fact, I changed just about every option three times or more just to make sure I wasn't missing anything. Everything I did gave me the same result. The page would refresh to itself and my form data would just disappear.
The eventual fix for the problem is to manually set the DOM action for the form when the handler is fired. So, for the first code listing, my handler went from looking like this:
var verifyDB = function(){ dbPanel.getForm().submit(); };
To looking like this:
var verifyDB = function(){ dbPanel.getForm().getEl().dom.action = 'db_verify.php'; dbPanel.getForm().submit(); };
The first handler worked perfectly well with the other form submit. For some reason, it just seems to randomly decide it isn't going to work for this scenario. It's an easy fixed, but when you are trying to learn a new framework it's not good to deal with a bug like this during your first few days.
Twutils.com
Posted by Randy in Programming, technology, Web Development on October 6, 2009
I've starting a new website and have almost completed development on the first tool. It's a site devoted to Twitter tools. I call it Twutils. The first utility is a spam removing tool called Spit Remover. I've settled on "Spit" as a good name for Twitter Spam. I'm in the process of moving the site to a new host due to DNS issues on the previous host. A few other ideas I have for Twutils are:
1.) Tweet Scheduler
2.) Follower generator
3.) Unfollow those that don't follow you (like Huitter.com's Mutuality.
I'm also planning to keep track of users who are removed with the spit remover. I may use this to show blacklisted spammers. I may generate a list of the most removed spammers, and allow people to remove these people automatically. Or I may just use it to create the biggest spammers list.
Warning: simplexml_load_file() [function.simplexml-load-file]: URL file-access is disabled in the server configuration
Posted by Randy in Apple, Internet, Programming, technology, Web Development on September 24, 2009
If you've seen that error message you've probably happened upon a security feature that your shared web hosting provider has enabled. There are a few work-arounds for this error but most require you to have certain privileges on the server that you probably don't have. Quite frankly, if you are getting these errors you probably don't have the ability to change these settings yourself.
Rather than try to get the provider to change these settings (let's face it, they have this enabled for a reason and surely someone else has already tried to get this changed, right?) one can easily get around this with Curl. In most cases, curl will be enabled on the server. So here is the quick and dirty way to get around it:
Create a PHP file and name it anything you want. For the sake of this article we'll refer to it as curl_functions.php. In this file put the following functions:
<php function setupMyCurl() { $myCurl = curl_init(); $temp = curl_setopt($myCurl, CURLOPT_RETURNTRANSFER, 1); return($myCurl); } define("myCurl", setupMyCurl()); function curl_get_contents($url) { $temp = curl_setopt(myCurl, CURLOPT_URL, $url); return(curl_exec(myCurl)); } ?>
Include or require this file. Then, all you have to do is use the curl_get_contents($url) in your code to pull in the xml to a string. Then use the simplexml_load_string() instead of simplexml_load_file(). This will give you the same results but works around the url fopen feature. If you don't have curl enabled on your host, GET ANOTHER HOST.
Why do Google Search Results Change?
Posted by Randy in Internet, Networking, Programming, SEO on July 30, 2009
I was recently asked by my wife why Google search results change. I had noticed it before but didn't spend much time dwelling on it because my first thought was that Google uses many locations and many datacenters to hand out search results. The varying results are differences in the data stored at each location. Depending on which datacenter you are getting results from at any given time, you can see a huge change in results. As an example to this I made a quick video to show how going through a proxy server can change search results. In this video I'm going through a Linux server in Texas at first. Note the total results for the keyword while going through the proxy are 282. By removing the proxy and refreshing the search the number changed dramatically to 635,000 results.
I saw a video explanation of this behavior that stated that Google was a beach, and while I enjoyed the analogy, it isn't entirely correct. There is a lot happening on the internet, but there's no way Google can index it all at once, or even catch it all. That's why they have many data centers, each pulling their own part of the weight. I'd imagine that the synchronization of the data takes time, that is if they actually synchronize the data at all. It may be that Google does this to randomize search results a bit in order to gauge relevancy of each result. At any rate, the keyword results can vary.
Also, after making this video, I captured the packets using wireshark and found that the request from my home internet connection was querying IP 208.67.217.231 and my proxy server is pulling the query from 74.125.159.103. Also neither of the search results were correct. After digging into the other pages of results there is a total of 64 results omitting the repeats. ICHY reports that the keyword has 3,640 competition. So, from what I can see of the data on both sides, ICHY doesn't report very accurate competition numbers according to their own explanation of the relevant results. Other keywords in their list yielded similar results discrepancies.
Make Twitter Better
Posted by Randy in Applications, Tips, Web Development on May 26, 2009
One of the things I like about Twitter, believe it or not, is the simplistic design. There's not a lot of useless options. There not many things to click on at all really, compared to other sites. There are a few missing items that should be on the site, however. I just recently installed a Firefox extension that accomplishes everything I need.
I've found that a lot of the twitter "clients" are lacking. For instance, I can't easily search and follow people from TweetDeck. I really like to just use the web client. I only thing that I could use on the web interface is a notification of @ replies. Every other option that I found useful in the clients is now available on the web client via Power Twitter Firefox extension. There's also a few features I wasn't expecting. For instance, Song.ly is now integrated. I had never tried Song.ly until I installed this extension. I love it.
Check out the extension. It's worth it if you Tweet much at all.
