Quantcast
Channel: Software Salad
Browsing all 21 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Extended the YUI Compressor Tool

I extended the YUI compressor tool to have the ability to remove global namespaces from your javascripts. Check it out here! Posted in General, News, Web Programming Tagged: compressor, debug,...

View Article


Image may be NSFW.
Clik here to view.

Enlightenment 17 (Window manager+) for Ubuntu (8.04 LTS)

You can get enlightenment 16 via the synaptic package manager – since its the latest stable version. It’s actually quite a bit old, I had a play round with it and didn’t like it that much. You want...

View Article


Image may be NSFW.
Clik here to view.

Retrieving Inherited CSS Styles with DOM

If you need to get a CSS style from an element in a document, you cannot just test the style of the element directly. That is: Element.style.nameOfStyle won’t work. Take this example: <p...

View Article

Image may be NSFW.
Clik here to view.

Accessing the System Clipboard with JavaScript – A Holy Grail?

I am developing an API written in JavaScript for a project which requires the ability to copy data to, and retrieve data from, a clipboard within a web browser. A simple/common problem definition – but...

View Article

Image may be NSFW.
Clik here to view.

Webkit clipboard security hole

While on a search for accessing the System clipboard via JavaScript, it seems I discovered a security hole in Webkit. Usually system clipboard access is restricted in clipboard events like oncopy and...

View Article


Image may be NSFW.
Clik here to view.

IE’s cloneNode doesn’t actually clone!

When you want to deeply clone a node you use the cloneNode(true) method on the element you want to clone (see w3′s DOM Level 2 specifications) IE Cant even clone I found that IE’s cloneNode method is...

View Article

Image may be NSFW.
Clik here to view.

IE Whitespace madness

Internet Explorer’s DOM has a few issues regarding whitespace. Whitespace symbols in HTML 4.01 are any of the following symbols: ASCII space (&#x20;) ASCII tab (&#x09;) ASCII form feed...

View Article

Image may be NSFW.
Clik here to view.

A Simple Javascript Model-View-Controller API

Model-View-Controller is such a useful and powerful design pattern. You can use MVC for more than just physical views (i.e. GUI’s), but abstract views as well (e.g. pure data structures). You can even...

View Article


Image may be NSFW.
Clik here to view.

Inferring the Locale text direction with Javascript

Here’s a hack to detect which is the locale text direction (e.g. left-to-right for English or right-to-left for Hebrew) using JavaScript: /** * Detects locale text direction... * @return {String} "ltr"...

View Article


Image may be NSFW.
Clik here to view.

First public release of the Seaweed Plugin

In the past year I have been developing a JavaScript API called “Seaweed” (The seamless web editor – see http://seaweed-editor.com) for my masters project at the University of Waikato. The API allows...

View Article

Image may be NSFW.
Clik here to view.

Programming Praxis – Coin Change, Part 1, C# Solutions

This post presents C# solutions to a coin change problem as described in http://programmingpraxis.com/2013/05/17/coin-change-part-1. It is a classic problem from computer science to determine the...

View Article

Image may be NSFW.
Clik here to view.

Find the character position using javaScript: FAST, BIG pages, ALL browsers,...

During my masters year at University, I set out to experiment with a modeless editing model. I decided to use the web at my content environment: the challenge became to making the web editable. I did,...

View Article

Image may be NSFW.
Clik here to view.

Programming Praxies – Egyptian Fractions, C# solution.

This post presents C# solutions to a coin change problem as described in http://programmingpraxis.com/2013/06/04/egyptian-fractions. An Egyptian fraction was written as a sum of unit fractions, meaning...

View Article


Image may be NSFW.
Clik here to view.

Non-blocking Writer Collection (C# Example)

A question was posed to me recently: If you had a thread that produced messages, and pushed those messages one or more consumer threads: how would you write the code to ensure that the producer thread...

View Article

Image may be NSFW.
Clik here to view.

A reflection on code reflection: where it helps, and where it hinders.

Today at work I broke some of my team project’s unit tests from a seemingly harmless code change (C#). I simply changed a protected member into an auto-property. Unfortunately the code change was...

View Article


Image may be NSFW.
Clik here to view.

Programming Praxies – Finding Digit Strings In Powers Of Two

Today’s boredom lead me to solving another programming praxies problem: Search every power of two below 210000 and return the index of the first power of two in which a target string appears. For...

View Article

Image may be NSFW.
Clik here to view.

XML Serialization for interfaces in .NET

In your quest to find out how you can support XML serialization for types that contain interfaces, you may often find yourself coming to the same answer: you cannot serialize interfaces. That is true,...

View Article


Image may be NSFW.
Clik here to view.

Augmented Interval Tree in C#

Interval trees are an efficient ADT for storing and searching intervals. It is an ADT that probably doesn’t make the top 10 most commonly used collections in computer science. I often see code where a...

View Article

Image may be NSFW.
Clik here to view.

Helpful Tips for your Raspberry Pi Media Centre. Part 1: Hardware

It was about time I geeked it up and setup a DIY media centre for my home. I decided to go for the cheap and cheerful hardware option to power my media centre: Raspberry Pi. Only £25 (for the actual...

View Article

Image may be NSFW.
Clik here to view.

Reservoir Sampling

Reservoir sampling is a great random sampling algorithm every data engineer should know. It’s an algorithm for extracting a random sample of a specified size, over a large unbounded dataset. The data...

View Article
Browsing all 21 articles
Browse latest View live