我gdx-setup.jar已从网站下载,我将其运行为:
java -jar gdx-setup.jar
我选择了我想要的选项并为idea(libgdx 1.6.2)生成项目.当我点击生成按钮时,该工具不会给我任何错误.
当我运行时,idea 14.1.3我转到文件>打开...并选择生成的ipr文件.
当我尝试运行桌面启动器时,idea抛出下一个错误:
Error:Android Pre Dex: [android] Android SDK is not specified
我尝试过使用不同的构建工具和android的API(当我按下生成按钮时,大多数都会向我发出警告gdx-setup.jar).我正在使用构建工具20.0.0和API 20,并且使用此配置gdx-setup.jar不会向我发出警告.
我检查一般项目的local.properties:
sdk.dir=/home/XXXX/Escritorio/android-sdk-linux-libgdx/
我检查文件>项目结构...> SDK的> Android SDK,它也是对的:
/home/XXXX/Escritorio/android-sdk-linux-libgdx
有什么建议?
谢谢.
我想从屏幕坐标转换为世界坐标OpenGL.我正在glm为此目的使用(我也在使用glfw)
这是我的代码:
static void mouse_callback(GLFWwindow* window, int button, int action, int mods)
{
if (button == GLFW_MOUSE_BUTTON_LEFT) {
if(GLFW_PRESS == action){
int height = 768, width =1024;
double xpos,ypos,zpos;
glfwGetCursorPos(window, &xpos, &ypos);
glReadPixels(xpos, ypos, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &zpos);
glm::mat4 m_projection = glm::perspective(glm::radians(45.0f), (float)(1024/768), 0.1f, 1000.0f);
glm::vec3 win(xpos,height - ypos, zpos);
glm::vec4 viewport(0.0f,0.0f,(float)width, (float)height);
glm::vec3 world = glm::unProject(win, mesh.getView() * mesh.getTransform(),m_projection,viewport);
std::cout << "screen " << xpos << " " << ypos << " …Run Code Online (Sandbox Code Playgroud) 在我的应用程序中,我需要配对蓝牙设备并立即与它连接.
我有以下功能,以配对设备:
public boolean createBond(BluetoothDevice btDevice)
{
try {
Log.d("pairDevice()", "Start Pairing...");
Method m = btDevice.getClass().getMethod("createBond", (Class[]) null);
Boolean returnValue = (Boolean) m.invoke(btDevice, (Object[]) null);
Log.d("pairDevice()", "Pairing finished.");
return returnValue;
} catch (Exception e) {
Log.e("pairDevice()", e.getMessage());
}
return false;
}
Run Code Online (Sandbox Code Playgroud)
我用它如下:
Boolean isBonded = false;
try {
isBonded = createBond(bdDevice);
if(isBonded)
{
//Connect with device
}
}
Run Code Online (Sandbox Code Playgroud)
它显示了配对设备和输入引脚的对话框.
问题是createBond函数总是返回true,它一直等到我输入引脚并与设备配对,所以我没有正确使用:
isBonded = createBond(bdDevice);
if(isBonded) {...}
Run Code Online (Sandbox Code Playgroud)
所以问题是我如何与设备配对以及何时配对连接?
PD我的代码基于以下线程的第一个答案:Android +配对设备通过蓝牙编程
我在翻译 Laravel 消息时遇到问题。我创建了一个名为esinsidelang文件夹的文件夹,并将消息从英语翻译成西班牙语。我也已经开始'locale' => 'es'了config/app.php。但英文信息继续出现。
我使用了 laravel 提供的默认登录视图来生成它(和路由)我使用了命令(如https://laravel.com/docs/5.2/authentication 中所述)
php artisan make:auth
我通过以下方式更改了默认路由:
Route::get('/login', 'UserController@getLogin');
Route::post('/login', 'UserController@postLogin');
Run Code Online (Sandbox Code Playgroud)
在 UserController 中,我有:
public function getLogin(){
return view('auth.login');
}
public function postLogin(Request $request){
$input = $request->all();
if (Auth::attempt(['email' => $input["email"], 'password' => $input["password"]], true))
{
return redirect()->intended('/tables');
}
}
Run Code Online (Sandbox Code Playgroud)
这是英文显示的消息的两个屏幕截图
http://i64.tinypic.com/if4k83.png
http://i64.tinypic.com/51zhnp.png
如何转换这些消息?
谢谢
编辑:
resources/lang/en/validation.php
<?php
return [
/*
|--------------------------------------------------------------------------
| Validation Language Lines
|--------------------------------------------------------------------------
|
| The following language lines contain …Run Code Online (Sandbox Code Playgroud) 在 mongoDB 中,有一个名为 geoNear 的命令,它返回到数据库中地理空间点存储的距离。另外,当我在 mongoDB 中使用 find 函数时,我可以使用近过滤器返回 DB 中 maxDistance 范围内的寄存器,例如:
db.collection.find( { localizacion:{ $near: { $geometry: { type: "Point", 坐标: [lng, lat]}}, $maxDistance: 1000}}).
该语句返回 DB 中距 [lng, lat] 1000 米的寄存器。
那么,MySQL中有类似的吗?
感谢您。
我正在从头开始开发 3D 引擎,并尝试取消投影矢量。我使用我自己的数学库,称为ALMath.js. 据我所知,要将 2d 屏幕坐标转换为 3d 世界坐标,我需要将画布中 x 和 y 坐标形成的向量乘以 ViewProjection 矩阵的逆。这是取消项目的代码:
unproject : function (vector){
var viewMatrix = camera.viewMatrix;
var projectionMatrix = camera.projectionMatrix;
var viewProjection = viewMatrix.multiply(projectionMatrix);
var inverseViewProjection = viewProjection.getInverse();
var x = ((vector.x -0) / (AL3D.width)) *2 -1;
var y = ((vector.y -0) / (AL3D.height)) * 2 -1;
var z = 2*vector.z-1;
var w = 1;
var vec4 = new ALMath.Vector4(x,y,z,w);
var transformedVector = inverseViewProjection.multiplyByVector4(vec4);
var wordCoords = new ALMath.Vector3(transformedVector.x/transformedVector.w,transformedVector.y/transformedVector.w,transformedVector.z/transformedVector.w);
return wordCoords;
} …Run Code Online (Sandbox Code Playgroud) 我对C#中的BackgroundWorker性能有一个奇怪的问题.我有一个应用程序,除其他外,使用BackgroundWorker来执行某些任务.Basicaly的任务如下:
public void simulate(Image imgSimulator)
{
simulador = new Simulator(imgSimulator);
simulador.setBackground(0);
Constants.finishSimulation = false;
BackgroundWorker bw = new BackgroundWorker();
bw.DoWork += run;
bw.RunWorkerAsync(imgSimulator);
}
public void run(object sender, DoWorkEventArgs e)
{
Image imgSimulator = (Image)e.Argument;
bool clear;
foreach (Program p in programs)
{
Resource r = p.getResource(0);
clear = true;
if (r is Text)
{
Text t = (Text)r;
clear = t.getClearPrev() == 1;
}
if (!clear)
{
simulador.setBackground(FontBitmap.COLOR_BLACK);
}
p.execute(simulador, imgSimulator);
if (Constants.finishSimulation)
{
break;
}
}
}
Run Code Online (Sandbox Code Playgroud)
上面代码中的主要函数是execute: …
我有一个由openssl以下列方式生成的密钥对
openssl genrsa -out private_key.pem 2048
我把它转换成DER格式如下
openssl pkcs8 -topk8 -inform PEM -outform DER -in private_key.pem\-out private_key.der -nocrypt
现在我想在android中导入它,但我不想导入它,因为我想在密钥库中保护它.
所以我的问题是如何使用keytool将现有密钥导入BKS密钥库?
谢谢