weka入门教程II——分类 读研时转过一篇《weka入门教程》。当时机器学习还没有这么火。Weka其实非常方便,有图形界面,可以识别多种格式,自动切分测试集与训练集等功能。这篇主要介绍图形界面下分类的用法,其他机器学习任务大同小异。weka可以从官方网站下载:https://www.cs.waikato.ac.nz/ml/weka/安装就不说了,安装好后运行,Windows在菜单中可以找到,Linux运行weka.s...
LeetCode Java First 400 题解-034 Search for a Range MediumGiven an array of integers sorted in ascending order, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the o...
LeetCode Java First 400 题解-033 Search in Rotated Sorted Array MediumSuppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2).You are giv...
LeetCode Java First 400 题解-032 Longest Valid Parentheses HardGiven a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the longest valid pa...
LeetCode Java First 400 题解-031 Next Permutation MediumImplement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange...
LeetCode Java First 400 题解-030 Substring with Concatenation of All Words HardYou are given a string,s, and a list of words,words, that are all of the same length. Find all starting indices of substring(s) insthat is a conc...
LeetCode Java First 400 题解-029 Divide Two Integers MediumDivide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.public int divide(int dividend, int divisor) { if...
LeetCode Java First 400 题解-028 Implement strStr()EasyImplement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.public int strStr(String haystack, String ne...
LeetCode Java First 400 题解-027 Remove Element EasyGiven an array and a value, remove all instances of that value in place and return the new length.Do not allocate extra space for another array, you must do this in place wit...
LeetCode Java First 400 题解-026 Remove Duplicates from Sorted Array EasyGiven a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space for an...
LeetCode Java First 400 题解-025 Reverse Nodes in k-Group HardGiven a linked list, reverse the nodes of a linked listkat a time and return its modified list.kis a positive integer and is less than or equal to the length of ...
LeetCode Java First 400 题解-024 Swap Nodes in Pairs MediumGiven a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your...
LeetCode Java First 400 题解-023 Merge k Sorted Lists HardMergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.public ListNode mergeKLists(ListNode[] lists) { if (lists == nul...
LeetCode Java First 400 题解-022 Generate Parentheses MediumGivennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:[ "((()))", ...
LeetCode Java First 400 题解-021 Merge Two Sorted Lists EasyMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.public ListNode mergeTwo...
LeetCode Java First 400 题解-020 Valid Parentheses EasyGiven a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the correct order,"()"an...
LeetCode Java First 400 题解-019 Remove Nth Node From End of List MediumGiven a linked list, remove thenthnode from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = ...
LeetCode Java First 400 题解-018 4Sum MediumGiven an arraySofnintegers, are there elementsa,b,c, anddinSsuch thata+b+c+d= target? Find all unique quadruplets in the array which gives the sum of target.Note:...
LeetCode Java First 400 题解-017 Letter Combinations of a Phone Number MediumGiven a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telepho...
LeetCode Java First 400 题解-016 3Sum Closest MediumGiven an arraySofnintegers, find three integers inSsuch that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each ...
LeetCode Java First 400 题解-015 3Sum MediumGiven an arraySofnintegers, are there elementsa,b,cinSsuch thata+b+c= 0? Find all unique triplets in the array which gives the sum of zero.Note:The solution set must...
LeetCode Java First 400 题解-014 Longest Common Prefix EasyWrite a function to find the longest common prefix string amongst an array of strings.public String longestCommonPrefix(String[] strs) { if (strs.length == 0)...
LeetCode Java First 400 题解-013 Roman to Integer EasyGiven a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.public int romanToInt(String s) { int sum = 0; if (s....
LeetCode Java First 400 题解-012 Integer to Roman MediumRoman numerals are represented by seven different symbols:I,V,X,L,C,DandM.Symbol ValueI 1V 5X 10L 50...
LeetCode Java First 400 题解-011 Container With Most Water MediumGivennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints of line...
LeetCode Java First 400 题解-010 Regular Expression Matching HardGiven an input string (s) and a pattern (p), implement regular expression matching with support for'.'and'*'.'.' Matches any single character.'*' Matches ze...
LeetCode Java First 400 题解-009 Palindrome Number EasyDetermine whether an integer is a palindrome. Do this without extra space.Some hints:Could negative integers be palindromes? (ie, -1)If you are thinking of converting ...
LeetCode Java First 400 题解-008 String to Integer (atoi) MediumImplementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yours...
LeetCode Java First 400 题解-007 Reverse Integer EasyReverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321click to show spoilers.Have you thought about this?Here are some good question...
LeetCode Java First 400 题解-006 ZigZag Conversion MediumThe string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility...
LeetCode Java First 400 题解-005 Longest Palindromic Substring MediumGiven a strings, find the longest palindromic substring ins. You may assume that the maximum length ofsis 1000.Example:Input: "babad"Output: "bab"...
LeetCode Java First 400 题解-004 Median of Two Sorted Arrays HardThere are two sorted arraysnums1andnums2of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(lo...
LeetCode Java First 400 题解-003 Longest Substring Without Repeating Characters MediumGiven a string, find the length of thelongest substringwithout repeating characters.Examples:Given"abcabcbb", the answer is"abc", whic...
LeetCode Java First 400 题解 - 002 Add Two Numbers MediumYou are given twonon-emptylinked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add t...
LeetCode Java First 400 题解-001 Two sumGiven an array of integers, returnindicesof the two numbers such that they add up to a specific target.You may assume that each input would haveexactlyone solution, and you may not use ...
Oracle 常用环境变量查询 select SYS_CONTEXT('USERENV','TERMINAL') terminal, SYS_CONTEXT('USERENV','LANGUAGE') language, SYS_CONTEXT('USERENV','SESSIONID') sessionid, SYS_CONTEXT('USERENV','INSTANCE') instance, SYS_CONTEXT('US
赴美攻略 主要地名了解一下当地的一些主要地各机票购买先找所有可行路线。根据自己情况选择转机与否。在美国第一站需要入关。买票时请买往返票,时间约半年,最好提前一周左右回,以免出现极端天气造成滞留,影响下次入境。因为入关时海关会限定你的入关时间,一般为期半年。样子如下:红色的是入境日期,B1是签证类型(你们应该是B2)。海关可能会把出境日期写在签证类型下面。具体出境日期可以以后在线查询。转机分为两种,美国国内转
美国签证面签攻略 携带材料:1. 你们的护照。2. DS-160确认页,每人一份。可能用到姓名电报号(自己记在确认页上即可)3. 签证交费收据4. 给签证官的信(邀请你们来美的证据)5. 我的Offer、工作证、I-797、我的护照和I-94(我的收入和稳定工作证据),王芳的I-94及结婚证6. 亲子关系公证7. 全家
思考方法,程序员生存之道 本人自2006年开始转行搞IT,回头看看也快十年了!小总结一下经验教训。开始几年特别热衷于技术本身,所谓技术控。我想所有有热情的程序员都经过这一步。对技术不断求深求广求精。后来喜欢玩设计,技术有一定积累了,就想更大的提高,自然就到了设计阶段(最初也学了好多,但是设计这东西必定要基于足够多的实践)。这么又过了几年。现在,终于开窍了,经验如下:职场上的成功,不仅依赖技术,更依赖政治,人人都得懂一点技术
Ruby on rails 实战圣经:ActiveRecord 数据表关系 Debugging istwice as hard as writing the code in the first place. Therefore, if you writethe code as cleverly as possible, you are, by definition, not smart enough todebug it. — Brian W. KernighanAc
Ruby on rails 实战圣经:数据库迁移 - Migrations Programmingtoday is a race between software engineers striving to build bigger and betteridiot-proof programs, and the Universe trying to produce bigger and betteridiots. So far, the Universe is win
Ruby on rails 实战圣经:ActiveRecord All problems in computerscience can be solved by another level of indirection(abstraction) - DavidWheeler ...except for the problem of too many layers of indirection. - KevlinHenney’s corollaryActiveR
Ruby on rails 实战圣经:ActionController Controlling complexity isthe essence of computer programming. — Brian KernighanHTTP通讯协议是一种Request-Response(请求-响应)的流程,客户端(通常是浏览器)向服务器送出一个HTTP request封包,然后服务器就响应一个response封包。在上一章中,我们介绍了Rails如何使用路由来分派req
Ruby on rails 实战圣经:Routing 路由 Weeks of programming cansave you hours of planning. – Unknown不同于PHP的路由系统是直接对应于档案的目录结构,一个Web开发框架会将路由功能纳入其中,来获得最大的弹性。也就是您可以指定任意URL对应到任一个Controller的Action。另一方面,我们也不在Views中直接写死URL网址,而是透过Helper辅助方法根据你的路由设定
Ruby on rails 实战圣经:Part 2: 深度剖析环境设定与Bundler Complication is WhatHappens When You Try to Solve a Problem You Don’t Understand - Andy Boothe目录结构这一节让我们走访一个 Rails 的目录结构:app/app 目录是你主要工作的地方,不同子目录存储了 Models、Controllers、Views、Helpers 和 Assets 等档案。app/
Ruby on rails 实战圣经:RESTful 应用程序 什么是 RESTful?The first 90%of the code accounts for the first 90% of the development time. The remaining10% of the code accounts for the other 90% of the development time. – TomCargill, 贝尔实验室的面向对象程序专家RE
Ruby on rails 实战圣经:打造 CRUD 应用程序 Much of the essence ofbuilding a program is in fact the debugging of the specification. - FredBrooks, The Mythical Man-Month 作者初入门像Rails这样的功能丰富的开发框架,难处就像鸡生蛋、蛋生鸡的问题:要了解运作的原理,你必须了解其中的组件,但是如果个别学习其中的组件,又将
Ruby on rails 实战圣经:Ruby程序语言入门 Actually, I’mtrying to make Ruby natural, not simple. Ruby is simple in appearance, but isvery complex inside, just like our human body. - Matz, Ruby 发明人Ruby是个美丽、灵巧而且方便又实用的程序语言,而Ruby on Rails正是 Ruby 程
Ruby on rails 实战圣经:Rails起步走 Rails起步走There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are n
Ruby on rails 实战圣经:安装Rails开发环境 安装Rails开发环境Give someone aprogram, you frustrate them for a day; teach them how to program, you frustratethem for a lifetime. - David Leinweber在这一章中,我们将介绍如何安装Rubyon Rails的开发环境。开发Rails的环境需要:· Rub
Ruby on rails 实战圣经:Part 1: 入门导览->Ruby on Rails 简介 Ruby on Rails 简介“Life’s too short tobuild something nobody wants” - Ash Maurya, Running Lean 作者Ruby on Rails是一套非常有生产力、维护性高、容易布署的Web开发框架。从一开始不知名的玩具,到现在它已经成为全世界Web应用程序开发的首选框架之一。进入学习的旅程之前,我们先了解为什么它如此特别?什
英文版windows 中文软件乱码的解决方案:设置Locale 很多人用英文操作系统,原因有很多,不管什么原因,都有可能碰到一个问题:软件的文字显示乱码,怎么办? 软件文字显示乱码的原因在于,在英文操作系统下,基于ASCII编码解释所有非Unicode的语言,这时如果不是英语,就会出现乱码。 解决方案:我不确定从哪个版本的windows开始支持的,因为我从windows7才开始用英文版,windows7和8都是支持的。设置方法:Control Panel\Cl
解决 Provider 'System.Data.SqlServerCe.3.5' not installed. 在64位机器上开发,如果使用到SqlServerCe的话,那么很可能会碰到这个问题,问题有两个方面:1.如提示所云,没有安装SqlServerCe,只要去微软下载就好了。2.系统已经安装SqlServerCe,程序找不到相应的程序集。这时候网上有众多解法,最有效的可能属个性app.config文件的方法。但是这个方法也不能完全解决问题,在64位机器上就无效。这时需要强制应用程序兼容32位(即使安装
Windows 8 下总是以管理员权限运行Visual Studio 2012 首先,找到vs所在位置,主程序名为devenv.exe,然后:在"devenv.exe"上右键单击"Troubleshoot compatibility"(中文应该叫解决兼容问题之类,因为本人电脑是英文版,所以大家找找同义词吧)等会再出菜单,单击"Troubleshoot program"(解决程序兼容性)单击"The program requires additional permissions
windows 8 快捷键汇总 Windows键+空格键:切换输入语言和键盘布局Windows键+O:禁用屏幕翻转Windows键+,:临时查看桌面Windows键+V:切换系统通知信息Windows键+Shift+V:反向切换系统通知信息Windows键+回车:打开“讲述人”Windows键+PgUp:将开始屏幕或Metro应用移至左侧显示器Windows键+PgDown:将开始屏幕或Metro应用移至右侧显示器Windows
FFFFFE70解决方法 今天华为W1到手,但是激活却碰到这个问题,而且连接上WIFI无法正常上网。解决方法:重置手机。参考(微软官网):http://answers.microsoft.com/en-us/winphone/forum/wp7-wpstart/windows-live-id-problem-fffffe70/60b33852-45dc-4702-8bf9-71ff980bb5bd 手机重置方法:设置->关
windows 8 下五笔98版和新世纪版的解决方案 相信学会使用五笔98版的人都不会再想回到五笔86版了,因为98版比86版的提升还是蛮明显的。但是苦于输入法难觅…… 经过几翻周折,笔者找到几种解决方案:1. 通过输入法生成器生成自己编码的输入方案。比较著名的生成器有多多五笔生成器。笔者使用海峰98码表(百度一下,下载很多)和win8印象皮肤(皮肤可以从多多官网下载,有很多)成功生成一款98版输入法。2. 通过自定义QQ五笔词库。网上可以下载到QQ
C# 为私有方法添加单元测试 C# 为私有方法添加单元测试(使用反射)Add Unit Test for private method in C# using reflection 在Visuall Studio 2010或更老的版本中,使用系统生成默认的单元测试就可以测试私有方法。以VS 2010为例,在一个方法上单击右键,选择创建单元测试即可。生成的单元测试中,会为私有方法生成accesor,这时就可以在单元测试中访问私有
亚马逊中国购物攻略 笔者在亚马逊工作,所以在亚马逊购物多一些,把经验分享给大家。为什么要在亚马逊购物?正品保证亚马逊卖的商品保证是正品,如果确信收到假货,那么可以找亚马逊直接退货。退货顺畅亚马逊和其他电商比起来的突出优势,就是退货容易。大部分商品提供30天无理由退货,详细参见亚马逊退换货。特别提示:亚马逊有明文规定,凡是可以办理自主退货的商品,都可以无条件退货。所谓自主退货,就是在我的订单中,选择退货操作,选中要退的
C# 获取Internet时间 互联网上有免费的美国标准时间,即Nist时间,Windows中除微软自己提供的Internet时间外,也支持由Nist提供的多个Internet时间,可见此时间的权威性。获取Nist的方法非常简单,下面是一个封闭好的获取Nist时间的类:using System;using System.Collections.Generic;using System.Linq;using System.Net;
C#代码调用Weka 我们知道,Weka是一个用Java语言开发的机器学习工具包(http://blog.csdn.net/Felomeng/archive/2009/10/17/4687061.aspx)。那么如果想在C#中调用怎么办?可以使用IKVM(http://blog.csdn.net/Felomeng/article/details/4063343)。 IKVM转换weka.jar的命令是:ikvmc -
解决Windows下依赖问题的利器——Dependency Walker Windows下开发比较头疼的一个问题就是依赖问题,程序常常因为一个dll文件不存在而无法正常运行。本人遇到这个问题是在使用C++调用sqlite 3在别的机器上无法正常运行。 搜索了一下没有找到答案,于是去msdn论坛问了下,得到了一个MVP的回答,让我使用Dependency Walker这个工具,到无法正常运行的机器上查看缺少了哪些依赖。使我很轻松地解决了问题。
C#创建无窗体的应用程序 示例程序这是初学C#时困惑了很久才解决的问题,突然想起来拿出来和大家分享。当初我是这样做的:1. 在窗体初始化时(构造函数里面),添加一句This.Visible = false;2. 窗体初始大小设定为非常小,并且放到屏幕一个不起眼的角落然而这样并没有解决问题。因为程序启动时总会闪出一现窗体。于是去Program.cs里面改Main函数(C#工程首先进行的static Mai
c#使用StreamWriter将DataTable保存到Excel 废话不多说,贴代码:public static void Export2Excel(DataTable dtTemp, string fileName, bool append = false, Encoding encoding = null) { if (encoding == null) { encodi
Kindle免费在线文档存储及格式转换服务 可注册的Kindle可以享受的两个最容易被忽略的功能是:在线文档存储,亚马逊为每位用户提供至少5G的云存储空间在线文档格式转换支持格式包括Microsoft Word (.DOC, .DOCX) HTML (.HTML, .HTM) RTF (.RTF) JPEG (.JPEG, .JPG) Kindle Format (.MOBI, .AZW) GIF (.GIF) PNG (.PNG) BMP
Visual Studio 2010环境下Sqlite3加密版(由wxSqlite制作)使用方法 Sqlite3是著名的嵌入式数据库,应用之广就不多说了。本篇主要介绍如何使用加密功能。Sqlite3本身提供了加密的接口,但是加密功能并没有实现,用户要使用的话需要自己编写代码来实现加密功能。幸运的是,另一个开源工程wxSqlite(对Sqlite做的一个包装)实现了Sqlite3的加密模块,并且Sqlite3部分可以单独下载。下载地址:http://sourceforge.net/project
解决windows 7下无法安装windows live essential一法 windows live essential 也有一套类似金山快盘的工具,而且可以帮助同步IE的Favorite链接集,所以还是不错的。可是安装时总是报错,错误代码:0x80040607,并提示是wllogin-amd64出了问题。看到login,那么可能是帐户问题,于是切换到a
FORTUNE评出最令人钦佩的公司,Apple(苹果),Google(谷歌),Amazon(卓越)和Microsoft(微软)占了前十名的四个席位 Apple(苹果电脑公司),Google(谷歌),Amazon(卓越)和Microsoft(微软)占了前十名的四个席位
Felomeng翻译:Google C++ 编程规范——作用域 与官方翻译版本(http://code.google.com/p/zh-google-styleguide/downloads/list)不同,本文为本人原创翻译。
给新考上北大软件与微电子学院的同学——利用北大资源 利用北大资源首先,恭喜大家考入北京大学!希望软院成为各位人生旅途中快乐的一站!说明:限于本人搜集能力有限,本文只列出本人常利用的资源(上课老师会告知的资源也不在此列),本文所述的资源只是北大可利用资源的一个子集。一、 图书馆资源:北京大学图书馆的资源数量,我就不多废话了,这里主要说一样怎样利用这些资源。a) 传统资源分布及查找:这种资源主要包括纸质书箱、杂志、光盘等内...
谷歌(Google)为什么总是抄Bing? 我觉得作为搜索引擎市场占有率最高、搜索结果最好的搜索引擎提供商,谷歌不断抄袭必应的展示方式是挺有趣的一个事儿。这事还没有结束,不过看起来好象谷歌不同寻常地对必进行了脱帽礼。
解决Win7中Office(word、Excel)使用ctrl+鼠标左键点击目录提示:由于本机的限制,该操作已被取消。请与系统管理员联系 使用ctrl+鼠标左键点击目录提示:由于本机的限制,该操作已被取消。请与系统管理员联系
commonDialog引发AccessViolationException的一种原因 使用commonDialog如OpenFileDialog.ShowDialog(), SaveFileDialog().ShowDialog()引起AccessViolationException,使用自定义对话框引起Error creating window handle的一种原因