Archive for July, 2009

ITC280 – my version of the paged list

30 July 2009

Today I spent about 6 hours turning the paged list sample code into somthing that would fill a table with thumbnails (I didn’t try putting them inside links – didn’t want to stretch my luck).

I chose a 2 by 3 format for my table, as it fit better in the cramped screen I was working on at school. It’s a little clunky but I’m happy I could figure out how to do it. It runs off a “position” variable that is calculated for each entry in the list based on the return from the modulo funtion on its record number.

I’ll probably try to figure out queries tomorrow.

ITC280 – repurposing

29 July 2009

Spent about 4 hours repurposing the system to list and view my art items instead of muffins.

  • Create artitems table on zephyr using phpMinAdmin.
  • Get list and view pages working at home (as includes).
  • Rename the thumbnail art images (I called them farts) so the logic will pick them up.
  • Put all the changed files on zephyr and get them working there.
  • Update my files list spreadsheet.

How simple you want your public pages to be depends a lot on how much code you want to write.

In theory you can have just one public page for each major theme in the site (there might only be one) and then fill in all the content dynamically from includes. In practice you will probably have some relatively static public pages that just get linked to from the site. They would probably open in a new browser window.

The idea of passing the ID of a chosen link back to the server via the GET array is weird to me.  But in http, the page request is the main way the client has to communicate to the server, so it is taken advantage of. Normally, I would think of sending all data that does not have to do with viewing a new page as a POST to the server. But what is the server going to do with it? It wouldn’t normally store your data anywhere, unless it is creating an account for you in its database.  Most of the data you send it must be acted on immediately or lost. It’s not like a phone call where you keep the caller’s attention until you both hang up. I’d like to make that distinction more obvious in a site. I don’t like technology that looks like it’s doing one thing while it’s really doing something else.

ITC280 – list and view

28 July 2009

List and view is the basic web technique for viewing data in a database.

I am hoping to someday move beyond this technique, as I consider it very primitive, and inappropriate for some schemas. But everybody has to learn list and view.

Our instructor gave us two very basic pages about “muffins” that we were supposed to get working and then re-purpose to our own theme. I spent several hours today getting them working.

I wanted to try them as includes, instead of public pages, but this took some work. There is some logic in the view page that inspects the data handed to it by the the browser when someone clicks a button on the list page. If the data is no good for some reason, the view page is supposed to kick the system back to the list page (called a redirect).

When I was editing this code I messed up this logic, and it took a while to restore it to proper working order. Then I had to decide what to do about the fact that my local (at home) list page is different than my school list page. I decided to replace the calls to these pages with a variable defined at the top of each page. So my pages at school use the file I need to use at school, and the one at home uses the other file. I’m sure there is a more elegant way to do this.

Now the plan is to build this functionality into my two working versions that display images of artwork instead of muffins. This has to be done real fast so we can move on to the next part of the system.

ITC 280 – the new includes

26 July 2009

PHP allows a web designer to create a web page using “included files.” This technique is used by programmers for other purposes. In web design what the designer basically does, using a php script, is tell the server to assemble a web page out of pieces he has created previously. Those pieces can also have php scripts in them!

I am working with 3 different versions of a single web page using these includes. And I am working with them both at home and at school. So I have to get the three systems working the same way in both places. This Saturday I spent about 7 hours doing this.

Relative paths becomes a big issue when you have so many different files. It is a good idea to make sure all your paths work before you spend a lot of time writing code for a page. The most important paths are saved as constants in a configuration include. Without that include file, nothing else in the system will work!

What happened is that bacause of differences in how the school server and my home server are configured, they treat some relative paths in different ways. I spent a lot of my time getting stuff to work on the school server that was working fine at home. Hopefully I undestand it well enough now that I will not make the same mistakes again.

To Bill

25 July 2009

Bill: I don’t have a hosting company; I have a server installed locally. So it was just an oversight on my part. After the first 2 hours I went into php.ini and turned on error reporting. I have had several opportunities to use it since that time, and also on zephyr.

However, my local host is not set up as a real public server, so it has no public_html folder and doesn’t mind be browsing into the root directory of the server. I added a public_html folder on my servcer to match zephyr, but my server let me put serveral other folders (includes and images) in the “private” area without any complaints.

On zephyr, however, I could not get any html-generated call to reach a file that was not in the public_html folder. I hope this is the way it is really supposed to work. So I had to modify my setup to put the images and css includes up in the public folder. The php includes work okay in the “private” area.

ITC280 – Adder, etc.

21 July 2009

We got an assignment called the “black adder.”

It was a php code debugging assignment.

The adder is a harmless-looking extremely poisonous snake. And this code was similar. I don’t think adders are black, though.

I worked on this messed-up code for about 2 hours before I realized I had not managed to set error reporting to ON on my local php installation.

By that time I had figured out how to get the code to work.

The essence of it was how php treats quotes – single and double – and how you have to enter html code so that php will echo it correctly.

I couldn’t totally figure it out so I separated the echo commands into the html sections and the variables. I know php echos the values in variables when they are placed in strings within double quotes. However, html needs its attributes double-quoted, so it is better to leave the php variables outside of the quoted html strings.

The bad code was designed to NOT error out in php, so I was trying to figure out what was wrong based on the junk that php was outputting to my browser. But until I took out all my comments and segregated all the different echoed strings I couldn’t make it calm down and work.

After that, I had a problem with isset(). It seemed to test true whether you put anything into the form array or not. However empty() was more sensitive. So I ended up using two conditional statements in my code instead of one. I could then test both if the the submit button in the form had been pushed AND and if the form text boxes had anything in them. If the form was sent empty, even half-empty, I prompted for data. Otherwise I would display the answer string and the reset link. You could enter a non-numeric character in the form and it would still function, but act as if you had entered zero.

populating a database table

My next job was to populate my database table “artitems” in my database “larryart.” This will probably be changed to “lcox0008” so it has the same name as my database at school.

I found out the the punctuation used in the SQL INSERT statement used “`” signs. I thought they were single quotes. MySQL didn’t like that! I’m not sure those characters are required, but I was following how the book author did it. I fixed that and now I have data on 19 pieces of art loaded into my database at home. So now I can play with the code needed to display the art in the browser.

Total time spent: about 4 hours.

ITC280 – more work

18 July 2009

I spent about 7 hours Saturday creating styled forms for my left and right panes based on example code taken from the Liz Castro text web site.

These are basically non-dynamic pages at this time.

I worked out a basic plan for what should appear in these two panes and how it should work.

I also used irfanview to make thumbnails of my image files.

Then I used the instructions from the text to make my first table and add two records.

At this point it’s a cute, patchwork, useless site, but I’m a bit excited because I don’t get a chance to work with my old art very much and it reminds me of what I was thinking and what I was aware of when I was young.


Last night I went to a Scientology event. They are showing the summer “Maiden Voyage” events around the planet at this time.

The church is trying to raise donations from its members to replace all the major urban service organization buildings with  larger, renovated, better-located buildings.

Earlier this year Celebrity Center Memphis got finished.

Seattle is planned to be finished this year.

This expansion push has been hard on many members, as they are trying to pay for their own services plus being asked to finance these buildings. In every area there are a few exceptional members who contribure huge amounts, but everybody is asked to help, and most do donate something. At every event they have a fundraising rally after the event has been shown. And the speakers and major contributors always emphaize something that they have found to be true: you will do well if you stay “on purpose.”

Many beings are confused about or have lost interest in purpose. Some can identify several strong purposes they have that seem to conflict. But if a being can identify a pro-survival purpose that is important to him or her, and get on it and stay on it, this datum will begin to operate.

For example, I had two stronger periods in my life. One when I was a young teenager and one when I was abut 25.  During both those periods I was involved in performing groups. This was actually a major purpose for me. I had a hard time staying on it because I lacked training in it, but when I did things would go better for me.

I also loved to make art. But I was hampered by various factors, and didn’t choose it as my life’s work. I probably should have done so, as I am willing to spend countless hours at art-related work while other tasks go neglected. I hope to find an opportunity to give myself another chance in this direction.

In any case, it is worth heeding this lesson. Most people don’t actually have a deep, abiding purpose to “make a lot of money so I can retire and travel to Europe.” Most people, when they think about it, can recognize more far-reaching puposes in their lives. The best purpose is not necessarily the most practical one. It is the one that lights up your life. If you see someone doing quite well and wonder why you aren’t operating at their level, you might want to consider this subject of purpose.

ITC280 – mySQL install

16 July 2009

It is now Thursday morning. On Wednesday morning (Tuesday “night”) I spent about 4 hours downloading and installing mySQL Windows Essentials (a 38MB file that took more than 2 hours to download over my dail-up connection) and phpMyAdmin (a smaller file). I had not downloaded mySQL at school because I had a copy (the 107MB exe version – “essentials” is an msi file) that I had played around with earlier. However, on this install, the install program reported that one of the cabs in the exe (a self-extracting zip) was corrupt, so I couldn’t use it. The “essentials” install went fine, though it is technically challenging. The instructions in the text are very important. Data on the web on how to install is inferior.

I then got phpMyAdmin up and functioning. I was going to try one of the other GUI clients for mySQL (mySQL makes their own) but I thought I had better stick with the way the book does it. PhpMyAdmin is a funky way to do it. It’s all in php and the files reside on the server (it’s not a remote client, exactly) and you operate it from your browser.

Google’s New OS

While I was waiting for the download one of the things I read up on was Google’s new OS project. They just recently annownced that they were starting it. From what I can tell, the traditional desktop will basically be replaced by a browser (Chrome). You will do all your navigation, computer maintenance, settings, and computing (of course) from basically a browser interface. Google intends that the vast majority of your software (and your data) will be web-hosted and will not reside on your own machine. I think this is an assumption that will be disagreeable to some. But many already do most of their computing this way. By offloading your storage and computing resources to the “cloud” you can successfully work with grossly scaled-down hardware. The OS software will be built on top of a Linux kernel which will handle most of the hardware-specific work.

When I first started working with Vista (my desktop came with it – my netbook, which I use sort of like a proxy servcr, runs Win XP home) I thought “this looks like a browser!” I believe that all the major commercial players want to push us towards internet-based (or you could say server-based) computing. For some reason, they aren’t discussing the implications of this frankly (as far as I can tell) but only in marketing terms.

The Culture of Freedom versus the Culture of Security

The problem I see with it is that that the internet then becomes, instead of primarily a tool for the computer user, another tool of the new technocracy to control the information and communication channels available to us. The potential, as I see it, is to turn the internet into something that will reduce our freedoms instead of increase them. The technocray, as far as I can tell, is convinced that we are just bodies trapped on earth and that any hope for freedom is only illusory. It’s a sort of Matrix viewpoint, from what I can tell. The people who understand (correctly) that people are basically spiritual beings and innately free and immortal continue to be pounded with accusations of “lunatic” and “fringe,” while the technocracy itself was secretly making contacts and discoveries that could be, if they were widely known, used to support the idea of the workability of personal freedom.

Almost any government cringes at the idea that its populace could actually be composed of free beings. The United States was one of the first societies during this era in our planet’s history to base itself, at least at a PR level, on the desireability and workability of individual freedoms. And look at how we have been attacked for this! But look, also at what we have achieved! With our decision in the 1800’s to free the slaves, which then forced all other countries on the planet to (grudgingly) go along (many never really did it), a society was created that has become the dominant culture of earth. This was not achieved, though it was possibly supported, by our military power. It was essentially a product of our spiritual power – a celebration of the workable truth of spiritual freedom.

The new technocracy, European-based (some say Nazi-based; I don’t doubt it) as it is, does not value or (I think) even understand the power of personal freedom. They gave up on this idea a long time ago, if it ever even occurred to them. And thus we see the current face-off (if you can call it that)  between a U.S.-based group that still values the concept of individual freedoms with a power structure that never did. The power structure is pushing the concept of “security.” Those of us on the freedom side of things believe they are doing this totally cynically. In other words, we think they are fully aware that their concept of a “better” society based on security is basically flawed, but that they do not have the strength of conviction to change their thrust towards this newest brand of slavery. I will probably get back to this in future posts.

On-site audio no. 2

13 July 2009

My free-audio-on-a-free-site exploration continues.

On this site it costs extra. On most other free sites you have to find a host for your audio and link to it. You then use the embed tag, frowned-upon but not easily put to rest. But EMBED doesn’t work with MySpace. BUT on MySpace you can include a playlist on your site and link to the MySpace library of music albums. If the visitor wants the tune or album, they have to pay for it at amazon or whereever. You can also link to videos on MySpace, which you can also do at Squidoo, I beleive.

Facebook is much more restricted. I don’t think they have music at all, and the video has to be your own, and under 2 minutes long.

On a recommendation from a “how-to” blog, I found soundcloud.

I think soundcloud is a site that should be supported. They have a free service, and better services for money. You can have a whole collection of tracks on your site and people can visit and listen to them if you make them public, or musicians who are working together can set it so only they can see the tracks.

Each track has a cool waveform graphic and a cursor, like an audio editor. I uploaded my little Dr. John clave sample there.

You have to be careful what you upload. It’s the whole issue of who owns and controls the song, even if it’s digitized. I figure one or 2-bar samples shouldn’t be a big problem.

By I like the MySpace solution, too. If you have the bandwidth in your internet connection it’s a great way to share music you like with other peole, or for instructional purposes.

I have two songs up so far. I have Dr. John playing Iko Iko live, and I have Tom Jobim doing his English version of Waters Of March. I might upload more versions of both songs. I wonder if I should add another song. These two I have chosen are very, very special. If I add another I want it to be another song that is theta and that a lot of other artists have covered.

ITC280 – forms

13 July 2009

I started getting more used to forms. I spent several hours at it over the weekend. I used Liz Castro’s sample code (Web 110 text).

This is CSS-intensive code!

So I guess I have a style sheet I can link to if I really want to.

But my emphasis is on functionality. I am also using her form handler right now. It works for me.

I’m nervous, though, that I don’t have MySQL up and running at home yet and that we aren’t yet wrting queries and creating pages with data from databases. I have a LOT of unanswered questions about how this works, and I don’t feel like I have time to read ahead.