Android 周历

main.xml 文件

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:tools="http://schemas.android.com/tools"

android:layout_width="match_parent"

android:layout_height="match_parent" >

<LinearLayout

android:id="@+id/ll_week"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:orientation="horizontal" >

<TextView

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_weight="1"

android:gravity="center"

android:text="周日" />

<TextView

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_weight="1"

android:gravity="center"

android:text="周一" />

<TextView

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_weight="1"

android:gravity="center"

android:text="周二" />

<TextView

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_weight="1"

android:gravity="center"

android:text="周三" />

<TextView

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_weight="1"

android:gravity="center"

android:text="周四" />

<TextView

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_weight="1"

android:gravity="center"

android:text="周五" />

<TextView

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_weight="1"

android:gravity="center"

android:text="周六" />

</LinearLayout>

<ViewFlipper

android:id="@+id/flipper1"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:layout_below="@id/ll_week" />

<TextView

android:id="@+id/tv_date"

android:layout_below="@id/flipper1"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:text="2014年5月6日"

android:gravity="center"

/>

</RelativeLayout>

item_calendar.xml文件

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:orientation="vertical" >

<LinearLayout

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:gravity="center"

android:orientation="vertical" >

<TextView

android:id="@+id/tv_calendar"

android:layout_width="30dp"

android:layout_height="30dp"

android:gravity="center" />

</LinearLayout>

</LinearLayout>

MainActivity.java

public class MainActivity extends Activity implements OnGestureListener {

private ViewFlipper flipper1 = null;

private GridView gridView = null;

private GestureDetector gestureDetector = null;

private int year_c = 0;

private int month_c = 0;

private int day_c = 0;

private int week_c = 0;

private int week_num = 0;

private String currentDate = "";

private static int jumpWeek = 0;

private static int jumpMonth = 0;

private static int jumpYear = 0;

private DateAdapter dateAdapter;

private int daysOfMonth = 0; // 某月的天数

private int dayOfWeek = 0; // 具体某月的第一天是星期几

private int weeksOfMonth = 0;

private SpecialCalendar sc = null;

private boolean isLeapyear = false; // 是否为闰年

private int selectPostion = 0;

private String dayNumbers[] = new String[7];

private TextView tvDate;

private int currentYear;

private int currentMonth;

private int currentWeek;

private int currentDay;

private int currentNum;

private boolean isStart;// 是否是交接的月初

public MainActivity() {

Date date = new Date();

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-M-d");

currentDate = sdf.format(date);

year_c = Integer.parseInt(currentDate.split("-")[0]);

month_c = Integer.parseInt(currentDate.split("-")[1]);

day_c = Integer.parseInt(currentDate.split("-")[2]);//9

currentYear = year_c;

currentMonth = month_c;

currentDay = day_c;

sc = new SpecialCalendar();

getCalendar(year_c, month_c);

week_num = getWeeksOfMonth();//12月份week_num是5

currentNum = week_num;//5

if (dayOfWeek == 7) {

week_c = day_c / 7 + 1;

} else {

if (day_c <= (7 - dayOfWeek)) {

week_c = 1;

} else {

if ((day_c - (7 - dayOfWeek)) % 7 == 0) {

week_c = (day_c - (7 - dayOfWeek)) / 7 + 1;

Log.i("life", "day_c = "+ day_c );

} else {

week_c = (day_c - (7 - dayOfWeek)) / 7 + 2;

}

}

}

currentWeek = week_c;

Log.i("life", " currentWeek = "+currentWeek );

getCurrent();

}

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

tvDate = (TextView) findViewById(R.id.tv_date);

tvDate.setText(year_c + "年" + month_c + "月" + day_c + "日");

gestureDetector = new GestureDetector(this);

flipper1 = (ViewFlipper) findViewById(R.id.flipper1);

dateAdapter = new DateAdapter(this, getResources(), currentYear,

currentMonth, currentWeek, currentNum, selectPostion,

currentWeek == 1 ? true : false);

addGridView();

dayNumbers = dateAdapter.getDayNumbers();

gridView.setAdapter(dateAdapter);

selectPostion = dateAdapter.getTodayPosition();

gridView.setSelection(selectPostion);

flipper1.addView(gridView, 0);

}

/**

* 判断某年某月所有的星期数

*

* @param year

* @param month

*/

public int getWeeksOfMonth(int year, int month) {

// 先判断某月的第一天为星期几

int preMonthRelax = 0;

int dayFirst = getWhichDayOfWeek(year, month);

int days = sc.getDaysOfMonth(sc.isLeapYear(year), month);

if (dayFirst != 7) {

preMonthRelax = dayFirst;

}

if ((days + preMonthRelax) % 7 == 0) {

weeksOfMonth = (days + preMonthRelax) / 7;

} else {

weeksOfMonth = (days + preMonthRelax) / 7 + 1;

}

return weeksOfMonth;

}

/**

* 判断某年某月的第一天为星期几

*

* @param year

* @param month

* @return

*/

public int getWhichDayOfWeek(int year, int month) {

return sc.getWeekdayOfMonth(year, month);

}

/**

*

* @param year

* @param month

*/

public int getLastDayOfWeek(int year, int month) {

return sc.getWeekDayOfLastMonth(year, month,

sc.getDaysOfMonth(isLeapyear, month));

}

public void getCalendar(int year, int month) {

isLeapyear = sc.isLeapYear(year); // 是否为闰年

daysOfMonth = sc.getDaysOfMonth(isLeapyear, month); // 某月的总天数

dayOfWeek = sc.getWeekdayOfMonth(year, month); // 某月第一天为星期几

Log.i("life", " dayOfWeek = "+dayOfWeek );

}

public int getWeeksOfMonth() {

int preMonthRelax = 0;

if (dayOfWeek != 7) {//2014年的12月1号是星期一,所以preMonthRelax的值是1

preMonthRelax = dayOfWeek;

}

if ((daysOfMonth + preMonthRelax) % 7 == 0) {

weeksOfMonth = (daysOfMonth + preMonthRelax) / 7;

} else {

weeksOfMonth = (daysOfMonth + preMonthRelax) / 7 + 1;//所以2014年的12月的weeksOfMonth值是1

}

Log.i("life", " weeksOfMonth = "+weeksOfMonth );

return weeksOfMonth;

}

private void addGridView() {

LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(

LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);

gridView = new GridView(this);

gridView.setNumColumns(7);

gridView.setGravity(Gravity.CENTER_VERTICAL);

gridView.setSelector(new ColorDrawable(Color.TRANSPARENT));

gridView.setVerticalSpacing(1);

gridView.setHorizontalSpacing(1);

gridView.setOnTouchListener(new OnTouchListener() {

@Override

public boolean onTouch(View v, MotionEvent event) {

return MainActivity.this.gestureDetector.onTouchEvent(event);

}

});

gridView.setOnItemClickListener(new OnItemClickListener() {

@Override

public void onItemClick(AdapterView<?> parent, View view,

int position, long id) {

selectPostion = position;

dateAdapter.setSeclection(position);

dateAdapter.notifyDataSetChanged();

tvDate.setText(dateAdapter.getCurrentYear(selectPostion) + "年"

+ dateAdapter.getCurrentMonth(selectPostion) + "月"

+ dayNumbers[position] + "日");

}

});

gridView.setLayoutParams(params);

}

@Override

protected void onPause() {

super.onPause();

jumpWeek = 0;

}

@Override

public boolean onDown(MotionEvent e) {

return false;

}

@Override

public void onShowPress(MotionEvent e) {

}

@Override

public boolean onSingleTapUp(MotionEvent e) {

return false;

}

@Override

public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,

float distanceY) {

return false;

}

@Override

public void onLongPress(MotionEvent e) {

}

/**

* 重新计算当前的年月

*/

public void getCurrent() {

if (currentWeek > currentNum) {

if (currentMonth + 1 <= 12) {

currentMonth++;

} else {

currentMonth = 1;

currentYear++;

}

currentWeek = 1;

currentNum = getWeeksOfMonth(currentYear, currentMonth);

} else if (currentWeek == currentNum) {

if (getLastDayOfWeek(currentYear, currentMonth) == 6) {

} else {

if (currentMonth + 1 <= 12) {

currentMonth++;

} else {

currentMonth = 1;

currentYear++;

}

currentWeek = 1;

currentNum = getWeeksOfMonth(currentYear, currentMonth);

}

} else if (currentWeek < 1) {

if (currentMonth - 1 >= 1) {

currentMonth--;

} else {

currentMonth = 12;

currentYear--;

}

currentNum = getWeeksOfMonth(currentYear, currentMonth);

currentWeek = currentNum - 1;

}

}

@Override

public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,

float velocityY) {

int gvFlag = 0;

if (e1.getX() - e2.getX() > 80) {

// 向左滑

addGridView();

currentWeek++;

getCurrent();

dateAdapter = new DateAdapter(this, getResources(), currentYear,

currentMonth, currentWeek, currentNum, selectPostion,

currentWeek == 1 ? true : false);

dayNumbers = dateAdapter.getDayNumbers();

gridView.setAdapter(dateAdapter);

tvDate.setText(dateAdapter.getCurrentYear(selectPostion) + "年"

+ dateAdapter.getCurrentMonth(selectPostion) + "月"

+ dayNumbers[selectPostion] + "日");

gvFlag++;

flipper1.addView(gridView, gvFlag);

dateAdapter.setSeclection(selectPostion);

this.flipper1.setInAnimation(AnimationUtils.loadAnimation(this,

R.anim.push_left_in));

this.flipper1.setOutAnimation(AnimationUtils.loadAnimation(this,

R.anim.push_left_out));

this.flipper1.showNext();

flipper1.removeViewAt(0);

return true;

} else if (e1.getX() - e2.getX() < -80) {

addGridView();

currentWeek--;

getCurrent();

dateAdapter = new DateAdapter(this, getResources(), currentYear,

currentMonth, currentWeek, currentNum, selectPostion,

currentWeek == 1 ? true : false);

dayNumbers = dateAdapter.getDayNumbers();

gridView.setAdapter(dateAdapter);

tvDate.setText(dateAdapter.getCurrentYear(selectPostion) + "年"

+ dateAdapter.getCurrentMonth(selectPostion) + "月"

+ dayNumbers[selectPostion] + "日");

gvFlag++;

flipper1.addView(gridView, gvFlag);

dateAdapter.setSeclection(selectPostion);

this.flipper1.setInAnimation(AnimationUtils.loadAnimation(this,

R.anim.push_right_in));

this.flipper1.setOutAnimation(AnimationUtils.loadAnimation(this,

R.anim.push_right_out));

this.flipper1.showPrevious();

flipper1.removeViewAt(0);

return true;

// }

}

return false;

}

@Override

public boolean onTouchEvent(MotionEvent event) {

return this.gestureDetector.onTouchEvent(event);

}

}

SpecialCalendar.java

public class SpecialCalendar {

private int daysOfMonth = 0;      //某月的天数

private int dayOfWeek = 0;        //具体某一天是星期几

private int eachDayOfWeek = 0;

// 判断是否为闰年

public boolean isLeapYear(int year) {

if (year % 100 == 0 && year % 400 == 0) {

return true;

} else if (year % 100 != 0 && year % 4 == 0) {

return true;

}

return false;

}

//得到某月有多少天数

public int getDaysOfMonth(boolean isLeapyear, int month) {

switch (month) {

case 1:

case 3:

case 5:

case 7:

case 8:

case 10:

case 12:

daysOfMonth = 31;

break;

case 4:

case 6:

case 9:

case 11:

daysOfMonth = 30;

break;

case 2:

if (isLeapyear) {

daysOfMonth = 29;

} else {

daysOfMonth = 28;

}

}

return daysOfMonth;

}

//指定某年中的某月的第一天是星期几

public int getWeekdayOfMonth(int year, int month){

Calendar cal = Calendar.getInstance();

cal.set(year, month-1, 1);

dayOfWeek = cal.get(Calendar.DAY_OF_WEEK)-1;//切记这个地方减了一

return dayOfWeek;

}

public int getWeekDayOfLastMonth(int year,int month,int day){

Calendar cal = Calendar.getInstance();

cal.set(year, month-1, day);

eachDayOfWeek = cal.get(Calendar.DAY_OF_WEEK)-1;

return eachDayOfWeek;

}

}

DateAdapter.java

public class DateAdapter extends BaseAdapter {

private boolean isLeapyear = false; // 是否为闰年

private int daysOfMonth = 0; // 某月的天数

private int dayOfWeek = 0; // 具体某一天是星期几

private int nextDayOfWeek = 0;

private int lastDayOfWeek = 0;

private int lastDaysOfMonth = 0; // 上一个月的总天数

private int eachDayOfWeek = 0;

private Context context;

private SpecialCalendar sc = null;

private Resources res = null;

private Drawable drawable = null;

private String[] dayNumber = new String[7];

private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-M-d");

private int currentFlag = -1; // 用于标记当天

// 系统当前时间

private String sysDate = "";

private String sys_year = "";

private String sys_month = "";

private String sys_day = "";

private String currentYear = "";

private String currentMonth = "";

private String currentWeek = "";

private String currentDay = "";

private int weeksOfMonth;

private int default_postion;

private int clickTemp = -1;

private int week_num = 0;

private int week_c = 0;

private int month = 0;

private int jumpWeek = 0;

private int c_month = 0;

private int c_day_week = 0;

private int n_day_week = 0;

private boolean isStart;

// 标识选择的Item

public void setSeclection(int position) {

clickTemp = position;

}

public DateAdapter() {

Date date = new Date();

sysDate = sdf.format(date); // 当期日期

sys_year = sysDate.split("-")[0];

sys_month = sysDate.split("-")[1];

sys_day = sysDate.split("-")[2];

month = Integer.parseInt(sys_month);

}

public DateAdapter(Context context, Resources rs, int year_c, int month_c,

int week_c, int week_num, int default_postion, boolean isStart) {

this();

this.context = context;

this.res = rs;

this.default_postion = default_postion;

this.week_c = week_c;

this.isStart = isStart;

sc = new SpecialCalendar();

lastDayOfWeek = sc.getWeekDayOfLastMonth(year_c, month_c,

sc.getDaysOfMonth(sc.isLeapYear(year_c), month_c));

Log.i("life", " lastDayOfWeek = "+lastDayOfWeek );

currentYear = String.valueOf(year_c);

// 得到当前的年份

currentMonth = String.valueOf(month_c); // 得到本月

// (jumpMonth为滑动的次数,每滑动一次就增加一月或减一月)

currentDay = String.valueOf(sys_day);

// 得到当前日期是哪天

getCalendar(Integer.parseInt(currentYear),

Integer.parseInt(currentMonth));

currentWeek = String.valueOf(week_c);

Log.i("life", " week_c = "+week_c );

getWeek(Integer.parseInt(currentYear), Integer.parseInt(currentMonth),

Integer.parseInt(currentWeek));

}

public int getTodayPosition() {

int todayWeek = sc.getWeekDayOfLastMonth(Integer.parseInt(sys_year),

Integer.parseInt(sys_month), Integer.parseInt(sys_day));

if (todayWeek == 7) {

clickTemp = 0;

} else {

clickTemp = todayWeek;

}

return clickTemp;

}

public int getCurrentMonth(int position) {

int thisDayOfWeek = sc.getWeekdayOfMonth(Integer.parseInt(currentYear),

Integer.parseInt(currentMonth));

if (isStart) {

if (thisDayOfWeek != 7) {

if (position < thisDayOfWeek) {

return Integer.parseInt(currentMonth) - 1 == 0 ? 12

: Integer.parseInt(currentMonth) - 1;

} else {

return Integer.parseInt(currentMonth);

}

} else {

return Integer.parseInt(currentMonth);

}

} else {

return Integer.parseInt(currentMonth);

}

}

public int getCurrentYear(int position) {

int thisDayOfWeek = sc.getWeekdayOfMonth(Integer.parseInt(currentYear),

Integer.parseInt(currentMonth));

if (isStart) {

if (thisDayOfWeek != 7) {

if (position < thisDayOfWeek) {

return Integer.parseInt(currentMonth) - 1 == 0 ? Integer

.parseInt(currentYear) - 1 : Integer

.parseInt(currentYear);

} else {

return Integer.parseInt(currentYear);

}

} else {

return Integer.parseInt(currentYear);

}

} else {

return Integer.parseInt(currentYear);

}

}

public void getCalendar(int year, int month) {

isLeapyear = sc.isLeapYear(year); // 是否为闰年

daysOfMonth = sc.getDaysOfMonth(isLeapyear, month); // 某月的总天数

dayOfWeek = sc.getWeekdayOfMonth(year, month); // 某月第一天为星期几  1

lastDaysOfMonth = sc.getDaysOfMonth(isLeapyear, month - 1);

nextDayOfWeek = sc.getDaysOfMonth(isLeapyear, month + 1);

}

public void getWeek(int year, int month, int week) {

for (int i = 0; i < dayNumber.length; i++) {

if (dayOfWeek == 7) {

dayNumber[i] = String.valueOf((i + 1) + 7 * (week - 1));

} else {

if (week == 1) {

if (i < dayOfWeek) {

Log.i("life", " lastDaysOfMonth = "+lastDaysOfMonth );

dayNumber[i] = String.valueOf(lastDaysOfMonth

- (dayOfWeek - (i + 1)));

} else {

dayNumber[i] = String.valueOf(i - dayOfWeek + 1);

}

} else {

dayNumber[i] = String.valueOf((7 - dayOfWeek + 1 + i) + 7

* (week - 2));

}

}

}

}

public String[] getDayNumbers() {

return dayNumber;

}

/**

* 得到某月有几周(特殊算法)

*/

public int getWeeksOfMonth() {

int preMonthRelax = 0;

if (dayOfWeek != 7) {

preMonthRelax = dayOfWeek;

}

if ((daysOfMonth + preMonthRelax) % 7 == 0) {

weeksOfMonth = (daysOfMonth + preMonthRelax) / 7;

} else {

weeksOfMonth = (daysOfMonth + preMonthRelax) / 7 + 1;

}

return weeksOfMonth;

}

/**

* 某一天在第几周

*/

public void getDayInWeek(int year, int month) {

}

@Override

public int getCount() {

// TODO Auto-generated method stub

return dayNumber.length;

}

@Override

public Object getItem(int position) {

// TODO Auto-generated method stub

return position;

}

@Override

public long getItemId(int position) {

// TODO Auto-generated method stub

return position;

}

@Override

public View getView(int position, View convertView, ViewGroup parent) {

if (convertView == null) {

convertView = LayoutInflater.from(context).inflate(

R.layout.item_calendar, null);

}

TextView tvCalendar = (TextView) convertView

.findViewById(R.id.tv_calendar);

tvCalendar.setText(dayNumber[position]);

if (clickTemp == position) {

tvCalendar.setSelected(true);

tvCalendar.setTextColor(Color.WHITE);

tvCalendar.setBackgroundResource(R.drawable.circle_message);

} else {

tvCalendar.setSelected(false);

tvCalendar.setTextColor(Color.BLACK);

tvCalendar.setBackgroundColor(Color.TRANSPARENT);

}

return convertView;

}

}

时间: 2024-08-03 12:24:52

Android 周历的相关文章

Android周笔记(9.8-14)(持续更新)

本笔记记录一周内的小知识点和一些心学习的Demo. 1.PopupWindow: new 一个activity_pop_window:id为popwindow的Button,id为hello123的TextView 自测2.3以下不能实现: 1 protected void onCreate(Bundle savedInstanceState) { 2 super.onCreate(savedInstanceState); 3 setContentView(R.layout.activity_p

T-SQL: 17 个与日期时间相关的自定义函数(UDF),周日作为周的最后一天,均不受 @@DateFirst、语言版本影响!

原文:T-SQL: 17 个与日期时间相关的自定义函数(UDF),周日作为周的最后一天,均不受 @@DateFirst.语言版本影响! CSDN 的 Blog 太滥了!无时不刻地在坏! 开始抢救性搬家 ... ... 到这里重建家园 /* T-SQL: 17 个与日期时间相关的自定义函数(UDF),周日作为周的最后一天,均不受 @@DateFirst.语言版本影响 都是从老文章里收集或提炼出来的! 提示: (@@Datefirst + datepart(weekday,@Date)) % 7 判

html.ex.day02

1.同一个目录内页面跳转 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv=&

js常规日期格式处理、月历渲染、倒计时函数

日期格式处理在前端的日常任务中非常常见,但是为此引入monent.js这样的类库又会显得有点臃肿,毕竟我们一个特定的项目中,并不需要monent.js那么全的涵盖范围.另外,如果现在公司让你自己手写一个日历组件(月历.周历),日历组件中需要耦合我们的其他业务需求,如果有一个任务列表,当11月22号的待进行任务,我需要在日历上有一个绿色圆点,表示当天有待办事项.下面介绍一些常规的函数,希望对大家有用. 月历效果图 月历.png 函数目录 getFormatDateStr 获得指定日期格式的字符串:

JavaScript - 收藏集 - 掘金

Angular 中的响应式编程 -- 浅淡 Rx 的流式思维 - 掘金第一节:初识Angular-CLI第二节:登录组件的构建第三节:建立一个待办事项应用第四节:进化!模块化你的应用第五节:多用户版本的待办事项应用第六节:使用第三方样式库及模块优化用第七节:给组件带来活力Rx--隐藏在 Angular 中的利剑Redux你的 A... Electron 深度实践总结 - 前端 - 掘金思维导图 前言: Electron 从最初发布到现在已经维护很长一段时间了,但是去年才开始慢慢升温.笔者个人恰好

《计算机问题求解》总结——2014年CCF计算机课程改革导教班(2014.07.11)

一:引言 "心想事成",这是自己获得导教班学习机会的最佳概括.2013年年末学习李晓明老师的<人群与网络>课程:随后网络认识烟台大学贺利坚老师,了解到2013年导教班的学习内容:注册成为CCF会员,进而提交申请书并被录取为学员. 二:一周学习总结 一周学习时间很短,收获良多.除了课堂教学,优良的培训环境(北京怀柔区红螺园饭店,离市区坐公交车需要2个小时),让学员与老师能够专注交流,早中晚的餐桌交流成为了保留节目.有一半以上的时间都尽可能与陈老师.李老师等同桌.罗斯福总统有&

Week Plan:强介入性的效率导师[转]

做产品有三重境界,以效率工具这一细分领域为例: 第一重——发现用户需求,如 Fleep,敏锐地发现团队协作中的关键——聊天,围绕这一需求做足文章; 第二重——预见用户需求,如 ProcessOn,在以文字为基础的团队协作工具风生水起的时候,预见到美工和设计师用户经过市场教育,也可以采用团队协作工具提升绘图效率; 第三重——创造用户需求,但效率工具中尚无可一统江山.主导市场话语权的王者,侈谈创造需求尚无现实性. 湍急的河流中总有鱼儿逆流而上.一般的产品研发,无论何种境界,万变不离其宗的是围绕用户需

极客编程日历2018桌面壁纸(转载及完善)

转载声明 本文转载自简书文章[极客编程日历2018桌面壁纸],并进行了补充. 图灵社区出版了一本极客编程日历"Happy Hacking 2018" ,实体已经售罄,但是提供了PDF电子版下载.我们可以编写脚本,把日历和桌面壁纸结合在一起. 作者:Paralevi链接:https://www.jianshu.com/p/912ce01d4752來源:简书 在网上看了这篇文章后对自动合成壁纸蛮感兴趣的,但是把脚本粘过来执行时一直报错,最后查了不少信息才搞定,在此进行填坑记录. 1.环境说

一些 Mysql 维护命令

----------------------------------------------------------------------------使用mysql客户端程序---------------------------------------------------------------------------- -------------------建立MySQL用户帐户------------------- --登录mysqlmysql -h hostname -u usern