我目前正在使用Mac,运行的操作系统版本是El Capitan.网络根目录是/Users/username/Sites
.
我下载,解压缩phpmyadmin并将目录移动到根文件夹,然后我设法进入登录屏幕.但是当我尝试登录时,它会显示这样的消息.
#2002 - No such file or directory<br />The server is not responding (or the local server's socket is not correctly configured).
Run Code Online (Sandbox Code Playgroud)
我检查了MySQL是否已关闭,但它已启用,因此它与此无关.有谁知道如何解决这个问题?
这是日志.
java.lang.NoClassDefFoundError: android.support.v7.app.AppCompatDelegateImplV14
at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:93)
at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:77)
at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:429)
at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:57)
at com.marshall.gruppo.ui.MainScreenActivity.onCreate(MainScreenActivity.java:41)
at android.app.Activity.performCreate(Activity.java:5451)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2377)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2471)
at android.app.ActivityThread.access$900(ActivityThread.java:175)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5602)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
at dalvik.system.NativeStart.main(Native Method)
Run Code Online (Sandbox Code Playgroud)
我还阅读了一篇建议解决方案的文章(java.lang.NoClassDefFoundError:android.support.v7.app.AppCompatDelegateImplV14).它建议我在build.gradle文件中添加以下内容.
compile 'com.android.support:appcompat-v7:22.2.0'
Run Code Online (Sandbox Code Playgroud)
实际上已经存在于文件中,看起来这不是原始问题.这是我的build.gradle文件.
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile project(':volley')
compile project(':android-support-v4')
}
Run Code Online (Sandbox Code Playgroud)
如果您需要查看我的代码,这是我的代码导致NoClassDefFoundError.
public class MainScreenActivity extends AppCompatActivity {
private DrawerLayout mDrawerLayout;
private ListView mDrawerList;
private ActionBarDrawerToggle mDrawerToggle;
private …
Run Code Online (Sandbox Code Playgroud) 我设法克隆了Material Design图标的git存储库,但现在我正在努力使用它.
我想在XML文件中使用图标资源,比如XML属性android:icon="@drawable/***
.
所以我搜索了很多文章,到目前为止似乎都没有.谁能解释一下?
如标题中所述,我在Eclipse上运行Golang代码时遇到问题.我目前正在使用Mac,我使用自制软件安装.
目前,安装go的文件夹如下.
/usr/local/Cellar/go/1.5.2/..
运行终端并输入后open ~/.bash_profile
我添加了以下内容.
export GOROOT="/usr/local/Cellar/go/1.5.2/"
export PATH=$PATH:$GOROOT/bin
Run Code Online (Sandbox Code Playgroud)
我还缺少别的吗?
PS如果我像使用终端一样运行代码go run main.go
,我绝对没问题.问题必定是由于Eclipse中的一些配置错误.
这是一个C代码,用于将成员信息打印到控制台.
#include "learnc0006.h"
#include "stdio.h"
#include "string.h"
union Member {
char name[20];
int age;
int height;
};
void printMember(union Member data);
int learnc0006() {
union Member data;
strcpy(data.name, "Rico Angeloni");
data.age = 30;
data.height = 175;
printMember(data);
return 0;
}
void printMember(union Member data) {
printf("Name: %s\n", data.name);
printf("Age: %d\n", data.age);
printf("Height: %d\n", data.height);
}
Run Code Online (Sandbox Code Playgroud)
我预计会有没有问题,但它显示了一些不同的结果,打印出一个奇怪的名称值而不是显示正确的值.
Name: \257
Age: 175
Height: 175
Run Code Online (Sandbox Code Playgroud)
任何好的解决方案将非常感谢.谢谢!
我sudo /usr/local/mysql/support-files/mysql.server stop
用终端运行并显示
Shutting down MySQL
. SUCCESS!
Run Code Online (Sandbox Code Playgroud)
但非常奇怪的是,下一个命令sudo mysqld_safe --skip-grant-tables
不起作用,显示以下消息。
151103 19:45:27 mysqld_safe Logging to '/usr/local/mysql/data/Marshalls-MacBook-Air.local.err'.
151103 19:45:27 mysqld_safe A mysqld process already exists
Run Code Online (Sandbox Code Playgroud)
我进入系统偏好设置-> MySQL 查看它是否仍在运行,结果是是。
现在我启动活动监视器,强制退出 mysqld。我点击了退出按钮,结果它仍然处于活动状态。
有什么解决办法吗?
在LoginActivity.java类中,当用户单击注册按钮时,代码将登录会话设置为true,然后将活动从LoginActivity切换到MainActivity.这是登录代码段.
case(R.id.login):
String email = etEmail.getText().toString();
String password = etPassword.getText().toString();
if(email.trim().length() > 0 && password.trim().length() > 0) {
loginManager.checkLogin(email, password);
pDialog.setMessage("Logging in..");
showDialog();
session.setLogin(true);
if(loginManager.isLoginSuccessful()) {
hideDialog();
Toast.makeText(this, getResources().getString(R.string.welcome_msg), Toast.LENGTH_LONG).show();
Intent intent = new Intent(this, MainActivity.class);
startActivity(intent);
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
finish();
} else {
Toast.makeText(this, loginManager.getErrorMessage(), Toast.LENGTH_LONG).show();
}
} else if(email.trim().length() < 1) {
Toast.makeText(this, "Please enter the email", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(this, "Please enter the password", Toast.LENGTH_SHORT).show();
}
break;
Run Code Online (Sandbox Code Playgroud)
这是处理登录过程的LoginManager.java文件.我使用OkHttp作为HTTP库.
public class LoginManager {
private final String TAG_LOGIN = …
Run Code Online (Sandbox Code Playgroud) public function addNewCategory($category_title, $strImage) {
// get the image from the base64 string.
$strImage = str_replace('data:image/png;base64,', '', $strImage);
$strImage = str_replace(' ', '+', $strImage);
$strImage = base64_decode($strImage);
// set the path name of where the image is to be stored.
$path = dirname(__FILE__).'/category_images/'.$category_title.".png";
// save the image in the path.
file_put_contents($path, $image);
// insert category and the image path into the MySQL database.
$result = mysqli_query($this->db->connect(), "INSERT INTO category(category_title, path, created_at) VALUES ('$category_title', '$path', NOW())");
if ($result) {
return mysqli_fetch_array($result); …
Run Code Online (Sandbox Code Playgroud) 这是我的styles.xml文件.
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/colorPrimary4</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark4</item>
<item name="colorAccent">@color/colorAccent2</item>
<item name="android:fontFamily">fonts/HelveticaNeue-Light.ttf</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<style name="AppTheme.Widget" />
<style name="AppTheme.Widget.TextView" parent="android:Widget.Holo.Light.TextView">
<item name="android:fontFamily">fonts/HelveticaNeue-Light.ttf</item>
</style>
</resources>
Run Code Online (Sandbox Code Playgroud)
这是包含工具栏的布局文件.
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:fitsSystemWindows="true"
tools:context=".HomeActivity">
<android.support.design.widget.AppBarLayout android:layout_height="wrap_content"
android:layout_width="match_parent" android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary" app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_home" />
</android.support.design.widget.CoordinatorLayout>
Run Code Online (Sandbox Code Playgroud)
所以,toolbar
正在使用文件中AppTheme.PopOverlay
定义的主题styles.xml
.
目前工具栏上的标题被设置为默认的应用程序名称,我想更改标题,所以我已经尝试<item name="android:text">@string/customtitle</item>
在AppTheme.PopOverlay
主题中包含该属性.它没用. …
这是我的SQLiteHandler类代码的一部分。
public class SQLiteHandler extends SQLiteOpenHelper implements DataKeyLists {
private static final String TAG = SQLiteHandler.class.getSimpleName();
// All Static variables
// Database Version
private static final int DATABASE_VERSION = 1;
// Database Name
private static final String DATABASE_NAME = "users";
// Login table name
private static final String TABLE_USER = "user";
// query to create a login table
private static final String QUERY_CREATE_LOGIN_TABLE = "CREATE TABLE " + TABLE_USER
+ "("
+ KEY_ID + " INTEGER PRIMARY KEY,"
+ KEY_UID …
Run Code Online (Sandbox Code Playgroud) #include <stdio.h>
int main(int argc, const char * argv[]) {
int a = 10;
int b = 20;
double result = a / b;
printf("%d divided by %d makes %f\n", a, b, result);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
期望%f
返回0.500000,我运行代码,结果是0.000000.
有result
变量返回零值的原因吗?