现在位置: 首页 > soybean发表的所有文章
  • 05月
  • 02日
综合 ⁄ 共 1824字 评论关闭
描述 Description    一维的世界就是一个数轴。这个世界的狭小我们几乎无法想象。    在这个数轴上,有N个点。从左到右依次标记为点1到N。第i个点的坐标为Xi。经过漫长时间的物理变化和化学变化,这个一维世界中产生了一个高等智慧文明,而这N个点都成为了这个文明的一座城市。而点1则成为了这个文明的首都。    出于政治上和经济上的需要,首都不能和任何城市相距太远。所以政府决定在某两个城市耗巨资修建虫洞。一个修建了虫洞的城市可以瞬移到另一个修建了虫洞的城市,从而大大缩短了N个城市相互之间的距离。原先从......
阅读全文
  • 04月
  • 19日
综合 ⁄ 共 4112字 评论关闭
如下面一段文本:   Alice Emma has long flowing red hair. Her Daddy says when the wind blows through her hair, it looks almost alive, like a fiery bird in flight. A beautiful fiery bird, he tells her, magical but untamed. "Daddy, shush, there is no such thing, "she tells him, at the same time wanting him to tell her more. Shyly, she asks, "I mean, Daddy, is there?"   实现将其拆分为一个一个的单词,保存其在文中的行号及在行中的位置,并且剔除文中的标点:   vector<string> *retrieve_text()......
阅读全文
  • 03月
  • 16日
综合 ⁄ 共 284字 评论关闭
"=":递归赋值,即赋值后并不马上生效,等到使用时才真正的赋值,此时通过递归找出当前的值,所有在使用是很有可并不是开始赋的值,所有使用时有应该注意 例子:       SUBARCH=arm ARCH = $(SUBARCH) all:         @echo $(ARCH) 输出: arm 而 ARCH = $(SUBARCH) SUBARCH=arm all:         @echo $(ARCH) 也输出: arm "?=":仅仅在变量还没赋值的情况下才有效,所有一般用在第一次赋值 ":=":直接赋值,这就是我们常规的那种赋值方式,一赋值马上有效。在没赋值是为空字符。 "+=": 在变量后加上字符
阅读全文
  • 02月
  • 04日
综合 ⁄ 共 949字 评论关闭
Nicholas C. Zakas 的 The truth about non-blocking JavaScript 有提到: These three techniques for non-blocking JavaScript ensure that the downloading of the resource doesn’t block either rendering or the download of other resources on the page during page load. The little-known or understood aspect of all three approaches is that they are all defined to block the load event. That means adding scripts using any of these techniques during page load will delay execution of the window.onloa......
阅读全文
  • 01月
  • 29日
综合 ⁄ 共 763字 评论关闭
不泛泛的把所有快捷键列出来了,只记录几个我常用的快捷键,希望给像我一样的xcode入门者点帮助: cmd键(键盘ctrl和alt中间的那货) option键就是Alt键 常用 1. cmd + c   复制 2. cmd + v   粘贴 3. cmd + z   撤销 编译 1. cmd + b   编译但不运行 2. cmd + r   编译并直接运行 注释和提示 1.cmd + /     注释和反注释 2.esc  提示功能,提示函数参数等(推荐) 3.tab或空格  自动完成提示 代码编辑: 1.option+左箭头 上一单词 2.option+右箭头 下一单词 3.ctrl+a   行首 4.ctrl+e  行末 5.文件开头 HOME 6.文件结束 ......
阅读全文
  • 01月
  • 13日
综合 ⁄ 共 2831字 评论关闭
Description Farmer John has taken his cows on a trip to the city! As the sun sets, the cows gaze at the city horizon and observe the beautiful silhouettes formed by the rectangular buildings. The entire horizon is represented by a number line with N (1 <= N <= 40,000) buildings. Building i's silhouette has a base that spans locations A_i through B_i along the horizon (1 <= A_i < B_i <= 1,000,000,000) and has height H_i (1 <= H_i <= 1,000,000,000). Determine the are......
阅读全文
  • 12月
  • 22日
综合 ⁄ 共 1042字 评论关闭
1. dip: device independent pixels(设备独立像素). 不同设备有不同的显示效果,这个和设备硬件有关,一般我们为了支持WVGA、HVGA和QVGA 推荐使用这    这个,不依赖像素。      这里要特别注意dip与屏幕密度有关,而屏幕密度又与具体的硬件有关,硬件设置不正确,有可能导致dip不能正常显示。在屏幕密度为160的显示屏上,1dip=1px,有时候可能你的屏幕分辨率很大如480*800,但是屏幕密度没有正确设置比如说还是160,那么这个时候凡是使用dip的都会显示异常,基本都是显示过小。       dip的换算:             dip(value)=(int)......
阅读全文
  • 12月
  • 09日
综合 ⁄ 共 2238字 评论关闭
一 unix/linux 命令   unix2dos - UNIX to DOS text file format converter     EXAMPLES Get input from stdin and write output to stdout. unix2dos Convert and replace a.txt. Convert and replace b.txt. unix2dos a.txt b.txt unix2dos -o a.txt b.txt Convert and replace a.txt in ASCII conversion mode. Convert and replace b.txt in ISO conversion mode. unix2dos a.txt -c iso b.txt unix2dos -c ascii a.txt -c iso b.txt Convert and replace a.txt while keeping original dat......
阅读全文
  • 08月
  • 17日
综合 ⁄ 共 9009字 评论关闭
为什么要把搜索栏单独写,主要是这里牵涉到一个深层可变副本。在这里为什么要用这个~~~~你迷茫吗? 我也很迷茫哈哈~~~~~~ 该项目是请一个项目的加强版,虽然只是多了一个搜索控件,可是却多了许多步骤。 上次公司需要添加一个字段。也就是在数据库中新增一个字段。我排的时间相对长了一点,受到众人笑话。可是当你对系统的复杂性了解后,你会知道特别时在数据库增加字段时带来了很多的问题。并且我这个字段几乎整个项目的所有表都要增加。因为每张表的关联性,并且有些地方要添加,有的地方使用存储过程,有的是创建临时表,如果要......
阅读全文
  • 08月
  • 11日
综合 ⁄ 共 1509字 评论关闭
  有时候,为了网页设计的美观,需要把div+css设计的页面里的某些div层里的文字垂直居中,包括多行文字以及单行文字;方法有不少,但真正能实现而代码又简洁的介绍不多,flymorn就为大家介绍几种适用的div文字垂直居中的方法。      首先要知道css里vertical-align无效,W3C官方对vertical-align做了下面的解释: “ This property affects the vertical positioning inside a line box of the boxes generated by an inline-level element.”            实际上,一个Box中由很多行很多元素组成,vertical-align只作用于在同一......
阅读全文
  • 07月
  • 27日
综合 ⁄ 共 1543字 评论关闭
 树状数组,一个用来区间求和修改都为log(n)的算法。在网上资料很多,看起来也不是很难,学习一下!     基本上学习树状数组都会看到下面这个图,这也是最基本的一个图,看懂这个以后,对树状数组也就会有 一定的了解了。                                             令这棵树的结点编号为C1,C2...Cn。令每个结点的值为这棵子树的值的总和,那么容易发现:       C1 = A1   C2 = A1 + A2   C3 = A3   C4 = A1 + A2 + A3 + A4   C5 = A5   C6 = A5 + A6   C7 = A7   C8 = A1 + A2 + A3 + A4 + A5 + A6 ......
阅读全文
  • 12月
  • 08日
综合 ⁄ 共 4170字 评论关闭
1.以下代码哪里错了,请指出来。   abstract class Name {   private String name;   public abstract boolean isStupidName(String name) {}   }   大侠们,这有何错误?   答案: 错。abstract method必须以分号结尾,且不带花括号。 2.   public class Something {   void doSomething () {   private String s = "";   int l = s.length();   }   }   有错吗?   答案: 错。局部变量前不能放置任何访问修饰符 (private,public,和protected)。final可以用来修饰局部变量   (final如同abstract和str......
阅读全文