Showing posts with label bash. Show all posts
Showing posts with label bash. Show all posts

Monday, January 31, 2011

Iteration 2, Mon

The logic and syntax of more involves shell scripts is a continual source of interest and intrigue to me. Specifically, an if-fi statement which determines whether a certain command returned an error and if so exiting the script flow, and if no error the if will continue with the install script. The logic behind double square brackets in conditional statements in bash is that they make a wildcard do "shell globbing" which I interpret as meaning that it is a true wildcard as they are usually used in bash rather than a wildcard limited by the local directory or logic function that they are enclosed in.

I spent some time reading about programming languages which use vocabularies other than English. Not everyone can code in english, even if the ASCII set is generally intolerant of the umlaut and accent marks of the world. To say nothing of ideograms.

I spent a little time with ~/.gitconfig and ctrl-comma to make my environment visually coherent. The standard aliases are also useful.
[alias]
st = status
ci = commit
co = checkout
br = branch

You make a symlink (which doesn't really exist in Windows) using ln -s origin destination and it is extremely useful, especially when trying to get all of the correct files into version control when one of them "has" to be in a certain directory which should not be under version control. I learned about how to copy a path using pwd | pbcopy and also the rules of meaning behind . .. / and ./

/absolute path
./path relative to current director
. local directory
.. out one dir (closer to root) 
Previously, I knew many correct usages but not the underlying syntax logic. 


I believe that it is currently impossible for a program to analyze code well enough that it could autotag a class or project with tags representing certain code technique chunks which are used in it, like the Observer design pattern or a for loop which iterates over an array in order to concatenate all the contents of the array into one long string, or a do while loop which iterates through a list to add the sums of all the odd numbers in it.

The purpose of this would be to be able to search your own (or communal) codebase for certain code chunks. This relates to the "I did that in a previous project but I don't currently remember how and googling this has a low cost-reward ratio" problem which I believe is somewhat common. This is kind of like a code snippet search system, except that the search is secondary because the identification of the purpose-driven techniques is the main point of the automation. Again, I don't think this currently exists or is even implementable, but if I'm wrong I will be very interested in the manner of the solution.

For future TWUers:
When you must order ice cream to clear the ice cream meter, keep in mind that the fruit Chikoo is very tasty and you can order ice cream flavored with it to B2 from a place called Natural.

Friday, January 28, 2011

Iteration 1, Fri

Today I spent a large amount of the time discussing analytic paths and the site visit yesterday rather than coding/configuring/scripting.

Git is a complicated beast which enables many fantastic data exchanges when you use its higher level commands and setting modifiers. I have found no tutorials particularly suited to my usage needs, although this one was informative.

I installed and spent some time using Wordpress today. Also, I learned some things about path errors in OSX and thus about .bashrc and .bash_profile.