Changing SVN (subversion) user under APTANA (Eclipse)

After a long while, I finally found a solution to my committing to subversion under anoter person’s name.
I hope this helps somebody.

WINDOWS:
delete the cache file(s) under
%APPDATA%\Subversion\auth\svn.simple\

LINUX: (not tested)
delete the cache file(s) under
~/.subversion/auth/svn.simple/

, , , , , ,

No Comments

How to disable specific options in JQuery Autocomplete lists

If you ever had to disable autocomplete results while using JQuery Autocomplete, here is the method I found most useful:



First, mark your entries as disabled server-side, before you send it as json

01
02
$items = array(); // add your items here
03
 
04
$items[] = array(
05
  'id' => $i,
06
  'label' => '<strong>This option is disabled</strong><br/>Too many results, be more specific',
07
  'value' => 'disabled' // this will specify what we disable
08
);
09
 
10
die(json_encode($items));
11

Then simply add them as non-autocomplete items in the autocomplete list, while at the same time enabling html code in items:

01
02
$('#autocomplete_polita').autocomplete({
03
  source : webRoot + 'ajax/my_autocomplete',
04
}).data("autocomplete")._renderItem = function(ul, item) {
05
  if(item.value=='0'){
06
    return $('<li class="ui-menu-item disabled"></li>').data("item.autocomplete", item).append('<span>'+item.label+'</span>').appendTo(ul);
07
  }else{
08
    return $("<li></li>").data("item.autocomplete", item).append("<a>" + item.label + "</a>").appendTo(ul);
09
  }
10
};
11

Then style this no-option as one (maybe using disabled-style colors:

01
02
li.ui-menu-item.disabled{
03
  text-decoration: none;
04
  display: block;
05
  padding: .2em .4em;
06
  line-height: 1.5;
07
  zoom: 1;
08
  color: #CCC;
09
}
10

, , , , ,

1 Comment

Using mysql_query() within CakePHP

I always wanted to be able to get large datasets into CakePHP but since cake turns a 10MB db result into 120MB array, I had to come up with a solution to use the php mysql_query() function.

After a few unhelpful searches on google this is what I ended up with:

1
2
$db =& ConnectionManager::getDataSource('default');
3
$result = mysql_query('SELECT * FROM `users`;', $db->connection);
4

4 Comments

HTML5 support in IE? How funny!

Another reminder for us web developers, of why we “love” Internet Explorer so much.

, , , , , , ,

No Comments

NetBeans 6.8 PHP

Screenshot of NetBeans PHP

NetBeans PHP 6.8

I always like to have the best available tools when I get started on a LAMP project. Although writing PHP code is not IDE-dependent  like for example .NET or other development systems, it does help to have the best IDE one can find. Taking into consideration the available funds for setting up a development environment, it makes a lot of sense to use free available tools as much as possible, so to that end, I’ve ended up using NetBeans PHP, which at this time (March 2010), is at version 6.8.

I’ve enjoyed using Eclipse PDT for quite a while now, but my current project setup causes Eclipse to be very slow on managing my Subversion checked out project.

My experience with NetBeans is very good so far. It seems like the more I use it, the more I like it. There are a few down sides to it, like for example, having a smaller plugin base, or code completion not working so great, dispite the fact that code completion is been advocated as working better than Eclipse.

I’m sure for small projects it works well, but for larger ones, code completion kind sucks. I suspect the cause of that issue is NetBeans not keeping a project index cache somewhere. One should be built every now and then, updated each time you save or work with a function/method/etc and that index could be used to instantly serve code completion. I’m not sure that’s happening though.

All in all, here are my pros and cons regarding NetBeans.

Cons:

  • Ridiculous code completion times in projects that aren’t small (especially if you’re not working on a local server – i’m working on a local VMWare samba folder)
  • Poor list of issue tracker related plugins (it basically only supports Bugzilla and Jira out of the box, unlike Eclipse)
  • No folder refresh option (if I change anything outside NetBeans, I have to wait for it to refresh that folder whenever it feels like doing so)
  • Limited set of Subversion features (unlike eclipse)

Pros:

  • Significantly more athletic than Eclipse in every aspect (startup time, memory consumption, general responsiveness)
  • Pretty stable (very few crashes)
  • Symfony support (I like Symfony, so I like having support for it)
  • Can save project files outside project source folder (I like saving project files on a local HDD, since I’m forced to use project source folder as a VMWare samba share, so I can optimize response time in the IDE as much as possible)

Conclusion:

I’ve previously used Eclipse PDT and Zend Studio for Eclipse, because they were the only ones I considered to be serious PHP IDEs. I find other editors to be unworthy of any interest. I’ve also tested NuSphere PhpED, Dreamweaver (can you say LOL?), ActiveState Komodo, Maguma Studio and others like that, none of which are professional PHP tools.

Since it’s a very cool, professional PHP tool, and it’s completely free, I rate it 8.5 out of 10, for lacking quite a few features, but I still use it for working a lot better with my environment than Zend Studio for Eclipse, or Eclipse PDT. which I would probably rate 9.5 and 9.0 respectively, even though Zend Studio costs quite a lot of money.

, , ,

No Comments

Fast cat is fast

Fast Cat Widget Settings

Fast Cat Widget Settings

I recently had to develop a WordPress widget plugin that would hierarchically  list the categories of a blog, but in a decent amount of time, unlike the default category list, or any other widget I could find online.

The “FastCat” plugin currently works very nice on a database of 250 categories, containing more than 280,000 articles, so if you have a large WordPress database, you probably want to give this baby a try. Available options are:

  • widget title
  • root category
  • toggle display on singulars (`article` or `page`)

…but if required, I may add more. You can download it here and see it in action on Expert Mountain.

If you have any comments or suggestions, please leave a comment at least. I would enjoy perfecting it, if possible.

, , , , ,

16 Comments