sql取月初月底、季年周等日期范围sql(许多网上博客有BUG) 因网上有的sqlserver写法存在BUG,所以特写此文比如取月底日期的sql,许多博文是这样取的,其实是错误的select dateadd(day,-day(getdate()),dateadd(month,1,getdate()))错误的!!!正确的写法我示范两种select dateadd(day,-1,dateadd(month,1,dateadd(dd,-d
python(五)二叉树 # coding:utf-8import randomclass Node(object): def __init__(self, item): self.elem = item self.lchild = None self.rchild = Noneclass Tree(object): def __init__(s
python(四)二分查找法 # coding:utf-8import randomimport timedef sort(alist, first, last): if first >= last: return mid_value = alist[first] low = first high = last while low < high:
python(三)6种排序算法性能比较(冒泡、选择、插入、希尔、快速、归并) # coding:utf-8import randomimport timedef bubble_sort(alist): """冒泡""" n = len(alist) for j in range(n-1): count = 0 for i in range(0, n-1-j): if alist[i]
python(二)mac环境(macOS10.12.6)下的python3.6使用mysql 首先到mysql官网下载最新版mysql :mysql-5.7.19-macos10.12-x86_64.dmg双击下一下,中间过程中记录下密码(类似这样的一串:4nf6WXPB#!nj),用于后面更改进入系统偏好设置启动mysqlvim ~/.bash_profile加入pathsource ~/.bash_profil
python(一)简单WEB服务器 # coding:utf-8import socketimport reimport sysfrom multiprocessing import Process# from TGWebFramework import app# from Django import appHTML_ROOT_DIR = "./html"class HTTPServer(object): def _
swift3自定义UIBotton(带动画效果) 效果上代码//// TGAnimationButton.swift// TGAnimationButton//// Created by targetcloud on 2017/8/18.// Copyright © 2017年 targetcloud. All rights reserved.//import UIKitenum TGAnimationBu
swift3实现照片多选,史上最赞(TGPhotoPicker) the best photo picker plugin in swift(iOS8+)Demo Screenshot照片选择界面(.weibo)更多效果在下面哦:)参数调节界面自定义拍照界面Recently Updated0.0.5 添加AlertSheet类和useCustomActionSheet配置属性
iOS8自定义相机(swift) iOS不同版本的自定义有所不同的,本文介绍iOS8下的自定义相机,所用语言为swift3+//// TGCameraVCForiOS8.swift// TGPhotoPicker//// Created by targetcloud on 2017/8/11.// Copyright © 2017年 targetcloud. All rights reserved.//
iOS10自定义相机(swift) 直接上代码//// TGCameraVC.swift// TGPhotoPicker//// Created by targetcloud on 2017/7/25.// Copyright © 2017年 targetcloud. All rights reserved.//import UIKitimport AVFoundationimport Photos
替换UIAlertView、UIAlertController UIAlertView是iOS9开始不建议使用了,UIAlertController是iOS8提倡使用,但是这两个风格可能都不是自己想要的,那么下面介绍如何自定义一款//// TGActionSheet.swift// TGPhotoPicker//// Created by targetcloud on 2017/8/13.// Copyright © 2017年 targ
画心 //// HeartView.h// Heart//// Created by targetcloud on 2017/7/27.// Copyright © 2017年 targetcloud. All rights reserved.//#import @interface HeartView : UIView/** 波纹占比 */@property (nona
一款以最新潮的方式来使用UIImage的swift插件 1、新建一个swift工程,pod init支持cocapods2、pod search TGImage3、在podfile中写入 一句pod 'TGImage'4、编写代码//// ViewController.swift// TGImageDemo//// Created by targetcloud on 2017/7/1.// Co
swift3自定义下拉刷新控件(二)QQ弹簧效果 1、请在命令行输入 pod search tgrefreshswift2、弹出下面提示说明可以使用3、在你的podfile中导入tgrefreshswift
橡皮筯式下拉刷新控件的实现,效果超赞(OC版本) 本刷新控制支持两种形式,默认是橡皮筯式,也是QQ上见到的效果,皮筯拉到一定的长度,自动进入刷新状态; 另外一种是常见形式(下拉可以刷新,松手即将刷新,正在刷新),大家可以根据自己喜欢切换。效果图如下原本MJRefresh self.collectionV.mj_header = [MJRefreshNormalHeader headerWithRefreshingTarg
长文本在复杂cell里的收缩与展开 一般情况下,我们在cell里处理单纯的长文本收缩与展开是不难的,但是遇到一些复杂cell的时候,里面有各种uilabe、uiimageview、图片、声音、视频时,问题就变得比较复杂,因为你处理了cell里其中一个长文本时,其他cell里的元素得重新布局。效果如下由于上传限制,复杂cell的GIF见 GitHub https://github.com/targetcloud/b
一句话完成无限轮播器的编程 本轮播器不采用什么 collectionView,也不使用XIB,更不依赖第三方下载框架(如AFN等),使用也非常简单,先上效果图其中指示器pagecontrol效果自己可以设置,效果一效果二如何使用步骤如下1、#import "TGCarouselImageView.h"2、NSArray *imag
自己的导航条与系统UINavigationController的导航条进行自动融合与分离 我们在很多APP使用都会遇到,类似的tableview在向上滚动时,会让自己的导航条与系统的UINavigation的titleview进行融合,而当类似的tableview向下滚动时,又会让自己的的导航条与系统的UINavigation的titleview进行分离,另外融合分享会结合一定的滚动或滑动速度,如果慢慢向下滚动或滑动,则不会分离自己的导航条,当速度达到设定的某个值则正式进行分离或融合,