labs.insert-title.com

Latest Posts

Need to Test

Is Stringbuilder faster than Array/Stack join?

which is faster? Relative or Absolute paths for images in CSS?

VB.NET, Second Class Citizen?

I am determined that I can help make VB.NET a first class language again. Not quite ready for release, the image below is from a framework I am working on.

Update: 01/18/2011 -- It might be blasphemy, but I started www.vbsharp.com

FFMPEG scripts

Make sure you always have the latest ffmpeg release.

mp3+jpg to flv

ffmpeg -loop_input -i picture.jpg -i audio.mp3 -shortest -acodec copy movie.flv

Split, but don't re-encode

ffmpeg -ss 0 -t 600 -i InputVideo.m4v -acodec copy -vcodec copy OutputVideo.m4v

This would create a video of the first 10 minutes of a video. From -ss 0 seconds to -t 600 seconds

Round Robin Scheduler

A Round Robin Tournament is a series of games or events in which each team plays each other the same number of times. Creating a round robin schedule is something many a volunteer scheduler has learned is not as simple as it sounds. This is a pure javascript version of a component in a full league scheduling software I have been developing. Just enter the number of teams and hit submit.

Source:

 /*!
 * JavaScript Round Robin Generator
 * http://insert-title.com/
 *
 * Copyright 2010, Joe Maddalone
 * Dual licensed under the MIT or GPL Version 2 licenses.
 *
 */ 
 
 function  RoundRobin(teams) {
     var  i;
     var  ret = "" ;
     var  round;
     var  numplayers = 0;
     numplayers = parseInt(teams) + parseInt(teams % 2);
     numplayers = parseInt(numplayers);
     var  a = new  Array(numplayers - 1);
     var  alength = a.length;
     for  (var  x = 0; x < (numplayers); x++) { a[x] = "Team "  + (x + 1); }
     if  (numplayers != parseInt(teams)) { a[alength] = "BYE" ; }
     var  pos;
     var  pos2;
     ret = "----- ROUND #1-----<br />" 
     for  (var  r1a = 0; r1a < (numplayers / 2); r1a++) {
         ret += a[r1a] + " vs. "  + a[alength - r1a] + "<br />" 
     }
     for  (round = 2; round < alength + 1; round++) {
         ret += "<br /><br />----- ROUND #"  + round + "-----<br />" 
         ret += a[0] + " vs. "  + a[alength - (round - 1)] + "<br />" 
 
         for  (i = 2; i < (numplayers / 2) + 1; i++) {
             pos = (i + (round - 2))
             if  (pos >= alength) { pos = ((alength - pos)) * -1 }
             else 
             { pos = (i + (round - 2)) }
 
             pos2 = (pos - (round - 2)) - round
             if  (pos2 > 0) {
                 pos2 = (alength - pos2) * -1
             }
 
             if  (pos2 < (alength * -1)) {
                 pos2 += alength
             }
             ret += a[(alength + pos2)]
             ret += " vs. "  + a[(alength - pos)] + "<br />" 
         }
     }
     return  ret
 }
 

MP4 Moov Atom Application

Tired of all the ffmpeg mp4box command line stuff I wrote this little app.

Repositions the Moov Atom in your H.264 Video files so they will do a proper Progressive Download in Flash. .Net framework required, no installation.

download

Guest LAMP VM on Windows in 3 minutes

3 minutes, sort of...

Creating a guest LAMP VM server with a shared drive and mysql server to windows host. Pause as needed, I might actually write out instructions later.

TextFill.js

Partially because I am tired of lipsum.com and could not find a clean alternative to it that didn't require some sort of software plugin I decided to write my own lorem ipsum generator. Then I made a website version of the VB application that I had written, then I made a public API for it.

The public facing generation tool can be found here

The API implementation can be found here

An example of the api call below:

Run this example: fillhtml('mycontent',3,true)

this div's id is "mycontent"

Lorem Ipsum Generator

Habitual Wheel-Reinvention continues as I create a lorem ipsum generator for myself. No installation, .NET required.

Lorem Ipsum Generator
Download
Comments temporarily disabled for now, you can find me @joemaddalone