Archive for the ‘editors/ides/rads’ Category

Skywriter or Bespin as bookmarklet

Tuesday, November 16th, 2010

Skywriter (Bespin) is an on line pure web standards code editor from the Mozilla ppl.. It’s also available as a bookmarklet (apart from an embedded release). The bookmarklet is pritty cool, allowing you to click the bookmarklet when visiting any site with a textarea in it and then transform them into code editors with highlightning etc..

svn over ssh with another port than 22

Wednesday, December 2nd, 2009

A client of mine has their own SVN repository and they where running ssh over another port than the normal 22. Doing this can be a bit tricky since svn doesn’t really like the common host:port style when using svn+ssh protocoll (or whatever you call that combo).

I’m using NetBeans (6.7.1) in Ubuntu, so was eager to get svn working directly from there. Since svn itself doesn’t like special ports, neither did NB. But after a simple search on “netbeans svn ssh port number” I surfed into (not stumbled – you know – I surf the web..) a subject in the subversion mailing list which reviled a simple solution. With ssh you can add some kind of alias for hosts for which you also can define a port etc, then it’s as simple as one two three to use custom ports with svn+ssh. I’m taking the liberty to sum the mail archive post here:

create (if not already there) a file in you home folder ~/.ssh/config

Adopt the following to your needs and add them to that file


host mysvnhost
Hostname svn.onthehost.tld
Port 80
ForwardAgent no
ForwardX11 no

Then just use svn+ssh://mysvnhost/path/to/repo with svn.

Adobe CS4 is down for counting

Wednesday, December 10th, 2008

As soon as Adobe CS4 was released we got our hands on it. Since I’ve been doing quite a lot Flash things lately I was hoping the new version would reveal some greate new features. However after trying it for couple of weeks now, I can only summarize the experience as; grumpy. To begin with Flash crashes for me when opening most of my old cs3 files, doesn’t recognize an old flash project file (.flp), crashes totaly if I’m to fast clicking around (hey.. it’s fun to click around with the mouse). The last behaviour is the same for the other nifty tools such as Illustrator and Fireworks.

They die right in front of me leaving me with a broken (long-time-since-last-save) file. Some say it’s about fonts, some say it’s about somethingelse. I saw someone who solved it by buying a new computer..

I contacted Adobe in for the subject, posted an error report and gave them full dumps of my machines current state.. getting the reply to go through a bunch of help yourself links with twenty steps each! Things like that make me grumby.

Anyway.. I’ve tried reinstalling the entire CS4 premium package (uninstall and install taking for ages) without success.. and yeah. one last thing.. Acrobat reader now crashes if I try to open a pdf link within the (a/any) browser. Thanks..

regards,
A grumpy web developer

editing PHP with NetBeans IDE

Monday, October 27th, 2008

I admit. I’m an IDE and RAD lover. And I enjoy trying out new development enviroments all the time in the quest for the perfect work tools. After using Eclipse for quite a long time for PHP, I switched to Activestate’s Komodo 4.4 IDE. Komodo is a really nice and slick IDE with by far the best PHP code completition I’ve found in any tool. The debugging is easy to setup using xdebugger and it’s easy to analyse your code using watches and analysing tools. One tool I found useful was the Watch file tool wich could be compared to the tail -f command in Linux (allows you to ‘stream’ the data of a file to output. useful to analyze log files on the fly for instance).

However, I think Komodo suffers a bit from a ruff UI, loosing variables and values in debugging sessions, forgets it’s line position and break point positions from time to time and has a limited subversion integration.

Then I found NetBeans early access for PHP. This was a really nice surprise, however I couldn’t get debugging working so I switched back to Komodo again. But now Netbeans.org released the RC1 of version 6.5. After some fiddeling I got the debbuger working (I guess it really didn’t have to do with rc1 but still..) and by that I’ve got my new favourite environment. Main advantages are for me:

  • The debugger is the best PHP debugger I’ve tried.
  • A slick and fast UI. Very easy and intuitive to rearrange panels and views almost in any way I’d like
  • Superb subversion support. Direct markers for changes, easy shortcuts to view diffs and revert actions.
  • Good refactoring support (things like Ctrl+R to refactor a variable etc).
  • Built in SQL editor with code completion
  • Active and easy class/property inspector (Komodo lists all open files, Netbeans shows only active or selected file in file list without opening it)
  • and so on..

A screen shot attached, editing a TYPO3 ext project for a client.. note the SVN popup..

coding PHP with NetBeans 6.5 RC1

Fixing an eclipse crach

Tuesday, May 6th, 2008

Recently I wasn’t able to start up my Eclipse (vaugly remembering having an X-hangup – x-windows crach I mean). All I got was a small error dialog with a reference to eclipse log file containing huge traceback of java exceptions.. I didn’t have the time or energy to trace this so I swaped to jEdit for a while.

Sooner or later one has to deal with the problems. The later was today.. My method became deleting each plugin path under [workspace path]/.metadata/.plugins/

The solution was quite simple.. I removed the file .snap in the [workspace path]/.metadata/.plugins/org.eclipse.core.resources/ path and it started working again! :-)

I’m no expert in how Eclipse handles it’s workspace data, but apparently I lost associated projects.. ..but that’s that not so tuff to add again.

Delphi for PHP, a promising PHP RAD

Thursday, March 1st, 2007

I just recently found out about Delphi for PHP – a PHP RAD environment. Actually the first real PHP RAD environment I’ve seen. Delphi was (and still is I guess) a fast and easy to use RAD for MS Windows solutions based on the the Pascal language. I more or less started my programming path with Delphi so there are special feelings still there for it :)

Delphi for PHP can be found at http://www.codegear.com/products/delphiforphp. Take a sneak peak at the demos. I really like the table grid and database connection.

I think that a RAD like Delphi for PHP is a great thing for the PHP language though not required. But developing complex, custom tailored solutions for your clients by hand is time consuming and demanding even if you use frameworks like cakePHP or symfony (which both are really great btw). Using some kind of IDE like eclipse (with php plugin), PSPad or JEdit is a requirement for any development.

What I fear is that I might loose to much control over the source code and it’s parts. To much happening automaticaly. A bit like using Microsofts development tools ;) . I’m also a bit worried when using proprietary libraries like the vcls as I can’t enhance or redefine them in the same way as with open source ones. The good thing here on the other hand is that these libraries are object oriented and therefore easily extendible. Thinking of it, it would also be interesting to know a bit more about layout support and application flow controls.

Well I’m hoping to fetch a trial of it before I mumble to much about pros and cons. ;)

So please codegear. Release a trial version so we can give it a spinn. I’m definitely considering to start use it. If it can increase productivity and efficiency, while still leaving me with full control over my sources it’s worth a lot. I’m ready to let go of total control and “notepad mentality” in benefit of that. Maybe I might actually be able to start earn some money on the projects then.

my first c# test, extracting and renaming first entrty in zip files

Tuesday, December 19th, 2006

I’ve never done any c# coding before, but honest to say, I do have been a (tiny) bit curious on it. It looks a lot like my old favourite java, and it almost smells like java.

My case now was that I needed to extract the first instance in ~1500 zip files from a folder in windows and rename each extracted file to the same name as the zip file (not the extension name of cource). Furthermore the zipfiles where named with “two file extensions” meaning they could be called blabla.eps.zip (or even worse – blabla.jpg.zip which is really odd).

Anyway. As a none Microsoftish or .netish guy in most aspects I found a great IDE/RAD for c# that is GPL:d – SharpDevelop. The install file is around 4.5mb (compared to MS Visual studio for C# cd image beign ~440mb). They also ship a native GPL:d zip library (http://www.icsharpcode.net/OpenSource/SharpZipLib/Default.aspx) for C# that’s really easy to use.

Screen capture of Sharpdevelop

My small but efficient result examplifies how to read a directory, file info, zip contents and how to extract zipfiles:

  1.  
  2.       textBoxResults.Text = "Starting to process zip files in dir " + textBoxDir.Text + Environment.NewLine;
  3.       DirectoryInfo ourDir = new DirectoryInfo(textBoxDir.Text);
  4.       FileInfo[] ourZipFiles = ourDir.GetFiles("*.zip");
  5.       int noFiles = ourZipFiles.Length;
  6.       textBoxResults.Text += "Found " + noFiles + " zip files to extract:" + Environment.NewLine;
  7.       for (int y=0;y<ourZipFiles.Length;y++) {
  8.         textBoxResults.Text += "Extracting " + ourZipFiles[y].FullName + ".. ";
  9.         //extract contents
  10.         //give us a zip rep
  11.         try {
  12.           ZipFile zf = new ZipFile(ourZipFiles[y].FullName);
  13.           //get first entry and extract it..
  14.           foreach (ZipEntry ze in zf) {
  15.             if (ze.CanDecompress && ze.IsFile) {
  16.               //ok. we can extract something. lets do it then. set up fastzip to do it..
  17.               FastZip fz = new FastZip();
  18.               fz.ExtractZip(zf.Name, textBoxOutDir.Text,ze.Name);
  19.               FileInfo tmpfi = new FileInfo(textBoxOutDir.Text + ze.Name);
  20.               //change file extension
  21.               string full = tmpfi.FullName;
  22.               //textBoxResults.Text += "FULL: " + full + Environment.NewLine + " short: " +  + Environment.NewLine;
  23.               string newFileName = tmpfi.Directory.FullName + "" + ourZipFiles[y].Name.Substring(0,ourZipFiles[y].Name.Length-7) + tmpfi.Name.Substring(tmpfi.Name.Length-3);
  24.               //rename
  25.               try {
  26.               //  textBoxResults.Text += "from filename " + tmpfi.FullName + " to " +newFileName;
  27.                 tmpfi.MoveTo(newFileName);
  28.               } catch (IOException ioex) {
  29.                 throw new ZipException("can’t move file; extracted file not found " + ioex.Message);
  30.               }
  31.               textBoxResults.Text +=  ze.Name + " (renamed to " + newFileName + ") ";
  32.               break; //break iteration after first valid zip entry. for now we only want the first one..
  33.             }
  34.           }
  35.           textBoxResults.Text += "..done :) "+ Environment.NewLine;
  36.         } catch(ZipException zex) {
  37.           textBoxResults.Text += "..failed :( ERROR CAUSE: " + zex.Message + Environment.NewLine;
  38.         }
  39.        
  40.       }
  41.  

To summarize I use the following components (not noting gui stuff):
* DirectoryInfo – read/modify directory data
* FileInfo – read/modify file data (not content)
* ZipFile – a zip file representation and functions.
* ZipEntry – a file or folder in a ZipFile.
* FastZip – easy to use utility to ie extract files from zip.

Also note the use of Environment.NewLine to create correct newline/carriage return (std \n\r) in a string. … I tried to use escape style but that seems not to be valid..

Go ahead and download full source code including my sharpdevelop project file attached to this post as zip archive. MultiZipExtractor source codes

Note that to use the ziplibrary you need to add the compiled version as a reference. In sharpdevelop that’s done by selecting the project tab to the left, and right click on references in your project. Browse the dll file and add it. Then just add an extra use line in you code.

Editing Typo3 templates and constants localy

Thursday, September 28th, 2006

I found a great way of editing my typo3 templates. JEdit (the incredibly flexible java based code editor found at jedit.org) has a plugin for Typo3 which gives you direct access to constants and templates thruout the entire site structure.

Requirements/parts:
jEdit installed with Typo3 plugin
Typo3 version 3.8> (known to work up to 4.0.1)
xml support in PHP
Typo3 extensions: xmlrpc_lib and jeditvfs.

The following steps helps you set up the environment correctly:

1) Install xmlrpc_lib and jeditvfs to Typo3 with Typo3 extension manager.
It should work out of the box, but you can, if you like to, add some custom TS settings:

  1.  
  2. jeditpage = PAGE
  3. jeditpage.typeNum = 761
  4. jeditpage.config {
  5.         no_cache = 1
  6.         pageGenScript=EXT:jeditvfs/server.php
  7.         admPanel = 0
  8. }
  9.  

2) download and install jEdit from
jedit.org

3) Start jEdit and go to menu Plugins -> Plugin manager and then the install tab. Check TypoScript for Typo3 and install.

4) Now add a new Typo3 site. Close the Plugins manager and go to menu Plugins -> Plugin options. Select TypoScript and then the + button to add a new site.

5) Close the Plugin options window and go to menu Plugins -> TypoScript for Typo3 -> Template browser. Double click on your website name and voila – your in the game!