(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
#ifndef H_UNORDERED_MAP_ | |
#define H_UNORDERED_MAP_ | |
#import <tr1/unordered_map> | |
template<class K, class T> | |
class HUnorderedMap { | |
public: | |
typedef typename std::tr1::unordered_map<K, T > Map; | |
typedef typename Map::value_type ValueType; |
#import <Foundation/Foundation.h> | |
NSString *decodeStringFromURLFormat(NSString *string) | |
{ | |
NSString *result = [string stringByReplacingOccurrencesOfString:@"+" withString:@" "]; | |
result = [result stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; | |
return result; | |
} | |
NSString *encodeStringToURLFormat(NSString *string) |
NSIndexPath *IndexPathWithOffset(UITableView *tableView, NSIndexPath *indexPath, NSInteger offset) | |
{ | |
if (indexPath.row < 0 || indexPath.section < 0) | |
{ | |
return nil; | |
} | |
if (offset == 0) | |
{ | |
return indexPath; | |
} |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
void __cdecl -[UITableViewController loadView](UITableViewController *self, SEL a2) | |
{ | |
NSString *v2; // eax | |
struct objc_object *v3; // eax | |
UITableView *v4; // edi | |
struct objc_object *v5; // eax | |
int v6; // eax | |
UIStoryboard *v7; // eax | |
void *v8; // eax | |
void *v9; // eax |
UITableViewController *__cdecl -[UITableViewController init](UITableViewController *self, SEL a2) | |
{ | |
return (UITableViewController *)-[UITableViewController initWithStyle:](self, "initWithStyle:", 0); | |
} | |
UITableViewController *__cdecl -[UITableViewController initWithNibName:bundle:](UITableViewController *self, SEL a2, id a3, id a4) | |
{ | |
int v4; // edi | |
UITableViewController *v5; // esi |
Persistent queues are really useful. I have envied Android developers for having the Tape queue http://square.github.io/tape/ and the Android Priority Jobqueue https://github.com/yigit/android-priority-jobqueue
Below I have compiled a list of the persistent queue implementations for iOS that I know of. Most of them are not in active development. Ping me if you want a library added to the list.
// | |
// SpinlockTestTests.swift | |
// SpinlockTestTests | |
// | |
// Created by Peter Steinberger on 04/10/2016. | |
// Copyright © 2016 PSPDFKit GmbH. All rights reserved. | |
// | |
import XCTest |
CGFloat BNRTimeBlock (void (^block)(void)); |
#include <stdatomic.h> | |
#include <stdint.h> | |
#include <stdbool.h> | |
/*! | |
An atomic ARC reference. Here's how it works: | |
The lowest bit of the pointer (mask 0x1) is used as a tag for the pointer being stored. | |
if the tag bit is set, that means that one thread currently owns this pointer, and will release it if the value has | |
been concurrently updated. |