This file contains 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
09 	 Horizontal tab | |
10 Line feed | |
13 Carriage Return | |
32   Space | |
33 ! ! Exclamation mark | |
34 " " " quotation mark = APL quote | |
35 # # Number sign | |
36 $ $ Dollar sign | |
37 % % Percent sign | |
38 & & & ampersand |
This file contains 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
require 'rubygems' | |
require 'cucumber/rake/task' | |
Cucumber::Rake::Task.new(:features) do |t| | |
t.cucumber_opts = "--format pretty" | |
end |
This file contains 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
def sqrt(x: Double): Double = sqrtIter(1.0, x) | |
def sqrtIter(guess: Double, x: Double): Double = | |
if (isGoodEnough(guess, x)) guess | |
else sqrtIter(improve(guess, x), x) | |
def improve(guess: Double, x: Double) = | |
(guess + x / guess) / 2 | |
def isGoodEnough(guess: Double, x: Double) = | |
abs(square(guess) - x) < 0.001 |
This file contains 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
Query Table with Excel as Data Source | |
Query tables can be of great help if you need to extract particular data from a data source | |
It represents a worksheet table built from data returned from an external data source, such as an SQL server or a Microsoft Access database. The QueryTable object is a member of the QueryTables collection | |
However, it need to be SQL server or a Microsoft Access database always. You can use CSV file or our fellow Microsoft Excel spreadsheet as a data source for QueryTable | |
Here is one such example, which extracts data from MS Excel sheet | |
Use the Add method to create a new query table and add it to the QueryTables collection. |
This file contains 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
# MacPorts | |
export PATH=/opt/local/bin:/opt/local/sbin:$PATH | |
export MANPATH=/opt/local/share/man:$MANPATH | |
# Terminal colours (after installing GNU coreutils) | |
NM="\[\033[0;38m\]" #means no background and white lines | |
HI="\[\033[0;37m\]" #change this for letter colors | |
HII="\[\033[0;31m\]" #change this for letter colors | |
SI="\[\033[0;33m\]" #this is for the current directory | |
IN="\[\033[0m\]" |
This file contains 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
using System.Xml; | |
using System.IO; | |
using System.Collections.Generic; | |
using System.Web.UI; | |
using System; | |
using System.Linq; | |
using System.Text; | |
using System.Web; | |
using System.Web.Configuration; | |
using System.Web.UI.WebControls; |
This file contains 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
$ ghci -XTemplateHaskell | |
Prelude> :m +Language.Haskell.TH | |
Prelude Language.Haskell.TH> runQ [| let x = 5 in x * x |] | |
LetE [ValD (VarP x_0) (NormalB (LitE (IntegerL 5))) []] (InfixE (Just (VarE x_0)) (VarE GHC.Num.*) (Just (VarE x_0))) | |
Prelude Language.Haskell.TH> $(runQ [| let x = 5 in x * x |]) | |
25 |
This file contains 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
package com.exercise.AndroidPaint; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.graphics.Canvas; | |
import android.os.Bundle; | |
import android.view.View; |
This file contains 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
# Add line numbers to file | |
cat file | perl -wne 'while (<STDIN>) { print "$. $_" }' | |
# Add '!' prefix for WikiFormatting of classnames | |
# pattern: | |
# - 2 or more capital letters | |
# - no consecutive capital letters | |
# or use {{{ ... }}} for preformatted code block | |
cat file | grep -v "^\s*$" | sed -e "s/$/ [[br]]/g" | perl -wne '$_ =~ s/(?!\w*[A-Z]{2,}\w*)((?<!")[A-Z]\w+[A-Z]\w+)/!$1/g; print;' |
This file contains 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
Platform Version API Level | |
================ ========= | |
Android 3.1 12 | |
Android 3.0 11 | |
Android 2.3.4 10 | |
Android 2.3.3 | |
Android 2.3 9 | |
Android 2.2 8 | |
Android 2.1 7 | |
Android 2.0.1 6 |