我的手机(android,fwiw)拍摄的图片已损坏.我不确定为什么或如何做到这一点,但它似乎阻止我将照片上传到某些服务.如果我将照片移动到我的电脑并在GIMP中打开它,我会看到一条警告信息:
Corrupt JPEG data: 1130 extraneous bytes before marker 0xd9
Run Code Online (Sandbox Code Playgroud)
该错误并不妨碍我查看或编辑照片,但我想知道是否有某种方法可以设置批处理来解决这个问题?
我有一个可爱的数据帧,我的第一个,我开始得到R的一个东西.我无法找到的一件事是重复值的测试.我有一个专栏,我很确定它是所有独特的价值观,但我不知道.
有什么办法可以问吗?为简单起见,让我们假装这是我的数据:
var1 var2 var3
1 1 A 1
2 2 B 3
3 3 C NA
4 4 D NA
5 5 E 4
Run Code Online (Sandbox Code Playgroud)
我想知道是否var1重复.
我有一整列数字,包括成千上万的逗号分隔符.当我尝试用它们创建一个数字列时,超过999的任何东西都变成了NA.
我用过cbind:
df <- cbind(df, var2 = as.numeric(as.character(df$var1)))
Run Code Online (Sandbox Code Playgroud)
并结束:
var1 var2
1 2,518.50 NA
2 2,518.50 NA
3 5,018.50 NA
4 4,018.50 NA
5 10,018.50 NA
6 318.50 318.5
7 2,518.50 NA
8 3,518.50 NA
9 7,518.50 NA
10 1,018.50 NA
Run Code Online (Sandbox Code Playgroud)
有没有办法剥离逗号或告诉as.numeric如何处理它们?
是scraperwikiPython模块可安装Scraperwiki.com Web界面之外?看起来源可用,但未打包.
我有一个数据框,比如工资单,如:
payroll <- read.table(text="
AgencyName Rate PayBasis Status NumRate
HousingAuthority $26,843.00 Annual Full-Time 26843.00
HousingAuthority $14,970.00 ProratedAnnual Part-Time 14970.00
HousingAuthority $26,843.00 Annual Full-Time 26843.00
HousingAuthority $14,970.00 ProratedAnnual Part-Time 14970.00
HousingAuthority $13.50 Hourly Part-Time 13.50
HousingAuthority $14,970.00 ProratedAnnual Part-Time 14970.00
HousingAuthority $26,843.00 Annual Full-Time 26843.00", header = TRUE)
Run Code Online (Sandbox Code Playgroud)
"NumRate"实际上是数字:
payroll$NumRate <- as.numeric(payroll$NumRate)
Run Code Online (Sandbox Code Playgroud)
而且我想通过PayBasis了解最高,最低和平均工资.我希望这可行:
ddply(payroll, "PayBasis", summarize)
Run Code Online (Sandbox Code Playgroud)
但相反,我得到一个错误: Error: length(rows) == 1 is not TRUE
我在这里错过了什么?
我正在尝试编写一个控制台应用程序,它将根据请求解密gpg签名.一切都很顺利,除了它提示我的GPG密码的部分.如何gpg --decrypt在没有密码对话框的情况下从命令行调用?
到目前为止,这是我的代码:
var startInfo = new ProcessStartInfo("gpg.exe");
startInfo.Arguments = "--decrypt"; //this is where I want to insert "--passphrase MyFakePassword"
startInfo.CreateNoWindow = true;
startInfo.UseShellExecute = false;
startInfo.RedirectStandardInput = true;
startInfo.RedirectStandardOutput = true;
startInfo.RedirectStandardError = true;
startInfo.WorkingDirectory = @"C:\Program Files (x86)\GNU\GnuPG";
var proc = Process.Start(startInfo);
var sCommandLine = stringData + "\n"+(char)26+"\n"; //stringData is the encrypted string
proc.StandardInput.WriteLine(sCommandLine);
proc.StandardInput.Flush();
proc.StandardInput.Close();
var result = proc.StandardOutput.ReadToEnd();
Run Code Online (Sandbox Code Playgroud)
我已尝试使用--passphrase MyFakePassword,--passphrase-fd MyFakePassword甚至--passphrase-fd 0在第一行输入时使用我的密码.如果可能的话,我想避免将我的密码放在运行此代码的机器上的txt文件中.
在此先感谢您的帮助.
我有一个数据框,其中包含一列数字,如下所示:
360010001001002
360010001001004
360010001001005
360010001001006
Run Code Online (Sandbox Code Playgroud)
我想分成两位数,3位数,5位数,1位数,4位数的块:
36 001 00010 0 1002
36 001 00010 0 1004
36 001 00010 0 1005
36 001 00010 0 1006
Run Code Online (Sandbox Code Playgroud)
这似乎应该是直截了当的,但我正在阅读strsplit文档,我无法理清我是如何做到这一点的长度.
我有一个数据框,我已经计算并添加了一difftime列:
name amount 1st_date 2nd_date days_out
JEAN 318.5 1971-02-16 1972-11-27 650 days
GREGORY 1518.5 <NA> <NA> NA days
JOHN 318.5 <NA> <NA> NA days
EDWARD 318.5 <NA> <NA> NA days
WALTER 518.5 1971-07-06 1975-03-14 1347 days
BARRY 1518.5 1971-11-09 1972-02-09 92 days
LARRY 518.5 1971-09-08 1972-02-09 154 days
HARRY 318.5 1971-09-16 1972-02-09 146 days
GARRY 1018.5 1971-10-26 1972-02-09 106 days
Run Code Online (Sandbox Code Playgroud)
我想将其分解并计算小计,其中 days_out 为 0-60、61-90、91-120、121-180。
由于某种原因,我什至无法可靠地编写括号符号。我希望
members[members$days_out<=120, ] 仅显示 Barry 和 Garry,但我得到很多行,例如:
NA.1095 <NA> NA <NA> <NA> NA days …Run Code Online (Sandbox Code Playgroud) 我在OSX上安装了CSVkit pip install --user csvkit,它似乎已经工作(重新安装)给我一个Requirement already satisfied消息,但csvcut在我的命令提示符下不可用并且which csvcut什么都不返回.
默认情况下如何将csvkit导入我的路径?
我有一个使用大量背景图片的 Reveal.js 幻灯片:
<section data-background="latimes.png">
<small class="caption">[Some Text](http://a.link.com/whatever)</small>
<aside class="notes">some notes</aside>
</section>
Run Code Online (Sandbox Code Playgroud)
我想在每张幻灯片的左下角为每张图片添加一个标题/链接。
我尝试设置自定义类
.reveal .caption a {
background: #FFF;
color: #666;
padding: 10px;
border: 1px dashed #999;
}
.reveal .caption {
postion: absolute;
bottom: 0px;
left: 50px;
}
Run Code Online (Sandbox Code Playgroud)
但它似乎对布局没有任何影响。元素检查器似乎不能很好地与 Reveal.js 配合使用,这使得很难对其进行故障排除。在reveal.js中是否有一种将文本块强制到屏幕一角的好方法?