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 processObjWithRef(obj, result){ | |
| if(obj==null || typeof obj != 'object'){ | |
| //nothing really to do here - you're going to lose the reference to result if you try an assignment | |
| } | |
| if(obj instanceof Array) { | |
| for(var i=0; i<obj.length; i++){ | |
| result.push(); | |
| processObjWithRef(obj[i], result[i]); | |
| } | |
| } |
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
| var socket = null; | |
| function bootstrap() { | |
| // 適当な図形を描画 | |
| var c = document.getElementById('mycanvas'); | |
| var ctx = c.getContext('2d'); | |
| ctx.globalalpha = 0.3; | |
| for(var i=0; i<1000; i++) { | |
| ctx.beginPath(); |
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
| - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { | |
| //create a example nested dictionary with just 4 levels | |
| NSMutableDictionary *parent = [[[NSMutableDictionary alloc] init] autorelease]; | |
| NSDictionary *thirdChild = [NSDictionary dictionaryWithObjectsAndKeys:@"bi",@"l4",@"nar",@"l4_", nil]; | |
| NSDictionary *secondChild = [NSDictionary dictionaryWithObjectsAndKeys:thirdChild,@"l3",@"bar",@"l3_", nil]; | |
| NSDictionary *firstChild = [NSDictionary dictionaryWithObjectsAndKeys:secondChild,@"l2",secondChild,@"l2_", nil]; | |
| [parent setObject:firstChild forKey:@"l1"]; | |
| [parent setObject:firstChild forKey:@"l1_"]; | |
NewerOlder