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
[Test] | |
public void TestExceptAndIntersect() | |
{ | |
//check if equal with differing sequence | |
var list1 = new List<int>(new int[] { 1, 2, 3, 4, 5, 6 }); | |
var list2 = new List<int>(new int[] { 6, 5, 4, 3, 2, 1 }); | |
var result = list1.Except(list2).ToList(); | |
Assert.AreEqual(new int[] { }, result); | |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Test Canvas</title> | |
<!-- get excanvas.js from http://code.google.com/p/explorercanvas/ | |
Note the test cases and examples. Very cool! --> | |
<!--[if IE]> | |
<script src="excanvas.js"></script> |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Test Canvas II</title> | |
<!-- get excanvas.js from http://code.google.com/p/explorercanvas/ | |
Note the test cases and examples. Very cool! --> | |
<!--[if IE]> | |
<script src="excanvas.js"></script> |
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
#-2*-2 = 2*2. In other words, when you | |
#multiply 2 negative integers it is the | |
#same as multiplying the same two positive | |
#integers. -x*-y = x*y | |
x = 2 | |
y = 3 | |
puts ((x*y + x*-y) + -x*-y == x*y) == | |
((x*y + x*-y) + -x*-y == -x*-y) |
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
# ~.autotest | |
require 'rubygems' | |
require 'autotest_notification' | |
SPEAKING = false | |
DOOM_EDITION = false | |
BUUF = false | |
PENDING = false | |
STICKY = false | |
SUCCESS_SOUND = '' | |
FAILURE_SOUND = '' |
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
#!!/usr/bin/env python | |
import RPi.GPIO as GPIO, time | |
GPIO.setmode(GPIO.BCM) | |
GREEN_LDE = 18 | |
RED_LED = 23 | |
GPIO.setup(GREEN_LED, GPIO.OUT) | |
GPIO.setup(RED_LED, GPIO.OUT) | |
count = 0 |
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
#!/usr/bin/env python | |
import RPi.GPIO as GPIO, time | |
GPIO.setmode(GPIO.BCM) | |
GREEN_LED = 18 | |
RED_LED = 23 | |
GPIO.setup(GREEN_LED, GPIO.OUT) | |
GPIO.setup(RED_LED, GPIO.OUT) | |
count = 0 |
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
class CreateTableNameSequence < ActiveRecord::Migration | |
def up | |
#create sequence for categories table | |
execute <<-SQL | |
CREATE SEQUENCE table_name_id_seq | |
INCREMENT 1 | |
MINVALUE 1 | |
MAXVALUE 9223372036854775807 | |
START 25 | |
CACHE 1; |
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
class AddSequenceToTableName < ActiveRecord::Migration | |
def up | |
#add sequence to | |
execute <<-SQL | |
ALTER TABLE table_name ALTER COLUMN id SET DEFAULT nextval('table_name_id_seq'::regclass); | |
SQL | |
end | |
def down | |
execute <<-SQL |
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
import urllib | |
import re | |
def find_between( s, first, last ): | |
try: | |
start = s.index( first ) + len( first ) | |
end = s.index( last, start ) | |
return s[start:end] | |
except ValueError: | |
return "" |
OlderNewer