MyBlog

01/23/2012

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

Mom attack!

Filed under: Uncategorized — conner36 @ 12:39

I just went down stairs to eat breakfast and my mom started getting on my case to ‘contribute’ to things I don’t participate in, and then she pointed out the bread crumbs that I leave on the counter…. Oh snap!

I’m up

Filed under: Uncategorized — conner36 @ 12:26

So I’m up, have been for the past 20 minutes and I’ve yet to get out of bed. I was thinking that there are two obstacles in my way of being productive. The Internet and TV.
I need to work on my need to know whats going on and what’s gonna happen on the next episode.

I think the way to do that is to stop and blog every time I feel like I’m too tired to be productive and need to relax.

I’m out to work. Now to work on better eating habits…. Maybe that will be next months goal?

I’m going to bed, really

Filed under: Uncategorized — conner36 @ 06:00

So I’ve downloaded wordpress for my iPhone…. I was thinking about all the half finished things I’ve done and decided to pick one thing a month to work on. So for January it will be this blog. I’ll gather all my blogs past and migrate them here.

Now for some sleep.

Piano

Filed under: Uncategorized — Tags: , , , — conner36 @ 05:33

So, after surfing youTube at odd hours I realized that I should be more productive. I need sleep, but when ever I get into this mood, I can’t. Things need doing! So after doing some animation work, I’m ready to get to bed.

So why name this post piano? Because I want to either work on recording me play, or make progress on my composition. I’ve never composed a piece that I’ve felt proud about yet. My crowning achievement is an improvisation that I have on you tube.

I figure if I give up watching TV I’ll have time to do a lot more… so from the disjointed ashes of this post I’m off to sleep and prepare for a new day.

Hello world!

Filed under: HTML Blog, Uncategorized — Tags: , , — conner36 @ 05:30

First Post

So according to the HTML book I’m learning it’s good to blog about progress, so after staying up all Saturday I managed to do a quick read through of the whole book. The main thing I learned is that website development has many aspects to it.

You have the content, look, and more content

  • The first content is just words, links, images. It’s all written in HTML or XHTML
  • The look is mostly governed by CSS. CSS seems to be syntacticly similar to HTML. It’s main purpose is to make it easy to have a similar look and feel across a website, or sections.
  • The last content is the interesting stuff. It’s what makes websites like Facebook or the Apple online store interesting. This blog, for instance, uses php for the editor. It boils down to sever client gobeldygook. But this is perhaps the most interesting part of web development. Through mastering this one could make their own google, Facebook, or amazon… the sky is the limit.
« Newer Posts

Create a free website or blog at WordPress.com.