Tuesday, July 7, 2009

First recording with audacity underway!

So, I have decided to start recording some of my music. I am using Audacity atm until either A) I hit a brick wall with it and can no longer use it or B) I finish this song.

It is kind of Tool/NIN-y, so it isn't really the music _everyone_ likes.

Just the intro to the song for the time being, haven't gotten the whole thing worked out yet... It's about 3 minutes long (calculations tell me the whole song should be about 10 minute slong total when I am done).
http://files.volatileminds.net/nothing_intro.mp3

Criticisms and comments are much appreciated! /me looks at jono.

Saturday, June 6, 2009

Man, I love my internet....


the internet in my apt.

Friday, June 5, 2009

Looking for a job in germany....

Hello Planet, I am hoping you can help me!

I am currently looking for a new job. I have always wanted to live and work in Germany. I know people in Germany read the planet, so maybe, if anyone out there in Deutschland is looking for a .NET programmer/Systems Administrator/All around computer tech guy and is willing to sponsor a work visa, let me know in the comments or email me at bperry.volatile[at]gmail[dot]com and I will get you a resume.

I have managed Linux and Windows servers for the past three years, written .NET professionally for about one and a half years, and have excellent recommendations!

Thanks a bunch!

Monday, June 1, 2009

Running SQL scripts in order from C# code

I have a folder of SQL scripts being compiled as embedded resources. They are named as such:

01 FirstTable.sql
02 SecondTable.sql
etc...

so that way I can run them in the order they need to be run in when say, resetting a database. The problem I ran into was getting the resources through reflection gave them to me in the wrong order... the second script was trying to be run first and it relies on the first script, so that obviously didn't work. Running Array.Sort() on the script list fixed this problem. The code ended up looking like:


public void Reset()
{
if (string.IsNullOrEmpty(ConnectionString) && Connection == null)
throw new Exception("Connection string and connection are null.");
else
{
if (Connection == null)
Connection = new MySqlConnection(ConnectionString);

Connection.Open();

MySqlCommand cmd = new MySqlCommand();
cmd.CommandText = "DROP DATABASE SystemsLogica; CREATE DATABASE SystemsLogica; USE SystemsLogica;";
cmd.CommandType = System.Data.CommandType.Text;
cmd.Connection = Connection;

cmd.ExecuteNonQuery();

Assembly asm = Assembly.GetExecutingAssembly();

string[] scripts = asm.GetManifestResourceNames();
Array.Sort(scripts);

foreach (string file in scripts)
{
Stream res = asm.GetManifestResourceStream(file);
byte[] resbytes = new byte[res.Length];

res.Read(resbytes, 0, (int)res.Length);

Console.WriteLine(file);
Console.WriteLine("-----------------");
Console.WriteLine(Encoding.ASCII.GetString(resbytes));
Console.Write("\n\n\n");


using (cmd = new MySqlCommand())
{
cmd.CommandText = Encoding.ASCII.GetString(resbytes);
cmd.CommandType = System.Data.CommandType.Text;
cmd.Connection = Connection;

cmd.ExecuteNonQuery();
}

}

Connection.Close();
}
}


This works great in mono. This was just a test method, so there is no real error checking, so be careful.

Tuesday, May 5, 2009

2 things

Reset mac password without CD:

[Apple|Super]-S after chime
mount -uw /
rm /var/db/.AppleSetupDone
shutdown -h now

Office 2003 source doesn't match installation source.

Uninstall from the setup binary on the CD.
Go to Control Panel -> Add/Remove programs -> Remove Office 2003. For some reason, it isn't removed from this list. this causes many headaches later and took me a few hours to figure out.
Reinstall from CD.

Wednesday, April 22, 2009

Gdk.Color -> HTML hex string

String.Format("#{0:X2}{1:X2}{2:X2}", (byte)(colorSelector.CurrentColor.Red >> 8), (byte)(colorSelector.CurrentColor.Green >> 8), (byte)(colorSelector.CurrentColor.Blue >> 8));


or a better way:

currentEntry.Text = String.Format("#{0:X2}{1:X2}{2:X2}", (int)Math.Truncate(colorSelector.CurrentColor.Red / 256.00), (int)Math.Truncate(colorSelector.CurrentColor.Green / 256.00), (int)Math.Truncate(colorSelector.CurrentColor.Blue / 256.00));

Monday, January 19, 2009

Can you spot the bug?