我正在将图像转换为base64字符串并将其从Android设备发送到服务器.现在,我需要将该字符串更改回图像并将其保存在数据库中.
有帮助吗?
我在Laravel 5中使用社交名流设置Facebook登录.我仔细按照说明操作,直到遇到以下错误
cURL error 60: SSL certificate problem: unable to get local issuer certificate
Run Code Online (Sandbox Code Playgroud)
所以我找到了这个答案来修复它确实通过但后来我得到了这个错误
cURL error 77: error setting certificate verify locations:
CAfile: /Applications/XAMPP/xamppfiles/cacert.pem
CApath: none
Run Code Online (Sandbox Code Playgroud)
任何想法是什么原因造成这个错误?!以及如何解决它?!
我正在尝试使用来自localhost的Laravel从Gmail发送电子邮件.我收到此错误:无法与主机smtp.gmail.com [#0]建立连接
我正在使用端口465的ssl.我也尝试过587但它没有用.
我也尝试了这个,但它没有用.我发现很多人都遇到了同样的问题,但我找到的解决方案却没有用.
我正在尝试获取django中某些对象的id,但我不断收到以下错误异常值:QuerySet; 对象没有属性ID.我在views.py中的功能
@csrf_exempt
def check_question_answered(request):
userID = request.POST['userID']
markerID = request.POST['markerID']
title=request.POST['question']
m = Marker.objects.get(id=markerID)
u = App_User.objects.get(id=userID)
print userID
print markerID
print title
# userID='1'
# markerID='1'
# title='Hello'
at = AttachedInfo.objects.filter(attachedMarker=m.id, title=title)
print 'user'
print u.id
print 'marker'
print m.id
print 'att'
print at
#print at.id
if(Answer.objects.filter(marker=m.id, user=u.id, attachedInfo=at.id)):
print 'pass'
return HttpResponse('already answered')
else:
print 'not'
return HttpResponse('not answered yet')
Run Code Online (Sandbox Code Playgroud)
错误发生在此部分的if条件中(attachedInfo = at.id).我检查过,当我从条件中删除它时,一切都运行良好.
这是models.py
class AttachedInfo(models.Model):
title = models.CharField(max_length=200)
helpText = models.CharField(max_length=200, null=True, blank=True)
type = models.CharField(max_length=200) …
Run Code Online (Sandbox Code Playgroud) 我正在尝试设置ndk在eclipse中工作.我一直收到这条消息说在路径中找不到ndk-build.我已将它添加到Environment Variables-> Path但仍然无效.
有什么帮助?!
我已经开发了一个Libgdx应用程序并在我的三星Galaxy S3(4.1.2)上进行了测试,它的工作效果非常好.我试图在Galaxy Grand(4.1.2)上测试它,但它失败了.在logcat中,我发现了以下内容:
caused by com.badlogic.gdx.utils.GdxRuntimeException couldn't load shared library 'gdx' for target: Linux, 32-bit
Run Code Online (Sandbox Code Playgroud)
这只是在更换设备时发生的,所以任何想法是什么原因?!
完整的logcat:
05-22 20:25:01.745: E/AndroidRuntime(12725): FATAL EXCEPTION: main
05-22 20:25:01.745: E/AndroidRuntime(12725): java.lang.ExceptionInInitializerError
05-22 20:25:01.745: E/AndroidRuntime(12725): at java.lang.Class.newInstanceImpl(Native Method)
05-22 20:25:01.745: E/AndroidRuntime(12725): at java.lang.Class.newInstance(Class.java:1319)
05-22 20:25:01.745: E/AndroidRuntime(12725): at android.app.Instrumentation.newActivity(Instrumentation.java:1068)
05-22 20:25:01.745: E/AndroidRuntime(12725): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2025)
05-22 20:25:01.745: E/AndroidRuntime(12725): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2135)
05-22 20:25:01.745: E/AndroidRuntime(12725): at android.app.ActivityThread.access$700(ActivityThread.java:140)
05-22 20:25:01.745: E/AndroidRuntime(12725): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237)
05-22 20:25:01.745: E/AndroidRuntime(12725): at android.os.Handler.dispatchMessage(Handler.java:99)
05-22 20:25:01.745: E/AndroidRuntime(12725): at android.os.Looper.loop(Looper.java:137)
05-22 20:25:01.745: E/AndroidRuntime(12725): at android.app.ActivityThread.main(ActivityThread.java:4935)
05-22 20:25:01.745: …
Run Code Online (Sandbox Code Playgroud) 我正在使用以下代码创建地图并为其附加标记.我还添加了一个标记监听器,我需要在拖动后获取标记位置的经度和纬度.
它的作用是返回我当前的位置而不是拖动后标记的位置.这个部分有什么帮助吗?!
package com.example.mysample;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.GoogleMap.OnMarkerDragListener;
import com.google.android.gms.maps.MapView;
import com.google.android.gms.maps.Projection;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.BitmapDescriptor;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;
import com.google.android.maps.GeoPoint;
import android.location.Location;
import android.location.LocationListener;
import android.os.Bundle;
import android.app.Activity;
import android.content.Context;
import android.support.v4.app.FragmentActivity;
import android.view.Menu;
import android.view.MotionEvent;
import android.widget.Toast;
import android.graphics.*;
public class MainActivity extends FragmentActivity implements LocationListener {
GoogleMap map;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
GooglePlayServicesUtil
.isGooglePlayServicesAvailable(getApplicationContext());
map = ((SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map)).getMap();
map.setMyLocationEnabled(true);
map.setMapType(GoogleMap.MAP_TYPE_NORMAL);
map.addMarker(new MarkerOptions()
.position(new …
Run Code Online (Sandbox Code Playgroud) 我在Java中有openCV矩阵,我想打印出它的内容.我尝试了toString()函数,如下所示:descriptor.toString()所以我可以实现这个形式
"[[1,2,3,4],[4,5,6,7],[7,8,9,10]]"
Run Code Online (Sandbox Code Playgroud)
其中每个数组是矩阵中的第i行,但我得到了以下结果.我试图删除toString但仍然是同样的问题.
Mat [ 3*4*CV_8UC1, isCont=true, isSubmat=false, nativeObj=0x5dc93a48, dataAddr=0x5d5d35f0]
Run Code Online (Sandbox Code Playgroud)
其中3是行数,4是列数.
任何帮助我如何获得矩阵内容?!
我已按照所有步骤生成.ipa file
并使用Application Loader上传它但仍然收到以下错误:
The Info.plist in the package must contain the CFBundleVersion key.
The Info.plist in the package must contain the CFBundleShortVersionString key.
Run Code Online (Sandbox Code Playgroud)
这是包含所有信息的Hello World-Info.plist文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string>icon.png</string>
<key>CFBundleIcons</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>icon-40</string>
<string>icon-small</string>
<string>icon-60</string>
<string>icon.png</string>
<string>icon@2x</string>
<string>icon-72</string>
<string>icon-72@2x</string>
</array>
<key>UIPrerenderedIcon</key>
<false/>
</dict>
</dict>
<key>CFBundleIcons~ipad</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>icon-small</string>
<string>icon-40</string>
<string>icon-50</string>
<string>icon-76</string>
<string>icon-60</string>
<string>icon</string>
<string>icon@2x</string>
<string>icon-72</string> …
Run Code Online (Sandbox Code Playgroud) 我正在尝试在服务器端保存图像.我收到它作为base64字符串,所以我先解码它然后将其保存在数据库中.但是这次失败,所以我检查了服务器错误日志,我发现以下错误.日志
[Tue May 21 14:26:38 2013] [error] [client 41.236.182.133] mod_wsgi (pid=4952): Exception occurred processing WSGI script '/root/AR_BROWSER/example/wsgi.py'.
[Tue May 21 14:26:38 2013] [error] [client 41.236.182.133] IOError: failed to write data
Run Code Online (Sandbox Code Playgroud)
我检查了wsgi.py
import os
import sys
path = '/root/AR_BROWSER/example'
sys.path.append('/root/AR_BROWSER/example')
sys.path.append('/root/AR_BROWSER')
sys.path.append('/root/AR_BROWSER/example/app')
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
Run Code Online (Sandbox Code Playgroud)
但我找不到错误.知道这个问题的原因是什么?!负责保存图像的代码
@csrf_exempt
def create_app(request):
appName = request.POST['name']
user = request.POST['userID']
c = request.POST['category']
i = request.POST['image']
imgdata = base64.b64decode(i)
t = datetime.now()
filename = t.strftime('test.jpg')
with open(filename, 'w') as f:
f.write(imgdata) …
Run Code Online (Sandbox Code Playgroud) 在使用Laravel项目之前,我尝试像往常一样运行composer install和composer update.但是我遇到了一个奇怪的问题,我似乎暂时无法解决这个问题.
PHP Fatal error: Uncaught exception 'ErrorException' with message 'Invalid argument supplied for foreach()' in /Applications/XAMPP/xamppfiles/htdocs/wild-guanabana/app/storage/views/d4682a7a7da163c9444d69f6b6de3dc7:35
Stack trace:
#0 /Applications/XAMPP/xamppfiles/htdocs/wild-guanabana/app/storage/views/d4682a7a7da163c9444d69f6b6de3dc7(35): Illuminate\Exception\Handler->handleError(2, 'Invalid argumen...', '/Applications/X...', 35, Array)
#1 /Applications/XAMPP/xamppfiles/htdocs/wild-guanabana/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(35): include('/Applications/X...')
#2 /Applications/XAMPP/xamppfiles/htdocs/wild-guanabana/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(56): Illuminate\View\Engines\PhpEngine->evaluatePath('/Applications/X...', Array)
#3 /Applications/XAMPP/xamppfiles/htdocs/wild-guanabana/vendor/laravel/framework/src/Illuminate/View/View.php(134): Illuminate\View\Engines\CompilerEngine->get('/Applications/X...', Array)
#4 /Applications/XAMPP/xamppfiles/htdocs/ in /Applications/XAMPP/xamppfiles/htdocs/wild-guanabana/app/storage/views/d4682a7a7da163c9444d69f6b6de3dc7 on line 35
PHP Fatal error: Uncaught exception 'ErrorException' with message 'Invalid argument supplied for foreach()' in /Applications/XAMPP/xamppfiles/htdocs/wild-guanabana/app/storage/views/d4682a7a7da163c9444d69f6b6de3dc7:35
Stack trace:
#0 /Applications/XAMPP/xamppfiles/htdocs/wild-guanabana/app/storage/views/d4682a7a7da163c9444d69f6b6de3dc7(35): Illuminate\Exception\Handler->handleError(2, 'Invalid argumen...', '/Applications/X...', 35, Array)
#1 /Applications/XAMPP/xamppfiles/htdocs/wild-guanabana/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(35): include('/Applications/X...')
#2 /Applications/XAMPP/xamppfiles/htdocs/wild-guanabana/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(56): Illuminate\View\Engines\PhpEngine->evaluatePath('/Applications/X...', Array)
#3 /Applications/XAMPP/xamppfiles/htdocs/wild-guanabana/vendor/laravel/framework/src/Illuminate/View/View.php(134): …
Run Code Online (Sandbox Code Playgroud) 创建新的 Android Activity 时,它通常在布局文件夹中创建一个 xml 文件,我将在其中定义 UI。现在它创建两个文件:
1.布局文件
2.片段布局文件。
有人可以解释一下两者之间的区别吗?此外,当尝试将项目添加为列表视图、按钮等时。我应该在哪个文件中添加它们以在我的活动文件中调用。
我在处理Mat时遵循了所有步骤,包括在调用时将其添加到AsyncTask但仍然是相同的错误,这是找不到本机方法org.opencv.core.mat.n_mat
这是代码:
package com.example.myfirstapp;
import java.io.ByteArrayOutputStream;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import org.json.JSONException;
import org.json.JSONObject;
import org.opencv.android.BaseLoaderCallback;
import org.opencv.android.LoaderCallbackInterface;
import org.opencv.android.OpenCVLoader;
import org.opencv.android.Utils;
import org.opencv.core.Mat;
import com.example.myfirstapp.RegisterMarkerMain.ProcessImage;
import android.location.Criteria;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.ListActivity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.util.Base64;
import android.util.Log;
import android.view.ContextMenu;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter; …
Run Code Online (Sandbox Code Playgroud) android ×6
python ×3
django ×2
opencv ×2
php ×2
android-ndk ×1
artisan ×1
base64 ×1
composer-php ×1
curl ×1
django-views ×1
gmail ×1
google-maps ×1
info.plist ×1
ios ×1
java ×1
laravel ×1
laravel-4 ×1
laravel-5 ×1
libgdx ×1
mat ×1
mongodb ×1
ssl ×1