自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(28)
  • 资源 (7)
  • 收藏
  • 关注

原创 win10 idea控制台日志中文乱码解决,亲测有效

网上的试了很多都不生效.总结:除了在idea.exe.vmoptions和idea64.exe.vmoptions文件后面添加-Dfile.encoding=UTF-8-Dconsole.encoding=UTF-8,然后修改seting-->editor-->file encodings,全部设置成utf_8,然后在java compiler中的addtiona...

2019-03-14 09:52:10 2760

原创 web开发内嵌tomcat的使用,告别复杂的配置

对于java web开发,最常使用的就是安装tomcat,然后在ide中配置一大堆,然后在进行调试。这种方式对很多新手来说很容易出错。现在说一下使用内嵌的tomcat进行开发。在tomcat官网,我们可以下载对应的内嵌tomcat,在官网长这样。下载解压后将需要用到的jar拷到项目对应的库目录下,然后就可以像普通的java程序一样开发web应用了。下面是启动tomcat的代码。import jav

2017-06-13 14:55:36 8780 2

原创 在ubuntu16.04下面安装tplink无线网卡驱动

在网上找了很久,都没找到合适的方法.去tplink英文网站http://www.tp-link.com/en/download/TL-WN823N.html#Driver下载的linux驱动,因为编译失败,无法使用.所以只能考虑其他方法了.之后尝试查找无线网卡芯片型号,看看有没有合适的解决方案.终端输入lsusb可以看到,芯片的型号是 0bda:818b Realtek S

2017-03-13 15:36:14 28048 3

转载 git .gitignore生效解决方案

经常会clone一份代码,之后把一些不方便提交的文件添加到.gitignore文件里面后,发现没有任何效果.对于这个问题的原因就是原因是.gitignore只能忽略那些原来没有被track的文件,如果某些文件已经被纳入了版本管理中,则修改.gitignore是无效的。 解决方案:git rm -r --cached . #删除本地缓存git add .git commit -m 'upda

2016-10-17 16:25:43 953

原创 scrapy爬取某网站,模拟登陆过程中遇到的那些坑

最近接触scrapy,爬取了几个网站,用着还挺顺手的. 前几天,一个做业务的同事让我帮他爬取一个网站上的用户信息,我就满口承诺下来了.毕竟,通过前几次的爬取,已经自信心爆棚了(从此入坑). 拿到一个网站之后就是先分析网站,分析之后发现需要的数据要登陆才能看到.这个可难不倒我,不就是模拟登陆吗,小菜一碟. 用chrome分析一下,看到有用户名,密码,还有其他两个校验值.另外还有一

2016-09-12 11:13:40 18627 7

原创 spring boot 开发相关

版权声明:本文为博主原创文章,转载请注明出处。用了spring boot有一段时间了,中途也遇到过一些坑.下面记录一下: 刚开始使用eclipse做开发,但是对于做android的我来说,eclipse很久不用了,最主要的是eclipse需要自己安装gradle,然后将web项目转成gradle项目.太麻烦了.鉴于spring boot内置tomcat,本身就是一个java程序,所以果断使用and

2016-06-01 18:24:30 489

翻译 使用spring创建一个RESTful Web Service

原文地址:https://spring.io/guides/gs/rest-service/这篇文章引导你使用spring创建一个 "hello world" 的RESTful web service .你将创建什么你将创建一个可以接受http get请求的服务:http://localhost:8080/greeting通过

2016-04-26 16:38:00 641

原创 关于ubuntu 64位 android studio 运行时,gradle卡住的问题

主要是因为缺少相关的32位依赖库可通过一下方法解决:终端输入以下命令,安装完成后 重启as即可sudo dpkg --add-architecture i386 sudo apt-get update sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386

2016-03-14 15:46:22 790

转载 ANDROID DATABINDING: GOODBYE PRESENTER, HELLO VIEWMODEL!

from http://tech.vg.no/2015/07/17/android-databinding-goodbye-presenter-hello-viewmodel/The Model-View-Presenter-pattern (MVP) has been the dominating trend lately when it comes the UI-layer

2016-01-22 11:37:03 901

原创 android studio 生成 aidl 文件

其实很简单的..在AndroidManifest.xml 文件中的包名下,右键new 一个aidl的文件,然后在build/generated/source/aidl/debug/ 下面就会生成相应的aidl文件.如果没有生成 就重新编译一下项目就有了

2016-01-05 14:22:16 358

原创 mysql 一些用法 总结

开启数据库后 在终端中mysql -u root -p  用root账号登陆create database name; 创建数据库use databasename; 选择数据库对于数据库表的中文编码问题 create  table table_name(........)character set = ut

2015-12-16 16:42:14 284

转载 apktool 在mac下的安装

Download Mac wrapper script (Right click, Save Link As apktool)Download apktool-2 (find newest here)Rename downloaded jar to apktool.jarMove both files (apktool.jar & apktool) to /usr/local/bin (r

2015-12-10 11:36:05 441

翻译 android studio 代理设置

原址:http://developer.android.com/tools/studio/studio-config.htmlConfigurationIn this documentUpdate ChannelsProxy SettingsSee alsoInstalling Android StudioWorkflowBuil

2015-07-28 10:14:13 5863

翻译 多屏幕 适配

http://developer.android.com/guide/topics/resources/providing-resources.html#BestMatchhttp://developer.android.com/guide/practices/screens_support.htmlThough this procedure is executed

2015-06-03 11:41:07 410 1

原创 bitmap 裁剪

try { if (Environment.MEDIA_MOUNTED.equals(Environment .getExternalStorageState()) && Environment.getExternalStorageDirectory().exists()) { TEST_IMAGE = Environment.getExternalStorage

2015-05-23 15:39:55 574

转载 getMeasuredHeight()与getHeight

在当屏幕可以包裹内容的时候,他们的值相等,只有当view超出屏幕后,才能看出他们的区别:getMeasuredHeight()是实际View的大小,与屏幕无关,而getHeight的大小此时则是屏幕的大小。当超出屏幕后,getMeasuredHeight()等于getHeight()加上屏幕之外没有显示的大小

2015-05-20 19:36:30 494

转载 Java的局部内部类以及final类型的参数和变量

转自  http://xm-king.iteye.com/blog/773292Thinking In Java里面的说法(唯一正确的说法): 如果定义一个匿名内部类,并且希望它使用一个在其外部定的对象,那么编译器会要求其参数引用是final 的。Java代码  public class Tester {             public

2015-05-15 15:31:27 650

原创 android studio 查看 签名 md5 sha

原来在Eclipse中获取SHA1或者MD5,在IDE界面上就可以查找到。切换到Android Studio后,如何查看呢?找了半天没找到。那就老办法命令行。第一步、打开Android Studio的Tools->Open Terminal...第二步、输入命令:keytool -v -list -keystore keystore.jks

2015-05-12 11:51:46 989

转载 NetworkImageView 设置默认图片

原文地址:http://stackoverflow.com/questions/21567055/display-networkimageviews-default-image-without-network-requestThe problem is that even if a default image is set, it won't be displayed until

2015-05-11 09:28:15 825

原创 textview设置 weight

LinearLayout.LayoutParams(int width, int height, float weight)Creates a new set of layout parameters with the specified width, height and weight.

2015-05-07 09:17:56 1788

原创 标识在 Span 范围内的文本前后输入新的字符

Spanned.SPAN_EXCLUSIVE_EXCLUSIVE(前后都不包括)、Spanned.SPAN_INCLUSIVE_EXCLUSIVE(前面包括,后面不包括)、Spanned.SPAN_EXCLUSIVE_INCLUSIVE(前面不包括,后面包括)、Spanned.SPAN_INCLUSIVE_INCLUSIVE(前后都包括)

2015-05-04 14:39:33 526

原创 截屏代码

截取应用 private void getScreen(){ View content = findViewById(R.id.layoutroot); Bitmap bitmap = content.getDrawingCache(); File file = new File( Environment.getExternalStorageDirectory()

2015-04-21 09:33:22 432

原创 文件 创建

1、File类的createNewFile根据抽象路径创建一个新的空文件,当抽象路径制定的文件存在时,创建失败  2、File类的mkdir方法根据抽象路径创建目录 3、File类的mkdirs方法根据抽象路径创建目录,包括创建必需但不存在的父目录  4、File类的createTempFile方法创建临时文件,可以制定临时文件的文件名前缀、后缀及文件所在的目录,如果不指定目录,则存放

2015-04-21 09:28:20 482

翻译 listview 中的不同 item 实现

原文 链接 http://android.leocardz.com/multiple-layout-listview/Basically, you have to follow these steps:Create the custom layous;Create a custom adapter;Override getViewTypeCount() me

2015-04-18 17:19:55 384

原创 关于设备像素 DisplayMetrics

/** * The exact physical pixels per inch of the screen in the X dimension. */ public float xdpi; /** * The exact physical pixels per inch of the screen in the Y dimension.

2015-04-17 15:50:01 356

原创 this message is already use 解决

对同一个消息对象,重复多次发送便会报This message is already in use错误。解决方法就是重新获取消息对象。

2015-04-16 18:19:16 1739

原创 getText 与getString 区别

Android提供多种获取资源文件方法,但是需要注意以下方法:CharSequence getText(int resId):返回本地、样式化的字符。String getString(int resId) :返回字符串/** * Return the string value associated with a particular resource ID. T

2015-04-16 15:51:00 1043

原创 android studio使用 (一)

添加注释模板Settings->IDE Settings->File and Code Templates->Includes快捷键 keymap--fix javadoc不明白为什么设置代码模板之后就不能使用模板了.

2015-04-15 10:04:37 334

Realtek RTL8192EU chipset (0bda:818b) ubuntu 驱动程序

tplink 823n无线网卡驱动

2017-03-13

android Textview 实现html 图片显示

android Textview 实现html 图片点击 两种方式 一种是用webview ,调用jsInterface实现 另一种是 textview 使用Html.from()方法

2015-07-24

picasso 图片库

github 地址 https://github.com/square/picasso ADAPTER DOWNLOADS Adapter re-use is automatically detected and the previous download canceled. @Override public void getView(int position, View convertView, ViewGroup parent) { SquaredImageView view = (SquaredImageView) convertView; if (view == null) { view = new SquaredImageView(context); } String url = getItem(position); Picasso.with(context).load(url).into(view); } IMAGE TRANSFORMATIONS Transform images to better fit into layouts and to reduce memory size. Picasso.with(context) .load(url) .resize(50, 50) .centerCrop() .into(imageView) You can also specify custom transformations for more advanced effects. public class CropSquareTransformation implements Transformation { @Override public Bitmap transform(Bitmap source) { int size = Math.min(source.getWidth(), source.getHeight()); int x = (source.getWidth() - size) / 2; int y = (source.getHeight() - size) / 2; Bitmap result = Bitmap.createBitmap(source, x, y, size, size); if (result != source) { source.recycle(); } return result; } @Override public String key() { return "square()"; } } Pass an instance of this class to the transform method. PLACE HOLDERS Picasso supports both download and error placeholders as optional features. Picasso.with(context) .load(url) .placeholder(R.drawable.user_placeholder) .error(R.drawable.user_placeholder_error) .into(imageView); A request will be retried three times before the error placeholder is shown. RESOURCE LOADING Resources, assets, files, content providers are all supported as image sources. Picasso.with(context).load(R.drawable.landing_screen).into(imageView1); Picasso.with(context).load("file:///android_asset/DvpvklR.png").into(imageView2); Picasso.with(context).load(new File(...)).into(imageView3); DEBUG INDICATORS For development you can enable the display of a colored ribbon which indicates the image source. Call setIndicatorsEnabled(true) on the Picasso instance.

2015-06-19

mysql 驱动

java 开发连接mysql数据库驱动 版本:5.1.35

2015-05-15

zxing jar 包

条形码 二维码扫描库 支持目前为止所有的二维码编码格式 zxing 3.2.1 2015-04 打包

2015-05-15

volley jar包 1.0.15

volley jar包 google官方开源项目 网络通讯 支持图片加载 更新至2015-03

2015-05-15

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除