MainActivity类
public class MainActivity extends BaseActivity {
private AppDatabase db;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Database creation
db = Room.databaseBuilder(getApplicationContext(),
AppDatabase.class, "Medimap-db").build();
// Profile profile=new Profile("rajitha","12-2-345","male","no 345","test med","test emergency","testurl");
// db.profileDao().insert(profile);
// Toast.makeText(getApplicationContext(),"success",Toast.LENGTH_SHORT).show();
new DatabaseAsync().execute();
}
private class DatabaseAsync extends AsyncTask<Void, Void, Void> {
@Override
protected void onPreExecute() {
super.onPreExecute();
//Perform pre-adding operation here.
}
@Override
protected Void doInBackground(Void... voids) {
//Let's add some dummy data to the database.
Profile profile = new Profile("rajitha", "12-2-345", "male", …Run Code Online (Sandbox Code Playgroud) 我添加了以下代码style="background-color: #C2A5A5 !important.但这对我没有用.如何为离子项添加背景颜色?提前感谢.
<ion-item class="item-remove-animate item-avatar item-icon-right" style="background-color: #C2A5A5 !important" ng-repeat="detail in details" type="item-text-wrap" ng-controller="ChatsCtrl" ng-click="openShareModel(detail)">
<img ng-src="{{profilepic.profileimageurl}}">
<h2>{{detail.date | date :'fullDate'}}</h2>
<h2>{{detail.title}}</h2>
<p>{{detail.description}}</p>
<i class="icon ion-chevron-right icon-accessory"></i>
<ion-option-button class="button-assertive" ng-controller="ChatsCtrl" ng-click="remove(detail.id)">
Delete
</ion-option-button>
</ion-item>
Run Code Online (Sandbox Code Playgroud) 我目前的Tensorflow版本是0.10.0.我需要将它更新到最新版本.最新版本是1.0.0.有什么方法可以在终端中使用吗?
这是我用来查找版本的python代码
import tensorflow as tf;
print(tf.__version__);
Run Code Online (Sandbox Code Playgroud) 这是我的modal-profile.html
<ion-modal-view>
<form name="itemEdit" novalidate>
<ion-header-bar class="bar-positive fix-buttons">
<div class="row">
<a class="button " ng-click="closeModal()">Cancel</a>
<h1 class="title ">Diary</h1>
</div>
</ion-header-bar>
<ion-content has-bouncing="true">
<div class="row" ng-class="{'no-padding-top': !data.editItem}">
<div class="col">
<label class="item item-input large">
<input type="text" placeholder="Title" ng-model="modelTitle">
</label>
</div>
</div>
<div class="row description-row">
<div class="col">
<label class="item item-input text">
<textarea placeholder="Description" rows="5" ng-model="modelDescription" ng-Required="true" lose-focus-on-return></textarea>
</label>
</div>
</div>
<button class="button" ng-click="addDetail()">ADD</button>
<div class="row charity-row">
<div class="col col-10 vert-center">
<div class="charity large"></div>
</div>
</div>
</ion-content>
</form>
</ion-modal-view>
Run Code Online (Sandbox Code Playgroud)
这是我的控制器
.controller('ChatsCtrl', function($scope,$ionicModal, Chats,$state,$cordovaSQLite) {
$scope.chats …Run Code Online (Sandbox Code Playgroud) **我可以使用此代码将图像保存在远程Mysql数据库中.但是我无法从此代码中获得完整的图像质量.图像质量非常差.有人建议使用它的解决方案吗?
提前致谢.**
public void onActivityResult(int reqCode, int resCode, Intent data) {
if (resCode == RESULT_OK) {
if (reqCode == 1) {
Bitmap photo = null;
imageURI = data.getData();
try {
photo = MediaStore.Images.Media.getBitmap(this.getContentResolver(), imageURI);
} catch (IOException e) {
e.printStackTrace();
}
Image.setImageBitmap(photo);
ByteArrayOutputStream stream = new ByteArrayOutputStream();
photo.compress(Bitmap.CompressFormat.JPEG, 90, stream); //compress to which format you want.
byte[] byte_arr = stream.toByteArray();
String image_str = Base64.encodeToString(byte_arr, Base64.DEFAULT);
try {
image_str1 = URLEncoder.encode(image_str, "UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
} …Run Code Online (Sandbox Code Playgroud) android ×2
ionic ×2
android-room ×1
angularjs ×1
bitmap ×1
cordova ×1
css ×1
html ×1
java ×1
mysql ×1
python-3.x ×1
sqlite ×1
tensorflow ×1