Posts

  • Intro to R »

    Things learned today:

    • Emacs tutorial: M-x help-with-tutorial
    • Learning about R today to look at crude oil data over the past year. I wanted to see if there was an opportunity to invest in airlines after crude prices had started to fall.
    • File extensions aren’t necessary to run scripts (Python, R, etc.), they are a convention.
    • REPLs are useful for exploratory programming because of their quick feedback.
    • R Cheatsheet:
      • q() - Quit REPL
      • list.files() - ls
      • source(“filename”) - Run program
      • install.packages(“packagename”), update.packages()
      • Assign variables via <-
      • c() - Create a new vector (array). Vector indices start at 1.
      • Rscript - Run program without entering REPL.
      • Graphs generated in the REPL appear immediately in Quartz, and from rscript are saved as PDFs.
      • RStudio seems like the best R-specific IDE right now. Ggplot2 is a good way to create visualizations.
  • You Don't Know JS »

    Things learned today:

    • Word of the day - mulct : to punish by fine.
      • Ex: The ruler used an income tax primarily to mulct his subjects.
    • How to keep a cuff in jeans.
    • Bash command line practice from Coursera - Part 1 and part 2.
    • You don’t know JS - This and Object Prototypes
      • Many programmers don’t fully understand how to use this and fall back to reliance on lexical scope instead.

    function foo(num) {
        console.log( "foo: " + num );
    
        // keep track of how many times `foo` is called
        data.count++;
    }
    
    var data = {
        count: 0
    };
    • An alternative is to use this.count++; and to call the function via foo.call( foo, i );, which forces this to point at the function object.
  • More Unix and CSS »

    Things learned today:

    • Bash guide from startup engineering on Coursera
    • The typical place to store custom bash scripts is usr/local/bin.
    • chmod 755 to reserve write access for the user and make executable.
    • Script created: zippy (to unzip/extract anything).
    • Auto-complete sudo and man, colorize ls and grep.
    • Benefit of using tmux (or screen) - terminal sessions become persistent until you shut down.
    • Karen in Californication - “They’re just words - I know you mean them, but I don’t know what they mean to you.”
    • Flexbox documentation - supposed to make aligning stuff easier.
    • Clearfix for positioning stubborn divs.
    • Percentage heights are tricky to use in CSS. Vertically aligning content can also be difficult.
    • jQuery Mobile makes working with layout very difficult. Alternative flipswitches here.
    • Setting and getting cookies with javascript. *Made something to help my parents pick somewhere to eat for dinner.
  • Powershell and Unix Tips »

    Things learned today:

    • More on Powershell from Microsoft’s training course:
      • You can use Powershell for remote servers on mobile devices using Powershell Web Application.
      • The reason that you need .\ScriptName to run a script within a directory is to prevent attacks. In the old days of Unix, attackers would create scripts such as “pwd” that would execute when run within a directory.
      • The Powershell community is very strong and helpful. Try asking questions on Powershell.org or on Twitter (#PowerShell).
      • Implicit remoting allows you to run cmdlets on different servers all locally.
      • Using icm with sessions allows you to issue commands to many computers at once remotely.
    • Contract templates for freelancing.
    • From Unix tutorial:
      • Command substitution allows you to run a command and store the output to a variable or use it as an argument. Syntax: $(command)
      • Process substitution allows a command to appear as a file. Syntax: <(command)
      • Piping to grep allows you to quickly find a certain word or phrase in a file.
      • Awk and sed are good for simple parsing or text manipulation problems. The author only uses sed to replace text or delete lines.
  • Birthday »

    Things learned today:

subscribe via RSS