Archive for the 'Software' Category

-image-WPF and MDI

Just been using Windows Presentation Foundation ( WPF ) to prototype an application that I am working on and althought Microsoft Expression Blend is a fantastic tool I am finding some frustrating limitations with WPF already. Chiefly amoung these is support for Multiple Document Interfaces or MDI.

I was hoping to create an interface where I could open and close windows within an application ala Photoshop, After Effects, Director or any application in the last 10 years to do with media creation but Microsoft have decided, in their infinite wisdom, that MDI is a no no. Now I don’t mind that Microsoft, Apple or Xerox Parc spend millions of dollars on interface design, further interface human interaction etc. But when the best method of interaction for using an application is disable I get a bit annoyed.

People do find Photoshop hard to use, but the interface to me really does serve its purpose. The problem with Photoshop is actually user education and understanding not the fact that it has multiple dragable windows. Its a hard application to get to grips with (I still find it amusing that users describe themselves as expert at it - those are the users that usually don’t understand it as an application, in fact I would say that anyone that hasn’t played with API doesn’t know photoshop, but hey that is another story..) and that is nothing to do with the interface just that the application has a lot of depth and many ways to do the same thing. While we are on the subject, any user that hasn’t paid the license fee and doesn’t spend hours a day in front of Photoshop can NOT be classed as an expert.

But it is really bugging me that Microsoft have decided that its legions of developers of its next GUI interface paradigm can not choose for themselves the method that they want users to interact with their application. They do not always know best - and there are many examples of this, and saying that there are better ways than using MDI is a chief example. The fact that if you are creating an interface in Visual Studio and want to use MDI is non-trival should speak volumes, but instead we are told to use tab views or a single document model.

What happens when I want users to be able to drag and drop multiple media types of different sources into an application window that they are working on? A tabbed interface doesn’t work in this situation, a single document window certainly doesn’t. How annoying. Thanks Microsoft. Perhaps I should make my application OS X based.


-image-Zussaweb now with Newzbin IDs

The modification I made to zussaweb the PHP frontend to HellaNZB is now available in sourceforge for downloaded as a 0.3 release.

They tidied it up abit, but I am glad it made it in after all the requests and emails that I got for this feature.

Now perhaps I should integrate a Newzbin RSS feed!!


-image-Firefox 2 is released

So firefox 2 the latest release from Mozilla is out to the public today, and so I am typing this to you from it.  I think its looking good, though I am not sure what it is doing to the padding on the backend of Wordpress.

I am really liking the built in spell checker.  Its a nice feature particularly when you spend a lot of time typing into websites.

Firefox2

Available from http://www.mozilla.com as always.


-image-django with apache2

One thing that I feel is harder than it should be with django is getting it working with Apache2. Sure the built in webserver is nice for development, but there comes a time when you need to step up and use a webserver for development that you can also deploy the site upon.

I have used Apache a lot in the past, but recently I have decided to move over to installing everything the Debian way, and this will reflect that. I am going to use python2.3, Apache2 and the version of mod_python that is in stable. You can follow the instructions if you have installed Apache2 and mod_python in otherways after this step if you wish.
To get Apache2 on debian with mod_python, simply:

  1. apt-get install apache2
  2. apt-get install libapache2-mod-python

For the rest of the tutorial, I am assuming that you have Django setup correctly, and working with your database. If not, I recommend installing the development version. It is easy to update using SVN and there are some features that are better than the stable version I find. Once you have done this you can start to build your site. From then on you can create your apache virtualhost file:

I have decided to run my django site on a different port, but of course you can run it on different ipaddresses, and with different hostheaders. All you need to do is follow the apache 2 documentation for this. I feel this is already well documented so I will just show how I did it by running on different ports:

  1. Edit the ports file for apache2 to tell it to listen on more than one port:
    vi /etc/apache2/ports.conf
  2. Add this line to tell it to listen on port 8000:
    Listen 8000
  3. Create a new sites file for this new virtual host:
    vi /etc/apache2/sites-available/djangosite
  4. Now we need to put in the configuration details:
    
    
    
    SetHandler mod_python
    PythonHandler django.core.handlers.modpython
    PythonPath “[’/home/tim/dev/projects/’] + sys.path”
    SetEnv DJANGO_SETTINGS_MODULE djangosite.settings
    PythonDebug On
    
    
    Alias /media “/var/www/djangosite/media”
    
    SetHandler None
    
    
    
    SetHandler None
    
    
    
    

    This gives us several things:

    • Sets up a virtualhost to listen on port 8000.
    • For the virtual host use mod_python.
    • PythonHandler is told to use Django.
    • Our PythonPath is updated with our site files, in my case my django projects are located in /home/tim/dev/projects/ so this is what I use. Point this to where your django files are kept.
    • Let django know to use the settings file for this project
    • The we setup an alias to serve the media files, as they don’t need to be served through mod_python we turn the handler off for the /media/ location. I will setup my media files in /var/www/djangosite/media
    • Finally tell apache2 not to use mod_python to serve image files.

  5. Now save this file, and enable the site:
    a2ensite djangosite
  6. Now create the webhosting directory, and the symbolic link for the admin directory, and check the permissions:
    mkdir /var/www/djangosite/
    CD /var/www/djangosite/
    ln -s /usr/lib/python2.3/site-packages/django/contrib/admin/media/
    chmod -R 755 /var/www/djangosite
    
  7. The stop and start apache2 on your server (this is for Debian using init.d scripts, but whatever you do stopping then starting is better than a simple reload).
    /etc/init.d/apache2 stop; /etc/init.d/apache2 start

Once you have done that, check your site by point a webbrowser to the the machine that you have apache2 running on, but at port 8000 for instance if it is a localhost, tryhttp://127.0.0.1:8000.

One thing that I haven’t talked about is where it is best to place all the files used in creating a django site, and I have yet to read any documentation about this. This is why in the above I am point it to a dev subdirectory from my home directory. I don’t think this is a good idea for a production site, and perhaps it should go in somewhere off /var.

One thing is for sure, creating seperate directories for media and the actual files is a good idea, and you if you follow the django instructions you can take them up on the recommendation of using a seperate lightweight webserver to just serve these files.


-image-hellahella on Apache 2

I have been using hellahella using paster serve and I must say the performance was terrible. I don’t think that it is mean’t to be run for any length of time which is at odds with hellahella, the web interface to hellanzb, which is.

I have documented before that I am using hellanzb to manage my nzb files, and hellahella makes it even easier and with integration with http://www.newzbin.com it is even better (how about one click downloads, unrar, par, and ready to view - yes I have it!)

So I wanted to run hellahella using Apache2 on my Debian box. Luckly just as I wanted to do this a new FAQ was put up on the Pylons web site on how to achieve this using mod_python (which I also wanted to use). Pylons is a web framework for python and it seems quite good too and I got alot of help from the very helpful pylons-discuss group on groups.google.com.
So I setup Apache2 or rather Debian did using apt-get, and I got a fairly normal install. If you haven’t used version2 of apache before the configuration has changed somewhat and all the config files are now split. At the same time I also installed mod_python using apt-get and as this is rather well documented I am not going to write it down here. Now all we need do is follow the first part of the instructions on the Pylons site:

  1. Install hellahella (I assume you are running hellanzb already otherwise go and download and install it) and make sure it works with paster serve hella.ini
  2. Make sure mod_python is installed and enabled.
  3. Save the http://projects.amor.org/misc/svn/modpython_gateway.py script as wsgi.py in your mod_python python directory which is /usr/lib/python2.3/site-packages/mod_python/ on my system.
  4. Create a project directory. I used /www/hellahella
  5. Create startup.py file in this directory with the following information:from paste.deploy import loadapp
    app = loadapp(”config:/www/hellahella/hella.ini”)
  6. Create a link to your hella.ini file: ln -s /etc/hella.ini hella.ini
  7. Go into your apache2 sites directory: CD /etc/apache2/sites-available/
  8. Create a new site: vi hellahellaSite
  9. And input the following information:

    VirtualHost 127.0.0.1
    ServerAdmin tim@timc3.com
    DocumentRoot /www/hellahella/
    SetHandler mod_python
    PythonHandler mod_python.wsgi
    PythonPath "['/www/hellahella/'] + sys.path"
    PythonOption wsgi.application startup::app
    PythonOption SCRIPT_NAME /
    ErrorLog /var/log/apache2/error.log
    Alias /stylesheets/ "/www/hellahellaMedia/stylesheets/"
    Alias /javascripts/ "/www/hellahellaMedia/javascripts/"
    Alias /images/ "/www/hellahellaMedia/images/"
    LogLevel warn
    CustomLog /var/log/apache2/access.log combined
    /VirtualHost
  10. Remember to change the ipaddress 127.0.0.1 to whatever ipaddress or domain name you need.
  11. The to a level above your doc root: CD /www
  12. Then create a link from the public media files for hellahella to a directory here: ln -s /usr/lib/python2.3/site-packages/hellahella-0.1dev_r782-py2.3.egg/hellahella/public
  13. Rename public: mv public hellahellaMedia
  14. You might need to chgrp and chown the files under this directory.
  15. Then enable this site: a2ensite hellahellaSite
  16. Restart apache2: /etc/init.d/apache2 stop; /etc/init.d/apache2 start
  17. Then test.
  18. And it should work aslong as hellanzb.py is running and hellahella is setup correctly.

And I must say it is looking good!


-image-Interesting Django video

Nice hour long video on Django, from a google presentation here:

http://video.google.com/videoplay?docid=-70449010942275062

Worth watching if you are thinking about getting in to the Django framework.


-image-django and python

At Vizrt there is alot of python, and although I wish I could have jumped on the bandwagon and started messing around more with Ruby, I am enjoying working with python where the scripts are properly authored.

So I was looking for a nice framework that would give me Rails style speed of prototyping web applications whilst using Python and after looking at the usual suspects (Turbogears, pylons, zope & plone) I am again playing around with Django again.

Django

Django is nice, not too heavy weight, seems flexible and uses the best parts of python - its go anywhere sensibilities coupled to only write things once, to a semi - MVC style of creation (well it has models and views - thats a start).

Its not quite as mature as Rails, but in these days of million user Beta & Gamma web applications thats hardly going to put anyone off, I can host it on Dreamhost with the help of the excellent tutorial from Jeff Croft here: http://www2.jeffcroft.com/2006/may/11/django-dreamhost/ (and his site is powered by Django, and is quite a stunning showcase).

I also like the fact in Django that it has a web admin interface plus a shell interface, that the web admin can be completely transformed and then rolled out into the application.

The only wonder that I had was whether I could build something using PostgreSQL (I much prefer using PostgreSQL, and have it on all my dev machines at home) and then publish it to Dreamhost and use MySQL.  There is one cmd,

manage.py syncdb

that setups the database access layer and looking at the examples if I don’t write any custom SQL statements then I might be able to get away with it.  I really wish Dreamhost would support PostgreSQL.

Django could also do with a nice webforum for support, but the IRC channel has many users on, and I take my hat off to them for supplying the code for the actual support website - Well done.  I suppose I will have to wait until some creates a forum - or maybe they could install vanilla.  Created by me old man Neven, and one of the nicest bits of forum software I have seen.

For a  quick overview of Django take a look at: http://www.djangoproject.com/documentation/overview/


-image-pop3 server for osx

I need a POP3 server for osx for testing an application that I am thinking of building. I would like it small as in lightweight, osx switch on/switch offable and with little dependancies. Anyone know of one?


-image-VMWare free version

Just read on the register that VMWare is going to offer a free version of its server product. There is no mention of this on their site yet unless they are talking about the VMWare Player which can be used to host VMware / Microsoft and Symantic virtual PC sessions.

VMware Logo

I am really interested to see where they go with this. For instance at home it would make for a really good test system and its a good competitor to Xen running on Linux.


-image-Joomla

Been messing around with Joomla, and so far I am really impressed. I must admit one of the features that I am looking forward to implementing is WordPress in Joomla - best of both worlds perhaps? I am not sure, as I haven’t installed it yet, but one of the resources I found interesting seems to have disappeared: a tutorial on setting up a Joomla template, luckily I have managed to rescue it out of googles cache.

I have posted the page here http://blog.timc3.com/setting-up-joomla/ and its probably copyright of compass.net so if there are any problems I will take it down, but being an extremely useful resource checkout their site.


Bad Behavior has blocked 674 access attempts in the last 7 days.