Skip to content

Instantly share code, notes, and snippets.

// The basics:
// - Write your own NSURLProtocol subclass and register it.
// - Override the 5 required methods
// - Kick off download or cache fetch during |startLoading|
// - Update self.client with progress/completion/failure notifications.
// UIWebView will download requests concurrently via NSURLProtocol.
// If you use the typical NSURLCache hook to download content, you're
// stuck with serial downloads.
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
@smartdj
smartdj / hmac.cpp
Last active August 29, 2015 14:18 — forked from woodja/hmac.cpp
#include <iostream>
using std::cout;
using std::cerr;
using std::endl;
#include <string>
using std::string;
#include "cryptlib.h"
using CryptoPP::Exception;
@smartdj
smartdj / autoFitIframe.js
Last active August 29, 2015 14:26 — forked from zmmbreeze/autoFitIframe.js
使同域的iframe宽度撑满其所在容器,并且高度自适应其内容
/**
* 使同域的iframe宽度撑满其所在容器,并且高度自适应其内容
*
* @param {Element} iframe .
*/
function autoFitIframe(iframe) {
var doc = iframe.contentDocument || iframe.contentWindow.document;
// 设置iframe宽度
iframe.style.width = '100%';
@smartdj
smartdj / 隐藏UITableView多余的分割线
Created January 13, 2016 01:05 — forked from flashlib/隐藏UITableView多余的分割线
其实就是设置一个透明的footerView,这样空的cell就不会显示出来。
- (void)setExtraCellLineHidden: (UITableView *)tableView
{
UIView *view =[ [UIView alloc]init];
view.backgroundColor = [UIColor clearColor];
[tableView setTableFooterView:view];
[view release];
}
1、 三角函数 
  double sin (double);正弦 
  double cos (double);余弦 
  double tan (double);正切 
  2 、反三角函数 
  double asin (double); 结果介于[-PI/2, PI/2] 
  double acos (double); 结果介于[0, PI] 
  double atan (double); 反正切(主值), 结果介于[-PI/2, PI/2] 
  double atan2 (double, double); 反正切(整圆值), 结果介于[-PI, PI] 
  3 、双曲三角函数 
@smartdj
smartdj / NSURL+ZXURL.h
Created June 19, 2016 00:29 — forked from zhangxigithub/NSURL+ZXURL.h
解析NSURL中GET传数值的参数
//
// NSURL+ZXURL.h
// ZXTools
//
// Created by zhangxi on 13-6-21.
// Copyright (c) 2013年 张玺. All rights reserved.
//
/*
demo