It seems to me that I have come across a few people (if you’re reading this its probably not you I’m talking about) that have learnt a programming language without actually knowing when the language reference manuals are for that language.
Continue Reading »
I’ve decided that since my two latest gravatars (one of which is pending rating) have been sourced from other peoples pictures I should make my gravatars available should anyone else wish to use them:
This work is licensed under a Creative Commons License.
Note: This has been written retrospectively.
I started bell ringing today. It was my turn to take my nephew, Tor, along for his lesson and whilst I was there I ahd a quick go.
I only got as far as ringing the back stroke… but its only my first go so I can’t expect too much.
I’m currently using VB.NET as my main language because thats what my project at work requires. But having come from programming in VB6 I was just wondering if I’m using some of the old VB6 constructs and functions just because they are still there or because they really are the best way of doing things in VB.NET.
Continue Reading »
This is a very rough and read initial release of a little code tester I have written for VB.NET in VB.NET.
The idea of this tool is to allow programmers to be able to test little snippets of code they find on the internet without having to fire up a copy of Microsoft Visual Studio or SharpDevelop.
The current list of features provided:
- Syntax highlighting
- Textbox output area
- Listbox output area
- User defined linked assemblies
- Dynamic compilation (error identification)
- Output of execution exceptions
This is only a few of the features and as I get the chance to work on the tool I’m sure I’ll be adding a few more. The current incarnation of the CodeTester is already very flexible, I’ve even been able to create a working cut-down version of the CodeTester within itself.
Because CodeTester is written in VB.NET I haven’t bothered to package it in an installer. All you have to do is extract the zip file and so long as you have got .NET Framework 1.1 installed on your machine it should run. Please note that I have only tested this under Windows XP and I make no promise that it will run under any other OS (although it should). I have also come across issues whereby the dynamic compilation stops work for no apparent reason, and because the code you write is able to access the main form (for result output) it is possible to very easily crash the whole program.
I shall (when I have the time) post some code snippets for you to try out, or you could head over to the Code Project and try some of the code from that site.
I’ve been playing around with a couple of ideas for nifty little tools that I might release as freeware tools. One of them is a replacement for a tool which I have previously release and the other is something completely new for me.
Confused? I hope so, because I’ve been confusing myself a lot recently and I wouldn’t want you too feel left out
[Listening to: Girls And Boys - Blur - (4:18)]
It appears that the news of Norway increasing its speeding fines has made it into the international papers.
From February the already astronomical speeding fines will be hiked up a further 30% to 7,800 kroner (£660).
Not that I’m planning to speed. But then I neveer planned to speed in Guernsey… but these things occasionally happen.
This is a little code snippet that will allow you to play wav files that are embedded in your VB.NET exe. This code is based on a C# class by Peter A. Bromberg that I found on this page.
I had to do a little reworking to get it to play with VB.NET. ANd my VB code probably isn’t the neatest way that it could be done… but it works.
Public Class Sound
Private Shared SND_ASYNC As Integer = 1
Private Shared SND_MEMORY As Integer = 4
Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As Byte(), ByVal hModule As Integer, ByVal dwFlags As Integer) As Integer
Public Shared Sub PlayWavResource(ByVal wav As String)
' get the namespace
Dim strNameSpace As String = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name.ToString()
' get the resource into a stream
Dim resourceStream As Stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(strNameSpace + "." + wav)
If resourceStream Is Nothing Then Exit Sub
' bring stream into a byte array
Dim wavData As Byte()
resourceStream.Read(wavData, 0, CInt(resourceStream.Length))
' play the resource
PlaySound(wavData, 0, SND_ASYNC Or SND_MEMORY)
do to user this code is create a new VB.NET class file and paste this code in. When you want to play a wav you must include the wav file in your project as an embedded resource and use the following (replacing the name of the wav file to be played):
Please note that the Sound class must be in the same assembly as the the wav file.
Update: Please copy the source code and paste it into a texteditor to read it as the code has been broken onto multiple lines on this page by my blog stylesheet.
Update 2: Yes I know its got the same comments as the page I referenced above. Give me a break, its 8pm on a Friday and I’m still at work. What more do you want? For me to translate the bible into Haxxor?
Update 3: I’ve just corrected a couple of errors in the above code (removed a > and removed an extra End If)