Archive for the ‘General’ Category

Free download software

Web Resizer has been given 5 Stars Award by soft82.com

Download From Soft82.com

There are two versions, Gigastudio and EXS24. I do not have the software, and therefore no benefit from these samples, but you have them maybe?

I should have read the following sentences but I did not. It is a large file. I just downloaded and got a little (actually just a little) disappointed. I expected that I got SoundFont (SF2) files. But they were not. Ha ha…

G-Town Church Sampling Project
http://www.clearbits.net/torrents/21-g-town-church-sampling-project

Recorded in his local church in Grebbestad, Sweden by music producer Tobias Marberger, this set of CC-licensed music samples (available in two separate torrents, with either the original .WAV files with separate EXS24 soft sampler patches, or as .GIG Gigastudio-formatted versions) should be invaluable to amateur and professional musicians alike – includes anvil, snare, wood stick, hihat, brushplate, bongos, piano, organ, mandolin, glockenspiel, flute, many other instruments.

Team Foundation Service is live! Up to 5 users are free, and for a limited time all use is free!

Go to http://tfs.visualstudio.com/.

I want to read, write (modify) and save Unicoded document with TMemo component in Delphi. And failed.
On the Internet, I had found a procedure to load Unicode files into TMemo, and it worked. But Unicoded string shows like this “???????” (without quotation marks). No, it didn’t work. It seems to be quite difficult to do so.

Here is the code I used. I named TMemo to “Doc”.
Be sure, it didn’t work!

procedure TForm1.LoadUnicodeFile(const filename: String; strings: TStrings);
  procedure SwapWideChars(p: PWideChar);
  begin
    while p^ <> #0000 Do
    begin
      p^ := WideChar(Swap(Word(p^)));
      Inc(p);
    end;
  end;
var
  ms: TMemoryStream;
  wc: WideChar;
  pWc: PWideChar;
begin
  ms:= TMemoryStream.Create;
  try
    ms.LoadFromFile(filename);
    ms.Seek(0, soFromend);
    wc := #0000;
    ms.Write(wc, sizeof(wc));
    pWC := ms.Memory;
    if pWc^ = #$FEFF then
    Inc(pWc)
    else if pWc^ = #$FFFE then
    begin
      SwapWideChars(pWc);
      Inc(pWc);
    end
    else
      ;
    strings.Text := WideChartoString(pWc);
  finally
    ms.free;
  end;
end;

// This function is necessary to validate the file.
function IsTextFileUnicode(const TextFilename: string): boolean;
var
  FS : TFileStream;
  w : word;
begin
  result := false;
  if FileExists(TextFilename) then
  begin
    FS := TFileStream.Create(TextFilename, fmOpenRead or fmShareDenyNone);
    try
      if FS.Read(w, SizeOf(w)) = SizeOf(w) then
        result := (w = $FEFF) or
      (w = $FFFE);
    finally
      FS.Free;
    end;
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
var OD: TOpenDialog;
begin
  Doc.Lines.Clear;
  OD := TOpenDialog.Create(Self);
  with OD do
  begin
    Filter := 'Text Files (*.txt)|*.txt';
    if Execute then
    begin
      if IsTextFileUnicode(FileName) then
         LoadUnicodeFile(FileName, Doc.Lines) // Load Unicoded text
      else
        Doc.Lines.LoadFromFile(FileName); // Load ANSI text
    end;
  end;
end;

Read the rest of this entry »

This blog has been updated to version 3.5. And works just fine.

Merry Christmas

Merry Christmas

Jingle Bells

There are many of them, but it is user friendly and easy to navigate. No weird popups and stuff. One of the best, I think.

http://www.fontsquirrel.com/

They say:

Free fonts have met their match. We know how hard it is to find quality freeware that is licensed for commercial work. We’ve done the hard work, hand-selecting these typefaces and presenting them in an easy-to-use format. Here are some of our favorites.

I have found something that is fun. I found it on YouTube.
Someone called “Hacker” have VB course on YouTube.

You move the green rectangle using the arrow keys. The red following the green. I felt it was funny.
He (called Hacker) using VisualStudio 2012, but it works just fine with VS 2008.

Follower

Follower AI

This is VisualBasic Code

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.Start()
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If PictureBox1.Left < PictureBox2.Left Then             PictureBox2.Left = PictureBox2.Left - 4         End If         If PictureBox1.Left > PictureBox2.Left Then
            PictureBox2.Left = PictureBox2.Left + 4
        End If
        If PictureBox1.Top < PictureBox2.Top Then             PictureBox2.Top = PictureBox2.Top - 4         End If         If PictureBox1.Top > PictureBox2.Top Then
            PictureBox2.Top = PictureBox2.Top + 4
        End If
    End Sub

    Private Sub Form1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
        If e.KeyCode = Keys.Left Then
            PictureBox1.Left = PictureBox1.Left - 4
        End If
        If e.KeyCode = Keys.Up Then
            PictureBox1.Top = PictureBox1.Top - 4
        End If
        If e.KeyCode = Keys.Down Then
            PictureBox1.Top = PictureBox1.Top + 4
        End If
        If e.KeyCode = Keys.Right Then
            PictureBox1.Left = PictureBox1.Left + 4
        End If
    End Sub
End Class

And CSharp

namespace Follower_AI_Sharp
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            timer1.Start();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            if (pictureBox1.Left < pictureBox2.Left)                 pictureBox2.Left = pictureBox2.Left - 4;             if (pictureBox1.Left > pictureBox2.Left)
                pictureBox2.Left = pictureBox2.Left + 4;
            if (pictureBox1.Top < pictureBox2.Top)                 pictureBox2.Top = pictureBox2.Top - 4;             if (pictureBox1.Top > pictureBox2.Top)
                pictureBox2.Top = pictureBox2.Top + 4;

        }

        private void Form1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Left)
                pictureBox1.Left = pictureBox1.Left - 4;
            if (e.KeyCode == Keys.Right)
                pictureBox1.Left = pictureBox1.Left + 4;
            if (e.KeyCode == Keys.Up)
                pictureBox1.Top = pictureBox1.Top - 4;
            if (e.KeyCode == Keys.Down)
                pictureBox1.Top = pictureBox1.Top + 4;
        }
    }
}

I had been looking for C# source code that can be used to learn. Something simple program I wanted. Also I’m interested in images and graphics, I want to have something like that.
Luckily, I found the source code but Visual Basic .Net. And there was something wrong with the code and I could not compile it. It was done by the older version of Visual Studio and it works fine with it, I think. But not with mine (Visual Studio 2008). Since I don’t speak VB.Net, it was a big problem. But I’ve found a good translator on the Internet. There you can translate different languages as well.

http://www.developerfusion.com/tools/convert/vb-to-csharp/

It is so clean, nice and simple.

ResizeBatchImage

Resize Batch Image

Finally I could make graphics resizer with C#. It works, but not correctly. The height and the width looks strange. Distorted. Apparently I did something wrong, but where? I do not know. I had been working on the problem, but I did not find the solution. So I ended up with this.
It did not work and it is absolutely not author’s fault but mine.

Finally!
It did not take 48 hours, but 26 hours and almost everything works fine. Now you can download my MIDI files and software, but not the MP3 yet.