Wednesday, January 21, 2009

Formatting Issues

So there seem to be some formatting issues with my code on the previous entry.
I will attempt to solve that. For now... give me the benefit of the doubt that it was good.

Oh, and I began working on a more intricate program based off this one. I have 4 different switch cases, and I am working on my second function to find the time elapsed in the equation.

Phunky Physics

So I spent the better part of this afternoon devising a small program very similar to my algebraic one. This program will take a falling object's initial velocity, elapsed time of descent (or ascent, for it can work either way), and acceleration and it will give you the distance traveled by that object. Modeled in the equation d = v0t+1/2at2

Here's the source code:


#include <>
using namespace std;
// This program is a demonstration of the physics formula relating distance traveled
// acceleration
// and time traveled. Users will input variables and be able to find out the distance traveled, given
// the time traveled, and acceleration.
// Global variables assigned for ease of use in the two functions
float t; // time elapsed
float v0; // starting velocity
float a; // Acceleration (generally 9.8, earth's gravity)
float calculations(float t, float v0, float a);


int main()
{

cout << "Please enter the time elapsed.\n"; cin >> t;
cout << "Please enter the starting velocity.\n"; cin >> v0;
cout << "Please enter the acceleration.\n"; cin >> a;
cout<< "The distance is " << first =" v0" t =" t*t;" second =" a">



As the last few comments note, I will be adding to this sometime soon. (I hope). It could be fairly useful in the future for my Physics courses (I won't be taking any real courses for at least until next year. I just enjoy reading my self-teaching physics book from time to time).

However, I am proud of myself for this one.

Also, on a side note, I added a slight bit of CSS to my myspace page. It just changed the color of the text of a header I added, but it's a step in the right direction!

Tuesday, January 20, 2009

I Could Have Posted this Tomorrow...

I'm sure there must be a study of procrastination.

Well, at least, I am certain that at some point some person proposed an in-depth study on the methods of procrastination and the reasoning behind it in the human head.

However, I'm sure that they are just planning on going through with the study later on. You know... let things clear up in their schedules or something.

hah.
Humor.

Friday, January 16, 2009

The Left and the Right Connect

Greetings once more.
Alas, I lack substance. I should start doing real work.
(I believe I am going to go about and possibly work on some CSS or HTML code for my myspace page, and see how that goes. Just something simple. A nice background and some sweet text formatting, possibly. I will post source as soon as possible/available/tangible).

However, I am posting just to make a minor point.
After doing some thinking upon proper coding techniques, I began to ponder more about my creative endeavors.

I have often referred to myself as a poet. However, I really have just as little right to refer to myself as a poet as I do a coder. Sure I can write words and code. But can I do it right?

I can get results. But I haven't refined either art.

So I have pulled up a rather dusty copy of my least favorite bok: Writing Metrical Poetry, by William Baer. I rejected it after a while, a long time ago, saying that the greats didn't need this. Poetry came from the heart.
True, true. But it requires some sort of form and shape, and while freeverse is nice and easy, I cannot be happy until I have at least attempted to do it properly, similar to my strivings in coding.

I just thought it was noteworthy how similar skills can crossover both the logical and creative side of my brain.
(And I do realize the creative art of coding. Not that coding and poetry are so far apart. Still, they do come from different backgrounds and master categories. Remind me to write a post about the similarities between the two sometime. That may make for an intriguing entry).

Wednesday, January 14, 2009

Perfection, or Close to It. (A Lamentation of the Subject).

So today's post is another lacking substance, and talking more of one of my hazards on this little journey of mine.

There was a slashdot article talking about poor programming skills and techniques, and how it has a lot less to do with literal code errors, but more to do with poor construction and planning and testing. It sparked a good couple hundred responses.

As I sat there, neglecting actual school work, and reading this large debate about proper programming practices, I couldn't help but feel slightly overwhelmed and even somewhat guilty for even wanting to call myself a programmer or coder or whatever. I read these in-depth arguments about Waterfalling and syntax and clean code, and it worries me that I'll never be up to par. I don't want to be a mediocre coder. I want to do it right. I want my code to be clean, understandable, maintainable. And with all this scrutiny, how am I supposed to feel safe at all to even try? I feel as if I am part of this problem, even though I've only ever written a few fully functional programs that do a few meaningless tasks.

It's just a slightly woeful feeling, and I am alleviating it with some good nerdcore hip hop. (See: www.rhymetorrents.org) It tends to inspire me to keep going. However, midterms are upon us, and all I feel like doing is sleeping and ignoring my studying for a few classes. So I have not put much work into my little math program. However, I suppose I will do my best to keep that in the "to do" list.

Hmm...
Maybe I should write a to-do program?
It wouldn't be much special I suppose.

I could set it to create a calendar of sorts.
Keep each date as a variable
Set the date to be a string of whatever, and I can look up each date and see what's due or what I want to do.
I could add a function to recall for me an entire week or month.

Hmm...
If I had this program, I might just put this project first, because I think this might be incredibly convenient.

Now... C++ or Python?

Saturday, January 10, 2009

No Substance, Just Pondering

Today's post has no basis in any substance of learning, just my own worries.

As I sit here, toiling away on a research paper, I am hit repeatedly with the realization that I know little to nothing in the field of computers or technology. Sure, I know enough to make myself look smart if I'm talking to an average user. However, my research paper calls for details and explanations that I just cannot deliver.

Along with that, I cannot find a good place to START improving my knowledge. There are so many aspect to computing and hardware and software. There is no one starting point, really. At least, none that I have found yet. There is no "1+1=2" formula, no Kindergarten. Just a vast jungle of information of different species and forms that I get tangled in.

Granted, I am beginning to learn how to organize all this information. I am getting better at finding starting places. I am managing, and I continue to learn.

However, it is difficult to do find a good place to start out here in the wild.

I'm sure I will find a groove, and I have found a few small grooves already. Still, it worries me sometimes when I am face to face with things I do not know.

Though I suppose the recognition that I do not know everything is in fact, the best starting point of all.

Thursday, January 8, 2009

A Tangent!

A tangent is called for!
So far I have focused mainly on the software aspect of technology.
However, today in my research class, I reached a milestone in my journey.

I built and ran a computer.
It runs smoothly.
It runs so silently.

I am going to have so much fun destroying it.

I have to grab an External CD drive, or maybe dig up a Serial SATA CD drive and hook it up. I need to do this soon. I'm basically leaning towards running Linux on it.

If anyone is actually reading this for the tech aspect, and not because you are humoring me as friends (which I still appreciate), I was wondering if you had any recommendations for a distro. I've got about 200 GB, so it's not like I'm running low on HD space. However, lightweight might be best, so I don't have to spend too much time hooking it up. Personally I am thinking Ubuntu, because it's all I have any experience with. Debian is fairly attractive, since I know that it is a predecessor of Ubuntu, and I've heard good things about the development environment (although I will not be doing more than overclocking it, really).

Part of me is also considering loading up Windows, just because I may or may not be running games (as part of the testing process) on it.

However, I am extremely excited. I was starting to get discouraged about my hardware knowledge. But when I hooked it up, and it ran on the third try (I had a few loose cables), I almost cried out of sheer joy. So I am confident in my ability to work on my summer plans. (Build computers. Sell computers. Money.)

However, I now have a good deal of paperwork due for a science symposium.
Oh my.

Wednesday, January 7, 2009

A Rough Outline, A General Idea, and a Witty Title

So I set out to work on a program that would do my Algebra 2 homework for me.
Convenient, no?
My goal was to design a program that would take the terms of a difference of squares. (Such as "w3-27")

The program would take the root of the terms. In this case "w" and "3" (So you're still doing a little bit of calculation) and re-arrange them into the formula of
(a-b) - (a2+ab+b2)

It would save me time.

So I hashed out a quick skeleton during my Algebra class (instead of actually paying attention, in hopes that I could do the work myself). I got home, fixed it up, and came out with a rough piece of work that takes two variables and spits them back out in slightly different order:

Here's the source:

# include < iostream >
using namespace std;


char a; //sets the variable in the expression
int b; // sets the variable for the second term
int a2; // stands for a squared in formula
int b2; // stands for b squared in formula



int main()
{

cout << "What is A? \n";
cin >> a;
cout << "What is B? \n";
cin >> b;
cout << "("<< a <<"-"<< b <<")-("<< a <<"squared + "<< b <<"" << a << " + " << b <<
<< "squared)\n";
cin.get();
}


So it's not very pretty, but it gets the job done.


Problems and Solutions and Improvements
1) You still have to do the initial calculation of the roots. Easy fix. I'll just have it divide variable B by 3 two times.
2) If the first term has both a coefficient and a variable, I have to be able to enter the coefficient. That's simple enough. I can treat the coefficient separately, divide that by 3 twice.
3) The program won't take or give out superscript. I can't quite get it to print out superscript. I'll have to look into that. Plus, you still have to do a little thinking, and remove the exponent from the original "a" term. I'm not sure how to fix my superscript problem, honestly.
4) The program doesn't simplify it totally. So if you end up with an answer that isn't fully simplified. that fix might be slightly more complicated. However, I suppose I could set it to test whether or not b2 is divisible by anything that adds up to ab. I'll have to work on this, without a doubt. That might be a little tricky. But essentially it'll come down to an if/else function.

I feel slightly bad about posting unfinished/rough code here, but I suppose it's a good way to organize my thoughts, and show how I progress throughout a project. The code works, does what it's supposed to do. It's just not comprehensive enough. Expect to see more as I work on it.

I am excited though, because this is the first semi-major, semi-useful project I have really attempted with any sort of code or computer knowledge.

Over and Out.

Monday, January 5, 2009

Scripting Saves Students

So I don't know if anyone really knows, but I am in love with scripting languages. I don't know why. However, I do believe it is partially due to the fact that the first programming language I ever messed around with was Python, which is so clear, so easy, so simple, and so powerful. It makes for some useful scripts.

Well, I just ran a tiny tiny tiny script for myself a few moments ago. I figured I'd post it up here just for fun. It's really not complex... It is a total of two lines.

Essentially, I'm working on some Algebra 2 homework, and we're doing factoring of cubes and using the differences/sums of cubes. However, I don't have any of the roots memorized. So everytime I get 343 I have to try and figure out what the cubed root of that particular number is. (Substitute whatever cubed number you want).

So, to use as a reference and to save time, I wrote myself a tiny script and ran it in my Python interpreter up on the Linux-Box.

here's the contents of my source file (very simple)


for i in range (1,21):
print "%d cubed = %d" % (i, i*i*i)


So that is my tiny script. But it is a very handy reference for this homework. And isn't the point of effective coding to make short, easily understandable/maintainable code that does what you need? I believe I hit proverbial nail on the head.

Also, I am very happy to finally have posted a bit of code on my web log that is in fact about code. It is slightly amusing. Of course I have written a fair amount of HTML code. All the links and different text formatting was created by hand by me in the process of posting.

So thank you for reading, and now I depart. Midterm examinations are upon us, and I fear I need a refresher of some more Algebra.

Thursday, January 1, 2009

A Test, a Test I Say!

Hello everybody. Quick post, just to let everyone know, I've got a test site going on google sites.

I'm using it to test out my HTML skills and possibly Javascript (once I learn the stuff).

Here We Go

So give it a read, it's really small for now. I've got to get ready for a social gathering at the moment. I'll be sure to add more to it by the end of tonight.

Projects and Plans and Things

Ah, first post of a New Year.
Let's make 2009 good, shall we, my friends?
We've only got 3 more years until everything's fucked, anyways.

So here are my plans for the New Year:

1) Build the computer.
- I have this barebones kit. MicroBTX socket 775 computer, that I need to assemble and get running for my research. I am acquiring the Hard Drive on Tuesday or so. It uses SATA connections, with NO IDE slots on the motherboard. So all my IDE equipment: the hard drives and optical drives, won't work at all.

2) Build the cooling system
- Once I have the computer in an operable state, I need to build this cooling system fast, because I only have about 2 months until the research is due.

3) Create and operate a working web site
- I'm going to take up my Uncle on his offer for some server space. As such, I have been learning HTML (and focusing on keeping it clean and strict, to adhere to XHTML standards). I've got a good portion of it learned and I'm practicing around on some test sites with Google Web Sites. Along with that, I've got some Javascript to learn, and I believe I am going to pick up the good 'ol Python, so I can do some server-side programming and create a functional blog from scratch. (Sorry blogger).

4) Start really working on C++.
-I want to have some serious contributions to the Linux community who have given me so much. So for that I have to become more adept at C++ and the language of the machine. I'm going to start browsing around Launchpad for some ideas and see if I can help anyone out. I might make my wiki page in the near future.

I believe that is all. I hope everyone is having a wonderful year so far.