Archive for the ‘Web Development’ Category

A Secret Source for Great Free Icons for your Desktop and Web Apps

Wednesday, December 5th, 2007

Desktop and Web application needs icons. Icons make the app more usable than an all-text application. If you are building a desktop application, your framework may provide some stock icons. But if you are making a web application, you will need external icons.

I have seen a lot of pages that lists many icon sets…

But when I want some icons I have a better place to look.

KDE and Gnome Icon themes.

I prefer using these icons because of the following reasons…

Multiple Size Icons

Most themes provide the same icon in various sizes. The available sizes are 128×128, 64×64, 48×48, 32×32, 24×24, 22×22, 16×16 and sometimes even a scalable SVG set. Not all themes have all the sizes - but most have. I don’t have to tell you how useful this is.

Multiple Size Icons

Lots of Choice

KDE Look Icons page have 86 pages with 15 icon themes per page. That makes a total of 1290 icon sets. And I am not counting the Gnome Look Icons.

That’s a lot of choice. Granted, not all will be good. Not all will have the icon I am searching for. Not all have the size I way want. There will be some duplication. But its still a lot.

Free - in both sense of the word

Most of these icons uses GPL and LGPL licenses. So you can use if for your application without paying for them. You can modify them. You can share it with others. You can… you get the idea. The point is there are no restrictions.

Even if you are building a proprietary application, I think you can use the icons because you are not compiling it into the application. But I am not sure about that - if anyone reading this knows, please leave a comment.

I have to warn you that not all icons sets use these licenses - so make sure you look at the license of an icon set before using it.

Great Icons

Most of the icons are created by professional designers. Sure there are some duds among the collection - but the majority of them are good.

Some Recommended Icon Sets

Crystal Project

Crystal Project

Nuvola

Nuvola

Crystal Diamond

Crystal Diamond

black + white icons

Black White

Crystal Clear

Crystal Clear

And there are hundreds more for you to find out…

BarCamp Kerala 2007

Sunday, November 25th, 2007

Barcamp Kerala 2007

Yesterday I went to the first Kerala BarCamp. It was held at Techno Park, Trivandrum. I had to travel 225 kilometers to attend it - and it was totally worth it!

Sessions

Open Social

By Kenney Jacob

About the new OpenSocial API provided by Google. The talk was concentrated on its application on Orkut - as it is the most popular social networking site here.

Game Development in Ruby

By Vishnu Gopal

This session was about creating small 2D games in Ruby using the ‘Gosu’ library. You can get a small sample game he created for this session at N3wton Google Code

Presentation

Home Automation using Bluetooth

By Hari Krishnan

Using your mobile phone as an universal remote for all applications within your home.

Asterisk

By Bipin

Asterisk is a Open Source software PBX(Private branch exchange)

QT

By Dhaneesh and Dev

Using QT Designer to create GUI applications.

Computer Memory Based on Bacteriorhodopsin

By Jidhu

A new way of storing information - by changing the state of a protein. This is done by shining a different colour light on the protein. It is much faster and cheaper than the fastest RAMs available today. Also, it is non-volatile - so it can be as both the HardDisk and as the RAM. I found this the most interesting of all session.

Open Network Project

By Linoy Joseph

A implementation of a mesh style open network.

Android

by Renjith Ramachandran

Developing mobile application using the Android SDK provided by Google. The presentation showed us how to do it using Eclipse.

PHP Wiz

by Sreekanth G S

A small introduction to PHP and Web Application Development.

The People

The best part of the camp is the people you meet. I met a lot of people who I only knew only through the internet. Some of the people I met…

Until next time…

AGPL License

Tuesday, November 20th, 2007

License

AGPL or Affero General Public License Version is a new License released by FSF. This is aimed at Web Applications.

The GNU GPL allows people to modify the software they receive, and share those modified versions with others, as long as they make source available to the recipients when they do so. However, a user can modify the software and run the modified version on a network server without releasing it. Since use of the server does not imply that people can download a copy of the program, this means the modifications may never be released. Many programmers choose to use the GNU GPL to cultivate community development; if many of the modifications developed by the programs users are never released, this can be discouraging for them. The GNU AGPL addresses their concerns. The FSF recommends that people consider using the GNU AGPL for any software which will commonly be run over a network. (Emphasis mine)

Say I used AGPL for Nexty. You decide that it is a nice program - so you download it and use it. Then you make some changes to the code. So far so good.

Then you decide that you can put the modified version on your web server. The visitors can use the modified version of nexty - that is, you are not ‘distributing’ the software. If I used GPL, you could have gotten away with it - but if I use AGPL, you have to publish the code you modified as well.

The end result is that the end user is in a lot of confusion about what they should do with respect to the license. If they are not lawyers, they will not be able to understand what the license says. I have opted to use the BSD license due to factors like this - BSD license basically gives you the right to do anything with it - except claim that you wrote it.

Related Links

Creating PDF in Ruby on Rails - PDF::Writer

Monday, November 12th, 2007

PDF::Writer is my choice for creating PDF files in Ruby on Rails. Its simple, easy to use, and has all the features I am looking for.

Install PDF::Writer in Linux systems using this command…

gem install pdf-writer -y

Includes

We will require rubygems and pdf/writer.

require "rubygems"
require "pdf/writer"

The next line creates a new instance of PDF::Writer

pdf = PDF::Writer.new

Create a Heading(big font size)

pdf.select_font "Times-Roman"
pdf.text "Sample PDF Document", :font_size => 32, :justification => :center

The text function will add a string of text to the document, starting at the current position. It will wrap to keep within the margins - so you can specify text as big blocks. The text will go to the start of the next line when a return code “\n” is found.

The other arguments available for this function are…

:font_size
The font size to be used. If not specified, is either the last font size or the default font size of 12 points. Setting this value changes the current font_size.
:left
Gap to leave from the left margin
:right
Gap to leave from the right margin
:absolute_left
Absolute left position (overrides :left)
:absolute_right
Absolute right position (overrides :right)
:justification
This can be :left, :right, :center, :full
:leading
This defines the total height taken by the line, independent of the font height.
:spacing
Line spacing - usually set to one of 1, 1.5, 2 (line spacing as used in word processing)

Writing Text

pdf.text "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam sodales velit ac ante. Suspendisse felis mi, convallis at, semper id, malesuada eu, mauris. Integer orci. Sed consectetuer orci. In hac habitasse platea dictumst. Duis nec pede. Ut lacinia eros ut magna. Maecenas lectus dui, lacinia vel, porttitor a, fringilla nec, turpis. Nulla odio nisi, mattis ac, porttitor at, malesuada ac, nibh. Nam suscipit mi ut justo. Phasellus aliquam lorem non velit ornare bibendum. Nullam mollis. Ut elementum rutrum justo. Pellentesque ac sapien. In facilisis lorem a enim. Curabitur vitae felis. In eget tellus nec ligula egestas semper. Nulla facilisis urna nec magna. Pellentesque fringilla pulvinar risus. Aliquam rutrum, nisi ut lobortis consequat, nisl felis posuere risus, at sollicitudin nibh dui et felis.

Fusce tristique dapibus neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut felis mi, dictum ut, vehicula non, fermentum quis, elit. Quisque ultricies purus quis enim. Integer turpis elit, porttitor quis, volutpat consequat, interdum vitae, quam. Donec tempus, dolor eget bibendum euismod, metus dolor imperdiet purus, vitae nonummy est mi non orci. Aenean eu massa. Fusce euismod. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Nullam quis massa id sem commodo eleifend. Cras eu velit rutrum leo egestas adipiscing. Nulla volutpat, lectus sit amet sagittis gravida, erat tortor condimentum sem, vitae sollicitudin lectus diam eget felis. Aliquam augue. Vestibulum viverra est. Fusce tellus ligula, euismod sed, placerat vel, cursus dictum, erat.", :font_size => 12

I used the text() - but this time with 12 as the font_size. The long text will wrap around and the \n will be converted to line breaks.

Inserting Images

PDF::Writer provides an easy way to insert images…

pdf.image "default.png"

That’s it - it will insert an image called ‘default.png’. The other option are…

:pad
The number of PDF userspace units that will be on all sides of the image. The default is 5 units.
:width
The desired width of the image. The image will be resized to this width with the aspect ratio kept. If unspecified, the image’s natural width will be used.
:resize
How to resize the image, either :width (resizes the image to be as wide as the margins) or :full (resizes the image to be as large as possible). May be a numeric value, used as a multiplier for the image size (e.g., 0.5 will shrink the image to half-sized). If this and :width are unspecified, the image’s natural size will be used. Mutually exclusive with the :width option.
:justification
The placement of the image. May be :center, :right, or :left. Defaults to :left.
:border
The border options. No default border. If specified, must be either true, which uses the default border, or a Hash.

Tables

Inserting tables are slightly more complicated than the last two items. If you are using SimpleTable, you have to add
require "pdf/simpletable"
along with the other includes.

table = PDF::SimpleTable.new
table.title = "Sample Tables"
table.column_order.push(*%w(first second))

table.columns["first"] = PDF::SimpleTable::Column.new(”first”)
table.columns["first"].heading = “First”

table.columns["second"] = PDF::SimpleTable::Column.new(”second”)
table.columns["second"].heading = “Second”

table.show_lines    = :all
table.show_headings = true
table.orientation   = :center
table.position      = :center

data = [
	{"first"=> "1", "second"=> "2"}, # First row
	{"first"=> "One", "second"=> "Two"}, # Second row
	{"first"=> "Mono", "second"=> "Di"}, # Third row
]

table.data.replace data
table.render_on(pdf)

The above code will create a table with two column and three rows of data. The code should be easy to decipher - so I am not going into any more explanation.

Saving the PDF

Finally, saving the created PDF…

pdf.save_as("report.pdf") 

Links

Case Sensitivity in URLs

Wednesday, October 17th, 2007

I am an open source guy - so naturally I prefer the flagship OSS software Apache to the proprietary Microsoft IIS. But there is one area where IIS does a better job than Apache - the case sensitivity of URLs.

Are URLs Case Sensitive?

They should not be - but they sometimes are. Domain names are not case sensitive - for example http://www.apache.org/ and http://WWW.Apache.Org/ goes to the same location. But in the LAMP platform, the path is case sensitive…

But in the case of Microsoft IIS server, this is not true - try…

Reason: Linux Filesystem is Case Sensitive

The root cause of this is that the filesystem in the Linux OS is case sensitive - while FAT32/NTFS filesystems in Windows are not.

Dynamic URLs

Now Dynamic/friendly/clean URLs are appearing in many CMS tools. A good example for this is the ‘permalink structure’ in WordPress. These dynamic URLs could be case sensitive or not - it depends on the software. In WordPress they are case insensitive. Del.icio.us is also case insensitive. TinyURL is another service that uses case insensitive URLs. But it is possible for the tool to make the URLs case sensitive.

From the SEO perspective

If the search bot visits two urls say, example.com/MyWebPage/Index and example.com/mywebpage/index , will the bot index both page contents? If they are same, will one get the duplicate content penalty? Or will google just index the URL with lower case and ignore the other - remember, in Linux/Apache, both pages may have different content.

Conclusion

The RFC for URL says they must be case insensitive.

For resiliency, programs interpreting URLs should treat upper case letters as equivalent to lower case in scheme names (e.g., allow “HTTP” as well as “http”).

Apache must not use the filesystem as an excuse - I really hope they provide case insensitive URLs

Nexty, The Online Application

Wednesday, September 26th, 2007

Nexty Logo

I just released the latest version of Nexty - and to celebrate that, I am making Nexty an online application. That is, you can use Nexty from the web - without having to install it on your local system.

Of course, Nexty code is available as well - you can download and install it locally if you wish. In fact, I will recommend that you install it locally. That way, the application will be much faster than the online alternatives.

This happens to be my first online app. I have worked on many online projects before - but those were for various clients. This is the first online application that I have created for the use of others! I am working on anther online application - but by the look of things, it is not going to be over soon.

And thanks to Brad Nickel for suggesting this idea.

Finally! Nexty 1.01.A Released

Saturday, September 22nd, 2007

I have released Nexty 1.01.A. If you are a user of Nexty, I will recommend that you switch to the new version.

Changelog

Search
Search for tasks, projects and reminders
Next Action
Dedicated page for the next action - and only that
Inbox Feature
Add a lot of tasks in one go using the inbox
Linux Command Line
A script to control Nexty from the Linux command line.
Code uses iFrame
iFrame is my PHP framework
Bug Fixs
Too many to list
Better Installer
Will not overwrite the old data
Printing Support
Well, its better than before

To Learn more…

Seinfeld Calendar - Simple way to Force Yourself to Create Content Regularly

Sunday, September 16th, 2007

BinnyVA.com

I created an RSS aggregater for my site BinnyVA.com that aggregates the content from all my sites. The basic idea is to build a Seinfeld Calendar that will force me to continually publish posts - at least 1 per day.

It is very simple to create - whole system is contained in the following files…

fetcher.php

This will run once a day as a cron job. It downloads the feeds for all my sites, parses the XML and inserts the new posts into the database.

The download is done by my load PHP function. It uses the curl library.

The XML parsing uses the xml2array() PHP function. Currently I parse only the RSS format - I am completely ignoring the atom format.

Finally the data is inserted into the database - the following data is stored…

  • Title
  • Link
  • Date
  • Summary
  • Full Content
  • Categories/Tags

The full file is around 100 lines long.

index.php

This is a simple calendar scripts that lists all the posts of each days of one month. Includes a navigation to enable the visitor to go to the past months as well.

Other Files

There is a bit of mod_rewrite code that make sure that the URL are very clean. For example, the URL for April 2007 is http://www.binnyva.com/2007/04/.

The mod_rewrite for this is in the .htaccess file…


RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([0-9]+)/([0-9]+) index.php?year=$1&month=$2

Don’t Break the Chain

Now all you have to do is make sure that each day has at least one post in it. This system had me creating content continually for the last two months.

If you are looking for an easier way to create the calendar, try out Don’t break the chain.

LinDesk - Linux on the Desktop

Saturday, September 1st, 2007

LinDesk

I have a new blog - LinDesk. LinDesk concentrates on the use of Linux on the Desktop. I am trying to keep it distro agnostic - but there is a slight leaning towards Fedora - as it is the distro I am using. Also, you might find a disproportionate amount of articles about KDE.

Actually this blog has been around for some time. The first article appeared on April 8. But I did not announce it so that there can be a build up of articles before it goes public.

Take a look at LinDesk - and if you are a fan of the Linux operating system, subscribe.

Some Popular Posts

So what do you guys think of the new blog? Is it a good move? Or am I moving towards an early burnout?

Between Web Application and Desktop Applications

Sunday, August 26th, 2007

There is a distinct line between web application and desktop applications. But over the last few years, this line is becoming thinner. Due to faster internet connection and technologies like ajax, web applications are becoming much faster and more responsive. And, if you have a local web server installed, a ‘web’ application can become desktop application.

I have a web server(Apache), and a database server(MySQL) running at all times on my local system. Since LAMP is my preferred platform of development, if I need a new software, I will create it on LAMP. A good example of this is Nexty. Over time, I have discovered that web application can be used as desktop applications. All you need is a web server, a database server and a browser.

There must be some changes to the current model to make this system work. These are a few I could think of…

  • Web Server must run as the current user. That way, you can read/write to any file using PHP(or equivalent).
  • The application must not be available over the network. Or, the web server must only accept connections from 127.0.0.1
  • An installer for these kind of applications must be made.

Advantages

  • Familiarity: People are already used to web applications - so it will be easy to switch.
  • User Customizable: Users can change the appearance of the application(user stylesheets), and to a limited extent, the functionality(GreaseMonkey).
  • Open Source: If the code is in PHP or Ruby on Rails, or anything similar, the code will be available for study or even modification.
  • Cross Platform: The same program can be installed in Windows or Linux or whatever - as long as it has a Web server.

Disadvantages

  • Imaginary: As of yet no such system exists.
  • High Level: The system will not be able to do low level system operations.
  • Limited: There will be some very serious limitation to the application unless the current systems are modified. For example, the browser cannot read or write to the filesystem.

I have been using some web applications as desktop applications for a while now - these include WordPress(for keeping notes), activeCollab(project management), Nexty(to do list), and Tiker(time tracker).

Subscribe to Feed