实现注册、登录、注销账户

MainActivity.java

  1. package cn.lixyz.activity;
  2.  
  3. import android.app.Activity;
  4. import android.content.Intent;
  5. import android.database.Cursor;
  6. import android.database.sqlite.SQLiteDatabase;
  7. import android.os.Bundle;
  8. import android.util.Log;
  9. import android.view.View;
  10. import android.widget.Button;
  11. import android.widget.CheckBox;
  12. import android.widget.EditText;
  13. import android.widget.TextView;
  14. import android.widget.Toast;
  15. import cn.lixyz.data.MySQLiteOpenHelper;
  16. import cn.lixyz.sqlite.R;
  17.  
  18. public class MainActivity extends Activity {
  19.  
  20. // 声明组件
  21. private EditText et_login_username, et_login_password;
  22. private Button bt_login_login, bt_login_register;
  23. private CheckBox cb_login_rember;
  24. private TextView tv_login_forget;
  25.  
  26. // 声明一个意图
  27. private Intent intent;
  28.  
  29. // 声明SQLite相关内容
  30. private MySQLiteOpenHelper msop;
  31. private SQLiteDatabase database;
  32.  
  33. @Override
  34. protected void onCreate(Bundle savedInstanceState) {
  35. // TODO Auto-generated method stub
  36. super.onCreate(savedInstanceState);
  37. setContentView(R.layout.activity_main);
  38.  
  39. // 找到组件
  40. findView();
  41.  
  42. // 创建数据库
  43. msop = new MySQLiteOpenHelper(this, "user.db", null, 1);
  44.  
  45. // 创建或打开一个数据库有两种方法,getWritableDatabase()和getReadableDatabase(),二者的区别是:
  46. // getWritableDatabase取得的实例是以读写的方式打开数据库,如果打开的数据库磁盘满了,此时只能读不能写,此时调用了getWritableDatabase的实例,那么将会发生错误(异常)
  47. // getReadableDatabase取得的实例是先调用getWritableDatabase以读写的方式打开数据库,如果数据库的磁盘满了,此时返回打开失败,继而用getReadableDatabase的实例以只读的方式去打开数据库
  48. database = msop.getReadableDatabase();
  49.  
  50. }
  51.  
  52. // 将findViewById独立封装,以清晰代码结构
  53. private void findView() {
  54. et_login_username = (EditText) findViewById(R.id.et_login_username);
  55. et_login_password = (EditText) findViewById(R.id.et_login_password);
  56. bt_login_login = (Button) findViewById(R.id.bt_login_login);
  57. bt_login_register = (Button) findViewById(R.id.bt_login_register);
  58. cb_login_rember = (CheckBox) findViewById(R.id.cb_login_rember);
  59. tv_login_forget = (TextView) findViewById(R.id.tv_login_forget);
  60. }
  61.  
  62. // 通过ID来判断点击的是哪个按钮
  63. public void clickButton(View view) {
  64. switch (view.getId()) {
  65. case R.id.bt_login_login:
  66. login();
  67. break;
  68.  
  69. case R.id.bt_login_register:
  70. register();
  71. break;
  72. case R.id.tv_login_forget:
  73. forgetPassword();
  74. break;
  75. }
  76. }
  77.  
  78. // 登录方法
  79. private void login() {
  80. String username = et_login_username.getText().toString().trim();
  81. String password = et_login_password.getText().toString().trim();
  82. Cursor c = database.rawQuery("select * from user where username=? and password=?",
  83. new String[] { username, password });
  84. if (c.moveToFirst()) {
  85. intent = new Intent(MainActivity.this, IndexActivity.class);
  86. startActivity(intent);
  87. finish();
  88. } else {
  89. Toast.makeText(MainActivity.this, "登录不成功,检查您的账户和密码", Toast.LENGTH_SHORT).show();
  90. }
  91. c.close();
  92. }
  93.  
  94. // 注册方法
  95. private void register() {
  96. intent = new Intent(MainActivity.this, RegesiterActivity.class);
  97. startActivity(intent);
  98. }
  99.  
  100. // 找回密码方法
  101. private void forgetPassword() {
  102. intent = new Intent(MainActivity.this, ForgetPasswordActivity.class);
  103. startActivity(intent);
  104. }
  105. }

activity_main.xml

  1. <!-- 首页布局 -->
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. xmlns:tools="http://schemas.android.com/tools"
  4. android:layout_width="match_parent"
  5. android:layout_height="match_parent"
  6. android:orientation="vertical"
  7. tools:context=".MainActivity" >
  8.  
  9. <!-- 一个ImageView控件放置logo -->
  10.  
  11. <ImageView
  12. android:layout_width="wrap_content"
  13. android:layout_height="wrap_content"
  14. android:layout_gravity="center"
  15. android:layout_marginTop="15dp"
  16. android:src="@drawable/logo" />
  17.  
  18. <!-- 两个EditText,输入用户名和密码 -->
  19.  
  20. <EditText
  21. android:id="@+id/et_login_username"
  22. android:layout_width="match_parent"
  23. android:layout_height="wrap_content"
  24. android:layout_marginTop="10dp"
  25. android:hint="输入您的用户名" />
  26.  
  27. <EditText
  28. android:id="@+id/et_login_password"
  29. android:layout_width="match_parent"
  30. android:layout_height="wrap_content"
  31. android:layout_marginTop="10dp"
  32. android:hint="输入您的密码"
  33. android:password="true" />
  34.  
  35. <!-- 一个水平的线性布局,用来放置登录和注册按钮 -->
  36.  
  37. <LinearLayout
  38. android:layout_width="match_parent"
  39. android:layout_height="wrap_content"
  40. android:layout_marginTop="10dp"
  41. android:orientation="horizontal" >
  42.  
  43. <Button
  44. android:id="@+id/bt_login_login"
  45. android:layout_width="match_parent"
  46. android:layout_height="wrap_content"
  47. android:layout_weight="1"
  48. android:onClick="clickButton"
  49. android:text="登录" />
  50.  
  51. <Button
  52. android:id="@+id/bt_login_register"
  53. android:layout_width="match_parent"
  54. android:layout_height="wrap_content"
  55. android:layout_weight="1"
  56. android:onClick="clickButton"
  57. android:text="注册" />
  58. </LinearLayout>
  59.  
  60. <!-- 一个水平的线性布局,用来放置记住用户名和忘记密码 -->
  61.  
  62. <LinearLayout
  63. android:layout_width="match_parent"
  64. android:layout_height="wrap_content"
  65. android:orientation="horizontal" >
  66.  
  67. <CheckBox
  68. android:id="@+id/cb_login_rember"
  69. android:layout_width="wrap_content"
  70. android:layout_height="wrap_content"
  71. android:layout_marginTop="10dp"
  72. android:text="记住用户名" />
  73.  
  74. <!-- 将weight设置为1,全占剩余空间,以保障忘记密码水平居右 -->
  75.  
  76. <TextView
  77. android:layout_width="wrap_content"
  78. android:layout_height="wrap_content"
  79. android:layout_weight="1" />
  80.  
  81. <TextView
  82. android:id="@+id/tv_login_forget"
  83. android:layout_width="wrap_content"
  84. android:layout_height="wrap_content"
  85. android:layout_marginTop="10dp"
  86. android:onClick="clickButton"
  87. android:text="忘记密码 " />
  88. </LinearLayout>
  89.  
  90. </LinearLayout>

RegesiterActivity.java

  1. package cn.lixyz.activity;
  2.  
  3. import android.app.Activity;
  4. import android.content.ContentValues;
  5. import android.database.sqlite.SQLiteDatabase;
  6. import android.os.Bundle;
  7. import android.view.View;
  8. import android.view.View.OnClickListener;
  9. import android.widget.Button;
  10. import android.widget.EditText;
  11. import android.widget.Toast;
  12. import cn.lixyz.data.MySQLiteOpenHelper;
  13. import cn.lixyz.sqlite.R;
  14.  
  15. public class RegesiterActivity extends Activity {
  16.  
  17. // 声明组件
  18. private EditText et_reg_username, et_reg_password, et_reg_againPassword, et_reg_mobilephone;
  19. private Button bt_reg_submit;
  20.  
  21. // 声明要插入的数据变量
  22. private String username, password, mobilephone;
  23.  
  24. // 声明数据库组件
  25. private MySQLiteOpenHelper msoh;
  26. private SQLiteDatabase database;
  27.  
  28. @Override
  29. protected void onCreate(Bundle savedInstanceState) {
  30. // TODO Auto-generated method stub
  31. super.onCreate(savedInstanceState);
  32. setContentView(R.layout.activity_register);
  33.  
  34. findView();
  35.  
  36. msoh = new MySQLiteOpenHelper(RegesiterActivity.this, "user.db", null, 1);
  37. database = msoh.getReadableDatabase();
  38.  
  39. bt_reg_submit.setOnClickListener(new OnClickListener() {
  40.  
  41. @Override
  42. public void onClick(View v) {
  43. String str = et_reg_againPassword.getText().toString().trim();
  44. String str2 = et_reg_password.getText().toString().trim();
  45. // 判断密码是否输入一致,如果不一致,弹出提示,并清空输入的密码
  46. if (str.equals(str2)) {
  47. password = str;
  48. } else {
  49. Toast.makeText(RegesiterActivity.this, "您输入的密码不一致,请重新输入", Toast.LENGTH_SHORT).show();
  50. et_reg_password.setText("");
  51. et_reg_againPassword.setText("");
  52. return;
  53. }
  54. username = et_reg_username.getText().toString().trim();
  55. mobilephone = et_reg_mobilephone.getText().toString().trim();
  56.  
  57. // 打包插入数据
  58. ContentValues cv = new ContentValues();
  59. cv.put("username", username);
  60. cv.put("password", password);
  61. cv.put("mobilephone", mobilephone);
  62. if (database.insert("user", null, cv) > 0) {
  63. Toast.makeText(RegesiterActivity.this, "注册成功", Toast.LENGTH_SHORT).show();
  64. finish();
  65. } else {
  66. Toast.makeText(RegesiterActivity.this, "注册不成功", Toast.LENGTH_SHORT).show();
  67. }
  68. }
  69. });
  70. }
  71.  
  72. //// 将findViewById独立封装,以清晰代码结构
  73. private void findView() {
  74. et_reg_username = (EditText) findViewById(R.id.et_reg_username);
  75. et_reg_password = (EditText) findViewById(R.id.et_reg_password);
  76. et_reg_againPassword = (EditText) findViewById(R.id.et_reg_againPassword);
  77. et_reg_mobilephone = (EditText) findViewById(R.id.et_reg_mobilephone);
  78. bt_reg_submit = (Button) findViewById(R.id.bt_reg_submit);
  79. }
  80.  
  81. }

activity_register.xml

  1. <!-- 注册布局 -->
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. android:layout_width="match_parent"
  4. android:layout_height="match_parent"
  5. android:orientation="vertical" >
  6.  
  7. <!-- 注册用户名 -->
  8.  
  9. <EditText
  10. android:id="@+id/et_reg_username"
  11. android:layout_width="match_parent"
  12. android:layout_height="wrap_content"
  13. android:layout_marginTop="10dp"
  14. android:hint="输入您要注册的用户名" />
  15. <!-- 注册密码 -->
  16.  
  17. <EditText
  18. android:id="@+id/et_reg_password"
  19. android:layout_width="match_parent"
  20. android:layout_height="wrap_content"
  21. android:layout_marginTop="10dp"
  22. android:hint="输入您要注册的密码"
  23. android:password="true" />
  24. <!-- 重复注册密码 -->
  25.  
  26. <EditText
  27. android:id="@+id/et_reg_againPassword"
  28. android:layout_width="match_parent"
  29. android:layout_height="wrap_content"
  30. android:layout_marginTop="10dp"
  31. android:hint="再次输入密码"
  32. android:password="true" />
  33. <!-- 注册手机号 -->
  34.  
  35. <EditText
  36. android:id="@+id/et_reg_mobilephone"
  37. android:layout_width="match_parent"
  38. android:layout_height="wrap_content"
  39. android:layout_marginTop="10dp"
  40. android:hint="输入您的手机号" />
  41. <!-- 提交注册按钮 -->
  42.  
  43. <Button
  44. android:id="@+id/bt_reg_submit"
  45. android:layout_width="match_parent"
  46. android:layout_height="wrap_content"
  47. android:layout_marginTop="10dp"
  48. android:text="提 交" />
  49.  
  50. </LinearLayout>

IndexActivity.java

  1. package cn.lixyz.activity;
  2.  
  3. import android.app.Activity;
  4. import android.database.Cursor;
  5. import android.database.sqlite.SQLiteDatabase;
  6. import android.os.Bundle;
  7. import android.view.View;
  8. import android.view.View.OnClickListener;
  9. import android.widget.Button;
  10. import android.widget.EditText;
  11. import android.widget.Toast;
  12. import cn.lixyz.data.MySQLiteOpenHelper;
  13. import cn.lixyz.sqlite.R;
  14.  
  15. public class IndexActivity extends Activity {
  16.  
  17. private EditText et_del_mobile;
  18. private Button bt_del_submit;
  19.  
  20. private MySQLiteOpenHelper msop;
  21. private SQLiteDatabase database;
  22.  
  23. @Override
  24. protected void onCreate(Bundle savedInstanceState) {
  25. // TODO Auto-generated method stub
  26. super.onCreate(savedInstanceState);
  27. setContentView(R.layout.activity_index);
  28.  
  29. findView();
  30.  
  31. msop = new MySQLiteOpenHelper(IndexActivity.this, "user.db", null, 1);
  32. database = msop.getReadableDatabase();
  33.  
  34. bt_del_submit.setOnClickListener(new OnClickListener() {
  35.  
  36. @Override
  37. public void onClick(View v) {
  38. String mobile = et_del_mobile.getText().toString().trim();
  39. Cursor c = database.rawQuery("select mobilephone from user where mobilephone=?",
  40. new String[] { mobile });
  41. if (c.moveToFirst()) {
  42. int i = database.delete("user", "mobilephone=?", new String[] { mobile });
  43. if (i > 0) {
  44. Toast.makeText(IndexActivity.this, "删除成功", Toast.LENGTH_SHORT).show();
  45. finish();
  46. } else {
  47. Toast.makeText(IndexActivity.this, "*删除不成功*", Toast.LENGTH_SHORT).show();
  48. }
  49. } else {
  50. Toast.makeText(IndexActivity.this, "删除不成功", Toast.LENGTH_SHORT).show();
  51. }
  52. }
  53. });
  54. }
  55.  
  56. private void findView() {
  57. et_del_mobile = (EditText) findViewById(R.id.et_del_mobile);
  58. bt_del_submit = (Button) findViewById(R.id.bt_del_submit);
  59. }
  60.  
  61. }

activity_index.xml

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. android:layout_width="match_parent"
  4. android:layout_height="match_parent"
  5. android:orientation="vertical" >
  6.  
  7. <TextView
  8. android:layout_width="wrap_content"
  9. android:layout_height="wrap_content"
  10. android:text="注销账户" />
  11.  
  12. <EditText
  13. android:id="@+id/et_del_mobile"
  14. android:layout_width="match_parent"
  15. android:layout_height="wrap_content"
  16. android:hint="验证您的手机号" />
  17.  
  18. <Button
  19. android:id="@+id/bt_del_submit"
  20. android:layout_width="match_parent"
  21. android:layout_height="wrap_content"
  22. android:text="点我验证,删除账户" />
  23.  
  24. </LinearLayout>

ForgetPasswordActivity.java

  1. package cn.lixyz.activity;
  2.  
  3. import android.app.Activity;
  4. import android.content.ContentValues;
  5. import android.database.Cursor;
  6. import android.database.sqlite.SQLiteDatabase;
  7. import android.os.Bundle;
  8. import android.util.Log;
  9. import android.view.View;
  10. import android.view.View.OnClickListener;
  11. import android.widget.Button;
  12. import android.widget.EditText;
  13. import android.widget.Toast;
  14. import cn.lixyz.data.MySQLiteOpenHelper;
  15. import cn.lixyz.sqlite.R;
  16.  
  17. public class ForgetPasswordActivity extends Activity {
  18.  
  19. private EditText et_forget_mobile, et_forget_username, et_forget_password, et_forget_againPassword;
  20. private Button bt_forget_submit;
  21.  
  22. private MySQLiteOpenHelper msop;
  23. private SQLiteDatabase database;
  24.  
  25. @Override
  26. protected void onCreate(Bundle savedInstanceState) {
  27. // TODO Auto-generated method stub
  28. super.onCreate(savedInstanceState);
  29. setContentView(R.layout.activity_forget);
  30.  
  31. findView();
  32.  
  33. msop = new MySQLiteOpenHelper(this, "user.db", null, 1);
  34. database = msop.getReadableDatabase();
  35.  
  36. bt_forget_submit.setOnClickListener(new OnClickListener() {
  37.  
  38. @Override
  39. public void onClick(View v) {
  40. String username = et_forget_username.getText().toString().trim();
  41. String mobile = et_forget_mobile.getText().toString().trim();
  42.  
  43. Cursor c = database.rawQuery("select username,mobilephone from user where username=? and mobilephone=?",
  44. new String[] { username, mobile });
  45. if (c.moveToFirst()) {
  46. String str = et_forget_password.getText().toString().trim();
  47. String str2 = et_forget_againPassword.getText().toString().trim();
  48. if (str.equals(str2)) {
  49. ContentValues cv = new ContentValues();
  50. cv.put("password", str);
  51. database.update("user", cv, "username=? and mobilephone=?", new String[] { username, mobile });
  52. Toast.makeText(ForgetPasswordActivity.this, "修改成功", Toast.LENGTH_SHORT).show();
  53. finish();
  54. }
  55. }
  56. }
  57. });
  58. }
  59.  
  60. private void findView() {
  61. et_forget_mobile = (EditText) findViewById(R.id.et_forget_mobile);
  62. et_forget_username = (EditText) findViewById(R.id.et_forget_username);
  63. et_forget_password = (EditText) findViewById(R.id.et_forget_password);
  64. et_forget_againPassword = (EditText) findViewById(R.id.et_forget_againPassword);
  65. bt_forget_submit = (Button) findViewById(R.id.bt_forget_submit);
  66. }
  67. }

activity_forget.xml

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. android:layout_width="match_parent"
  4. android:layout_height="match_parent"
  5. android:orientation="vertical" >
  6.  
  7. <EditText
  8. android:id="@+id/et_forget_mobile"
  9. android:layout_width="match_parent"
  10. android:layout_height="wrap_content"
  11. android:layout_marginTop="10dp"
  12. android:hint="输入您的手机号" />
  13.  
  14. <EditText
  15. android:id="@+id/et_forget_username"
  16. android:layout_width="match_parent"
  17. android:layout_height="wrap_content"
  18. android:layout_marginTop="10dp"
  19. android:hint="输入您的用户名" />
  20.  
  21. <EditText
  22. android:id="@+id/et_forget_password"
  23. android:layout_width="match_parent"
  24. android:layout_height="wrap_content"
  25. android:layout_marginTop="10dp"
  26. android:hint="输入您的密码" />
  27.  
  28. <EditText
  29. android:id="@+id/et_forget_againPassword"
  30. android:layout_width="match_parent"
  31. android:layout_height="wrap_content"
  32. android:layout_marginTop="10dp"
  33. android:hint="重复输入您的密码" />
  34.  
  35. <Button
  36. android:id="@+id/bt_forget_submit"
  37. android:layout_width="match_parent"
  38. android:layout_height="wrap_content"
  39. android:layout_marginTop="10dp"
  40. android:text="修改" />
  41.  
  42. </LinearLayout>

AndroidManifest.xml

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
  3. package="cn.lixyz.sqlite"
  4. android:versionCode="1"
  5. android:versionName="1.0" >
  6.  
  7. <uses-sdk
  8. android:minSdkVersion="19"
  9. android:targetSdkVersion="19" />
  10.  
  11. <application
  12. android:allowBackup="true"
  13. android:icon="@drawable/ic_launcher"
  14. android:label="@string/app_name"
  15. android:theme="@style/AppTheme" >
  16. <activity
  17. android:name="cn.lixyz.activity.MainActivity"
  18. android:label="@string/app_name" >
  19. <intent-filter>
  20. <action android:name="android.intent.action.MAIN" />
  21.  
  22. <category android:name="android.intent.category.LAUNCHER" />
  23. </intent-filter>
  24. </activity>
  25. <activity android:name="cn.lixyz.activity.RegesiterActivity" />
  26. <activity android:name="cn.lixyz.activity.IndexActivity" />
  27. <activity android:name="cn.lixyz.activity.ForgetPasswordActivity" />
  28. </application>
  29.  
  30. </manifest>

Android笔记(四十四) Android中的数据存储——SQLite(六)整合的更多相关文章

  1. Android笔记(四十二) Android中的数据存储——SQLite(四)update

    update方法的四个参数: update()方法参数 对应的sql部分 描述 table update table_name 更新的表名 values set column=xxx ContentV ...

  2. Android笔记(四十) Android中的数据存储——SQLite(二) insert

    准备工作: 我们模拟一个注册的页面,先看UI 我们需要创建一个数据库:user,数据库包含表user,user表包含字段id.username.password.mobilephone MainAct ...

  3. Android笔记(十四) Android中的基本组件——按钮

    Android中的按钮主要包括Button和ImageButton两种,Button继承自TextView,而ImageButton继承自ImageView.Button生成的按钮上显示文字,而Ima ...

  4. Android笔记二十四.Android基于回调的事件处理机制

        假设说事件监听机制是一种托付式的事件处理,那么回调机制则与之相反,对于基于回调的事件处理模型来说,事件源和事件监听器是统一的,或者说事件监听器全然消失了,当用户在GUI控件上激发某个事件时,控 ...

  5. Android笔记三十四.Service综合实例二

    综合实例2:client訪问远程Service服务 实现:通过一个button来获取远程Service的状态,并显示在两个文本框中. 思路:如果A应用须要与B应用进行通信,调用B应用中的getName ...

  6. Android笔记(七十四) 详解Intent

    我们最常使用Intent来实现Activity之间的转跳,最近做一个app用到从系统搜索图片的功能,使用到了intent的 setType 方法和 setAction 方法,网上搜索一番,发现实现转跳 ...

  7. Android笔记(四十一) Android中的数据存储——SQLite(三)select

    SQLite 通过query实现查询,它通过一系列参数来定义查询条件. 各参数说明: query()方法参数 对应sql部分 描述 table from table_name 表名称 colums s ...

  8. Android笔记(四十三) Android中的数据存储——SQLite(五)delete

    SQLite通过delete()方法删除数据 delete()方法参数说明: delete()方法参数 对应sql部分 描述 table delte from table_name 要删除的表 whe ...

  9. Android笔记(七十五) Android中的图片压缩

    这几天在做图记的时候遇第一次遇到了OOM,好激动~~ 追究原因,是因为在ListView中加载的图片太大造成的,因为我使用的都是手机相机直接拍摄的照片,图片都比较大,所以在加载的时候会出现内存溢出,那 ...

随机推荐

  1. linux设置程序运行超时时间

    在某些情况下,我们需要限制程序的运行时间(比如cronjob等),这里简单介绍下使用信号及timeout的实现方法 1. 假如有如下代码(test_timout.sh): #!/bin/bash wh ...

  2. ISO/IEC 9899:2011 条款6.10.3——宏替换

    6.10.3 宏替换 约束 1.两个替换列表是相同的,当且仅当两个替换列表中的预处理符记都具有相同的数.次序.拼写,以及空白分隔符,这里所有的空白分隔符都认为是相同的. 2.当前被定义为一个类似对象的 ...

  3. python初级(302) 4 函数

    一.函数 1.函数定义: 可以完成某个工作的代码块.这是可以用来构建更大程序的一个小部分. 2.创建或定义函数要使用def关键字 3.创建一个函数 1) def 关键字 2)函数名及后面跟随的括号 3 ...

  4. 使用 Node.js 写一个代码生成器

    背景 第一次接触代码生成器用的是动软代码生成器,数据库设计好之后,一键生成后端 curd代码.之后也用过 CodeSmith , T4.目前市面上也有很多优秀的代码生成器,而且大部分都提供可视化界面操 ...

  5. Python下numpy的使用

    首先:当然是欢迎大家了! Numpy : NumPy系统是Python的一种开源的数值计算扩展.这种工具可用来存储和处理大型矩阵,比Python自身的嵌套列表(nested list structur ...

  6. 滚动条mCustomScrollbar自定义

    mCustomScrollbar 是个基于 jQuery UI 的自定义滚动条插件,它可以让你灵活的通过 CSS 定义网页的滚动条,并且垂直和水平两个方向的滚动条都可以定义,它通过 Brandon A ...

  7. CEF4Delphi 常用设置

    CEF4Delphi是由 SalvadorDíazFau 创建的一个开源项目,用于在基于Delphi的应用程序中嵌入基于Chromium的浏览器. CEF4Delphi 基于Henri Gourves ...

  8. 2. RDD编程

    2.1 编程模型 在Spark中,RDD被表示为对象,通过对象上的方法调用来对RDD进行转换.经过一系列的transformations定义RDD之后,就可以调用actions触发RDD的计算,act ...

  9. 手贱删了一些不该删的东西,导致git pull每次都要输入账号密码...

    解决办法: 输入一次账号密码,然后git工程目录下执行  git config --global credential.helper store 就妥了.

  10. [CF436D]Pudding Monsters

    题目大意:有一个长度为$2\times 10^5$的板,有$n(n\leqslant 10^5)$个格子$a_1,\dots,a_n$有布丁怪兽,一开始连续的怪兽算一个怪兽,有$m(m\leqslan ...