The Blogs

Oh boy, I haven't worked with stacks sense college. I know how they worked, Last In First out, and all that. So if you don't know what a stack is, here are the basics:

24 November 2014
Ok this is huge, .NET has gone open source: link! Somewhere a java developer is crying because the only thing that made java better then C# is going away soonish. Now when I first heard about this open source thing this morning, the first thing that came to mind was: what is going to happen to Mono? So I did some digging around, turns out they are going to try to combine the .Net framework with Mono!

Now if you don't know what Mono is, it is a open source version of the .NET framework. Now Mono has a few problems, like it doesn't perfectly replicate the CLR compiler in every way, some times things just work different on Mono. So now that everyone has access to the .NET framework, at least once they get all of it up online, people can fix the issues that Mono was having. This wont happen over night, but I'm guessing all the C# open source nerds will be jumping on this and trying to combine Mono into the .NET framework as fast as possible.
20 November 2014
Alright let's go over the stream ticker that I have on my main website. If you didn't know, on my website if someone is streaming and they are in a text file list, their stream name/info will show up at the top of the page. I did this using the rest API from twitch and using Ajax to call a method from the server and reload the page asynchronously.

First off, for the ticker I just ended up using a jQuery plugin called liScroll. I had some problems figuring things out at first, but after a while I got everything I needed from it.
10 November 2014
Alright today is going to be a short post, but I want to talk a bit about best practices. Not any best practices in specific, but just when and when not to use them. For me, I feel that best practices are something that should always be followed when you are new at something, but slowly you learn why they are best practices and the pros/cons with them; then you learn when not to use them. As a general rule of thumb, if using best practices making something harder to read, conflict with the groups coding standards, or is intended for performance when performance doesn't matter, you should use what you are comfortable with over best practices.

Now there are a few times where I think you should always use best practices. The two big things are security and performance. I don't think I really have to go into security, I mean I would hope any programmer would know to do a strong level of encryption instead of sending something as raw text if it is sensitive information. But for performance it's a bit more gray. Now the more performance matters, the closer to some of these best practices you should follow. Like if you have a string that you are going to do a lot of modifications on, you don't want to use a normal string, you want to use a stringbuilder. The reason? Because strings (in C#) can't be changed, at all in anyway, when you change a string it will make a new string object. Now there are tons of different examples I could go into, but I think you get the point.
06 November 2014


Alright let's talk about IRC stuff. Now this is the irc code I use to deal with all my twitch stuff. I'm not sure if there is any differences that you would have to handle on normal IRC servers, so keep that in mind. Thinking about it now, I could probly make a simple API to handle all of this stuff but for the 3 different applications I use that use IRC I just copy over code, whatever. Also I have built this in a way so there is only one chat open at a time, I havn't looked into doing more then one channels at a time.

Alright let's go into a few of the class level variables I use. I'm not really going to go into them until I use them. I just want to show what kind of things we will need on a class level.
03 November 2014
Ok so I think from now on I'll try to do two post a week. The first on Monday going over code I've written and talking about each line and stuff like that, and the other on Thursday talking more about what I think some best practices are along with backing up my ideas. If I can't think of something to write or I don't have code I might just skip that day, or spend the time I normally use to write a post to try to make an ASCII penis. Also please keep in mind that most of the things I will be going over will be aimed towards C#, and by no means these are guides you should follow.

So I guess the first thing I should go over is naming conventions. I guess there are two things to cover: how and what to name things, and with that why you should do something like what I do. So first off let's talk about notations. Now if you don't know much about notations I'll try to show some examples of what I mean. On the other side of things, what you should name things isn't, what I would call, an exact science, but we will get into that.
30 October 2014
Alright so over the weekend I started and finished my pandora controller for twitch. It should have been pretty easy but I got stuck dealing with the IRC part. First before we get into code, let's explain the features of it. For users it's pretty simple, there are only 2 or 3 functions depending on how you count it. The 2 important ones are "!up" and "!down", if someone does one of these commands it will add a vote to up or down. The other command is "!songInfo" which just displays the song, artist, and album, kinda pointless but helpful if you can't see the full names because it's longer then the window.

Let's go into the structure of how this is build; there are 5 main classes: MainWindow, DriverShit, Pandora, Irc, and Voting (yes I did name a class "DriverShit"). Now here is a quick overview of the classes. MainWindow: Updates the UI, starts DriverShit, and creates the context menu. DriverShit: Starts Pandora, Irc, and Voting; runs loop to check pandora and finish voting. Pandora: Start/Login to pandora, get song info and time remaining, and clicks up/down vote at the end of a vote. Irc: Handles the Irc connection, does read in/write out functions. Voting: handles voting.
28 October 2014
So If you don't know my motherboard and cpu broke, so I didn't have my computer for like 2 weeks. Also I didn't know my cpu was broken so I only RMA'd my motherboard so now I still have a broken CPU. But lucky I hijacked my wifes CPU. So because of that I havn't done much coding, so I didn't see much of a reason to write an update. So I have done some coding but nothing major so I want to talk about some plans I have.

The main thing I want to do next is a Pandora control for twitch/irc. So my viewers and up/down vote songs in pandora and slowly build a playlist. I've tried to do this in the past but I had problems. Most of the problems I had was from not being able to get information from the pandora application. I tried the official app and a few open source ones. I could have messed with one of the open source programs and figure out how to do stuff, but oh well I have a idea that doesn't have me working with other people's code.
23 October 2014
So in short Testsabot is a Markov Chain generator hooked up to an IRC server that has the ability to manage votes. I'll ignore the IRC parts of Testsabot and explain more IRC stuff when I write about my twitch IRC client. Let's break things down into different parts of what makes Testsabot work.

Arguably the most import part is the implementation of a Markov Chain. By definition a Markov Chain is a state machine where the next state is only depended on its current state and chance. So one implementation of this would be most board games, like Monopoly, if you are ok Go and you role a 6 you will land on Oriental Avenue, but if you are on Mediterranean Avenue and role a 6 you land on Chance. So you might be wondering how does this translate into text generation. Basically we pick a random set of 2-1 word parts and then based off that we pick another random word part.
17 September 2014
So I have been thinking about making a blog for a while now, for a few reasons. For starters I just wanted to build one and see what I could do with it. I am a programmer and I love to make/program things whenever I need to, that is why I didn't just use a plugin or use a website for one. The other main reason is that I like to talk about things, whether it's about code, music, or something is just bothering me. If you know me at all, you know I love to rant.

So I guess I can point to that for a small kind of FAQ for now for this blog, but let's get into something a little more interesting. I'm going to go into a bit on how I built this blog.
09 September 2014