这里有感觉真的很愚蠢的风险,但我似乎无法从命令行设置VLC的音量?
vlc file.mp3 --vol 0
Run Code Online (Sandbox Code Playgroud)
我已阅读手册页以及谷歌搜索,但我无法完成上述工作.还尝试了--volume 0,-vol 0,-volume 0(以及在文件名之前放置音量选项).
无论如何,VLC以其预设音量开始.在Ubuntu上使用VLC 1.1.5.(我打算在bash脚本中使用该行,因此我无法使用VLC GUI)/ J.
更新
我尝试过不同的价值观.我现在运行vlc非常详细.这部分看起来有点可疑(但我不知道如何解释它!):
[0xb7108d14] main audio output warning: PTS is out of range (-9483), dropping buffer [0xb7108d14] main audio output warning: PTS is out of range (-35533), dropping buffer [0x94384ac] mpgatofixed32 audio filter debug: libmad error: bad main_data_begin pointer [0xb7108d14] pulse audio output debug: Pulse stream started [0xb7108d14] main audio output warning: output date isn't PTS date, requesting resampling (86708) Warning: call to rand() [0xb7108d14] main audio output …
由于信息安全限制,我在产品上有默认范围.
class Product < ActiveRecord::Base
has_many :photos
default_scope where('visible = 1')
end
Run Code Online (Sandbox Code Playgroud)
但是,在我的相关照片模型中,我还必须找到不可见的产品.
class Photo < ActiveRecord::Base
belongs_to :product
end
my_photo.product
Run Code Online (Sandbox Code Playgroud)
在其他情况下,我可以使用unscoped来绕过default_scope,例如在Product.unscoped.find_by_title('abc').然而:
如何在使用记录关联时删除范围?
my_photo.unscoped.product因为my_photo没有调用方法,所以没有意义unscoped.也没有my_photo.product.unscoped任何意义,因为my_photo.product可能已经是零.
在终端,我有
myapp < myfileinput
Run Code Online (Sandbox Code Playgroud)
但如果我想使用gdb,
gdb myapp < myfileinput
Run Code Online (Sandbox Code Playgroud)
它运行不正常.
如何在这里使用gdb?
我想把一些帖子数据发送到服务器并阅读回复.他们提供给我的网址是https://thesite.com/page/test.jsp,i尝试使用$ fp = fsockopen("https:// thesite .com/page/test.jsp",80,$ errno,$ errstr,30); 但得到了'无法找到'HTTPs''错误.使用curl发送数据但是与服务器核对,他们没有收到任何请求.还有其他办法吗?
我的代码:
String dbDate = DateTime.ParseExact(TextBox3.Text, "dd/mm/yyyy", null).ToString("yyyy-mm-dd");
SqlConnection MyConnection = new SqlConnection("Data Source=localhost;Initial Catalog=hcgoa;User Id=sa;Password=;");
MyConnection.Open();
String MyString = "select notice from notice_aspx where fil_no=? and orderdate=?";
SqlCommand MyCmd = new SqlCommand(MyString, MyConnection);
MyCmd.Parameters.AddWithValue("?", HiddenField4.Value);
MyCmd.Parameters.AddWithValue("?", dbDate);
using (SqlDataReader MyReader4 = MyCmd.ExecuteReader())
{
//**
if (MyReader4.Read())
{
String MyString1 = "UPDATE notice_aspx SET notice=? where fil_no=? AND orderdate=?";
SqlCommand MyCmd1 = new SqlCommand(MyString1, MyConnection);
MyCmd1.Parameters.AddWithValue("?", Editor1.Content.ToString());
MyCmd1.Parameters.AddWithValue("?", HiddenField4.Value.ToString());
MyCmd1.Parameters.AddWithValue("?", dbDate);
MyCmd1.ExecuteNonQuery();
}
else
{.........
Run Code Online (Sandbox Code Playgroud)
错误是
Exception Details: System.Data.SqlClient.SqlException: Line 1: …Run Code Online (Sandbox Code Playgroud) 给出如下列表:
val dane = List(
("2011-01-04", -137.76),
("2011-01-04", 2376.45),
("2011-01-04", -1.70),
("2011-01-04", -1.70),
("2011-01-04", -1.00),
// ... skip a few ...
("2011-12-22", -178.02),
("2011-12-29", 1800.82),
("2011-12-23", -83.97),
("2011-12-24", -200.00),
("2011-12-24", -30.55),
("2011-12-30", 728.00)
)
Run Code Online (Sandbox Code Playgroud)
我想01按照指定的顺序使用以下操作对特定月份(例如1月或1月)的值(即内部列表的第二项)求和:
groupByslicecollectsum我正在创建一个文件来读取一定数量的.wav文件,每个文件都对应一个音符.我正在对它们中的每一个执行FFT并将它们全部绘制在同一个图上.但是我遇到了使图例正确打印的问题,它将我想要使用的名称分隔成单个字母而不是将它们用作字符串.我的代码如下:
clear all
mydir = 'Note Values/';
wavFiles = dir([mydir '*.wav']);
length(wavFiles)
legendText = [];
figure(1);
hold on;
for i = 1:length(wavFiles)
wavFiles(i).name
[y, fs] = wavread([mydir wavFiles(i).name]);
sound(y, fs)
currentSample = y(round(length(y)/2)-2048:round(length(y)/2)+2047);
FFT = abs(fft(currentSample));
Power = FFT.*conj(FFT)/length(FFT);
if (mod(i, 2) == 1)
h = plot(Power, 'Color', 'red');
else
h = plot(Power, 'Color', 'blue');
end
sri = wavFiles(i).name;
sri
legendText = [legendText, sri];
end
length(legendText)
legendText(1)
legend(legendText(:));
hold off;
Run Code Online (Sandbox Code Playgroud)
sri变量始终是一个完整的字符串,但legendText(1)只打印出A而不是A3.wav.我知道它可能是非常明显的东西,但我找不到它.谢谢
我的图表上的输出显示如下:

我已经将文件内容读入char数组,然后将其中的一些数据读入向量中.如何将一系列char数组复制到向量中?vector和char数组都是相同的类型(unsigned char).
目前的代码是这样的:
int p = 0;
for(...){
short len = (arr[p+1] << 8) | arr[p+0];
p+=2;
...
for(...len...){
vec.push_back(arr[p]);
p++;
}
}
Run Code Online (Sandbox Code Playgroud)
我想通过放弃循环来改进这个push_back,怎么样?
我正在制作一个表单,并且只有在输入值是数字时才会执行代码.我试图避免使用某种验证插件,并想知道是否有办法循环输入字段并检查值.
我一直在尝试以下但我认为我的逻辑错了:
(#monthlyincome是表单ID)
$("#submit").click(function() {
$("#monthlyincome input").each(function() {
if (!isNaN(this.value)) {
// process stuff here
}
});
});
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
这是整个更新的代码:
$("#submit").click(function() {
$("#monthlyincome input[type=text]").each(function() {
if (!isNaN(this.value)) {
// processing data
var age = parseInt($("#age").val());
var startingage = parseInt($("#startingage").val());
if (startingage - age > 0) {
$("#field1").val(startingage - age);
$("#field3").val($("#field1").val());
var inflationyrs = parseInt($("#field3").val());
var inflationprc = $("#field4").val() / 100;
var inflationfactor = Math.pow(1 + inflationprc, inflationyrs);
$("#field5").val(inflationfactor.toFixed(2));
var estyearlyinc = $("#field6").val();
var inflatedyearlyinc = inflationfactor * estyearlyinc;
$("#field7").val(FormatNumberBy3(inflatedyearlyinc.toFixed(0), ",", …Run Code Online (Sandbox Code Playgroud) 我有一个除了一些字符串之外什么都没有的网页.没有图像,没有背景颜色或任何东西,只是一些长度不是很长的纯文本.
我只是想知道,什么是最好的(通过这种方式,我的意思是最快和最有效)的方式来传递网页中的字符串,以便我可以用它来做其他事情(例如在文本框中显示)?我知道WebClient,但我不确定它是否会做我想做的事情,而且即使它确实有效,我也不想尝试它,因为我上次做的时间大约需要30秒一个简单的操作.
任何想法,将不胜感激.