- 博客(102)
- 资源 (22)
- 收藏
- 关注
原创 ios 试图滚动的时候,顶部显示和隐藏动画效果
@interface HeadrView : UIView @property (nonatomic, strong) UIScrollView *scrollView; @end #import "HeadrView.h" #import "Masonry.h" @interface HeadrView ()UIScrollViewDelegate>
2017-11-14 14:44:11
1827
转载 二进制快速排序
算法C语言实现: #define bitsword 32 #define bitsbyte 8 #define bytesword 4 #define R (1 #define digit(A,B) ((A)>>(bitsword-((B)+1)*bitsbyte)&(R-1)) void SortB(int a[],int l,int r,int m)
2017-11-14 10:55:33
847
原创 iOS 从相册中导入二维码图片识别
使用的第三方库ZXingObjC(https://github.com/TheLevelUp/ZXingObjC)进行识别,主要代码如下: CGImageRef imageToDecode = image.CGImage; // Given a CGImage in which we are looking for barcodes ZX
2015-11-25 10:20:44
3894
原创 仿新浪新闻留言界面
#define kTextLen 200 @interface xxxView()UITextViewDelegate> @property (nonatomic, strong) UIView *contentView; @property (nonatomic, strong) PlaceholderTextView *textView; @
2015-09-16 17:17:06
627
原创 iOS 打包工具生成
预备知识:要懂shell脚本和xcode命令行命令,libexec命令使用 1、首先根据序号选择对应的证书,这个要在自己的配置文件中写好 while read var do case "$var" in 1) selectIndex=$var echo "==is number==" break ;; *)echo "==is no number=
2015-09-16 17:08:27
675
原创 发表评论的界面代码
#import "ForumViewController.h" #import "FaceViewController.h" @interface ForumViewController ()UITextViewDelegate,FaceViewDelegate> @property(nonatomic,strong)UITextView* textView; @property(nona
2014-10-29 11:51:52
5539
原创 读写plist文件
1、创建路径 NSFileManager *fileManager = [NSFileManager defaultManager]; NSArray * paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentDi
2014-10-20 16:32:17
497
原创 分裂bst 非递归实现
PBSTNode splayR(PBSTNode h,Item item) { if (h == z) { return NEW(item, z, z, 1); } PBSTNode p = NULL; int flag = 0; Key v = key(item); while (h !=
2014-07-07 16:58:32
647
原创 二进制加法实现
int const n = 5; void addBinary(int *a,int *b,int *s) { int i = n-1; int c = 0; int d = 0; for (;i >= 0;i -=1) { d = floor((*(a+i) + *(b+i) + c )/2);
2014-07-03 14:18:28
3259
原创 BST删除重复键实现,非递归实现
PBSTNode deleteRRR(PBSTNode h,Key v) {//删除一个匹配的键值,如果有重复的键,将删除 if (h == z) { return h; } PBSTNode p = h; PBSTNode parent = NULL; while (p != z)
2014-06-12 16:29:38
703
原创 BST的删除的非递归实现
PBSTNode deleteRR(PBSTNode h,Key v) { if (h == z) { return h; } Key t = key(h->data); PBSTNode p = h; PBSTNode parent = NULL; while (p != z) {
2014-06-11 17:40:08
701
原创 将bst树选择运算的非递归实现-获取第k个元素值
Item selectRR(PBSTNode link,int k) { if (link == z) { return NULLitem; } PBSTNode p = link; int t = 0; while (p != z) { t = p->left->N;
2014-06-11 16:58:04
575
原创 在mac上使用Tcpdump命令行抓包工具的安装
首先,先从http://www.tcpdump.org网上下载源代码,然后在进行安装,这个
2014-05-29 10:03:02
10513
原创 使用指针数组实现bst插入和查找操作
#include #include #include typedef struct node* PNode; #define key int #define Item int struct node { int index; Item data; PNode left; PNode right;
2014-05-21 15:00:45
628
原创 NSObject类中有两个方法: + (void)load; + (void)initialize;解释
NSObject类中有两个方法: + (void)load; + (void)initialize; 如果多个类继承NSObject类,那在所有的子类在程序启动的时候,都会调用load方法, 在调用load这个方法要分几种情况: 1、如果在load方法里面调用[self class]时候,会调用initialize方法, 2、如果在load方法里面没有调用[self
2014-05-20 11:08:07
1218
原创 符号表的索引实现-使用3个数组实现
#include #include #include typedef char* itemType; typedef char* keyType; static int N; static int inc; static itemType a[100]; static int left[100];// static int right
2014-05-16 17:28:39
762
原创 使用重复键插入到bst树中
void BSTinsertR(Item item) {//重复的键的插入操作 if (header == NULL) { header = NEW(item,NULL, NULL, 1); return; } if (header == z) { header = NEW
2014-05-12 17:03:38
734
原创 BST树的搜索和插入一并开始运行
//使用一个标 PBSTNode BSTsub(PBSTNode link,Item item,int *flag) { if (!link) { return NEW(item, z, z, 1); } Key t = key(link->data); if (t == key(item))
2014-05-12 09:00:35
597
原创 字符串反转
void FirstReverse(char * str[]) { int sumLen = (int)(sizeof(&str)/sizeof(str[0])); int len = 0; int i = 0,j = 0; for (len = 0;len { int subLen = (int)strlen((
2014-04-23 09:44:25
676
原创 scheme写程序训练
;求三个值,两两之间的最大值 (define (max-function x y z) (define max (if (> (+ x y) (+ x z))(+ x y) (+ x z))) (define mid (if (> (+ x y) (+ y z))(+ x y) (+ y z))) (define lst (if (
2014-04-21 17:17:36
586
原创 符号表支持优先队列的最大值和最小值删除
//支持优先队列的最大值和最小值删除,aType = 0是删除最小值 aType = 1是删除最大值 void STdeleteMinAndMax(int aType) { STfilterData(); int ret = 0; int i = 0; int n = STcount(); int tempIndex = 0;
2014-04-17 11:14:05
1096
原创 使用数组模拟符号表的程序
#include #include #include //插入, typedef int Item; typedef int Key; static Item *g_cache; static Item *g_Item; static int M; static int indexX; void key(Item aItem,Ke
2014-04-08 16:56:31
616
原创 二项堆实现
#include #include #include #include #define N 10 typedef struct PNode { int key; int degree; struct PNode *p,*child,*sibling; }*PLink; void BINOMIAL
2014-03-04 16:10:25
709
原创 锦标赛程序的优先队列的插入
Link insert(Link pq,Item aData) { if (!pq) { return pq; } if (pq->l) { if (pq->data == pq->l ->data) { pq->flag = 1;
2014-02-11 15:59:51
577
原创 锦标赛程序的优先队列的删除
//转载c算法,其中在数据结构中加一个标志位,是用于删除遍历后使用 struct node { Item data; Link l,r; int flag; }; Link NEW(Item aData) { Link x = malloc(sizeof(*x)); if (!x) { re
2014-02-11 09:44:10
613
原创 有序双向链表的合并,删除最大值和最小值
typedef int Item; typedef struct node { Item data; struct node *next,*prev; }*PQlink; typedef struct pq { PQlink header,tail; }*PQ; PQ createLink() { PQ pq =
2014-01-26 17:55:44
1166
原创 无序双向链表的优先队列
#include #include #include typedef int Item; typedef struct node { Item data; struct node *next,*prev; }*PQlink; typedef struct pq { PQlink header,tail; }
2014-01-22 10:40:06
1029
转载 runtime地址
http://opensource.apple.com/tarballs/objc4/
2013-12-25 15:51:00
549
原创 ALAssetsLibrary读取相册里面的图片
self.m_library = [[ALAssetsLibrary alloc] init]; 然后设置 NSUInteger type = ALAssetsGroupLibrary | ALAssetsGroupAlbum | ALAssetsGroupEvent | ALAssetsGroupFaces | ALAssetsGroupPhotoStream;
2013-12-24 13:45:57
4261
原创 在storyboard中使用代码实现跳转
UIStoryboard *board = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; Person****ViewController *next = [board instantiateViewControllerWithIdentifier:@"Person******ViewController"];
2013-12-24 13:25:21
2107
原创 等比例缩放图片
+(UIImage *) getThumbnail:(UIImage *)image size:(CGSize)asize { UIImage *newimage; UIGraphicsBeginImageContext(asize); image drawInRect:CGRectMake(0, 0, asize.width, asize.heig
2013-12-24 13:21:13
768
原创 UITabBarController的外观修改总结
要自定义UITabBarController UITabBarController *tabBarController = self; UITabBar *tabBar = tabBarController.tabBar; UITabBarItem *tabBarItem1 = [tabBar.items objectAtIndex:0]; UITabBarI
2013-12-24 13:19:11
5052
1
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人