我有一个运行带参数的程序的bash脚本.该程序输出一些状态(这样做,这样做......).这个程序没有选择安静.如何防止脚本显示任何内容?
我正在寻找类似windows"echo off"的东西.
有谁知道任何可以将视频(avi,flv,等等)转换为HTML5支持的ogg/ogv和mpeg4格式的软件?
我尝试了一些,但我找不到任何有效的东西.
我正在使用Google的Geocoder来查找给定地址的lat lng坐标.
var geocoder = new google.maps.Geocoder();
geocoder.geocode(
{
'address': address,
'region': 'uk'
}, function(results, status) {
if(status == google.maps.GeocoderStatus.OK) {
lat: results[0].geometry.location.lat(),
lng: results[0].geometry.location.lng()
});
Run Code Online (Sandbox Code Playgroud)
address 变量取自输入字段.
我想只在英国搜索位置.我认为指定'region': 'uk'应该足够但不是.当我输入"波士顿"时,它在美国找到波士顿,我想在英国找到它.
如何限制Geocoder仅从一个国家或某个纬度范围返回位置?
谢谢
一个非常简单的代码来说明差异.
var x = [0, 3, 1, 2];
console.debug('debug', x);
console.log('log', x);
// above display the same result
x.splice(1, 2);
// below display kind of a different result
console.debug('debug', x);
console.log('log', x);
Run Code Online (Sandbox Code Playgroud)
alt text http://sixbytesunder.com/stuff/firebug_console.png
javascript值完全相同,但console.log()显示它与应用splice()方法之前有点不同.因为这个我失去了几个小时,因为我认为拼接是有趣的使我的阵列多维或其他东西.
我只是想知道为什么这样的工作.有人知道吗?:)
我是Magento的新手.我在这里阅读了十几个问题,并在Magento论坛上发帖,但似乎都没有解释如何解决我的问题.
我的类别页面有两列布局.在右栏中,我有"最近查看的项目","我的购物篮"和"比较产品".我需要做的就是在右栏添加一个静态块.
据我所知,我必须编辑一些xml文件,但该文件在哪里?我似乎无法找到如何添加这三个现有块.我的猜测是,如果我能找到那些我会弄清楚如何再添加一个.
请帮忙,我现在完全迷路了.谢谢.
编辑
我显然在这里缺少一些基本的东西.让我换句话说.
我有一个类别"AAA"在这个类别中我添加了使用管理面板:描述,图像和分配的产品.然后我在网络浏览器中打开这个类别我看到主要区域中的所有数据和右侧边栏中的那三个块(如上所述).
Magento如何知道展示那些特定的三个街区而不是其他一些街区?它在哪里显示这三个街区?
如何找出给定文本文件的编码字符?
var inputFile = "filename.txt";
var file = fs.readFileSync(inputFile);
var data = new Buffer(file, "ascii");
var fileEncoding = some_clever_function(file);
if (fileEncoding !== "utf8") {
// do something
}
Run Code Online (Sandbox Code Playgroud)
谢谢
我从公共谷歌日历中获得了XML提要.看起来像这样:
<?xml version='1.0' encoding='UTF-8'?>
<feed xmlns='................' xmlns:gd='http://schemas.google.com/g/2005'>
<id>http://www.google.com/calendar/feeds/........./public/full</id>
<updated>2009-08-24T10:57:00.000Z</updated>
<category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event'/>
<title type='text'>Sports Events</title>
.....
<entry>
<id>...........</id>
<published>2009-08-14T00:29:58.000Z</published>
<updated>2009-08-14T00:29:58.000Z</updated>
<category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event'/>
..............
<georss:where>
<gml:Point>
<gml:pos>11.111111 -22.22222</gml:pos>
</gml:Point>
</georss:where>
<gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed'/>
<gd:transparency value='http://schemas.google.com/g/2005#event.transparent'/>
<gCal:uid value='.........@google.com'/>
<gCal:sequence value='0'/>
<gd:when startTime='2009-10-03' endTime='2009-10-04'/>
.............
Run Code Online (Sandbox Code Playgroud)
现在到PHP:
$calendar = simplexml_load_file('http://my.feed.com');
foreach ($calendar->entry as $item) {
//here I get the whole <entry> node
$gd = $item->children('http://schemas.google.com/g/2005');
// now in $gd I have all nodes like <gd:XXXXX>
}
Run Code Online (Sandbox Code Playgroud)
问题是如何从这里获得价值?
<gml:pos>11.111111 -22.22222</gml:pos>
Run Code Online (Sandbox Code Playgroud)
它不存在于我的$ gd变量中,如何获取此节点?
我有一个用 NodeJS 编写的小命令行程序来处理给定目录中的所有文本文件。由于 Node 是异步的,脚本将读取所有文件,处理它们并输出如下内容
Converting file: example-file-1.txt
Converting file: example-file-2.txt
Converting file: example-file-3.txt
Converting file: example-file-4.txt
File example-file-3.txt converted!
File example-file-1.txt converted!
File example-file-2.txt converted!
File example-file-4.txt converted!
Run Code Online (Sandbox Code Playgroud)
这不是很漂亮,“转换后的”消息不按顺序排列,因为文件大小不同并且以不同的速度完成处理。
我想看到的是这样的
File example-file-1.txt: DONE! // processing of this file has finished
File example-file-2.txt: converting... // this file is still processing
File example-file-3.txt: DONE!
File example-file-4.txt: converting...
Run Code Online (Sandbox Code Playgroud)
每行最右边的部分应该随着进度动态更新。
我在这里真正要问的是如何在控制台中显示几行消息,我可以随着脚本的进展更新这些消息?
我在页面的某处有一个div,我需要给它一个背景图像,当你滚动浏览器窗口时它不会移动.到目前为止这是我的代码:
#mydiv {
float:left;
width:540px;
margin:40px 0px 0px 20px;
background:url(/images/myimage.jpg) no-repeat fixed 0px 0px transparent;
}
Run Code Online (Sandbox Code Playgroud)
问题是我的背景图像是相对于画布定位的,我需要它相对于#mydiv滚动而不是滚动.
为了说明这个问题,请看这里http://jsfiddle.net/QPrUz/1/
在这个例子#div1看起来很好但是#div2根本没有显示背景,因为它相对于画布而不是#div2.
欢迎任何建议.
PS
iframe不是一个选项.
我正在使用Laravel 5.4。我有一个artisan命令,通常由cron运行,但是也可以由用户从网站内部运行。用户在页面上/customer/123,然后单击带有的链接的按钮/customer/vat/123,artisan命令执行其工作,应将浏览器重定向回/customer/123,但并非出于某些原因。
我的路线如下所示:
Route::get('customer/vat/{id}', function ($id) {
Artisan::call('app:reminder', [
'--vat' => $id
]);
});
Run Code Online (Sandbox Code Playgroud)
整个过程按预期运行,只是重定向不执行任何操作。没有错误消息,日志中没有任何内容,只有空白页。
在最底层的工匠命令中,我有:
return redirect::to('/customer/123');
Run Code Online (Sandbox Code Playgroud)
我希望可以将我重定向到上述网址,但事实并非如此。
我是否需要使用其他功能从artisan命令中重定向?
javascript ×2
node.js ×2
php ×2
background ×1
bash ×1
console ×1
css ×1
echo ×1
firebug ×1
firefox ×1
fixed ×1
geocode ×1
geolocation ×1
google-maps ×1
gps ×1
html5 ×1
laravel ×1
laravel-5.4 ×1
magento ×1
mpeg ×1
position ×1
redirect ×1
scripting ×1
shell ×1
sidebar ×1
simplexml ×1
video ×1
xml ×1