BASH
Unix in a Nutshell Chapter 1, Skim Chapter 2
Introduction_to_bash_Shell_Scripting.html
ManPages/man8/softwareupdate.8.html
JAVASCRIPT
- pulled list of commands that have been useful in past and might be useful in the future.
- "To run a script, you can call it via the shell: /bin/sh 01_hello_world.sh"
- "Or, more commonly, make the file executable and call it directly: ./01_hello_world.sh"
- "Comments begin with a "#""
- "Lines end with a semi-colon (optional)"
- "Use $ to call var, not to set it, can use ${} to call as well to avoid confusion"
- "use double quotes for strings so can evaluate certain chars, use / to escape"
- "it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order"
Introduction_to_bash_Shell_Scripting.html
- "not only an excellent command line shell, but a scripting language in itself"
- "Programming languages are generally a lot more powerful and a lot faster than scripting languages. Programming languages generally start from source code (a text file containing instructions on how the final program is to be run) and are compiled (built) into an executable. This executable is not easily ported into different operating systems."
- "A scripting language also starts from source code, but is not compiled into an executable. Rather, an interpreter reads the instructions in the source file and executes each instruction. Unfortunately, because the interpreter has to read each instruction, interpreted programs are generally slower than compiled programs. The main advantage is that you can easily port the source file to any operating system and have it interpreted there right on the spot."
- "Write the code, save the file, and make it executable with chmod."
- "All comments in bash begin with the hash symbol: "#", except for the first line (#!/bin/bash)"
- command is the action giver. argument is the stuff in "". variable is box to hold things.
- "The collection of bash control structures are, if, while, until, for and case. Each structure is paired, meaning it starts with a starting "tag" and ends with an ending "tag". For instance, the if structure starts with if, and ends with fi"
- "If a variable is enclosed in double quotes, its value will be evaluated. If it is enclosed in forward quotes, its value will not be evaluated."
- "Normally the number 0 is used to denote a successful exit, no errors occurred"
- *Note to self: this article was great, and now I get all sorts of things I did not before. RE-read this for useful tips and info.
- "The way to deal with this is to put braces around X to seperate it from the other characters: echo "${X}abc""
- "A command in backquotes is executed and then replaced by the output of the command"
- "The awk utility is used for processing columns of data"
- "When an error occurs in a script, the script continues executing at the next command"
- to run any program, must use ./ before it to tell it to run
- "Because using single quotes disables a bash feature called expansion, where special characters and sequences of characters are replaced with values. For example, the "!" character is the history expansion character"
- "A non-quoted backslash '\' is the Bash escape character. It preserves the literal value of the next character that follows"
- note: this article contains very exact rules of which quotes do what and when. if I have any questions, this is a good place to look.
- content covered in other readings. no new notes.
- good overview of bash and commands.
- "Files read: ... ~/.bash_logout upon logout."
- skimmed the rest. good resource for topics.
- skimmed
- skimmed. lots of examples, but in no particular order. will have to use search to find specific info.
- tutorial. also skimmed.
- barely in english, but I did glean this command: echo $? to print out the error code.
- "The appearance of the prompt is governed by the shell variable PS1. Command continuations are indicated by the PS2 string"
- skimmed
- skimmed
- about making scripts secure so you will not mess up your system.
- "If it is only useful when users are logged in, put it in /Library/LaunchAgents, or in the personal LaunchAgents directories of specific users."
- "If you are at all concerned about a job going wild, you can create a new instance of launchd. Run the command launchd bash. You are now in a shell run by a new instance of launchd, and any launchctl commands you give will go to that new instance of launchd. Each instance of launchd has a directory in /var/launchd"
ManPages/man8/softwareupdate.8.html
- "softwareupdate -l" will show updates needed. can run and echo to make sure everything is going where it needs to and when.
- " -i | --install. Each update specified by args is downloaded and unarchived, and also installed. The install flag requires root. args can be one of the following: item ... One or more update names. -a | --all All appropriate updates. -r | --req All required updates.
- "LaunchDaemons folders contain items that will run as root"
- "If so indicated in the plist by the "OnDemand" key, the daemon is not actually loaded at startup"
- OnDemand "used in Mac OS X 10.4", "The default was true", "has been deprecated and replaced in Mac OS X 10.5 with the more powerful KeepAlive option"
- KeepAlive default is false and therefore only demand will start the job
Web Design in a Nutshell Chapter 26 and 27
PHP
- Javascript is client-side, so dependent upon the user's computer.
- to call an external script (remove spaces before using): < script type="text/javascript" src="myscript.js" >< /script >
- recommended to put all scripts in common area of head, but ok in body too.
- ooh. "this" is a useful fcn. learn more.
- overview
- overview
- "You can use HTML comments to hide Javascripts"
- "The noscript tag allows display for non-javascript aware browsers"
- "document.write(blah);" is like echo.
- clear definitions, but some steps missed. examples not explained.
- "the less code affecting the global namespace, the better."
- similar to 04.01, but more content.
- simple, short overview of DOM
- "To insert a JavaScript into an HTML page, we use the < script > tag. Inside the < script > tag we use the "type=" attribute to define the scripting language."
- "JavaScripts in the body section will be executed WHILE the page loads. JavaScripts in the head section will be executed when CALLED. Scripts that contain functions go in the head section of the document"
- never understood the term variable in code as well as I do now: "Do You Remember Algebra From School...a letter (like x) could be used to hold a value (like 5)? These letters are called variables, and variables can be used to hold values (x=5) or expressions (z=x+y)." Golly, I get it now!
- "When you assign a text value to a variable, you use quotes around the value."
- "If you assign values to variables that has not yet been declared, the variables will automatically be declared"
- ooh, I finally get switch now, too: "First we have a single expression n (most often a variable), that is evaluated once. The value of the expression is then compared with the values for each case in the structure. If there is a match, the block of code associated with that case is executed. Use break to prevent the code from running into the next case automatically"
- "functions that are going to return a value must use the return statement...The returned value...will be stored in the variable"
- the for in loop is a good way to write my deleting users code in javascript: "for (variable in object){code to be executed}"
- "Events are normally used in combination with functions, and the function will not be executed before the event occurs"
- See http://www.w3schools.com/jsref/jsref_events.asp for the complete list of events
- "The onload event is often used to check the visitor's browser type and browser version, and load the proper version of the web page based on the information"
- "The onFocus, onBlur and onChange events are often used in combination with validation of form fields"
- "The onSubmit event is used to validate ALL form fields before submitting it"
- "Error messages like this may be useful for developers but not for users" use try...catch or onerror events
- "JavaScript is Case Sensitive. You can break up a code line within a text string with a backslash."
- "The Array object is used to store a set of values in a single variable name."
- "When you search in a text, you can use a pattern to describe what you are searching for. RegExp IS this pattern." var patt1=new RegExp("e"); "The RegExp Object has 3 methods: test(), exec(), and compile()"
- test() returns true or false. exec() returns search string or null. compile() changes the regexp. are all case sensitive.
- window.outerheight and .outerwidth should return height and width of viewing window (yet according to the chart, none of the browsers support it...)
- no, wait, the screen object seems better. screen.availHeight and screen.availWidth give the available screen space for page. screen.height and screen.width give the max ht and width of screen.
- DOM chapter. has many detailed examples.
- skimmed
- This lecture has a little Ajax at the end, remember to revisit.
- skimmed
- skimmed
- skimmed
- skimmed
- skimmed
INLS572 Notes Review
Control-your-scripts-with-command-line-PHP/0,339028448,339212680,00.htm
AJAX
- includes: history, syntax, variables, strings, forms, arrays, conditionals, operators, loops, includes, sessions, cookies, email.
- "The power of php lies partially in the wealth of functions--there are 40+ array functions"
- more review
- "Php uses backticks (olde school) and the function shell_exec() to process shell commands (usually through bash)"
- "fsockopen opens a connection, and establishes a point to that connection, with server, port and timeout specifiable"
- Regular Expressions: "The basic usage is "match a_string a_blob", where the string is what you're looking for and the blob is where it might be...the basic function in PHP is ereg()"
- following are lots of ereg examples. using anchors, ranges, etc, etc.
- history and background.
- for loop shorthand: "for (initialization; condition; increment){sutff to do}"
- "The session_start() function must appear BEFORE the html tag: < ? php session_start(); ? >"
- "Proper exception code should include: 1.)Try - A function using an exception should be in a "try" block. If the exception does not trigger, the code will continue as normal. However if the exception triggers, an exception is "thrown" 2.) Throw - This is how you trigger an exception. Each "throw" must have at least one "catch" 3.) Catch - A "catch" block retrieves an exception and creates an object containing the exception information"
- revisit the PHP filters reference
- basic commands with mySQL. revisit for assignment.
- note to self: there are some PHP with Ajax chapters here. Revisit.
- notes in book itself. chapters covered: Dynamic Content and the Web, Installation, Exploring PHP, PHP Decision-Making, Functions.
- forms. review.
- php and js together
- "...the browser parses and renders the html, builds the DOM for that page, and processes the javascript. The javascript can be local only, or it can go back to the server to request a page using the XMLHttprequest object, and modify the page."
- used to check for special charactersa dn use htmlentities..." if ( ereg( " [ \!\@$%^\*\(\)\.\\/:;<> ] ", $ _GET [ "title" ] ) ) { die ( "Error: Invalid Option" ) ; } $ php_title = htmlentities ( $ _GET [ "title" ] ) ; "
- MySQL
- "I recommend that you only allow access via the local host, and use php for user access"
- "There's also a nice package, phpmyadmin, you can use to manage databases"
- short into to commands for mysql. go here for basics.
- "echo htmlentities ( $ _GET [ 'string' ] ) ; This converts any HTML tags to entities, so they are displayed and not rendered by the browser."
- "Be careful with these--if you pass file to be included into your script with a GET or POST, a hacker can run a script of their own through yours"
- "Run a hash on your scripts to check for mods--there are lots of freebie programs that can do this for you and alert you to changes"
- tutorials. can revisit when have specific needs.
- article on one solution to combining PHP and JavaScript.
Control-your-scripts-with-command-line-PHP/0,339028448,339212680,00.htm
- article on using command line PHP
- "it will be stored in the bin/ sub-directory of your PHP installation directory: shell> /path/to/php -v"
- php.net on using PHP CLI (command line interface)
- unix manual for php cli: use 'man php'
- full php manual. noted for reference in future.
- tutorial on using php to store and verify a password to password-protect certain parts of your site.
- article on php and sockets.
- oops. skipping.
- another basics tutorial.
- The htmlentities function takes a string and returns the same string with HTML converted into HTML entities. For example, the string "< script >" would be converted to "& lt ; script & gt ; ".
- snippets of code used as tutorial. difficult to navigate. a lot of PHP written for you here.
- discusses session state (managing look and data per session) and page state (managing look and data per state - ex used is logged in vs not).
- tutorials
- php and mysql tutorial
- read parts 1 and 2. am deferring the rest until I get phpmyadmin working on my computer
- php and mysql tutorial. dos cmds.
- php security
- "always develop and deploy applications with register_globals disabled."
- "disabled by default in PHP versions 4.2.0 and greater"
- "One method is to have a single PHP script available directly from the web (via URL). Everything else is a module included with include or require as needed. This method usually requires that a GET variable be passed along with every URL, identifying the task."
- "Another approach is to have a single module that is responsible for all security measures. This module is included at the top (or very near the top) of all PHP scripts that are public"
- notes in book itself. chapters covered: Arrays, Database Basics, Using MySQL, Getting PHP to talk to MySQL, Modifying MySQL objects and PHP data.
10.01: http://www.xml.com/pub/a/2005/08/19/ajax.html
FLASH
- remote scripting using xmlhttprequest
- description of Ajax and how it is used
- mozilla dev center example of Ajax
- blog of ajax developers.
- "it is rather an approach based on a number of disparate technologies"
- Notes in book
Flash Help Manual:
RUBY ON RAILS
- "When you create and save Adobe¨ Flash¨ CS3 Professional documents within the Flash authoring environment, the documents are in FLA file format. To display a document in Adobe¨ Flash¨ Player, you must publish or export the document as a SWF file."
- "For most computer-displayed animations, especially those playing from a website, 8 frames per second (fps) to 12 fps (the default) is sufficient."
- A keyframe is a frame in which you define a change to an objectÕs properties for an animation or include ActionScript code to control some aspect of your document. You can also arrange keyframes in the Timeline to edit the sequence of events in an animation. Flash can tween, or automatically fill in, the frames between keyframes in order to produce fluid animations.
- Flash Video tutorial on Drawing
- I am used to object drawing model from other apps. Each object is treated like its own entity. The default in Flash is the Merge drawing model, where objects affect each other when they intersect.
- Flash Video Tutorial on Pen Tool
- Flash Video tutorial on Shape Tweening
- Flash Video tutorial on Motion Tweening
- Read and re-read for info on how to ActionScript.
http://www.alistapart.com/articles/gettingstartedwithrubyonrails
- "Unlike many PHP apps which often 'just work' when uploaded to a webserver, Rails apps rely on their framework and a customized hosting infrastructure (often called a stack). As a result, Rails applications can be a bit more challenging to deploy"
- PHP and RoR can both perform similar functionality, but each has its strengths.
- "You can think of Rails as being an elaborate menu of code that developers can select from, modify, and extend to create a completely customized application"
- "Rails implements a software engineering technique called model-view-controller, commonly abbreviated as MVC...MVC means the XHTML and CSS you create is kept as separate as possible from the deeper levels of code"
- RoR always has the same folder structure which is much larger than I am used to. "the folders that are important for you to pay attention to are the app/views, app/layouts, public/images, and public/stylesheets folders"
- source control software frequently used with RoR are Subversion (SVN) and Git. Basically this is revision control and it keeps all of te changes madfe to the files. ever. excellent for collaboration. and me.
- Note to self: this site has links to other tutorials that I should check out.
- watched a demo where a blog is set up and teste in 15 minutes. Understood little, but am impressed.
- signed up for free course in RoR. won't finish it by the time I do my assignment because they dole out the materials, but it looks really interestng anyway.
- notes in book
- to run code but not insert to html, use < %. to run code and insert to html, use < % =