我正在使用这样的回调调用函数:
$(function() {
//get all the items
search.init('.result tbody tr');
search.parseresults(function(announcementID){
//query every single page
var myCompany = new company(announcementID);
myCompany.requestPage(function(){
//on response parse the data.
myCompany.parsedata()
var myPerson = new person(myCompany )
myPerson.getPhone(function(){
console.log('test')
});
})
});
});
Run Code Online (Sandbox Code Playgroud)
这是使用console.log('test')的最后一个回调问题.
这是getPhone函数:
person.prototype.getPhone = function(callback){
this.attempt++
if( this.attempt === 1){
var who = this.lastname;
var where = this.adress+' '+this.postal;
}else if(this.attempt === 2){
var who = this.firstname+' '+this.lastname;
var where = this.adress+' '+this.postal;
}else{
var who = this.firstname+' '+this.lastname;
var where …Run Code Online (Sandbox Code Playgroud) 如果我正在调用此函数,则始终"未定义html2canvas".
makeScreenshot: function(button)
{
debugger;
html2canvas(document.body, {
Uncaught ReferenceError: html2canvas is not defined
onrendered: function(canvas) {
document.body.appendChild(canvas);
}
});
},
Run Code Online (Sandbox Code Playgroud)
但为什么?我有一类它...就像在教程中写的那样.有没有人有办法解决吗?
我想我需要在这里包含html2canvas,但我不知道如何.
Ext.define("TEST.controller.Desktop", {
extend: "Ext.app.Controller",
views: [
"desktop.Desktop",
//"desktop.TaskBar",
"desktop.Toolbar",
"desktop.DataprovidersDataView",
"configuration.UploadFileWindow"
],
refs: [{
ref: "viewport",
selector: "viewport"
}, {
Run Code Online (Sandbox Code Playgroud) 是否可以使用CSS裁剪图像,使其具有圆形边框?


我如何在CSS中执行此操作?
我无法从Nuget包管理器中解决此错误.
我尝试过卸载T4 Scaffolding并重新安装.我在Visual Studio 2012中使用3个更新开发了此程序,现在已将程序迁移到VS Express 2013该程序在2012版本中没有错误.我搜索了互联网,Nuget和这个网站,但我无法解决这个问题.我应该提到我在包装中有MvcMailer,它似乎依赖于T4脚手架.答案将不胜感激.
Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At E:\Visual Studio
2012\Projects\ArtsProject\packages\T4Scaffolding.Core.1.0.0\tools\init.ps1:50
char:9
+ Set-DefaultScaffolder -Name CustomTemplate -Scaffolder
T4Scaffolding.Cus ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
+ CategoryInfo : NotSpecified: (:) [Set-DefaultScaffolder], Inval
idOperationException
+ FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet
Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At E:\Visual Studio
2012\Projects\ArtsProject\packages\T4Scaffolding.Core.1.0.0\tools\init.ps1:51
char:9
+ Set-DefaultScaffolder -Name CustomScaffolder -Scaffolder
T4Scaffolding.C ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
+ CategoryInfo : NotSpecified: (:) [Set-DefaultScaffolder], Inval
idOperationException
+ FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet
Set-DefaultScaffolder : Cannot …Run Code Online (Sandbox Code Playgroud) 如果类在这样的文件中,则看起来不会发生严格错误:
abstract class Food{}
class Meat extends Food{}
abstract class Animal{
function feed(Food $food){ }
}
class Cat extends Animal{
function feed(Meat $meat){
parent::feed($meat);
}
}
Run Code Online (Sandbox Code Playgroud)
但是如果你把类定义放在单独的文件中并包含它们:
abstract class Food{}
class Meat extends Food{}
require 'Animal.php';
require 'Cat.php';
Run Code Online (Sandbox Code Playgroud)
抛出严格的标准错误消息:
严格标准:声明
Cat::feed()应与Animal::feed(Food $food)c:\ path\to\Cat.php在线兼容......
如果all都在一个文件中,即使这样也可以:
class Dog extends Animal{
function feed($qty = 1){
for($i = 0; $i < $qty; $i++){
$Meat = new Meat();
parent::feed($Meat);
}
}
}
Run Code Online (Sandbox Code Playgroud)
这是预期的行为吗?
因为Meat是a Food,首先不应该有抱怨,对吧?因此解决方案简单明了:将所有内容放在一个文件中并满足严格的标准;)
任何提示赞赏
我正在为开发服务器生成一个自签名证书,但我需要它才能被信任才能使用一些将使用该证书的工具.
这是我尝试过的:
openssl req -newkey rsa:2048 -x509 -nodes -keyout /etc/ssl/private/server.key -new -out /etc/ssl/certs/server.crt -reqexts v3_req -extensions v3_req -config /vagrant/openssl.san.conf -sha256 -days 1825
ln --symbolic /etc/ssl/certs/server.crt /etc/pki/ca-trust/source/anchors/server.crt
update-ca-trust extract
Run Code Online (Sandbox Code Playgroud)
在尝试运行update-ca-trust命令之后,我尝试使用grepping ca-bundle.crt文件获取内容,server.crt但它不在那里.
我也尝试过复制文件而不是制作符号链接,但这也不起作用.
证书是正确创建的,适用于Apache,但它会产生自签名错误:
Run Code Online (Sandbox Code Playgroud)[vagrant@localhost certs]$ curl --head https://localhost/ curl: (60) Issuer certificate is invalid. More details here: http://curl.haxx.se/docs/sslcerts.html
如何在服务器的命令行上信任我的自签名证书?
如何在 e-charts / ngx-echarts 库中的条形图顶部设置值?让我知道是否存在相同的属性,我无法找到任何属性?
我想要的结果:
到目前为止我能够实现的结果:
组件:-
import {Component, Input, OnInit} from '@angular/core';
declare var echarts: any;
@Component({
selector:'app-bar-chart',
templateUrl:'./bar-chart.component.html',
styleUrls:['./bar-chart.component.css'],
})
export class BarChartComponent implements OnInit{
public barChartData;
ngOnInit() {
let dataAxis = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K','L'];
let data = [200, 180, 190, 233, 219, 203, 110, 250, 160, 130, 120, 263];
this.barChartData ={
xAxis: {
data: dataAxis,
axisLabel: {
textStyle: {
color: 'black'
}
},
axisTick: {
show:true
},
axisLine: …Run Code Online (Sandbox Code Playgroud) 我正在为iPhone制作音乐播放器,我希望用户能够将歌曲发布到他们的时间轴上.我有Facebook Connect工作,我已经注册了Open Graph对象和Facebook的动作,但我无法弄清楚如何从iOS创建/发布对象和动作.
Facebook给了我以下代码,但我不知道在哪里使用它的iOS SDK.
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# MYAPPNAME: http://ogp.me/ns/fb/MYAPPNAME#">
<meta property="fb:app_id" content="xxxxxxxxxxxxxxx" />
<meta property="og:type" content="MYAPPNAME:song" />
<meta property="og:url" content="Put Your Own URL Here" />
<meta property="og:title" content="Some Arbitrary String" />
<meta property="og:description" content="Some Arbitrary String" />
<meta property="og:image" content="http://ogp.me/logo.png" />
Run Code Online (Sandbox Code Playgroud) 在Rails 3中,如果我想点击db,我会在查询结束时使用.all.这对于我在写入时刷新缓存(因此读取总是命中缓存)这一点非常有用.
现在在Rails 4中,Model.all返回一个ActiveRecord::Relation对象(即没有命中db).让它真正进入数据库并返回指定记录的最佳方法是什么?