This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Replace `TABLE_NAME` with the name of the table | |
//Replace `DB_NAME` with the database name. | |
//Replace `PRIMARY_KEY` with the primary key of the `TABLE_NAME` | |
CREATE TABLE DB_NAME.TABLE_NAME_history LIKE DB_NAME.TABLE_NAME; | |
ALTER TABLE DB_NAME.TABLE_NAME_history MODIFY COLUMN PRIMARY_KEY int(11) NOT NULL, | |
DROP PRIMARY KEY, ENGINE = MyISAM, ADD action VARCHAR(8) DEFAULT 'insert' FIRST, | |
ADD revision INT(6) NOT NULL AUTO_INCREMENT AFTER action, | |
ADD dt_datetime DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER revision, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.config(['$httpProvider', | |
function($httpProvider) { | |
// Use x-www-form-urlencoded Content-Type | |
$httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8'; | |
// Override $http service's default transformRequest | |
$httpProvider.defaults.transformRequest = [function(data) { | |
return angular.isObject(data) && String(data) !== '[object File]' ? $.param(data) : data; | |
}]; | |
}]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getWidgetInfo($widgetId){ | |
if (preg_match('/^(.+)-(\d+)$/', $widgetId, $matches)){ | |
global $wp_widget_factory; | |
list($widgetId, $baseid, $instanceid) = $matches; | |
$widget_obj = null; | |
foreach($wp_widget_factory->widgets as $widget){ | |
if ($widget->id_base == $baseid){ | |
$widget_obj = $widget; | |
break; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: Homework #4, Due Friday, March 8th | |
--- | |
Preliminaries | |
============= | |
Before starting this part of the assignment, | |
1. Install the following packages |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SOEPATH=/Users/jstroem/Projects/cse230/SOE/src/ | |
all: | |
ghc -i${SOEPATH} -hide-package parsec-3.1.3 --make hw3 | |
test: | |
ghc -i${SOEPATH} -hide-package parsec-3.1.3 --make testing | |
clean: | |
rm -f *.hi *.o hw3 testing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: Homework #2, Due Sunday 2/5/13 | |
--- | |
This week's homework is presented as a literate Haskell file, | |
just like the lectures. This means that every line beginning with | |
`>` is interpreted as Haskell code by the compiler, while every other | |
line is ignored. (Think of this as the comments and code being reversed | |
from what they usually are.) | |
You can load this file into `ghci` and compile it with `ghc` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import qualified Hw1 as H | |
import Text.Printf | |
main :: IO () | |
main = do | |
putStrLn(printf "rectangle sides: %d" (H.sides (H.rectangle 2 3))) | |
putStrLn(printf "rtTriangle sides: %d" (H.sides (H.rtTriangle 2 3))) | |
putStrLn(printf "Polygon sides with 0 vertexes: %d" (H.sides (H.Polygon []))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HOST = $(shell hostname) | |
BANG = $(shell expr match `hostname` ccom-bang) | |
BANG-COMPUTE = $(shell expr match `hostname` compute) | |
LILLIPUT = $(shell expr match `hostname` lilliput) | |
ifneq ($(BANG), 0) | |
PUB = /share/class/public/cse260-fa12 | |
include $(PUB)/Arch/arch.gnu.generic |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HOST = $(shell hostname) | |
BANG = $(shell expr match `hostname` ccom-bang) | |
BANG-COMPUTE = $(shell expr match `hostname` compute) | |
LILLIPUT = $(shell expr match `hostname` lilliput) | |
ifneq ($(BANG), 0) | |
PUB = /share/class/public/cse260-fa12 | |
include $(PUB)/Arch/arch.gnu.generic |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HOST = $(shell hostname) | |
BANG = $(shell expr match `hostname` ccom-bang) | |
BANG-COMPUTE = $(shell expr match `hostname` compute) | |
LILLIPUT = $(shell expr match `hostname` lilliput) | |
ifneq ($(BANG), 0) | |
PUB = /share/class/public/cse260-fa12 | |
include $(PUB)/Arch/arch.gnu.generic |
NewerOlder