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
protocol SomeValue { | |
var name: String? { get } | |
func getName() -> String? | |
} | |
extension SomeValue { | |
var name: String? { | |
return nil | |
} | |
func getName() -> String? { |
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
(gdb) po [[NSURL alloc] initWithScheme:@"https" host:@"localhost:8000" path:@"/xauth_login/"] | |
https://localhost:8000/xauth_login/// | |
(gdb) po [NSURL URLWithString:@"https://localhost:8000/xauth_login/"] | |
https://localhost:8000/xauth_login/ |
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
2011-10-26 17:11:01.966 JSONPerfTest[195:707] SBJSON-twitter_public.json 19.425 | |
2011-10-26 17:11:09.877 JSONPerfTest[195:707] YAJL-twitter_public.json 7.879 | |
2011-10-26 17:11:20.179 JSONPerfTest[195:707] TouchJSON-twitter_public.json 10.275 | |
2011-10-26 17:11:22.405 JSONPerfTest[195:707] JSONKit-twitter_public.json 2.204 | |
2011-10-26 17:11:25.267 JSONPerfTest[195:707] NextiveJson-twitter_public.json 2.839 | |
2011-10-26 17:11:27.291 JSONPerfTest[195:707] NSJSONSerialization-twitter_public.json 1.990 | |
2011-10-26 17:11:39.849 JSONPerfTest[195:707] SBJSON-lastfm.json 12.504 | |
2011-10-26 17:11:45.418 JSONPerfTest[195:707] YAJL-lastfm.json 5.546 | |
2011-10-26 17:11:59.969 JSONPerfTest[195:707] TouchJSON-lastfm.json 14.524 |
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
2011-10-26 16:08:32.778 JSONPerfTest[2436:707] SBJSON-twitter_public.json 2.083 | |
2011-10-26 16:08:33.919 JSONPerfTest[2436:707] YAJL-twitter_public.json 1.136 | |
2011-10-26 16:08:36.969 JSONPerfTest[2436:707] TouchJSON-twitter_public.json 3.047 | |
2011-10-26 16:08:37.737 JSONPerfTest[2436:707] JSONKit-twitter_public.json 0.765 | |
2011-10-26 16:08:38.685 JSONPerfTest[2436:707] NextiveJson-twitter_public.json 0.946 | |
2011-10-26 16:08:39.493 JSONPerfTest[2436:707] NSJSONSerialization-twitter_public.json 0.806 | |
2011-10-26 16:08:43.699 JSONPerfTest[2436:707] SBJSON-lastfm.json 4.201 | |
2011-10-26 16:08:45.641 JSONPerfTest[2436:707] YAJL-lastfm.json 1.940 | |
2011-10-26 16:08:50.868 JSONPerfTest[2436:707] TouchJSON-lastfm.json 5.224 |
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
2011-10-26 16:04:05.344 JSONPerfTest[27924:10103] SBJSON-twitter_public.json 0.371 | |
2011-10-26 16:04:05.605 JSONPerfTest[27924:10103] YAJL-twitter_public.json 0.259 | |
2011-10-26 16:04:06.076 JSONPerfTest[27924:10103] TouchJSON-twitter_public.json 0.470 | |
2011-10-26 16:04:06.190 JSONPerfTest[27924:10103] JSONKit-twitter_public.json 0.113 | |
2011-10-26 16:04:06.327 JSONPerfTest[27924:10103] NextiveJson-twitter_public.json 0.135 | |
2011-10-26 16:04:06.434 JSONPerfTest[27924:10103] NSJSONSerialization-twitter_public.json 0.106 | |
2011-10-26 16:04:07.093 JSONPerfTest[27924:10103] SBJSON-lastfm.json 0.656 | |
2011-10-26 16:04:07.447 JSONPerfTest[27924:10103] YAJL-lastfm.json 0.354 | |
2011-10-26 16:04:08.275 JSONPerfTest[27924:10103] TouchJSON-lastfm.json 0.827 | |
2011-10-26 16:04:08.444 JSONPerfTest[27924:10103] JSONKit-lastfm.json 0.168 |
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 re, htmlentitydefs, os.path, urllib | |
## | |
# Removes HTML or XML character references and entities from a text string. | |
# Thank you Fredrik Lundh | |
# http://effbot.org/zone/re-sub.htm#unescape-html | |
# | |
# @param text The HTML (or XML) source text. | |
# @return The plain text, as a Unicode string, if necessary. |
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
int contentLength = 0; | |
if (request.containsHeader("content-length")) { | |
contentLength = Integer.parseInt(request.getFirstHeader("content-length").getValue()); | |
} | |
String bodyString = null; | |
if (contentLength > 0) { | |
BasicHttpEntityEnclosingRequest req = new BasicHttpEntityEnclosingRequest(request.getRequestLine()); | |
try { | |
conn.receiveRequestEntity(req); |
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
{ | |
"do_json": true, | |
"package": "com.yelp.parcelgen", | |
"props": { | |
"String": [ | |
"id", "name", "imageUrl", "url", "mobileUrl", | |
"phone", "displayPhone", "ratingImageUrl", | |
"ratingImageUrlSmall", "snippetText", "snippetImageUrl" | |
], | |
"int": ["reviewCount"], |
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 Swift | |
extension CollectionType where Index: SignedNumberType, Index == Index.Distance { | |
func get(var position: Self.Index) -> Self.Generator.Element? { | |
if position < 0 { | |
position = self.endIndex.advancedBy(position) | |
} | |
return (indices ~= position) ? self[position] : nil | |
} |
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 sys; reload(sys); sys.setdefaultencoding('utf-8') | |
import MySQLdb | |
import urllib2 | |
import urllib | |
import simplejson | |
login = 'your github login' | |
token = 'your github API key' | |
repo = 'username/repo' |