MyBlog

01/31/2012

Musicians and Computers

Filed under: Uncategorized — conner36 @ 10:35

I was thinking about the adage that people that are good at math and playing musical instruments are well suited to learning computer science. I was wondering why this could be. After reading Code Complete I think I have an interesting point of view.
In Code Complete it made an emphasis that good code comes from abstracting smaller parts to make the sum of those parts greater than the whole. In my experience with piano I have come across the similar phenomena. In order to play an advanced piece you must take past learning experiences and build off them to be able to play. It’s impossible to try and contemplate every note, you instead focus on playing a passage. You practice until that passage becomes a part of you and has become an abstracted part of the “musical puzzle”.
I believe it is that task of abstracting that makes musicians so apt to learning computer science. So you don’t have to be a musician to be a great coder, but if you’re a great coder music can be a great hobby conducive to helping you expand your abstracting abilities. As a friend of mine observed that after a few years of playing piano, my chess skill magically improved. Music can help in sometimes unexpected ways.
It’s a shame it’s not a requirement of elementary schools…

01/27/2012

Tax season…

Filed under: Uncategorized — conner36 @ 14:52

It’s that time of year again… Can’t start until I receive all my forms. I expect to start mid February.

Any tips on doing taxes? Last year I did them online with H&R Block. It was pretty painless, but I can’t shake the feeling that I’m too ignorant on the subject and don’t know how to play the system yet.

01/25/2012

An Interesting Seminar

Filed under: Uncategorized — conner36 @ 21:20

So tonight, I got a call around 3pm from a friend inviting me to an investment seminar. I have to say Burn Notice has definitely influenced my perception of these type of events. A few people in nice suits and tans definitely made me think SCAM more than once.

But after attending and going half in to take an investment course I have to say, I was presently surprised at what went on. For the most part the speaker was funny and repetitive. There were gimmick like tactics used to entice people to pay for the three day course, BUT as I see it there are people that followed a strict set of guidelines, learned tax code, and were paid to give this seminar. They presented just enough information on what would be taught, things like how to set up a rough IRA and make sure that your profits aren’t taxed. And most importantly that there is a difference between investments and a career. They are not mutually exclusive. The whole point of making money is so that you can make time for yourself and do the things you love. Money CAN make money, but you don’t need a whole lot to get started.

The seminar will be focused on how to get started and how to keep going. Ignoring the boring details, there are ways to be more committed and ways to keep things on the less time consuming side.

I’ve decided to become business partners with my friend and I hope things go well. We went halfsies on the course but can’t take it right away because they’re mostly on the weekends (we both keep Shabbat). A minor detail is that we’re both in college and so waiting to schedule the course for a more opportune time works out. That goes without saying though that best way to get started is to take the first step, so we’ll be meeting to talk more things over.

I wish both of us luck and hope it turns out for the best.

01/24/2012

Code Complete

Filed under: Uncategorized — conner36 @ 22:25

So today in Java class I finally got to put some lessons I learned in the book Code Complete to good use. It talked about use of boolean variables and how to name them as yes/no questions. Also how to remove for loops used over and over again into a method to better control the logic and make it easier to read for others and my future self.

(link to code in paseBin)

Welcome my son… to 2012

Filed under: Uncategorized — Tags: , , , — conner36 @ 11:20

I can’t believe that it’s 2012 and my CIT course about HTML is still focused on proprietary HTML dev tools…. really? The teacher is focused on using HTML Kit for class development of our web pages. It only runs on windows. I’m a mac fanboi. So textEdit here I come… Just kidding, I’m using textWrangler for now. I may invest in BBEdit depending on how things go.

Funny enough I enjoy Xcode so much I find myself opening up the webpages in Xcode to edit…

EDIT: Just figured that NetBeans allows easy HTML editing as well… Nice.

AGH!! Couldn’t resist…

Filed under: Uncategorized — Tags: , , — conner36 @ 01:30

So I’m closing my tabs for the night when I come across Star Wars Uncut. I was so close to not watching TV/Movies. But it’s Star Wars! Either way it’s awesome, I watched the first couple minutes of it and I have to say in the wake of SOPA/PIPA this couldn’t have been released at a better time. This video is living proof that creativity begets creativity, and should need royalties.

Artistry has been locked down by the Media Corporations. Every day that we don’t protest copyright law as it is, we give in… I’ll be ranting about my position on the whole copyright thing. I even wrote a paper for ENG 101 about it. (Essay3_BetsalelWilliamson- ENG101-AC10)

Well, this is my last tab open… Good night Internet.

To bed again…

I made it though today without watching TV! Instead I focused on the blog. I mostly ranted in an EDIT on my truth game, though I did learn about <dl> definition lists.

Word press has some HTML automation that can be annoying sometimes. It makes it harder to try and write code when every time you save, the code gets changed without telling you… 😦

I’m all ready for classes tomorrow. I read the first chapter in American Stories. It covered early american history from a context point of view. So mostly it was about how Spain, England and American natives were compelled to do things. Why Spain was there first, why England stayed out, and why the Americans were subdued.

  • Spain was an economic power held together by Religion.
  • England was in religious turmoil and creating it’s own religion
  • The South American natives were too in awe of horses to understand what was happening to them before it was too late.

In CIT 130, I finished the LabAssign1 which was a simple input two INTs and calculate a percentage using JOptionPane.

In CIT 125, I uploaded a simple webpage to the server and added minor information. Skimming through the whole text book on Saturday didn’t hurt either. I now know that class will be very boring for the next few weeks.

My last class about Macroeconomics doesn’t start until the 30th, so I have some time to start reading the book.

And with that, I’m off to bed. I hope that all this writing doesn’t rattle around in my head keeping me up…

01/23/2012

Edit’s

Filed under: Uncategorized — Tags: , — conner36 @ 19:25

A fleeting thought… should I edit my posts or just write new ones? Ohh now I remember, I meant to figure out how to make links to posts or part of posts. I guess I’ll look that up after I eat.

I’m in the mood for pasta, with cheese…

It’s a start…

Filed under: Uncategorized — Tags: , — conner36 @ 19:22

So I unloaded the raw words onto the blog. I don’t think its very organized, but I have to start somewhere. One thing I found was that I had lots of lists and QA’s in my notes/blogPosts. Starting to fiddle with HTML I looked how to best organize them in HTML. Thank google, I found a website that seems to have the information I needed. All organized and everything 🙂

But looking at the lists and the information that I have I am beginning to wonder,

what are all of the <h> tags are for?

Also, after reading some of my old posts, specifically the one about self made conventions, I’m am wondering whether they only applied to that note taking situation. Either way I should reread them and decide what to keep and what to toss.

I’m getting hungry, now if only I could decide what to eat. I can never seem to decide. I have a hard time finding most food appealing. Usually if I think of great meal it can take days for me to shop for and cook the damn meal. Then people usually finish my leftovers before I can 😦

It’s a tough life living with your parents… at least the rent is cheap.

Dump… hey ideas!

Filed under: Uncategorized — Tags: , — conner36 @ 18:46

Here is a dump of previous “blog entries”

app ideas

edited 24 feb 2011 7:45pm
started 24 feb 2011 1:49pm

This note is a list of applications that I can look forward to create when I have enough of a grasp of coding and xcode. I will not put these ideas as todos and when I start to make the application I will create a separate note for the specific app.

Note Application:
A better note application with groups and subgroups with integration with os x. It needs to have the same functionality as stickies and the notes in mail.
Truth/False Logic Game:
An adventure game where you learn facts and come up with conclusions using mathematical logic principles.
Way to jump to function definitions:
Why not have them act like hyperlinks? Well right click gets you there quick enough I guess. Hyperlinks would be quicker though.

first experience learning Java

At first I started my Java CIT111 class and wasn’t sure what to think of the Java programming language. It seemed that getting an IDE up and running took too much of a learning curve. I feel that most of the class is not going to make it. Syntactically Java isn’t too far from C. I am happy the class’s outline is learning Objects first and Procedural code last.

I am using NetBeans 7.0.1. and had to readjust all of the key commands to reflect normal Mac OS commands. Thats strike one. If you’re trying to make an IDE to use across different OSs than make sure that the key commands fit the OS.

I am happy though that after learning how to use the IDE in class it works well with many little target files. If there is one thing I wish that Xcode has was a reset target and compile. I have a thumb drive with my all of my class work on it. The IDE supports ‘packages’ so that I have one folder for my CIT111 class.

mathematical logic

edited 24 feb 2011 1:57pm
started 24 feb 1:28pm

This note is about mathematical logic as taught in the book Integrated Mathematics by Dressler and Keenan Second Edition Course One. I want to takes notes on it for reference.

Key words:

Conjunction (and)
two facts are true only when both parts are true

Disjunction (or)
two facts are true as long as any part of the statement is true

Implication/Conditional (if..then)
the facts are split into two groups, the premise/hypothesis/antecedent and the conclusion/consequent. The conditional is false when a true hypothesis leads to a false conclusion. A conjunction can sound like a conditional.

EX: Vote for me and I’ll whip unemployment = (IF) you vote for me (THEN) I’ll whip unemployment

(taking a break at 1:44pm)

programming – true/false prog

edited 23 Jan 2012 11:35 pm
edited 24 feb 2011 3:20 am
feb 20, 2011 6:30 am

Write a top/down approach for the true/false game
I have an understanding that you’re suppose to split the big problem down into small problems and then think about the problem until its in small pieces.
Create a database for the truth false prog

the database needs:


  • Create a truth table to build questions and axioms
  • Create facts for the truth table database

a truth table needs:


  • A truth table is such that you have at least two variables [a] and [b]. their relationship can either be both true both false or true false, false true. It would be binary in nature because [0] false [1] true.

These values could be assigned to strings. I could create a stuct or object with a string and a truth variable.

  • Create a way to store questions and axioms with a true/false value assigned

But the game would need a compelling story to work. If the object is for someone to become absorbed in the game and still be able to have different outcomes each time he plays, than a simple yes/no game would fail. It all comes down to the difficult questions. If I was handed a character why should I care for him? Taking games that I felt care for the character, Warcraft One and Two I felt drawn into the game because every mission I was in control. Each mission’s progress furthered my capabilities. Another game Myth you are set in control of a group of characters, the only downfall was that even though each character you had accumulated kills and you could see that, those characters never became important to the story. They remained nameless peons that had lots of kills. The attachment was artificial.

So lets say I’m a character, in an adventure game what is more compelling to me? That I do things or that things are done to me?

We are all interested in discovery, and mastery. The hook is that we all want a great experience. We want our character with whom we spent a lot of time with to matter in some sense. In the game Godville you watch a character with very limited control. The fun part is seeing stupid random things that the community has created. The downfall is that there is very limited interactivity. You never get to send you character into a dungeon, or discover a larger context. It’s all pretty shallow.

So shallow = bad. What does not shallow mean? In World of Warcraft you have so many missions, but it still feels shallow. Nothing you do ever changes things. Maybe deep = risk. We all like taking risks. If something I do has consequences that effect others I care.

So doing things that cause things is important, only if those actions are bigger than ourselves. Like a piano performance, I find the most exhilaration from the reactions of the crowd, the fact that every note I play effects someone is a powerful feeling. In a story, the twist is great when something happens and the context expands. Something happens to the character that effects more than just him. Something is done where even the reader feels the effects. It’s not just unexpected, but a meaningful effect. The book Battlefield Earth was great for me because every time the plot thickened, the story zoomed out and you are introduced to more variables. You gain an understanding of how things worked.

Back to truth tables, by itself it’s useless. But abstracting it so that a truth table becomes a persons actions and repercussions makes it meaningful.

Now to figure out how to make an interesting story…

programming – problem with function copying input to an array

edited 24 feb 4am
edited 24 feb 2011 2:50am
started 23 february 2011 10:30am

I started to do exercise 1-15 in the K&R book. It says to write a prog that can print all lines that are longer than 80 characters.

I made an outline top down and came up with a program that should work. i started testing it out by writing the functions as programs. I thought I would need three functions.

  1. enter chars into an array
  2. get the line length
  3. a way to concatenate a line to an array
I wrote the first function and first did it in a while loop:
while ((characters = getchar()) != '\n') {
array[i]=characters;
++i;
}
I then took the example from the book and did a for loop:
for (i=0; i < THIS_BIG-1 && (characters = getchar()) != '\n';
++i) {
array[i]=characters;
}

While debugging, I found that when incrementing the position of the array I could use that value to show how many characters there are in the array. But when I turned the function into an int I started having trouble getting the value returned back. It worked fine until I moved the process from the main into a separate function. It either hangs in a loop when the both the function and the main terminate with EOF or i get a bus error when the function terminates with \n.

Figure out how to make the function work
I figured it out!!! I thought that in the main I would need a while loop

while (c != EOF) {
funtion
}

But then when the prog failed when the function terminated at \n I realized that since there was nothing to provide c with the EOF I would need to add c = getchar().

After doing that it seemed silly to do so because my function should do it. It’s a generic method that most of my progs do.

It was then I realized that I didn’t need a while loop when my function called it. All I needed was a call to the function.

# define SIZE_OF_ARRAY
static void callFunction ( int c , char array [] ) {
int arrayPosition = 0;
while ( ( c = getchar () ) != EOF &&
arrayPosition < SIZE_OF_ARRAY - 1) {
array [ arrayPosition ] = c;
++arrayPosition;
}
}
int main ( int argc, char * argv [] ) {
int c;
char array [ SIZE_OF_ARRAY ];
callFunction ( c, array );
return 0;
}

I added error prevention in the function by making sure the arrayPosition could never exceed the SIZE_OF_ARRAY. So now i can get back to work on the print lines longer than 80 chars prog.

Can I combine: ” array [ arrayPosition ] = c; ++arrayPosition; ” into one line of code? ” array [arrayPosition++] = c;
Yes! I originally thought that it would increment arrayPosition before assigning it the value of c, but after testing it out it adds it after assigning array[arrayPosition] the value of c. I think it would be safe to say that array[++x] = y; would increment then assign.
What would happen if I incremented arrayPosition before assigning it the value?
I think that there would be a random value in position 0.
I tried it and instead of spitting back a value, the program quits with out any error but appears to not add anything to the array.
I think a possibility is that since I am printing a string, it sees a 0 value and terminates before printing the rest of the chars in the array. I came to this conclusion when I started the array = chars at 5 instead of 0. (arrayPostion = 5; vs arrayPosition = 0;)

programming – general coding rant 2 (conventions)

edited 17 may 2011 7:15am – answered top/down bottom/up question
edited 24 feb 2011 2:00pm – added idea in time stamps
edited 24 feb 2011 5:47am
edited 24 feb 2011 5:31am
edited 24 feb 2011 4:44am
edited 24 feb 2011 4:09am
started 24 feb 2011 4am

Time Stamps:

I have decided to come up with a time stamp convention for my notes. it goes as follows:
Starting from now I write down the starting date of the time when I started, and i add the edited date when I finish a session of editing.
EX; I create a note 4:02 am 24 feb 2011
I write:
started 24 feb 4am.
I think I should add a little note next to the time stamp explaining what was added and/or why.

When I finish and decide to add more lets say an hour later, I write the time of when I finished. So i went to edit it at 10am but finished editing at 10:15am. I write:
edited 24 feb 10:15am.

I think I should write exact times to the minute, also I can add the edit if I close the note thinking that I wouldn’t add any more, but an idea pops in. Formatting a note doesn’t count as editing.

Emacs:

I started to use Emacs to write my code. I found that xcode was very cumbersome when trying to write many small programs and trying to keep them organized. It assumes that every source file in the project wants to get compiled and run. For now I think that emacs is ok since I am only writing one file programs.

A bonus of learning emacs is that a lot of the commands that make emacs run translate into commands I can use in xcode and most apple editor applications. The most useful command I found is the kill line replace line. I think as I learn how to use emacs more I will find even more and useful commands that I can use all around.

Notes:

Now that I am using notes more I am finding that one note can contain many different topics and it would be useful to come up with a way of easily finding what is in the note as well as in the note finding where the different topics are located.

Set up a better format for the notes
Using the top/down approach like in coding I will try to find what i need. I tried visualizing it but It didn’t seem to make sense that way. So working from the bottom up… the list of things that my notes contain:

  • Comments
  • Questions
  • Answers
  • Code Examples
  • Important Information
  • Not Important Information
  • Projects
  • Reminders
  • Headers/Titles
  • Lists
  • Timestamps
  • ToDo’s (things that I need to ask or get done)
  • Experiments
  • Definitions (self defined) or (defined by some[one/thing] else)
  • Conventions

Some of these items appear to belong to others. So rearranging the list:

  • Timestamps
  • Headers/Titles
  • Notes
    • Important Information
    • Not Important Information – this is really hard to define variable based on time and circumstance
      • Projects
      • Conventions
      • Reminders
      • Definitions (self defined) or (defined by some[one/thing] else)
        • Comments – can also be general but since the level above can be expressed in comments and comments aren’t expressed in projects
Figure out how best to define the top/down and bottom/up relationships
Top down is when you start with an application idea/genre and find what that application needs to work. Bottom up is when you have a cool little widget and you build an application starting from the widgets.
  • Code Examples
  • Lists
  • Experiments
    • ToDo’s (things that I need to ask or get done)
      • Assignments
      • Questions
        • Answers

programming – general coding rant

edited 17 may 2011 7:08am – answered some questions (function vs array; declaration initializations)
edited 24 feb 2011 5:00am
edited 24 feb 2011 4:42am
edited 24 feb 2011 4:06am
edited 23 feb 2011 10:40am
started feb 20, 2011 6am in the morning

After watching UNSW CS 1917 on itunes U, I am following the advice to keep a log.

Early this morning I started to clean up my graph prog and was trying to apply the idea of combining functions to split up the work. I am having trouble visualizing how to do it top down. I added comments and renamed the declarations .

I also started to write the true/false program, where it states facts and you answer true false. the goal is to build up from axioms to bigger truths. I tried to start doing it from the top down approach and again had trouble visualizing how to split up the problems into smaller functions.

I am starting to understand the use of functions and header files. The K&R book is written from a entirely different perspective. In the itunes U course I am ‘2 weeks’ in and they haven’t learned arrays. They are also using scanf apposed to c = getchar(). They are using unix and the command line.

I have a list of questions that need answering:

What is the convention about whether to cap the #define variables?
will change with the language, and preference
What is the thought process difference between using lots of functions vs. learning how to use arrays?
functions compare to the objective computing idea of methods. you use functions to help compartmentalize ideas. arrays are a color on the programming palette that you use in functions.
Why in the 16bit machine they skipped from instruction 15 to 24
The teacher in the UNSW lecture said there was significance. I asked my father but he didn’t know exactly why. He said it could have something to do with hexadecimal.
When do you not initialize the declaration immediately?
I asked my father but forgot to ask specifically when you need not need to declare. You don’t declare something early on if its only for a one use thing. you declare it when you first use it.
How best to execute the top down approach using lots of functions?
It’s starting to make sense how to use functions. they are general purpose doers. If you need something done send it to a function. the main handles case specifics.

EX: if you need only a line with 80 chars, a function can count it and return a value while the main will ask how big a line is and only pick out lines with 80 chars.

Help with clarifying my graphProg (ex 1-12)
I started to rewrite the prog using functions, before starting ex 1-15, and will take another look at it since i understand how to use functions a little better now. I still need to look at original file.
I looked at the original and what I started on the 22nd of feb, but I started to rewrite too much. All I need to start with is making a simple graph function.
Make a simple graph prog using functions
The difference between scanf and getchar
scanf uses char and getchar uses int. Im not sure that my initial assumption is correct. Both functions can use ints or chars.
getchar waits for a newline and then prints everything it has stored. the function is: int getchar(void).

I haven’t really every used scanf and should try to tinker with it in some example code.

Play around with scanfHow to transform the while c = getchar into a function?
void enterIntoArray ( int character, char array[]) {
int length=0;
while ((character = getchar())!= '\n') {
array[length++]=c;
}
}

As this code stands, there is the potential for there to be more chars then there are places available inside the array. I wonder if I could write self modifying code (a function) to add as many slots as needed.

Write a function to expand the array to what ever size is neededIt turns out in C its best to use malloc or calloc to dynamically create arrays

programming – ex-11 word count prog

edited 24 feb 2011 1:47pm
edited 24 feb 2011 4:37am
edited 24 feb 2011 3:20am
edited 23 feb 2011 10:55am
started feb 20, 2011 6:40am

I need to revise ex-11 the better word count exercise program. its too cryptic and needs beautification.

I started to rewrite the program with a top down approach.

Why doesn’t else if work for the word count prog?It works when you have statements if this or if not than this, but if you have to check if [a] is subset [b] or if [b] is a subset of [a]. and they aren’t contrapositives than the else statement doesn’t work. I guess i could make a truth table to see when if else works.Create a truth table to see when if else works or doesn’t workI started but then realized I need to look in the math book to translate the semantics of if, if else to a truth table.

  • a | b || A B
  • T | F
  • T | T || T | T
  • F | T
  • F | F || F | F

Take a look in the math book with the truth tablesI started to write a note about the mathematical logic section from the book.

songs to arrange

  • Mad world -Roland orzabel
  • Smells like teen spirit – nirvana
  • Apologize -One republic
  • Jude-beatles
  • Maybe tomorrow- steriophonics

songs to compose for sara

  • 8/4
  • Plea adagio
  • 2 Tondue moderato
  • 2 Dégagé a but faster than ton due
  • Frappé andante
  • Grande badma adagio
Older Posts »

Blog at WordPress.com.