Friday, January 22, 2010

Networked memory

I just read an interesting article about how slime mold generates networks as efficient as the Tokyo Subway system, the only downfall looks to be related to redundancy.
Slime Mold Subways

Which get's me thinking, now that memory is a dime a dozen, can we have networks of the same data, and depending on where you are in the platter for example rather then having to travel say all the way across the platter to get the information, you can just stay in the local vicinity?

So Suppose you have the same data being transferred back and forth in different memory regions so they are all matching. Your head is already in a particular location of the platter, now rather then having to say move the head all the way from where it is to a location nearly opposite the location you currently are, there is a networked memory piece just a few micrometer's next to, or after what you're looking at. Now the disk doesn't need to seek as long, which tends to be the more time consuming part of data access.

Let me know what you think or do you think I'm off my rocker?

Monday, January 11, 2010

Deleting Files

I was having problems with a particular file, one of my scripts accidentally produced a file named such that I couldn't delete it.
I found a great tip here: Forum Post

All I had to do was find the filename using dir /x /a

Once i found that a simple del filename got rid of it.

Saturday, January 9, 2010

Analog Inputs

I've been fighting since late last night trying to get analog inputs working on my PIC16F684.

I finally got somewhere this evening, oddly enough for some reason, in some regions of the pot it goes really quick then just a small bit over will slow it down drastically.

All my code does is initialize everything to setup RA0 as an analog input, then it turns on the ADC waits until it's done then toggles the LED and waits the amount of time in the combination of ADRESH and ADRESL, all I had to do was put ADRESH into the integer value I had, shift it 8 positions left, then or the ADRESL in, then pass it to my wait routine.

Outside of that it's finally working, the last hiccup I had was well frankly I forgot to turn it back on after trying turning it off as a troubleshooting measure. Of Course I'll continue to plug VERSION CONTROL, had I gotten this working and decided to play a little here and there to make it say be more sensitive, I may have done myself in by messing something up, now I have no fear of that.

I am posting the code on my SVN server, and one day would like to be able to make that public so everyone can get to it, but I suspect my ISP won't like me using a web server out of my house, so I'll for now plan to upload it to Google Docs.

Below you'll find the vid of the PIC Kit 1 in action with the LED's toggling quickly then as I rotate the pot it slows down.


Here's the code to do it, there may be some unneeded stuff, let me know if you see anything off!

For the sake of testing I uploaded this file to YouTube and am going to see what the difference in appearance is here!


Thursday, January 7, 2010

Opening Mailto in Gmail in XP

One of the first things I did when I bought my netbook was to download chrome. Now I haven't actually clicked a mailto link until today, and guess what happened? Internet explorer in all it's glory opened up. I didn't like that. One of the solutions I found was to look for URI.mailto or something to that effect in the file types menu of an explorer window and make some changes there, but well I didn't like that method much and I couldn't find what they were talking about in the first place.

I started searching for the term mailto in the registry, and I came upon this line right below.

HKEY_CLASSES_ROOT\mailto\shell\open\command

Unfortunately I deleted the original line so if anyone has it I would really like to know what it originally said, but none the less I have the line to insert if you want Chrome to open up gmail and insert the mail address!

This brings me to my next point ALWAYS BACKUP YOUR REGISTRY in case you muck something up.

I changed the key
to the below (change out onaclov for your username) and you should be set to go! Of course if you want to use another type of email client and/or browser you're going to have to change a few things. Basically all I'm doing is calling the chrome application, and passing the gmail address with mailto and URL %1 passed to it. The ideal way would be to call the default browser

"C:\Documents and Settings\onaclov\Local Settings\Application Data\Google\Chrome\Application\chrome.exe" --app=https://mail.google.com/mail?extsrc=mailto&url=%1

Additional Notes:
Oddly enough I found that if I go to IE and click options and then programs it only shows Outlook Express and Windows Live Mail which I initially thought was the culprit and in some ways it might have been, so I did a search for Windows Live Mail.

I found this:
As you can see it looks like mine has an entry for GMAIL, which of course is completely incorrect
as I was testing some things out trying to get it to work, if you add a Key there and name it whatever you name it, when you go to IE and Tool Options and Programs and Email you'll see those entries the problem is I have/had no idea what to put in there which lead me to the initial piece of the post finding mailto.

If I had the original mailto contents I "might" be able to remember what that was doing and possibly setup the entry on the left (HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Gmail) to actually open whatever browser you want as well as whatever email client you want based on that location (rather then having to keep entering in the registry if you decide to change).

Well if you have any other items of note please let me know.

Good luck

Wednesday, January 6, 2010

Interrupts

In ECE 344 we learned about interrupts and how to use them, of course we were programming in assembly, so we had to setup our interrupt vector, then write some code at the appropriate offset.

That turned out to be pretty easy, but the problem is let's say we want to write some code in C and try to handle interrupts. This is a little tricky if you don't have all the information you need.

Well of course since I can't seem to think logically sometimes, I didn't look at any manuals and just headed over to stackoverflow.com, where I got some great answer's here: Interrupts

The simple answer was this:
void interrupt my_interrupt_handler (void) {
handle_interrupts_here();
}
I did some testing and once I had the right bit's turned on I just ended up in my interrupt routine with this (about 90% borrowed from here:Microchipc):
void interrupt isr(void)
{
if (T0IF)
{
TMR0=TMR0_SETTING;
T0IF=0;
RA5=1;
//code right here is executed every 800us
}

My newest project I'll be working on with this microcontroller is to find some way to create a simple serial interface which I can transmit and receive a piece of data. Since I can interrupt on a timed interval. I should be able to read data passed at an expected rate.

I'll keep you updated when I get more work done.

Sunday, January 3, 2010

SVN

So today I would like to go over the importance of version control.

Take for example I was working on a program, I made some changes and it was working. Now rather then checking in my file and version controlling it, I just started modifying it. About half ways through I realized I meant to re-save the file somewhere but instead overwrote the changes that I had originally working.

When you've gotten a particular program working at some point, if you're dedicated enough to stick to version control, you check it in, then keep working, now if you have made changes and wish to revert to a previous working state it's REALLY EASY. Now of course simple enough you can just save multiple copies of a file, and keep renaming it and everything else. If you use version control you really only "see" one file and you just keep checking it in.

I have SVN setup on my server, and am using Tortoise SVN for my window's machine, and am enthralled with it. When you do a checkout in SVN it ends up copying the checked out folder into your current directory. Now when you make changes it shows a different icon on the folders so you can visually see that it's needing to be committed. Now if you're working with multiple machines/people you will want to make sure you update before commiting.

Once you've committed changes you're set.

Good luck and let me know if you need any help setting up your very own SVN server.

Max RPM II

Well I finally got a few minutes to mess with my arcade after cleaning the garage a bit.

So far I have the lights on the coin op working, the flourescent light doesn't fully light, so I need to find out if it's the wattage or what. The monitor doesn't turn on at all, and the speakers just give a hum. I have to assume that the system isn't "booting". I found a site I can use to help me with questions here: Arcade Museum

I have 120V going to my monitor and have checked a few IC's on the Turbo Cheap Squeak.

In the hopes of using another computer monitor I tried hooking up the Horizontal sync to a regular CRT, and the monitor said the frequency wasn't correct. So at this point I'm assuming that it's a no go on that CRT.

I'll post updates as they come along. Have fun!

Thursday, December 31, 2009

Timed Shot Photos

So my original goal for this project was to take some pictures of the mountains at pre-determined times. I found that this might be useful in other cases as well, so I'm going to be building an enclosure next and allowing maybe a tripod screw mount.

S/W Requirements:
1. Set a period (eventually elsewhere, but for now in code)
2. Turn Camera on
3. Once camera's stabilized take a picture
4. Turn camera off.
5. Lather, Rinse, Repeat.


Here's some footage.

Tuesday, December 22, 2009

What is a web browser?

In commemoration of my 100th post, I decided to do a video post. Here I give a rough overview of what a web browser is. I'm sure it'll need more work, but hey it's a first and I just put it together with movie maker through windows.

The inspiration for this post was my mom, I was attempting to set her up with Google Voice, and when I was needing to get her to get on the internet she asked me "You mean click aol?". Unfortunately I suspect very strongly that my mom thinks that aol is the internet, and there are alot of people out there that think the same thing. Sit back relax, and hopefully I'm at least somewhat entertaining.



Once you've finished watching let's re-iterate what I'm trying to get across.
1. Web browser's are not the internet.
2. Web browser's are the vehicle that get's you to web pages.
3. You aren't stuck with only one web browser, you can try other ones.
4. Things you want to keep in mind are speed, real estate, following standards, usability, popups, and addon's.

Tuesday, December 15, 2009

Help Joe get an iPod touch

I posted a site joe.onaclovtech.com, hopefully I can get alot of people to donate a little, and we'll all get Joe an iPod touch.

Thanks anyone that helps out.

#joesipod

Monday, December 7, 2009

Clonezilla

Well I finally went about the task of imaging my hard drives.

I decided to use CloneZilla, as I read from lifehacker this would be best as well as a few light searches on the net seemed to refer alot to CloneZilla.

I ran into some problems, there is a USB helper that they recommend, that wouldn't boot my SD and/or my USB thumb drive.

I basically had to use Unetbootin, the nice thing is you can point to the .zip file you download from clonezilla's website and it treats it just like it's an image file and builds everything up for you on your drive.

Once I got that all working there were a couple more things I ran into. I'm assuming that my wifi wasn't going to work with this light "OS" so after a few tries I finally hooked into ethernet.

Once I got past that I found out that it was expecting a folder called partimag on the home directory, so I had to make that folder.

I also ran into problems when trying to specify my samba server, if I just pointed it to my ip address it seemed to have problems, so I actually pointed it to ip\folder, and that worked.

From there it was literally a cake walk.

Wednesday, December 2, 2009

Google Voice Ideas

I was logging into google voice again, and found myself in a familiar world. I send a text message, and when the person replies it's in my inbox AND my phone. The problem is, I have one of those crappy phones so I have to constantly be deleting messages because I run up to the limit.

Here's my thoughts, if you get a text message in Google Voice AND you're logged in, it gives the text message say 1 minute to sit in the inbox doing nothing, if you immediately respond INSIDE google voice, it doesn't bother sending it to your phone, additionally you could add a "send to phone" option for a text, then it will still send it to your phone in the event you're getting directions and you won't have internet access when you leave your computer.

Well there you are just one more idea.

Thursday, November 26, 2009

Troubleshooting

One of the biggest challenges in ECE 344 is troubleshooting on the system.

I mean walking through typing stp, then rrd when you want to read the registers.

In comes typical troubleshooting without a debugger, normally you stick some print statements in there and wait for the print fest to begin.

This bothered me because we can't really do this in our architecture very easy. The nice thing is that we learned about sub routines, and you can treat sub routines as functions if you do it right, so what did I do?

I wrote a sub routine that will print the register values at the time you branch and link, the main limitation, is that interrupts can change your register values once you've entered into the subroutine. This is where the mailbox architecture comes in, if you design your system so that the interrupts do as little as possible and leave everything as untouched as possible, you can then go into your print subroutine and it will print the register's last value.

There are probably plenty of other uses you can find for this routine, and maybe even better ways to use it, for example when you enter this subroutine it waits for a key press before you can exit. Once that happens you can return from your branch and link, this is great because now you don't just blow through your whole program before even really seeing anything.

This is untested code as I am unable to make it to the school until Monday at the earliest, but if you want to give it a try I'll link to it at the bottom.

Changes you'll want to make to allow this to integrate with your program is finding your location in memory you can stick the long ascii string I've built.

Additionally you'll need a 32 bit to ascii converting branch and link, which i haven't written, but we have written for our latest program. This will convert the actual register values to a printable value, as well as you'll need a push and pop routine at the beginning and end, with the pointer jumping by 40 each time, if you don't have this you'll have to find a way to get the data from the register's instead of memory as I'm doing.

As I have time I'll upload more files and a more complete solution but this is very far along and should only require small amounts of modification.

NOTE: As with any file you download from google documents, unfortunately just directly downloading it will have format issues. Copy and paste the contents to a new file and save as a .s file, otherwise you'll be chasing your tail trying to find problems that really don't exist.

Check out the code here: Print Function

Friday, November 20, 2009

Thoughts on OS's

So here are my thoughts on os's these days.

I just recently got my new HP netbook. It's a great little device, but here's my worry, it's not very powerful and it's running windows, My old laptop is running windows as well and is slowing to a crawl.

What are some common causes of slowed down computers?
From Computer Hope:
Hard disk drive is short on available disk space.
Several software programs have been installed/uninstalled leaving behind bad files and/or confusing the software.
Data Corruption.
Outdated drivers
Computer is overheating.
Corrupt OS.
Bad Hardware.


It would appear there are two common causes here.
1. The hardware capability is declining.
2. Operating System related errors.

Hold up before you start getting all upset and claiming that if the people who wrote the programs cleaned them up right then you wouldn't have these problems.

What I want to know is why these programs are becoming so integrated with the OS that the OS can't simply clean itself up?

I was watching the Google OS talk as well as reading a little on it. One of the things I noticed and it's becoming a bit of a theme across OS developer's now a day's.

Let's build OS's that are designed for specific hardware and really only market for that.

What I'd really rather see is OS's that when you load them up will look at all hardware connected and self configures itself to be the most optimal OS for that hardware. What this means is now instead of having 300 print drivers loaded into your system and 45 wireless network card configurations, the OS looks at what you have and decides what's best and get's rid of the rest. Typically true hardware to the system should have only those drivers loaded, no more, no less.

I know this sounds crazy and in some ways it is, but what happens next is the OS is also linked up with the web, so let's say you plug in a new hardware item a new sound card, a new stick of ram or something. Things might be a little hokey but with a basic set of drivers that will control (in a limited way) most hardware, you now tell the computer to rescan for system updates, at which point you can optionally load the new driver's for this new device onto your system, and again it re-configures itself to run as optimally as it can with this system.

What can this mean for boot up times? Well if the OS doesn't have to constantly be verifying what equipment you have and assume you just plain have it and go forward from there. If/When it runs into a hiccup such as it expected a stick of ram somewhere and didn't see it, it jumps to the degraded mode until you either update and "auto" re-configure the system or repair the problem.

I think if you can resolve hardware checks as well as re-design the bootup to start simultaneously kick off processes that will help considerably.

Once more, you won't have to constantly be pinging the devices (wasting power) just verifying that the components are there.

Tuesday, November 17, 2009

Syntax

Syntax doesn't require a whole lot of explaining. Mainly get a good source of information that you can understand, in this case we really only get a .pdf file with the reference manual so you really need to make the best of it.

In our "compiler" the system converts the assembly code that you wrote to a 32bit instruction.
This instruction can be analyzed by the student by breaking it down into opcode, from there that will tell you what kind of data can reside in the rest of the instruction.

One thing I'd like to do is write a syntax checker for the PPC 403 that we're using. This would be particularly helpful in writing code off site, and then making sure the syntax is right.

Once you can sucessfully "compile" then you're on to the testing, and possibly will return to this section.

Let me know what you think!!

Google Voice Screwups

This is a pretty hilarious site, they allow anyone to post google voice to text translations which many times turn out to be quite hilarious.

http://gvscrewups.blogspot.com/

Now here's my question some people post the "before" and after versions, is it possible to improve the translator's capabilities knowing this information?

Check it out and let me know what you think.

Wednesday, November 11, 2009

Google Voice

I just ran into another situation where Google can integrate their google voice application into, Google Maps!

I was searching for my doctor's office, it brought up an address and phone number, why not have a clickable link for those logged in that have GV, and they can click call this number and select which phone to ring, OR even text message address/directions to myself....

Just another little idea for the wide world of google voice

Concepts, the Leonardo of Programming

If you don't understand "what" you're trying to do, it's going to be very difficult to write code and/or tests for it.

Learning concepts can be difficult, some of the main things you need to think about "conceptually" is breaking any task down into 3 parts,
  1. Initialization
  2. Code that does the actual work (algorithm)
  3. Exiting
For initialization you can look most of the things up in the user's manual, once you know how to setup the actions you will be using, you can then begin to look at what you're actually wanting to do, which brings us to algorithms.

Algorithms are "how" you're going to accomplish the task you're attempting to complete. My favorite method is drawing it out in a flowchart design. But I have to "see" what I'm doing and that's one way of doing it, once you've managed to really nail this idea down, you can frequently just do it in your head, and reserve doing flow chart's for the more difficult designs that you really can't wrap your head around.

If you don't know your algorithm it's much like trying to write a paragraph about a subject that hasn't been given to you, you'll keep writing and rewriting your paragraph until you finally get the subject, but that doesn't seem very efficient now does it? Figure out your subject (or what you're trying to do) and THEN write the paragraph, much like figuring out your algorithm FIRST then code up the solution, this prevents large quantities of re-writing code.

Finally when you've finished your task, are there any "clean up tasks" that you need to complete? Do you need to return the register's to their original values? Do you need to clear out memory so that another operation doesn't accidentally use data you've shoved out there? Do you need to pop the stack? These are all things you need to answer when you've finished the task your algorithm is attempting to complete.

Tuesday, November 10, 2009

School Reports

What's wrong with School reports today?

Frequently we are told you need X number of pages, so you push and pull at your words to try to force as many as you can out, many times rather then a clear and concise report you end up sometimes obfuscating ( to be evasive, unclear, or confusing) things.

When will it become clear that writing shorter reports that convey the information required are better then long drawn out reports that are 90% bloat and 10% real information?

Looking at Needless words I started thinking about this, I don't know how many reports this semester alone I've written that are really just bloated with meaningless information, in a simple attempt to pass as a "useful" paper.

When will engineering students write reports as clear and concise as the work we will need to produce?

I have read requirements documents that are so indirect that it's a wonder how people can implement them, and in fact I was once told that if they didn't understand the requirements they were writing that well, they would write it more then once in a couple different ways, so as to give them an "out" when the software comes that they can say "this isn't what I meant" and force you to change it.

That's a tough paragraph to read. Re-Worded: If you don't understand the material you're writing about, make it so the people that are reading it can't understand it.

Start writing what you MEAN. Stop writing bloat into your reports. I'm going to give this a try on my next Microprocessors report, I'll let you know what kind of score I get.

No one likes bloat. Me least of all.

Sunday, November 8, 2009

Designing Learning

In today's day and age, is the current methodology of teaching the best approach?

Here's my hypothesis, Changing HOW we are taught can net greater results on a broader spectrum of students.

It's a well known fact that there are different types of learning
from: LD Pride
These Learning styles are, Auditory, Tactile, and Visual.
How can we improve each of these area's in today's classroom?

I believe that if a student doesn't "care" about what they're learning, it's like trying to force oil to mix with water, it doesn't work.

What we need is something that will be the go-between from the oil (the student) and the water (the material). One way to do this is by not stifling creativity, and in fact fostering it, the best engineers in my opinion are the ones who find the most creative solutions!

Point in case, I'm working on my microprocessors class. Right now we are learning how to handle interrupts, using timer's, buttons, led's and various other things. Individually these projects are dry and don't inspire creativity.

My solution suggests that the student attempts to create a game in one case. For example, Simon Say's, a great game, could be a pretty easy one to build, but in building that you learn a lot of things, here are many of them I can think of:
  1. LED Outputs
  2. Pointers
  3. Timer's
  4. Interrupts
  5. Button Presses
  6. LCD (maybe give the user a score?)
  7. Stack
  8. Algorithms
So I could manage to learn all those things and actually have fun doing it.

I am so far having a blast with the class because I can SEE the potential I'm given while learning this information, but many people see it using blinders, where they can only see what's directly ahead of them, and not see the potential, I believe that letting student's pick projects force them to learn how to design a project, work through the team building details, and the final implementation. I don't think this should be a one time project that is part of graduating, but shoot find a project that the student needs to complete that takes each piece, and as you learn, you can build more and more.

For example, let's say you're given a project as a freshman, some of the techniques to build this project may require math level x (doesn't have to be overly difficult), as you push through each semester you can learn more and then literally apply it to a project as you go along, so when you finish your degree you can say...Look I completed this project and it required knowledge and skills in all these area's.


How do you think learning should be implemented in today's day and age? And do you have any ideas for programming that may induce learning indirectly?