Scott-sjf
From CCVWiki
Contents |
Mathematic Concepts
Intermediate Programming For The Internet
Week 2
PHP Dynamic Example (before , after , example)
Array Example (original script , example)
Week 3
Form Example (original script , example)
Form Handling Example (before , after , example)
Week 4
Form Numbers Thing (before , after , example)
Pretty Numeric Output? (before , after , example)
Increments (before , after , example)
Discussion: "What can your personal webspace run?" PHPInfo Result
Week 5
adLib (before , after , example)
urlEncode (before , after , example)
stringReplace (before , after , example)
Week 6
FormCheck (before , after , example)
If-Else (before , after , example)
Operators (before , after , example)
Discussion
Trimming Strings is the practice of cutting out extraneous portions of a string variable such as extra whitespace
or unwanted data.
Joining Strings is when one takes two or more string variables and merges them into one non-Array string variable.
Encoding Strings is when one converts a piece of string data to binary data for preservation.
Concatenation is the process of connecting strings together ($catfight = $cat . $fight;).
Literal -vs- Interpreted These two perspectives on data are differentiated by single and double quotes. If a
variable is presented in single quotes, it is literal and taken as it is type, whereas if it were in double quotes,
it would be interpreted and taken "normally."
Weekly Typed Weakly Typed references PHP's leniency with data types. Whereas in other programming languages,
you must differentiate between text (char/str) and different numerical denominations (int, double, float), in PHP
you do not. Numerical values may be processed alongside strings as either strings, integers or both.
Magic Quotes are quotes in string variables that must be escaped so the PHP interpreter does not mistake them
for the quotes used to surround the string.
Classmate Discussion
Author: Vasile Laur
I am taking the C++ class right now parallel with the PHP and it's helping me so much, taking in consideration
that the PHP is very similar with C++.It so happens that we have a much deeper coverage of the language on C++
class and after hours of trying to uderstand variables, string arrays and pointers in C++ , PHP its just a slightly
different interpretation of it :)).
Author: Delia Zamora-Crosby
I hope I did say it as clearly as possible about the use of double and single quotes in concatenating strings.
Values that are enclosed within single quotation marks are treated literally. Which means the actual string,
like for example:
$girl = 'Nina';
print 'Nina';
Nina
print '$girl';
$girl
Whereas interpreted means it processes the assigned value of the variable, in this case Nina for $girl. Thus
it prints Nina instead of $girl.
$girl = "Nina";
print $girl;
Week 7
Array Example (before after example)
dynamicContent (original script)
MD-Array (original script)
Week 8
Header (before after)
Footer (before after)
Body (before after)
Functional Example (before after)
Week 9
Before and After
Cookie Set (before after example)
Cookie View (before after example)
Cookie Expire (before after example)
Discussion
Integrated Development Environment (IDE) software, (not to be
confused with the other IDE: Integrated Drive Electronics commonly used
in ATA bus interfaces) are programs which provide source code editing,
syntax testing, program debugging, shell or shell-like real-time
interactivity with the interpretor/compiler and other IDE-dependent
features like syntax highlighting and code block isolation.
IDEs provide developers an isolated and interactive environment to
develop software within. Real-time debugging, syntax highlighting and
other such features streamline the development process immensely. The
purpose of the IDE is to make the very inhuman language of software
appear in a more visually organized and manner. This can become a
definite necessity for a developer or development team working on a
large software project to keep track of various functions and blocks of
code. Typos and mistypes will immediately reveal themselves with syntax
highlighting preventing the most obvious bugs.
When searching for an IDE, you need to look for certain key
features. You will likely want syntax highlighting, because otherwise,
you might as well use a standalone text editor and repeated compile
externally. You will also want to look for real-time debugging or
interactive interpretation. While not considered essential, a built-in
version control system is also an important feature, preventing the
developer from version regret.
Wikipedia: Integrated development environment:
http://en.wikipedia.org/wiki/Integrated_development_environment
Week 10
Before and After
CURSE (code example)
vsrc (code example)
vflist (code example)
Discussion
OccultHosting is an independent virtual host serving via rackmount Red
Hat Linux servers running Apache web server software. I currently have three
domains hosted on one account (digitalucifer.net, northernwolf.biz,
psychoticassault.com) and will likely host my web application on one of the
first two. The server is running PHP and I often run PHP applications on the
account. I do not currently have an SQL database setup but have previously
done so for phpBB, a popular, open source PHP bulletin board/message board
system. The cost of hosting is $50 per year for roughly 1GB of storage and 5GB
of bandwidth (a custom deal). The domains run about $27 per year ($9 per domain)
via GoDaddy. While I am happy with my current set up, I have considered switching
to 1and1 Hosting with their impressive uptime and legion of good deals.
Week 11
Before and After
FileWrite (code example)
HTML-Neuter (code example)
String Match (code example)
Week 12
Connect DB (before after example)
Error Handling (before after example)
Select/Create DB (before after example)
Week 13
12.4 (before after example)
12.5 (before after example)
12.6 (before after example)
Week 14
Functional Interest
PHP
Initially, I wanted to write about two obscure, complex functions that do a million things and
require long-winded explanations. After some thought, I decided it would be more fin and logical
to discuss the two functions I use most often: file_get_contents() and str_replace().
file_get_contents()
For the first two years of my PHP exploration, I was a slave to the unholy trinity of fopen()
/ fread() / fwrite(). There were times when I felt like writing degrading mock-functions that fit the
naming pattern. All I wanted to do was load the contents of my poor files into a variable! Was that
too much to ask? Apparently not. Enter: file_get_contents(). I still kick myself for having been
ignorant to this beautiful function for so long.
To put it simple, file_get_contents() reads the contents of a file. There is no need to manually
open the file (bye bye, fopen) before reading it (later, fread) into memory. Need to parse the contents
of an XML, conf or any other text file? Easy!
$filecontents = file_get_contents('filename.ext');
This function has made my life easier.
http://us2.php.net/file_get_contents
str_replace()
One of the most frequent things I do in my various web applications is process text. From changing
an instance of <xmltag> to <p>, to altering <script to <DsIcSrAiBpLtE, str_replace()
is a necessary tool. The premise and use is simple. You give the function a target, what you want to
target to be replaced with, and where to find the target and str_replace() does the rest. Here is an
example:
$processedtext = str_replace("<script" , "<disabled-script" , $target);
The above line of code takes the data in the variable $target, searches through it for instances of
<script, and replaces them with the string <disabled-script, storing the processed data in the $processedtext
variable. Beautiful simplicity.
http://us2.php.net/str_replace
MySQL
MySQL is a wonderful element to LAMP (Linux-Apache-Mysql-Php (or Perl)). This semester's coverage
was a great starting point for me on databases, an area in which I had no direct experience. Since this
is still new to me, there aren't any functions I can say I use all of the time. That said, I will choose
two functions which appear interesting to me. These are: MD5() and RAND().
MD5()
I chose the MD5 function because I had no idea MySQL could create MD5 checksums internally. This
function, as the MySQL documentation says, "Calculates an MD5 128-bit checksum for the string," and,
"...returned as a binary string of 32 hex digits..." Having this feature as a built in function in MySQL
is very useful. It is invoked like this: SELECT MD5('testchecksum');
http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html#function_md5
RAND()
RAND() was chosen because I am a fan of PHP's randnum() function for generating random numbers. RAND()
will return a random floating-point number. This can be good for generating entry id numbers in tables,
or even selecting random id's. It is invoked as such: SELECT RAND();
http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html#function_rand
Before and After
RegEx Search (before after example)
RegEx Replace (before after example)
Week 15
Discussion
I think the thing I got most from this class, or rather what got the thing
(being a tighter PHP prowess) to me the best was your very active approach to
educating. While I only attended one chat, the concept itself went above and
beyond my other courses this semester.
I'm not so sure there was anything I found useless. ePortfolio didn't really
appeal to me, but that's far beyond just this class. I agree as well that there
should be a third level course on this route (as well as for the WD&M class).
All in all, this has been a great semester and class.
Final Project
Outline
Project Site "runlevel0"
Media
Psychotic Assault, "Election of A New God" filmed live in Bedford NH at Mark's Rock Club -- I'm to the left.
YouTube
Skinless, the band we opened for.
YouTube
External Links
Personal-ish Website: DigitaLucifer.Net Business-ish Website: NorthernWolf.Biz Obligatory MySpace Profile: lame Band: Psychotic Assault Old Band (1997-2007): Morpheus