上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 91 下一页
  2013年12月13日
摘要: 有很多种方法可以用来找出哪些SQL语句需要优化,但是很久以来,最简单的方法都是分析保存在V$SQL视图中的缓存的SQL信息。通过V$SQL视图,可以确定具有高消耗时间、CUP和IO读取的SQL语句。 1.查看总消耗时间最多的前10条SQL语句 select * from (select v.sql_id, v.child_number, v.sql_text, v.elapsed_time, v.cpu_time, v.disk_reads, rank() over(order by v.elapsed_time desc) elapsed_rank from v$sql v)... 阅读全文
posted @ 2013-12-13 16:15 我的小人生 阅读(449) 评论(0) 推荐(0) 编辑
摘要: 一 配置SSH 下载ssh服务端和客户端sudo apt-get install openssh-server openssh-client 验证是否安装成功ssh username@192.168.30.128按照提示输入username的密码,回车后显示以下,则成功。(此处不建议修改端口号,hadoop默认的是22,修改后启动hadoop会报异常,除非在hadoop的配置文件中也修改ssh端口号)Welcome to Ubuntu 13.04 (GNU/Linux 3.8.0-34-generic i686) * Documentation: https://help.ubun... 阅读全文
posted @ 2013-12-13 16:11 我的小人生 阅读(547) 评论(0) 推荐(0) 编辑
摘要: 递归题目,注意结合了memo的方法和trie的应用 package Moderate;import java.util.Hashtable;import CtCILibrary.AssortedMethods;import CtCILibrary.Trie;/** * Oh, no! You have just completed a lengthy document when you have an unfortu-nate Find/Replace mishap. You have accidentally removed all spaces, punctuation,and... 阅读全文
posted @ 2013-12-13 16:07 我的小人生 阅读(289) 评论(0) 推荐(0) 编辑
摘要: 原文地址:http://blog.csdn.net/jinzhuojun/article/details/17293325Android 4.1(Jelly Bean)引入了Vsync(VerticalSyncronization)用于渲染同步,使得App UI和SurfaceFlinger可以按硬件产生的VSync节奏来进行工作。关于VSync的介绍详见博文http://www.androidpolice.com/2012/07/12/getting-to-know-android-4-1-part-3-project-butter-how-it-works-and-what-it-adde 阅读全文
posted @ 2013-12-13 16:04 我的小人生 阅读(876) 评论(0) 推荐(0) 编辑
摘要: 例子:759+6741)不考虑进位: 3232)只考虑进位:11103)两者之和:1433 递归求解c package Hard;/** * Write a function that adds two numbers. You should not use + or any arithmetic operators.译文:写一个Add函数求两个数的和,不能使用+号或其它算术运算符。 * */public class S18_1 { public static int add(int a, int b) { if (b == 0) return a; int sum = a ^ b;... 阅读全文
posted @ 2013-12-13 16:00 我的小人生 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 第i个元素和index在[i,length-1]之间的一个数随机交换 package Hard;import CtCILibrary.AssortedMethods;/** * * Write a method to shuffle a deck of cards. It must be a perfect shuffle - in other words, each 52! permutations of the deck has to be equally likely. Assume that you are given a random number generator which i 阅读全文
posted @ 2013-12-13 15:56 我的小人生 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 算法同上题 package Hard;import CtCILibrary.AssortedMethods;/** * Write a method to randomly generate a set of m integers from an array of size n. Each element must have equal probability of being chosen.译文:写一个函数,随机地从大小为n的数组中选取m个整数。要求每个元素被选中的概率相等。 * */public class S18_3 { /* Random number between lower an 阅读全文
posted @ 2013-12-13 15:53 我的小人生 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 一种是Brute force,O(nlogn)另一种是找规律O(n),见http://hawstein.com/posts/20.4.html当某一位的数字小于2时,那么该位出现2的次数为:更高位数字x当前位数当某一位的数字大于2时,那么该位出现2的次数为:(更高位数字+1)x当前位数当某一位的数字等于2时,那么该位出现2的次数为:更高位数字x当前位数+低位数字+1 package Hard;/** * Write a method to count the number of 2s between 0 and n.译文:写一个函数,计算0到n之间2的个数。 * */public class. 阅读全文
posted @ 2013-12-13 15:49 我的小人生 阅读(228) 评论(0) 推荐(0) 编辑
摘要: 1. ModelAdmin.inlines 将有外键的子类包含进视图 ,实例:class Author(models.Model): name = models.CharField(max_length=100)class Book(models.Model): author = models.ForeignKey(Author) title = models.CharField(max_length=100)class BookInline(admin.TabularInline): model = Bookclass AuthorAdmin(admin.ModelAdm... 阅读全文
posted @ 2013-12-13 15:46 我的小人生 阅读(466) 评论(0) 推荐(0) 编辑
摘要: Insert IntervalGiven a set ofnon-overlappingintervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially sorted according to their start times. Example 1: Given intervals[1,3],[6,9], insert and merge[2,5]in as[1,5],[6,9]. Example 2: Given[ 阅读全文
posted @ 2013-12-13 15:42 我的小人生 阅读(186) 评论(0) 推荐(0) 编辑
上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 91 下一页