Do It Yourself sites (or DIY for short) have run their course. It seems that almost everyone now has posted a blog on creating, controlling and doing at home. From homespun wool to hacking the latest gaming system into a laptop, DIY-ers have sprouted across the internet like wild flowers. Or weeds, depending on your opinion.
DIY-ers are an interesting breed. For starters, most of us fit into that category of specialization. You and I know people who have specialized in something beyond our own understanding. What is interesting is the DIY-ers who have reached hyperspecialization. Their communication on their abilities breaks down and no longer can they communicate with people outside the loop. Traditionally, this is when people get careers relating to their hyperspecialization. Which puts the rest of us outside their sphere of communication.
This came to my attention a while ago when I realized I understood less and less of what my wife was talking about when she'd tell me how her day went. I tried. I tried very hard to understand it and it helped that I was fascinated by natural language processing. But there is a point which she crossed that I couldn't follow with a layman's perspective. The reverse is true for her understanding art. In fact, the masses don't understand visual arts (and haven't for the past 50 years) because of this hyperspecialization which resulted in the distancing of art from its suckle: the community.
For several months, I tried to approach this system in painting. I used departmentally specific symbols which communicated only to those within fields outside of the art community. The piece was about dysfunction in communication. Ironically, because it was about miscommunication, it was a misrepresented body of work and being misread was taken down prematurely.
But returning to DIY-ers, I noticed that because of Web 2.0 models DIY communities had taken the place of hobbyist communities and physical social groups. Someone commented the other day that if you truly wanted to become an attorney in California, all you needed was to study the information to pass the bar online and then pass the test. There is no requirement for law school. Save yourself some money: teach yourself online! So, why doesn't it work like that?
I have a couple theories. First, the internet has become too large. According to Google, Inc, during the year of 2005 the number of websites surpassed 8.5 billion. Web 2.0 platform feeds that number. This surplus of information requires a precision of search which can't be reached with outdated search algorithms. Personally, I'd like to see NLP taken beyond the theoretically academic institutions into a processing locale where it could make a difference in this area.
Second theory: learning from DIY-ers requires you to already be "in the know." There are dozens of projects I want to do (anyone know how to make an LCD laptop monitor into something worthwhile?) which I can't do because studying online help guides makes about as much sense as stereo instructions. This is really the point of the beast - DIY is only as helpful as what you already learned. Stereo instructions mean a great deal to someone who knows audio equipment, but where did they attain that information?
I decided to mimic the DIY community by documenting my process of learning skills which I have wanted to learn: java, linux, etc. The list will grow as I learn and learn what other people around me know. But there's one important catch: I need to learn it from someone I know, one-on-one. If I fail miserably... well, maybe I wasn't meant to learn something. The art project is to analyze the social interaction between teacher and learner - between the experience of learning and the experience of adapting to new information. I will post documentation on this work.
This was my "first" written java class taught to me by my wife, Rebecca.
I am an artist. Or a non-artist. Or whatever. My wife got her master's degree in computer science and programs full time in java programming language for Magma Design Automation. When we moved out here, she specifically wanted a job that used java because it is her favorite computer language. Me? Besides my brief career in programming with actionscripting for flash presentations to children, I don't understand anything about computer programming.
My last "real" job was designing flash language tutorials. Six months before I left the job, they installed flex 2.0 on my computer at work and asked that I start programming my activities in flex. I spent 6 months hating work because I couldn't teach myself flex. The funny thing about learning anything in today's world is that it should be all on the internet. I strongly believe that everything is on the internet - all information exists somewhere in digital form and can be transferred through bits, insignificant ones and zeros. However, as I have found, it is next to impossible to find anything anymore because the internet has become so massive and the search algorithms for major search engines are outdated beyond resolving the burgeoning world wide web.
package ralph; * My first java file. * @author wayne * */ public class TheCode { /** * @param args */ public static void main(String[] args) { System.out.println("monkey " + getNumber()); System.out.println(getNumber()); } public static int getNumber() { return 3; } }
in eclipse IDE
I realized that the only way to learn anything is by going back to the most basic elements of learning - passing information from one person to another. The personal touch. It has become out-of-style in the information age to get information directly from one person, but I am realizing that it is essential in order to learn anything. I'm not just talking about the personal touch in a physical realm - one of the greatest beauties of a digital world is the non-presence of others through digital means. I am hoping that this experience I am putting myself through can be a part of myself - my learning - which I have plugged into the internet and exists as a personal one on one learning process which might help others.
Realistically, I don't expect anyone to learn anything from this documentation. I do, however, expect to get something from it besides a better understanding and ability to program in java: I just want to understand what my wife is talking about when she explains her job.
My head hurts after today's session. I think I understand what classes are now. I vaguely knew what objects were before. I am still frightened by trying to find code to do what I want. Rebecca told me that what I need to do is first decide what I want to do in java and then work backwards to learn how to do it. That seems easy enough. I'm used to the way things were in flash coding: I knew a good chunk of the commands that existed so I could easily call them to memory to write my code.
Set up eclipse. This is easy to do on both windows and linux platforms. We had some problems getting java 5 working on eclipse in linux. We're still working on it.
Create a project. I named my project "helloworld" because that was the name of the exercise. The java libraries are loaded into this project.
Create a package. I remember strange names. I named the package "ralph." See attached files for .class and .java files.
In the package, create the code .java file "TheCode." Make a main method "public static void main..." within which we call a method from the java library.
System.out.println("whatever your message is")
[see the code at the beginning of this post]
The video follows our session; I learned how to print "monkey."
Rebecca gave me homework. It was the only way.
Most of learning comes from plugging away at something and playing with it, of course with the fastidious guidance of a tutor. I've thought a great deal about tutors over the past couple of days since my last lesson. In grade school, when you fall behind your studies you are recommended to take on a tutor. This person acts as a mediator to maintain personal contact and guidance in training your mind and studies to understand the skills that are being taught. I believe that I once had a tutor for math when I was in high school. Amanda Gambino. A friend who was in advanced math who was willing to help me out. I wasn't in trouble of flunking: I just felt behind because I was in the advanced classes and didn't grasp math as fast as my brother might have.
Interesting in looking back that my tutor then performed her great charity to me in part because she wanted to date me. Here I am, getting tutoring lessons from my wife, the person who I want to spend all my time with.
Rebecca gave me some twenty pages of text in our "textbook," Lewis & Loftus' 5th edition Java Software Solutions text. I believe she used a similar text when she went through her studies of early java. A couple of confessions for those of you reading this, hoping to learn a bit of java along the way: I think I had a headstart. My limited actionscripting knowledge has transferred easily to the basic skills we're dealing with here. Since I know what a string is and the difference between a string and integer, I can't say that my reading was terribly enlightening. I read pages 42 - 90; truthfully, I skimmed most of them. However, a few pages before the discussion on scanning data, I got really lost and had to do the work in order to understand what was going on.
While reading this, I thought about the Battleguard group I infiltrated earlier this year and how similar this experience is to that experience. There is a limit/threshold which I was able to go up to comfortably, without experiencing any conflict with previous personal experience - or lack thereof. I could go to the practices and pick up a sword, but the moment I was considering becoming more engaged than that, it plunged me into a social experience I wasn't prepared for. This is an experience that we all go through by crossing thresholds between our inner social matrix and the outside matrix which includes the greater public sphere. Somehow, I'm trying to reach that sphere and chip away at it, by learning scanning in java. After a couple of attempts with using the scanner method to input data, I eventually fulfilled the requirements to create a conversion from pounds to kilograms (see TheCodeb.java).
package echo; import java.util.Scanner; /** * @author wayne * */ public class TheCodeB { /** * @param args */ public static void main(String[] args) { Scanner scan = new Scanner (System.in); double pounds, kilos; System.out.println("Please enter amount of pounds:"); pounds = scan.nextDouble(); kilos = pounds * .45359237; System.out.println("You currently have " + kilos + " kilograms of stuff."); } }
System.in.
Scanning isn't actually a string/text/number, but an object. It must be converted to a string or number.
Why shouldn't I get in the habit of always using double for a numerical value, and then choose from the other possible options when those limitations are necessary?
I'm still not sure I understand what a class is. Or what an object is.
Method makes sense to me. A method is a group of code which is called with a single line of code anywhere else after the declaration of the method. I used a lot of functions (the equivalent of a method in actionscript) when I did flash designing.
The beginning of a cultural introduction revolves a great deal around language. And rightfully so, according to Jacques Derrida. Over the summer, I read a translation of his speech and discussion of his speech entitled Ethics, institutions, and the right to philosophy, among other books on the philosophy of language/grammar. I've become more interested in the cultural structure of a language and the symbols which that culture takes on which give support to conscious philosophy.
package tutorial; import edu.byu.phun.*; import edu.byu.phun.body.*; /** * @author Wayne * */ public class TutorialMain { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Win3D win = new Win3D ("Tutorial", 100, 200, 400, 300); Floor monkeydancefloor = new Floor (10); SphereObj monkeysphere = new SphereObj(); Axes myaxes= new Axes(); win.add(myaxes); win.add(monkeydancefloor); win.add(monkeysphere); monkeysphere.setLocation(1, 2, 0); win.setLookFrom(10,1,10); } }
I don't understand the language of the programming community, thus I am on the out group. I got a little frustrated with this because my wife and I don't talk the same way about code and although I thought I was asking a clear question, I obviously wasn't because her answers were not clear to me. This is very important to note because communication between the in-group and communication from the in-group to the out-group is one of the primary keys to understand how to become apart of the in-group.
I get really frustrated because she says "directory" and I have no idea what that means. This is the code we wrote together.
I resumed training in java this week, requesting that Rebecca teach me some things about reading and writing to external files. Now that I have a rough beginning in programming java, I have decided that I want to learn how to access database files and mine the information. So after I have the groundwork laid for understanding IO interfaces, I will soon learn about algorithms.
I keep calling java "javascript." Rebecca explained that javascript is for web pages; she doesn't know javascript. I think it is a remnant of calling the code for flash design "actionscripting." This problem, along with many other communication problems, reveals that my language isn't entrenched into the world of java. Let's review the process of what I learned this past week.
Initially, I explained to Rebecca that I wanted to learn how to create, access, write and read to external files. Eventually, I would like to learn some good data mining skills, but for now I need to get the basics down. She then referred me to several sites which went over some of the basic principles of the IO interface java uses. What does IO interface mean? I have no idea. Possible I I[n] - O[ut], but your guess is as good as mine. Rebecca is pressuring me to get used to the "Java API," which is the online database of java commands and an explanation of what each class/method does; however, since it reads worse than stereo instructions, I haven't been able to figure out how to make sense of what the Java API says. I have come to the understanding that the Java API is a real semiotic threshold for making sense of the community of programmers who use java.
This first group of code follows very accurately to the examples given to me. Mostly, I copied the code directly from the websites and then posthumously figured out what the code had done. Rebecca has convinced me (another threshold, in my opinion) that much of learning how to use code revolves around the copying of other code posted on the internet and then deciphering the language meaning afterwards. This teaching method, not through understanding first and then correct usage afterwards but through mimicking, creates an interesting parallel for language development in children: adoption and then comprehension.
package fileReader public class MainCode { public static void main (String[] args) throws IOException { File file = new File ("myData.txt"); Scanner scan = new Scanner (file); int num, square; while (scan.hasNextInt()) { num = scan.nextInt(); square = num * num; System.out.println("The square of " + num + " is equal to "+ square); } } }
The previous block of code accesses the external file, myData.txt, which had been created on my computer prior to running the code. This code would not create the file, to my knowledge, but only read it for integers. Many of the features used in this block of code I had already used in my earlier lessons, such as printing to the console and creating a scanner. In fact, the only two new symbols of language I "learned" from java in this block was the class object File and the parsing method hasNext, both of which are immeasurably important in reading information. I had to verify with Rebecca if I understood correctly about File objects and hasNext methods. I'm still a bit hazy on when something is an object and when I am calling a method. This is one of the main linguistic keys to understanding the elementary foundations of java.
The following block of code is a simple file writing program which introduced me to the printStream class. Unfortunately this class only allows me to enter and submit text to an external file (a .txt file, for example) which then overwrites all information on that external file. I need to learn how to add text to a file, something which is referred to as "appending" text. Rebecca mentioned this to me when I explained my problem with the information being overwritten.
I tried to learn how to append by using Sun Microsystem's Java informationbase site, the "Java API". What does API mean? Rebecca didn't know. She looked up the acronym and told me it was the "Application Programming Interface." The API is frightening. It is the single most frightening thing about learning this language. It is the grammar text book. The complete grammar text book written for those who are already inside the philosophical circles of java programming. It makes less sense to me than stereo instructions. Rebecca tells me it is her best friend when programming.
package fileWriter; public class MainCodeWrite { public static void main (String[] args) throws IOException{ File file = new File ("myData.txt"); PrintStream print = new PrintStream (file); Scanner user = new Scanner(System.in); System.out.print("Enter your text here: "); String finaltext; finaltext = user.nextLine().trim(); print.println (finaltext); } }
The fileWriter program is as simple as one of my first programs and thankfully I haven't had to come up with much code myself. At this point I am still copying code from other examples and making slight alterations to personalize the code for my own system. This model directly mimics the imitation-language model that children use as one of their learning patterns for gaining language. I copy code, I alter it to fit my needs, but I am not generating programming language on my own because I do not have the internalized vocabulary necessary.
Following this experiment in writing to a file, I read a tutorial on reading from an external file. One of my goals at this time is to use java to evaluate database information. Although I am a long way from understanding and utilizing datamining algorithms, these are the baby steps needed in order to understand and, further, to adopt the philosophy behind datamining.
In the following code, I used a scanner to identify the user's desired external text file (that was my own addition beyond what the tutorial gave). The scanner then parses the external text file (which was previously filled with integers) and then calculates the square of each integer included. The program then prints the results on the command interface. Compare my code to the tutorial and see how much I imitated it.
package filereader; import java.util.*; import java.io.*; import java.text.*; import java.lang.*; public class MainCode { public static void main (String[] args) throws IOException { int num, square; Scanner user = new Scanner (System.in); String fileName;] System.out.print("Please type file name to access: "); fileName = user.nextLine().trim() + ".txt"; File file = new File(fileName); Scanner scan = new Scanner (file);\ while (scan.hasNext()){ if (scan.hasNextInt()){ num = scan.nextInt(); square = num * num; System.out.println("The square of " + num + " is " + square); } else { scan.next(); } } } }
For my final program this lesson, I combined the two classes of reading and writing to make a metaclass, including an additional user interface for the convenience of the user.
package readWrite; import java.util.*; import java.io.*; public class MainCode { public static void main (String[] args)throws IOException{ // this is where I declare my little variables double num, square; String user; //this is the first declaration of the scanner, //also determining the name for the file to be created Scanner scan = new Scanner(System.in); System.out.print("Enter the name of the file you wish to create: "); user = scan.nextLine().trim() + ".txt"; //the file is then created by using the data in the string, user File myFile = new File (user); myFile.createNewFile(); //I then open a printstream IO interface to write to the file, //using the data now put in the string, user PrintStream myPrintStream = new PrintStream (myFile); System.out.print("Enter data to process: "); user = scan.nextLine().trim(); myPrintStream.println(user); myPrintStream.close(); //redefine the scanner, scan, to read information // from the external file, myFile scan = new Scanner (myFile); //loop, to read each clump of data, see if it is a number //and then do some math with it while(scan.hasNext()){ if(scan.hasNextDouble()){ num = scan.nextDouble(); square = num * num; System.out.println("The square of " + num + " is " + square); } else { scan.next(); } } scan.close(); } }
I have been working on this program for several days, attempting to start from scratch and write the entire program myself by using what I have already learned from the previous work in file input-output (IO). For this program, instead of copying a tutorial, I determined the design of my program before I began to code and set it within the linguistic parameters of what I knew, which at this point was only IO. We got rid of the textbook and have been tailoring my lessons more closely with what it is that I want to learn. 3D design does not lead me down the path of information analysis and so for the time being, I have put that behind me. Which obviously means that I do not remember anything of how to code 3D images. I am amazed at how quickly information escapes me. I could throw out a trite explanation of how our brains are muscles and we must exercise them to maintain their fitness, but I won't.
My grasp on the language has improved, but doesn't reach beyond a first year student. I am almost completely illiterate, but I am beginning to be able to comprehend the uses of the Java API and how to appropriately use it. This step into the grammar database of Java marks a step into experimentation with the vocabulary I have gained. Since the last program, I have been able to resolve the PrintStream Class problem by using the BufferedWriter class. Although I tried to understand this class and implement it on my own, I was not able to. Rebecca had to write that code for me. She did, in fact, write a good portion of this program - while I copied it from her explanations.
Imitated code is very common. Rebecca tells me that if she wants to do something in Java which she hasn't previously learned, she searches online for it, copies the code and moves on with her life (after she has learned how the copied code functions). Apparently this is a well-used tactic by all programmers. As I have thought about it, I too imitate new words and structure in English as I hear them and adopt them into my personal grammar.
New vocabulary and grammar I learned:
The following code/program could be used by a professor to maintain averages for scores of different student groups. This could be especially useful for an experiment situation when the scientist needs to keep track of data of many different groups and easily format the scores into an excel spreadsheet (for further statistical evaluation). I attempted to make the input user interface as intuitive as possible.
package inputOutput; import java.util.*; import java.io.*; public class TestingGroups { //global variables, only so i don't have to instantiate them into the doGroups method static int value, groups = 0; static Scanner myScan = new Scanner(System.in); //method for running the numbers to the text file public static void doGroups(File p_myFile) throws IOException{ //identify the number of times to run the while loop int students, limit = 1; System.out.println("How many students are in this group?: "); students = myScan.nextInt(); //appendable buffered writing, so we can continue to build our stats FileWriter fstream = new FileWriter (p_myFile, true); BufferedWriter myBuffer = new BufferedWriter(fstream); //print how many students per this group myBuffer.write(" " + students); //loop to get all the students' scores while (limit <= students){ System.out.print("Enter student "+ limit + "'s score: "); value = myScan.nextInt(); myBuffer.write("\t" + value); limit++; } //formatting so we can open this file in excel later myBuffer.write("\n"); myBuffer.close(); } public static void main (String[] args)throws IOException{ //access and open file String myString = new String(); Scanner myScan = new Scanner (System.in); System.out.println("What file do you want to use?: "); myString = myScan.nextLine().trim(); File myFile = new File(myString + ".txt"); //determine how many groups while (!myString.equals("y")) { System.out.println("How many groups are you working with today?: "); System.out.println("[Hint: enter zero to see current scores]"); groups = myScan.nextInt(); System.out.println("You have decided to work with " + groups + " groups today. Is this correct? (y/n)"); myString = myScan.next().trim(); } //run data entry for (int i = 1; i <= groups; i++){ System.out.print("For group " + i +": "); doGroups(myFile); } //reading the external text file Scanner fileScan = new Scanner (myFile); int groupcount = 1; //loop for determining the absolute average values of all separate groups while(fileScan.hasNextInt()){ groups = fileScan.nextInt(); int count = 0; int average = 0; for (int l=1; l <= groups; l++){ value = fileScan.nextInt(); count += value; } average = count/groups; System.out.println("The average score for group number " + groupcount + " is " + average); groupcount ++; } } }