wesley tanaka

Tech

Deleting/Disabling iTunes

()

iTunes on Mac OSX started playing a random U2 song for no obvious reason.  I would kill it, and it would launch again after 10 seconds.

I tried deleting iTunes.app by opening the Applications directory in Finder and dragging it to the trash, but got the message that

"iTunes" can't be modified or deleted because it's required by macOS.

So I opened a terminal and did: sudo chmod ugo-rwx /Applications/iTunes.app which seems to have stopped it for now. We'll see how long that lasts.

What is MapReduce?

()

MapReduce is a programming model for parallel programming, and a proprietary execution engine (open source engines like Hadoop and open source successors like Beam also exist). It is loosely based on map() and reduce() higher order functions from functional programming, but refers to a very specific algorithm that uses those two higher order functions exactly once each.

What are higher order functions?

()

A higher order function is one that either takes functions as parameters or returns functions as return values. They are often used in place of loops in functional programming languages since a pure function cannot have a mutable loop iteration variable.

Some commonly used higher order functions are:

What is lazy evaluation?

()

Most programming languages use a process called strict evaluation when calling a function. For example, if we multiply the result of 1+2 with the result of 3+4 (to get 7):

multiply(plus(1, 2), plus(3, 4))

most programming languages will first add 1 + 2 and determine the result is 3, then add 3 + 4 to determine that result is 7, and then finally pass 3 and 7 to multiply()function to get 21.

What is functional programming?

()

Many computer programs today are written in a style called imperative programming. The programmer writes a list of steps that the computer's CPU will do one after another in order. A common analogy for imperative programs are recipes for cooking or baking food. Imperative programming came from a mathematical model called a Turing Machine, which is like a very long street with sequentially numbered mailboxes.

Spreadsheet dataflow programming

()

Spreadsheets are a dataflow programming language where all expressions are displayed visually on the screen.  They share a lot in common with functional programming languages.  Cells are expressed as functions of other cells, where the functions do not have side effects, and in most simple sheets, any given cell is immutable barring new I/O in the form of keyboard input (cells which are not will show an error instead of a value).

They have three limitations that make arbitrary programming difficult:

Lazy evaluation in python: zipping infinite lists

()

One demonstration of lazy evaluation in a programming language is to create an infinitely long list containing the Fibonacci sequence, defined recursively as the concatenation of two lists:

  • the list [1, 1]
  • a list made by zipping the Fibonacci sequence with the tail of the Fibonacci sequence, and summing the resulting pairs

The canonical example code in Haskell is:

What is memcache?

()

memcached is a small executable program. In the most idiomatic deployment, it listens for TCP connections on port 11211. Clients that connect have access to read and write a single in-memory hashtable with short (up to 250 byte) binary keys and longer (up to 1 megabyte) binary values. Clients use a simple text based protocol to store values in the hashtable by key, or get them by key.

memcached makes no guarantees about how long it will store a key/value pair. If you store a key/value, it may or not be there later when you attempt to retrieve it.

Composable asset and vulnerability expected value model for security

()

Security is often thought of as a level of risk to "assets". An asset is anything of value, like a password, 1000 hours of CPU time, the ability to execute software on a machine, customer credit card numbers, employee Social Security Numbers, etc.

A "vulnerability" can be thought of as weaknesses that an attacker who already has access to assets X1, X2, X3, ... can exploit to gain access to new assets Y1, Y2.

Exporting a graph from neo4j and importing it into gephi

()

Some code to calculate the <key> elements needed to get Gephi to import the labels for nodes and edges exported by neo4j

Syndicate content Syndicate content
by Wesley Tanaka