function walkReport() {
$("body").find("*").andSelf().each(function() {
var parent = $(this).parent().attr("id");
console.log(this.nodeName+" "+this.id+" and my parent is "+parent);
});
}
small code
Blog Archive
-
►
2011
(19)
-
►
June
(7)
- In list of numbers, find each pair that equals 100...
- Binary search in Perl, using CGI.pm and Ajax
- python: generate list of random alphnumeric string...
- View source of a malware website: http://bzowwjcr....
- Java: Write to File: Copy Bytes: Copy Music
- aLife cellular automata with sound output
- ascii to hex converter. useful for iwconfig key pa...
-
►
June
(7)
Monday, May 14, 2012
Walk DOM and report ID's and Parents
Sunday, May 6, 2012
One Wire On Fire 1-Wire Automation Management Tool
This is a project I'm designing and coding. Far from done as of this post, but I hope to have it reasonably functional by July 2012.
- Promotional Sitehttp://one-wire-on-fire.org/
- GITHUB: https://github.com/lancemiller/One-Wire-On-Fire
- A succinct HOWTO on 1-wire gear at hobby-boards.com: 1 Wire HOWTO
Python: Error Handling
import traceback
def formatExceptionInfo(maxTBlevel=5):
cla, exc, trbk = sys.exc_info()
excName = cla.__name__
try:
excArgs = exc.__dict__["args"]
except KeyError:
excArgs = ""
excTb = traceback.format_tb(trbk, maxTBlevel)
return (excName, excArgs, excTb)
try:
x = x + 1
except:
print formatExceptionInfo()
Thursday, May 3, 2012
Wednesday, May 2, 2012
Friday, April 13, 2012
Basic ssh login script
#!/usr/bin/env bash ip="127.0.0.1"; u="joe"; p="2222" webport="8080"; while true; do echo "http://$ip:$webport": echo "ssh -p $p $u@$ip"; read -p "press enter"; ssh -p $p $u@$ip; done
Tuesday, March 20, 2012
Create an associative array in PHP
Some of you may dislike the distraction of a full set of working code with core lesson of associative arrays buried in it. Their are plenty of minimalist examples on the web, and when I wanted an example they were too minimalist. Core code for reference is in this color scheme.
deviceNickNames.txt10.AF2551010800|no nickname 22.20F21A000000|no nickname 22.650E1B000000|no nickname 29.A29F09000000|no nickname
$deviceNickNamesTxt = "deviceNickNames.txt";
if (file_exists($deviceNickNamesTxt)) {
$lines=explode("\n", file_get_contents($deviceNickNamesTxt));
foreach($lines as $line) {
$items=explode("|",$line);
if(isset($items[1])) { $devicesB[$items[0]]= $items[1]; }
}
}
print "\n<form name=\"setupForm\" action=\"\" method=\"GET\">\n<table>\n<tr><th>Device Hardcoded Name</th><th>Human Friendly Name</th></tr>\n";
foreach($devicesB as $name => $value) {
print "\n<tr>";
print "\n<td valign=\"center\" align=\"center\">".$name."</td>";
print "\n<td valign=\"center\" align=\"center\">\n";
inputText($name."_NAME", $value, "");
submit("");
print "</td>\n</tr>\n";
}
print "\n</table>\n</form>\n"
| Device Hardcoded Name | Human Friendly Name |
|---|---|
| 10.AF2551010800 | |
| 22.20F21A000000 | |
| 22.650E1B000000 | |
| 29.A29F09000000 |
Subscribe to:
Posts (Atom)