Mac 上安装Rust 453 sudo curl https://sh.rustup.rs -sSf | sh 454 source $HOME/.cargo/env 455 rustc --version 456 cargo --version 457 ls 458 vi hello.rs 459 rustc hello.rs 460 ls 461 ./helloHello:fn main(){println!("hello World");...
获取iOS手机当前最上层的veiwcontroller //获取手机当前显示的ViewController+ (UIViewController*)currentViewController{ UIViewController* vc = [UIApplicationsharedApplication].keyWindow.rootViewController; while (1) {
在mac上编译lame lame源代码下载地址,https://sourceforge.net/projects/lame/?source=typ_redirect编译已经有牛人写成编译脚本了,一般情况下直接用就可以了,https://github.com/kewlbear/lame-ios-build和FFmpeg是一样的,就是lame要自己先下载,解压,文件名要记得改成lame,在脚本中是直接写死的,
iOS在线播放--影音播放的两个方式 #import "ViewController.h"#import #import @interface ViewController ()@property (strong,nonatomic)AVPlayer *avPlayer;@property (strong,nonatomic)MPMoviePlayerController
c++项目包含纯c文件编译方法 Error 4 error C1853: 'Release\LocalchangeDemo.pch' precompiled header file is from a previous version of the compiler, or the precompiled header is C++ and you are using it from C (or vice versa
WaitForSingleObject DWORD WINAPI WaitForSingleObject(__in HANDLE hHandle,__in DWORD dwMilliseconds);参数hHandle[in]对象句柄。可以指定一系列的对象,如Event、Job、Memory resource notification、Mutex、Process、Semaphore、Thread、Waitable t
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT iptables: Applying -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT iptables: Applying firewall rules: iptables-restore: line 13 failed就是配置完iptables之后不要忙着重启要先保存的服务,然后再重启servi
获取mysql中指定库的所有表名 select table_name from information_schema.TABLES where TABLE_SCHEMA='db_name'information_schema这个是数据系统用来保存数据表的总表
ccnp rip和ospf的双向注入 router ospf 100router-id 4.4.4.4network 34.1.1.0 0.0.0.255 area 0distance 125 2.2.2.2 0.0.0.0!router ripversion 2network 14.0.0.0no auto-summary!router ospf 100router-id 4.4.4.4network 34.1.1.0 0.0.0.255 area 0distance 125 2.2...
ccnp-eigrp的路由注入 路由器设置R2:interface Loopback0ip address 2.2.2.2 255.255.255.0!interface Loopback1ip address 100.1.1.1 255.255.255.0!interface FastEthernet0/0ip address 12.1.1.2 255.255.255.0duplex full!interface GigabitEthernet1/0ip address 23.1.1.1 2...
ccnp:路由重分布协议注入 路由器设置interface Loopback0ip address 2.2.2.2 255.255.255.0!interface Loopback1ip address 200.1.1.1 255.255.255.0!interface FastEthernet0/0ip address 12.1.1.2 255.255.255.0duplex full!interface GigabitEthernet1/0ip address 23.1.1....
ccnp-帧中继的配置 R4的:interface Serial2/0no ip addressencapsulation frame-relayserial restart-delay 0frame-relay lmi-type ciscoframe-relay intf-type dceframe-relay route 102 interface Serial2/1 201frame-relay route 103 interface Serial2/2 301!interfac...
kali 安装empire错误解决办法三 接上一篇,安装完成了别以为能跑起来,empire3.1各种问题。都安装完成后,由于urllib3的版本问题,需要执行 pip install urllib3==1.22然后再empire再重置,reset.sh执行之后就好了...
kali 安装empire错误解决办法二 安装的是empire 3.1*(https://github.com/BC-SECURITY/Empire),问题还挺多的,一个一个解决依赖库安装,opensll,下载源代码,编译安装pcre,下载源代码,编译安装swig,下载源代码,编译安装这下empire安装总算是通过了,不容易啊...
kali 安装empire错误解决办法一 OpenSSL库的安装 去官网下载最新版本 官网:http://www.openssl.org 下载页面:http://www.openssl.org/source/ 选择新版本下载 http://www.openssl.org/source/openssl-1.1.1f tar -zxv openssl-1.1.1f.tar.gz...
kali-linux. python使用版本切换 sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 150sudo update-alternatives --config pyt...
Xcode 11界面的最新问题解决办法 The app delegate must implement the window property if it wants to use a main storyboard file.在AppDelegate.m#import "AppDelegate.h"@interface AppDelegate ()@end@implementation AppDelegate@...
使用树莓派搭建流媒体服务 使用的是SRS(Simple-RTMP-Server,我们中国人开发的使用非常友好,支持的平台也很多)直播服务器:SRS 3.0直播软件(推流):OBS Studio播放软件(拉流):VLC安装需要的工具更新后就要安装需要的工具,Raspberry Pi本身就包含编译SRS的大部分工具了,这里需要两个打包工具sudo aptitude install lsb_release...
ubuntu18.*下编译SRS错误问题的解决 sudo apt-get install lzop/usr/include/c++/7/sstream:300:7: error:‘struct std::__cxx11::basic_stringbuf<_CharT, _Traits, _Alloc>::__xfer_bufptrs’redeclared with different accessstruc...
Xcode升级10之后项目错误 Ld /Users/liuyongqing/Library/Developer/Xcode/DerivedData/RenyirenshuIM-gdoqnmfczijtczbkzmlzpqkkbjeh/Build/Products/Debug-iphoneos/RenyirenshuIM.app/RenyirenshuIM normal arm64 cd /Users/liuyongqi...
Xcode升级10之后项目错误 Ld /Users/liuyongqing/Library/Developer/Xcode/DerivedData/RenyirenshuIM-gdoqnmfczijtczbkzmlzpqkkbjeh/Build/Products/Debug-iphoneos/RenyirenshuIM.app/RenyirenshuIM normal arm64 cd /Users/liuyongqi...
iOS 生成纯色图片 -(UIImage*) imageWithColor:(UIColor*)color{ CGRect rect = CGRectMake(0.0f, 0.0f, 32.0f, 32.0f); UIGraphicsBeginImageContext(rect.size); CGContextRef context = UIGraphicsGetCurrentCont...
mysql 1175错误解决办法 Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Editor and reco...
mac anaconda 安装opencv conda install -c https://conda.binstar.org/menpo opencv在anaconda中安装不成功,只好在命令行下运行,马上就好了,用 import cv2测试是否成功,不报错就OK了
python + selenium # -*- coding: gbk -*-#encoding=utf8# -*- coding:cp936 -*-from selenium import webdriverfrom selenium.common.exceptions import NoSuchElementExceptionfrom selenium.webdriver.common.keys import
android webview无法播放视频 if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){ ws.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);}在网页中部分视频部无法播放,由于是https和http混合编在一起造成了就要添加上面这句话
iOStableview手势冲突 在tableview中左右拖动和上下拖动- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{ if ([gestureRecognizer view]==_table) { return N
jsp推送iOS消息 pageEncoding="UTF-8"%> Insert title hereString deviceToken = "AAAA5064209B6165C8542A9A17118BFFFFFE99851A9BD124B26CE6A6F84DDDDD"; String alert = "t
改变android状态栏颜色 final Window window=getWindow();window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);window.setStatusBarColor(Color.RED);
android的键盘隐藏,之前都没怎么在意这个问题,现在解决一下 @Overridepublic boolean onTouchEvent(MotionEvent event){ if (this.getCurrentFocus()!=null) { InputMethodManager inputMethodManager=(InputMethodManager)getSystemService(INPUT_METHOD_
添加 自定义的view,并显示在最前端 View view1=new View(MainActivity.this); int x=getResources().getDisplayMetrics().widthPixels; int y=getResources().getDisplayMetrics().heightPixels; view1.setX(100)
iOS 高清二维码的生成,并保存到本地相册 开始之前不要忘记在plist中设置这个属性Privacy - Photo Library Usage Description 注明使用相册的原因- (void)loadImageFinished:(UIImage *)image{ UIImageWriteToSavedPhotosAlbum(image,self, @selector(image:didFinis
android 中通知消息中打开activity带参数的问题 在activity中获取的参数始终是空的,一开始在PenddingIntent的最后一个参数用0Intent intent=new Intent(getApplicationContext(),Main2Activity.class);Log.d("notice",drugname);intent.putExtra("drug",drugname);PendingIntent pendi
android listview adapter 不调用getview的问题 由于换了另外一个控件,listview的约束掉了一个高度变为3,导致listview的高度为0,根本不调用getview,找了好久都没发现这个问题,ios下顶多看不见,cell还是可以调用的因此问题的解决主要是layout的检查,重新设置listview的高度
ioS 消除navigationbar下方的阴影 //自定义一个NaVIgationBar [self.navigationController.navigationBarsetBackgroundImage:[UIImagenew] forBarMetrics:UIBarMetricsDefault]; //消除阴影 self.navigationController.navigationBar
iOS 曾经上传照片到项目中,但是后面删除了,在真机调试中报错的解决办法 error: /Users/*project/IMG_0725.jpg: No such file or directory先点击项目名称-》build phrases->filter:找到相应的文件名,这个时候发现曾经删除的文件或者已经改掉或者已经挪动了文件位置,但是文件的老信息还在,所以在编译的时候会出现错误。直接delete删除,编译出现的问题即可解决
android ListView item中添加checkbox之后点击无效的解决办法 在item的layout文件中添加android:descendantFocusability="blocksDescendants"这个属性,一定要在跟节点中添加要不然无效的
c# webbrowser使用ie内核版本的问题 在使用webbrowser的时候发现加载html5的页面会出现很大的问题,显示各种错乱.抓包才发现默认使用的是低版本的ie内核.需要在注册表中修改才能恢复正常注册表位置对于32位程序HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULA
jsp tomcat apache web.xml编译错误问题解决 错误日志 提示Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext一般情况下出现这个提示,主要是由于web.xml配置出现了错误,仔细核查一个小错误都能造成,血的教
android actionbar 添加菜单 1、在res下添加menu文件夹,创建xml文件xml version="1.0" encoding="utf-8"?>menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> item andro
js 修改input text 的值 之前用$getElementId('xxx').value=0; 结果发现在firefox这些浏览器上是无效的还得用下面的$getElementId('xxx').setAttribute('value',0);
jsp servlet的web.xml的配置中碰到的诡异问题 Server Tomcat v9.0 Server at localhost failed to start.he servlets named [x] and [x.y] are both mapped to the url-pattern [/x] which is not permitted这个神奇的问题,搞了一晚上才想起来,在等标号前面要加上web:结果
js 字符串转float onchange="textToFloat(this.id)" 这个是 input text的function textToFloat(x){var y=document.getElementById(x).value;var fy1=parseFloat(y);document.getElementById(x).value=fy1;}
jsp 时间数据处理 从数据库中获取的时间数据格式不一定符合需要,可根据下面的代码进行修改SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd hh:mm"); Date date=format.parse(fabingshijian); fabingshijian=format.format(date);
datetimepicker 出现1899的bug 这个bug 出现的可能性有日期格式设置错误,解决办法重新调整第二个可能性,也就是我碰到的情况,startDate的问题,获取当前时间,然后设置这个属性var now=new Date();var strTime=now.getFullYear()+"-"+(now.getMonth()+1)+"-"+now.getDate();alert(strTime); $(
android 隐藏顶部标题栏 ActionBar actionBar = getSupportActionBar();if (actionBar != null) { actionBar.hide();}
mysql jsp 同时查多张表 Statement stmt1=conn.createStatement(); ResultSet rsYiyuan=stmt1.executeQuery("select * from 要重复使用一定要再申请statement 要不然就是一个坑啊
jsp 计算年龄 SimpleDateFormat form=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); Calendar cal=Calendar.getInstance(); Date birth=form.parse(rs.getString(5)); cal.setTime(birth); int n2=cal.get
ajax 跨域访问 protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {// TODO Auto-generated method stubresponse.setHeader("Access-Control-Allow-Orig
jsp中的值付给js $("#btnSelectAll").click(function(){var n=;//就在 这里for(var i=1;i{var str="ck_"+i;var ckx=document.getElementById(str);ckx.checked=true;}})
jsp的servlet乱码问题 protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {// TODO Auto-generated method stubrequest.setCharacterEncoding("utf-8");respo
iSO searchbar的边框线消除 searchbar的边框线的消除,其实也不是消除只是改的河背景色一只而已,代码如下 _searchBar.layer.borderWidth=1; _searchBar.layer.borderColor=[UIColorcolorWithRed:0x16/255.0fgreen:0xdb/255.0fblue:0x8c/255.0falpha:1]
iOS导航条透明的办法 //导航条透明化 UINavigationBar *bar=[UINavigationBarappearance]; bar.translucent=YES;//透明属性的设置//同时背景色也要设置的要不然无法透明,直接new 一个就好了 [self.navigationController.navigationBarsetBackgr
jsp上传文件 前台 pageEncoding="ISO-8859-1"%>Insert title hereString str=request.getParameter("pic");if(str!=null){str="";}else{str="";}%>后台
uislider去掉圆形的大按钮 生成透明图片 CGSize s=CGSizeMake(1,1); UIGraphicsBeginImageContextWithOptions(s,0, [UIScreenmainScreen].scale); UIRectFill(CGRectMake(0,0, 1,1)); UIImage *img=UIGraphics
iOS navigation bar的背景色设置 [UINavigationBarappearance].translucent=NO;//这行一定不要少,要不然颜色有差异,因为这行是禁止背景透明。这个bar里面有很多层,因此要加入这个避免透明,造成了导航条颜色的差异 [UINavigationBarappearance].barTintColor=[UIColorcolorWithRed:0x16/255.0fgr
jsp 导出xls,创建多个sheet pageEncoding="UTF-8"%> 这个地方要下载jxl的jar包Insert title here response.setContentType("application/download"); response.setHeader("Content-Disposition","attachment;filenam
Can not find the tag library descriptor for "http://java.sun.com/jsp/jstl/core" 解决办法 Can not find the tag library descriptor for "http://java.sun.com/jsp/jstl/core"在webcontent/lib下添加jstl.jar 和standard.jar 即可解决问题
iOS隐藏导航栏 隐藏导航栏方法 [self.navigationControllersetNavigationBarHidden:YES];#pragma mark --判断导航栏是否隐藏- (void)navigationController:(UINavigationController *)navigationController willSh
iOS 启动图 加载的问题 这个问题困扰了很久,在xcodelaunchscreen中有启动图,但是图片莫名其秒的出现了延迟,一种无法解决,无意中修改了图像名,结果就好了,过不了多久又出现,再改一次文件名又好了,这个方法能解决问题,但是比较low,也不是一劳永逸,暂时只能这样了,有没有更好的办法?望高手解答
android studio 调试 的问题 Error running app: Instant Run requires 'Tools | Android | Enable ADB integration' to be enabled.用usb编译调试apk的时候android studio 老是出现这个错误提示i寻找的时候adm其实的可以正常找到手机并连接手机,按理说没有错误啊,但是一直报错查了n多资料才发现 在 t
iOS 图像拖动和拉伸 - (void)viewDidLoad { [superviewDidLoad]; // Do any additional setup after loading the view from its nib.}- (void)viewWillAppear:(BOOL)animated{ _imgView.image =_i
在使用UIImagePickerViewcontroller的时候,状态栏的颜色会被改变的解决办法 在使用UIImagePickerViewcontroller的时候,状态栏的颜色会被改变,在uiimagepickerviewcontroller中delegate设置了之后,就可以调用- (void)navigationController:(UINavigationController *)navigationController willShowViewControl
iOS FFmpeg 在Mac OS下的编译和使用 在github上搜索build-ffmpeg.sh即可,编译一般情况没有问题,但是在使用的过程中容易出问题,报如下错误Undefined symbols for architecture x86_64: "_AudioConverterDispose", referenced from: _ffat_close_decoder in libavcodec.a(audio
iOS 修改状态栏的颜色的时候,始终无法高亮的解决办法之二 修改完状态之后别忘了恢复原状UIModalPresentationOverCurrentContext(如果设置了这个选项,在回到上一个viewwillappear得时候是不起作用的)所以那个改了,要在那个结束的时候处理- (void)viewWillDisappear:(BOOL)animated{ [[UIApplicationsh
iOS 修改状态栏的颜色的时候,始终无法高亮的解决办法 添加视图切换的时候如果设置了下面的值nav.modalPresentationStyle=UIModalPresentationOverCurrentContext;坑就开始了 [[UIApplicationsharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; [self
iOS UIScroolView使用的一个坑 在UIScroolView使用的使用中,使用自动布局,经常出现scrollview比预想的大小小了一些,主要是由于scrollview的contentview的大小没有填满scrollview,也是坑死人了
iOS 下AES256 CBC NOPadding的实现 填充问题 - (NSData *) AES256_Encrypt:(NSString *)key withIV:(NSString *)gIv{ char keyPtr[kCCKeySizeAES256+1]; bzero(keyPtr,sizeof(keyPtr)); [key getCString:keyPtrmaxLength:sizeof(keyP
iOS 打开QQ分享信息报错解决方案 在Info.plist中创建LSApplicationQueriesSchemes的数组,添加如下信息:mqqopensdkapiV2如果出现类似的信息报错同样加入即可,QQ的分享看sdk的帮助文档完全是啃爹-canOpenURL: failed for URL: "mqqopensdkapiV2://" - error: "This app is not allowe
ios 文件上传 “[formData appendPartWithFileURL:url name:@"userfile" fileName:@"1.zip" mimeType:@"application/octet-stream" error:NULL];“上传过程中,需要核对对应的参数 ,第一个是文件地址NSURL类型,第二个是自定义的文件名称,第三个是等待上传的文件名称,第四个是文件上传的方式(哪种
iOS 截取原型图片 UIImage *img=[UIImageimageNamed:@"IMGx.jpg"]; [_userImgsetImage:imgforState:UIControlStateNormal]; _userImg.layer.cornerRadius=41; _userImg.layer.masksToBounds=YES;
iOS 图像压缩 图像选择的使用 @implementation ViewController- (void)viewDidLoad { [superviewDidLoad]; // Do any additional setup after loading the view, typically from a nib. UIImage *img1=[UIImageim
c++ dll创建及使用 rundll32 测试 使用vs2010 直接创建dll工程// dllmain.cpp : Defines the entry point for the DLL application.#include "stdafx.h"#include #include "fun.h"extern "C" _declspec(dllexport) void __cdecl dllfun(HWND hwnd,
iOS UiICollectionView中cell间的边距的设置 其实没有太多,但是中间容易忽略很多细节,cell和cell之间的间距就是实现两个代理函数具体如下,写本文主要是为了做个笔记,有问题的时候方便查询- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimu
iOS UITextField的边框设置颜色的小坑 _textBoxName.layer.borderWidth=1.0f; _textBoxName.layer.borderColor=[UIColorcolorWithRed:0xbf/255.0fgreen:0xbf/255.0fblue:0xbf/255.0falpha:1].CGColor; 设置的时候在ib里面记得选择无边框的,要不然随便你设置,
xcode7以后,访问https服务器 在plist中增加NSAppTransportSecurity nsdictionary子属性 NSAllowsArbitraryLoads boolean YES就能正常访问如果不加,报如下错误:UserInfo={NSURLErrorFailingURLPeerTrustErrorKey=, NSLocalizedRecoverySuggestion=W
iOS navigationbar的各种改色 这个写了主要是为了方便记忆 ,主要是记录一些问题的解决方法,其它的内容网上讲的比较详细了 。实现的方法各异,实现就好标题的设置[selfsetTitle:@"test"];设置navigationcontroller的view的标题颜色 [self.navigationController.navigationBarsetTitleTextAttribute
在iOS中动态改变statusbar的颜色 1、在视图控制器中添加- (UIStatusBarStyle )preferredStatusBarStyle{ returnUIStatusBarStyleLightContent;}2、在navigationcontroller中还要添加- (UIViewController*)childViewControllerForStatusBarStyle
EACCES (permission denied)解决办法 android 文件读写 uses-permission android:name="android.permission.INTERNET" />uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />uses-permission android:name="android.permission.WRITE_EXTE
在android studio中添加.jar文件后,rebuild不报错,执行报错的解决 问题如题,一直以为是下载的jar有问题报如下错误:Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.> com.android.build.api.transform.TransformException: com.android.builder.packaging.Dup
iOS控制屏幕旋转 - (BOOL) shouldAutorotate{ return YES;}- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{ NSLog(
iOS uiwebview load request 出错 2016-04-25 12:53:46.464 TestWebView[12473:263632] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)2016-04-25 12:53:46.470 TestWebView[12473:263458] Error Domain=NSURL
jsp 输出 json 在项目中先把准备好的json-taglib-0.4.1.jar文件保存到新建的网站中,即test\WebContent\WEB-INF\lib即这个路径下.可在路经下直接右键打开保存
tomcat 配置https 一、命令行用管理员权限起来Microsoft Windows [版本 6.1.7600]版权所有 (c) 2009 Microsoft Corporation。保留所有权利。C:\Windows\system32>cd\C:\>cd key二、新建文件夹,并进入C:\key>dir 驱动器 C 中的卷没有标签。 卷的序列号是 A4CB-0E8A C:\key 的目录2016/04/21 11:51
iOS 发布过程中出错 Code Sign error: No matching provisioning profile found: Your build settings specify a provisioning profile with the UUID “600000f6-2228-444c-2258-9e11111ac2”, however, no such provisioning profile wa
iOS uiwebview 有阴影的解决办法 在开发中使用uiwebview的时候会碰到在空间的四周出现一条黑线的问题。解决办法如下UIWebView *web=[[UIWebViewalloc] init]; web.opaque=NO; web.backgroundColor=[UIColorclearColor];