我正在使用php SDK开发一个Facebook应用程序,我的应用程序很小,简单意味着社区项目,它的数据库只包含一个有6列的表,几乎没有10-20行记录.
我使用heroku来托管我的应用程序,它不提供直接的数据库托管功能.另外,我认为将这些小信息存储在一个完全独立的数据库服务器中将不会非常有效.
我正在寻找一些简单的解决方案,就像一个紧凑的数据库文件,我可以上传到目录,我的代码可以连接到它,并使用SQL查询从一个简单而有效的解决方案中检索信息.或任何其他好的建议来处理这个.
我的应用程序不需要在运行时将任何信息存储到数据库,而只需从已有的信息中检索,简单的类似于:
Select * from table where column LIKE %value%
请指导我.谢谢.
我有MainActivity类,它有实例化ApplicationBar的方法,所有其他的Activity都是从这里继承的,MainActivity所以他们可以使用这个方法.
但是我也有一个MapHolder类,它必须从FragmentActivityxml中扩展而来,它使用a fragment来显示地图.问题是,如果我扩展它,FragmentActivity我无法显示ApplicationBar选项卡,如果我从MainActivity扩展它,我不能显示地图,它给出了这个错误:
LogCat Output:
09-29 17:52:10.107: E/GooglePlayServicesUtil(3788): Google Play services is invalid. Cannot recover.
09-29 17:52:43.536: E/AndroidRuntime(3832): FATAL EXCEPTION: main
09-29 17:52:43.536: E/AndroidRuntime(3832): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mydomain.myproj/com.mydomain.myproj.MapHolder }: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
09-29 17:52:43.536: E/AndroidRuntime(3832): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)
09-29 17:52:43.536: E/AndroidRuntime(3832): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
09-29 17:52:43.536: E/AndroidRuntime(3832): at android.app.ActivityThread.access$600(ActivityThread.java:141)
09-29 17:52:43.536: E/AndroidRuntime(3832): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
09-29 17:52:43.536: E/AndroidRuntime(3832): at android.os.Handler.dispatchMessage(Handler.java:99)
09-29 17:52:43.536: E/AndroidRuntime(3832): at android.os.Looper.loop(Looper.java:137)
09-29 17:52:43.536: …Run Code Online (Sandbox Code Playgroud) 我是一个长字符串数组,我想将它传递给250字符块中的另一个函数,我写了这段代码:
var cStart = 0;
var phase = 250;
var cEnd = cStart + phase;
var count = 0;
while (count < 10000)
{
string fileInStringTemp = "";
fileInStringTemp = fileInString.Substring(cStart, cEnd);
var lngth = fileInStringTemp.Length;
//Do Some Work
cStart += phase;
cEnd += phase;
count++;
}
Run Code Online (Sandbox Code Playgroud)
在循环的值的第一次迭代lngth就是250这是很好的,在未来的迭代我也希望它250,因为我是从250-500字符提取子,但令人吃惊的值lngth在第二次迭代变量获得500.
这是为什么?我也试图在循环中每次初始化字符串变量,所以它从零开始但没有增益.
I have made a new column in my database table:
alter table TABLE add (COLUMN NUMBER(1));
Run Code Online (Sandbox Code Playgroud)
Now I want to select all records where the value of column is not zero, either it’s some other number of empty (null)
SELECT * FROM TABLE WHERE COLUMN != 0;
Run Code Online (Sandbox Code Playgroud)
And by default all columns have empty/null value as this column is recently added so it should return all records but doesn’t return any.
But if a change the value for this column …
我有这么简单的代码,但我不知道为什么我不能让它工作.
tagName="Hello";
String value="Hello";
if (tagName!=null && tagName.equals(value))
{
int io=0;
}
Run Code Online (Sandbox Code Playgroud)
tagName不是null并且明显等于value但代码永远不会出现这种情况int io=0;
我有单独的地图类,其中我编写了与地图活动相关的所有逻辑,因为严格要求将两个地图相关的事物分开.现在从主应用程序活动我调用这样的函数:
Timer t = new Timer();
t.scheduleAtFixedRate(new TimerTask() {
@Override
public void run() {
if (mapObj.isLocationClientConnected)
Location currentLocation = mapObj.gotoCurrentLocation();
}
}, 0, refreshUserLocationInterval);
Run Code Online (Sandbox Code Playgroud)
在Map Class我有:
public Location gotoCurrentLocation() {
currentLocation = mLocationClient.getLastLocation();
LatLng ll = new LatLng(currentLocation.getLatitude(), currentLocation.getLongitude());
CameraUpdate cUpdate = CameraUpdateFactory.newLatLngZoom(ll, defaultZoom);
gMap.animateCamera(cUpdate);
return currentLocation;
}
Run Code Online (Sandbox Code Playgroud)
但我得到这个错误:
06-22 19:56:30.900: E/AndroidRuntime(11413): FATAL EXCEPTION: Timer-0
06-22 19:56:30.900: E/AndroidRuntime(11413): java.lang.IllegalStateException: Not on the main thread
06-22 19:56:30.900: E/AndroidRuntime(11413): at kbh.b(Unknown Source)
06-22 19:56:30.900: E/AndroidRuntime(11413): at lzd.b(Unknown Source)
06-22 19:56:30.900: …Run Code Online (Sandbox Code Playgroud)