有人帮助我使用xamarin表格实验室相机获取此代码:
picker = DependencyService.Get<IMediaPicker> ();
task = picker.TakePhotoAsync (new CameraMediaStorageOptions {
DefaultCamera = CameraDevice.Rear,
MaxPixelDimension = 800,
});
img.BackgroundColor = Color.Gray;
Device.StartTimer (TimeSpan.FromMilliseconds (250), () => {
if (task != null) {
if (task.Status == TaskStatus.RanToCompletion) {
Device.BeginInvokeOnMainThread (async () => {
//img.Source = ImageSource.FromStream (() => task.Result.Source);
var fileAccess = Resolver.Resolve<IFileAccess> ();
string imageName = "img_user_" + User.CurrentUser().id + "_" + DateTime.Now.ToString ("yy_MM_dd_HH_mm_ss") + ".jpg";
fileName = imageName;
fileAccess.WriteStream (imageName, task.Result.Source);
fileLocation = fileAccess.FullPath(imageName);
FileStream fileStream = new FileStream(fileAccess.FullPath(imageName), …Run Code Online (Sandbox Code Playgroud) 多次尝试正确编译,但显然我做错了.
我有OpenCV和OpenCVSharp的最新SVN签出.我使用CMake为OpenCV构建我的解决方案(使用x64 Visual Studio 2010配置),然后在Visual C++ Express 2010中编译它.
之后我再次使用Cmake为OpenCVSharp构建一个版本,但是我得到一个错误,说我弄乱了OpenCV dll.
另外,当我第一次在VC++中打开OpenCV时,我收到一条警告,说它不支持解决方案文件夹.不确定这是否有所不同.
编译环境: Windows 7 x64
Cmake(OpenCV构建日志)
Found Windows SDK v7.1: C:\Program Files\Microsoft SDKs\Windows\v7.1\
Could NOT find Qt4 (missing: QT_QMAKE_EXECUTABLE QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE QT_UIC_EXECUTABLE QT_INCLUDE_DIR QT_LIBRARY_DIR QT_QTCORE_LIBRARY)
CUDA_TOOLKIT_ROOT_DIR not found or specified
Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) (Required is at least version "4.1")
Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (Required is at least version "2.0")
General configuration for OpenCV 2.4.9 =====================================
Platform:
Host: Windows 6.1 x86
CMake: 2.8.8 …Run Code Online (Sandbox Code Playgroud) 我有一个用Spring构建的简单HATEOAS提供程序,它为我提供以下资源:
{
"_links" : {
"self" : {
"href" : "http://localhost:8080/employees{?page,size,sort}",
"templated" : true
},
"search" : {
"href" : "http://localhost:8080/employees/search"
}
},
"_embedded" : {
"employees" : [ {
"id" : "5400d5152f5243f1988c649b",
"name" : "Some Employee",
"location" : [ 0.0, 0.0 ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/employees/5400d5152f5243f1988c649b"
}
}
}, {
"id" : "5400d5162f5243f1988c649c",
"name" : "Some Employee",
"location" : [ 0.0, 0.0 ],
"_links" : {
"self" : {
"href" …Run Code Online (Sandbox Code Playgroud) 我的 HTML 文档头中导入了一个 JavaScript 库。如何从该库访问对象?
谢谢。
很难弄清楚我做错了什么。遗憾的是我曾经让它工作过,但无法确定我改变了什么破坏了它。
据我了解,现在应该完全支持。
有问题的对象:
@Document
public class Place {
public final static String URI = "/place";
@Id private String id;
private String name;
private String caption;
private GeoJsonPoint location;
public Place() {}
public Place(GeoJsonPoint geoJsonPoint) {
this.location = geoJsonPoint;
}
// Proper getters & setters clipped.
}
Run Code Online (Sandbox Code Playgroud)
调用(出于某种原因,我的 Spring Boot 版本包含额外的 x/y 坐标。)
{
"id": null,
"name": null,
"caption": null,
"location": {
"x": 41.988161,
"y": -87.6911499,
"type": "Point",
"coordinates": [
41.988161,
-87.6911499
]
}
}
Run Code Online (Sandbox Code Playgroud)
Pom(也许我有错误/冲突的依赖关系?)
<?xml version="1.0" encoding="UTF-8"?> …Run Code Online (Sandbox Code Playgroud) geojson spring-data-rest spring-data-mongodb spring-data-commons
我有一个非常简单的控制器,可以发出HTTP请求并以HATEOAS格式接收一些资源。
package com.provider.spring.controller;
import java.util.List;
import org.springframework.hateoas.Link;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.client.RestTemplate;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.provider.employee.EmployeeDTO;
import com.provider.http.HttpComponentsClientHttpRequestFactoryBasicAuth;
import com.provider.spring.rest.Resource;
@Controller
public class EmployeeController {
private static final String REL_SELF = "self";
private static final String REL_SEARCH = "search";
private static final String REL_EMPLOYEE = "employee";
private static final String RESOURCE_URI = "http://localhost:8080/employees";
private RestTemplate restTemplate = new RestTemplate(new HttpComponentsClientHttpRequestFactoryBasicAuth("user", "password"));
private List<EmployeeDTO> employees;
@RequestMapping("/employees")
public String getAllEmployees() {
String result = null;
try {
String resultBody = restTemplate.getForObject(RESOURCE_URI, …Run Code Online (Sandbox Code Playgroud) 我的控制器似乎无法找到像"linkTo"这样的HATEOAS方法.
我错过了什么吗?
的pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework</groupId>
<artifactId>provider</artifactId>
<version>0.1.0</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.1.5.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- Spring Security -->
<!-- Auto configured, remove dependencies to disable. -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
</dependency>
<!-- OAuth 2.0 -->
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
<version>2.0.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test-mvc</artifactId>
<version>1.0.0.M2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<!-- Spring MongoDB -->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb</artifactId>
</dependency>
<!-- Spring REST MVC …Run Code Online (Sandbox Code Playgroud) hateoas ×2
spring ×2
dart ×1
dart2js ×1
geojson ×1
jackson ×1
javascript ×1
opencv ×1
spring-boot ×1
spring-mvc ×1