Tuesday, March 10, 2015

Quick and Dirty .Net BigDecimal Implementation

     Now many of us I'm sure have gone to Wolfram Alpha and have done some calculations and get very precise answers. I thought why cant I just make a calculator that runs on the computer instead of relying on a website. The problem here is that I typically write in .Net and as far as I know in .Net there isn't yet a BigDecimal implementation though I hear something called Rational Number will be in the future (correct me if I'm wrong). .Net as of 4.5 does include BigInteger though and I figured "hey I can surely manipulate that to do decimals". So by playing with powers of 10 and some string manipulation I threw together this quick and dirty BigDecimal implementation. It does most of the basic arithmetic operations (add, subtract, multiply, divide) and also includes modulus and a limited power operator (only decimals to integer powers allowed).
It also has most of the basic comparison operators (=,<>,>,<,>=,<=).

     I didn't implement a way to do powers (exponents) of decimal numbers to decimal numbers as I don't know of any way to do arithmetic that are to the power of a decimal number. This is one of many things Wolfram Alpha and other tools are still useful for. I did however add a power operator where you can raise a decimal number to an integer power. Again this was a quick and dirty implementation by use of an already existing BigInteger and some string manipulation so this is more of a workaround then a full and proper implementation. With all that said this works as it is intended and I just thought I'd share this for those who want to have such capabilities and/or not want to make their own or use one that others have made (for what ever reason). Below is the source in VB.net, feel free to critique it constructively or even suggest improvements/additions/corrections/other changes (they are always welcome) in the comments, even link to other/better implementations for others to learn from (including myself lol).

     Here is a brief and simplified explanation of how the operators work (take note of the number of digits after the decimal places, trailing zeros after the decimal are omitted).
How Addition is done:
     ex: 2.5 + 3.56
     250 + 356 = 606
     606 * 10^-2 = 6.06
How Subtraction is done:
     ex: 3.56 - 2.5
     356 - 250 = 106
     106 * 10^-2 = 1.06
How Mulitplication is done:
     ex: 1.23 * 2.34
     123 * 234 = 28782
     28782 * 10^-4 = 2.8782
How Division is done:
     ex: 2.75 / 1.23
     27500 / 123 = 223.5772...
     223.5772... * 10^-2 = 2.235772...
How Modulus is done:
     ex: 81.913 mod 1.89
     81913 mod 1890 = 643
     643 * 10^-3 = 0.643
How Powers is done:
     ex: 3.86 ^ 3
     386 ^ 3 = 57512456
     57512456 * 10^(-2 * 3) = 57.512456


Sunday, February 15, 2015


Here is a little app that will help rename files with the wrong or missing extension by getting its signature. You must know the signature before hand and the extension you wish to append to the file.

Download: http://www.mediafire.com/download/txac5cdc5a9tofh/ExtensionBySignature.exe

The program relies on a file called "sig.txt" to know what extensions and signatures to name and look for.
The format of the list is {extension}={signature}.
example for a .zip file: "zip=504B0304" without quotes.

 ExtensionBySignature.exe [Input Directory(s)]
 ExtensionBySignature.exe /n [Input Directory(s)]

 Every session is saved in a log upon completion.

 /n , /N = NonDestructive mode (files will not be renamed but the log file will stay the same)

Note: Multiple input directories can be used, just make sure to space them from one each other and use quotes where appropriate. If a file already has an extension and the program is going to rename it, the new extension is appended to the end (keeping the old extension in the file name) for future reference in case knowledge of what the previous extension used is needed.


Wednesday, February 11, 2015


Well here is something to kinda parse the syscon communication (not everything is parsed). It sorts out the packets and is able to output read and write operations to a file.
Apparently these dumps may contain the QA token and so be very careful with those files.

Download: http://www.mediafire.com/download/cc09aoxrglcbbpf/SysComParser.exe

PS: Brought about by zecoxao's request for the parser.

Tuesday, January 20, 2015

XMB Wave

     Here is a XMB wave video that I edited from the original to look a bit better (imo) and also to higher the resolution (1080). It might be used for video backgrounds or something, I just thought I'd leave it here.

Download: http://www.mediafire.com/watch/cbia0jcrpakpvk8/wave.avi

Here is the original to which I edited:

1) This is the Blue XMB only.
2) The blue is more subtle than the one from the original video.
3) Made the sparkles smaller.
4) Wave is sharper.
5) Banding is corrected.

Thoughts about original video:
1) The video is a lower resolution then I would have liked.
2) The banding was pretty bad.
3) The video is not truly seamless but instead it kind of looks seamless (actually an overlay where 2 wave states are similar).
4) Bit rate was too low hindering the overall quality of the video (to be expected due to it being used for Dreamscene so I guess it's understandable).

Wednesday, January 7, 2015

Project Euler Problems

     The same friend of a friend that got me motivated to make the SudokuGen also showed me this website with these challenge problems and since I have nothing to do these days and am bored anyways, I thought I'd start solving them.


     One of my friend's friend (I just met him recently) shared some code with me which turned out to be a Sudoku puzzle generator in Java. I don't really know or like Java but it gave me motivation to try my hand at making my own. My algorithm is different from his and I don't really know much about Sudoku generation but enough trial and error and my method works pretty well now. The one big difference from what his has and mine doesn't is backtracking, mine just retries from scratch if it hits a dead end. After improving my algorithm a bit I then went to tackle adding backtracking but that was giving me more of a headache then it should've so I just gave up lol. After this one I have learned a bit and I might plan on making another one using a slightly different algorithm but it should allow me to implement backtracking easier.

As always leave any feedback or suggestions in the comments

Got around to commenting my SudokuGen code (VB.Net) and modified a couple things as well:

Finally here is the source to my Sudoku puzzle generator (VB.Net/Java), on my computer it generates 1000 Puzzles in about 45 seconds, it is by no means fast but fast enough for practical purposes I imagine.

Here are 1000 Sudoku solution outputs :

Tuesday, November 18, 2014


   I looked around on the internet to see if there was any way for me to store individual bits in an array. The BitArray class exists but it states that it uses booleans to represent bits. I then went to look at how large booleans are. MSDN says it varies and on several threads the size ranges from 2-4 bytes. I haven't done any testing to see how much the actual size of booleans when used in the BitArray class but I went a head and threw together this TBitArray class anyways. Bits are stored in a byte array but each bit in the array is given an index instead of each byte given an index. 8bits = 1byte array, 9bits = 2byte array, 16bits = 2byte array, 17bits = 3byte array etc...

As always this might not be the best approach or implementation, if you have any issues or suggestions please leave a comment.

Sunday, October 12, 2014

XwitchBot2 [BETA] Release

This is the BETA release for XwitchBot2. It implements most if not all intended functionality (at least ones I remembered). Plugins will come slow and the Raffle plugin included is a dummy plugin to test plugin system. If any issues are found please comment.

Download: https://www.mediafire.com/folder/jze9zh71g0du5//XwitchBot2
Only the ZIP file is needed.

UPDATE - Oct 14, 2014:
Fixed a bug in Chat menu option not reverting to dark gray.
Fixed a bug in the plugins selection menu that causes crash.
Fixed a bug in several basic twitch IRC commands that causes crash.
Fixed a bug in plugins command processing that causes crash.
Fixed a bug preventing application from closing properly when expected.
Corrected message username to display "XwitchBot" instead of the current Nick when expect.
Added Restore option to system tray icon.
Added Command Line Argument to set bot's OAuth.
Added Command Line Argument to set owner's OAuth.
Added Command Line Argument to set server.
Added Command Line Argument to set server port.
Added Command Line Argument to auto connect.
Added Functional "Retarded" plugin, with dummy UI.
Changed Title name to state "Nick" and "Channel".

To make plugins use the Core.dll although this is only BETA the Core.dll might change before final version (though unlikely).
Here is a screenshot:

Here is a basic starting point for making a plugin:
Start a new project.
Select Class Library.
Create a new User Control in the project, call it UI.
Set the Size property to 842, 488.
Lock the control.
Add a Panel to the form.
Change the Panel's Dock property to Fill.
In the <YourPluginName>.vb file follow the below example

Sunday, August 10, 2014

McCollough Effect

Made a little program because I got bored. It induces the McCollough Effect.
While the wiki says you should look at each image several seconds at a time it didn't specify so I just used 5 seconds intervals.
You will first be shown a black and white image with horizontal and vertical grating for 10 seconds. You will then be shown a red with horizontal grating, then a green one with vertical grating each being shown for 5 seconds for a total of 3 minutes. The same black and white image from the beginning will be shown again at the end. If the Effect was successful the image should look slightly different now.
To exit the application at any time press escape.
PS: The application runs in full screen.

Download: http://www.mediafire.com/download/niurrwq3e92s3ac/McCollough_Effect.exe

Thursday, August 7, 2014


Here is an application requested by Ada and maybe a few other on IRC. At first I didn't want to do it since I am lazy and didn't know anything about it. After they linked me to the page I thought I can do this though I cant test etc. I eventually started it and here is the completed app (though I personally never tested but Ada has tested and says its working). It generates a GVD file used for PlayView on the PlayStation3 and possibly other devices.

PS: Thanks Ada for explaining the GVD structure etc.

Download: http://www.mediafire.com/download/k1n5kfmc2wkm7kx/Image2GVD.exe
Download for those on XP : http://www.mediafire.com/download/rg7cdyvz0w6yviv/Image2GVD-XP.exe

Usage: Normally run the executable and follow onscreen
             Drag image into CMD when asked.

             Running the application and the image as argument also works

             Generated GVD will be created in the same directory as the source image.

             Images must be 3840x2160 for now, might make custom later.

As always if you have problems or suggesting please leave a comment.

Tuesday, June 3, 2014

XwitchBot2 Started

Update: Starting over. I goofed and messed up the bot lol but not all is lost I can bring over many of the things from this version. I will be working slowly to ensure no memory leaks and no UI hangups occur. I will also improve on the plugin system giving it more control etc.

For those still using XwitchBot, I am working on XwitchBot2 at the moment. I will post updates on its progress here. The idea is that XwitchBot while pretty functional in itself lacks some capabilities and making plugins is easy but not extremely easy. The UI could also use some work.
 Core = DONE
 Plugin interface = DONE
 Chat UI = DONE
 UserList = DONE
 Options UI = DONE
 Plugins UI = DONE
 Donation UI = DONE
 About UI = DONE
 TwitchAPI = DONE
 IRC component = DONE
 Plugin Manager = DONE
 MessageProcessor = DONE
 Greetings = Redone ~95%
 ProgrammableKeySupport = DONE
 InChat Basic Twitch Commands = DONE
 Timestamps = DONE
 OAuthGeneration Helper = DONE
 ....if more components are added I will update this list including their progress.
The percentages here indicate how close a component is to intended functionality and not an indication of completeness.

UPDATE 8/11/2014
Thought I would upload a video showing what the bot is like at the moment. Its not complete but its very close to it. So here is a video of it doing its thing:

Welp thats that, should be done soon, if me getting kicked out doesn't get in the way.

UPDATE 8/10/2014
Separated the bot and core for use with plugins and implemented the plugin manager.

UPDATE 8/9/2014
Removed the Staff and Admin lists in chat (find them unnecessary).
Fixed random disconnect (had the close events in the paint event handler :P, put it in the mouseclick event now)
Added a reconnect feature just in case of the connection is cut (will not work if internet connection itself is lost or unavailable)
Made the Setup page only show upon start up (no more disconnect feature)
Forgot to mention I implemented all basic IRC commands available to twitch (/timeout /ban etc)
Cleaned up some things.

UPDATE 7/23/2014 (much done today)
I got to DONE status for many of the components on the list and progressed further in some others as well.
Currently working on improving the IRC component though. It's still 100% functional so its DONE status will remain as it. I am making it more robust and processing received messages. I will also be removing the staff and admin areas in the chat as I find them unnecessary.

UPDATE 6/26/2014 (IRC component in place and tested):

UPDATED UI, It is far from complete but here is a sample of the working UI thus far:

[OLD]Well the bot is nearing completion and here is what it looks like for those curious:

Friday, May 30, 2014

Custom OAuth

If you are logged into Twitch/Justin an OAuth will be generated for that account. To ensure nothing goes wrong check
Twitch/Justin or simply go and logoff, you will be asked to login to the account you want to generate an OAuth for.

user_read: Read access to non-public user information, such as email address.
user_blocks_edit: Ability to ignore or unignore on behalf of a user.
user_blocks_read: Read access to a user's list of ignored users.
user_follows_edit: Access to manage a user's followed channels.
channel_read: Read access to non-public channel information, including email address and stream key.
channel_editor: Write access to channel metadata (game, status, etc).
channel_commercial: Access to trigger commercials on channel.
channel_stream: Ability to reset a channel's stream key.
channel_subscriptions: Read access to all subscribers to your channel.
user_subscriptions: Read access to subscriptions of a user.
channel_check_subscription: Read access to check if a user is subscribed to your channel.
Note: chat_login will be part of the scope.

While working with the Twitch API I noticed that scopes are like the creditials an access card has. At first I figured any generated OAuth key should have complete access to my own room (channel) but I was sadly mistaken. An OAuth key must be generated with the specified creditials and this is absolute. So comes the next task, how do I go about generating OAuths with the proper/needed scope? The most common and known OAuth generator only generates OAuths for IRC login for chat with only the scope "chat_login". I thought is there a way to modify this generator so that it will request a new key with the added scopes. I looked on the documented page and it states that you can specify the scope in the URL. I went back to the generator and load and behold at the end of that URL was "&scope=chat_login". The TwitchAPI documentation says I can add scopes seperating them with a plus sign "+" and so I tested it. I changed the end of the url to "&scope=chat_login+channel_subscriptions" because getting subscription info was my main goal at the time. I pressed enter and it gave me a new OAuth. I checked the new OAuth with the twitchAPI to see if it had indeed the scope I needed.

If you look at line 14, as you can see the needed scope is indeed there. Mission accomplished lol. The next thing I want to do now is make it easy for people to create their own custom OAuth key using the existing key generator. I do not know of an existing easy to use method of making OAuth keys and so I will present my own here.
Finally here is the code snippet of the OAuth generator used here (HTML + JavaScript):

Friday, March 14, 2014


   I was asked to make a bot for twitch and so I did. It is called Xwitchbot (pronounced switch bot). I wouldn't call it a very good bot personally but it works. It provides some message handling, and is plugin based. Included is a single plugin that I made called Raffle2. As the name implies its used to hold raffles on twitch chats. To make plugins for this bot simply implement the interface "Globals.dll".

XwitchBot Files: https://www.mediafire.com/folder/aflc46sawa3rg/Xwitch
XwitchBot Download: http://www.mediafire.com/download/5oqmvpv3q51so78/XwitchBot.zip

Plugin Interface: http://www.mediafire.com/download/c80t7k4neh799cj/Globals.dll

Keep in mind that this is the first ever plugin based application I have ever made so it might lack some common practices etc. I am also mostly self taught and the implementation might not be optimal. All in all it works and I just wanted to share.

The system is as follows. The main application loads the plugins in a pool of shared resources. That pool holds the IrcClient, message handler, and plugins as well as plugin resources. The IrcClient, MainUI, and PluginManager/Messagehandler are all on separate threads. Plugins can be on their own separate threads too if they are made so.

Here are some signatures and their description of the functions available in Globals.dll to make creating plugins easier.

Public Shared Function GetToSend() As String
Returns the first element in the list of messages to be sent to the server, and removes it from the list.

Public Shared Function GetRecvMsg(Optional ByVal RemoveOnGet As Boolean = True) As String
Returns the first element in the list of messages received by the server,
if RemoveOnGet is true remove the message from the list.

Public Shared Function GetConsoleMsg(Optional ByVal RemoveOnGet As Boolean = True) As String
Returns the first element in the list of messages to be shown as output,
If RemoveOnGet is true remove the message from list.

Public Shared Function ParseMessage(ByRef sourceInfo As Message, ByVal Input As String) As String
Returns a string replacing all fields with their respective information. sourceInfo is the Message where this function will get the required information from.

Public Shared Sub AddResource(ByVal newResource As Resource)
Adds a new Resource to the pool of resources.

Public Shared Sub AddResource(ByVal newResourceOrigin As String)
Adds a new Resource to the pool using a name.

Public Shared Sub RemoveResource(ByVal Origin As String)
Removes a Resource from the pool with the specified name (Origin)

Public Shared Sub RemoveResourceAt(ByVal index As Integer)
Removes a Resource from the pool at the specified index location

Public Shared Sub AddResourceElement(ByVal ResourceIndex As Integer, ByVal Type As String, ByVal Name As String, ByVal Value As Object)
Adds a resource element  to a resource in the pool at a given index location. Type, Name, and Value as specified.

Public Shared Sub AddResourceElement(ByVal ResourceOrigin As String, ByVal Type As String, ByVal Name As String, ByVal Value As Object)
Similar to the other but instead adds a resource element to a resource of a specified name (Origin)

Public Shared Sub RemoveResourceElementAt(ByVal ResourceIndex As Integer, ByVal ElementIndex As Integer)
Removes a resource element givent a resource index and the element index.

Public Shared Sub RemoveResourceElement(ByVal ResourceOrigin As String, ByVal Name As String)
Similar but removes a resource element with a specified name at the resource with the specified Origin

Public Shared Sub SetResourceElement(ByVal ResourceIndex As Integer, ByVal ElementIndex As Integer, ByVal Value As Object)
Given a resource index and a resource element index, change the value of the element.

Public Shared Function GetResourceElement(ByVal ResourceIndex As Integer, ByVal ElementIndex As Integer)
Returns the value at a specified resource element index at a resource index

Public Shared Sub AddToSend(ByVal msg As String)
Adds a message to the list of message to send to the server

Public Shared Sub AddToRecv(ByVal msg As String)
Adds a message to the list of messages that are received by the server

Public Shared Sub AddToConsole(ByVal msg As String)
Adds a message to the list of message that will be shown on the output

Public Shared Sub SetCurrentChan(ByVal newChan As String)
Sets the current channel the bot is in "Does NOT actually change the channel is in, used for message handling"

Public Shared Function GetCurrentChan() As String
Gets the current channel the bot is currently in "Does NOT actually get the channel the bot is currently in, used for message handling"

Public Shared Function GetResourceIndexOfOrigin(ByVal Origin As String) As Integer
Returns the index of a resource of a given name (Origin)

Public Shared Function GetElementIndexOfName(ByVal Name As String) As Integer()
Returns the resource index and element index for an element with a specific name

Public Shared Function GetElementIndexOfName(ByVal ResourceIndex As Integer, ByVal Name As String) As Integer
Returns the index of a resource element in the resource at the specified index

Public Shared Sub StopPluginManager()
Stops the plugin manager built into the bot and is used by default.

Public Shared Sub StartPluginManager(ByVal Owner As String, ByVal Server As String)
Starts the plugin manager built into the bot and is used by default.

Public Shared Sub StopConnectionClient()
Stops the IrcClients connection to the server

Public Shared Function StartConnectionClient(ByVal Server As String, ByVal Port As String, ByVal Nick As String, ByVal Channel As String, ByVal Pass As String, ByVal JoinMsg As String) As Boolean
Starts the IrcClients connection to a server, the return boolean indicates a successful or failed connection attempt.

The plugin must implement 3 things:
    ReadOnly Property Name() As String
    Function ProcessMessage(ByVal InputMessage As GlobalResources.Message) As Boolean
    Sub Config()

Messages are sorted into 2 types:
1) PRIVMSG (private message that is properly formatted in a way this bot can understand by default)
2) NS (non-sense/not-supported)

NS messages are not discarded, they are passed to all plugins (unless a plugin stops the chain) just like every other message, the difference is their type will be NS and a plugin would have to manually process that message in its raw form.

Messages that have been processed have a structure of the following:
    Public Structure Message
        Dim Type As MessageType
        Dim Nick As String
        Dim User As String
        Dim Host As String
        Dim Target As String
        Dim Message As String
        Dim Owner As String
        Dim Server As String
        Dim Raw As String
    End Structure

Message is where the message itself (what the user specifically send) is stored.
Raw is the message exactly as it was received by the bot with all heading information intact.

ResourceElements have the following structure
    Public Structure ResourceElement
        Dim Type As String
        Dim Name As String
        Dim Value As Object
    End Structure

Resource has the following structure
    Public Structure Resource
        Dim Origin As String
        Dim Resources As List(Of ResourceElement)
    End Structure

Here is the starting source for making a plugin:

For a complete source of Globals.dll :

Here is the source to my Raffle2 Plugin:

Source for UserList plugin:

And finally my horrible source for the bot itself:

As always if anyone has any issues or improvements please leave a comment :)

Wednesday, February 26, 2014

Saving bandwidth while chatting using UTF8 (Fixed)

UPDATE: Decode function fixed and tested (issue was a 4 was used instead of 1, silly me lol). Next up is maybe porting to C#,C++ and maybe Java, but its pretty simple I think people can do it themselves.
UPDATE: Well this is embarrassing, my new and faster decoding function is flawed lol, for now use the old decoding function for accuracy while I look into fixing my faster code.
UPDATE: New Encoding/Decoding Function and changes are below. From testing Encoding is over 5X faster than the previous code and Decoding is over 15X faster. Major change would be I implemented a lookup table so not so much string manipulation is required. Minor changes are I swapped and reordered some things around in favor of faster alternatives like for ex using index of instead of contains.

Test String (100,000 loop) = This is a test to try to make I can make my encoding and decoding for my scheme faster, it badly needs a speed boost lol!!!

Encoding: ~9,334 ms
Decoding: ~13,556 ms

Encoding: ~1,732 ms
Decoding: ~849 ms

    Previously I had a concept of a modified UTF8 encoding scheme with selected characters being optimized. I had code but the scheme was broken to some extent and code flawed. I left it alone for a couple months and then pbanj(from irc) posted a message in all hex lol. At first I didn't know what to do with it, so I told him "wanna decode that for me?" and he said why would he have to. At that moment it hit me, he was using an app I made awhile ago with the encoding scheme I made (still with bugs). I decoded the message and the message said "has this been updated" and that was when I got back to work on fixing this scheme. The concept was simple, most English messages are simply of Latin characters as in a-z and A-Z. I thought all that was needed to represent these were 6 bits. But with 6 bits I had extra room for more characters so I squeezed in the next possibly most used characters, digits 0-9. I then had room for 2 more spaces for characters, I used one to represent a space because come on... its used to separate words from one another. The last bit is reserved for something that isn't a character. It is used instead as an escape or wildcard. The last spot in the 6 bit encoding (111111) is used to represent a non optimized character (UTF8). Because most English messages will contain a ratio of greater Latin letters and numbers 0-9 plus some spaces compared to punctuation and other special characters this scheme will most likely save bandwidth. This scheme works because UTF8 has certain characteristics and rules that compliment the workings of this scheme. A character encoded in UTF8 cannot (in bits) start with 10XXXXXX. The first byte contains information on how many bytes ahead needs to be read for the current character, for example 111XXXXX has three 1 bits leading so the character has 3 bytes total to represent that character. So including itself it needs to also get the next 2 bytes to successfully decode the character.

    Now Lets see how we can optimize UTF8 a bit. Lets assume we want to encode only with 6 bits, those 6 bits representing the optimized characters mentioned above. And every time a special character needs to be encoded the bits (111111) is used. That Character is then encoded using UTF8 and its byte representation is put aside later for use (we will get back to it later). The encoding then continues onto the next character, again if the character is not an optimized character then the bits (111111) is added and its UTF8 bytes are added to the end of the UTF8 bytes from earlier.

    At the end of the encoding we put everything together. We should have 2 groups of data now, the bytes of the characters encoded in UTF8 and the bits for the characters encoded with 6 bits. We need to put them together but how will the decoder know where the UTF8 bytes end and where the 6 bit encoding start. Earlier we established that UTF8 cannot start with 10XXXXXX, well we will use this to signify the end of the UTF8 but instead of the whole byte we only use the first 2 bits (1 and 0) because there is no point in reading the whole byte if UTF8 wont be able to decode it anyways. So 1 and 0 are placed in between the bytes and the 6 bit encoding. The last thing to do to encoding the message is convert it to bytes. We do this because the final data needs to be in a byte array, we do this by simply adding 1s until the number of bits in the final data is a multiple of 8 (8 bits are in a byte). 1s are used so the decoder doesn't mistakenly decoded any other character if the padding was 6 bits long, for example if 0s were used for padding and the padding was 6 bits long the first optimized character would be decoded at the end when the original message didn't have it.

    To decode is fairly simple. We read the message byte per byte first for UTF8 decoding and only when a UTF8 starts with 10 does it stop, the UTF8 characters are put aside for later use. The bits per bit decoding now starts at the beginning of the byte which started with 10XXXXXX. First thing to do is because the 1 and 0 were just used as markers they are skipped or removed.The rest of the message is decoded 6 bits at a time until there are no more bits to read or there are less than 6 bits remaining. Each 6 bits corresponds with one of the optimized characters. Each time the 111111 comes up it grabs the corresponding index of the special characters. For example if this is the first occurance of 111111 then that character in the encoding is the first character in the special characters we decoded earlier.

Here is a demo of the encoding:
Optimized characters: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 " no quotes.
Message = Hello my name is TizzyT.
Hex = 2E:A1:10:B2:CE:F8:C6:3E:34:03:04:F8:84:BE:B4:86:59:62:DF:FF
Octets =
00101110 10100001 00010000 10110010
11001110 11111000 11000110 00111110
00110100 00000011 00000100 11111000
10000100 10111110 10110100 10000110
01011001 01100010 11011111 11111111

First we look at the first byte (first octet): 00101110
We see that it starts with a 0 meaning that this character only needs the byte to decode the character. This character in turns decodes to be the period at the end of the original message. We add that to a list of special characters for later use.

We move onto the next byte (second octet): 10100001
It starts with a 1 and 0 so from this we know to stop decoding in UTF8.
Note if it doesn't start with 10  continue decoding in UTF8.

We skip (or remove) the 1 and 0 because they are markers and look at the next 6 bits: 100001
That is the number 33, so we know the character here is the 33rd character in  our optimize characters list (count started from 0) which is "H". And we repeat this throughout the rest of the message.
000100 = "e"
001011 = "l"
001011 = "l"
001110 = "o"
111110 = " "
001100 = "m"
011000 = "y"
111110 = " "
001101 = "n"
000000 = "a"
001100 = "m"
000100 = "e"
111110 = " "
001000 = "i"
010010 = "s"
111110 = " "
101101 = "T"
001000 = "i"
011001 = "z"
011001 = "z"
011000 = "y"
101101 = "T"
111111 = Special Character
111111 = Special Character

Here we come across 111111 which is to signify that the current character is a special character and it is the first occurrence so we look to the first decoded special character we have (which is the period).
Now we still have 6 more bits to read so we read those, if there were less then 6 bits left you stop because it is the end of the encoding and the remaining bits are there as padding. If the last six bits are 111111 the encoding ends because in such a case the bits are used as padding otherwise decode as usual.

Using this scheme we effectively saved 4 bytes with this message.
            UTF8 = 48:65:6C:6C:6F:20:6D:79:20:6E:61:6D:65:20:69:73:20:54:69:7A:7A:79:54:2E
This Scheme = 2E:A1:10:B2:CE:F8:C6:3E:34:03:04:F8:84:BE:B4:86:59:62:DF:FF

In the best case scenario (using only optimized characters and no padding) messages are 0.75 the size of  the same message encoded in standard UTF8. In the worst case this scheme can be any number of bytes larger, in which case the message should be sent using the standard UTF8 encoding. Because this scheme is based off UTF8 and the fact that this scheme decodes using UTF8 first there is no conflict with using this scheme to decode a standard UTF8 message.

Download Demo App: http://www.mediafire.com/download/x0l1cyf1zvxgy9x/Encode_Decode.exe
Note: The Demo App doesn't fall back to standard UTF8 encoding to show worst case scenario of a given message.

After thoughts:
1) Why didn't I use compression instead of this encoding scheme?
    I have thought of that and did several test and concluded that while compression with large messages with hundreds or thousands of characters would work nicely, in many or most cases much nicer than this scheme. In a instant messaging environment people don't hold their messages until there is a huge bulk..I mean come on its called instant messaging for a reason, people send whats on their minds as soon as they finish typing it and for such short messages most if not all compression actually makes the message larger in size.

2) Why did you make this?
    I was first intending to make a new chat program just for the heck of it and while doing so I needed to decided what encoding scheme I would use to send text messages. I had 2 factors that I wanted to keep optimal. The first was to be able to use a large range of characters and the second being it had to use as little bandwidth as possible. The first obvious choice was to use ASCII but that later turned out to be very limited in what I wanted users to be able to type. The next was UTF8. While looking into how UTF8 worked and how it came to be I was amazed as to how flexible it was. It only uses the required amount of bytes needed to represent a given character and thus my knowledge on variable byte encoding grew and of course the scheme I came up with is essentially taking that concept a bit further. So back to the original question, this scheme satisfies both factors and saves enough bandwidth in my opinion for me to opt for its use, and in the worst case scenario in a completed application (if made to) would be the size of a standard UTF8 encoded message.

3) Have you tried to optimize it even more?
    I have thought about it but besides rearranging some declarations around etc I haven't really changed the fundamentals of my code. There are probably optimization here and there but I haven't gotten into doing that, like maybe making use of bit shift operators or creating a look up table instead of constantly calculating things. Those things I will maybe get around to later for now I am satisfied with the basic concept and workings of the scheme and I'll leave the optimizing and/or porting for others who want to use it.

4) You say this saves bandwidth but how when some messages aren't smaller in size?
    When I say save bandwidth I am talking about traffic used within a given duration. For many people that duration is at the start of a billing cycle to the end of one. Here in America and probably most other countries a billing cycle is usually on a per month basis. So within a month this scheme would save you bandwidth. For a single message sure it might not be that much saved but over hundreds or even thousands of messages throughout the month you would have saved a noticeable amount in my opinion.

5) Why 6 bits? Why not lower?
    I will be honest I wanted to use 5 bits at first and being a complete scatter brain I completely forgot about capital letters so it took me a good half hour or so before my brain fart subsided and increased it by 1 bit. There are 26 letters in the Latin alphabet but there are also capitalization so already there are 52 characters that need to be represented and that exceeds the 31 possible with 5 bits. And I would argue that with 6 bits it works out nicely with the whole alphabet with capitalization and digits 0-9, the inclusion of a space and the required escape/wildcard.

Here is the updated code I have for this scheme which encodes 5X faster than the old one and decodes about 15X faster than the old one.
(100,000 loop stopwatch as benchmark with string of 123 characters):

While this scheme can save bandwidth and is perceived fast, it is much slower than standard UTF8 encoding and requires more steps. The encoding for practical uses though is more than fast enough.

As always if anyone has any issues or improvements please comment.
Open to non commercial use.

Saturday, February 15, 2014

Large Prime Number Generator

   I was using a combination of code from my previous posts etc and while looking at the code, I realized something, why do I need to repeat so much of it? I thought I could possibly optimize this a bit. The first thing I did was make it so that each new random number generated will all have the same length in bits. Because they are all the same length in bits I don't have to generate new random numbers each time for the potential witnesses. Another thing was I can just set the length of bits instead of using the not so accurate tobytearray.length or using my own function to get bit length, I can just set it. I also added a multiple of 5 check before the iterations so that it doesn't try checking a number that ends in 5 (because primes larger than 2 only end in 1,3,7,9) instead it makes the number end in 3 by subtracting 2. For ease iterations can be set manually, if not the number of iterations is the square root of the length.

Code Note: Line 27 can be changed to:
"PrimeGen -= X" *X can be any even number
Depends on what you want the function to do when the current number isn't a prime.

Note: As always any errors or improvements please post in comments.

Miller Rabin VB.net

   Here is an implementation of Miller Rabin Primality Test. It was originally in C# and was converted to VB.net with some modifications and additions.

Note: If there is anything wrong or can be improved please comment. I am also not 100 percent sure this is Miller Rabin it is what I found as I was searching for Miller Rabin, but this is still a Primality Test (more accurately this is a composites test).

BigInteger Bit Length

   I was looking for Miller Rabin implementation in .Net (vb or c#) and found one. I went through the code and apparently I needed to generate a random BigInteger hence why I made THIS. Another thing I noticed was the algorithm needed that random number to be the same length as the number to be checked. Now I don't know how precise this length had to be whether it was just bytes or bits. But I saw something I didn't like and I sought out to 'change' it (might not be broken to say 'fix').

Number = 8739
In Hex = 2223
Actual = 15
Report = 16 (using BigInteger.ToByteArray.Length * 8)

That lack of precision kinda bugged me lol and so:
Note: If there is a better way (which I'm sure there is) please let me know in the comments.

Random BigInteger Generator

While I was working with primes I needed to generate large pseudo random numbers. I looked and I was envious that Java had one and from what I saw .Net didn't have one built yet? I decided to make my own and to share.

Random BigInteger Generator (VB.net):

PS: If there is an error please let me know also if there is a faster or better way please comment :)

Prime Sieve

Found a Prime Sieve function online and tested it, took ~3570ms to generate primes up to 10,000,000. Was pretty fast compared to the one I made awhile back so I decided to make a new one tailored to be faster than the one I just found. My final version takes ~2790ms to generate primes up to 10,000,000. Code I found was originally in C# but I converted it to VB.net.
Note: Speeds may vary per machine.

Sieve I made with use of multiplication instead of modulus (even faster than stated above):

Sieve I made:

Sieve I found:
Note: Any errors or improvements please post in comments.

Friday, January 31, 2014

MangaHere Downloader

Here is a tool which is a standalone of what my final program is going to be. This downloads mangas (completely or upto latest) from MangaHere.com. All downloaded Mangas are organized in their own folder and in their own chapters in the same location as this program. I think it is faster than MangaRipper but not sure.

Download: http://www.mediafire.com/download/9fh9bc83dxqr75i/MangaHereDL.exe
Usage: Run the program, type or paste the main url of a manga from MangaHere.com and let it do its thing.

1) Invalid Characters for file/folder names which caused program to throw an exception.
2) Added Capitalization algorithm to correct the all caps anime names from previous version.
3) Tried multiple ways of multi-threading and found one that seems to work best.
4) Added folder name ordering for mangas that have duplicate chapter names.
5) Fixed an issue where program completes before all scans are downloaded.
6) Fixed issue where if the number of chapters is less than number of threads, the other threads are
    left idling.
7) Some other things I can't remember at the moment.....


Monday, January 13, 2014

MangaHere Search Tool

   This isn't really the initial goal of the program I was working on but I decided that I should make a separate standalone tool for searching MangeHere. This was originally supposed to be a plugin for my manga reader I'm working on but I decided to put out a smaller app just for the heck of it.

Download : http://www.mediafire.com/download/wvqgegqmcxqabjh/TzBrowse_MangaHere.exe

Usage: Run the program, enter what you are looking for and it will do its thing.
Double click to open the site associated with the manga. Press Esc to search for a new manga.

Info: Compatible with MangaHere, displays name and link.
Improvements: I plan to implement a multi-threaded and more optimized version in the final reader for performance as this standalone one is slow for searches that contain a lot of results, will also include more info like rating and summary etc.

 Image: http://i.imgur.com/EDEVzkL.png
1) Single Threaded, kind of slow if search contains many results.

Monday, October 28, 2013

Remove Windows 8.1 watermark

I know there are others out there and people can do this too but I will put this here for convenience sake.

Update : Removed Test Mode Watermark
Download : http://www.mediafire.com/download/wbeg0cmak467fm0/Windows_8.1_watermark_removal.zip

-Run Add_Take_Ownership
-Take ownership of C:\Windows\Branding\Basebrd\en-US\basebrd.dll.mui and replace with edited basebrd.dll.mui
-Take ownership of C:\Windows\System32\en-US\shell32.dll.mui replace with edited shell32.dll.mui
-Logout and back in

Friday, October 25, 2013

DRIICE Project

   This is meant to be an alternative to the recent "ice" project for steam made by scottrice. There are certain things that I saw about his project that I would like to change. One of which is a nice GUI to use (I know there is work being done already). I have been working on it for the past week or so (on and off) although following a language I don't know makes things sluggish and cumbersome. The actual program itself is quite simple, and so finishing my alternative should be fairly easy.

Progress (99 = done but might make changes):
GUI : 0% "Will work on this last, I usually get functionality working before esthetics."

Names and Categories : 99% "Am able to generate properly formatted screenshot.vdf files for name of app, location, category, etc."

AppID generation : 60% "Currently working on this, This is the key to generating another properly formatted screenshot.vdf file (dif location/dif format) that handles id to game association also used for grid images. I got have the generation and formatting done, just the correct appid is left"

App/image association : 80% "Am able to pick images and move them to the correct location and with correct demensions, but giving them their correct file name (same as appid) is pending on me getting AppID generation working."

== LOG ==

May 13, 2014: Officially dropped.
Oct 25, 2013: Until now I haven't been seriously working on it but today I will sit down with paper and pencil (yes I code with scrap paper - it helps me, don't laugh) and really work on it through the day. Although sometime today my little brother's computer case is to come and I will have to put his computer together which is currently housed in the motherboard box, fully functional lol.

Thursday, October 17, 2013

+DeSmuME for ICE , ugly fix for NDS support

Here is a little thing that I worked up, its similar/same method as the previous fix for ICE. This one add NDS emulator (DeSmuME).

Instructions: Rename your original Gameboy advance emulator to "gbaemu.exe", ex: "VisualBoyAdvance.exe" to "gbaemu.exe" and extract the NDS folder into the same directory. Add NDS games by placing them into the GBA roms directory.

Download : http://www.mediafire.com/download/z3h482mgk53r2rf/%2BDeSmuME.zip


Made to batch re-size and convert images for Steam grid.
Latest Update : Version 2.0c:
Changed a couple things here and there and added some options.
Changes :
There is now a mode displayed in the console so people know what options are being used.
There are now two quality options (highspeed/highquality) highspeed is used by defualt.
There is now a way to specify the number of threads to use. Specifying 0 will behave the same way as not specifying one at all.
A usage message is added for people who run the application normally.
Download : http://www.mediafire.com/download/xvwc9ooocfy9yb5/SteamGridImager2.0c.exe
Usage: Drag images or folders containing images on the executable.
If you would like to benchmark add "-bench" without quotes to the file name.
If you would like to use high quality mode add "-q" without quotes to the file name.
If you would like to specify number of threads to use add "-thread=" followed by the number of threads you want to use (no spaces, without quotes) to the end of the file name.
You can use multiple modes at the same time.

Because most of this was from an old application and uses most of .Net built in stuff I will provide the source:

== OLD == Benchmark done by Pbanj:
2.0b HighSpeed CPU utilization

2.0b HighSpeed

2.0b HighQuality

Download : http://www.mediafire.com/download/o3jrga30povdn5f/SteamGridImager.exe Update : Its fucked up, here is a fixed version: Download : http://www.mediafire.com/download/z190ztoo3cwy1uy/SteamGridImager1.0a.exe Reason : I was using an old project to make this one, and I decided to change the output format to Jpeg from Png, but I forgot to change the extensions from .png to .jpeg. I am sorry for any inconveniences. Update : Here is another update I was told that the images were pixelated and I knew what was causing it. Microsoft's built in Jpeg compressor in .NET is shitty, and so to remedy that I simply made it output PNG. Another thing that is changed is I removed the ending popup message because apparently Pbanj thought it was annoying. Download : http://www.mediafire.com/download/hhviob9mafizg9l/SteamGridImager1.0b.exe Requested : Pbanj requested that I implement multi-threading to this. And so I might do just that, just to speed up batch processing. For single image processing there will be no speed improvements. Updates : Here is SteamGridImager1.0c and the first version of SteamGridImager2.0. Download 1.0c : http://www.mediafire.com/download/t2tu6orzv33e2m2/SteamGridImager1.0c.exe Changes : Added folder support, if you have too many images to process put them into a folder and drag the folder onto SteamGridImager1.0c.exe, all images in the folder and sub-folders will be processed. Also added a benchmark feature for people who want to see stats, simply add "-benchmark" (without quotes) to the end of the executable file name.  Download 2.0 : http://www.mediafire.com/download/b8gbuiebc71di3f/SteamGridImager2.0.exe Info : This is 2.0 because it was more or less a rewrite of the first version. This version is an attempt to implement multi-threading. Minimal testing was done so performance increases may vary. Also to note I do not know best practices of multi-threading to make optimized multi-threaded apps yet, the only thing I'm certain of is there is a performance gain and that it works lol. Further optimization of the app will probably not come as unless you are processing thousands of files its not going to make that big of a difference. Supports everything 1.0c supports feature wise. Benchmarks : Here are the two version processing 100 images = Version 1.0c
Version 2.0
Here are the two versions processing 2000 images = Version 1.0c
Version 2.0
As you can see the multi-threading does provide some performance gain (at least on my system) but quite little (probably due to my lack of knowledge on multi-threading). Welp take it or leave it lol. On second thought : I will try later to implement multi-threading another way and see if that yields better performance. Welp here is the other way I've implemented Multi-threading, its better I guess but again not by much lol. Features and usage is the same. Download 2.0a : http://www.mediafire.com/download/a4fpt3264qlo5r2/SteamGridImager2.0a.exe Difference explained : 2.0 has a list of all the images and each thread can grab a new one as soon as its finished with the current one its working with. Each time a thread grabs an entry, that entry is removed from the list so other threads don't process that image a second time. 2.0a gives each thread its own list of images to work with. It works non-stop until it finishes. There is no waiting like 2.0 does. In 2.0 all the threads are grabbing from one source so there needed to be some form of management. If multiple threads try to access the list at the same time, all but one thread is put on hold until that one thread is finished with the list, basically the other threads need to wait in line until they get the information needed to work on the next image. Another factory that might be making my tests seem like multi-threading isn't gaining much might be a HDD bottleneck. 2.0a benchmark with the same test from earlier. 100 images:
2000 images:
CPU Utilization:
Testing done by Pbanj: 1.0c

Monday, October 14, 2013


This little app is for people who want to know what a particular executable (windows exe) is being given as arguments.

Usage: Put in the same location as the executable you want to check and rename the original to something else, and rename ArgumentChecker to the original name of the program. If there are any arguments a new text file is created in the same location listing the arguments used, if there are no arguments "NO ARGS" (with quotes) will be in the list. In the message version it behaves the same except that instead of outputting a file a popup box comes up listing the arguments.

Download : http://www.mediafire.com/download/x383bhqnnnnobjr/ArgumentChecker.exe

Message version: http://www.mediafire.com/download/8h1fvl5x2t239t6/ArgumentCheckerMsg.exe

Steam ICE Snes9x + Bsnes temp ugly fix

Here is a little thing I put together as a temp fix for people who want to use the snes9x emu for snes games and bsnes for nes games. There might have been an easy way to do this but watching someone try to get it working made me not look for an easy solution lol. So here it is:

Download : http://www.mediafire.com/download/2z0ctdb21q59i3c/Winbsnes%2BSnes9x.zip

Instructions : Delete or Rename or Backup the bsnes.exe, found here
"C:\Users\<USER>\AppData\Local\Scott Rice\Ice\Emulators\Winbsnes".
Then extract everything in the archive into that directory (overwrite if asked).

Changes :
- No visible console.
- Doesn't conflict with ICE

To Update Emus:
Put all Snes9x related files in the Snes9x folder.
For Bsnes update files and then rename the updated bsnes.exe to bnesemu.exe and then extract/use the bsnes.exe from the archive.

Alternatively if you would like a different NES emulator (FCEUX) you can use a package  that uses the same method put together by Pbanj here : http://www.mediafire.com/?icr12m5lpytac2l

Thursday, October 3, 2013


    Ada thought it be a good idea to give me something to do to relax when I was stressing. I was at first more confused with what she wanted then neither relaxing or stressing. I finally understood what she handed me, it was a challenge (don't know if one can call it that lol). She gave me a file, told me it is actually an image. It was 128 bytes. The image is in black and white and dimensions were 32x32. With that in mind I already knew what I needed to do, each bit = black or white. And so here is the completed app.

Download folder: http://www.mediafire.com/folder/z1ytx6r9qde98/DATA2BW

There are different executable for different orientations, only because I don't know what she was talking about when she said the image is reversed/flipped etc lol.


     This came about when I was wondering why, some gim files weren't able to convert to png using gimconv. I found that gimconv had a -S option which has a portion that looks promising to me. it said "Pixels" followed by what looks like arrays of 4bytes. I immediately interpreted this as 32bit color (red, green, blue, and alpha). So the plan now was to take that array and make a PNG out of it, but I found another problem, the number of pixels in that array didn't match the width x height of the image. So I thought it was because the actual size of the image the pixels would form would be proportionally smaller than the stated width and height. That's when sandungas said he saw a pattern and that the image (at the time) was 36 x 44. And the math matches up. And so if you take the number of pixels / height (which we are assuming is correct) we should get the correct width. And so off I went, putting this little app together, then another problem arose, the order of RGB was different. I asked Ada to hand me a gim that was convertible using gimconv and from that I was able to match the colors (abgr if anyone was wondering), and there we have it. This program converts the gis files made from gimconv into png files. Although it works fine with files that can already be converted normally with gimconv, for files that wasn't able to convert with gimconv this program can convert the gis that was generated but it looks weird. And so I don't know if its correct or wrong (most likely wrong), or if we are missing something lol. Either way I decided to put this here even if it might be useless.

Usages: gis2png.exe <inFile>
            gis2png.exe <inFile1> <inFile2> <inFile3> ...
            Drag gis file(s) over application

Download : http://www.mediafire.com/download/5kbn4lh51pjbw9z/gis2png.exe
MD5: 119936C018C9D1F6200558E17F514B52
SHA-1: BC27D25E0A180A98BA0E9776FD90C51F15CA7EC1

Here is a version that doesn't do the calculations to get width and uses the one found in the gis itself:
Download : http://www.mediafire.com/download/ixqe941bm5imbxt/gis2png.exe
CRC32: FF75528C
MD5: 14B301C3C1C64962E9F8064C41C71C68
SHA-1: E1EDD51062A56E87407FF69EC82780C60AD93116

PS: No one listed will be responsible for the usage, and effects of this program, if there is room for correction/improvement, they might/might not be implemented.

Friday, August 9, 2013

== Learning Hexadecimal ==

   Previously we learned to count in binary which is a base 2 system and is used in computers. There are other base systems that the binary system is usually paired with in computers and that is the base 16 system. In hexadecimal there are 16 different digits usable that being 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. the values are 0 to 15 and like in binary and decimal once you go past that you increment and restart the sequence.

Take a look at this:

Decimal Hexadecimal
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 A
11 B
12 C
13 D
14 E
15 F

    Lets take the same number as last lesson on binary 3,791 as an example. In hexadecimal that value is ECF. To get a better understanding why the value is what it is, lets convert it to binary. Each digit in hexadecimal can be represented with 4 bits like so:

Binary Hexadecimal
0000 0
0001 1
0010 2
0011 3
0100 4
0101 5
0110 6
0111 7
1000 8
1001 9
1010 A
1011 B
1100 C
1101 D
1110 E
1111 F

So in turn the number ECF in binary is:

1110 1100 1111

As you can see it is identical to the previous lesson, the result being 111011001111. You can also use the place value method as well similar to the binary and decimal system but again the place values are different. You again start with 1 and  each number afterward is a power of 16.

256 16 1
So using the place value method we do (Ex256) + (Cx16) + (Fx1). You can convert the letters to their respective values if that helps like so : (14x256) + (12x16) + (15x1) = 3,791.

More information can be obtained here : http://en.wikipedia.org/wiki/Hexadecimal

== Learning Binary ==

Binary is a numeric system that uses the base 2 numeral system. There are only 2 usable digits 0 (or off) and 1 (or on). Binary is the heart of all electronic computers, including but not limited to personal computers, Macs, gaming controls, and cellphones. In computers the only thing it really does is switch between 2 states 0 or 1, from that many combinations we get our digital world as we have it today. In this portion I will be showing how to count in binary.
Take a look at the following:

Do you see the pattern?
   In the decimal system we start with 0, and there are 10 usable digits, 0-9. In binary like mentioned there are only 2 digits 0 and 1. In decimal once you get past 9 you simply increment the first digit to the left (if it doesn't exist then pretend its a 0) and start the sequence over. For example: 00,01,02,03,04,05,06,07,08,09 from here we increment to the next digit and start the sequence over again hence we get 10,11,12,13,14, etc.

 In binary its the same concept. 00,01 since 1 is our last usable digit we increment and start the sequence over hence 10,11 from here we repeat the same idea hence 100,101,110,111, etc. Now 100 shown here isn't actually 100 like we use in decimal its value is actually 4. Each place value is different, lets compare it to decimal system:

Note: the value 3,791 is randomly used in this comparison.
1000 100 10 1
3 7 9 1
2048 1024 512 256 128 64 32 16 8 4 2 1
1 1 1 0 1 1 0 0 1 1 1 1
   In the decimal system you multiply the number of its place value, and then add the result of each multiplication. So you take (3x1,000) + (7x100) + (9x10) + (1x1) = 3,791.

   In binary it is the same process, just that the place values are different, and easy way to remember is it starts with 1 and is doubled each time. So (1x2,048) + (1x1,024) + (1x512) + (0x256) + (1x128) + (1x64) + (0x32) + (0x16) + (1x8) + (1x4) + (1x2) + (1x1) = 3,791. An obvious way to make this faster is ignore the multiplication part because if its 0 it doesn't add to the value and you can ignore it, and if its 1 just add the place value its because anything multiplied by 1 is equal to itself.

Here is a simple converter:

More information can be obtained here : http://en.wikipedia.org/wiki/Binary_number
By the end of this lesson you will see there are 10 kind of people in this world those who know binary and those who don't.

Thursday, August 8, 2013

[Computer related tutorials]

In this portion I will be making tutorials and help guides for computer related things that I know/learned to help/teach others, I believe knowledge is power and knowledge should be free

Learn Binary
Learn Hexadecimal

Thursday, July 18, 2013

PNG Crush EZ

I have been making some small programs here and there, and here is another. The original program is called PNG Crush by Glenn Randers-Pehrson which is packed inside mine. What I've done is again something that might be useless but here it is. Its basically to make batch processing using PNG Crush easier. Simply group select the PNG files you want processed and drag them onto the PNG Crush EZ executable, it takes care of the rest.

What PNG crush essentially does is removes metadata from PNG files to make them a bit smaller in file size.


Note: The original PNG Crush executable is extracted into the "C:\Windows\Temp" folder.

Saturday, June 29, 2013

HumanAddition - Addition calculator using human method

==[Update 1]==
Performance Improvements
 - Same test as before now takes less than 1 second (~ 700ms)
 - Changed the logic up a little to remedy the "different number lengths taking longer" issue, now if
   you add a large number with a small one it will be faster than adding 2 same size numbers.
Non-Number Checks
 - Removes all characters that are not valid digits
Progress Bar/Report
 - Progress loading bar and percentage, but it bugs out on very high numbers like one with 50,000,000 digits

== Download ==

== Code ==
This probably isn't perfect, anyone wanting to make changes are free to, and submit them if you want in to comments.
Welp I made another possibly useless simple program lol. This program is a single function calculator in that it only does addition. The purpose of this calculator though is adding two large numbers and presenting every digit. It does this by utilizing how we were taught addition in school, add two numbers starting from the right, if there is a carry, add in the carry. This calculator can be considered slow, any number ~200,000 digits long from what I've seen is practical, larger numbers will obviously be slower, it also depends on what the number is. For 2 random numbers I made both with exactly 200,000 digits, it took 134,369 milliseconds, or 134.369 seconds or, 2.240 minutes.

There is also a bottleneck or bug (what ever you want to called it) somewhere, when adding a large number with one of less digits or vice-verse, it takes longer then adding 2 large numbers of the same number of digits, I might fix it sometime later.

Comments would be nice, If you haven't noticed I am bored and making small programs lol.

Thursday, June 27, 2013


Here is a simple program I made for a friend it's very simple and actually is my first actual program that I will be showing source for (Below) but only because its so simple that I don't think I made an mistakes anywhere :P .

This program simply flips images on the horizontal axis. The resulting output is in PNG format so keep that in mind though you can change that if you want using the source provided.

== Features ==
Flips images on horizontal axis
Converts to PNG format

== Download ==

== Source ==

Comments would be great, haven't been really active with school being in the way lately.

Monday, February 25, 2013

Manga/Image archiving program

I made this program a while ago due to me starting to collect manga. It was very cluttered and really a complete mess and manga with many page scans just looked ugly in a folder. So to organize my new found hobby I made a simple program that will archive my manga collection into single files known as simple manga pack (.smp). Sure there are other similar programs made for comics and such out already and I've tested them and in some cases my format rivals even them. For now the program is in 2 separate executables, one to create SMPs and one to read them but I plan to implement it all in one program in the near future as their current states are incomplete and is only functional and not final.

Download Simple Manga Packer (creates .smp files)

Download SMP Reader (reads .smp files)

To be implemented:
- Encryption
- Compression
- Volume, Chapter seperation
- Volume, Chapter, Page seeking
- Descriptions
- More Viewing modes
- Extract image sequence from smp
- Importing folders to convert to smp
- smp preview before packing

Current smp limitations and specification (subject to change):
- 65535 scans possible in smp file
- 255 characters possible in smp file
- 16,777,215 Byes max per scan (under 16 MB)
- Only jpeg, png, bmp supported as inputs

As mentioned compression is not implemented yet so it will be larger then other formats out there but it has been tested and results are good.

How to use:
- run program normally
- drag and drop images into list
- provide a name for the smp
- click pack

-  associate file extention .smp with the reader and open reader by double clicking the smp file you wish to read.
- another way is through dragging and dropping the smp ontop of the excutable
- another way is through command prompt
                                     SMP Reader.exe <input smp file>