我正在使用IBM Bluemix为学校项目制作Web服务.
我的项目需要从API请求JSON,因此我可以使用它提供的数据.我使用该http get方法的数据集,我不知道它是否正常工作.
当我运行我的代码时,我收到消息:
错误:不支持协议"https:".预计"http:"
是什么导致它,我该如何解决?
这是我的.js档案:
// Hello.
//
// This is JSHint, a tool that helps to detect errors and potential
// problems in your JavaScript code.
//
// To start, simply enter some JavaScript anywhere on this page. Your
// report will appear on the right side.
//
// Additionally, you can toggle specific options in the Configure
// menu.
function main() {
return 'Hello, World!';
}
main();/*eslint-env node*/
//------------------------------------------------------------------------------
// node.js …Run Code Online (Sandbox Code Playgroud) 寻求将JSON API调用集成到Python程序中的一些帮助.
我希望将以下API集成到Python .py程序中,以允许它被调用并打印响应.
API指南规定必须生成承载令牌以允许调用API,这是我成功完成的.但是,我不确定在Python API请求中将此令牌包含为承载令牌身份验证的语法.
我可以使用包含令牌的cURL成功完成上述请求.我试过"urllib"和"请求"路线但无济于事.
完整的API详细信息:IBM X-Force Exchange API文档 - IP信誉
使用Apache Kafka Java客户端(0.9),我正在尝试使用Kafka Producer类向代理发送一长串记录.
异步发送方法立即返回一段时间,然后在短时间内开始阻塞每次调用.大约三十秒后,客户端开始抛出异常(TimeoutException),并显示消息"Batch expired".
什么情况导致抛出此异常?
我已经下载并安装了Cloud Foundry CLI工具"cf".但是,我无法登录,因为我无法设置API端点.
我应该提供什么API端点?我在哪里可以找到相关信息?
我目前正在研究一个nodejs Web应用程序我在使用云代工厂在线推送应用程序时遇到了麻烦.我对错误做了一些研究,似乎可能有一些安装包有一些冲突.
这是package.json文件.
{
"dependencies": {
"c3": "^0.4.12",
"cfenv": "1.0.0",
"cloudant": "^1.8.0",
"dygraphs": "^2.0.0",
"express": "4.5.1",
"getmac": "1.0.6",
"http": "0.0.0",
"mqtt": "1.0.5",
"properties": "1.2.1",
"save": "^2.3.0",
"sockjs": "0.3.9",
"websocket-multiplex": "0.1.x"
},
"description": "description.",
"license": "UNLICENSED",
"main": "app.js",
"repository": {
"type": "git",
"url": "<gitUrl>"
}
}
Run Code Online (Sandbox Code Playgroud)
这是我尝试通过云代工推送应用程序时遇到的错误.在删除node_modules文件夹的所有内容后,我在安装npm时发生类似的错误.
../src/bufferutil.cc:32:50: error: call of overloaded 'NODE_SET_METHOD(v8::Local<v8::FunctionTemplate>&, const char [6], void (&)(const v8::FunctionCallbackInfo<v8::Value>&))' is ambiguous
NODE_SET_METHOD(t, "merge", BufferUtil::Merge);
../src/bufferutil.cc:32:50: note: candidates are:
In file included from ../src/bufferutil.cc:8:0:
/root/.node-gyp/8.0.0/include/node/node.h:257:13: note: void node::NODE_SET_METHOD(v8::Local<v8::Template>, const char*, …Run Code Online (Sandbox Code Playgroud) 我正在尝试将以下项目从IBM developerWorks部署到Bluemix:
使用Watson和Cloudant在IBM Bluemix上构建Java EE应用程序
通过Eclipse中的Bluemix插件(称为:IBM Eclipse Tools for Bluemix).但是我一直收到以下错误
项目方面不支持Cloud Foundry Standalone Application 1.0版
使用版本:
通过Cloud Foundry CLI执行此操作时没有问题 cf push
这很奇怪.它也有点长,所以提前道歉. 更新 - 它最终成为2个问题,请参阅下面的答案.
这是我的错误: EXCEPTION: this.svg.selectAll(...).data(...).enter is not a function
我有一个angular-cli客户端和一个节点api服务器.我可以使用observable从服务中检索states.json文件(下面的代码).d3喜欢该文件并显示预期的美国地图.
当我将api服务器中的服务目标从文件更改为bluemix-cloudant服务器时,我在客户端收到上述错误.
当我使用ngOnInit在一个变体中使用console.log输出时,最初mapData打印为一个空数组,并抛出错误.这是错误的明显来源,因为没有数据,但Chrome调试器显示待处理的请求.请求完成后,数据将按预期在控制台中打印.
map.component.ts:
import { Component, ElementRef, Input } from '@angular/core';
import * as D3 from 'd3';
import '../rxjs-operators';
import { MapService } from '../map.service';
@Component({
selector: 'map-component',
templateUrl: './map.component.html',
styleUrls: ['./map.component.css']
})
export class MapComponent {
errorMessage: string;
height;
host;
htmlElement: HTMLElement;
mapData;
margin;
projection;
path;
svg;
width;
constructor (private _element: ElementRef, private _mapService: MapService) {
this.host = D3.select(this._element.nativeElement); …Run Code Online (Sandbox Code Playgroud) 我正在使用在Bluemix上运行Flask的Python应用程序.我知道如何使用swiftclient模块的对象存储来创建容器并在其中保存文件,但是如何转储其中包含的joblib或pickle文件?如何在我的Python程序中加载它?
这是存储简单文本文件的代码.
import swiftclient
app = Flask(__name__)
CORS(app)
cloudant_service = json.loads(os.environ['VCAP_SERVICES'])['Object-Storage'][0]
objectstorage_creds = cloudant_service['credentials']
if objectstorage_creds:
auth_url = objectstorage_creds['auth_url'] + '/v3' #authorization URL
password = objectstorage_creds['password'] #password
project_id = objectstorage_creds['projectId'] #project id
user_id = objectstorage_creds['userId'] #user id
region_name = objectstorage_creds['region'] #region name
def predict_joblib():
print('satart')
conn = swiftclient.Connection(key=password,authurl=auth_url,auth_version='3',os_options={"project_id": project_id,"user_id": user_id,"region_name": region_name})
container_name = 'new-container'
# File name for testing
file_name = 'requirment.txt'
# Create a new container
conn.put_container(container_name)
print ("nContainer %s created successfully." % container_name)
# List your containers
print …Run Code Online (Sandbox Code Playgroud) 我正在与IBM Bluemix合作,因此我创建了一个基本的ASP.net 5 Web应用程序,作为bluemix中的启动项目提供.在不同的其他文件中有一个名为dotnetstarter.xproj的项目文件.我能够在Visual Studio 2012中打开解决方案文件,但该解决方案无法理解具有扩展名.xproj的"项目".任何人都可以帮助我理解这类项目,如何在Visual Studio 2012中打开它?
我已经在SO中阅读了以下链接,但它没有帮助.
我在Bluemix中都看到了这些,但它们之间有什么区别?