This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| J.U.C并发框架(1) | |
| 翻译:书卷多情 | |
| 在J2SE1.5中,java.util.concurrent包下的大部分同步工具(锁、阻塞等)以AbstractQueuedSynchronizer类为基础来构建。这个框架提供了一些常用机制用于自动管理并发状态、阻塞及非阻塞线程和队列。本论文描述了该框架的根源、设计实现、用法及性能。 | |
| 关键字:synchronized, java | |
| 1、介绍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| JVM底层又是如何实现synchronized的? | |
| 目前在Java中存在两种锁机制:synchronized和Lock,Lock接口及其实现类是JDK5增加的内容,其作者是大名鼎鼎的并发专家Doug Lea。本文并不比较synchronized与Lock孰优孰劣,只是介绍二者的实现原理。 | |
| 数据同步需要依赖锁,那锁的同步又依赖谁?synchronized给出的答案是在软件层面依赖JVM,而Lock给出的方案是在硬件层面依赖特殊的CPU指令,大家可能会进一步追问:JVM底层又是如何实现synchronized的? | |
| 本文所指说的JVM是指Hotspot的6u23版本,下面首先介绍synchronized的实现: | |
| synrhronized关键字简洁、清晰、语义明确,因此即使有了Lock接口,使用的还是非常广泛。其应用层的语义是可以把任何一个非null对象 作为"锁",当synchronized作用在方法上时,锁住的便是对象实例(this);当作用在静态方法时锁住的便是对象对应的Class实例,因为 Class数据存在于永久带,因此静态方法锁相当于该类的一个全局锁;当synchronized作用于某一个对象实例时,锁住的便是对应的代码块。在 HotSpot JVM实现中,锁有个专门的名字:对象监视器。 | |
| 1. 线程状态及状态转换 | |
| 当多个线程同时请求某个对象监视器时,对象监视器会设置几种状态用来区分请求的线程: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 3.1、摘要 | |
| 在前面两篇文章中,分别介绍和讨论了朴素贝叶斯分类与贝叶斯网络两种分类算法。这两种算法都以贝叶斯定理为基础,可以对分类及决策问题进行概率推断。在这一篇文章中,将讨论另一种被广泛使用的分类算法——决策树(decision tree)。相比贝叶斯算法,决策树的优势在于构造过程不需要任何领域知识或参数设置,因此在实际应用中,对于探测式的知识发现,决策树更加适用。 | |
| 3.2、决策树引导 | |
| 通俗来说,决策树分类的思想类似于找对象。现想象一个女孩的母亲要给这个女孩介绍男朋友,于是有了下面的对话: | |
| 女儿:多大年纪了? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1.1、摘要 | |
| 贝叶斯分类是一类分类算法的总称,这类算法均以贝叶斯定理为基础,故统称为贝叶斯分类。本文作为分类算法的第一篇,将首先介绍分类问题,对分类问题进行一个正式的定义。然后,介绍贝叶斯分类算法的基础——贝叶斯定理。最后,通过实例讨论贝叶斯分类中最简单的一种:朴素贝叶斯分类。 | |
| 1.2、分类问题综述 | |
| 对于分类问题,其实谁都不会陌生,说我们每个人每天都在执行分类操作一点都不夸张,只是我们没有意识到罢了。例如,当你看到一个陌生人,你的脑子下意识判断TA是男是女;你可能经常会走在路上对身旁的朋友说“这个人一看就很有钱、那边有个非主流”之类的话,其实这就是一种分类操作。 | |
| 从数学角度来说,分类问题可做如下定义: | |
| 已知集合:和,确定映射规则,使得任意有且仅有一个使得成立。(不考虑模糊数学里的模糊集情况) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 今天是我非常郁闷的一天,心情很差。today is my blue day. im not in mood to do anything. i know everybody hate aggressive boys. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
| " Maintainer: amix the lucky stiff | |
| " http://amix.dk - amix@amix.dk | |
| " | |
| " Version: 3.6 - 25/08/10 14:40:30 | |
| " | |
| " Blog_post: | |
| " http://amix.dk/blog/post/19486#The-ultimate-vim-configuration-vimrc | |
| " Syntax_highlighted: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 在这份教程中,我们将会学习到如何组织用户通过PHP上传成人照片或者裸照. | |
| 示例 下载 | |
| 我在phpclasses.org上面偶然发现一个很有用的,由Bakr Alsharif开发的可以帮助开发者基于皮肤像素点来检测图片裸照的类文件. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class sexIdentifier { | |
| public static final String HOMOSEXUAL = "homo"; | |
| public static final String STRAIGHT = "straight"; | |
| public static void main(String args[]){ | |
| public String identifyGender(String yourGender, String belovedGender){ | |
| if(yourGender.equals(belovedGender)){ | |
| return HOMOSEXUAL; | |
| }else{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 简单验证码识别程序(源码) | |
| 简单验证码是指验证码图片里的字符,固定不变,或者变化很小的验证码,比如:字符上会有一些感扰点感扰线等情况,或者只有少数几种字体变化和字体大小变化。 | |
| 这里给出源代码都是非常简单的源代码,学过《C程序设计》的都可以看懂,不会超出书本范围,而且不使用指针,这样VB,Delphi,JAVA 等语言都可以照此写出相应的源代码。 | |
| 验证码识别可以分为三个大的步骤:预处理,分割,识别。 | |
| 1. 预处理 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 原文地址:http://in.sdo.com/?p=1707 | |
| 收集和整理了目前互联网上能找到的开源推荐系统,并附上了个人的一些简单点评(未必全面准确),这个列表是目前为止比较全面的了,希望对大家了解掌握推荐系统有帮助(文/陈运文) | |
| SVDFeature | |
| 由上海交大的同学开发,采用C++语言,代码质量很高。去年我们参加KDD竞赛时用过,很好很方便,而且出自咱们国人之手,所以置顶推荐! | |
| 项目地址: | |
| http://svdfeature.apexlab.org/wiki/Main_Page | |
| SVDFeature包含一个很灵活的Matrix Factorization推荐框架,能方便的实现SVD、SVD++等方法, 是单模型推荐算法中精度最高的一种。SVDFeature代码精炼,可以用相对较少的内存实现较大规模的单机版矩阵分解运算。 | |
| 另外含有Logistic regression的model,可以很方便的用来进行ensemble运算 |
OlderNewer