See also: Heapify

Pages: 1 2 3 4 5 6 7 8 9 10 11

A Technical Introduction to Asterisk Gateway Interface (AGI)

Introduction

The Asterisk Gateway Interface, commonly referred to as AGI, is a language-independent API for processing calls. It allows programmers to write simple programs to manipulate and route calls on Asterisk servers in a simple, easy manner.

This article provides a technical introduction to the AGI, explaining how it works, how it can be used, where you can find API documentation, and even provides some basic code samples which demonstrate how to use the AGI. The intended audience is programmers, telephony enthusiasts, or IT people who want to learn more about adding functionality to their Asterisk PBX systems. This is not a full programming reference, and will not explain how to write AGI programs, it will merely teach you what the AGI provides and how to use it high-level.

...

Read more

There are no comments on this post.

My Regex Guide as a PDF

Part two of my regex guide was released as a shiney PDF. At the time I never created a PDF for part one. Sometime between then and now I created an updated PDF version of both, and they have been gathering metaphorical dust.

So, here is a PDF version of part 1, along with an updated version of part 2 (incorporating feedback form the comment section):

Remember: The guide isn't a guide on regex best practises; the examples used are purely to explain the regex syntax. I use examples like escaping MySQL parameters because this is something most programmers are familiar with - you should never use regex for this purpose outside a regex tutorial..

...

Read more

There are 2 comments on this post.

How many characters should you allocate for a string representation of any given integer in any given base

Once every while somebody asks how to calculate how many characters to allocate when building a string representation of an integer. This is actually a very easy problem.. when you know your maths.

The answer is simply to use logarithms!

floor(log10(number) + 1)

...

Read more

There are no comments on this post.

A caffine induced sense of humour? I surely hope not

Super serial!

import java.io.PrintWriter;
import java.io.Serializable;    
class Doug implements Serializable {
  public Doug(PrintWriter out) {
    out.println(getMood());
  }
  private static String getMood() {
    return ":-(";
  }
}
/*
 * __        ___   ___   __  ____   ___
 * \ \      / / | | \ \ / / / ___| / _ \
 *  \ \ /\ / /| |_| |\ V /  \___ \| | | |
 *   \ V  V / |  _  | | |    ___) | |_| |
 *    \_/\_/  |_| |_| |_|   |____/ \___/
 *
 *  ____  _____ ____  ___    _    _    ___
 * / ___|| ____|  _ \|_ _|  / \  | |  |__ \
 * \___ \|  _| | |_) || |  / _ \ | |    / /
 *  ___) | |___|  _ < | | / ___ \| |___|_|
 * |____/|_____|_| \_\___/_/   \_\_____(_)
 */

...

Read more

There are no comments on this post.

A Java WHOIS protocol implementation

This should all be quite self explanatory. I can't remember why I went ahead and implemented this in Java. I think I was just rusty and wanted some practice. What follows is an implementation of the WHOIS protocol used to get information about a record name (in this case specifically domain name records). The nature of the information is contact information, ownership rights, etc.

The full source code and documentation can be downloaded here. This includes the source package and documentation. Depends only on Java core packages (java.io, java.net, and java.util).

Let's start with the whois server pool (WhoisServerPool.java). This is a static map of top level domain names to the whois server that is responsible for maintaining information on domains with that top level domain name.

...

Read more

There are 6 comments on this post.

My Git

A few days back I ordered a copy of Scott Chacon's book: Pro Git, which I am really enjoying reading. Scott is an excellent writer, and really does justice to Git. I was reflecting on his enthusiasm, and thinking about my own. Here are my thoughts on Git, and my experience with it over the years.

I started using Git around 2 years ago when I saw a screencast discussing it online. What initially drew me to Git was that it was created by Linus (who was very enthusiastic about it), and that my previous experiences with version control systems (VCS) were horrible. Naturally, I wanted to give it a try, and get back to the best-practices way of doing things (using a VCS).

When I first learned about VCSs, pretty much everyone used SVN or CVS. When I researched them both, there was no doubt in my mind that SVN was clearly the most popular, and so that's what I decided to learn. I started using SVN for all of my code (most of it was hosted on Sourceforge at some point or another), and learned it well enough to push periodic updates to my projects and do basic collaboration with a few other people.

...

Read more

There are no comments on this post.

Performing a Denial of Service (DoS) Attack on a Phone Line

Intro

Denial of Service attacks are nothing new to people in the IT and computer security world. DoS attacks are a very simplistic form of attack which aim to flood the target (whether it be a computer, mobile device, or phone line) with traffic so that it cannot process legitimate traffic. While being simple simple to perform, DoS attacks are often difficult to defend against without significant downtime.

Today I'm going to show you how to perform a DoS attack on a phone line. This process is simple, quick to perform, and very illegal. Before we get started, I'd just like to remind you that this article is for educational purposes only! All the code I'm putting into this article is python, and should work on any system with python 2.4+.

...

Read more

There are 15 comments on this post.

Chained hashing implementation

This is my implementation of chained hashing using the hashlittle hash function from Robert Jenkins. This code is meant for educational purposes but should be good enough for normal use (if it's not, I would love to hear your constructive critism!). I have no doubt there are more optimised implementations out there.

Check it out on its project page

...

Read more

There are no comments on this post.

Lewis wins the first match of the neverfear corewar league

Our good friend Lewis (aka Nemmy) can hang his head high today as he won the first round of the neverfear corewar league (http://corewars.neverfear.org/) with his warrior "SourKraut" when it kicked the ass of my warrior, Sanguinity. I'll get you next time!

There are no comments on this post.

Cartoon prediction of Corewars Tournament

With the upcoming Core Wars Tournament looming, a small cartoon is in order!

Dont feel sorry, in a past life micmast ate imps for breakfast!

Core Wars is a programming game where programs called warriors face off in an epic battle to crash each other.

...

Read more

There are 2 comments on this post.

Pages: 1 2 3 4 5 6 7 8 9 10 11

RSS
Powered by Debian, Guinness, and excessive quantities of caffeine and sugar.