September 1st Tuesday 2009

作者分享了自己对于软件开发行业的不满和个人梦想的偏离。原本希望能在其他行业有所发展,但目前仍处于困境之中。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

I felt so bad.  I had not good sleeping for days.  This is IT.  I can not say more something about IT in China.  I hated it.

I always have dreamt to get rid of the work on software development for years.  It is deflect from my original dream.

 

  As a matter of fact, many young men lost their dreams.  Nowadays, the most rich industry in China is just the estate.  Yes, it is based on our house.  Other rich industries all have the special relantions to our government, such as China Telecom, China Petrol, China Coal Mine, and so forth.

 

   In ancient China, the goal of study for ten years is to become an officer.  That is so populer in the youger in those years.  To current year, the idea is not changed.  But, many people are aware that it is not useful to get diplomas for an averger man.

 

  I am aware to it too.  I am going to deal with a little shop or a restauant by myself in the future.  However, it is just a dream so far.  It became a difficulity not easy to get over.

#include <stdio.h> #include <time.h> #include <string.h> #include "aip_common.h" int main() { time_t u4_t_time_now =time (NULL); ST tm st_t_time_members; // 改为栈分配的结构体 localtime_s(&st_t_time_members, &u4_t_time_now); // 使用安全版本 // 中文星期数组 const U1* u1p_tp_cnweeks_members[] = { "日", "一", "二", "三", "四", "五", "六" }; // 英文月份数组 const U1* u1p_tp_enmonths_members[] = { "January", "February", "March", "April", "May", "June","July", "August", "September", "October", "November", "December" }; // 英文星期数组 const U1* u1p_tp_enweeks_members[] = { "Sunday", "Monday", "Tuesday", "Wednesday","Thursday", "Friday", "Saturday" }; // 日文星期数组 const U1* u1p_tp_jpweeks_members[] = { "日", "月", "火", "水", "木", "金", "土" }; // 格式1:2017年9月28日 星期四 14点26分13秒 printf("格式1:%d年%d月%d日 星期%s %d点%d分%d秒\n", st_t_time_members.tm_year + 1900, st_t_time_members.tm_mon + 1, st_t_time_members.tm_mday, u1p_tp_cnweeks_members[st_t_time_members.tm_wday], st_t_time_members.tm_hour, st_t_time_members.tm_min, st_t_time_members.tm_sec); // 格式2:2017/9/28 星期四 14:26:13 printf("格式2:%d/%d/%d 星期%s %d:%02d:%02d\n", st_t_time_members.tm_year + 1900, st_t_time_members.tm_mon + 1, st_t_time_members.tm_mday, u1p_tp_cnweeks_members[st_t_time_members.tm_wday], st_t_time_members.tm_hour, st_t_time_members.tm_min, st_t_time_members.tm_sec); // 格式3:2017/9/28 星期四 2:26:13(PM) int hour12 = st_t_time_members.tm_hour % 12; if (hour12 == 0) { hour12 = 12; } else { // 空语句,不做任何操作 } printf("格式3:%d/%d/%d 星期%s %d:%02d:%02d(%s)\n", st_t_time_members.tm_year + 1900, st_t_time_members.tm_mon + 1, st_t_time_members.tm_mday, u1p_tp_cnweeks_members[st_t_time_members.tm_wday], hour12, st_t_time_members.tm_min, st_t_time_members.tm_sec, (st_t_time_members.tm_hour >= 12) ? "PM" : "AM"); // 格式4:Thursday, September 28, 2017 14:26:13 printf("格式4:%s, %s %d, %d %02d:%02d:%02d\n", u1p_tp_enweeks_members[st_t_time_members.tm_wday], u1p_tp_enmonths_members[st_t_time_members.tm_mon], st_t_time_members.tm_mday, st_t_time_members.tm_year + 1900, st_t_time_members.tm_hour, st_t_time_members.tm_min, st_t_time_members.tm_sec); // 格式5:2017年9月28日(木) 2:26:13(PM) printf("格式5:%d年%d月%d日(%s) %d:%02d:%02d(%s)\n", st_t_time_members.tm_year + 1900, st_t_time_members.tm_mon + 1, st_t_time_members.tm_mday, u1p_tp_jpweeks_members[st_t_time_members.tm_wday], hour12, st_t_time_members.tm_min, st_t_time_members.tm_sec, (st_t_time_members.tm_hour >= 12) ? "PM" : "AM"); return 0; } 将该代码中的三元判断语句改为ifelse语句
08-06
#include <stdio.h> #include <time.h> #include <string.h> #include "aip_common.h" #define ZERO (0) #define DEFAULT_YEAR (1900) #define DEFAULT_MON (1) #define HALFDAY (12) U4 main() { time_t u4_t_time_now = time(NULL); struct tm st_t_time_members; localtime_s(&st_t_time_members, &u4_t_time_now); // 中文星期数组 const U1* u1p_tp_cnweeks_members[] = { "日", "一", "二", "三", "四", "五", "六" }; // 英文月份数组 const U1* u1p_tp_enmonths_members[] = { "January", "February", "March", "April", "May", "June","July", "August", "September", "October", "November", "December" }; // 英文星期数组 const U1* u1p_tp_enweeks_members[] = { "Sunday", "Monday", "Tuesday", "Wednesday","Thursday", "Friday", "Saturday" }; // 日文星期数组 const U1* u1p_tp_jpweeks_members[] = { "日", "月", "火", "水", "木", "金", "土" }; // 格式1:2017年9月28日 星期四 14点26分13秒 printf("格式1:%d年%d月%d日 星期%s %d点%d分%d秒\n",st_t_time_members.tm_year + (U4)DEFAULT_YEAR, st_t_time_members.tm_mon + (U4)DEFAULT_MON, st_t_time_members.tm_mday,u1p_tp_cnweeks_members[st_t_time_members.tm_wday], st_t_time_members.tm_hour, st_t_time_members.tm_min, st_t_time_members.tm_sec); // 格式2:2017/9/28 星期四 14:26:13 printf("格式2:%d/%d/%d 星期%s %d:%02d:%02d\n",st_t_time_members.tm_year + (U4)DEFAULT_YEAR, st_t_time_members.tm_mon + (U4)DEFAULT_MON, st_t_time_members.tm_mday,u1p_tp_cnweeks_members[st_t_time_members.tm_wday], st_t_time_members.tm_hour, st_t_time_members.tm_min, st_t_time_members.tm_sec); // 格式3:2017/9/28 星期四 2:26:13(PM) U4 u4_t_time_halfday = st_t_time_members.tm_hour % (U4)HALFDAY; if ( (U4)ZERO == u4_t_time_halfday) { u4_t_time_halfday = (U4)HALFDAY; } else { } const U1* ampm_str; if ((U4)HALFDAY <= st_t_time_members.tm_hour) { ampm_str = "PM"; } else { ampm_str = "AM"; } printf("格式3:%d/%d/%d 星期%s %d:%02d:%02d(%s)\n",st_t_time_members.tm_year + (U4)DEFAULT_YEAR, st_t_time_members.tm_mon + (U4)DEFAULT_MON, st_t_time_members.tm_mday,u1p_tp_cnweeks_members[st_t_time_members.tm_wday], u4_t_time_halfday, st_t_time_members.tm_min, st_t_time_members.tm_sec,ampm_str); // 格式4:Thursday, September 28, 2017 14:26:13 printf("格式4:%s, %s %d, %d %02d:%02d:%02d\n",u1p_tp_enweeks_members[st_t_time_members.tm_wday],u1p_tp_enmonths_members[st_t_time_members.tm_mon], st_t_time_members.tm_mday, st_t_time_members.tm_year + (U4)DEFAULT_YEAR,st_t_time_members.tm_hour, st_t_time_members.tm_min, st_t_time_members.tm_sec); // 格式5:2017年9月28日(木) 2:26:13(PM) if ((U4)HALFDAY <= st_t_time_members.tm_hour) { ampm_str = "PM"; } else { ampm_str = "AM"; } printf("格式5:%d年%d月%d日(%s) %d:%02d:%02d(%s)\n",st_t_time_members.tm_year + (U4)DEFAULT_YEAR, st_t_time_members.tm_mon + (U4)DEFAULT_MON, st_t_time_members.tm_mday, u1p_tp_jpweeks_members[st_t_time_members.tm_wday], u4_t_time_halfday, st_t_time_members.tm_min, st_t_time_members.tm_sec,ampm_str); return ZERO; } 给数组加上初始化函数
08-06
#include <stdio.h> #include <windows.h> #include "time_display.h" #define MAX_TIME_STR (256) // 时间字符串最大长度 #define MAX_WEEK (7) #define MAX_MONTH (12) #define TIME_HALFDAY (12) #define TEST_ZERO (0) #define FORMAT_ERROR (0) #define TEST_ONE (1) #define TEST_FIVE (5) #define CONDITIONONE (1) #define CONDITIONTWO (2) #define CONDITIONTHREE (3) #define CONDITIONFOUR (4) #define CONDITIONFIVE (5) static const U1* u1p_sp_TIME_WEEKZH[] = { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" }; static const U1* u1p_sp_TIME_WEEKEN[] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" }; static const U1* u1p_sp_TIME_WEEKJP[] = { "日", "月", "火", "水", "木", "金", "土" }; static const U1* u1p_sp_TIME_MONTHEN[] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; static U4 u4_s_time_Format(U1 u1_a_format_index, SYSTEMTIME* stp_a_time_t, U1* u1p_a_time_bufferone, size_t u4_a_buf_size) { U4 u4_t_format_ret ; // 默认返回错误值 U2 u2_t_time_y; S1 s1_t_time_m; S1 s1_t_time_d; S1 s1_t_time_h24; S1 s1_t_time_min; S1 s1_t_time_sec; S1 s1_t_time_w; S1 s1_t_time_h12; const S1* s1p_t_TIME_AMPM; if (!u1p_a_time_bufferone || u4_a_buf_size < (U4)MAX_TIME_STR || !stp_a_time_t) { u4_t_format_ret= (U4)FORMAT_ERROR; // 直接返回错误 } else { // 时间变量提取 u2_t_time_y = (U2)stp_a_time_t->wYear; s1_t_time_m = (S1)stp_a_time_t->wMonth; s1_t_time_d = (S1)stp_a_time_t->wDay; s1_t_time_h24 = (S1)stp_a_time_t->wHour; s1_t_time_min = (S1)stp_a_time_t->wMinute; s1_t_time_sec = (S1)stp_a_time_t->wSecond; s1_t_time_w = (S1)stp_a_time_t->wDayOfWeek; if ((U1)TEST_ZERO == s1_t_time_h24 % (U1)TIME_HALFDAY) { s1_t_time_h12 = (U1)TIME_HALFDAY; } else { s1_t_time_h12 = s1_t_time_h24 % (U1)TIME_HALFDAY; } if (s1_t_time_h24 >= (U1)TIME_HALFDAY) { s1p_t_TIME_AMPM = "PM"; } else { s1p_t_TIME_AMPM = "AM"; } // 格式选择 switch (u1_a_format_index) { case (U4)CONDITIONONE: u4_t_format_ret = snprintf(u1p_a_time_bufferone, u4_a_buf_size, "格式1:%u年%u月%u日 %s %u点%u分%u秒", u2_t_time_y, s1_t_time_m, s1_t_time_d, u1p_sp_TIME_WEEKZH[s1_t_time_w], s1_t_time_h24, s1_t_time_min, s1_t_time_sec); break; case (U4)CONDITIONTWO: u4_t_format_ret = snprintf(u1p_a_time_bufferone, u4_a_buf_size, "格式2:%u/%u/%u %s %02u:%02u:%02u", u2_t_time_y, s1_t_time_m, s1_t_time_d, u1p_sp_TIME_WEEKZH[s1_t_time_w], s1_t_time_h24, s1_t_time_min, s1_t_time_sec); break; case (U4)CONDITIONTHREE: u4_t_format_ret = snprintf(u1p_a_time_bufferone, u4_a_buf_size, "格式3:%u/%u/%u %s %u:%02u:%02u(%s)", u2_t_time_y, s1_t_time_m, s1_t_time_d, u1p_sp_TIME_WEEKZH[s1_t_time_w], s1_t_time_h24, s1_t_time_min, s1_t_time_sec, s1p_t_TIME_AMPM); break; case (U4)CONDITIONFOUR: u4_t_format_ret = snprintf(u1p_a_time_bufferone, u4_a_buf_size, "格式4:%s, %s %u, %u %02u:%02u:%02u", u1p_sp_TIME_WEEKEN[s1_t_time_w], u1p_sp_TIME_MONTHEN[s1_t_time_m - 1], s1_t_time_d, u2_t_time_y, s1_t_time_h24, s1_t_time_min, s1_t_time_sec); break; case (U4)CONDITIONFIVE: u4_t_format_ret = snprintf(u1p_a_time_bufferone, u4_a_buf_size, "格式5:%u年%u月%u日(%s) %u:%02u:%02u(%s)", u2_t_time_y, s1_t_time_m, s1_t_time_d, u1p_sp_TIME_WEEKJP[s1_t_time_w], s1_t_time_h12, s1_t_time_min, s1_t_time_sec, s1p_t_TIME_AMPM); break; default: u4_t_format_ret = snprintf(u1p_a_time_bufferone, u4_a_buf_size, "[错误] 无效格式编号:%u", u1_a_format_index); break; } } return u4_t_format_ret; } // 显示指定格式的时间(使用核心格式化函数) void vd_g_time_Display_format(U1 u1_a_format_index) { SYSTEMTIME st_t_format_t; GetLocalTime(&st_t_format_t); U1 u1_tp_format_buffer[(U4)MAX_TIME_STR]; u4_s_time_Format(u1_a_format_index, &st_t_format_t, u1_tp_format_buffer, sizeof(u1_tp_format_buffer)); printf("%s\n", u1_tp_format_buffer); // 添加换行符 } // 显示所有格式的时间 void vd_g_time_Display_allformats(void) { U1 u1_t_allformats_i; for (u1_t_allformats_i = (U1)TEST_ONE; u1_t_allformats_i <= (U1)TEST_FIVE; ++u1_t_allformats_i) { vd_g_time_Display_format(u1_t_allformats_i); } } // 写入所有格式到文件(使用核心格式化函数) void vd_g_time_Write_allformats_to_file(void) { FILE* stp_t_file_fp; errno_t s4_t_file_err; SYSTEMTIME st_t_systemtime_t; U1 u1_t_file_i; U1 u1_tp_file_buffer[(U4)MAX_TIME_STR]; S4 s4_t_fclose_result; // 正确使用 fopen_s 需要三个参数:文件指针地址、文件名、打开模式 s4_t_file_err = fopen_s(&stp_t_file_fp, "time_log.txt", "a"); if ((S4)TEST_ONE!= s4_t_file_err || NULL == stp_t_file_fp) { printf("[错误] 无法打开 time_log.txt,错误码:%d\n", s4_t_file_err); return; } else { /*do nothing*/ } GetLocalTime(&st_t_systemtime_t); for (u1_t_file_i = 1; u1_t_file_i <= 5; ++u1_t_file_i) { u4_s_time_Format(u1_t_file_i, &st_t_systemtime_t, u1_tp_file_buffer, sizeof(u1_tp_file_buffer)); fprintf(stp_t_file_fp, "%s\n", u1_tp_file_buffer); // 添加换行符 } fprintf(stp_t_file_fp, "----------------------------------------\n\n"); // 增强分隔符 s4_t_fclose_result = fclose(stp_t_file_fp); if ((S4)TEST_ZERO != s4_t_fclose_result) { printf("[警告] 文件关闭失败\n"); } else { /*do nothing*/ } }添加英文注释,用/* */单行注释
08-06
内容概要:本文详细探讨了基于阻尼连续可调减振器(CDC)的半主动悬架系统的控制策略。首先建立了CDC减振器的动力学模型,验证了其阻尼特性,并通过实验确认了模型的准确性。接着,搭建了1/4车辆悬架模型,分析了不同阻尼系数对悬架性能的影响。随后,引入了PID、自适应模糊PID和模糊-PID并联三种控制策略,通过仿真比较它们的性能提升效果。研究表明,模糊-PID并联控制能最优地提升悬架综合性能,在平顺性和稳定性间取得最佳平衡。此外,还深入分析了CDC减振器的特性,优化了控制策略,并进行了系统级验证。 适用人群:从事汽车工程、机械工程及相关领域的研究人员和技术人员,尤其是对车辆悬架系统和控制策略感兴趣的读者。 使用场景及目标:①适用于研究和开发基于CDC减振器的半主动悬架系统的工程师;②帮助理解不同控制策略(如PID、模糊PID、模糊-PID并联)在悬架系统中的应用及其性能差异;③为优化车辆行驶舒适性和稳定性提供理论依据和技术支持。 其他说明:本文不仅提供了详细的数学模型和仿真代码,还通过实验数据验证了模型的准确性。对于希望深入了解CDC减振器工作原理及其控制策略的读者来说,本文是一份极具价值的参考资料。同时,文中还介绍了多种控制策略的具体实现方法及其优缺点,为后续的研究和实际应用提供了有益的借鉴。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值