我正在尝试使用TypeDoc生成doc文件.当我使用follwing命令运行TypeDoc时:
/node_modules/.bin/typedoc --module system --target ES5 --exclude *.spec.ts* --experimentalDecorators --out typedoc app/ --ignoreCompilerErrors
Run Code Online (Sandbox Code Playgroud)
它给出了输出:
Using TypeScript 1.6.2 from /development/node_modules/typedoc/node_modules/typescript/lib
Error: /development/app/angular2/app.ts(1)
Cannot find module 'angular2/core'.
Error: /development/app/angular2/app.ts(2)
Cannot find module 'angular2/upgrade'.
Error: /development/app/angular2/app.ts(3)
Cannot find module 'angular2/platform/browser'.
Error: /development/app/angular2/app.ts(5)
Run Code Online (Sandbox Code Playgroud)
tsconfig.json
{
"compilerOptions": {
"target": "ES5",
"module": "system",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false
},
"exclude": [
"node_modules"
]
}
Run Code Online (Sandbox Code Playgroud)
我在这里缺少一些参数来包含libs或.d.ts.文件吗?
我正在尝试使用带有Three.js的Blender创建的模型.模型非常基本,两个立方体彼此叠加.一个立方体是红色,另一个是绿色.
我使用Three.js的Blender导出器插件导出模型当我手动将材质分配给对象时:
loader.load("model.js", function ( geometry, material ) {
material = new THREE.MeshBasicMaterial( { color: 0xFF0000 } );
mesh = new THREE.Mesh( geometry, material);
scene.add(mesh);
animate();
});
Run Code Online (Sandbox Code Playgroud)
没有问题,如https://googledrive.com/host/0B9t0vRo6sUnzWndDTGxicENIdDg/index.html所示
但是,当我删除该行:
material = new THREE.MeshBasicMaterial( { color: 0xFF0000 } );
Run Code Online (Sandbox Code Playgroud)
使用模型的材料.这会产生Three.js的错误:
TypeError:程序未定义[打破此错误]
p_uniforms = program.uniforms,
你可以在https://googledrive.com/host/0B9t0vRo6sUnzWndDTGxicENIdDg/index2.html上看到这个.
有谁知道什么可能导致这个问题?您可以在https://googledrive.com/host/0B9t0vRo6sUnzWndDTGxicENIdDg/model.blend下载Blender文件
我用以下方法构建了我的 Ionic 项目:
ionic build --prod --source-map
然后我上传了源地图:
npx sentry-cli releases files my-app-1.1.0 upload-sourcemaps ../sentry-source-code-1.1.0 --url-prefix 'http://localhost'
(sentry-source-code-1.1.0 文件夹包含 .map 和 .js 文件)
这似乎是有道理的,但不幸的是 Ionic / Capacitor 应用程序总是从中加载,localhost因为它是一个 Webview 容器。
上传--url-prefix 'http://localhost没有改变任何东西
我如何告诉哨兵查找localhost工件中的文件和源映射?
我试图让 Android 深度链接仅适用于特定的网址,例如:
所以http://books.com/about不断链接到该网页
这会在我的AndroidManifest.xml作品中进行配置并在我的应用程序中打开正确的页面。问题是这与 books.com 上的每一页都匹配
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="@string/custom_url_scheme" />
<data android:scheme="https" android:host="books.com" />
</intent-filter>
Run Code Online (Sandbox Code Playgroud)
当我将数据部分更改为:
<data android:scheme="https" android:host="books.com" android:path="/book/nice-book-1" />
Run Code Online (Sandbox Code Playgroud)
或者
<data android:scheme="https" android:host="books.com" android:pathPrefix="/book" />
Run Code Online (Sandbox Code Playgroud)
或者
<data android:scheme="https" android:host="books.com" android:pathPattern="/book/..*" />
Run Code Online (Sandbox Code Playgroud)
仅匹配/book后跟一个 slug,它不起作用。
我已经在 Stackoverflow 上发现了许多类似的问题,但它们要么相当过时,要么无法处理 url 与 slugs 一起使用的情况。
当仅将几个 url 与 slugs 匹配时,是否有人遇到过相同的问题?
我有以下代码:
onLogin(): void {
this.message = "loading";
this.api.login("username", "password")
.subscribe(
this._processData,
this._logError,
//error => { this._logError(error); },
);
}
private _logError(data) {
console.log(data);
this.errorMessage = data.message;
};
Run Code Online (Sandbox Code Playgroud)
当我取消注释该行//error ->并注释上面的行时,一切正常.
如果有直接调用解决方案我直接给出函数会很好.
有什么想法吗?
我正在关注Django Rest Framework - Tutorial 3基于类的视图的教程.
如何将url字段(指向当前代码段)添加到序列化程序?
serializers.py
from rest_framework import serializers
from snippets.models import Snippet, LANGUAGE_CHOICES, STYLE_CHOICES
from django.core.urlresolvers import reverse
class SnippetSerializer(serializers.ModelSerializer):
class Meta:
model = Snippet
fields = ('id', 'title', 'code', 'linenos', 'language', 'style')
Run Code Online (Sandbox Code Playgroud)
urls.py
urlpatterns = [
url(r'^snippets/$', views.SnippetList.as_view()),
url(r'^snippets/(?P<pk>[0-9]+)/$', views.SnippetDetail.as_view()),
]
Run Code Online (Sandbox Code Playgroud)
实际输出
[
{
"id":1,
"title":"",
"code":"foo = \"bar\"\n",
"linenos":false,
"language":"python",
"style":"friendly"
}
]
Run Code Online (Sandbox Code Playgroud)
期望的输出
[
{
"id":1,
"url":"http://192.168.28.131:8000/snippets/1/",
"title":"",
"code":"foo = \"bar\"\n",
"linenos":false,
"language":"python",
"style":"friendly"
},
]
Run Code Online (Sandbox Code Playgroud) 我正在使用http://raphaeljs.com/的Raphael库并在图表库上工作.对于此库,当Y轴反转时非常有用.现在0,0位于左上角,但我希望它位于左下角.
有可能将一个比例矩阵应用于一个元素,但我想要为我绘制的任何内容反转坐标.有线索吗?
我有一个网站,显示三列图像.这些都是img已column-count: 3应用的div 中的所有标签.
这些列包含一百多个图像,我想延迟加载以节省带宽.
有许多Javascript插件可用,如http://www.appelsiini.net/projects/lazyload,在不使用时效果很好column-count.这些插件计算图像的顶部偏移量并确定图像是否可见.
随着column-count然而,这些插件无法lazyload图像.这可能是由于列的流量变化然后加载图像引起的.
有谁知道如何解决这个问题?我创建了一个小提琴,显示了使用的HTML和CSS:http://jsfiddle.net/LCbTc/2/
在经过Jest测试的项目中,我有*.entity.ts文件。我不希望这些文件包含在覆盖测试中。
根据在文档https://facebook.github.io/jest/docs/en/configuration.html#coveragepathignorepatterns-array-string有一个coveragePathIgnorePatterns,你可以在使用设置package.json
我已经尝试过正则表达式和文件模式,但是这些都不会忽略*.entity.ts最终报告中的文件。
例如,当我添加时,"coveragePathIgnorePatterns": ["common"]我的测试将不再运行。
关于如何使Jest跳过*.entity.ts覆盖测试的任何想法?
package.json中的“我的笑话”部分如下所示:
{
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "src",
"testRegex": ".spec.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"coverageDirectory": "../coverage"
}
Run Code Online (Sandbox Code Playgroud) 在"file1.dat"我写的文件中"anahasapples".
然后我写了这个程序:
#include <stdio.h>
#include <conio.h>
int main()
{
FILE *ptr_file;
ptr_file=fopen("file1.dat","r+");
printf("%c",fgetc(ptr_file));
printf("%c",fgetc(ptr_file));
printf("%c\n",fgetc(ptr_file));
char c;
printf("char:\n");
c=getch();
fputc(c,ptr_file);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我从文件打印前3个字符的部分工作.之后,我想在文件中加入一个字符.
当我编译它时,我没有得到任何错误,但包含文本不会改变.