自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(398)
  • 资源 (1)
  • 收藏
  • 关注

原创 Latex llncs2e模板 通讯作者标注小信封方法

To mark the corresponding author in the first page of the paper, you should use a small envelope. You can use the bbding package of LaTex, and use the command \inst{ (}\Envelope\inst{)} right after th...

2018-10-13 16:59:48 5379

转载 Add emacs key bindings to Microsoft Word on OSX platform

Emacs users get addicted to the standard key bindings (which are also available in Cocoa apps). Microsoft Word doesn’t support these by default, but you can add them through customization. Here are th

2018-01-13 22:00:09 393

转载 brew 更新

为什么要定期更新 我发现不少人都不会经常更新,或者只在必须用某个工具的新版本的时候才更新。他们的看法是,更新有可能产生一些意外的问题,反正当前环境足够稳定可以用,干嘛自找麻烦呢?这个看法对也不对。对是因为,更新产生的潜在问题不可避免。不对是因为总有一天你需要升级的,也许是为了某个工具的新特性,也许是为了修复软件的漏洞,也许你安装的包非要依赖另一个包的新版本,等等。如果隔了很长一段时间才升级,

2018-01-11 16:09:19 18187

原创 Sublime和SumatraPDF双向选择的设置方案

怎么配置Sublime编辑latex的暂时不记录了,只记录个Inverse search的option:"D:\Program Files\Sublime Text 3\sublime_text.exe" "%f:%l"前面是sublime_test.exe的路径,除此以外,要将sumatra加入PATH环境变量。

2017-09-23 09:08:03 1799

转载 (转)max-min fairness 最大最小公平算法

我们经常面临给一组用户划分稀有资源的问题,他们都享有等价的权利来获取资源,但是其中一些用户实际上只需要比其他用户少的资源.那么我们如何来分配资源呢?一种在实际中广泛使用的分享技术称作“最大最小公平分享”.直观上,公平分享分配给每个用户想要的可以满足的最小需求,然后将没有使用的资源均匀的分配给需要‘大资源’的用户。最大最小公平分配算法的形式化定义如下:资源按照需求递增的顺序进行分配 不存在用户得到的

2017-08-15 11:06:27 927

原创 Dominant Resource Fairness: Fair Allocation of Multiple Resource Types

论文的大致内容: 在一个拥有多资源系统中往往需要面对资源平均分配的问题,每个用户对每个资源都有不同的需求。针对这个问题,伯克利几位大牛Ali Ghodsi, Matei Zaharia, Benjamin Hindman, Andy Konwinski, Scott Shenker, Ion Stoica发表了一篇文章,提出Dominant Resoruce Fairness(DRF)算法,一个多

2017-08-14 19:40:40 2746 1

原创 New Surface pro +Vmware 12 +Ubuntu 16.04 分辨率问题

最近新入了今年的Surface pro,众所周知这个屏幕是个高清屏,3:2的比例,高达2736x1824的分辨率,但是安装完Vmware 12+Ubuntu 16.04后分辨率一直有点问题,1400x1050勉强能看,但是这个是4:3比例的,别的分辨率都不太合适。通过一晚上的摸索,总结如下的配置,粘贴到~/.xprofile即可xrandr --newmode "2048x1364_60.00"

2017-06-24 20:55:25 5249 3

原创 Aurora的安装和中文配置

Aurora是office系列的支持latex公式的收费插件,可以方便地在word中插入公式。安装该软件需要两个东西:1.Aurora本身;2.latex编译程序。安装好Aurora后,需要设置latex编译程序位置,完成公式编译。 安装的时候,如果你已经安装了Ctex则不需要再安装Miktex。如果你想要公式中支持中文,建议安装Ctex,避免安装Miktex后复杂的配置。 安装好,破解结束后,

2017-06-07 20:58:42 20044

原创 LeetCode Array Partition I

Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), …, (an, bn) which makes sum of min(ai, bi) for all i from 1 to n as large as possibl

2017-05-12 10:30:30 331

原创 LeetCode Majority Element

Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and the majority element always

2017-05-12 10:14:24 313

原创 LeetCode Base 7

class Solution(object): def convertToBase7(self, num): """ :type num: int :rtype: str """ res= "" flag = 0 if num == 0: return "0

2017-03-30 19:41:10 383

原创 LeetCode Delete Node in a Linked List

# Definition for singly-linked list.class ListNode(object): def __init__(self, x): self.val = x self.next = Noneclass Solution(object): def deleteNode(self, node): """

2017-03-30 19:31:46 362

原创 LeetCode Minimum Moves to Equal Array Elements

#coding=utf-8class Solution(object): def minMoves(self, nums): """ :type nums: list[int] :rtype: int """ #该问题与每次自减一个元素,等价 res = 0 m = min(nu

2017-03-28 12:24:04 327

原创 LeetCode First Unique Character in a String

#coding=utf-8import stringclass Solution(object): def firstUniqChar(self, s): """ :type s: str :rtype: int """ k_v = {} t = [s.find(i) for i in str

2017-03-27 23:56:25 298

原创 LeetCode Ransom Note

class Solution(object): def canConstruct(self, ransomNote, magazine): """ :type ransomNote: str :type magazine: str :rtype: bool """ magazine_k_v = {

2017-03-27 23:34:18 381

原创 LeetCode Assign Cookies

class Solution(object): def findContentChildren(self, g, s): """ :type g: list[int] :type s: list[int] :rtype: int """ res = 0 g.sort()

2017-03-27 14:20:24 356

原创 LeetCode Relative Ranks

class Solution(object): def findRelativeRanks(self, nums): """ :type nums: list[int] :rtype: list[str] """ origin_nums = nums[:] nums.sort()

2017-03-26 15:43:25 372

原创 LeetCode Move Zeroes

class Solution(object): def moveZeroes(self, nums): """ :type nums: list[int] :rtype: void Do not return anything, modify nums in-place instead. """ i,j= 0,

2017-03-26 00:50:15 346

原创 LeetCode Construct the Rectangle

import mathclass Solution(object): def constructRectangle(self, area): """ :type area: int :rtype: list[int] """ #x^2=area x = math.sqrt(area)

2017-03-26 00:31:31 327

原创 LeetCode Add Digits

class Solution(object): def addDigits(self, num): """ :type num: int :rtype: int """ while num % 10 != num: s = str(num) num = sum([i

2017-03-25 23:54:33 343

原创 LeetCode Sum of Two Integers

# coding=utf-8class Solution(object): def getSum(self, a, b): """ :type a: int :type b: int :rtype: int """ MAX_INT = 0x7FFFFFFF MIN_INT = 0

2017-03-25 23:36:39 414

原创 LeetCode Invert Binary Tree

# Definition for a binary tree node.class TreeNode(object): def __init__(self, x): self.val = x self.left = None self.right = Noneclass Solution(object): def invert

2017-03-25 23:35:36 240

原创 LeetCode Find the Difference

Given two strings s and t which consist of only lowercase letters.String t is generated by random shuffling string s and then add one more letter at a random position.Find the letter that was added in

2017-03-23 20:15:19 263

原创 LeetCode Detect Captital

Given a word, you need to judge whether the usage of capitals in it is right or not.We define the usage of capitals in a word to be right when one of the following cases holds:All letters in this word

2017-03-23 19:10:32 310

原创 LeetCode Find All Numbers Disappeared in an Array

Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.Find all the elements of [1, n] inclusive that do not appear in this array.Could you

2017-03-22 11:13:17 287

原创 LeetCode Max Consecutive Ones

Given a binary array, find the maximum number of consecutive 1s in this array.Example 1: Input: [1,1,0,1,1,1] Output: 3 Explanation: The first two digits or the last three digits are consecutive 1s.

2017-03-21 19:15:57 268

原创 LeetCode Nim Game

You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who removes the last stone will be the

2017-03-21 19:06:29 196

原创 LeetCode Island Perimeter

You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The grid is completely s

2017-03-21 19:05:01 219

原创 LeetCode Next Greater Element I

You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1’s elements in the corresponding places of nums2.The

2017-03-20 20:38:55 393

原创 LeetCode Fizz Buzz

Write a program that outputs the string representation of numbers from 1 to n.But for multiples of three it should output “Fizz” instead of the number and for the multiples of five output “Buzz”. For n

2017-03-20 20:22:54 242

原创 LeetCode Keyboard Row

Given a List of words, return the words that can be typed using letters of alphabet on only one row’s of American keyboard like the image below.Example 1: Input: [“Hello”, “Alaska”, “Dad”, “Peace”] O

2017-03-20 20:03:57 273

原创 LeetCode Number Complement

Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation.Note: The given integer is guaranteed to fit within the range of a 32-b

2017-03-19 22:06:53 197

原创 LeetCode Total Hamming Distance

The Hamming distance between two integers is the number of positions at which the corresponding bits are different.Now your job is to find the total Hamming distance between all pairs of the given numb

2017-03-19 21:26:48 195

原创 LeetCode Hamming Distance

The Hamming distance between two integers is the number of positions at which the corresponding bits are different.Given two integers x and y, calculate the Hamming distance.Note: 0 ≤ x, y < 231.Examp

2017-03-19 20:59:55 231

转载 What does "Vanilla" mean ?

Generally speaking, we say something is Vanilla when it’s as “pure” as its producer did in computing world. (The term Vanilla is mainly used in an unix environment to indicate that the Kernel is withou

2016-10-09 10:15:31 531

原创 使用Emacs发送邮件

个人感觉发邮件还是需要效率的,用Emacs来发邮件感觉效率杠杠的,比如想要发送一篇论文给好友等诸如此类的情况。 倒腾了一下,这里以smtp的qq服务器为例,配置如下 (setq send-mail-function (quote smtpmail-send-it)) (setq smtpmail-smtp-server "smtp.qq.com") (setq smtpmail-smtp

2016-10-06 00:16:58 3276 2

原创 ubuntu 全局使用Emacs keybindings

在OSX下使用Ctrl-a,e,f,b,p,n习惯了,Windows下可以使用xkeymacs进行比较好的解决。现在换成ubuntu了却有了很多不便。 ubuntu 下可以安装gnome-tweak-tool有效地切换到emacs布局上来:sudo apt-get install gnome-tweak-tool安装成功后,打开gnome-tweak-tool,进行如下的更改: 按键主题使用E

2016-09-17 12:03:02 1132

原创 ubuntu 16.04 安装hp 扫描打印一体机

Linux下一般使用sane做为扫描仪后端,安装如下: sudo apt-get install sane sane-utils xsanekirchhoff@kirchhoff-dell:~/Downloads$ sudo sane-find-scanner # sane-find-scanner will now attempt to detect your scanner.

2016-09-14 12:11:46 6440 2

原创 Spacemacs 如何在指定工程下删除所有以fprintf开头的行?

在Emacs-china论坛中,有网友问如题所示的问题。其实这样的需求在真实项目中却遇到的不少,比如需要上线运行,需要删除所有类似的输出语句。我使用helm-ag做的,搜索工程下的所有fprintf开头的行,然后对搜索结果进行C-c C-e编辑 C-c C-c对编辑结果进行确认,gif中的str2str.c的277行的测试语句展示了修改前后的效果,fprintf函数都被注释了。

2016-05-24 17:01:34 676

原创 OSX下brew cask install 本地安装pkg,dmg

本来用brew cask 安装东西很爽了,但是今天遇到要安装mactex,这个2.5G的大软件而brew cask install太慢了!!!搭建国内源感觉不靠谱的样子,好像问题乱七八糟的,怕以后维护起来麻烦不断。所以想起来本地安装迅雷事先下好的mactex。具体步骤如下:主要是在/Library/Caches/Homebrew下把MacTex.pkg

2016-04-22 22:37:41 5184

树状数组讲义

树状数组的讲义,很厉害的数据结构,送给大家了~~大家一起学习

2014-12-11

空空如也

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

TA关注的人

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