我得到了傅立叶变换的频谱。它看起来像这样:

警察刚从附近经过
颜色代表强度。
X 轴是时间。
Y 轴是频率 - 其中 0 位于顶部。
虽然吹口哨或警笛只留下一点痕迹,但许多其他音调似乎包含很多谐波频率。
电吉他直接插入麦克风(标准调音)
真正糟糕的是,正如你所看到的,没有主要的强度——有 2-3 个频率几乎相等。
我编写了一个峰值检测算法来突出显示最重要的峰值:
function findPeaks(data, look_range, minimal_val) {
if(look_range==null)
look_range = 10;
if(minimal_val == null)
minimal_val = 20;
//Array of peaks
var peaks = [];
//Currently the max value (that might or might not end up in peaks array)
var max_value = 0;
var max_value_pos = 0;
//How many values did we check without changing the max value
var smaller_values = 0;
//Tmp variable for performance …Run Code Online (Sandbox Code Playgroud) 我正在尝试发送一个来自包含null值的对象的请求:
ajax_post("path", {name: "Name", status: null}, callback);
Run Code Online (Sandbox Code Playgroud)
我有自己的URL编码对象的方法.null是一个javascript类型object,所以它最终在这里:
for(var i in data) {
...
if(typeof data[i]=="object") {
if(data[i]==null) {
//HOW TO ENCODE THE NULL VALUE?
}
else
...
}
else
...
}
Run Code Online (Sandbox Code Playgroud)
生成$_POST的服务器端应包含以下内容:
array(
name => "Name",
status => NULL
)
Run Code Online (Sandbox Code Playgroud)
这是可能的,或者我将不得不转换"NULL"到NULL手动服务器端?
所以我试图理解Google Chrome 中的pasteAPI copy。我也不明白。
从复制开始,您可能需要使用 javascript在剪贴板中添加一些内容。我正在处理图像(实际上字符串效果很好1):
//Get DataTransferItemList
var files = items.items;
if(files) {
console.log(files);
//Create blob from canvas
var blob = Blob.fromDataURL(_this.editor.selection.getSelectedImage().toDataURL("image/png"));
var file;
try {
//Try to create file from blob, which may fail
file = new File([blob], "image.png", {type:"image/png"});
}
catch(e) {
return false;
}
if(file) {
//I think this should clear previous data from clipboard
files.clear();
//Add a file as image/png
files.add(file, "image/png");
}
//console.log(files.add(file));
}
Run Code Online (Sandbox Code Playgroud)
问题是,我真的不知道该add方法是如何工作的。我找到了 …
Windows 上的命令tasklist具有非常有用的功能:它可以列出dll一个进程的所有模块或所有进程。下面的命令将列出以下命令使用的所有 DLL 文件explorer.exe:
tasklist /fi "ImageName eq explorer.exe" /m
Run Code Online (Sandbox Code Playgroud)
看起来像这样(缩短,翻译成英文):
Process name PID Modules
========================= ======== ============================================
explorer.exe 1104 ntdll.dll, kernel32.dll, KERNELBASE.dll,
ADVAPI32.dll, msvcrt.dll, sechost.dll,
RPCRT4.dll, GDI32.dll, USER32.dll, LPK.dll,
USP10.dll, SHLWAPI.dll, SHELL32.dll,
ole32.dll, OLEAUT32.dll, EXPLORERFRAME.dll,
DUser.dll, DUI70.dll, IMM32.dll, MSCTF.dll,
Run Code Online (Sandbox Code Playgroud)
问题是这对于 64 位进程来说效果不太好:
C:\>tasklist /fi "ImageName eq firefox.exe" /m
Process name PID Modules
========================= ======== ============================================
firefox.exe 4980 ntdll.dll, wow64.dll, wow64win.dll,
wow64cpu.dll
Run Code Online (Sandbox Code Playgroud)
你看到的并不完整,它看起来更像是这样的:

我的问题是:我可以将任务列表作为 32 位程序启动还是以其他方式确保它将返回正确的值?我需要从另一个程序(Java)调用任务列表并获取已加载的 DLL 文件的列表。我需要这个来确保我不会尝试加载 DLL 两次。
我有一个界面:
/**
* Getter for any values within the GameObject and it's subclasses.
* Used as callback.
*
* Typical implementation would look like:
* new ValueGetter<SummonerSpell, String> {
* public String getValue(SummonerSpell source) {
* return source.toString();
* }
* }
* @param <T>
* @param <V> Type of value retrieved
*/
public static interface ValueGetter<T extends GameObject, V> {
public V getValue(T source);
}
Run Code Online (Sandbox Code Playgroud)
在一种情况下,我想使用接口GameObject本身,而不是某个子类。我想在List游戏对象中做到这一点:
/**
* Will call the given value getter for …Run Code Online (Sandbox Code Playgroud) 请注意:这个问题是关于Qt C ++框架的,而不是普通的Java API。在Java中,此问题已得到解答。
在我的应用程序的主菜单中,我真的不想担心不同类型的屏幕旋转。我想禁用屏幕旋转,直到用户转到屏幕旋转有意义的其他视图为止。对于主菜单,我只想使用纵向视图。
如何实现呢?如何控制应用程序屏幕旋转?
到处都是,同事对我在gerrit中发布的代码更改发表评论。但是要看到它们,我必须:

最好查看具有注释的代码片段列表,并按时间排序。这样,我不必在整个编辑历史记录上单击。
如何列出关于我的Gerrit更改发表的所有评论?
我有以下项目结构:
|-mainFile.js
|-scripts -
|-Library1.js
|-Library2.js
Run Code Online (Sandbox Code Playgroud)
库文件使用requirejs define([], function() {})语法。
因此,我将其放入webpack.config.js中:
module.exports = {
resolve: {
modules: [
path.resolve(__dirname, 'scripts'),
// The normal path
"node_modules"
]
},
/** ... **/
}
Run Code Online (Sandbox Code Playgroud)
然后在mainFile.jswebpack的入口点执行此操作:
require(["Library1", "Library2"], function(Library1, Library2) { ... });
Run Code Online (Sandbox Code Playgroud)
我得到这个错误:
GET http://localhost:3000/0.js [HTTP/1.1 404 Not Found 3ms]
Error: Loading chunk 0 failed.
Stack trace:
onScriptComplete@http://localhost:3000/player/webpack_build.js:100:24
webpack_build.js:146:52
The resource from “http://localhost:3000/0.js” was blocked due to MIME type mismatch (X-Content-Type-Options: nosniff).[Learn More]
test_file.html Error: Loading chunk 0 failed.
Run Code Online (Sandbox Code Playgroud)
因此,webpack尝试加载一些 …
我有一个具有属性的类:
class MyClass {
constructor() {
this.property = null;
}
}
Run Code Online (Sandbox Code Playgroud)
该属性可以是null一个Array实例。我试过这个:
/**
* @property property {Array}
*/
class MyClass ...
Run Code Online (Sandbox Code Playgroud)
这:
/**
* @property MyClass.property {Array}
*/
class MyClass ...
Run Code Online (Sandbox Code Playgroud)
和这个:
class MyClass {
/**
* @property property {Array}
*/
constructor() ...
Run Code Online (Sandbox Code Playgroud)
我仍然在智能感知中看到这一点:
那么谁能告诉我如何正确地做到这一点?
javascript javascript-intellisense visual-studio-community visual-studio-2017
Node.JS 10 添加了对加载 ES6 模块的实验性支持,这些模块已经在浏览器中运行。这意味着我们最终可以为 Node.JS 和浏览器使用完全相同的文件,而无需任何转译或 polyfill。
除了我们不能。Node.js 需要.mjs将文件作为模块加载的扩展名。我尝试使用符号链接来欺骗节点,但节点绕过了它:
D:\web\lines>node --experimental-modules ES6test.mjs
(node:7464) ExperimentalWarning: The ESM module loader is experimental.
D:\web\lines\ES6test.js:6
import myLibrary from "./MyFile.mjs";
^^^^^^^^^^^^^^^
Run Code Online (Sandbox Code Playgroud)
我想不出任何其他解决方法来完成这项工作 - 这确实使整个 ES6 模块支持变得毫无用处。
其他人能想出一些技巧让 Node.js 忽略扩展吗?
javascript ×5
node.js ×2
android ×1
audio ×1
c++ ×1
cmd ×1
dll ×1
ecmascript-6 ×1
fft ×1
generics ×1
gerrit ×1
git ×1
guitar ×1
inheritance ×1
java ×1
php ×1
qt ×1
tuner ×1
url-encoding ×1
webpack ×1