___  _  ___  _  _  ___  ___ 
 /   \/ \/   \| \| |/  _|/ _ \
 |      || | ||  | |\_  \|  _|
 |__|_|_|\___/\____||___/\___/
 Project Mouse (v3.4) 
 By Nate Royer
 © 1995-2008

	
 
Project Mouse

What's Your Programming Function?

Functions are a staple of all programming languages big and small. They all share very similar syntax, but each has it’s own slang. Here I have collected examples of a handful of my favorite programming languages as a reminder to myself and as an easy primer to reference in three minutes when my attention span flips to some other task and pushes this information off the side of my brain.

When I read or think of a programming function this lyric line runs through my head: “Conjunction junction, what’s your function” – School House Rock. Does anyone else have that happen? … no … mmm … okay, must just be me then.

Javascript

<script type="javascript"> <!--//--> <[!CDATA[ // SYNTAX // // function name(variables) { // lines of code to run // } var many function make_robots(many) { document.write(many + " Robots are being made."); } ]]> <!--//--> </script>

PHP

PHP <?php /* SYNTAX function name(variables) { lines of code to run } */ function make_robots($many) { echo "$many Robots are being made.\n"; } ?>

Python

Python #/usr/bin/python # SYNTAX: # # def name(variables) { # lines of code to be run # } # make_robots(many) { printf "%s Robots are being made." % (many) }

Perl

Perl #/usr/bin/perl # SYNTAX: # # name(variables) { # commands to be run # } # make_robots($many) { printf "$many Robots are being made." }

Bash Shell Script function example

#/bin/bash # Shell script functions must appear before the function can be called. # Normally this means putting the function at the top or the script. # SYNTAX: # # name(variables) { # commands to be run # } # make_robots($1) { printf "$1 Robots are being made." }

Objective-C for Cocoa function example

... /* SYNTAX: function name (variables) { lines of code to be run } */ function make_robots ($many) { print ("$many Robots are being made."); } ...

Oh god, my head hurts from bouncing between all these languages. I'm sure I've made mistakes here so let me know if I have so I can correct them. I must go draw a picture now and forget everything related to computers.

picture = Null if time < '0800': drawing = pen + paper else: coffee and mc-worky


macosx

Open Directory and .htpasswd

Fascinating! I worked on a project* once that involved a complete rewrite of the command-line utility passwd in order to keep a number of system services including a .htpasswd file in sync with users account passwords. Mac OS X Hints noted this is made simple with Mac OS X Leopard (10.5) and Open Directory.


macosx

Virtualized Xserver

Media Temple labs has a private beta for what it’s calling Xserve-Virtual . This system has been added quickly added to my MT wish list along with the Django GridContainer which, perhaps I wont need if I move over to a full-on-mirror of my development environment using a virtual OS X Server.

A virtual Mac OS X Leopard Server running on a fully loaded cluster of Xserves virtualized using Parallels Server . I want one, … or three, … yeah that should be enough …. maybe four, for symmetry.


opensource

Fedora 9 root password mismatch resolution

Having started my journey down the command-line with Fedora 3, I was excited to try out Fedora 9. The install completed with ease (the first time around) but once I logged onto the system and attempted to configure some of the system settings, my root password didn’t work.

Why? CAPS LOCK bit was set by default during the install process making a different root password.



Mac OS XNetworkingOpen SourceProgrammingReferenceSecurity & PrivacySystem Administration

Sketch Style Drawings Photo Album Polaroid Post

In the BloggiesOne of My Many IssuesRubbish
		
  ___  _  ___  _  _  ___  ___ 
 /   \/ \/   \| \| |/  _|/ _ \
 |      || | ||  | |\_  \|  _|
 |__|_|_|\___/\____||___/\___/
 Project Mouse (v3.4) 
 By Nate Royer
 © 1995-2008