I saw the new iPhone apps and it is superb. They have nearly more than 9 sections and they have given good navigate view. They have removed tab bar controller and instead of they have given one good navigate view.
Does any have seen this new Facebook apps and knows that how can we give same navigate view for the any apps.
The shortest code by character count to generate seven segment display representation of a given hex number.
Input is made out of digits [0-9] and hex characters in both lower and upper case [a-fA-F] only. There is no need to handle special cases.
输出将是输入的七段表示,使用这些ASCII面:
_ _ _ _ _ _ _ _ _ _ _ _
| | | _| _| |_| |_ |_ | |_| |_| |_| |_ | _| |_ |_
|_| …Run Code Online (Sandbox Code Playgroud) 我在StackOverflow上找到了一个不区分大小写的jQuery 选择器的解决方案:contains.它运行良好,但它以性能为代价.有没有其他人觉得这个解决方案有点慢?
我正在使用:contains选择器来搜索表格.用户在文本框中键入搜索字符串.对于每次击键,它会在表中搜索该字符串,仅显示通过:contains选择器包含该字符串的行.在实施不区分大小写的解决方案之前,此搜索快速而且快速.现在有了这个解决方案,它会在每次击键后锁定一小段时间.
关于如何加快这个解决方案的任何想法?
我想在程序的输出日志上进行正则表达式匹配(在Python中).日志包含一些如下所示的行:
...
VALUE 100 234 568 9233 119
...
VALUE 101 124 9223 4329 1559
...
Run Code Online (Sandbox Code Playgroud)
我想捕获在以VALUE开头的第一次出现之后发生的数字列表.即,我希望它返回('100','234','568','9233','119').问题是我事先并不知道会有多少数字.
我试图用这个作为正则表达式:
VALUE (?:(\d+)\s)+
Run Code Online (Sandbox Code Playgroud)
这匹配线,但它只捕获最后一个值,所以我得到('119',).
我们正在为SQLite数据库中具有数百兆字节HTML的客户端创建一个应用程序.我们已经实现了一种查询此数据的方法,并以合理快速的方式滚动浏览所有数据.问题是某些数据库有非常大的查询(20,000多行),当我们在用户滚动时增加查询时,我们会看到错误.所以我想问题是,我们在Android中查询和显示数万行数据时有哪些选择?
这是我们看到的堆栈跟踪:
09-10 19:19:12.575: WARN/IInputConnectionWrapper(640): showStatusIcon on inactive InputConnection
09-10 19:19:18.226: DEBUG/dalvikvm(640): GC freed 446 objects / 16784 bytes in 330ms
09-10 19:19:32.886: ERROR/CursorWindow(19416): need to grow: mSize = 1048576, size = 36, freeSpace() = 30, numRows = 17717
09-10 19:19:32.896: ERROR/CursorWindow(19416): not growing since there are already 17717 row(s), max size 1048576
09-10 19:19:32.916: ERROR/CursorWindow(19416): The row failed, so back out the new row accounting from allocRowSlot 17716
09-10 19:19:33.005: ERROR/Cursor(19416): Failed allocating fieldDir at startPos 0 row 17716 …Run Code Online (Sandbox Code Playgroud) 一周前,我会手动完成此操作:按组分组数据到新数据帧.对于每个数据帧计算意味着每个变量,然后是rbind.非常笨重......
现在,我已经了解split和plyr,我想必须有使用这些工具的更简单的方法.请不要证明我错了.
test_data <- data.frame(cbind(
var0 = rnorm(100),
var1 = rnorm(100,1),
var2 = rnorm(100,2),
var3 = rnorm(100,3),
var4 = rnorm(100,4),
group = sample(letters[1:10],100,replace=T),
year = sample(c(2007,2009),100, replace=T)))
test_data$var1 <- as.numeric(as.character(test_data$var1))
test_data$var2 <- as.numeric(as.character(test_data$var2))
test_data$var3 <- as.numeric(as.character(test_data$var3))
test_data$var4 <- as.numeric(as.character(test_data$var4))
Run Code Online (Sandbox Code Playgroud)
我和两个人都在玩,ddply但是我无法生产出我想要的东西 - 即每个小组都有这样一张桌子
group a |2007|2009|
________|____|____|
var1 | xx | xx |
var2 | xx | xx |
etc. | etc| ect|
Run Code Online (Sandbox Code Playgroud)
也许d_ply有些odfweave输出会起作用.非常感谢投入.
ps我注意到data.frame将rnorm转换为data.frame中的因子?我怎么能避免这种情况 - 我(rnorm(100)不起作用所以我必须像上面那样转换成数字
我怎么能在这里做他们正在谈论的事情,但是在Ruby中呢?
你会如何对对象执行此功能?你将如何做一个全局函数(参见jetxee 在上述帖子中的回答)?
示例代码:
event_name = "load"
def load()
puts "load() function was executed."
end
def row_changed()
puts "row_changed() function was executed."
end
#something here to see that event_name = "load" and run load()
Run Code Online (Sandbox Code Playgroud)
更新: 你如何得到全球方法?还是我的全球职能?
我试过这个额外的一行
puts methods
Run Code Online (Sandbox Code Playgroud)
和load和row_change未列出的地方.
我们正在研究Java内部的PDF文档的静默打印.打印将从桌面调用,而不是通过浏览器调用,因此我们无法使用JavaScript.PDF Renderer是一种可操作的解决方案,但它们的渲染质量是不可接受的.iText似乎不能与Java打印服务一起插件.有一些商业Java库,Qoppa的jPDFPrint,JPedal和ICEpdf,我们还没有尝试过.
有没有人有从Java静态打印的经验?
我需要从控制台读取输入并将其放入一个字符数组中.我写了以下代码,但是我收到以下错误:"Segmentation Fault"
#include <stdio.h>
#include <stdlib.h>
int main() {
char c;
int count;
char arr[50];
c = getchar();
count = 0;
while(c != EOF){
arr[count] = c;
++count;
}
return (EXIT_SUCCESS);
}
Run Code Online (Sandbox Code Playgroud) 我在linux系统上使用标准的python(2.5.2)日志记录模块,特别是RotatingFileHandler.我的应用程序支持命令行界面和Web服务界面.我想同时写入同一个日志文件.但是,当日志文件被轮换时,新文件具有644权限,并且由Web服务器用户拥有,这阻止了命令行用户写入它.我是否可以指定新的日志文件在日志记录配置中或在日志记录初始化期间是否可以进行组写?
我已经查看了'模式'设置(r/w/a),但它似乎不支持任何文件权限.