Eclipse issues in Linux Mint

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

I've been wrestling with IDEs and OSs for the past few days, trying to decide which would be best for Javascript and PHP development. I had been using Netbeans. I absolutely love Netbeans, but I found that editing Javascript in it was somewhat lacking. I was having trouble keeping up with my nested anonymous functions and thought it'd be a good time to try out other alternatives.

I bounced around between Linux Mint, Mac OS X, and Windows 7. I find that I would really like to program on my Macbook Pro, but it just doesn't feel comfortable. There's something about the keyboard setup or something that just annoys me. It's more of a problem with my familiarity with the keyboard, I think. At any rate, after messing with Eclipse, Netbeans, and Textmate on my Mac, I decided it was going to be a no-go.

Windows 7 presented a problem in the fact that XAMPP seems to have issues with sessions. They work but almost at random, creating a new session will lock up the entire web server. When you are developing a website which uses Sessions for user logins, that creates a problem. So, I decided it would be in my best interest to use Linux, which seems to be made for programmers, because most programming related things work great in it and the fact that you almost have to be a programmer to get some things to work correctly in it. Though, that is an outdated misconception, but everyone still seems to believe it.

I had been using Linux for most of the development of my new project anyway. So, there was no transition there. I'm using SVN on a server machine so it really didn't matter which OS or IDE I decided upon for that. They are all pretty universal in their ability to handle SVN. The major exception was Mac OS X which didn't include the ssh-askpass command needed to tunnel SVN through ssh correctly. I was able to find a shell script that handled the ssh-askpass function, however. Textmate didn't really work well, either, because it didn't really have robust SVN integration. It was pretty much just like manual SVN. I also needed separate programs for Diff and Merge. That was lacking and clunky. I was spoiled by Netbeans' built-in Merge, Diff, SVN, and so forth.

I thought I'd give Aptana a try. It is a PHP developer plugin for Eclipse. It is also available in a standalone package. I had various problems with the standalone version of Aptana so I decided to install Eclipse from the LinuxMint/Ubuntu repositories. Eclipse worked great, and Aptana installed perfectly. However, I needed the SVN tools that are Aptana add-ons. They wouldn't install. There was a version conflict with the version of Eclipse in the LinuxMint/Ubuntu repositories.

So I decided to install the latest version of Eclipse. I downloaded and ran the latest version and found that there were UI issues. This brings me to the subject of this post. The UI issues were a major roadblock, so I searched for a solution. The problem, I believe, stems from compositing inside Gnome. Unlike Ubuntu, I couldn't find an easy way to turn off compositing inside LinuxMint. OH, I'm sure I could disable the compositing extension inside the xorg.conf file, but I really wanted a light switch option. The normal way I would handle this is the Fusion Icon. It didn't seem to work. I also tried disabling effects from the Gnome Appearances menu option. Compositing just wouldn't turn off that easily.

So here is the solution for Eclipse and Aptana inside Linux Mint.

GDK_NATIVE_WINDOWS=true /opt/eclipse/eclipse

That will work if eclipse is installed in /opt/eclipse, but I just had mine downloaded to my home folder. It doesn't really matter. You would just change the /opt/eclipse/eclipse to your actual executable path. The key here is to add the GDK_NATIVE_WINDOWS=true before the eclipse command.

I'm about to create a shortcut to do this for me. Now all my buttons will work when I click on them. That's convenient huh.

, , , ,

No Comments

Resetting Wordpress Passwords Manually

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.

,

No Comments

Weight Loss Time

About four years ago, I gave up drinking as a hobby. I was drinking around a 12-pack per day. I had been doing that for about three years is my best guess. I didn't give up drinking altogether. I just stop drinking daily. I actually haven't had a drink in a few months, and before then it was months since I'd had one. So, all-in-all I'm completely broken from that habit.

That was my first goal. Once I was able to go months without drinking, I decided it would be a good time to stop smoking. That was my primary goal. I knew that, as long as I was still drinking, I would never be able to stop smoking. So, I went to my company's nurse practitioner and she set me up with a prescription to Chantix.

Now, I don't have an affiliation with Chantix. I make nothing from saying this. That medicine was awesome. I went into the whole thing thinking I'd like to quit smoking. I wasn't very determined. I just thought it would be a good idea to try. Maybe I really had more determination than I thought. Who knows? At any rate, I started taking the Chantix and set my quit date for a week into the treatment. This is how I was instructed to do it. Within three days of taking the Chantix, I stopped smoking. I didn't even finish the whole week. Smoking started to make me nauseous. I continued to take the Chantix for about three weeks. The instructions I received were to keep taking it for at least two months. I couldn't handle the sick feelings I got from it, and I was certain I had quit smoking for good.

That was September 13, 2008. I have smoked half a cigarette since then. I hated it. Now I'm smoke-free but I have a new problem.

At the time I quit smoking, I was working in an office position. I was already gaining weight from that. I'm about 5'9" and when I quit smoking I was up to 220 lbs. Within four months of quitting, I was up to 240 lbs. My weight equalised at that point. That is much heavier than I've ever been. Just 6 years ago, I was around 180 lbs. Three years before that, I was around 150 lbs. So, less than a decade ago, I was around 90 lbs lighter than I am today.

I know it's corny, but my new years resolution is to loss weight. I'm cutting my calorie intake down to less than 1200 per day, and I'm jumping on the treadmill twice a day for no less than 100 calories burned each time. Also, my calorie intake has to be limited to mostly snacks of 100 calories or less spaced out at least one hour apart. There will be exceptions to this and I'm not going to kill myself trying to stick to these rules but those are my general rules for the weight loss program. I'll probably be eating lots of tuna straight. Hopefully I can stick to this. It's about the only thing left for me to fix about myself.

, , ,

1 Comment

Another look at Google Chrome

I've never published a "first look at Google Chrome", but I have been excited about it before. By Google Chrome, I'm referring to Google's webkit-based browser, not the Chrome OS.

When it was announced that Google was releasing it's own browser, I wasn't extremely excited. Then once it was available, I downloaded it to see how well it performed. I was amazed. The javascript executing was blazing fast. I'd never seen a web application respond so well. So, I suddenly became very excited about it and wanted to adopt it as my main browser.

This was soon shot down by the fact that I rely too heavily on certain extensions in Firefox, namely Gmail Notifier, Firebug, ForecastFox, and Adblock Plus. So, I had to keep using Firefox and hoped that one day Firefox would be able to handle javascript as good as Chrome.

Well the opposite has happened. Chrome now has extensions. I'm a little worried that it will be bloated and start performing slowly like Firefox. Firefox was once a lean mean browser. Now it is a bloated mess. It has started crashing without warming in Windows 7. I was once a Firefox advocate and I still like the browser, but it has been going downhill for the past year or two. Let's hope that Chrome doesn't follow down this path.

Firefox shouldn't even be that bloated. Sure, the extensions probably add to memory usage and Firefox reserves memory if it's available, but should a browser really be using half a gig of RAM? Seriously?

Chrome doesn't use less memory but it sure responds better. Adding extensions doesn't seem to lower performance either. I've added a GMail notifier, Google Wave Notifier, Forecastfox weather, Firebug Lite, and a couple other extensions and there is no noticeable change what-so-ever.

Now that these extensions are available for Chrome, I think it's time for me to take the next step. Chrome will be my main browser as soon as the extensions are available for the Mac and Linux versions. It's already going to be my main browser in Windows.

So, if you took a look at Chrome when it first came out, this may be a good time to look at it again. There are a few added features that may change your mind about it as well.

Reblog this post [with Zemanta]

, , , , , , ,

No Comments

ExtJS Bug – Form doesn’t submit

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.

, , ,

No Comments

Why Internet Laws are Detrimental to Americans

Recently the FTC has created new guidelines/restrictions for the internet. These laws especially effect bloggers who review products. Any review of products requires a disclosure of the blogger's relationship with the product brand, if such a relationship exists. So, if you are a blogger and you review a product, if you received money or something from the product manufacturer, you now MUST disclose that information.

Now, on the outside, this appears to be a good thing. It should lower the amount of dishonesty on the internet, right? The answer is "yes and no". It will limit Americans from doing this. Americans make up about 5% of the Earth's population. Did you know that there are more people in China that speak English than there are people in the United States total? My point is, this regulation, along with many others, promotes outsourcing.

It is becoming increasingly difficult for an American to stay afloat in this world. I know, many of the non-Americans out there will say "but you guys have had it good for so long." I agree, we have. We've had it so good because we used to rely on freedom more. Our country could once pride itself on being free. We still have a lot of freedom, don't get me wrong. The fact that I'm still able to write a blog post like this reflects that I still have freedoms. They are just much more limited now when compared to even 50 years ago.

I may sound like a broken record but corporations run this country. We are losing our country.

, , ,

No Comments

Twutils.com

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.

, ,

No Comments

Wikipedia: A credible source?

Most people who have attended college in the last few years know that colleges don't like Wiki used as a source to papers. Their reasoning is sound, because Wikipedia is, after all, community-based. Anyone can make changes to a wiki article.

However, I tend to agree with the open source way of thinking. More eyes on the issue makes it less likely that someone can take advantage of it. Let me explain.

Security is actually a big selling point of open source software. Anyone can look at the source code. This means that anyone could easily see where the software could be exploited. At first, it sounds like open source would be bad for security. All those prying eyes will find all kinds of ways to exploit the software right? Actually the answer is no. Those prying eyes help keep everyone in check. You see, if you contribute to a piece of open source software and you add some malicious code, someone will spot it, correct it, and report you.

The same concept goes for Wikipedia, in my book. If an article makes a false statement, someone will normally find it and correct it. With potentially millions of people editing each article, it becomes increasingly difficult for the article to be biased.

Universities may not accept Wikipedia as a creditable source, but it's still an excellent choice for finding information. In fact, it's probably more accurate than most of the citations the schools will accept.

I mean think about it. They will accept a citation from CNN.com or FoxNews.com but won't accept a citation of Wiki? If anything CNN and Fox are much more biased. So, while I understand that Wikipedia isn't a concrete source, neither are other websites that are accepted. In fact, most sources are biased. Unless the source tells only the fact, there is probably an opinion mixed in there somewhere. That's what journalists do. That's what scientists do. What are the differences between Wikipedia and Encarta? One is maintained by millions of people who review each other's work. The other is a proprietary medium which is closed source and only a few people can review the contents. I prefer wiki.

, ,

No Comments

How to buy a Mac

I've bought a few Macs from Apple, recently. I bought a Mac Mini about 1.5 years ago and was very pleased. My company bought a MacBook Pro for me a year ago, so I sold my Mini. I left the company about 6 months ago. I was left without a Mac, so I recently bought a MacBook Pro.

So, that's my history with Macs. I've found that ordering a Mac from Apple is fine and all, but there are a few things that are lacking.

1.) It sometimes takes days before items are shipped. Most of these items are coming from China. The shipping process itself takes too long. People can go to Wal-mart and buy a Dell. They can also order a Dell straight from Dell. Chances are, the product will ship a lot fast than a Mac. Of course, you can buy Macs at your local Best Buy or Apple Store as well. Shipping is not really an issue there. It just happened to seem strange to me that it takes so long to get the product straight from Apple when ordering from their online store.

2.) While Macs themselves aren't overpriced when you step back and look at what you are getting for the money, the upgrades for Macs are ridiculous. They are actually unbelievable to anyone who follows hardware prices at all.

For instance, to upgrade a Mac Pro from the standard 3gb of RAM to 16gb of RAM costs $1850. Someone should tell Apple that RAM has been dirt cheap for at least 5 years. One can buy 16gb of 1066mhz ECC PC8500 RAM from Newegg for around $620, or as noted later in this article, one can get the same Ram for as little as $400. That's 4 chips at 4gb each, exactly what Apple offers.

Some may argue that the quality of the RAM is better from Apple. People please...It's the same stuff. Apple doesn't make their own RAM. They order it from the same RAM manufacturers that companies like Dell and HP order from. The same thing goes for hard drives, video cards, and DVD drives. Each of these are not better just because you ordered them from Apple.

I like MacBook Pros, Mac Minis, and iMacs, but I wouldn't advise anyone getting an Apple upgrade for any of them except for the processor. Even with the processor, I would advise to stick with the standard. If you need to upgrade anything else about your Mac, buy the hardware online. Get the specific type needed and buy from an online retailer.

Here is 4gb of 1066mhz ECC memory for just over $100. Get 4 of those and you have saved around $1400 compared to the Apple upgrade.

So, when buying a Mac, it's best to buy from a source other than Apple's online store, if you like getting your packages in a timely manner. If you must get your Mac straight from Apple, do not purchase upgrades from them. Buy your upgrades the smart way, from someone else.

, , , ,

No Comments

Warning: simplexml_load_file() [function.simplexml-load-file]: URL file-access is disabled in the server configuration

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. :)

, ,

No Comments