- iOS 8+ 添加毛玻璃效果
verge_l
letblurEffect=UIBlurEffect(style:UIBlurEffectStyle.Dark)letsub=UIVisualEffectView(effect:blurEffect)sub.frame=UIScreen.mainScreen().boundssub.alpha=0.8view.addSubview(sub)
- IOS 计算富文本的高度方法
OKXLIN
ios
方式一:NSMutableAttributedString*attStr=[NSMutableAttributedStringnew];CGSizeattSize=[attStrboundingRectWithSize:CGSizeMake(UIScreen.mainScreen.bounds.size.width,MAXFLOAT)options:NSStringDrawingUsesLineF
- UICollectionView
79d12e22ec53
UICollectionViewimportUIKitclassViewController:UIViewController,UICollectionViewDataSource,UICollectionViewDelegate{overridefuncviewDidLoad(){super.viewDidLoad()letscreenRect=UIScreen.main.boundsletre
- 解决Swift的Invalid frame dimension (negative or non-finite)
左边的天堂
Swiftswift开发语言ios
升级macos和xcode之后原来的代码报异常Invalidframedimension(negativeornon-finite),代码如下:Image("image").frame(width:.infinity)可以使用以下方法解决此问题:1.使用maxWidthImage("image").frame(maxWidth:.infinity)2.使用UIScreen尺寸Image("imag
- ios给整个屏幕加遮罩
pomelo_西
//绘制遮罩,定义宽高为屏幕的宽高letmaskView=UIView(frame:CGRect(x:0,y:0,width:UIScreen.main.bounds.width,height:UIScreen.main.bounds.height))//设置透明度maskView.backgroundColor=UIColor(red:0,green:0,blue:0,alpha:0.5)//添
- 8.1、UItableView
艾希_可可
importUIKitclassViewController:UIViewController,UITableViewDelegate,UITableViewDataSource{letScreenWidth=UIScreen.main.bounds.widthletScreenHeight=UIScreen.main.bounds.heightletimageArray=[["wd-zcfb",
- IOS UITableView UITableViewCell控件
SkTj
importUIKitclassViewController:UIViewController,UITableViewDataSource{overridefuncviewDidLoad(){super.viewDidLoad()//Doanyadditionalsetupafterloadingtheview,typicallyfromanib.letscreenRect=UIScreen.ma
- iOS 录屏和截屏监听
爱笑的猫mi
源起最近公司应用安全检查,在用户登录页面要防止截屏和录屏导致用户名密码等敏感信息泄露。iOS实现不了不让截屏或者录屏,但是提供的截屏或者录屏的监听方法,当用户截屏或录屏时系统会发送相关通知,我们可以提示用户截屏或录屏会泄露一些个人安全信息,类似于微信或支付宝的付款码截屏。截屏通知名:UIApplicationUserDidTakeScreenshot录屏是iOS11之后才有的功能,UIScreen
- Swift获取屏幕宽高
丶微笑Best_53a6
letscreenWidth=UIScreen.main.bounds.widthletscreenHeight=UIScreen.main.bounds.height
- SwiftUI之页面跳转
liyubao160
swiftuiwindowsservlet
1.更改根控制器页面:Button.init("返回"){letscrenDelegate:UIWindowSceneDelegate?={varuiScreen:UIScene?UIApplication.shared.connectedScenes.forEach{(screen)inuiScreen=screen}return(uiScreen?.delegateas?UIWindowSce
- SWIFT-获取启动图片
镜花水月忆存逝兮
//获取启动图classfunclaunchImage()->UIImage?{varlauchImage:UIImage!varviewOrientation:String!letviewSize=UIScreen.main.bounds.sizeletorientation:UIInterfaceOrientation=UIApplication.shared.statusBarOrienta
- iOS适配深色模式
tongyuling
我们所熟悉的UIView、UIViewController、UIScreen、UIWindow都已经遵从了一个叫UITraitEnvironment的协议。这些类都拥有一个叫做traitCollection的属性,traitCollection里面有一个userInterfaceStyle属性,而颜色模式就是存在userInterfaceStyle中。我们就可以通过traitCollection的
- SwiftUI通过代码实现页面跳转
蓝不蓝编程
letscrenDelegate:UIWindowSceneDelegate?={varuiScreen:UIScene?UIApplication.shared.connectedScenes.forEach{(screen)inuiScreen=screen}return(uiScreen?.delegateas?UIWindowSceneDelegate)}()screnDelegate?.
- Swift 截取当前屏幕(包含导航栏)
艾欧尼亚
funcscreenshot()->UIImage?{varimageSize=CGSize.zeroletorientation=UIApplication.shared.statusBarOrientationiforientation.isPortrait{imageSize=UIScreen.main.bounds.size}else{imageSize=CGSize(width:UISc
- Swift-富文本使用
SK丿希望
image.png定义公用的属性letstr="我不要种田我要当老板"letattrStr=NSMutableAttributedString.init(string:str)修改颜色(可多段)//MARK:-修改颜色lettextLabel=UILabel.init(frame:CGRect.init(x:20,y:100,width:UIScreen.main.bounds.size.widt
- iOS 13 之后自定义 Window 不显示解决 (SceneDelegate)
芮淼一线
iOS13以后苹果增加了SceneDelegate来管理窗口。iOS13以前自定义个Window进行显示,下面两种方式都可以方式一:letnewWindow=UIWindow()newWindow.frame=CGRect.init(x:0,y:0,width:UIScreen.main.bounds.size.width,height:UIScreen.main.bounds.size.heig
- CityViewController
一世沧桑画
letScrW=UIScreen.main.bounds.size.widthletScrH=UIScreen.main.bounds.size.height提示框extensionUIViewController{funcshowAlert(msg:String,sec:TimeInterval){//实例化弹出控制器letalertVC=UIAlertController(title:nil,
- SwiftUI——得到屏幕尺寸(bounds和nativeBounds)
zhonguncle
Swift/SwiftUIswift
本文原本写于2021-02-0717:12:03,但是由于2022-11-6发现了一个修改(或者说bug,已经上报了),所以补充了一些相关说明,详情请查看:《关于UIScreen.main.bounds.height的值发生了变化的原因和解决方案》。bounds关于这个值有个地方需要说明一下,varscreenBounds:CGRect=UIScreen.main.boundsbounds得到的是
- 【Swift】开屏广告页(代码贴走就能用)
Landen2011
swiftiosobjective-cxcode开发语言
////LaunchADView.swift//TianFeng////CreatedbyAppleon2022/5/5.//importFoundationimportUIKitpublicclassLaunchADView:UIView{letscreenW=UIScreen.main.bounds.widthletscreenH=UIScreen.main.bounds.heightvara
- 一像素的大小
FallPine
1像素=1.0/UIScreen.main.scale参考文章:航歌Swift-正确绘制1像素的线条(附样例)
- Swift-适配iphoneX屏幕
紫云夕月
//设备屏幕尺寸letcurrentMode_width=UIScreen.main.currentMode?.size.widthletcurrentMode_height=UIScreen.main.currentMode?.size.height//判断是否是iPhoneX//iphoneXiPhoneXs1125,2436letiPhoneX=currentMode_height==243
- UILabel 不换行、preferredMaxLayoutWidth
mydisc1
问题:UILabel自动布局,如果设置了numberOfLines大于0,有时候会发现并没有换行?原因:设置preferredMaxLayoutWidth。比如UILabel设置了左边距10右边距10,则preferredMaxLayoutWidth=UIScreen.main.bounds.width-20.0.当然,不同IOS系统,可能不设置preferredMaxLayoutWidth,也会
- Swift 宏定义iPhoneX
紫星轩
letiPhoneX=(UIScreen.instanceMethod(for:#selector(getter:UIScreen.main.currentMode))!=nil)?__CGSizeEqualToSize(CGSize.init(width:1125,height:2436),(UIScreen.main.currentMode?.size)!):false
- swift学习之旅--实现一个自定义cell的tableView
Auditore
不说便宜话了,直接上代码imagecontrollerimportUIKitletscreen_width=UIScreen.main.bounds.size.widthletscreen_height=UIScreen.main.bounds.size.heightletwindowKey=UIApplication.shared.windows.filter{$0.isKeyWindow}.f
- isiPhoneX/刘海屏 相关的宏定义
知德
主要是看isNotchScreen的判断方式1.根据每种设备的屏幕分辨率//判断是否是ipad#defineisPad([[UIDevicecurrentDevice]userInterfaceIdiom]==UIUserInterfaceIdiomPad)//屏幕size#definekScreenSize(UIScreen.mainScreen.currentMode.size)//Scree
- swift的轮播
ViewController_
导入这个东西吧privatelazyvarscrollView:UIScrollView={letscrollView=UIScrollView(frame:CGRect(x:0,y:0,width:UIScreen.main.bounds.width,height:200))scrollView.contentSize=CGSize(width:3*(UIScreen.main.bounds.w
- 气泡选择框-可自定义(类似微信气泡选择框)
Paxton_
使用方法letconfigure=PXPullConfigure()configure.apexPoint=CGPoint(x:UIScreen.main.bounds.width-45,y:45)letview=PXPullView.init(configure:configure,titileArr:["测试1","测试2","测试3","测试4","测试5"])view.show()conf
- 全屏宽度的图片设置、@2x或@3x高倍图片设置原理
小毛毛笑哈哈
UI布局基本控件ios适配全屏宽度图片oc2x
场景:启动页面需要全屏宽度的图片,如何设定该imageView的约束要求ImageView的宽度=屏幕宽度,而ImageView的长宽比固定为4:3,如何做?约束该view的宽度:左右间距设为0、或者宽度等于父View的宽度;在加上宽高约束,如下所示:关于适配,各屏幕尺寸:为了自动适应分辨率,系统会根据设备实际分辨率,自动给UIScreen.scale赋值,加载1x,2x,3x对应的图片,该属性对
- SwiftUI 入门之Image设置大小并居中(2020年教程)
iCloudEnd
SwiftUI入门之Image设置大小并居中(2020年教程)技术要点如何获取屏幕大小UIScreen.main.bounds.width如何设置照片大小适中.resizable().scaledToFit()代码importSwiftUIstructProductCard:View{varbody:someView{VStack(alignment:.leading,spacing:0){Ima
- iOS 防录屏
海边的遐想
//当用户录屏怎么办目前来说只能进行提示。监听到就返回上一页,并弹出提示1,检测当前设备是否在录屏:pragmamark--录屏(void)addLuPingJianTing{//监测当前设备是否处于录屏状态UIScreen*sc=[UIScreenmainScreen];if(@available(iOS11.0,*)){if(sc.isCaptured){NSLog(@"正在录制-----%d
- java责任链模式
3213213333332132
java责任链模式村民告县长
责任链模式,通常就是一个请求从最低级开始往上层层的请求,当在某一层满足条件时,请求将被处理,当请求到最高层仍未满足时,则请求不会被处理。
就是一个请求在这个链条的责任范围内,会被相应的处理,如果超出链条的责任范围外,请求不会被相应的处理。
下面代码模拟这样的效果:
创建一个政府抽象类,方便所有的具体政府部门继承它。
package 责任链模式;
/**
*
- linux、mysql、nginx、tomcat 性能参数优化
ronin47
一、linux 系统内核参数
/etc/sysctl.conf文件常用参数 net.core.netdev_max_backlog = 32768 #允许送到队列的数据包的最大数目
net.core.rmem_max = 8388608 #SOCKET读缓存区大小
net.core.wmem_max = 8388608 #SOCKET写缓存区大
- php命令行界面
dcj3sjt126com
PHPcli
常用选项
php -v
php -i PHP安装的有关信息
php -h 访问帮助文件
php -m 列出编译到当前PHP安装的所有模块
执行一段代码
php -r 'echo "hello, world!";'
php -r 'echo "Hello, World!\n";'
php -r '$ts = filemtime("
- Filter&Session
171815164
session
Filter
HttpServletRequest requ = (HttpServletRequest) req;
HttpSession session = requ.getSession();
if (session.getAttribute("admin") == null) {
PrintWriter out = res.ge
- 连接池与Spring,Hibernate结合
g21121
Hibernate
前几篇关于Java连接池的介绍都是基于Java应用的,而我们常用的场景是与Spring和ORM框架结合,下面就利用实例学习一下这方面的配置。
1.下载相关内容: &nb
- [简单]mybatis判断数字类型
53873039oycg
mybatis
昨天同事反馈mybatis保存不了int类型的属性,一直报错,错误信息如下:
Caused by: java.lang.NumberFormatException: For input string: "null"
at sun.mis
- 项目启动时或者启动后ava.lang.OutOfMemoryError: PermGen space
程序员是怎么炼成的
eclipsejvmtomcatcatalina.sheclipse.ini
在启动比较大的项目时,因为存在大量的jsp页面,所以在编译的时候会生成很多的.class文件,.class文件是都会被加载到jvm的方法区中,如果要加载的class文件很多,就会出现方法区溢出异常 java.lang.OutOfMemoryError: PermGen space.
解决办法是点击eclipse里的tomcat,在
- 我的crm小结
aijuans
crm
各种原因吧,crm今天才完了。主要是接触了几个新技术:
Struts2、poi、ibatis这几个都是以前的项目中用过的。
Jsf、tapestry是这次新接触的,都是界面层的框架,用起来也不难。思路和struts不太一样,传说比较简单方便。不过个人感觉还是struts用着顺手啊,当然springmvc也很顺手,不知道是因为习惯还是什么。jsf和tapestry应用的时候需要知道他们的标签、主
- spring里配置使用hibernate的二级缓存几步
antonyup_2006
javaspringHibernatexmlcache
.在spring的配置文件中 applicationContent.xml,hibernate部分加入
xml 代码
<prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop>
<prop key="hi
- JAVA基础面试题
百合不是茶
抽象实现接口String类接口继承抽象类继承实体类自定义异常
/* * 栈(stack):主要保存基本类型(或者叫内置类型)(char、byte、short、 *int、long、 float、double、boolean)和对象的引用,数据可以共享,速度仅次于 * 寄存器(register),快于堆。堆(heap):用于存储对象。 */ &
- 让sqlmap文件 "继承" 起来
bijian1013
javaibatissqlmap
多个项目中使用ibatis , 和数据库表对应的 sqlmap文件(增删改查等基本语句),dao, pojo 都是由工具自动生成的, 现在将这些自动生成的文件放在一个单独的工程中,其它项目工程中通过jar包来引用 ,并通过"继承"为基础的sqlmap文件,dao,pojo 添加新的方法来满足项
- 精通Oracle10编程SQL(13)开发触发器
bijian1013
oracle数据库plsql
/*
*开发触发器
*/
--得到日期是周几
select to_char(sysdate+4,'DY','nls_date_language=AMERICAN') from dual;
select to_char(sysdate,'DY','nls_date_language=AMERICAN') from dual;
--建立BEFORE语句触发器
CREATE O
- 【EhCache三】EhCache查询
bit1129
ehcache
本文介绍EhCache查询缓存中数据,EhCache提供了类似Hibernate的查询API,可以按照给定的条件进行查询。
要对EhCache进行查询,需要在ehcache.xml中设定要查询的属性
数据准备
@Before
public void setUp() {
//加载EhCache配置文件
Inpu
- CXF框架入门实例
白糖_
springWeb框架webserviceservlet
CXF是apache旗下的开源框架,由Celtix + XFire这两门经典的框架合成,是一套非常流行的web service框架。
它提供了JAX-WS的全面支持,并且可以根据实际项目的需要,采用代码优先(Code First)或者 WSDL 优先(WSDL First)来轻松地实现 Web Services 的发布和使用,同时它能与spring进行完美结合。
在apache cxf官网提供
- angular.equals
boyitech
AngularJSAngularJS APIAnguarJS 中文APIangular.equals
angular.equals
描述:
比较两个值或者两个对象是不是 相等。还支持值的类型,正则表达式和数组的比较。 两个值或对象被认为是 相等的前提条件是以下的情况至少能满足一项:
两个值或者对象能通过=== (恒等) 的比较
两个值或者对象是同样类型,并且他们的属性都能通过angular
- java-腾讯暑期实习生-输入一个数组A[1,2,...n],求输入B,使得数组B中的第i个数字B[i]=A[0]*A[1]*...*A[i-1]*A[i+1]
bylijinnan
java
这道题的具体思路请参看 何海涛的微博:http://weibo.com/zhedahht
import java.math.BigInteger;
import java.util.Arrays;
public class CreateBFromATencent {
/**
* 题目:输入一个数组A[1,2,...n],求输入B,使得数组B中的第i个数字B[i]=A
- FastDFS 的安装和配置 修订版
Chen.H
linuxfastDFS分布式文件系统
FastDFS Home:http://code.google.com/p/fastdfs/
1. 安装
http://code.google.com/p/fastdfs/wiki/Setup http://hi.baidu.com/leolance/blog/item/3c273327978ae55f93580703.html
安装libevent (对libevent的版本要求为1.4.
- [强人工智能]拓扑扫描与自适应构造器
comsci
人工智能
当我们面对一个有限拓扑网络的时候,在对已知的拓扑结构进行分析之后,发现在连通点之后,还存在若干个子网络,且这些网络的结构是未知的,数据库中并未存在这些网络的拓扑结构数据....这个时候,我们该怎么办呢?
那么,现在我们必须设计新的模块和代码包来处理上面的问题
- oracle merge into的用法
daizj
oraclesqlmerget into
Oracle中merge into的使用
http://blog.csdn.net/yuzhic/article/details/1896878
http://blog.csdn.net/macle2010/article/details/5980965
该命令使用一条语句从一个或者多个数据源中完成对表的更新和插入数据. ORACLE 9i 中,使用此命令必须同时指定UPDATE 和INSE
- 不适合使用Hadoop的场景
datamachine
hadoop
转自:http://dev.yesky.com/296/35381296.shtml。
Hadoop通常被认定是能够帮助你解决所有问题的唯一方案。 当人们提到“大数据”或是“数据分析”等相关问题的时候,会听到脱口而出的回答:Hadoop! 实际上Hadoop被设计和建造出来,是用来解决一系列特定问题的。对某些问题来说,Hadoop至多算是一个不好的选择,对另一些问题来说,选择Ha
- YII findAll的用法
dcj3sjt126com
yii
看文档比较糊涂,其实挺简单的:
$predictions=Prediction::model()->findAll("uid=:uid",array(":uid"=>10));
第一个参数是选择条件:”uid=10″。其中:uid是一个占位符,在后面的array(“:uid”=>10)对齐进行了赋值;
更完善的查询需要
- vim 常用 NERDTree 快捷键
dcj3sjt126com
vim
下面给大家整理了一些vim NERDTree的常用快捷键了,这里几乎包括了所有的快捷键了,希望文章对各位会带来帮助。
切换工作台和目录
ctrl + w + h 光标 focus 左侧树形目录ctrl + w + l 光标 focus 右侧文件显示窗口ctrl + w + w 光标自动在左右侧窗口切换ctrl + w + r 移动当前窗口的布局位置
o 在已有窗口中打开文件、目录或书签,并跳
- Java把目录下的文件打印出来
蕃薯耀
列出目录下的文件文件夹下面的文件目录下的文件
Java把目录下的文件打印出来
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
蕃薯耀 2015年7月11日 11:02:
- linux远程桌面----VNCServer与rdesktop
hanqunfeng
Desktop
windows远程桌面到linux,需要在linux上安装vncserver,并开启vnc服务,同时需要在windows下使用vnc-viewer访问Linux。vncserver同时支持linux远程桌面到linux。
linux远程桌面到windows,需要在linux上安装rdesktop,同时开启windows的远程桌面访问。
下面分别介绍,以windo
- guava中的join和split功能
jackyrong
java
guava库中,包含了很好的join和split的功能,例子如下:
1) 将LIST转换为使用字符串连接的字符串
List<String> names = Lists.newArrayList("John", "Jane", "Adam", "Tom");
- Web开发技术十年发展历程
lampcy
androidWeb浏览器html5
回顾web开发技术这十年发展历程:
Ajax
03年的时候我上六年级,那时候网吧刚在小县城的角落萌生。传奇,大话西游第一代网游一时风靡。我抱着试一试的心态给了网吧老板两块钱想申请个号玩玩,然后接下来的一个小时我一直在,注,册,账,号。
彼时网吧用的512k的带宽,注册的时候,填了一堆信息,提交,页面跳转,嘣,”您填写的信息有误,请重填”。然后跳转回注册页面,以此循环。我现在时常想,如果当时a
- 架构师之mima-----------------mina的非NIO控制IOBuffer(说得比较好)
nannan408
buffer
1.前言。
如题。
2.代码。
IoService
IoService是一个接口,有两种实现:IoAcceptor和IoConnector;其中IoAcceptor是针对Server端的实现,IoConnector是针对Client端的实现;IoService的职责包括:
1、监听器管理
2、IoHandler
3、IoSession
- ORA-00054:resource busy and acquire with NOWAIT specified
Everyday都不同
oraclesessionLock
[Oracle]
今天对一个数据量很大的表进行操作时,出现如题所示的异常。此时表明数据库的事务处于“忙”的状态,而且被lock了,所以必须先关闭占用的session。
step1,查看被lock的session:
select t2.username, t2.sid, t2.serial#, t2.logon_time
from v$locked_obj
- javascript学习笔记
tntxia
JavaScript
javascript里面有6种基本类型的值:number、string、boolean、object、function和undefined。number:就是数字值,包括整数、小数、NaN、正负无穷。string:字符串类型、单双引号引起来的内容。boolean:true、false object:表示所有的javascript对象,不用多说function:我们熟悉的方法,也就是
- Java enum的用法详解
xieke90
enum枚举
Java中枚举实现的分析:
示例:
public static enum SEVERITY{
INFO,WARN,ERROR
}
enum很像特殊的class,实际上enum声明定义的类型就是一个类。 而这些类都是类库中Enum类的子类 (java.l