android拍照功能之权限和Android版本问题
对于Android 6.0之前,想要使用系统的相机进行拍照,那么只要在AndroidManifedt.xml中进行添加相应的权限,主要是两个:<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/><uses-permission android:name="android.permission.CAMERA"/>这样设置完成后,当在Android 6.0一下(不包括6.0)进行使用系统相机进行拍照是完全没有问题,当我们进行点击拍照功能时,此时系统就会提醒我们打开相应的权限,这说明使用系统相机进行拍照是没有问题的,但是,但使用Android 6.0以...
linux下安装根证书支持Https
在linux下有时会使用http请求HTTPS网站数据(API),会报错。要安装根证书支持HTTPS访问。于是百度,提示用 mozroots --import --ask-remove 可以安装,结果 运行提示 找不到mozroots于是安装mozroots,百度发现,这个是mono命令。刚好我安装的jexus独立版又带了Mono和mozrootscd jexusll看到了mozroots运行 sudo ./mozroots --import --ask-remove178个证书已导入。最后,还要在你asp.net程序的某个地方,比如 global.asax的application_start 事件中,加入一句:System.Net.ServicePointManager.Ser...
解决Newsoft.Json版本冲突
解决办法如下:web.config 的 configuration节点下面注明:<runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="4.5.0.0" /> </dependentAssembly> </assemblyBinding> </runtime>就强制使用版本4.5.0.0 ...
关于AJAX跨域调用ASP.NET MVC或者WebAPI服务的问题及解决方案
作者:陈希章时间:2014-7-3问题描述当跨域(cross domain)调用ASP.NET MVC或者ASP.NET Web API编写的服务时,会发生无法访问的情况。重现方式使用模板创建一个最简单的ASP.NET Web API项目,调试起来确认能正常工作创建另外一个项目,仅仅包含一个HTML页面,发起AJAX的调用在浏览器中打开这个网页,我们会发现如下的错误(405:Method Not Allowed) 【备注】同样的情况,也发生在ASP.NET MVC中。某些时候,MVC也可以直接用来开发服务,与WebAPI相比各有优缺点。下面是一个利用MVC开发...
.net连接MySql:Unable to connect to any of the specified MySQL hosts
MySql.Data.MySqlClient.MySqlException Unable to connect to any of the specif 我的问题是my.cnf配置错误,从官方网站重新下载mysql,把它的My.cnf默认文件覆盖就OK了,这里我上传一份我的MYSQL5.1的my.cnf# Example MySQL config file for large systems.## This is for a large system with memory = 512M where the system runs mainly# MySQL.## MySQL programs look for option files in a set of# locations which depend on the deployment platform.# You can copy this option file ...
[真正完美解决]InnoDB: Attempted to open a previously opened tablespace
升级mysql到5.6后,启不了Mysql看error.log其中关键的一行是:InnoDB: Attempted to open a previously opened tablespace. Previous tablespace db_patients/tb_patients uses space ID: 3 at filepath: ./db_patients/tb_patients.ibd. Cannot open tablespace mysql/slave_relay_log_info which uses space ID: 3 at filepath: ./mysql/slave_relay_log_info.ibd解决办法:一、打开MAMP PRO,点击主界面左侧LANGUAGES中PHP,右侧Extensions分类中点击Manually enable other extensions右侧按钮(或者打...
解决android 安卓中横屏、竖屏切换 应用崩溃问题
在manifest.xml中对应的activity中加入关键代码:<activity android:name=".Activity.ImageViewActivity" android:configChanges="orientation|screenSize|keyboardHidden" />原因:这是由于横竖屏转换导致activity重跑onCreate方法导致的,有两种解决方案:1、横竖屏转换的时候不要重新跑onCreate方法,这个可以在manifest.xml的对应activity中增加这个属性:“android:configChanges="orientation|screenSize"”;2、禁止横竖屏转换,在manifest.xml的对应activity中增加这个属性“andr...
Linux下查看磁盘与目录的容量df、du
查看目录大小:du -sh其它用法:df:列出文件系统的整体磁盘使用量;du:评估文件系统的磁盘使用量(常用于评估目录所占容量)df参数:-a:列出所有的文件系统,包括系统特有的/proc等文件系统-k:以KB的容量显示各文件系统-m:以MB的容量显示各文件系统-h:以人们较易阅读的GB,MB,KB等格式自行显示-H:以M=1000K替代M=1024K的进位方式-T:连同该分区的文件系统名称(例如ext3)也列出-i:不用硬盘容量,而以inode的数量来显示
我的第一个开源框架,webspider
最近要写一个爬虫,本来打算用Python来写的,但是好久没用python写过东西了,加上最近的.NET项目都在LINUX上运行了,所以,打算用.NET来写,网上搜索了很多.NET的爬虫框架,运行起都或多或少有点问题,不那么顺手,就自己写了一个,很简单的。开源地址:https://github.com/BruceProject/WebSpider My first open source project,WebSpider ! welcome to commit ,issue我的第一个开源项目,网站蜘蛛!欢迎提问,改进!How to use?怎么使用?#demo static void Main(string[] args) { C...
解决searchview自动获取焦点问题
searchview中的edittext 默认自动获取焦点的 而且会出现小键盘很烦人<LinearLayoutandroid:id="@+id/focus"android:layout_width="fill_parent"android:layout_height="60dp"android:background="#EAEAEA"android:focusable="true"android:focusableInTouchMode="true"android:gravity="center_vertical"android:orientation="horizontal" ><SearchViewandroid:id="@+id/searchView"android:layout_width="fill_parent"android:layout_height="40dp"android:layout_marginRight="20dp"and...