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
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
using Softing.OPCToolbox; | |
using Softing.OPCToolbox.Client; | |
namespace opc_simple | |
{ | |
class Program | |
{ |
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
public ScrabbleGame() { | |
super( | |
ScrabbleGame.parseGrid( | |
"T..d...T...d..T\n"+ | |
".D...t...t...D.\n"+ | |
"..D...d.d...D..\n"+ | |
"d..D...d...D..d\n"+ | |
"....D.....D....\n"+ | |
".t...t...t...t.\n"+ | |
"..d...d.d...d..\n"+ |
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
public class Node { | |
public final static boolean GADDAG_PREPEND = false, GADDAG_APPEND = true; | |
Node[] children = new Node[CHILD_COUNT]; | |
boolean end_of_word = false, gaddag_mode = GADDAG_PREPEND; | |
char letter; | |
... | |
/** |
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
@Test | |
public void testDawgDictionaryCollapse() { | |
Dictionary dictionary = Dictionary.buildDefaultDictionary(); | |
Trie trie = new Trie(dictionary); | |
Dawg dawg = new Dawg(dictionary); | |
assertEquals(395184, trie.countNodes()); | |
int i=0; | |
//Despite the merged nodes, a dawg should look structurally the same as a trie. | |
TrieIterator t = trie.iterator(), d = dawg.iterator(); |
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
http://www.youtube.com/watch?feature=player_embedded&v=OoPCDiMF108 | |
1. In the battery or inside the battery plug, the current is converted to AC. | |
2. The LEDs are attached in opposite polarity, but are normal LEDs. | |
3. The switches are labelled in reverse - '0' is short, '1' is open. | |
4. Each switch has an internal diode in series, with the same polarity as their LED. | |
When both switches are '0': | |
Each switch conducts when the AC cycle forward-biases its diode, so the LED sees insufficient voltage (only 0.7V to light) |
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
<? | |
... | |
$select = new Zend_Db_Select($db=Zend_Db_Table::getDefaultAdapter()); | |
$select->from(array('a'=>'tutors_applicant_application')); | |
//Filter on area? | |
if (isset($query['area']) and $query['area']!='all') { | |
$area = $query['area']; | |
$select->where('area=?',$area); | |
} |
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
<? | |
//Given MSA files, report for each the semesters. | |
array_shift($argv); | |
if (!$argv) $argv = array('php://stdin'); | |
foreach ($argv as $file) { | |
$in = new SplFileObject($file, 'r'); | |
$semesters = array(); | |
foreach($in as $l) | |
if (preg_match('/\d{5}_([^_]+)_.*\|(\d{4})$/',$l,$m)) |
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
if (PORTB&(1<<USER_SOL_PIN)) { | |
48e: c0 9b sbis 0x18, 0 ; 24 | |
490: 02 c0 rjmp .+4 ; 0x496 <main+0x12> | |
PORTD|=(1<<UV_LAMP_PIN); | |
492: 97 9a sbi 0x12, 7 ; 18 | |
PORTB&=~(1<<BW_PUMP_PIN); | |
494: c6 98 cbi 0x18, 6 ; 24 | |
496: ff cf rjmp .-2 ; 0x496 <main+0x12> | |
Same code generated with macros: |
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
<? | |
set_time_limit(0); | |
function usage($msg) { | |
echo $msg."\n"; | |
echo "Usage: update_couch_design ADMIN_PASSWORD\n"; | |
echo "Updates the configured couchdb database's design doc and views without blocking any other users.\n"; | |
exit; | |
} | |
//Must run as a standalone script. |
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
+V----------------+ | |
| # # # < | |
| # # # # # ######| | |
| # # # # # | | |
| # # # # ########| | |
| # # # # # | | |
| # # # # # ######| | |
| # # # | | |
|######## ####### | | |
| | |