我目前在公共WIFI上,我无法使用SSH(他们可能阻止了该端口).但是,我需要连接来做一个git push.
? ssh -T git@github.com
ssh: connect to host github.com port 22: Connection refused
Run Code Online (Sandbox Code Playgroud)
是否可以通过端口80设置SSH隧道并告诉github push使用该连接来绕过此限制?怎么做?我在OSX(狮子).这一定是个常见问题吗?
我正在尝试制作一个10频段均衡器,kAudioUnitSubType_NBandEQ音频单元似乎还有很长的路要走,但Apple的文档并没有涵盖如何设置/配置它.
我已经连接了节点,但是当我尝试连接EQNode和iONode(输出)时出错:https://gist.github.com/2295463
如何将效果转换为工作的10波段均衡器?
更新: 使用Novocaine的 DSP工作方案也是一个解决方案,任何想法!那些DSP公式非常复杂.
更新2: 我更喜欢使用诺瓦卡因的工作DSP配方,因为它比编程音频节点更清洁/更小.
Update3: "Multitype EQ单元(子类型为kAudioUnitSubType_NBandEQ)提供均衡器,可以配置为"Mutitype EQ单元过滤器类型"(第68页)中描述的任何一种类型." 来源:http://developer.apple.com/library/ios/DOCUMENTATION/AudioUnit/Reference/AudioUnit_Framework/AudioUnit_Framework.pdf 但仍然没有例子.
重要更新(17/05):我建议每个人都使用我在github上发布的DSP类:https://github.com/bartolsthoorn/NVDSP这可能会为你节省很多工作.这将使开发n波段均衡器或任何类型的音频滤波器变得轻而易举.
如何解交织float *newAudio成float *channel1和float* channel2和交织它放回newAudio?
Novocaine *audioManager = [Novocaine audioManager];
__block float *channel1;
__block float *channel2;
[audioManager setInputBlock:^(float *newAudio, UInt32 numSamples, UInt32 numChannels) {
// Audio comes in interleaved, so,
// if numChannels = 2, newAudio[0] is channel 1, newAudio[1] is channel 2, newAudio[2] is channel 1, etc.
// Deinterleave with vDSP_ctoz()/vDSP_ztoz(); and fill channel1 and channel2
// ... processing on channel1 & channel2
// Interleave channel1 and channel2 with vDSP_ctoz()/vDSP_ztoz(); to newAudio …Run Code Online (Sandbox Code Playgroud) signal-processing objective-c core-audio accelerate-framework
我有这6个峰值均衡系数:
b0 = 1 + (? ? A)
b1 = ?2??C
b2 = 1 - (? ? A)
a0 = 1 + (? / A)
a1 = ?2 ? ?C
a2 = 1 ? (? / A)
Run Code Online (Sandbox Code Playgroud)
有了这些中间变量:
?c = 2 ? ? ? fc / fs
?S = sin(?c)
?C = cos(?c)
A = sqrt(10^(G/20))
? = ?S / (2Q)
Run Code Online (Sandbox Code Playgroud)
vDSP_deq22()应该通过"5个单精度输入,滤波器系数" 的状态记录,但我有6个系数!另外,我以什么顺序将它们传递给vDSP_deq22()?
更新(17/05):我建议大家使用我在github上发布的DSP类:https://github.com/bartolsthoorn/NVDSP它可能会为你节省很多工作.
我正在寻找一个足够智能的javascript函数来删除一长段文本的最后一句(实际上是一段).一些示例文本显示复杂性:
<p>Blabla, some more text here. Sometimes <span>basic</span> html code is used but that should not make the "selection" of the sentence any harder! I looked up the window and I saw a plane flying over. I asked the first thing that came to mind: "What is it doing up there?" She did not know, "I think we should move past the fence!", she quickly said. He later described it as: "Something insane."</p>
Run Code Online (Sandbox Code Playgroud)
现在我可以拆分.并删除数组的最后一个条目,但这对于以?或结尾的句子不起作用,!并且某些句子以引号结束 …
关于如何抑制大熊猫科学记数法,我找到了很多答案,但我如何启用呢?我找到了这个选项,pd.set_option('precision', 2)但它没有将大数字变成科学记数法.
例如,我希望将数字123066.14格式化为1.23E+5.我正在使用a pandas.DataFrame,在导出/打印时设置整列的格式会很有用.
我只想使用Ruby的续集获取last_insert_id():
insertret = @con.run("INSERT INTO `wv_persons` ( `id` ) VALUES ( NULL )")
pp insertret.inspect # returns "nil", expected that..
last_insert_id = @con.run("SELECT LAST_INSERT_ID() AS last_id;")
pp last_insert_id.inspect # returns "nil", should be an IDRun Code Online (Sandbox Code Playgroud)
SELECT查询应返回last_id,但.run不返回它.我应该用什么方法代替?
解决方案:(感谢Josh Lindsey)
last_insert_id = @con[:wv_persons].insert({})
last_insert_id = last_insert_id.to_s
puts "New person ["+ last_insert_id +"]"Run Code Online (Sandbox Code Playgroud) 重要更新:我已经找到答案并将它们放在这个简单的开源库中:http://bartolsthoorn.github.com/NVDSP/检查一下,如果遇到问题,它可能会节省很多时间在IOS中使用音频过滤器!
^
我创建了一个(实时)音频缓冲区(float *data),它可以容纳几个sin(theta)不同频率的波.
下面的代码显示了我是如何创建缓冲区的,我试图做一个带通滤波器,但它只是将信号转换为噪声/闪烁:
// Multiple signal generator
__block float *phases = nil;
[audioManager setOutputBlock:^(float *data, UInt32 numFrames, UInt32 numChannels)
{
float samplingRate = audioManager.samplingRate;
NSUInteger activeSignalCount = [tones count];
// Initialize phases
if (phases == nil) {
phases = new float[10];
for(int z = 0; z <= 10; z++) {
phases[z] = 0.0;
}
}
// Multiple signals
NSEnumerator * enumerator = [tones objectEnumerator];
id frequency;
UInt32 c = …Run Code Online (Sandbox Code Playgroud) audio signal-processing objective-c core-audio accelerate-framework
我正在研究Novocaine的DSP类(obj-c ++),但我的滤波器似乎只会对信号造成噪声/失真.
我在这里发布了我的完整代码和系数:https://gist.github.com/2702844 但它基本上归结为:
// Deinterleaving...
// DSP'ing one channel:
NVDSP *handleDSP = [[NVDSP alloc] init];
[handleDSP setSamplingRate:audioManager.samplingRate];
float cornerFrequency = 6000.0f;
float Q = 0.5f;
[handleDSP setHPF:cornerFrequency Q:Q];
[handleDSP applyFilter:audioData length:numFrames];
// DSP other channel in the same way
// Interleaving and sending to audio output (Novocaine block)
Run Code Online (Sandbox Code Playgroud)
请参阅要点以获取完整的代码/上下文.
系数:
2012-05-15 17:54:18.858 nvdsp[700:16703] b0: 0.472029
2012-05-15 17:54:18.859 nvdsp[700:16703] b1: -0.944059
2012-05-15 17:54:18.860 nvdsp[700:16703] b2: 0.472029
2012-05-15 17:54:18.861 nvdsp[700:16703] a1: -0.748175
2012-05-15 17:54:18.861 nvdsp[700:16703] a2: …Run Code Online (Sandbox Code Playgroud) 如何向现有 DataFrame 添加订单号列?
这是我的数据帧:
import pandas as pd
import math
frame = pd.DataFrame([[1, 4, 2], [8, 9, 2], [10, 2, 1]], columns=['a', 'b', 'c'])
def add_stats(row):
row['sum'] = sum([row['a'], row['b'], row['c']])
row['sum_sq'] = sum(math.pow(v, 2) for v in [row['a'], row['b'], row['c']])
row['max'] = max(row['a'], row['b'], row['c'])
return row
frame = frame.apply(add_stats, axis=1)
print(frame.head())
Run Code Online (Sandbox Code Playgroud)
结果数据为:
a b c sum sum_sq max
0 1 4 2 7 21 4
1 8 9 2 19 149 9
2 10 2 1 13 105 …Run Code Online (Sandbox Code Playgroud)