WWDC 2006 2007 2008 2009 2010 2011 2012 2013 2014
import java.io.IOException; | |
import java.io.UncheckedIOException; | |
/** | |
* XML escaping utils. | |
* | |
* Source: https://gist.github.com/Miha-x64/4ed50f1d5593e45a452efbf456aa1db4 | |
*/ | |
public final class Xml { |
The libdispatch is one of the most misused API due to the way it was presented to us when it was introduced and for many years after that, and due to the confusing documentation and API. This page is a compilation of important things to know if you're going to use this library. Many references are available at the end of this document pointing to comments from Apple's very own libdispatch maintainer (Pierre Habouzit).
My take-aways are:
-
You should create very few, long-lived, well-defined queues. These queues should be seen as execution contexts in your program (gui, background work, ...) that benefit from executing in parallel. An important thing to note is that if these queues are all active at once, you will get as many threads running. In most apps, you probably do not need to create more than 3 or 4 queues.
-
Go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure. Reuse
101 Keynote http://devstreaming.apple.com/videos/wwdc/2016/101g0jrsvv5qcoduisk/101/101_hd_keynote.mp4 | |
102 Platforms State of the Union http://devstreaming.apple.com/videos/wwdc/2016/102w0bsn0ge83qfv7za/102/102_hd_platforms_state_of_the_union.mp4 | |
103 Apple Design Awards http://devstreaming.apple.com/videos/wwdc/2016/103m0752oxdkymyk6gy/103/103_hd_apple_design_awards.mp4 | |
201 Internationalization Best Practices http://devstreaming.apple.com/videos/wwdc/2016/201h1g4asm31ti2l9n1/201/201_hd_internationalization_best_practices.mp4 | |
202 What's New in Accessibility http://devstreaming.apple.com/videos/wwdc/2016/202w2zhc4l8yomptqnt/202/202_hd_whats_new_in_accessibility.mp4 | |
203 What's New in Cocoa http://devstreaming.apple.com/videos/wwdc/2016/203x2w42att1kdzg1ce/203/203_hd_whats_new_in_cocoa.mp4 | |
204 iMessage Apps and Stickers Part 1 http://devstreaming.apple.com/videos/wwdc/2016/204t23fvanrkj7a1oj7/204/204_hd_imessage_apps_and_stickers_part_1.mp4 | |
205 What's New in Cocoa Touch http://devstreaming.apple.co |
import CoreLocation | |
func locationVCardURLFromCoordinate(coordinate: CLLocationCoordinate2D) -> NSURL? | |
{ | |
guard let cachesPathString = NSSearchPathForDirectoriesInDomains(.CachesDirectory, .UserDomainMask, true).first else { | |
print("Error: couldn't find the caches directory.") | |
return nil | |
} | |
In some cases for Python unit tests, we want to automatically perform setUp
methods in as declared in a base class. However, we still want setUp
to work as per normal in the subclass. The following code will proxy the new setUp
function to run it's base class' and the new one.
# Define a common test base for starting servers
class MyBaseTestCase(unittest.TestCase):
@classmethod
def setUpClass(cls):
"""On inherited classes, run our `setUp` method"""
# Inspired via http://stackoverflow.com/questions/1323455/python-unit-test-with-base-and-sub-class/17696807#17696807
if cls is not MyBaseTestCase and cls.setUp is not MyBaseTestCase.setUp:
http://devstreaming.apple.com/videos/wwdc/2014/403xxksrj0qs8c0/403/403_hd_intermediate_swift.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2014/403xxksrj0qs8c0/403/403_sd_intermediate_swift.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2014/403xxksrj0qs8c0/403/403_intermediate_swift.pdf?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2014/419xxli6f60a6bs/419/419_hd_advanced_graphics_and_animation_performance.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2014/419xxli6f60a6bs/419/419_sd_advanced_graphics_and_animation_performance.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2014/419xxli6f60a6bs/419/419_advanced_graphics_and_animation_performance.pdf?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2014/101xx36lr6smzjo/101/101_hd.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2014/101xx36lr6smzjo/101/101_sd.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2014/236xxwk3fv82sx2/236/236_hd_building_interruptible_and_responsive_interactions.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2 |
Traceback (most recent call last): | |
File "<string>", line 1, in <module> | |
ImportError: No module named virtualenvwrapper.hook_loader | |
virtualenvwrapper.sh: There was a problem running the initialization hooks. | |
If Python could not import the module virtualenvwrapper.hook_loader, | |
check that virtualenv has been installed for | |
VIRTUALENVWRAPPER_PYTHON=/usr/bin/python and that PATH is | |
set properly. |
import uuid | |
import wtforms_json | |
from sqlalchemy import not_ | |
from sqlalchemy.dialects.postgresql import UUID | |
from wtforms import Form | |
from wtforms.fields import FormField, FieldList | |
from wtforms.validators import Length | |
from flask import current_app as app | |
from flask import request, json, jsonify, abort |
#!/usr/bin/env bash | |
rm -rf "${HOME}/Library/Caches/CocoaPods" | |
rm -rf "`pwd`/Pods/" | |
pod update |