自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

工作生活的memo

学到的东西简单的做个备忘

  • 博客(51)
  • 资源 (1)
  • 收藏
  • 关注

原创 树定义相关资源

树的定义:http://blog.csdn.net/jnu_simba/article/details/8852653 二叉树的性质: http://www.cnblogs.com/ronnydm/p/5928895.html

2016-11-20 00:08:28 347

原创 Scala lazy

trait Stream[+A] { def uncons: Option[(A, Stream[A])] def isEmpty: Boolean = uncons.isEmpty // 此函数有side effect很不好, 不要这样写, 这里只为测试, def tryMatch: Unit = { uncons match { case Some(x) =>

2016-10-10 21:52:37 463

原创 Scala strict & non-strict

strict non-strict

2016-10-10 10:59:48 588

原创 Double precision

scala> 0.0000000000000001+1 (16bits) res37: Double = 1.0scala> 0.000000000000001+1 (15bits) res38: Double = 1.000000000000001scala> 0.0000000000000000001 res30: Double = 1.0E-19

2016-07-30 18:12:45 1989

原创 animation cancel

when calling animationSet.cancel(), onAnimationCanel() and onAnimatioEnd() are both invoked…….

2016-07-11 17:10:59 769

原创 android显示音标

android里的音标是IPA(international pronunciation alphabet) 低版本的android的unicode不支持IPA, 但在4.1.2, 5.0, 6.0的机子上试了下,发现是可以正常显示的,大概已经修复了?

2016-07-06 00:12:53 711

原创 setBackgrounResource内部做了神马?!

问题再现: 在RecyclerView的adapter里自定义了view,给view设置了paddingBottom,同时需要根据top,middle,bottom来设置不同的item的background(shape xml)。 可是在一些device上(sony xperia)paddingBottom竟然不起作用。问题逐一排查发现是setBackgroundResource的问题! 原来

2016-06-17 16:02:36 272

原创 Locale.US

Integer.parseInt(String) 以前有bug,Integer.parseInt(“アラビア数字“) 是不能正确的识别的。现在修正了。String.format(Locale.US, “%02d”, 数字) 如果不指定的的话,显示会交给lib内部,但是内部是怎样的并不知道,于是,为了app的统一,全部Locale指定!如果多语言对应的话,基本上显示的时候需要用Locale.get

2016-06-15 18:34:08 3025

原创 mac电脑library下的文件是没有执行权限的,配环境变量需要chmod

mac电脑library下的文件是没有执行权限的,配环境变量需要chmod

2016-06-02 01:30:16 3742

原创 在导入新库的时候,一定先看下已有的依赖!

gradle dependencies

2016-06-02 01:28:56 337

原创 Growthpush的push通知为什么当连在wifi的时候就不能收到

http://matome.naver.jp/odai/2142466999721107101如果一开始就是wifi或者一开始就是LTE等没有问题 但是如果相互切换的话就不行了

2016-05-30 20:58:30 569

原创 在dev环境访问self assigned的https服务器,报Trust Anchor not found for Android SSL Connection

https的SSL解决方案:try { final TrustManager[] trustAllCerts = new TrustManager[]{ new X509TrustManager() { @Override public void checkClientTrusted(java.security.cert.X50

2016-05-29 11:55:19 539

原创 allowBackup

http://y-anz-m.blogspot.jp/2015/09/androidmanifest.htmlhttp://qiita.com/kpkpkp/items/eb49db6fa1a9f637af97

2016-05-26 17:22:18 369

原创 merge中写的属性不起作用

比如写了一个自定义view,继承LinearLayout,在merge的属性部分写了orientation="vertical",但是没有作用,必须在使用的地方定义属性

2016-05-26 07:58:39 1297 1

原创 selector of text and background should using different attributes

selector of text color:you should use android:color="@color/white" not android:color="@drawable/white"selector of background:you should use android:color="@drawable/white" not android:color="@color/w

2016-05-26 07:46:05 306

原创 what the fragment

一、一些废话第一天参加的what the fragment,可惜技术和英文太垃圾,现场没听懂,刚刚花了2个小时在youtube复看了一遍,还是只看懂了70%。还是自己的经验不够,写的代码太少,很多问题没有遇到过,自然不能理解。大概在这里梳理一下吧。二、历史公司的项目也是用fragment,就是一个activity一个fragment的样子,感觉为什么还特意去用个fragment,activity用的

2016-05-23 15:28:31 252

原创 disable application 的notification

可以disable application 的notification! 那activity中是否能够得到呢? 应该可以,查一查

2016-05-12 13:10:54 1274

原创 问题:COMPLEX_UNIT_PX

现在获取文字大小等都是通过pixel,如下textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimensionPixelSize(R.dimen.txt_x_small));但是在TypedValue中还有另一个filedCOMPLEX_UNIT_SP,textView.setTextSize(TypedValue.

2016-04-15 16:48:50 1194

原创 自定义view的measureSpec是谁的mode和size

一、简单背景介绍在自定义view(不是ViewGroup)时,需要重写父类的onMeausre(), onLayout(), onDraw():protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec);

2016-04-09 15:58:22 1302

原创 一些思考方式——从continue按钮的实现暴露的设计问题

一、功能背景用户每天会学习一些课程,我希望下次当用户再次学习的时候能够知道从哪里开始上次的学习。由于有很多的课程,通过list的方式提供给用户,用户如果自己找就会很不方便。那么就提供一个continue按钮,当点击这个按钮时就能定位到应该学习的课程的位置。二、服务器提供的数据服务器提供两个数据:在用户的信息中有一个targetId域,存放用户应该继续学习的课程id。这个targetId是optio

2016-04-07 23:36:21 498

原创 wholeContainer.setMinimumHeight(wholeContainerHeight + buttonsContainerHeight);

<android.support.v4.widget.NestedScrollView> <LinearLayout android:id="@+id/whole_container"> ... ... </LinearLayout></android.support.v4.widget.NestedScrollView><Line

2016-04-03 01:08:49 463

原创 mac上同时安装多个jdk,选择版本

在home文件夹下的.bash_profile中设置JAVA_HOME> open .bash_profileexport JAVA_HOME=`/usr/libexec/java_home -v 1.7`> source .bash_profile (for update)就能把jdk从1.8变成1.7了

2016-03-28 19:04:31 1793

原创 multidex导入至build失败问题

Error:Execution failed for task ‘:app:transformClassesWithDexForDevDebug’. com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.int

2016-03-25 17:58:42 1260

原创 linearlayout问题

<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_pare

2016-03-22 18:25:18 273

原创 同时点击buttons

一、问题再现View.OnClickListener listener = new View.OnClickListener() { @Override public void onClick(View v) { Context context = getContext(); setButtonsEnabled(fals

2016-03-22 11:14:01 312

原创 unaligned apk

http://stackoverflow.com/questions/22058210/why-unaligned-apk-is-needed http://developer.android.com/intl/ja/tools/publishing/app-signing.html

2016-03-18 16:00:53 338

原创 blog need to read

http://www.androiddesignpatterns.com/2013/08/fragment-transaction-commit-state-loss.html

2016-03-18 15:58:46 238

原创 动画问题

问题 当点击back键时,需要通过3秒钟的淡入动画显示PauseDialog,也就是在3秒动画结束的时候,调用listener的onshow。问题是这个动画整个运行是在UI主线程吗?但是上次在ObjectAnimator上观察到在动画移动过程中也可以相应button的点击事件。动画最终是调用invalidate这个是向UI线程发的消息?

2016-03-17 17:48:54 241

原创 Thread.UncaughtExceptionHandler

在android的Application的onCreate中注册Thread.UncaughtExceptionHandler,它运行在进程中,可以捕获crash异常!在这个里面写crashlytics.log

2016-03-16 15:47:08 258

原创 View的位置--x,y,translationX,translationY

一、背景在上一篇文章View的位置中,介绍了top, left, bottom, right这几个坐标,我们知道了这几个坐标是view与其所在的父容器的相对位置。那x,y,translationX,translationY是做什么的?这几个坐标是在Android API 11(Android3.0)之后加进来的。三、代码还是之前的那个例子<RelativeLayout xmlns:android="

2016-03-15 23:55:58 17715 2

原创 View的位置--top, left, bottom, right

一、背景在用到view的位置时,查到的API有一大堆,什么 getTop(),getTranslationX(), getX(),不知道这些位置具体代表的是什么东西。于是今天就先研究下top, left, bottom, right这几个坐标。二、坐标Android的坐标系的x轴向下是正方向,y轴向右是正方向。top, left, bottom, right这几个属性是View类就具有的,顾名思义就

2016-03-15 22:28:06 4595 3

原创 scrollview中RelativeLayout问题

scrollview中RelativeLayout需要是wrap_content。如果此时我需要在屏幕的最下面放一个buttonA,然后让另一个buttonB在这个buttonA之上,用layout_above不管用。那问题来了,为什么?还有如果有滚动条的情况出现时,那buttonA会出现在哪里??在最下面??

2016-03-14 17:50:21 585

原创 dimension适配

large,xhdpi, 600x960dpvalues-sw600dp-hdpi dimens.xml: 10sp values-xhdpi dimens.xml: 12spresult: 10dp

2016-03-14 13:37:26 330

原创 adb shell commands

这篇官方文档都没有index了,我的妈,赶快看! http://developer.android.com/intl/ja/tools/help/shell.html http://developer.android.com/intl/ja/tools/help/adb.html

2016-03-11 16:29:06 244

原创 metadata

androidmanifest.xml中的东西,tools:replace

2016-03-11 16:26:10 204

原创 ActivityLifecycleCallbacks

一、一些废话今天早上快5点的时候才睡的觉,早上不到10点起来就是研究那个Google Analytics。因为新增了一个需求就是希望记录用户的类型,需要用到其中的custom dimension.但是最新版的SDKv4的用法改变了,研究了半天怎么样设置才能正确的把用户类型和hit一起发送出去。然后想了半天怎么设计代码符合DDD。简直是闇。设计好了被mentor说不希望做一个usecase,希望放到c

2016-03-09 23:31:25 721

原创 在Application的onCreate中创建线程,线程不能被执行

问题: 在Application的onCreate中调用了ExecutorService service = Executors.newSingleThreadExecutor();service.commit(new Runnable() {@Override public void run() { Log.e("GA", "reloa

2016-03-09 01:05:17 2266 2

原创 Fragment的IllegalStateException

背景问题:java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState at android.support.v4.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1341) at android.su

2016-03-07 00:35:08 507

原创 继承view要用AppCompatXXX

保证兼容性?

2016-03-04 00:03:53 2555

原创 需要思考的一些问题列表

为什么要用Dagger2?为了使测试方便,Mock容易,还有没有其他?开发中所用的singletonDDD一些实战Jenkins,docker能够做些什么?Google IO 2008-2016首要任务是要考虑 事物的本质感觉人生学习实际就是不断在用持续增量的方式来完善自己的domain。重点在于完善!

2016-03-03 23:27:57 238

VC++MFC实现凸包绘制

用VC++MFC实现凸包绘制,算法精简易懂!

2009-11-07

空空如也

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

TA关注的人

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