Thursday, September 6, 2012

Budget Buddy Transactions and such

 


Above are two snapshots of the transaction Area. In the left image, the +Add Transaction button causes some Javascript to display a form to add transactions, and in the right image the Add Account screen is shown. When transactions are actually in the system, it looks something like the image below:



I'm working on the Edit button right now, which will allow you to change a transactions Name, Amount, Or Date. The trick is going to be updating the account to reflect the change. But once thats done I can get into the meat of the program itself, which isn't its checkbook, but tagging transactions and reporting spending habits based on them.

Sunday, September 2, 2012

SQL foreign key issue. Errno 150 in BudgetBuddy

Budget buddy is coming along, Im working on the transactions page. I worked for a couple hours trying to get an htaccess file to work before realizing that my apache server wasn't set up right, and then had to rework a bunch of code to make the site work again. Alot of relative linking was going awry. Luckily a bit of GIT magic brought me back to working correctly so, its ok!

Coding today took a fun detour for about 10 minutes while I tried to figure out why I couldn't apply a foreign key to my database after successfully applying one before. Heres what I had as a problem and how I solved it:

3 Tables, userinfo which has a primary key of userid, accounts which has a userid associated with it and a name (as well as an amount), and then a transactions table I had just made. So I successfully altered transactions to reference userid from userinfo so that it cascades for both updating and deleting. And if anyone doesn't know how to do it, this is the page I go to everytime I need it: This site is good for foreign key info

But then I went to apply the accountname from transactions to be a foreign key from accounts and started getting this errono-150 bit. Completely unhelpful, saying I couldn't create a table such and such. This unhelpful bit led me to google the error number and I quickly stumbled onto this link. After looking at a couple of the reasons for error I figured it was because the account names weren't indexed. I hadn't told them to be primary keys because multiple users could have an account called "Checking". But then I read up on indexing and then used the mysql documentation on create index to add an index to my table. Tried to alter it again, and viola, foreign key accepted.

I hope that if anyone gets an error similar to the one I experienced that they find this blog and use the good couple of links to fix it!

On a side note:
Has anyone ever noticed that viola, when pronounced with a bit of an accent should probably be spelt walah?

Saturday, September 1, 2012

A break from BudgetBuddy for some evolutionary computation

http://practicalcryptography.com/cryptanalysis/stochastic-searching/cryptanalysis-simple-substitution-cipher/#python-code

I just found this bit of code to break a simple substitution cipher. Its an extremely simple hill climbing algorithm but I'm wondering if I couldn't improve on it by using different methods. I wonder how ALPS or another evolutionary tactic would fare against solving ciphers.


Friday, August 31, 2012

Budget Buddy Homepage


After a half hour of messing with the css, I finally got the buttons in my home page to center well. This is the main home page of budget buddy, if you have accounts it displays them like the above and if it doesn't then it displays the following error message:


All in all, the login, signup, and now home page are functioning correctly, now I just have to make everything else! So excited!


Tuesday, August 28, 2012

Budget Buddy in php

https://github.com/EJEHardenberg/BudgetBuddy


Well I've tried to do this project a few times already, and most of the time the method of storing the data was the primary inconvenience in java and c#. But with php I can use mysql to easily store anything and everything.

So I'm modeling it like an app, and this is what I have so far. A clean interface, and a sign up and login page that are working. Well, I'm currently working on making the log-in secure but besides that its all good. This has been my baby for the last 2 days. And after some CSS magic and stack overflow results I fixed an error that had stuck me and I can keep working.

Word for the wise, do NOT store hash's into a binary type sql field. Binary types mess with strings and can cause string comparisons to result in errors, I learned this the hard way over the past few days until I stumbled onto a small comment on a stack overflow page about hashing.

Tuesday, July 17, 2012

Complete



As you can see, I added a little bit because I forgot about youtube linking. But tada, theres the input, a few button clicks later and the second image is what results. Cool right?

This literally took about 30 minutes or so to whip out. A simple iterator goes through the item lists (0000,242323, 2323) and makes the links to the SKU's. And besides all that its simple plug in play. A file stream and a stream writer object are all thats neccesary to use.

Also, I have it generate simple random file names by using the Path.getRandomeFileName() function.


Here's all the code in very zoomed out mode, 142 lines

SKU Maker Basic Interface

So I've finished up the basic interface design. I might mess with the color scheme a little to make it easy on the eyes, but now let the coding begin! I figure it will be fairly basic and easy. All I'm doing is generating some xml from the information I'm getting from my text boxes. The only thing that I'm going to probably have to watch out for is escaping special characters. 

Oh, and of course change the default form name to a good name for the program. Probably going to call it Sku Maker or something. Also I've been thinking about causing the add sku button to either just do a simple pop up dialog, or to have it able to read from Excel datasheets, because I do have a good amount of data in excel... we'll see how ambitious I am after coding the basics