小编use*_*071的帖子

如何下载前一天名称的文件

我想下载前一天作为其名称的文件.今天的例子日期:20131021

文件名: 20131020-blah.gz

到目前为止,我已经提出了这个...但它不起作用:

wget ftp://blah:blah@ftp.haha.com/'$(date +%Y%m%d -d)-blah.gz' /myFolder/Documents/ 
Run Code Online (Sandbox Code Playgroud)

linux bash

2
推荐指数
1
解决办法
63
查看次数

如何并排显示同一个表中的数据

假设我在mysql中有一个表(称为get),如下所示:

ID S Num
00 1 506
00 2 620
01 1 562
01 2 564
02 1 548
02 2 484
03 1 488
03 2 895
Run Code Online (Sandbox Code Playgroud)

我试图以这种格式得到它:

ID S1  S2
00 506 620
01 562 564
02 548 484
03 488 895
Run Code Online (Sandbox Code Playgroud)

到目前为止我有这个,但它给了我一个错误:

select id,d.S1,c.S2 from 
(select S as S1 from get where S=1)d inner join  
(select s as S2 from get where S=2)c using (id);
Run Code Online (Sandbox Code Playgroud)

我仍然不太确定加入,但这似乎有道理.

编辑:S有时只能有1个值,在这些时间内,此值将为S1

php mysql sql database inner-join

2
推荐指数
1
解决办法
1339
查看次数

我看不到log2 + log3 + log4 = log(n!)

我看不到log2 + log3 + log4 + ... + log n = log(n!)值如何计算出来,但我不明白为什么会这样。请帮帮我!

math big-o recurrence

2
推荐指数
1
解决办法
1691
查看次数

我用cron得到了一个缺少错误的方案

当我使用它从ftp服务器下载文件时:

wget ftp://blah:blah@ftp.haha.com/"$(date +%Y%m%d -d yesterday)-blah.gz" /myFolder/Documents/"$(date +%Y%m%d -d yesterday)-blah.gz"
Run Code Online (Sandbox Code Playgroud)

它说"20131022-blah.gz saved"(它下载很好),但我得到这个:

/myFolder/Documents/20131022-blah.gz: Scheme missing (I believe this error prevents it from saving the file in /myFolder/Documents/).

我不知道为什么这不起作用.

linux ftp bash cron

1
推荐指数
1
解决办法
4360
查看次数

如何使用 tcl 搜索文件,仅包含文件名的一部分

如果我有一个包含以下文件的文件夹:

hello-version-1-090.txt
hello-awesome-well-091.txt
goodday-087.txt
hellooo-874.txt
hello_476.txt
hello_094.txt
Run Code Online (Sandbox Code Playgroud)

如何使用 tcl 搜索包含以下术语的文件:“hello”和“091”。

可能的解决方案:获取ls -l文件夹中 an 的输出,将其拆分'\n',然后foreach在每一行上运行 a并使用正则表达式匹配条件。但是如何ls -l在文件夹中运行并使用 tcl 记录其保存内容(文件名)?

regex bash foreach ls tcl

1
推荐指数
1
解决办法
1036
查看次数

在python字典中操作和打印项目

我有以下代码:

ex_dict={1:"how",3:"do you",7:"dotoday"}
for key in ex_dict:
    string= key," and this is ", ex_dict[key]
    print (string)
Run Code Online (Sandbox Code Playgroud)

输出是:

(1, ' and this is ', 'how')
(3, ' and this is ', 'do you')
(7, ' and this is ', 'dotoday')
Run Code Online (Sandbox Code Playgroud)

我的预期输出:

1 and this is how
3 and this is do you
7 and this is dotoday
Run Code Online (Sandbox Code Playgroud)

我似乎无法弄清楚如何摆脱输出中的字典格式.

python python-2.7

1
推荐指数
1
解决办法
63
查看次数

重新映射 Excel 链接 VBA

我有一个文件,其中包含约 3000 个其他文件的链接。该文件与链接的文件一起被移动到新位置。

当我移动文件和excel文件时,路径自动更新,但是引入了一个新文件夹,并且该文件夹没有添加到excel的超链接中。

例子:

Excel link: folder1/folder2/folder3/file.txt
Actual path: folder1/EXTRA_FOLDER/folder2/folder3/file.txt
Run Code Online (Sandbox Code Playgroud)

我该如何添加该超链接?使用VBA,我如何访问超链接?

excel vba

1
推荐指数
1
解决办法
190
查看次数

如何从未知数量的复选框中获取信息

在我的一个html页面上,我有一个循环,它创建了n个复选框(取决于数据库中有多少条目).

当用户按下提交按钮时,它会打开另一个html页面,如何设置我的第二页以接收所有打勾的项目.注意,复选框的名称也是未知的,到目前为止我在第一页上有这个:

 <form action='tests.php' method='get'>
                <p>
                <?php
                        while ($row = mysql_fetch_array($result)) {
                                print "<tr><td><input type='checkbox' name=".$row{'Info'}." value=".$row{'Info'}.">".$row{'Info'}."<br></td></tr>";
                        }
                ?>
                </p>
                <input type="submit" value="Submit">
        </form>
Run Code Online (Sandbox Code Playgroud)

当tests.php打开时,如何获取所有检查标记的值?

阅读其他帖子,我相信我必须使用数组来获取值,但是,我仍然看不到如何在这里实现数组.

html php

0
推荐指数
1
解决办法
100
查看次数

从 bash 脚本生成并运行 perl 脚本

我正在尝试生成一个 perl 脚本并从 bash 脚本运行它,但我遇到了问题:

#!/bin/bash
str="perl"
array=( one two three )
for i in "${array[@]}"
do
   str=$str" -e 'print \"$i \";'"
done
echo "$str"
echo "AND THE PERL OUTPUT: "
$str
Run Code Online (Sandbox Code Playgroud)

生成输出:

perl -e 'print "one ";' -e 'print "two ";' -e 'print "three ";'
AND THE PERL OUTPUT:
Can't find string terminator "'" anywhere before EOF at -e line 1.
Run Code Online (Sandbox Code Playgroud)

当我perl -e 'print "one ";' -e 'print "two ";' -e 'print "three ";'手动运行生成的 perl 命令时,它可以工作,但是当我尝试从 bash …

bash perl

0
推荐指数
1
解决办法
77
查看次数

标签 统计

bash ×4

linux ×2

php ×2

big-o ×1

cron ×1

database ×1

excel ×1

foreach ×1

ftp ×1

html ×1

inner-join ×1

ls ×1

math ×1

mysql ×1

perl ×1

python ×1

python-2.7 ×1

recurrence ×1

regex ×1

sql ×1

tcl ×1

vba ×1