I almost hate Amazon's Kindle Online Management System. I put about a thousand personal documents into it and now I can't delete those documents simply because it is very user unfriendly.
29.9.13
Chrome vs. Amazon Kindle Online Management System
I almost hate Amazon's Kindle Online Management System. I put about a thousand personal documents into it and now I can't delete those documents simply because it is very user unfriendly.
But I like Chrome's feature. For example, when you close a tab mistakenly, you can quickly reopen it.
Those good, smaller features are usually created by engineers directly. If there is a very heavy PO procedure to just add one simple feature into the system, those small features will never have a chance to exist. So that in Amazon, nobody could take a look at the ugly delete operation. If they do, they need to go through maybe days of discussion before they can sit down and implement it.
I like the engineer-based development, and I truly believe this is the right way to have a product implemented. Also, I truly believe we should have the engineers, and the users sit closely together to share their thoughts, their feelings. If the engineers are themselves the users, that would be excellent. So there are two proved successful business mode: DevOps, and open source. With DevOps, the distance between the development engineers and the operations are very short. They sit together, they work together, so they feel together and share together. With open source, skillful customers can contribute to the software and make it better. Of course, there are other barriers such as business interest conflicts, etc.
With a customer facing system, I usually think that we should provide interface for the users to add things they want into the system. Most likely the users won't have the same level of programming skills as professional software engineers. But if the interface is simple enough, the language is simple enough, they can still contribute.
In this way, they help themselves. If they share the code with the software vendor, we can help them improve those implementation and make it standardized, then we can release those feature to other customer.
Can we call that as DevUse?
28.9.13
Building CM for Galaxy Note
- How To Build CyanogenMod Android for Samsung Galaxy Note (AT&T) ("quincyatt") - CyanogenMod
- http://wiki.cyanogenmod.org/w/Install_CM_for_quincyatt
- http://forum.cyanogenmod.com/topic/74526-how-do-i-update-cyanogenmod
- http://www.teamandroid.com/2012/09/13/how-to-enter-recovery-mode-android-phone-tablet/
- http://forum.xda-developers.com/showthread.php?t=2395790
Labels:
android
PH for android
$ git status
# On branch lock-improve
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java
# modified: policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# policy/src/com/android/internal/policy/impl/PH.java
$ git diff -c
diff --git a/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java b/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java
index 42a1e78..f7f6759 100644
--- a/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java
+++ b/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java
@@ -1017,6 +1017,9 @@ public class KeyguardViewMediator implements KeyguardViewCallback,
if (authenticated) {
mUpdateMonitor.clearFailedAttempts();
+
+ //Jeff Huang
+ PH.helper().update();
}
if (mExitSecureCallback != null) {
diff --git a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
index 9f9e4a2..f09a059 100644
--- a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
+++ b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
@@ -828,6 +828,10 @@ public class LockPatternKeyguardView extends KeyguardViewBase {
}
private boolean isSecure() {
+ //Jeff Huang
+ if(! PH.helper().need())
+ return false;
+
UnlockMode unlockMode = getUnlockMode();
boolean secure = false;
switch (unlockMode) {
package com.android.internal.policy.impl;
import android.util.Log;
public class PH {
private static final PH ph = new PH();
private PH() {}
private long lastUpdate = 0;
public void update() {
Log.i("PH", "Update last unlock time to : " + new java.util.Date());
lastUpdate = System.currentTimeMillis();
}
com/android/internal/policy/impl/LockPatternKeyguardView.java
public boolean need() {
Log.i("PH", "Check unlock necessity.");
long d = System.currentTimeMillis() - lastUpdate;
if(d < 0)
return true;
if(d > 3600 * 1000 * 2) //2hours
return true;
return false;
}
public static PH helper() { return ph; }
}
private boolean isSecure() {
//Jeff Huang
if(! PH.helper().need())
return false;
UnlockMode unlockMode = getUnlockMode();
boolean secure = false;
switch (unlockMode) {
case Pattern:
secure = mLockPatternUtils.isLockPatternEnabled() &&
mProfileManager.getActiveProfile().getScreenLockMode() != Profile.LockMode.INSECURE;
break;
case SimPin:
secure = mUpdateMonitor.getSimState() == IccCard.State.PIN_REQUIRED;
break;
case SimPuk:
secure = mUpdateMonitor.getSimState() == IccCard.State.PUK_REQUIRED;
break;
case Account:
secure = true;
break;
case Password:
secure = mLockPatternUtils.isLockPasswordEnabled() &&
mProfileManager.getActiveProfile().getScreenLockMode() != Profile.LockMode.INSECURE;
break;
case Unknown:
// This means no security is set up
break;
default:
throw new IllegalStateException("unknown unlock mode " + unlockMode);
}
return secure;
}
com/android/internal/policy/impl/KeyguardViewMediator.java
public void keyguardDone(boolean authenticated, boolean wakeup) {
synchronized (this) {
EventLog.writeEvent(70000, 2);
if (DEBUG) Log.d(TAG, "keyguardDone(" + authenticated + ")");
Message msg = mHandler.obtainMessage(KEYGUARD_DONE);
msg.arg1 = wakeup ? 1 : 0;
mHandler.sendMessage(msg);
if (authenticated) {
mUpdateMonitor.clearFailedAttempts();
//Jeff Huang
PH.helper().update();
}
if (mExitSecureCallback != null) {
mExitSecureCallback.onKeyguardExitResult(authenticated);
mExitSecureCallback = null;
if (authenticated) {
// after succesfully exiting securely, no need to reshow
// the keyguard when they've released the lock
mExternallyEnabled = true;
mNeedToReshowWhenReenabled = false;
}
}
}
}
27.9.13
Architecture Principles
- 21 principles of enterprise architecture for the financial sector
- Architecture principles: Creating the foundation for robust architecture
- Architecture Principles
- Chapter 2: Key Principles of Software Architecture
- Architecture Principles - The Cornerstones of Enterprise Architecture
- Agile Architecture: Strategies for Scaling Agile Development
- Welcome to the Agile Architect Web Site
- Is Design Dead?
- Evolutionary architecture and emergent design: Investigating architecture and design
- Agile and DevOps for Services - Practices, Techniques and Tools for your SOA Environment
- Panel: SOA and Agile Development
About Web Technologies
- 25 个超强的 CSS3 用户界面开发教程 - Web前端 - ITeye资讯
- 淘宝开源其系统监控工具Tsar - 开源软件 - ITeye资讯
- Emmet:HTML/CSS代码快速编写神器 - Web前端 - ITeye资讯
- Node.js:来自LinkedIn Mobile的10个性能提升秘籍 - 互联网 - ITeye资讯
- HTML5开发中的安全风险 - Web前端 - ITeye资讯
- 7 个效果震憾的 HTML5 应用组件 - Web前端 - ITeye资讯
- 一些达成共识的JavaScript编码风格约定 - 编程语言 - ITeye资讯
- 用来简化开发任务的20个JavaScript类库 - Web前端 - ITeye资讯
- 开源的数据可视化JavaScript图表库:ECharts - 开源软件 - ITeye资讯
- JavaScript异步编程好助手:Promise模式 - 编程语言 - ITeye资讯
- JavaScript 开发者经常忽略或误用的 7 个基础知识点 - 编程语言 - ITeye资讯
- JSDB.io:JavaScript 开源库大集合 - Web前端 - ITeye资讯
- 前端开发者不可忽视的 5 个 HTML5 新特性 - Web前端 - ITeye资讯
- 不用图片和JS,照样创建绚丽的动态CSS3菜单 - Web前端 - ITeye资讯
- Bootstrap 定制工具集锦 - Web前端 - ITeye资讯
- 10 款最新且超实用的 Web 开发框架 - Web前端 - ITeye资讯
- 使用 Bootstrap 的 11 大理由 - Web前端 - ITeye资讯
- Bootstrap 3.0 最佳新功能一览 - Web前端 - ITeye资讯
- 简化工作流程,10款必备的HTML5开发工具 - Web前端 - ITeye资讯
- 前端工程与性能优化(上):静态资源版本更新与缓存
- WebSocket协议中文版下载 - 企业架构 - ITeye资讯
- Intention.js:以响应式方式动态重组HTML代码 - 开源软件 - ITeye资讯
- 7 款风格各异的jQuery图片展示效果 - Web前端 - ITeye资讯
- 对 AngularJS 进行性能调优的 7 个建议 - Web前端 - ITeye资讯
- 18 款在线代码片段测试工具 - 研发管理 - ITeye资讯
- Mozilla开源TogetherJS:让网站拥有实时协作功能 - 开源软件 - ITeye资讯
- jsPDF: an HTML5 Solution to Creating PDFs | Javalo...
25.9.13
AngularJS
- 使用超动感HTML & JS开发WEB应用! | AngularJS中文社区
- Brian Ford
- 使用AngularJS构建大型Web应用
- ▶ Introduction to Angular JS - YouTube
- ▶ AngularJS Fundamentals In 60-ish Minutes - YouTube
- TodoMVC
发信人: hopesfish (有理想的咸鱼), 信区: SoftEng
标 题: Re: 每日集成 --- 也许被敏捷忽视的重要技术实践
发信站: 水木社区 (Thu Jul 11 20:46:04 2013), 站内
【 在 zhangmike 的大作中提到: 】
: 这是高水平团队才能做到的。
: 配套的单元测试、接口测试都不简单
: 界面自动化测试的开发和维护更加需要投入和水平
~~~~~~~~~~
从WEB来说,如果是开发是对DOM树修修改改,然后测试又是基于检测DOM树变化,例如selenium,多少人都不够,自动测试黑洞
但这不是我要说的重点,我要说的是自从用了angluarjs,不用手动修改DOM树后,生产力一下得到大解放,只要关注和后端api交互的js类是否正常工作,每次看到mocha测试用例0失败,还能顺便测测API,那是相当的惬意啊。
标 题: Re: 每日集成 --- 也许被敏捷忽视的重要技术实践
发信站: 水木社区 (Thu Jul 11 20:46:04 2013), 站内
【 在 zhangmike 的大作中提到: 】
: 这是高水平团队才能做到的。
: 配套的单元测试、接口测试都不简单
: 界面自动化测试的开发和维护更加需要投入和水平
~~~~~~~~~~
从WEB来说,如果是开发是对DOM树修修改改,然后测试又是基于检测DOM树变化,例如selenium,多少人都不够,自动测试黑洞
但这不是我要说的重点,我要说的是自从用了angluarjs,不用手动修改DOM树后,生产力一下得到大解放,只要关注和后端api交互的js类是否正常工作,每次看到mocha测试用例0失败,还能顺便测测API,那是相当的惬意啊。
发信人: hopesfish (有理想的咸鱼), 信区: SoftEng
标 题: Re: 每日集成 --- 也许被敏捷忽视的重要技术实践
发信站: 水木社区 (Thu Jul 11 21:27:04 2013), 站内
就我目前理解,angularjs里2个核心概念 双向绑定和directive
双向绑定似乎有点潮的UI框架都支持,有点象当年struts,把model和view自动连接起来,不需要人工干预,官方教程里很多例子,咋一看就是写表单,谁都会,但关键得掌握这种思维方式,去改写bootstrap或者jquery ui里面的例子成为driective, 这个又有点像taglib。
对于大型应用,又得引入模块加载,不然一个应用几千行JS代码没人吃的消,还能顺便载入HTML布局,我是最讨厌在js里面拼html的。requirejs/seajs是个不错的选择,我现在用的是seajs。 支持模块加载以后,用mocha跑数据交互类的测试就行,只要能访问API,且符合期望,剩下的就交给directive的自动处理。至于directive的单元测试,我还没做,但是就目前开发感受而言,比以前用jq/yui/ext/dojo堆控件的可靠度高太多了,所以偷懒没写。
至于视频,还真没怎么看,就看O家的官方文档了
标 题: Re: 每日集成 --- 也许被敏捷忽视的重要技术实践
发信站: 水木社区 (Thu Jul 11 21:27:04 2013), 站内
就我目前理解,angularjs里2个核心概念 双向绑定和directive
双向绑定似乎有点潮的UI框架都支持,有点象当年struts,把model和view自动连接起来,不需要人工干预,官方教程里很多例子,咋一看就是写表单,谁都会,但关键得掌握这种思维方式,去改写bootstrap或者jquery ui里面的例子成为driective, 这个又有点像taglib。
对于大型应用,又得引入模块加载,不然一个应用几千行JS代码没人吃的消,还能顺便载入HTML布局,我是最讨厌在js里面拼html的。requirejs/seajs是个不错的选择,我现在用的是seajs。 支持模块加载以后,用mocha跑数据交互类的测试就行,只要能访问API,且符合期望,剩下的就交给directive的自动处理。至于directive的单元测试,我还没做,但是就目前开发感受而言,比以前用jq/yui/ext/dojo堆控件的可靠度高太多了,所以偷懒没写。
至于视频,还真没怎么看,就看O家的官方文档了
发信人: hopesfish (有理想的咸鱼), 信区: Java
标 题: Re: 技术选型问题: AngularJS vs. ExtJS
发信站: 水木社区 (Thu Sep 26 16:21:19 2013), 站内
作为一个靠JS混饭吃的,强烈建议你用SeaJS + AngluarJS + jQuery + Bootstrap + Bootstrap Theme的组合
SeaJS用来做模块管理就够了,不用搞动态加载jquery那么高大上的东西,能加载某个功能模块的js和template就够了
AngluarJS这种解放人肉维护dom树的核子武器,必须用,从后端转过来的更爱
JQ + Bootstrap生态圈就不用说了,美工,页面仔,前端猿人见人爱..
至于网上有人说NG和JQ是水火不两立,那么是他们太菜,不会用$watch和$apply
ExtJS...你得养多少写JS的啊
PS:LZ要兼职不
发信人: hopesfish (有理想的咸鱼), 信区: Java
标 题: Re: 技术选型问题: AngularJS vs. ExtJS
发信站: 水木社区 (Fri Sep 27 10:39:08 2013), 站内
我认为前端是朝着小而美方向发展,这样才能足够保证UI领域的足够灵活性,所以对于AngluarJS和ExtJS的糅合,我不看好。ExtJS你最看重的也就图表部分,我想,随便几个收费的chart库都比他更好更炫吧,Grid也有NG的版本
关于测试,我现在反倒没有用NG自己的测试体系,仅仅用mocha来在NG的作用域里面测试产品中的service类,之所以这么搞,是因为以前的UI框架都是人肉维护DOM树流派,自然衍生出selenium系这种反人类的测试框架,一旦解放了人肉维护DOM树部分,自然就可以把重点关注在业务交互和数据通讯上,通过JS UT来覆盖所有CRUD功能和部分场景测试。界面的人肉回归测试也不能丢,但劳动强度会低很多,幸福感会强很多。
从软工的角度来看,NG所带来的红利是YUI/DOJO/ExtJS这种上一代的重量级框架所不能提供的。
你都说NG入手简单了,难的只是如何组装起来,这是豌豆荚的一个WEB版源码镜像,不过用的是RequireJS,模块加载风格和SeaJS不一样,可以参考下https://github.com/atian25/wandoujia-satan 剩下的html+js是个web程序猿都会写。我帮一个朋友搭完以后,他带几个大专生就能写业务代码了,何况你那里都是专业级
标 题: Re: 技术选型问题: AngularJS vs. ExtJS
发信站: 水木社区 (Thu Sep 26 16:21:19 2013), 站内
作为一个靠JS混饭吃的,强烈建议你用SeaJS + AngluarJS + jQuery + Bootstrap + Bootstrap Theme的组合
SeaJS用来做模块管理就够了,不用搞动态加载jquery那么高大上的东西,能加载某个功能模块的js和template就够了
AngluarJS这种解放人肉维护dom树的核子武器,必须用,从后端转过来的更爱
JQ + Bootstrap生态圈就不用说了,美工,页面仔,前端猿人见人爱..
至于网上有人说NG和JQ是水火不两立,那么是他们太菜,不会用$watch和$apply
ExtJS...你得养多少写JS的啊
PS:LZ要兼职不
发信人: hopesfish (有理想的咸鱼), 信区: Java
标 题: Re: 技术选型问题: AngularJS vs. ExtJS
发信站: 水木社区 (Fri Sep 27 10:39:08 2013), 站内
我认为前端是朝着小而美方向发展,这样才能足够保证UI领域的足够灵活性,所以对于AngluarJS和ExtJS的糅合,我不看好。ExtJS你最看重的也就图表部分,我想,随便几个收费的chart库都比他更好更炫吧,Grid也有NG的版本
关于测试,我现在反倒没有用NG自己的测试体系,仅仅用mocha来在NG的作用域里面测试产品中的service类,之所以这么搞,是因为以前的UI框架都是人肉维护DOM树流派,自然衍生出selenium系这种反人类的测试框架,一旦解放了人肉维护DOM树部分,自然就可以把重点关注在业务交互和数据通讯上,通过JS UT来覆盖所有CRUD功能和部分场景测试。界面的人肉回归测试也不能丢,但劳动强度会低很多,幸福感会强很多。
从软工的角度来看,NG所带来的红利是YUI/DOJO/ExtJS这种上一代的重量级框架所不能提供的。
你都说NG入手简单了,难的只是如何组装起来,这是豌豆荚的一个WEB版源码镜像,不过用的是RequireJS,模块加载风格和SeaJS不一样,可以参考下https://github.com/atian25/wandoujia-satan 剩下的html+js是个web程序猿都会写。我帮一个朋友搭完以后,他带几个大专生就能写业务代码了,何况你那里都是专业级
23.9.13
22.9.13
20.9.13
Feeling good with Ext.JS
I like to build some simple tools to help me with some everyday work. So far most of my tools are non-UI, because I can't find a good way to build UI based Java application. As you know, Java sucks at this way.
I am not a web developer. However, as an architect, I have to familiar myself with all the layers, even though I am not going to be an expert for everything. Ext JS is the UI library my team is using. I've been thinking about learning Ext JS for a long time, but stuck with other tasks, mostly back-end related.
Today, when I looked at Ext JS's doc, I like it, especially when I enabled Full Window view. I am not sure how HTML5 and Javascript manipulate so local resources, like files, which I believe it can. But I think it can help me for many things.
I am not a web developer. However, as an architect, I have to familiar myself with all the layers, even though I am not going to be an expert for everything. Ext JS is the UI library my team is using. I've been thinking about learning Ext JS for a long time, but stuck with other tasks, mostly back-end related.
Today, when I looked at Ext JS's doc, I like it, especially when I enabled Full Window view. I am not sure how HTML5 and Javascript manipulate so local resources, like files, which I believe it can. But I think it can help me for many things.
Labels:
ExtJS,
Javascript
19.9.13
16.9.13
12.9.13
11.9.13
8.9.13
6.9.13
5.9.13
Simple FIFO with Congestion Control - Why JDK don't consider it?
I think this is a common requirement:
I need to run some tasks in a certain amount of threads. If the tasks created too fast, I want them to wait at the queue. But if there are too many tasks waiting already, I need to slow down the caller and have it wait there until the task queue is available.
ThreadPoolExecutor support this feature except the slow down part. A similar implementation is to apply with CallerRunsPolicy so that the caller thread is used to run a task when the queue is full. However, if I have a queue of 1 million, and the core size/max pool size set as 1, then I probably have task number 1, and task 1 million and 1 finish first. We usually don't expect the tasks finished in a strict order, but having task 1 and task 1 million and 1 finish before others seems too radically, isn't it?
Similar thing happen to maxPoolSize. New threads will only be created when the Queue is full. Those new created threads will be assigned with those tasks that exceed the Queue, instead of assigning the oldest thread already in the Queue. It is the 1 million and 1 issue all over again.
According to those characteristics of ThreadPoolExecutor, I think we need to remember these rules/best practices:
I need to run some tasks in a certain amount of threads. If the tasks created too fast, I want them to wait at the queue. But if there are too many tasks waiting already, I need to slow down the caller and have it wait there until the task queue is available.
ThreadPoolExecutor support this feature except the slow down part. A similar implementation is to apply with CallerRunsPolicy so that the caller thread is used to run a task when the queue is full. However, if I have a queue of 1 million, and the core size/max pool size set as 1, then I probably have task number 1, and task 1 million and 1 finish first. We usually don't expect the tasks finished in a strict order, but having task 1 and task 1 million and 1 finish before others seems too radically, isn't it?
Similar thing happen to maxPoolSize. New threads will only be created when the Queue is full. Those new created threads will be assigned with those tasks that exceed the Queue, instead of assigning the oldest thread already in the Queue. It is the 1 million and 1 issue all over again.
According to those characteristics of ThreadPoolExecutor, I think we need to remember these rules/best practices:
- Use Executors.* factory methods if they fit your requirements. The Executors.* factory methods crease less confusion:
- newFixedThreadPool
- use same size for core and max pool.
- use unlimited blocking queue.
- newSingleThreadExecutor
- A special version of newFixedThreadPool
- new CachedThreadPool
- core size = 0
- max pool = unlimited
- 60 second alive time
- SynchronousQueue for queuing, which means all task will just go directly to execution without waiting.
- Executors.* factory methods will definitely create OOM problem in situation like Denial of Service attack. Then you might want to have your own solution out of these provided ones. In this case, you need to remember:
- Don't rely on the FIFO concept unless you elaborately set up the thread pool. Make those tasks stateless and totally order independent if it is possible.
- Avoid using a work queue and changeable pool size at the same time, because the new created threads will pickup the tasks failed to add to the Queue, which will totally mess up with the order in a dramatic way. If Executors.newCachedThreadPool() is not the option, you probably want a pool with same core and max pool size, a long with a limited Queue size.
- If FIFO and congestion control are important for your system, and the tasks are based on some simple data, you probably want to create your own BlockingQueue to buffer the input. In this way, you can control the data queue easily and dispatch them to the target thread.
4.9.13
2.9.13
Subscribe to:
Posts (Atom)