Tuesday, November 26, 2013

JediChat update

I got the server GUI working right (for the most part). I'm going to post an image of my progress (yes there is one error in the chat dialog, BUT AT LEAST IT WORKS).

So here is an image!

I have two clients and one server. And a launcher in the upper left-hand corner (but you can't see it). The default port is 31337, but you can change that. Just click the "start listening" button and the server will wait to accept new client connections.

See the error? [NEW_USER] is one of the software-level protocol broadcast messages I spoke about in the previous post. It's broken here, but the error gives an opportunity to explain what it does. For now, I only have [NEW_USER] and [USER_LEFT] (tells clients to update online user lists), but I'd like to work in some others in the near future. When the client reads the special broadcast messages, it doesn't treat them like regular messages, it tells the client to do something. It reminds me of my scripting language, and how it works. Very similar. Very awesome. I really like where this is going.

ANYWAY. I've got /connect user@server:port and /disconnect working and I have a lot of other cool slash commands like /nick and /who, but I also have a new command in mind: /new user, which will open a privatized chat tab!

OKAY. Well. I'm off to bed. It's 4:00 AM here in OKC. 1337dr34mz c0d3junk33z

Friday, November 22, 2013

JediChat

In Advanced Java, we have to get a development team together, talk about a final project, and then work on it.

The professor told us to get to know the others in the class so that we'd know who to add to our teams, but the task was due by the following week. I actually have some pretty decent social skills thanks to my year of retail experience (and being a decent salesman), but I still didn't have enough time to meet every single person in the class. I decided to add the guys who sat closest to me. The majority of that class has dropped anyway. I'm glad we stuck around.

ANYWAY. "Jedi?"

A long time ago (2007), I was concurrently enrolled through my high school at a local voc-tech (MNTC), and I took my very first programming class at this school. The language was Java, and when time came to assemble a team, I did, and I named my team the "Java Jedis." We were all Java Jedis.

Now that I have provided a historical explanation as to where the "Java Jedi" idea originated, you can extrapolate what I decided to call my most recent team. And the project I decided we should write is "JediChat", IRC-like chat software written in Java for and by Java Jedis.

I've written everything by hand, by myself, but I did have to use Google to remember how to sockify everything. Worked on a software-level protocol for sending the messages, and made a pretty GUI with Netbeans. Yes, I use Netbeans; not Eclipse and Windowbuilder. I'm a huge proponent of Netbeans (it's what I've been using for six years).

Here is a screenshot of a console based server (for debugging) and the graphical JediClient sending messages to it.


It needs some work; not going to lie. See that empty box on the right-hand side of the frame? That's a user list. Notice the tabbed pane? The main tab is the JedIRC (clever, I know) view, which allows a normal broadcast chat for all users to communicate simultaneously. Privatized messaging is on its way. The JediServer GUI is pretty basic, with just "kick" and "start listening" buttons, and a list of users, and I'm thinking maybe the console-based server is the better option (I'll include both) in the tarball.

P.S. I've been sick for the past week, but I'm still being productive.

And if you are a Java Jedi as well, may the source be with you.

Wednesday, October 2, 2013

WebParse: A Simple HTML Parsing Library for C#

So last night, when the government had officially shutdown, I posted at Facebook that I was writing an HTML parsing class library in C#. I just now finished it.

Here is a screenshot of it in action.



You can download it at Github.

P.S. If you follow me, I'll follow back. :]

Sunday, September 29, 2013

USL Update

I made a mistake in my last release. I broke the sysExec function, but it's fixed now.

I have been working on a startup with a friend of mine which I won't make public anytime soon, but that and school plus work is keeping me pretty busy these days. I'm still looking for a programming job. Even if it's something like $30,000 annual salary. Anything beats my current hourly pay.

Anyway. Here is a code sample demonstrating some USL code manipulation.



So what's going on in this code? We've defined a method called "ls" that lists either the directories or files within the current working directory. This is done by storing the procedure in a variable called @code. If the parameter passed is a string containing the letter "d", a for-loop which generates a temporary list of directories in a specific directory (found at @path) will be written to the @code variable. You can guess what happens if the letter "f" was passed instead. But something really cool happens in the else-block. Since an invalid parameter value was found, we set @code to the commentation symbol #. After the endif, the rest of the code is appended. If an invalid parameter was passed, the code executed is just a comment. It may be a bit quirky of me to be excited about the discovery of cool tricks in my own language, but I'm just a quirky dude like that.

Follow me on Github!

Monday, August 26, 2013

Back to School!

I'm back, and I'll probably be posting here more often. I'm going to ask my professor if I can post my solutions here or commit them to github and link them here. I got a new job. I'm working as an EasyTech Associate at my local Staples. I don't get to touch computers, but I do help the techs when they ask for help. It appears I'm the only person there who is comfortable in a command-line environment. My job is to sell protection plans. I don't make commission either, we just have to sell plans to make our store look good (and earn the corporation some extra moolah). I feel ridiculously underpaid and I'm not given enough hours. But this blog isn't dedicated to complaining about retail jobs. This blog is about code.

So I'm back in school. I'm really close to graduating, I have two more semesters and I'll be able to get my Associate's in Computer Science. I'm not really sure if I'm taking the right degree, because I checked the "Computer Programming" degree and it says the highest math course required is College Algebra. I'm in Trigonometry and I took Pre-Calc/Analytic Geometry last semester. Who knows...

Anyway! So I get to Advanced Java, and the classroom is full of seemingly competent programmers. My professor is a nuclear physicist by trade, and the overall experience is something I'm not used to. But I really like it a lot. The first assignment was to code recursive and loop-based methods for generating Fibonacci numbers and calculating factorials. Right off the bat, I'm supposed to know about asymptotic algorithm analysis, and how to draw recursion trees. I've never had to draw a recursion tree, nor do I know what one is. I am currently collecting data in hopes of extrapolating the largest value of fib(n) calculable in 1 hour, 1 day, 1 month, and 1 year. I am currently still in the 1 hour zone. But I'm getting there. The recursive fib(n) seems to be in the order of n^2 aka O(n^2), but I'm really not sure what he means by "spatial and temporal performance." I googled these terms and could not find anything relevant. I also checked the books index and couldn't find anything. So I'm hoping he will clarify tomorrow. And I'm hoping I'm not the only person who has absolutely no idea what he's talking about.

Anyway! Here's a screenshot of my progress.

In the first window, I use my scripting language to compile and run the java program. The second window is the source. The third window is the USL interactive shell. I could easily use Python instead, but I really have grown attached to this language, and so I use it everyday as a general scripting language.

Anyway! The same professor also teaches my C++ class. And I seriously enjoy that class. I'm going to ask if I can post my source code here. I wrote a really awesome algorithm for converting Roman numerals to decimals and I'm very happy with it.

Follow me on Github!

Wednesday, April 17, 2013

PageCrawler

So a couple of days ago I was browsing a forum and found a board with tons of links to computer science related eBooks. I found one link to a book called Security Engineering by Ross Anderson, and the webpage contained links to all of the chapters, each in a separate PDF file. I figured downloading each PDF by hand would be far too time consuming for anyone, so I developed a solution to this problem.



PageCrawler lets me download all of them at once. It reads a webpage, parses the HTML in order to find hyperlinks (specifically for hypertext references) and compiles a list of each based on the file types I'm looking for. Click "Save" and select the directory to save to. Voila!

I'm working on the "Extensions" button when I find some time between school, work, and homework. The "Extensions" button will parse the page and list all of the found file extensions in the "File Extensions" text box.

A friend of mine put forth a suggestion to grab files from a range of web pages, and so I'll implement that as well (in time).

I'll post to SourceForge this weekend!

Tuesday, March 26, 2013

Binary Search in Java

I implemented a binary search algorithm in 36 lines with no outside help whatsoever. We learned the linear search and bubble sort algorithms in Java class today, and we described the binary search but didn't actually code it (we will this Thursday). So I decided to skip ahead a bit and try to write it myself. I had to work out a few kinks along the way, but it works! It works very well actually. And I feel that kind of accomplished feeling that I love to feel.

And I've added some new keywords to my OO-scripting language. I'll release it pretty soon!

Monday, March 18, 2013

Designing an Application Launcher

I try to employ minimalism in most of the applications I've been developing recently. I'm using Windows 8, and I'm not upset at all that we don't really have a "Start Menu" like the olden days of Windows, but I would really love to have a sort of "Application Folder" to access all of my favorite applications. So I've spent the past few hours writing this "AppLauncher" thing, and it's very low-tech at the moment, but it works the way it should.



After I get this going I'm going to write something similar to the original "Start Menu" except using Blend and WPF (I've never touched Blend before, so that will be exciting!).

I'm waiting on my friend Braden to design a cool icon for this "AppLauncher" project. I'm sure you could tell from my PageNotes icon that I'm not the greatest artist in town. :P

I expect to release this within the next day or so, and then I'll begin the WPF "Start Menu."

I really hope Winforms doesn't die out, but I also love learning new technologies. Time to sleep. I have to go to work in nine hours and fifteen minutes, and I'd like to be mentally prepared for whatever is in store for me at Burlington Coat Factory... please save me from retail...

Sunday, March 17, 2013

PageNotes 1.0.0.4

I'm glad people are finding PageNotes to be useful. I've added a few new features that should make life easier and extend the usability of the software itself.

Open webpages directly from PageNotes by selecting a page note, right-clicking the list, and selecting the "Open" option in the context menu. This works for multiple pages as well. So if you select all page notes (by pressing CTRL+A), right-click the PageNotes list, and select the "Open" option, all of the pages will be opened in your default web browser. If you use a modern browser, your selected pages will be opened in new tabs. You can also select specific items by holding CTRL and clicking the items you want to open, remove, or copy.



Copy pages or notes (or both) to the clipboard by right-clicking the PageNotes list and selecting the "Copy->Selected Pages" (or Selected Notes, or Selected Pages+Notes). So if you'd like to copy a list of your pages to send in an email you can do just that.



If you want to reload PageNotes (to see your currently saved page notes), you can reload without restarting the application by pressing CTRL+F5. This will just read the database (if it exists) and populate your PageNotes list.

Also, if you'd like to know why you can't find the PageNotes flat-file database (assuming you haven't checked the source code), you can just look in the PageNotes.html file that the application generates. I create a comment space at the beginning of the file to contain the data. So the PageNotes.html file is a flat-file database in itself.



PageNotes (v1.0.0.4)
--------------------
Source
Binary

Please view the README for more information about how to use PageNotes.

Monday, March 11, 2013

PageNotes

When I'm surfing around the web and I find all sorts of interesting pages and articles to read, I just want to bookmark all of them and get back to them later. But if I did that (at my rate), my web browser would be way too cluttered with unnecessary bookmarks and whatnot. I came up with a solution to this problem by creating my own webpage bookmarking system. It's a bit low-tech, so it's a standalone application but it generates a pretty neat (and "minimalistic") webpage for accessing all of my soon to be read bookmarked webpages. I call it "PageNotes" because each entry has a "note" attached which gives each bookmark a meaningful description of what the webpage contains. The note can be incredibly long if you wish, or as brief a single char. With that said, I'll give a couple of screenshots to demonstrate.

This is after adding three entries.


To save, press CTRL+S. To open the PageNotes.html, press CTRL+O.


Here are the files!
Source
Binary @ Softpedia

For more information on how to use it, check the README at the project page.

Wednesday, March 6, 2013

Code Generator (Java)

So I'm taking a Java class at my local community college and I realized how tedious it is to code out accessors and mutators for each class level variable in our assignments. I noticed the frequency of my copypastas and decided enough was enough! So I wrote a small application to handle this for me. Basically, it's a window with two TextBoxes (i/o) and one Button (to generate code). It takes a list of "simple declarations" and with a little bit of string manipulation creates a public accessor and a public mutator for each specific variable in the list. The datatypes aren't hard-coded, so it just uses what you give it.

When the application runs, I give a synopsis on how to use it (in the "Input" TextBox).


So we paste our list of class level variable declarations.


After the text is pasted into the "Input" textbox, we can click the "Generate" button.


Click the "Output" TextBox once to copy the accessors and mutators to the Clipboard (to use in your source).


In the future I could parse the lines for multiple variable declarations on a single line, or strip the assignment operators and everything beyond them. Until then, this will work. :]

To download the source files, click here.
To download the binary, click here.