- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我已经阅读了 Failed to change locale for db '/data/data/my.easymedi.controller/databases/EasyMediInfo.db' to 'en_US' 的解决方案但这对我没有帮助。我仍然有同样的错误。
这些是我的 DBHelper
类。你能调查一下并帮助我吗?
package com.example.mgr;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.sql.Date;
import java.util.ArrayList;
import android.content.Context;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
import android.database.sqlite.SQLiteOpenHelper;
public class DBHelper extends SQLiteOpenHelper{
//The Android's default system path of your application database.
private static String DB_PATH = "/data/data/com.example.mgr/databases/";
private static String DB_NAME = "Mgr.Test.db";
private SQLiteDatabase myDataBase;
private final Context myContext;
public static final String KEY_ROWID = "_id";
public static final String KEY_DATE = "DataWstawiena";
public static final String KEY_TRESC = "Tresc";
public static final String DATABASE_NAME = "Mgr.Test";
public static final String DATABASE_TABLE = "InformacjeZDziekanatu";
private static int DATABASE_VERSION = 18;
/**
* Constructor
* Takes and keeps a reference of the passed context in order to access to the application assets and resources.
* @param context
*/
public DBHelper(Context context) {
super(context, DB_NAME, null, DATABASE_VERSION);
System.out.println("------Odpalam DBHelpera---wolane z konstruktora----");
this.myContext = context;
}
/**
* Creates a empty database on the system and rewrites it with your own database.
* */
public void createDataBase() throws IOException{
boolean dbExist = checkDataBase();
System.out.println("----Baza istnieje: " + dbExist + "-----");
if(dbExist){
System.out.println("----Baza istnieje!");
this.getReadableDatabase();
System.out.println("----Baza istnieje! znow");
//do nothing - database already exist
}
dbExist = checkDataBase();
if(!dbExist){
System.out.println("----Baza nie istnieje");
//By calling this method and empty database will be created into the default system path
//of your application so we are gonna be able to overwrite that database with our database.
this.getReadableDatabase();
try {
System.out.println("Bede kopiowal");
copyDataBase();
} catch (IOException e) {
throw new Error("Error copying database");
}
}
}
/**
* Check if the database already exist to avoid re-copying the file each time you open the application.
* @return true if it exists, false if it doesn't
*/
private boolean checkDataBase(){
SQLiteDatabase checkDB = null;
System.out.println("----Baza istnieje w checkDB!");
try{
String myPath = DB_PATH + DB_NAME;
checkDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.NO_LOCALIZED_COLLATORS|SQLiteDatabase.OPEN_READONLY);
System.out.println("Bazka otwarta!");
}catch(SQLiteException e){
System.out.println("database does't exist yet");
}
if(checkDB != null){
System.out.println("Zamykam baze");
checkDB.close();
}
return checkDB != null ? true : false;
}
/**
* Copies your database from your local assets-folder to the just created empty database in the
* system folder, from where it can be accessed and handled.
* This is done by transfering bytestream.
* */
private void copyDataBase() throws IOException{
//Open your local db as the input stream
InputStream myInput = myContext.getAssets().open(DB_NAME);
// Path to the just created empty db
String outFileName = DB_PATH + DB_NAME;
//Open the empty db as the output stream
OutputStream myOutput = new FileOutputStream(outFileName);
//transfer bytes from the inputfile to the outputfile
byte[] buffer = new byte[1024];
int length;
while ((length = myInput.read(buffer))>0){
myOutput.write(buffer, 0, length);
}
//Close the streams
myOutput.flush();
myOutput.close();
myInput.close();
}
public SQLiteDatabase openDataBase() throws SQLException{
String myPath = DB_PATH + DB_NAME;
myDataBase = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.NO_LOCALIZED_COLLATORS|SQLiteDatabase.OPEN_READONLY);
return myDataBase;
}
@Override
public synchronized void close() {
if(myDataBase != null)
myDataBase.close();
super.close();
}
@Override
public void onCreate(SQLiteDatabase db) {
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
try {
copyDataBase();
} catch (IOException e) {
e.printStackTrace();
}
System.out.println(" ----Jestem w mtodzie onUpgrade------");
//DATABASE_VERSION++;
}
/**
* Wykonuje zapytanie SQL
* @param query - zapytanie SQL
* @return zwraca Stringa z rezultatem
*/
public String executeQuery(String query){
String result = "";
Cursor cursor = myDataBase.rawQuery(query, null);
String dataWs ="Data Wstawienia ";
String tresc = "Tresc";
result = dataWs + tresc + "\n";
if(cursor.moveToFirst())
{
do
{
result += cursor.getString(1) +" "+ cursor.getString(3)+"\n";
}while(cursor.moveToNext());
}
return result;
}
/**
* Wykonuje zapytanie SQL i zwraca tablice
* @param query - zapytanie SQL
* @return zwraca tablie Stringa z rezultatem
*/
public ArrayList<String> executeQueryTab(String query){
ArrayList<String> result = new ArrayList<String>();
Cursor cursor = myDataBase.rawQuery(query, null);
String dataWs ="Data Wstawienia ";
String tresc = "Tresc";
result.add(dataWs + tresc);
if(cursor.moveToFirst())
{
do
{
result.add(cursor.getString(1) +" "+ cursor.getString(3));
}while(cursor.moveToNext());
}
return result;
}
// Add your public helper methods to access and get content from the database.
// You could return cursors by doing "return myDataBase.query(....)" so it'd be easy
// to you to create adapters for your views.
}
它以前工作得很好,但我对数据库进行了一些升级,然后它就停止工作了。我想这是这个错误的根源,但我不确定。
提前致谢!
根据您的要求:
我在我的 MainActivity 类中调用了 createDataBase 方法,如下所示:
package com.example.mgr;
import java.io.IOException;
import java.util.ArrayList;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.Gravity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Adapter;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
public class MainActivity extends Activity implements OnClickListener {
SharedPreferences preferences;
TextView tv;
Adapter adapter;
SQLiteDatabase as;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button infDlaStudButton = (Button) findViewById(R.id.infDlaStud);
Button infDlaKandButton = (Button) findViewById(R.id.infDlaKand);
preferences = PreferenceManager.getDefaultSharedPreferences(this);
DBHelper myDbHelper = new DBHelper(this);
infDlaStudButton.setOnClickListener(this);
infDlaKandButton.setOnClickListener(this);
infDlaKandButton.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
ble();
}
});
infDlaStudButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
ble();
}
});
try {
myDbHelper.createDataBase();
System.out.println("Stworzyłam bazę danych");
} catch (IOException ioe) {
throw new Error("nie moge to create database");
}
System.out.println("bede otwierdal baze danych w glowej metodzie");
myDbHelper.openDataBase();
}
void ble() {
Intent intent = new Intent();
intent.setClass(MainActivity.this, SecondActivity.class);
startActivity(intent);
}
@Override
public void onClick(View arg0) {
Toast.makeText(this, "ble", Toast.LENGTH_LONG).show();
// TODO Auto-generated method stub
}
}
是的,android_metadata 表存在于数据库中并且具有“en_US”值。
我已经创建了新的、非常简单的数据库Drzewo.db。当此表只有 2 个表时:andoid_metadata 和另一个表 (Przyjeci) 那么一切正常!但是后来我添加了新表并尝试进行升级,但我遇到了同样的错误。
有我的日志(来自这个新数据库):
12-04 19:58:41.959: E/SQLiteLog(2293): (11) database corruption at line 50741 of [00bb9c9ce4]
12-04 19:58:41.959: E/SQLiteLog(2293): (11) database corruption at line 50780 of [00bb9c9ce4]
12-04 19:58:41.969: E/SQLiteLog(2293): (11) statement aborts at 16: [SELECT locale FROM android_metadata UNION SELECT NULL ORDER BY locale DESC LIMIT 1]
12-04 19:58:42.056: E/SQLiteDatabase(2293): Failed to open database '/data/data/com.example.mgr/databases/Drzewo.db'.
12-04 19:58:42.056: E/SQLiteDatabase(2293): android.database.sqlite.SQLiteException: Failed to change locale for db '/data/data/com.example.mgr/databases/Drzewo.db' to 'en_US'.
12-04 19:58:42.056: E/SQLiteDatabase(2293): at android.database.sqlite.SQLiteConnection.setLocaleFromConfiguration(SQLiteConnection.java:386)
12-04 19:58:42.056: E/SQLiteDatabase(2293): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:218)
12-04 19:58:42.056: E/SQLiteDatabase(2293): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:193)
12-04 19:58:42.056: E/SQLiteDatabase(2293): at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463)
12-04 19:58:42.056: E/SQLiteDatabase(2293): at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185)
12-04 19:58:42.056: E/SQLiteDatabase(2293): at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177)
12-04 19:58:42.056: E/SQLiteDatabase(2293): at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:804)
12-04 19:58:42.056: E/SQLiteDatabase(2293): at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:789)
12-04 19:58:42.056: E/SQLiteDatabase(2293): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:694)
12-04 19:58:42.056: E/SQLiteDatabase(2293): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:854)
12-04 19:58:42.056: E/SQLiteDatabase(2293): at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:229)
12-04 19:58:42.056: E/SQLiteDatabase(2293): at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:224)
12-04 19:58:42.056: E/SQLiteDatabase(2293): at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:188)
12-04 19:58:42.056: E/SQLiteDatabase(2293): at com.example.mgr.DBHelper.createDataBase(DBHelper.java:53)
12-04 19:58:42.056: E/SQLiteDatabase(2293): at com.example.mgr.MainActivity.onCreate(MainActivity.java:73)
12-04 19:58:42.056: E/SQLiteDatabase(2293): at android.app.Activity.performCreate(Activity.java:5104)
12-04 19:58:42.056: E/SQLiteDatabase(2293): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
12-04 19:58:42.056: E/SQLiteDatabase(2293): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
12-04 19:58:42.056: E/SQLiteDatabase(2293): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
12-04 19:58:42.056: E/SQLiteDatabase(2293): at android.app.ActivityThread.access$600(ActivityThread.java:141)
12-04 19:58:42.056: E/SQLiteDatabase(2293): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
12-04 19:58:42.056: E/SQLiteDatabase(2293): at android.os.Handler.dispatchMessage(Handler.java:99)
12-04 19:58:42.056: E/SQLiteDatabase(2293): at android.os.Looper.loop(Looper.java:137)
12-04 19:58:42.056: E/SQLiteDatabase(2293): at android.app.ActivityThread.main(ActivityThread.java:5041)
12-04 19:58:42.056: E/SQLiteDatabase(2293): at java.lang.reflect.Method.invokeNative(Native Method)
12-04 19:58:42.056: E/SQLiteDatabase(2293): at java.lang.reflect.Method.invoke(Method.java:511)
12-04 19:58:42.056: E/SQLiteDatabase(2293): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
12-04 19:58:42.056: E/SQLiteDatabase(2293): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
12-04 19:58:42.056: E/SQLiteDatabase(2293): at dalvik.system.NativeStart.main(Native Method)
12-04 19:58:42.056: E/SQLiteDatabase(2293): Caused by: android.database.sqlite.SQLiteDatabaseCorruptException: database disk image is malformed (code 11)
12-04 19:58:42.056: E/SQLiteDatabase(2293): at android.database.sqlite.SQLiteConnection.nativeExecuteForString(Native Method)
12-04 19:58:42.056: E/SQLiteDatabase(2293): at android.database.sqlite.SQLiteConnection.executeForString(SQLiteConnection.java:634)
12-04 19:58:42.056: E/SQLiteDatabase(2293): at android.database.sqlite.SQLiteConnection.setLocaleFromConfiguration(SQLiteConnection.java:367)
12-04 19:58:42.056: E/SQLiteDatabase(2293): ... 28 more
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): Couldn't open Drzewo.db for writing (will try read-only):
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): android.database.sqlite.SQLiteException: Failed to change locale for db '/data/data/com.example.mgr/databases/Drzewo.db' to 'en_US'.
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at android.database.sqlite.SQLiteConnection.setLocaleFromConfiguration(SQLiteConnection.java:386)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:218)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:193)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:804)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:789)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:694)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:854)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:229)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:224)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:188)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at com.example.mgr.DBHelper.createDataBase(DBHelper.java:53)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at com.example.mgr.MainActivity.onCreate(MainActivity.java:73)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at android.app.Activity.performCreate(Activity.java:5104)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at android.app.ActivityThread.access$600(ActivityThread.java:141)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at android.os.Handler.dispatchMessage(Handler.java:99)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at android.os.Looper.loop(Looper.java:137)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at android.app.ActivityThread.main(ActivityThread.java:5041)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at java.lang.reflect.Method.invokeNative(Native Method)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at java.lang.reflect.Method.invoke(Method.java:511)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at dalvik.system.NativeStart.main(Native Method)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): Caused by: android.database.sqlite.SQLiteDatabaseCorruptException: database disk image is malformed (code 11)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at android.database.sqlite.SQLiteConnection.nativeExecuteForString(Native Method)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at android.database.sqlite.SQLiteConnection.executeForString(SQLiteConnection.java:634)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): at android.database.sqlite.SQLiteConnection.setLocaleFromConfiguration(SQLiteConnection.java:367)
12-04 19:58:42.219: E/SQLiteOpenHelper(2293): ... 28 more
12-04 19:58:42.259: D/AndroidRuntime(2293): Shutting down VM
12-04 19:58:42.280: W/dalvikvm(2293): threadid=1: thread exiting with uncaught exception (group=0x40a71930)
12-04 19:58:42.359: E/AndroidRuntime(2293): FATAL EXCEPTION: main
12-04 19:58:42.359: E/AndroidRuntime(2293): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.mgr/com.example.mgr.MainActivity}: android.database.sqlite.SQLiteException: Can't upgrade read-only database from version 5 to 6: Drzewo.db
12-04 19:58:42.359: E/AndroidRuntime(2293): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
12-04 19:58:42.359: E/AndroidRuntime(2293): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
12-04 19:58:42.359: E/AndroidRuntime(2293): at android.app.ActivityThread.access$600(ActivityThread.java:141)
12-04 19:58:42.359: E/AndroidRuntime(2293): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
12-04 19:58:42.359: E/AndroidRuntime(2293): at android.os.Handler.dispatchMessage(Handler.java:99)
12-04 19:58:42.359: E/AndroidRuntime(2293): at android.os.Looper.loop(Looper.java:137)
12-04 19:58:42.359: E/AndroidRuntime(2293): at android.app.ActivityThread.main(ActivityThread.java:5041)
12-04 19:58:42.359: E/AndroidRuntime(2293): at java.lang.reflect.Method.invokeNative(Native Method)
12-04 19:58:42.359: E/AndroidRuntime(2293): at java.lang.reflect.Method.invoke(Method.java:511)
12-04 19:58:42.359: E/AndroidRuntime(2293): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
12-04 19:58:42.359: E/AndroidRuntime(2293): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
12-04 19:58:42.359: E/AndroidRuntime(2293): at dalvik.system.NativeStart.main(Native Method)
12-04 19:58:42.359: E/AndroidRuntime(2293): Caused by: android.database.sqlite.SQLiteException: Can't upgrade read-only database from version 5 to 6: Drzewo.db
12-04 19:58:42.359: E/AndroidRuntime(2293): at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:245)
12-04 19:58:42.359: E/AndroidRuntime(2293): at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:188)
12-04 19:58:42.359: E/AndroidRuntime(2293): at com.example.mgr.DBHelper.createDataBase(DBHelper.java:53)
12-04 19:58:42.359: E/AndroidRuntime(2293): at com.example.mgr.MainActivity.onCreate(MainActivity.java:73)
12-04 19:58:42.359: E/AndroidRuntime(2293): at android.app.Activity.performCreate(Activity.java:5104)
12-04 19:58:42.359: E/AndroidRuntime(2293): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
12-04 19:58:42.359: E/AndroidRuntime(2293): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
12-04 19:58:42.359: E/AndroidRuntime(2293): ... 11 more
我在 eclipse juno + Android 4.2.2
上工作最佳答案
我无法将所有这些代码都放在评论中,所以请试试这些:请记住,我并没有添加所有的样板文件……好吗?
更改 checkDb 方法:
private boolean checkDataBase(){
File dbFile = new File( DATABASE_PATH, DATABASE_NAME );
return dbFile.exists();
}
更改 createDb 方法:
public void createDataBase() {
if(checkDb()){
//do nothing
} else {
copyDatabase();
}
}
更改 copyDatabase() 方法:
private void copyDataBase(){
getReadableDatabase();
//add the rest of your current implementation
}
将构造函数的可访问性更改为私有(private)并添加这些方法:
private DBHelper mInstance = null;
public static DBHelper getInstance(Context context) {
if(mInstance == null)
mInstance = new DBHelper(context)
return mInstance;
}
//remove the old openDatabase method
public SQLiteDatabase openDatabase() {
return getReadableDatabase(); //or you can use getWritableDatabase();
}
此外,我注意到您在发布的代码中的数据库版本是 18,而在您发布的日志中它说的是 5 或 6?你能发布最新的日志吗...
关于java - 无法打开数据库/无法将(数据库)的区域设置更改为 'en_US',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20283580/
在使用 GDI 进行图形处理的传统 Windows 程序中,您必须担心只绘制需要重绘的窗口区域;这是“更新矩形”,可以通过 PAINTSTRUCT.rcPaint 或通过调用 GetUpdateRec
我对 TFS 中的所有内容感到困惑。有人可以解释一下所有这些是如何组合在一起的吗? 团队项目合集 团队项目 团队 地区 迭代 来自 this page,我认为一个(团队)项目集合可以包含多个(团队)项
这对我来说根本没有意义。创建新的 API 网关时,您可以指定它是区域优化的还是边缘优化的。但话又说回来,当您为 API Gateway 创建自定义域名时,您可以在两者之间进行选择。 最糟糕的是,您可以
我有一个工作表,其中包含我想循环遍历的许多不同区域。我将进行一些计算,并认为它比在列中逐个单元格地更快/更有效。 我尝试了一些不同的东西,但不知道如何跳到下一个区域。我已经发表了一些评论,最有希望的是
最近迁移到 TFS 2010 后,我想知道对于区域而言,最佳或最广泛接受的定义或配置是什么? 我能在网上找到的唯一有用的文章是 this one并且是我认为是正确的。然而,这让我开始思考是否以下任何一
我在“北欧”有一个存储帐户,现在我想使用生命周期管理将冷 blob 移动到存档层。 但是我每次尝试都会遇到以下失败:无法为存储帐户“myStorageAccount”添加生命周期管理规则。错误:管理策
我正在开发一个项目,您在扫描仪中输入州的缩写,然后程序会告诉您该州位于美国的哪个地区。我认为我的大部分代码都是正确的,但我有以前从未使用过 switch。 我已经将我的工作改进为一个错误,即我的第一个
我正在尝试学习 AngularJS,我想我有一个架构问题。 如果我想开始开发一个应用程序,比方说,比如 youtube,我如何在“区域”(比如 Marionette)中组织页面?我的意思是:顶部导航栏
我正在制作一个动态内存分配器,当我释放其中的一部分时,我需要检查我传递给函数的指针实际上是否在该区域内。我有一个指向 malloc 区域开头的指针 typedef unsigned char byte
有时我想看看 到底在哪里页面上图片上的标签。 在 Javascript 中有没有办法改变颜色或隐藏与区域标签对应的图像部分? 最佳答案 也许您正在寻找类似 mapper.js 的内容.它允许您在鼠标
我有一个使用 D3 js 创建的时间序列图表。我想为特定时间间隔添加高亮区域,以显示在该特定时间发生的特定事件(会有不同类型的事件,因此每个高亮标记将根据其类型具有不同的颜色)。我希望这个突出显示区域
我正在尝试创建网站的密码保护区。我想通过检查 MySql 表中的用户名和密码来允许访问,然后启动一个 session 并允许在 session 处于事件状态时访问多个页面。如果有人尝试直接访问这些页面
在 ScrollView 中我添加了几个按钮。正如您在图片中看到的,2 个按钮完全可见,第三个按钮半可见。当我向右滚动看到第三个时;1-如果滚动条很短,则它会滚动回到第一个位置。2- 如果滚动足够则显
我正在开发我的第一个 spritekit 应用程序,并且有一个关于如何处理我想到的事情的快速问题。我正在制作一个我想要的棋盘游戏原型(prototype),并希望在 iOS map 中进行一些集思广益
在我的 C# 程序中,我收到这样的日期和时间:DateTime.Now 我得到:19/09/2010 20:10:30 因为我的地区是:希伯来语(以色列) 但是如果我将我的程序安装在区域为 Engli
有时我在 Visual Studio 的源文件中运行(在我的例子中是 2010),我看到很多区域,我必须点击 + 号才能一个一个地打开它们! 是否有任何快捷方式或菜单选项可以使这对我来说更容易,并且对
关闭。这个问题是opinion-based .它目前不接受答案。 想要改进这个问题? 更新问题,以便 editing this post 可以用事实和引用来回答它. 关闭 7 年前。 Improve
我正在寻找二维数据中的峰值区域(如果您愿意,灰度图像或二维景观,通过霍夫变换创建)。 峰值区域是指局部最大峰值,但不是单个点而是周围的一部分strong>contributing region 随之而
我希望能够将任何字符或字符串转换为形状或区域,以便我可以按照我喜欢的任何大小、样式、效果等来绘制该字符。 更具体地说,我将使用视差绘制它,以便它仅在特定角度清晰定义(这就是为什么我不能使用 html
我非常喜欢数学(或者你们大多数人会说的“数学”!),但我还没有达到知道这个问题答案的程度。我有一个主圆,它可以在显示器上的任何 x 和 y 处有一个中心点。其他圆圈将随意在显示器周围移动,但在任何给定
我是一名优秀的程序员,十分优秀!