Skip to content

Instantly share code, notes, and snippets.

commit de7ef99e819e2f6091dee4ead0f400924e76ec08
Author: Vladimir Pouzanov <farcaller@gmail.com>
Date: Sun Feb 8 19:23:25 2009 +0200
Added more api docs to CPObject
diff --git a/Foundation/CPObject.j b/Foundation/CPObject.j
index a586e6a..b868521 100644
--- a/Foundation/CPObject.j
+++ b/Foundation/CPObject.j
@import <Foundation/CPObject.j>
/*!
Helper function to load xml documents
*/
function XmlFromString(xmlData)
{
if (window.ActiveXObject) {
//for IE
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
+ (id)dictionaryWithObjectsAndKeys:(id)firstObject, ...
{
// XXX: duplicate implementation is bad, but so it's done in CPArray
// The arguments array contains self and _cmd, so the first object is at position 2.
debugger;
var d = [self alloc];
var arglist = [d, "initWithObjectsAndKeys:"];
for(var i = 2; i<arguments.length; ++i)
arglist[i] = arguments[i];
#include <iostream>
#include <string.h>
#include <stdlib.h>
#define SIZE 3
class Comparator
{
private:
int items[SIZE];
#include <iostream>
#include <string.h>
#include <stdlib.h>
#define SIZE 3
class Comparator
{
private:
int items[SIZE];
<?xml version="1.0" encoding="UTF-8" ?>
<!--
This awful thing parses vkontakte.ru/mail.php
I am *NOT* proud of it. C'est la vie.
Created by Farcaller on 2009-02-17.
Copyright (c) 2009 Hack&Dev FSO. All rights reserved.
-->
def FixFuckingJSON(s):
'''FixFuckingJSON(bad_json) -> good_json
Fixes integer keys in json
'''
RX=re.compile(r'(\d+)')
r = []
m = RX.search(s)
while m:
r.append(m.group(1))
diff --git a/d20tools/postparser.py b/d20tools/postparser.py
index f3af4fe..638c529 100644
--- a/d20tools/postparser.py
+++ b/d20tools/postparser.py
@@ -3,10 +3,16 @@ import re, random
RX_DICE = re.compile(r'[^>](?P<dname>(?P<cnt>\d+)d(?P<dice>\d+)(?P<mod>[-+]\d+|))')
RX_DIRECT = re.compile(r'^((\w+), *)+:') # FIXME
+RDEV = None
+
- (void)onCatalog
{
RSSCatalogController *c = [[RSSCatalogController alloc] initWithNibName:@"RSSCatalogController" bundle:nil];
c.title = @"Catalog";
#ifdef USE_BLOCKS
UIActivityIndicatorView *scrollerView = [[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite] autorelease];
[scrollerView startAnimating];
UIBarButtonItem *scrollerItem = [[[UIBarButtonItem alloc] initWithCustomView:scrollerView] autorelease];
UIBarButtonItem *oldItem = [self.navigationItem.rightBarButtonItem retain];
[self.navigationItem setRightBarButtonItem:scrollerItem animated:YES];
-(void)loadScrollView
{
[[NSUserDefaults standardUserDefaults] setObject:self.dataSourceArray
forKey:@"data"];
[[NSUserDefaults standardUserDefaults] synchronize];
for (NSInteger i=0; i < [self.dataSourceArray count]; i++)
{
NSString *textString = [[self.dataSourceArray objectAtIndex:i]
objectForKey:kLabelTextKey];
// ^^ это медленно, используй fast enumeration: for(xx in yy)