Programs are moving along nicely. I have 459 books in the database so far. I can search by Title, Author and Genre and display the info. Still need to make a way to indicate that a book was read and by whom. Will want to the ability to modify the data too because sometimes I pulled double descriptions and its annoying to modify the database directly.
The Barcode scanner is annoying because I had to increase the timeout more to get all the codes. Will have to revisit the technical specifications to see if I can tell what is going on (betting that the code I have is a little lacking...)
Was able to reset both scanners to defaults and now they both beep when a code is scanned, just so I can confirm it :).
Have a lot of books that don't have barcodes so I'm manually typing in the ISBN. Have some books from the 50s that don't have the ISBN so I'll have to figure out how to manually get them into the database :).
All in all, I'm pretty happy with the way it is turning out.
Sunday, August 14, 2011
Thursday, August 4, 2011
Book Database
Well, my book database is moving right along. I found that the barcode on the back of the book isn't very reliable so I've moved to the ISBN number on the inside cover and this barcode seems to give me good data consistently. The problem is that those barcodes are only included on books made after 1986.
I scanned about 50 books with my Symbol CS1504 barcode scanner and when I went to pull them in with my program I only got 19 records... WTH? In trouble shooting the code (C#), I found that if I paused 750 miliseconds after each 'batch' read from the scanner that I would get the correct number of barcodes. Very strange. My current theory is that the code is just too fast for the serial comm to keep up.
So I have those codes stored in a database and now I am working on the program that pulls the data from Amazon (PHP). I've got it pulling the data and putting into my book object, now I just need to write the code to store that data into the database.
After that I will work on the code to view / search / edit the data (PHP).
I scanned about 50 books with my Symbol CS1504 barcode scanner and when I went to pull them in with my program I only got 19 records... WTH? In trouble shooting the code (C#), I found that if I paused 750 miliseconds after each 'batch' read from the scanner that I would get the correct number of barcodes. Very strange. My current theory is that the code is just too fast for the serial comm to keep up.
So I have those codes stored in a database and now I am working on the program that pulls the data from Amazon (PHP). I've got it pulling the data and putting into my book object, now I just need to write the code to store that data into the database.
After that I will work on the code to view / search / edit the data (PHP).
Thursday, July 14, 2011
AS400 / iSeries Fun
Where I work we still have some Cobol programs in use and I am the only one that supports them. I decided that I needed an easy way to pull the source code to my PC so I could use a slightly more friendly way to review the code and figure out what it does (so I could replace it with C# code).
Turns out that old school is the way to go. I FTP'd into the server, changed into the appropriate library and did a get on the source file I wanted. Very nice and easy. Then I decided why not just pull it all so I did an mget and it worked. Very nice! Dropped all the source onto a Linux box so I could grep it anytime I wanted. Did a WC on it and found that we had about 1.5 million lines of code spread across 7000 programs.
Wanted to share how I did it for others:
cd (some folder here to store the source files)
ftp servername
Enter Username & Password
cd (library here)
prompt (to turn off prompting for each file)
mget source.*
(wait for it to finish)
quit
Enjoy!
Turns out that old school is the way to go. I FTP'd into the server, changed into the appropriate library and did a get on the source file I wanted. Very nice and easy. Then I decided why not just pull it all so I did an mget and it worked. Very nice! Dropped all the source onto a Linux box so I could grep it anytime I wanted. Did a WC on it and found that we had about 1.5 million lines of code spread across 7000 programs.
Wanted to share how I did it for others:
cd (some folder here to store the source files)
ftp servername
Enter Username & Password
cd (library here)
prompt (to turn off prompting for each file)
mget source.*
(wait for it to finish)
quit
Enjoy!
Saturday, July 9, 2011
Finished TARDIS Piggy Bank
Thought I would share pictures of the TARDIS "Piggy Bank" I made for Sam. He chose the color. It is 17" tall by 7.25" wide (square). The light on top is a single LED bulb that cycles through 7 different colors and flashes. It can also show any one of the individual colors (by pressing the black button). Josh's is very similar but blue and a little bit shorter.
Saturday, July 2, 2011
Old but still great code
I decided to resurrect some old 3D dot rotation code (1993). It was in C so I converted it to C# (not a big stretch) and it works pretty good. The key was double buffering.
Right now I am working on a whole 'font' that will allow me to rotate just about any string.
(these are predefined elsewhere but thought I would include them so you could see how the are created)
offScreenBmp = new Bitmap(this.Width, this.Height);
offScreenDC = Graphics.FromImage(offScreenBmp);
backBrush = new SolidBrush(Color.Lime); // i set the form transparency key to this
this.TopMost = true;
the 'display' code looks like this (I will be cleaning it up later):
private void DoDotAnimation()
{
while (! ClosingIt)
{
MoveDots(); // never guess what this does...
Graphics clientDC = this.CreateGraphics();
offScreenDC.FillRectangle(backBrush, 0, 0, this.Width, this.Height);
Color newColor = System.Drawing.Color.Red;
for (i = 0; i < PointsN; i++) // run through the dots array and draw them { if ((TheNewDots[i, 0] > -1) && (TheNewDots[i, 1] > -1))
offScreenDC.DrawEllipse(new Pen(newColor, 2), TheNewDots[i, 0], TheNewDots[i, 1], dotSize, dotSize);
}
clientDC.DrawImage(offScreenBmp, 0, 0);
Application.DoEvents();
}
}
Right now I am working on a whole 'font' that will allow me to rotate just about any string.
(these are predefined elsewhere but thought I would include them so you could see how the are created)
offScreenBmp = new Bitmap(this.Width, this.Height);
offScreenDC = Graphics.FromImage(offScreenBmp);
backBrush = new SolidBrush(Color.Lime); // i set the form transparency key to this
this.TopMost = true;
the 'display' code looks like this (I will be cleaning it up later):
private void DoDotAnimation()
{
while (! ClosingIt)
{
MoveDots(); // never guess what this does...
Graphics clientDC = this.CreateGraphics();
offScreenDC.FillRectangle(backBrush, 0, 0, this.Width, this.Height);
Color newColor = System.Drawing.Color.Red;
for (i = 0; i < PointsN; i++) // run through the dots array and draw them { if ((TheNewDots[i, 0] > -1) && (TheNewDots[i, 1] > -1))
offScreenDC.DrawEllipse(new Pen(newColor, 2), TheNewDots[i, 0], TheNewDots[i, 1], dotSize, dotSize);
}
clientDC.DrawImage(offScreenBmp, 0, 0);
Application.DoEvents();
}
}
Sunday, June 19, 2011
Cool ASCII Text Generator
Found this cool ASCII Text generator awhile ago... thought I would share with you http://www.network-science.de/ascii/
________ __________
___ __ \_____________ /___(_)___ ________ ___
__ /_/ / _ \_ __ \ __/_ /_ / / /_ __ `__ \
_ ____// __/ / / / /_ _ / / /_/ /_ / / / / /
/_/ \___//_/ /_/\__/ /_/ \__,_/ /_/ /_/ /_/
________ _____
___ __ \_________(_)______ ________
__ /_/ /_ ___/_ /__ __ `__ \ _ \
_ ____/_ / _ / _ / / / / / __/
/_/ /_/ /_/ /_/ /_/ /_/\___/
Saturday, June 11, 2011
Soda Can Airplane
Many, many, many moons ago, I was given a Soda Can Airplane made out of Mountain Dew cans. I've always wanted to make another but with the "Pitch Black" Mt Dew cans.
I've looked all over the Internet for 'free' plans but no one has them.
I found this site today: http://www.sodaplanes.com/pictures/cutting%20cans.pdf that at least gives me good instructions on how to cut the cans.
Now if I can just figure out how to build a duplicate of the one I have I'd be really happy. My boys would be very happy too because they would get one :)
I also found a site that sells plans for making a corsair (my favorite plane... probably due to Black Sheep Squadron), but I'm thinking I'm too cheap to buy them... at least for now... Someone else can feel free to buy them and send them to me... :D
I've looked all over the Internet for 'free' plans but no one has them.
I found this site today: http://www.sodaplanes.com/pictures/cutting%20cans.pdf that at least gives me good instructions on how to cut the cans.
Now if I can just figure out how to build a duplicate of the one I have I'd be really happy. My boys would be very happy too because they would get one :)
I also found a site that sells plans for making a corsair (my favorite plane... probably due to Black Sheep Squadron), but I'm thinking I'm too cheap to buy them... at least for now... Someone else can feel free to buy them and send them to me... :D
Subscribe to:
Posts (Atom)

