Monday, August 28, 2006

[Software] Bencoding - Deciphering Torrent Files

Most torrent files are encoded using a method called BEncoding, I had trouble finding a .net version of the decoder, so I ended up writing my own.

You can download this here: BEncoding.dll.

Although it will decode a BEncoded file (ie. torrent file), it cannot create one (maybe another time).

This project is in no way complete, and still needs exception handling for the "Path" property and other areas

Code Example:

  • string filename = "afile.torrent";
    Bencoding.Decode bencodedfile = new Bencoding.Decode(filename);
    Bencoding.DebugDictionary db = new Bencoding.DebugDictionary(bencodedfile.Dictionary);

    Response.Write ( "/info/name = " + bencodedfile.get_Path("/info/name").toString());
    Response.Write ( "\n\n");

    // next section likely to cause an exception if used with a Single File Mode Torrent file

    Response.Write ( "/info/files/0/path/0 = " + bencodedfile.get_Path("/info/files/0/path/0").toString());
    Response.Write ( "\n\n");
    Response.Write ( "/info/files/1/path/0 = " + bencodedfile.get_Path("/info/files/1/path/0").toString());
    Response.Write ( "\n\n");

    Response.Write (db.toString);



Basic Documentation:
Constructor:

  • Bencoding.Decode dict = new Bencoding.Decode(actualFilePath);
  • Open and processes "actualFilePath"

    Property:
    Dictionary
  • return a Bencoding.Dictionary - basically an modified arraylist
  • example: dict.Dictionary - returns the Bencoding.Dictionary object ( if you wish to interogate the file in depth)

    Path
  • returns object within the dictionary based on a path
  • example: dict.Path("/info/name") - returns the Filename or Directory of the Torrent
  • example: dict.Path("/info/files/0/path/0") - returns the first filename in a multi file mode torrent

Wednesday, August 23, 2006

[Agency] What to charge for Web Development?

There are four elements that go into a price: time, materials, overhead and
mark-up. I think it will be easiest to look at each of these in reverse order.
Note that these elements are for your own use only

Vince Barnes make it clear in this article at HTMLGoodies.com

http://www.htmlgoodies.com/beyond/webmaster/article.php/3577016

Sunday, August 20, 2006

[Environment] Could Steorn have broken the law...

It appears that Steorn ( an Irish based company ) may have broken the first law of physics, the 'Principle of the Conservation of Energy' - basically 'energy can neither be created nor destroyed, it can only change form'.

In the attempt to develop a more efficient micro generator, They may have created a generator that is over 100% efficient in effect "Free Energy".

"We have developed a technology that can replace traditional energy sources" :
Steorn

Steorn has challenged the scientific community to either validate or refute it's findings.

Links: Video, Steorn website

Saturday, August 19, 2006

[Systems Administration] Free Website Analysis

I use Webtrends, Log Analyser Pro and other web traffic analysis applications for client sites. Some of these are very powerful, others fast, and others yet simple to use and/or install.

Now along comes Google with Google Analytics (www.google.com/analytics), and for the site with small /medium traffic flow, this blows most of these applications out of the water.

It's FREE, simple to setup, does everything I normally require Webtrends to do.

What is Google Analytics?
Google Analytics shows you how people found your site, how they explored it, and
how you can enhance their visitor experience. Improve your website return on
investment, increase conversions, and make more money on the web.

With
over 80 reports, your free Google Analytics account will track visitors through
your site, and will keep track of the performance of your marketing campaigns -
whether they're AdWords campaigns, email campaigns, or any other advertising
program. With this information, you'll know which keywords are really working,
which ad text is the most effective, and where your visitors are dropping off
during the conversion process. Don't be fooled by the fact that this
functionality is available to you for free - Google Analytics is a
full-featured, powerful analytics package




How much does Google Analytics cost?
Google Analytics is absolutely free! We are very pleased to be able to offer
this web analytics solution for no charge, allowing anyone with a website to
track conversion data, analyse the flow of visitors through their site and
identify elements of their site that could be changed to improve visitor
retention.

This free version is limited to 5 million page views a month,
however users with an active Google AdWords account are given unlimited page
view tracking.

Thursday, August 17, 2006

Keep in touch!

I came across this, the other day as part of a joke email:

"Soooo... Sometimes, we wonder why friends keep forwarding jokes to us without writing a word. Maybe this will explain. When you are very busy, but still want to keep in touch, guess what you do? You forward jokes. When you have nothing to say, but still want to keep contact, you forward jokes. When you have something to say, but don't know what, and don't know how, you forward jokes. Also to let you know that you are still remembered, you are still important, you are still loved, you are still cared for, guess what you get? A forwarded joke. "

I've alway been against the idea of forwarding jokes willy nilly, but after reading the message above maybe this is a good reason for some one like me who doesn't alway keep in contact with friends, not sending jokes willy nilly but the odd joke here or there.

Saturday, August 12, 2006

[Development] Design Patterns

A design pattern is a general repeatable solution to a commonly-occurring problem in software design. A design pattern is a description or template for how to solve a problem that can be used in many different situations.

Design patterns can be classified in terms of the underlying problem they solve. Examples of problem-based pattern classifications include:

Fundamental Patterns

  • Delegation pattern - expresses certain behaviour but in reality delegates responsibility for implementing that behavior to an associated object
  • Functional design - Assures that each modular part of a computer program has only one responsibility
  • Interface pattern - see Bridge Pattern, Composite Pattern and Delegation Pattern
  • Proxy pattern - An object representing another object
  • Immutable pattern - An object whose state cannot be modified after it is created
  • Marker interface pattern - Exposes some underlying semantic property of the class that cannot be determined solely by the class' methods

Creational Patterns

  • Abstract Factory - Creates an instance of several families of classes
  • Builder - Separates object construction from its representation
  • Factory Method - Creates an instance of several derived classes
  • Lazy initialization - delaying the creation of an object or some other expensive process until the first time it is needed
  • Prototype - A fully initialized instance to be copied or cloned
  • Singleton - A class of which only a single instance can exist

Structural Patterns

  • Adapter - Match interfaces of different classes
  • Aggregate - a version of the Composite pattern with methods for aggregation of children
  • Bridge - Separates an object's interface from its implementation
  • Composite - A tree structure of simple and composite objects
  • Container - create objects for the sole purpose of holding other objects and managing them
  • Decorator - Add responsibilities to objects dynamically
  • Extensibility - aka. Framework - hide complex code behind a simple interface
  • Facade - A single class that represents an entire subsystem
  • Flyweight - A fine-grained instance used for efficient sharing
  • Proxy - An object representing another object
  • Pipes and Filters - a chain of processes where the output of each process is the input of the next
  • Private class data - restrict accessor/mutator access

Behavioral Patterns

  • Chain of Resp. - A way of passing a request between a chain of objects
  • Command - Encapsulate a command request as an object
  • Event -
  • Interpreter - A way to include language elements in a program
  • Iterator - Sequentially access the elements of a collection
  • Mediator - Defines simplified communication between classes
  • Memento - Capture and restore an object's internal state
  • Observer - A way of notifying change to a number of classes
  • State - Alter an object's behavior when its state changes
  • Strategy - Encapsulates an algorithm inside a class
  • Template Method - Defer the exact steps of an algorithm to a subclass
  • Visitor - Defines a new operation to a class without change
  • Single-serving Visitor -
  • Hierarchical Visitor -

Tuesday, August 01, 2006

IE Min-Height missing

One of the thing that annoys me about Internet Explorer 4/5/6+, is the inability to specify a minimum or maximum height on an element, CSSplay offers one solution.

Will IE7 recify the problem?