mypcia's ramblings

from geek's perspective

Subscribe to RSS feed

Posts tagged with "vb.net"

Internet Relay Chat (IRC) [VB.NET]

, , , ...

No, I don't like IM messengers in any kind, in fact I hate them. Why? Because their purpose should be just as it says: INSTANT MESSAGING. IMs usually have too much ads or are unpractical and ugly. Besides being painfully slow (usually), that's where IRC (Internet Relay Chat) comes in. IRC is fast, because you're directly connected to server. IRC doesn't need an unimaginable GUI and neither doesn't it need ads. In fact most servers have their own set of rules, starting with public servers and finishing on the private ones. Most of these state clearly: NO spamming or phishing. All you get are server messages and messages from the channels you join or people that PM you. You don't get anything you don't want to. All you send back are your messages or commands and PONG (server first sends you PING and waits for an replay, your IRC client should send PONG to inform server you're still connected, if you don't send PONG back the server will disconnect you).
People usually tend to say that IRC is for more advanced computer users where in fact anyone could use IRC. The myth of IRC being overly difficult makes it kind of repulsive to normal people.
So how to connect to IRC server and receive messages you ask? It's actually fairly easy you either download already written client or write one yourself. I've been playing with IRC all day yesterday. Read more to see how to connect and receive messages in console application in VB.NET.

Read more...

Random Class and how it's not really random [.NET]

, , ,

As we all know Random isn't really a random class. There IS an actual pattern which repeats itself quiet frequently if you look into it. If we wanted a really random draw of numbers we'd gave to use more complicated algorithm and only then we'd be able to draw a pseudo random sequence of numbers. To avoid writing complicated and slow algorithms we could use X-dimensional arrays to store info and then draw Random() from there, the outcome would be almost the same as drawing Random() using Timer on X-dimensional array. Theoretically the pattern would be barely noticeable at least for general purpose drawing.

Lately I've done a lot of analysis on different Random algorithms, analyzing 100 or 1000 number draws from 100 number List(9, 9) Array using different algorithms and methods. And in the end I concluded that the best way to draw really random sequence of numbers is to declare matrix and rotate it. Even if you draw numbers using standard Random class from rotated matrix the sequence will be very random much more of what we'd like to see while speaking of real Random. Know any other not straining methods of drawing random?

Bug fixing in Cleaner Kit [coding4fun]

, , , ...

Bug fixes and changes:

# Window Location handler deleted
# Import and Export folder list added (Import files are .txt files, one directory per line)
# Check old list if all directories are up to date,
automatically delete if directory doesn't exist
# Pressing Enter in text area triggers Adding Folder
# Lostfocus replaced with GotFocus
# Fixed window states while minimizing and bringing to front
# Validate list on startup
# System Tray Notification Icon:
Left Click to bring form to front/hide to tray, Right Click for menu

Download Cleaner Kit 0.0.32

I am thinking about going back to any of my old projects, as I was getting pretty bored lately. But I dunno which one yet. There was a lots of ideas on my mind the past few days wizard

Cleaning temp and other directories

, , , ...

I got tired of cleaning up temp files after apps I use, there are many temp directories on my laptop, that's why I got pissed and just wrote Cleaning Kit lol Basically it deletes all files within selected directories. The list of the directories is saved so you don't have to choose them again and again after you restart. If anyone wants to use it feel free to cheers

Download Cleaner Kit
I haven't testes it on other OS than Windows 7, but it should work as long as you have Framework 4 installed.

Suggested directories (Replace "CURRENT USER" with your pc username):

C:\Users\CURRENT USER\AppData\Local\Opera\Opera\temporary_downloads
C:\Users\CURRENT USER\AppData\Local\Temp
C:\Users\Default\AppData\Local\Temp
C:\Temp

If you use a lot of software there probably is a lot more, these are just major examples where unwanted files are stored. If you're on Win7 the Cleaner won't delete your system files and protected files. I can't guarantee this on other OS, anyway you shouldn't try this.

Update: Just fixed list items count for cleraning.
Was:
If LstFolders.Items.Count < 0 Then

Is:
If LstFolders.Items.Count > 1 Then

Seriously I must have been half asleep yesterday XD. Download link fixed + added Lost Focus handler.
May 2013
M T W T F S S
April 2013June 2013
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31