stm32的TIM定时器失能后再使能是否CNT值会从0始开始

stm32的TIM定时器失能后再使能是否CNT值会从0始开始

1个回答

这个你可以自己测试一下,当使能的时候串口发送 CNT的值看看。一般是自动从零开始的。因为我用stm8的时候就是重新开始的

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
STM8S103F TIM2捕获中断进不去
#include "stm8s.h" u16 Cnt; void TextCap (void) { GPIO_Init(GPIOD, GPIO_PIN_2, GPIO_MODE_IN_PU_NO_IT); TIM2_DeInit(); TIM2_TimeBaseInit(TIM2_PRESCALER_16, 1000); TIM2_ICInit(TIM2_CHANNEL_3, TIM2_ICPOLARITY_RISING, TIM2_ICSELECTION_DIRECTTI, TIM2_ICPSC_DIV1, 0x00); TIM2_ITConfig(TIM2_IT_UPDATE, ENABLE); TIM2_ITConfig(TIM2_IT_CC3, ENABLE); TIM2_ClearITPendingBit(TIM2_IT_UPDATE); TIM2_ClearITPendingBit(TIM2_IT_CC3); TIM2_CCxCmd(TIM2_CHANNEL_3, ENABLE); TIM2_Cmd(ENABLE); } main() { TextCap(); enableInterrupts(); while (1){Cnt++;} } 中断程序如下: @far @interrupt void TIM2_Up_OverFlow(void) { TIM2_ClearFlag(TIM2_FLAG_UPDATE); } @far @interrupt void TIM2_Capture_IRQHandler(void) { TIM2_ClearFlag(TIM2_FLAG_CC3); } 我怀疑是库的问题,可是我用的库是别人用过的,理应没问题啊,头疼.
STM32F4超声波串口打印不出来,大神求救
STM32F4超声波模块测距,想串口助手显示距离打印不出来,新手求救,不仅感谢。程序如下: cs.c #include "cs.h" #include "stm32f4xx.h" #include "delay.h" #include "usart.h" /*¼Ç¼¶¨Ê±Æ÷Òç³ö´ÎÊý*/ uint overcount=0; /*ÉèÖÃÖжÏÓÅÏȼ¶*/ void NVIC_Config(void) { NVIC_InitTypeDef NVIC_InitStructer; NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2); NVIC_InitStructer.NVIC_IRQChannelPreemptionPriority=0; NVIC_InitStructer.NVIC_IRQChannelSubPriority=0; NVIC_InitStructer.NVIC_IRQChannel=TIM2_IRQn; NVIC_InitStructer.NVIC_IRQChannelCmd=ENABLE; NVIC_Init(&NVIC_InitStructer); } /*³õʼ»¯Ä£¿éµÄGPIOÒÔ¼°³õʼ»¯¶¨Ê±Æ÷TIM2*/ void CH_SR04_Init(void) { GPIO_InitTypeDef GPIO_InitStructer; TIM_TimeBaseInitTypeDef TIM_TimeBaseInitStructer; RCC_AHB1PeriphResetCmd(RCC_AHB1Periph_GPIOB, ENABLE); RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2, ENABLE); /*TRIG´¥·¢ÐźÅ*/ GPIO_InitStructer.GPIO_Speed=GPIO_Speed_50MHz; GPIO_InitStructer.GPIO_Mode=GPIO_Mode_OUT; GPIO_InitStructer.GPIO_Pin=GPIO_Pin_8; GPIO_Init(GPIOB, &GPIO_InitStructer); /*ECOH»ØÏìÐźÅ*/ GPIO_InitStructer.GPIO_Mode=GPIO_Mode_IN; GPIO_InitStructer.GPIO_Pin=GPIO_Pin_9; GPIO_Init(GPIOB, & GPIO_InitStructer); /*¶¨Ê±Æ÷TIM2³õʼ»¯*/ TIM_DeInit(TIM2); TIM_TimeBaseInitStructer.TIM_Period=999;//¶¨Ê±ÖÜÆÚ1000 TIM_TimeBaseInitStructer.TIM_Prescaler=71; //·ÖƵϵÊý72 TIM_TimeBaseInitStructer.TIM_ClockDivision=TIM_CKD_DIV1; TIM_TimeBaseInitStructer.TIM_CounterMode=TIM_CounterMode_Up; //TIM_TimeBaseInitStructer.TIM_RepetitionCounter TIM_TimeBaseInit(TIM2,&TIM_TimeBaseInitStructer); TIM_ITConfig(TIM2,TIM_IT_Update,ENABLE);//¿ªÆô¸üÐÂÖÐ¶Ï NVIC_Config(); TIM_Cmd(TIM2,DISABLE);//¹Ø±Õ¶¨Ê±Æ÷ʹÄÜ } float Senor_Using(void) { float length=0,sum=0; u16 tim; uint i=0; /*²â5´ËÊý¾Ý¼ÆËãÒ»´Îƽ¾ùÖµ*/ while(i!=5) { PBout(8)=1; //À­¸ßÐźţ¬×÷Ϊ´¥·¢ÐźŠdelay_us(20); //¸ßµçƽÐźų¬¹ý10us PBout(8)=0; /*µÈ´ý»ØÏìÐźÅ*/ while(GPIO_ReadInputDataBit(GPIOB,GPIO_Pin_9)==RESET); TIM_Cmd(TIM2,ENABLE);//»ØÏìÐźŵ½À´£¬¿ªÆô¶¨Ê±Æ÷¼ÆÊý i+=1; //ÿ´ÎÊÕµ½Ò»´Î»ØÏìÐźÅ+1,ÊÕµ½5´Î¾Í¼ÆËã¾ùÖµ while(GPIO_ReadInputDataBit(GPIOB,GPIO_Pin_9)==SET);//»ØÏìÐźÅÏûʧ TIM_Cmd(TIM2,DISABLE);//¹Ø±Õ¶¨Ê±Æ÷ tim=TIM_GetCounter(TIM2);//»ñÈ¡¼ÆTIM2Êý¼Ä´æÆ÷ÖеļÆÊýÖµ£¬Ò»±ß¼ÆËã»ØÏìÐźŠlength=(tim+overcount*1000)/58.0;//ͨ¹ý»ØÏìÐźżÆËã¾àÀë sum=length+sum; TIM2->CNT=0; //½«TIM2¼ÆÊý¼Ä´æÆ÷µÄ¼ÆÊýÖµÇåÁã overcount=0; //ÖжÏÒç³ö´ÎÊýÇåÁã delay_ms(100); } length=sum/5; return length;//¾àÀë×÷Ϊº¯Êý·µ»ØÖµ } void TIM2_IRQHandler(void) { if(TIM_GetITStatus(TIM2,TIM_IT_Update)!=RESET) { TIM_ClearITPendingBit(TIM2,TIM_IT_Update);//Çå³ýÖжϱêÖ¾ overcount++; } } 主函数 #include "stm32f4xx.h" #include "usart.h" #include "delay.h" #include "cs.h" float ChangeDistance(int cout1) { float distance=0; printf("cou1=%d\n",cout1); distance=cout1/58.0; return distance; } int main(void) { NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);//ÉèÖÃϵͳÖжÏÓÅÏȼ¶·Ö×é2 delay_init(168); //ÑÓʱ³õʼ»¯ uart_init(115200); //´®¿Ú³õʼ»¯²¨ÌØÂÊΪ115200 // int count=0; // float distance=0; CH_SR04_Init(); printf("Senor_Using\n"); }
stm32f103串口发送问题
TimeVal = TIM4->CNT; TimeVal = TimeVal; datal = TimeVal & 0x00ff; //取低八位 datah = TimeVal & 0xff00; //取高八位 dataz = (char)datal; USART_SendData(USART1, dataz); while(USART_GetFlagStatus(USART1, USART_FLAG_TXE)==RESET); //判断是否发送完毕 TimeVal = 0; 为什么我串口接收到的数据乱码?
cnt变量的值为什么会无故变动?
(新手学习中)以下是一个关于归并排序的函数。一开始cnt初始化为0(本来应该是plo),然后奇怪的事发生了:在调试时cnt的值开始随意的变化(以下各图均是运行一步的结果)。求大神解答原因。![图片说明](https://img-ask.csdn.net/upload/201608/18/1471531289_360990.png)![图片说明](https://img-ask.csdn.net/upload/201608/18/1471531294_754598.png)![图片说明](https://img-ask.csdn.net/upload/201608/18/1471531423_198911.png)![图片说明](https://img-ask.csdn.net/upload/201608/18/1471531428_889320.png)![图片说明](https://img-ask.csdn.net/upload/201608/18/1471531435_426713.png)![图片说明](https://img-ask.csdn.net/upload/201608/18/1471531444_869118.png)![图片说明](https://img-ask.csdn.net/upload/201608/18/1471531329_54318.png)![图片说明](https://img-ask.csdn.net/upload/201608/18/1471531335_102314.png)![图片说明](https://img-ask.csdn.net/upload/201608/18/1471531462_947493.png)
小白一枚,回文串和安全密码问题在codeblock运行没啥问题,但是oj上显示答案错误,大佬们能帮忙看看吗
#include <bits/stdc++.h>///安全密码 using namespace std; int main() { char s[55]; while(scanf("%s",&s)!=EOF){ int len =strlen(s); if(len<8){ printf("NO\n"); continue; } bool low= false,up=false,sng=false,num=false; for(int i=0;i<=len;i++){ if(isdigit(s[i]))num=true; else if(islower(s[i]))low=true; else if(isupper(s[i]))up=true; else sng=true; } int cnt=0; if(low)cnt++; if(up)cnt++; if(num)cnt++; if(sng)cnt++; if(cnt>=3)printf("YES\n"); else printf("NO\n"); } return 0; } #include <bits/stdc++.h>///回文串 using namespace std; char s[103]; bool judge(){ int len=strlen(s); for(int i=0;i<len/2;i++){ if(s[i]!=s[len-i-1])return false; } return true; } int main() { int T=1; while(scanf("%s",&s)!=EOF){ if(judge())printf("case%d:yes\n",T++); else printf("case%d:no\n",T++); } }
stm32f103 can总线回环测试可用,分析仪有数据,正常模式没有数据
各位大佬好,这几天一直在调stm32的can通讯,好几天了都没做出来~~~~~~~,来这里求救了!!!!!!!我使用的是stm32f103rct6单片机,使用的程序模板是原子哥ALIENTEK 战舰 STM32F103 开发板can实验教程,使用的can收发器是ISO1050,手里有一个个usb/can转换器。现在单片机canRX,TX接到IS01050,1050出来的CANH、CANL接到转换器的CANH\CANL,没有接反。 设置成回环测试的时候,电脑通过转化器可以收到单片机发出的数据,数据也没有错误。设置成正常模式,单片机就发不出数据了。 PCB板上加了两个led,用来指示单片机引脚的canRX、TX引脚。正常模式的时候这两个灯没有回环测试的时候亮,基本上亮不起来了,而且正常模式的时候闪十几下就不亮了。 下面是配置程序: u8 CAN_Mode_Init(u8 tsjw,u8 tbs2,u8 tbs1,u16 brp,u8 mode) { GPIO_InitTypeDef GPIO_InitStructure; CAN_InitTypeDef CAN_InitStructure; CAN_FilterInitTypeDef CAN_FilterInitStructure; RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);//ê1ÄüPORTAê±Öó RCC_APB1PeriphClockCmd(RCC_APB1Periph_CAN1, ENABLE);//ê1ÄüCAN1ê±Öó GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; //¸′óÃíÆíì GPIO_Init(GPIOA, &GPIO_InitStructure); //3õê¼»ˉIO GPIO_InitStructure.GPIO_Pin = GPIO_Pin_11; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU; //éÏà-êäèë GPIO_Init(GPIOA, &GPIO_InitStructure); //3õê¼»ˉIO //CANμ¥ÔaéèÖà CAN_InitStructure.CAN_TTCM=DISABLE; //·Çê±¼ä′¥·¢í¨DÅÄ£ê½ CAN_InitStructure.CAN_ABOM=DISABLE; //èí¼t×Ô¶ˉàëÏß1üàí CAN_InitStructure.CAN_AWUM=DISABLE; //ËˉÃßÄ£ê½í¨1yèí¼t»½DÑ(Çå3yCAN->MCRμÄSLEEPλ) CAN_InitStructure.CAN_NART=ENABLE; //½ûÖ1±¨ÎÄ×Ô¶ˉ′«Ëí CAN_InitStructure.CAN_RFLM=DISABLE; //±¨ÎÄ2»Ëø¶¨,DÂμĸ2¸Ç¾éμÄ CAN_InitStructure.CAN_TXFP=DISABLE; //óÅÏ輶ó鱨Îıê궷û¾ö¶¨ CAN_InitStructure.CAN_Mode= mode; //Ä£ê½éèÖão mode:0,ÆÕí¨Ä£ê½;1,»Ø»·Ä£ê½; //éèÖÃ2¨ìØÂê CAN_InitStructure.CAN_SJW=tsjw; //ÖØDÂí¬2½ìøÔ¾¿í¶è(Tsjw)Îatsjw+1¸öê±¼äμ¥λ CAN_SJW_1tq CAN_SJW_2tq CAN_SJW_3tq CAN_SJW_4tq CAN_InitStructure.CAN_BS1=tbs1; //Tbs1=tbs1+1¸öê±¼äμ¥λCAN_BS1_1tq ~CAN_BS1_16tq CAN_InitStructure.CAN_BS2=tbs2; //Tbs2=tbs2+1¸öê±¼äμ¥λCAN_BS2_1tq ~ CAN_BS2_8tq CAN_InitStructure.CAN_Prescaler=brp; //·ÖÆμÏμêy(Fdiv)Îabrp+1 CAN_Init(CAN1, &CAN_InitStructure); //3õê¼»ˉCAN1 CAN_FilterInitStructure.CAN_FilterNumber=0; //1yÂËÆ÷0 CAN_FilterInitStructure.CAN_FilterMode=CAN_FilterMode_IdMask; //Æá±ÎλÄ£ê½ CAN_FilterInitStructure.CAN_FilterScale=CAN_FilterScale_32bit; //32λ¿í CAN_FilterInitStructure.CAN_FilterIdHigh=0x0000; //32λID CAN_FilterInitStructure.CAN_FilterIdLow=0x0000; CAN_FilterInitStructure.CAN_FilterMaskIdHigh=0x0000;//32λMASK CAN_FilterInitStructure.CAN_FilterMaskIdLow=0x0000; CAN_FilterInitStructure.CAN_FilterFIFOAssignment=CAN_Filter_FIFO0;//1yÂËÆ÷01Øáaμ½FIFO0 CAN_FilterInitStructure.CAN_FilterActivation=ENABLE;//¼¤»î1yÂËÆ÷0 CAN_FilterInit(&CAN_FilterInitStructure); //ÂË2¨Æ÷3õê¼»ˉ return 0; } //can·¢Ëíò»×éêy¾Y(1춨¸ñê½:IDÎa0X12,±ê×¼Ö¡,êy¾YÖ¡) //len:êy¾Y3¤¶è(×î′óÎa8) //msg:êy¾YÖ¸Õë,×î′óÎa8¸ö×Ö½ú. //·μ»ØÖμ:0,3é1|; // ÆäËû,꧰ü; u8 Can_Send_Msg(u8* msg,u8 len) { u8 mbox; u16 i=0; CanTxMsg TxMessage; TxMessage.StdId=0x12; // ±ê×¼±ê궷û TxMessage.ExtId=0x12; // éèÖÃà©Õ1±êê¾·û TxMessage.IDE=CAN_Id_Standard; // ±ê×¼Ö¡ TxMessage.RTR=CAN_RTR_Data; // êy¾YÖ¡ TxMessage.DLC=len; // òa·¢ËíμÄêy¾Y3¤¶è for(i=0;i<len;i++) TxMessage.Data[i]=msg[i]; mbox= CAN_Transmit(CAN1, &TxMessage); i=0; while((CAN_TransmitStatus(CAN1, mbox)==CAN_TxStatus_Failed)&&(i<0XFFF))i++; //μè′y·¢Ëí½áêø if(i>=0XFFF)return 1; return 0; } //can¿ú½óêÕêy¾Y2éÑˉ //buf:êy¾Y»o′æÇø; //·μ»ØÖμ:0,ÎTêy¾Y±»êÕμ½; // ÆäËû,½óêÕμÄêy¾Y3¤¶è; u8 Can_Receive_Msg(u8 *buf) { u32 i; CanRxMsg RxMessage; if( CAN_MessagePending(CAN1,CAN_FIFO0)==0)return 0; //ûóD½óêÕμ½êy¾Y,Ö±½óíË3ö CAN_Receive(CAN1, CAN_FIFO0, &RxMessage);//¶áè¡êy¾Y for(i=0;i<8;i++) buf[i]=RxMessage.Data[i]; return RxMessage.DLC; } 下面是主程序: #include "led.h" #include "delay.h" //#include "key.h" #include "sys.h" //#include "lcd.h" //#include "usart.h" #include "can.h" int main(void) { u8 key; u8 i=0,t=0; u8 cnt=0; u8 canbuf[8]; u8 res; u8 mode=CAN_Mode_LoopBack;//CAN1¤×÷Ä£ê½;CAN_Mode_Normal(0)£oÆÕí¨Ä£ê½£¬CAN_Mode_LoopBack(1)£o»·»ØÄ£ê½ delay_init(); //Ñóê±oˉêy3õê¼»ˉ //NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);//éèÖÃÖD¶ÏóÅÏ輶·Ö×éÎa×é2£o2λÇàÕ¼óÅÏ輶£¬2λÏìó|óÅÏ輶 //uart_init(115200); //′®¿ú3õê¼»ˉÎa115200 CAN_Mode_Init(CAN_SJW_1tq,CAN_BS2_8tq,CAN_BS1_9tq,20,CAN_Mode_Normal);//CAN3õê¼»ˉ»·»ØÄ£ê½,2¨ìØÂê100Kbps CAN_Mode_LoopBack CAN_Mode_Normal while(1) { for(i=0;i<8;i++) { canbuf[i]=cnt+i;//ìî3ä·¢Ëí»o3åÇø } res=Can_Send_Msg(canbuf,8);//·¢Ëí8¸ö×Ö½ú delay_ms(1500); } }![![图片说明](https://img-ask.csdn.net/upload/201711/23/1511431715_397768.png)图片说明](https://img-ask.csdn.net/upload/201711/23/1511431708_572832.png)
杭电adc2034这题 我到底错在哪里呀 本地通过了 提交就是通过不了
#include <stdio.h> int main() { int n,m,i,j; while(scanf("%d %d",&n,&m)!=EOF) { if(n==0&&m==0)break; int c = n+m; int num[200]; //录入数据 for(i=0;i<c;i++) { scanf("%d",&num[i]); } //将重复数据取0 for(i=0;i<n;i++) { for(j=n;j<c;j++) { if(num[i]==num[j]) { num[i]=0; break; } } } //记录重复个数 int cnt=0; for(i=0;i<n;i++) { if(num[i]==0) { cnt++; } } //将0后移 int temp=num[0]; for(i=0;i<n;i++) { if(num[i]==0) { temp = num[i]; num[i]=num[i+1]; num[i+1]=temp; } } //如果A中0为n 则输出NULL if(cnt==n)printf("NULL\n"); //否则 else { //将A中n-cnt个非0元素排序 int temp2=num[0]; for(i=0;i<n-cnt;i++) { for(j=i+1;j<n-cnt;j++) if(num[i]>num[j]) { temp2 = num[i]; num[i] = num[j]; num[j]=temp2; } } //输出排序后的数组 for(i=0;i<n-cnt;i++) { printf("%d ",num[i]); } printf("\n"); } } }
求详解opencv中形状匹配matchShapes的代码参数及返回值!
先贴代码 ``` import cv2 import numpy as np img = cv2.imread('img7.png',0) img2 = cv2.imread('img9.png',0) ret, thresh = cv2.threshold(img, 127, 255,0) ret, thresh2 = cv2.threshold(img2, 127, 255,0) im2,contours,hierarchy = cv2.findContours(thresh,2,1) cnt1 = contours[0] im2,contours,hierarchy = cv2.findContours(thresh2,2,1) cnt2 = contours[0] ret = cv2.matchShapes(cnt1,cnt2,1,0.0) print( ret ) ``` 1.主要是不知道findContours中的3个参数中后两个的含义, 不知道(2,1)与(1,2)是什么意思. 2.findContours的3个返回值的含义
帮忙看下导入导出 和排序有问题 没有 本人新手也看不出啥问题,就运行不出来 ,学生类我放在后面的。
package xuejiguanli; import jxl.*; import jxl.Workbook; import jxl.format.Colour; import jxl.format.UnderlineStyle; import jxl.format.VerticalAlignment; import jxl.read.biff.BiffException; import jxl.write.WritableSheet; import jxl.write.WritableWorkbook; import jxl.write.WriteException; import jxl.write.biff.RowsExceededException; import jxl.write.Label; import jxl.write.WritableCellFormat; import jxl.write.WritableFont; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; import java.util.List; import java.util.Scanner; import javax.swing.GroupLayout.Alignment; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; //-------------------------------------------------------------------这是成绩管理系统的主界面 public class xueshengdei{ public static void main(String[] args) { List<Student> Students = new ArrayList<>(); while(true) { //----------------------------------------------------------------------菜单 System.out.println("-----------------学生管理系统----------------"); System.out.println("-------欢迎使用重庆工程学院学籍管理系统-------"); System.out.println("你可以使用的功能如下:^_^"); System.out.println(" 1-------------增加学生信息"); System.out.println(" 2-------------删除学生信息"); System.out.println(" 3-------------修改学生信息"); System.out.println(" 4-------------查看单独学生信息"); System.out.println(" 5-------------查看所有学生的信息"); System.out.println(" 6-------------对当前所有学生进行升序排序"); System.out.println(" 7-------------查看学校通知"); System.out.println(" 8-------------导入学生信息"); System.out.println(" 9-------------导出学生信息"); System.out.println(" 10------------退出该系统"); Scanner sc =new Scanner(System.in); System.out.println("请输入序号选择其对应的功能:"); String j = sc.nextLine(); switch (j) { case "1": //增加学生 addstudent(Students); break; case "2": //删除学生 deletestudent(Students); break; case "3": //修改学生 changestudent(Students); break; case "4": //单独查找 singlefind(Students); break; case "5": //查看所有学生 findstudent(Students); break; case "6": //排序 System.out.println("请输入你要是实现的排序功能:"); Scanner s =new Scanner(System.in); System.out.println("1---------------成绩排序:"); System.out.println("2---------------年龄排序:"); System.out.println("3---------------学号排序:"); String second=s.nextLine(); switch(second) { case "1": paixu(Students);break; case "2": paixu3(Students); break; case "3": paixu2(Students); break; } break; case "7": tongzhi(Students); //查看学校通知 break; case "8": exceldaoru(Students); //导入学生信息 break; case "9": daochu(Students); //导出学生信息 break; case "10": System.out.println("谢谢你的使用!"); System.exit(0);//退出 default: System.out.println("输入错误请重新输入!"); break; } } } //--------------------------------------------------------------导出 public static void daochu(List<Student> Students) { String excelpath; Scanner scanner=new Scanner(System.in); System.out.println("操作:导出数据"); System.out.println("请输入导出Excel文件路径:"); excelpath = scanner.next(); try { FileOutputStream fos = new FileOutputStream(excelpath); WritableWorkbook wwb = Workbook.createWorkbook(fos); // 创建工作表 WritableSheet ws = wwb.createSheet("学生学籍表", 10); // 设置单元格的文字格式 WritableFont wf = new WritableFont(WritableFont.ARIAL, 12, WritableFont.NO_BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.BLACK); WritableCellFormat wcf = new WritableCellFormat(wf); wcf.setVerticalAlignment(VerticalAlignment.CENTRE); ws.setColumnView(4, 10); ws.setColumnView(5, 16); ws.setColumnView(0, 14); ws.addCell(new Label(0, 0, "学号", wcf)); ws.addCell(new Label(1, 0, "姓名", wcf)); ws.addCell(new Label(2, 0, "年龄", wcf)); ws.addCell(new Label(3, 0, "性别", wcf)); ws.addCell(new Label(4, 0, "成绩", wcf)); // 填充数据的内容 // 匹配学生学号 System.out.println("所有学生学籍信息如下:"); int cnt = 1; while (cnt <= Students.size()) { Student s = (Student) Students.get(cnt - 1); ws.addCell(new Label(4, cnt, String.valueOf(s.getId()), wcf)); ws.addCell(new Label(1, cnt, String.valueOf(s.getName()), wcf)); ws.addCell(new Label(2, cnt, String.valueOf(s.getAge()), wcf)); ws.addCell(new Label(3, cnt, String.valueOf(s.getSex()), wcf)); ws.addCell(new Label(4, cnt, String.valueOf(s.getScore()), wcf)); cnt++; if (cnt == 0) wcf = new WritableCellFormat(); } wwb.write(); wwb.close(); System.out.println("学生信息导出成功!"); } catch (IOException e) { e.printStackTrace(); } catch (RowsExceededException e) { e.printStackTrace(); } catch (WriteException e) { e.printStackTrace(); } } //---------------------------------------------------------------导入 public static void exceldaoru(List<Student> Students) { Scanner scanner=new Scanner(System.in); String excelpath; excelpath = scanner.next(); WritableWorkbook book = null; try { // 创建一个Excel文件对象 FileOutputStream fos = new FileOutputStream(excelpath); // 创建Excel第一个选项卡对象 WritableWorkbook book1 = Workbook.createWorkbook(new File(excelpath)); WritableSheet sheet = book1.createSheet("第一页", 0); // 设置表头,第一行内容 // Label参数说明:第一个是列,第二个是行,第三个是要写入的数据值,索引值都是从0开始 Label label1 = new Label(0, 0, "学号");// 对应为第1列第1行的数据 Label label2 = new Label(1, 0, "姓名");// 对应为第2列第1行的数据 Label label3 = new Label(2, 0, "年龄");// 对应为第3列第1行的数据 Label label4 = new Label(3, 0, "性别");// 对应为第4列第1行的数据 // 添加单元格到选项卡中 sheet.addCell(label1); sheet.addCell(label2); sheet.addCell(label3); sheet.addCell(label4); // 遍历集合并添加数据到行,每行对应一个对象 for (int i = 0; i < Students.size(); i++) { Student s = Students.get(i); // 表头占据第一行,所以下面行数是索引值+1 // 跟上面添加表头一样添加单元格数据,这里为了方便直接使用链式编程 sheet.addCell(new Label(0, i + 1, s.getId()+"")); sheet.addCell(new Label(1, i + 1, s.getName())); sheet.addCell(new Label(2, i + 1, s.getAge()+"")); sheet.addCell(new Label(3, i + 1, s.getSex())); sheet.addCell(new Label(4, i + 1, s.getScore()+"")); } // 写入数据到目标文件 book.write(); } catch (Exception e) { e.printStackTrace(); } finally { try { // 关闭 book.close(); } catch (Exception e) { e.printStackTrace(); } } } //----------------------------------------------------------------------------------通知 public static void tongzhi(List<Student> Students) { int index = -1; if(Students.size()==0) { System.out.println("请你输入学生后再来查看通知,谢谢!"); return; } int[] point = new int[100]; for (int i = 0; i < Students.size(); i++) { Student s = Students.get(i); point[i] = s.getScore(); } for (int i = 0; i < Students.size(); i++) { if (point[i]<60){ Student s = Students.get(i); System.out.println(s.getName()+"同学,你收到的通知如下:"); System.out.println("恭喜你挂科了"); System.out.println("恭喜你挂科了"); System.out.println("恭喜你挂科了"); System.out.println("重要的事情说三遍"); } else { Student s = Students.get(i); System.out.println(s.getName()+"同学,你收到的通知如下:"); System.out.println("哎呦不错哟"); System.out.println("恭喜你没有挂科"); } } } //-----------------------------------------------------------------------------------成绩排序 public static void paixu(List<Student> Students) { if(Students.size()==0) { System.out.println("不好意思,目前还没有学生的信息可供排序,请返回重新操作!"); return; } int[] point = new int[100]; for (int i = 0; i < Students.size(); i++) { Student s = Students.get(i); point[i] = s.getScore(); Arrays.sort(point); } for (int j = 0; j < point.length; j++) { for (int i = 0; i < Students.size(); i++) { if (point[j]==Students.get(i).getScore()){ Student s = Students.get(i); System.out.println("学号\t姓名\t年龄\t性别\t成绩"); System.out.println(s.getId()+"\t"+s.getName()+"\t"+s.getAge()+"\t"+s.getSex()+"\t"+s.getScore()); } } } } //--------------------------------------------------------------------学号排序 public static void paixu2(List<Student> Students) { if(Students.size()==0) { System.out.println("不好意思,目前还没有学生的信息可供排序,请返回重新操作!"); return; } int[] point = new int[10000000]; for (int i = 0; i < Students.size(); i++) { Student s = Students.get(i); point[i] = s.getId(); Arrays.sort(point); } for (int j = 0; j < point.length; j++) { for (int i = 0; i < Students.size(); i++) { if (point[j]==Students.get(i).getId()){ Student s = Students.get(i); System.out.println("学号\t姓名\t年龄\t性别\t成绩"); System.out.println(s.getId()+"\t"+s.getName()+"\t"+s.getAge()+"\t"+s.getSex()+"\t"+s.getScore()); } } } } //---------------------------------------------------------------------------------------年龄排序 public static void paixu3(List<Student> Students) { if(Students.size()==0) { System.out.println("不好意思,目前还没有学生的信息可供排序,请返回重新操作!"); return; } int[] point = new int[100]; for (int i = 0; i < Students.size(); i++) { Student s = Students.get(i); point[i] = s.getAge(); Arrays.sort(point); } for (int j = 0; j < point.length; j++) { for (int i = 0; i < Students.size(); i++) { if (point[j]==Students.get(i).getAge()){ Student s = Students.get(i); System.out.println("学号\t姓名\t年龄\t性别\t成绩"); System.out.println(s.getId()+"\t"+s.getName()+"\t"+s.getAge()+"\t"+s.getSex()+"\t"+s.getScore()); } } } } //-------------------------------------------------------------------------------------------添加 public static void addstudent(List<Student> Students) { //创建键盘录入对象 Scanner sc= new Scanner(System.in); while(true) { System.out.println("请输入学号:"); int id= sc.nextInt(); System.out.println("请输入姓名:"); String name = sc.nextLine(); System.out.println("请输入年龄:"); int age = sc.nextInt(); System.out.println("请输入性别:"); String sex = sc.nextLine(); System.out.println("请输入成绩:"); int score = sc.nextInt(); //创建学生对象 Student s = new Student(); s.setId(id); s.setName(name); s.setAge(age); s.setSex(sex); s.setScore(score); //把学生对象添加到集合 Students.add(s); break; } System.out.println("添加学生成功!"); } //-----------------------------------------------------------------------------------------(查找所有学生) public static void findstudent(List<Student> Students) { if(Students.size()==0) { System.out.println("不好意思,目前还没有学生的信息可供查询,请返回重新操作!"); return; } for(int i=0;i<Students.size();i++) { Student s = Students.get(i); System.out.println("学号:"+s.getId()+"\n姓名:"+s.getName()+"\n性别:"+s.getSex()+"\n年龄:"+s.getAge()+"\n成绩:"+s.getScore()); } } //----------------------------------------------单独查找----------------------------------------------- public static void singlefind(List<Student> students) { Scanner sc=new Scanner(System.in); System.out.println("请输入要查找的学号"); int findId=sc.nextInt(); int index = -1; for(int i=0;i<students.size();i++) { Student s = students.get(i); if(s.getId()==findId) { index=i; } if (index == -1) { System.out.println("你要查找的学生不存在,请重新选择!"); }else { System.out.println("学号:"+s.getId()+"\n姓名:"+s.getName()+"\n性别:"+s.getSex()+"\n年龄:"+s.getAge()+"\n成绩:"+s.getScore()); } } } //------------------------------------------------------------------------------------------------删除 public static void deletestudent(List<Student> Students) { Scanner sc= new Scanner(System.in); System.out.print("请输入要删除的学号:"); int deleId = sc.nextInt(); int index = -1; for(int i=0;i<Students.size();i++) { Student s = Students.get(i); if(s.getId()==deleId) { index=i; } if (index == -1) { System.out.println("你要删除的学生不存在,请重新选择!"); } else { Students.remove(index); System.out.println("删除学生成功!!"); } } } //---------------------------------------------------------------------------------------修改 public static void changestudent(List<Student> students) { Scanner sc= new Scanner(System.in); System.out.print("请输入要改变的学号:"); int changeId = sc.nextInt(); int index = -1; for(int i=0;i<students.size();i++) { Student s = students.get(i); if(s.getId()==changeId) { index = i; } } if (index == -1) { System.out.println("您要改变的学生不存在,请重新操作!"); } else { System.out.println("请输入新的姓名:"); String name = sc.nextLine(); System.out.println("请输入新的年龄:"); int age = sc.nextInt(); System.out.println("请输入新的性别:"); String sex = sc.nextLine(); System.out.println("请输入新的成绩:"); int score = sc.nextInt(); //创建学生对象 Student s = new Student(); s.setId(changeId); s.setName(name); s.setAge(age); s.setSex(sex); s.setScore(score); //修改学生对象 students.set(index,s); System.out.println("修改学生成功!!!"); } } } //学生类 package xuejiguanli; public class Student { private String name; private int Id; private int age; private String sex; private int score; public Student() { } public Student(String name, int Id, int age, String sex,int score) { super(); this.name = name; this.Id = Id; this.age = age; this.sex = sex; this.score =score; } public String getName() { return name; }//姓名 public int getId() { return Id; }//学号 public int getAge() { return age; }//年龄 public String getSex() { return sex; }//性别 public int getScore() { return score; }//成绩 public void setName(String name) { this.name = name; } public void setId(int Id) { this.Id = Id; } public void setAge(int age) { this.age = age; } public void setSex(String sex) { this.sex = sex; } public void setScore(int score) { this.score = score; } }
C++ 类的引用成员初始化问题
代码如下 ``` struct A { int &cnt; A(int i=10):cnt(i){} //这里的 i 不是引用传参 A(const A &a):cnt(a.cnt){cnt++;} }; int main() { A a1(100); cout<<a1.cnt<<' '; // 输出100 A a2 (a1); cout<<a1.cnt<<' '<<a2.cnt<<endl; //输出两个相同的随机数 a2.cnt=0; cout<<a1.cnt<<' '<<a2.cnt<<endl; //输出 0 0 } ``` 输出为 32766 32766 1 1 。 原本是想在struct A中定义一个引用成员,让A的多个对象共同对cnt进行操作,奇怪的是上面的初始化出了问题,但把cnt重新赋值后,后面的操作就正常了,有大佬能解释一下为什么会有这种现象吗
怎样才能把下列代码改成输出5个不一样的?
#include <stdlib.h> #include <stdio.h> #include <time.h> void getgh(unsigned char * dest1, const unsigned int len1) { const unsigned char allChar1[11] = "0123456789"; unsigned int cnt1, randNo1; srand((unsigned int)time(NULL)); for (cnt1 = 0; cnt1<len1; cnt1++) { randNo1 = rand() % 10; *dest1 = allChar1[randNo1]; dest1++; } } main() { int i=0,n=5; FILE *fp=fopen("data2.txt","a"); for(i=0;i<n;i++) { const unsigned int strlen1 = 10; unsigned char gh[strlen1 + 1] = {}; getgh(gh, strlen1); fprintf(fp,"%s\n", gh); } fclose(fp); //关闭文件 printf("已随机生成数据!"); return 0; }
两个ARM间的SPI通信怎么实现?ARM型号均为STM32F429ZIT。
发送时,采取的函数为HAL_SPI_Transmit_IT(); 接收时,由于不知道对方发过来的报文长度, 就不知道用什么函数。厂家提供的软件包里面的receive函数都需要 指定size长度。 下面的代码中,我在最开始开启SPI_IT_RXNE中断使能。 通过中断函数和数据处理函数来解析报文。并把报文上传网络服务器。 但是ARM SPI接收不到数据。不知道为啥? 本代码为SPI主机的。 /* SPI5 init function */ void MX_SPI5_Init(void) { hspi5.Instance = SPI5; hspi5.Init.Mode = SPI_MODE_MASTER; hspi5.Init.Direction = SPI_DIRECTION_2LINES; hspi5.Init.DataSize = SPI_DATASIZE_8BIT; hspi5.Init.CLKPolarity = SPI_POLARITY_LOW; hspi5.Init.CLKPhase = SPI_PHASE_1EDGE; hspi5.Init.NSS = SPI_NSS_SOFT; hspi5.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_4; hspi5.Init.FirstBit = SPI_FIRSTBIT_MSB; hspi5.Init.TIMode = SPI_TIMODE_DISABLED; hspi5.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLED; HAL_SPI_Init(&hspi5); } /** * @brief Initializes the SPI according to the specified parameters * in the SPI_InitTypeDef and create the associated handle. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @retval HAL status */ HAL_StatusTypeDef HAL_SPI_Init(SPI_HandleTypeDef *hspi) { ..... HAL_SPI_MspInit(hspi); ...... } void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi) { GPIO_InitTypeDef GPIO_InitStruct; if(hspi->Instance==SPI4) { /* Peripheral clock enable */ __SPI4_CLK_ENABLE(); /**SPI4 GPIO Configuration PE2 ------> SPI4_SCK PE5 ------> SPI4_MISO PE6 ------> SPI4_MOSI */ GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_5|GPIO_PIN_6; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_LOW; GPIO_InitStruct.Alternate = GPIO_AF5_SPI4; HAL_GPIO_Init(GPIOE, &GPIO_InitStruct); } if(hspi->Instance==SPI5) { /* Peripheral clock enable */ __SPI5_CLK_ENABLE(); /**SPI5 GPIO Configuration PF7 ------> SPI5_SCK PF8 ------> SPI5_MISO PF9 ------> SPI5_MOSI */ GPIO_InitStruct.Pin = GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_LOW; GPIO_InitStruct.Alternate = GPIO_AF5_SPI5; HAL_GPIO_Init(GPIOF, &GPIO_InitStruct); } } main() { MX_SPI5_Init(); __HAL_SPI_ENABLE_IT(&hspi5, SPI_IT_RXNE); while (1) { SPI5_Master_Rx(); //读取从机发过来的数据。 } } typedef uint8_t u8 ; typedef uint16_t u16 ; typedef uint32_t u32 ; u8 hmosi[50]={0}; u8 mosi1[50]={0}; u8 phmosi[50]={0}; u32 imosi=0; u32 spi5_rx_len; u32 ic=0; #define comsize 8 extern u16 tSession; u32 udata_len_spi; extern u16 ports[comsize+1]; extern u32 uTimeLst; extern SPI_HandleTypeDef hspi5; void SPI5_IRQHandler(void) { if(__HAL_SPI_GET_FLAG(&hspi5, SPI_FLAG_RXNE) == SET) { hmosi[imosi++]=(uint8_t)(hspi5.Instance->DR); } } void SPI5_Master_Rx(void) { //for(;imosi>=(ic+7);ic++) for(;imosi>=(ic+5);ic++) { if((0x2e==hmosi[ic])&&(0x17==hmosi[ic+1])&&(0x0==hmosi[ic+2])) { spi5_rx_len=hmosi[ic+6]; udata_len_spi = spi5_rx_len+1; memset(phmosi,0x00,udata_len_spi); phmosi[5]=hmosi[ic+5]; phmosi[6]=spi5_rx_len-7; memcpy(phmosi+7,hmosi+ic+7,spi5_rx_len-7); memcpy(mosi1,hmosi+ic,50-ic); memcpy(hmosi,mosi1,50-ic); imosi=imosi-ic; ic=0; //************************** tSession++; phmosi[0]=0x2e; phmosi[1]=0x17; phmosi[2]=0x00; phmosi[3]=tSession; phmosi[4]=(tSession>>8); //memcpy(udata+7,tx1_buf,rx1cnt); phmosi[udata_len_spi-1] = crc(phmosi,udata_len_spi-1,1); com2net(ports[0],udata_len_spi,phmosi); uTimeLst=HAL_GetTick(); } } }
将两个无序的一维数组排序,然后将其合并到一个一维数组中,仍保持数组有序。
程序调试失败;program received signal SIGFPE ``` #include <stdio.h> int sort(int *p, int x) { int m, n, i; for (i=0; i<x-1; i++){ for (m=0; m<x-i-1; m++){ if (*p+m>*p+m+1){ n=*(p+m); *(p+m+1)=*(p+m); *(p+m)=n; } } } return *p; } void print(int num[], int x) { int cnt; for(cnt=0; cnt<x; cnt++) printf ("%d", num[cnt]); } int main() { int i, x, y, z, m, n; printf ("请输入两组数组的长度:"); scanf ("%d %d", &x, &y); z=x+y; int num1[x],num2[y],num3[z]; printf ("请输入第一组数组中的数:"); for (i=0; i<x; i++){ scanf ("%d", &num1[i]); num3[i]=num1[i]; } printf ("请输入第二组数组中的数:"); for (i=0; i<x; i++){ scanf ("%d", &num2[i]); num3[x+i]=num2[i]; } sort (num1[x], x); sort (num2[y], y); sort (num3[z], z); print (num1[x], x); print (num2[y], y); print (num3[z], z); return 0; } ```
【Verilog语句】用的quartus17.1,程序编译没有问题,但模块一直调用不出来,求大佬帮看
在网上看了一些关于调用模块的方法,大多是模块使用的语法,具体的使用都没有 就发个贴想求一个大佬讲解一些 ``` module LED(clk_50m,clk_1hz,reset,pause,led); input clk_50m,reset,pause; output clk_1hz; output reg [1:0] led; clk_50M U1(reset,pause,clk_50m,clk_1hz); always@(posedge clk_1hz or negedge reset or negedge pause) begin if(!reset) begin led <= 2'b11; end else if(!pause) begin led = led; end else if(led == 2'b00) begin led = 2'b11; end else led <= led - 1; end endmodule module clk_50M(reset,pause,clk_50m,clk_1hz); input clk_50m; input reset; input pause; output clk_1hz; reg clk_1hz; reg [24:0] cnt; always@(posedge clk_50m or negedge reset or negedge pause) begin if(!reset) begin cnt = 25'd0; end else if(!pause) begin cnt <= cnt; end else if(cnt > 25'd25000000) begin cnt = 25'd0; clk_1hz <= ~ clk_1hz; end else cnt <= cnt + 1'b1; end endmodule ``` 这个程序是用来写模4的减法器(刚刚开始学FPGA),然后主模块调用分频模块时,clk1hz始终没有输出。最初的想法是调用函数以后,以为会有clk1hz的输出,然后接着在always里面使用。我觉得可能是我对模块调用有一些误解,希望大佬解释!!!!
ise verilog 制作数字时钟,数码管引脚问题 signal is connected to multiple drivers
源代码以及管教设计如下 module clock(clk,clk_div,set_mod,set_option,time_add,option_1,qout, secL_1,secH_1,minL_1,minH_1,hourL_1,hourH_1,secL_2,secH_2,minL_2,minH_2,hourL_2,hourH_2, secL,secH,minL,minH,hourL,hourH, data,sm_wei,sm_qout ); input time_add; input set_mod; input set_option; input clk; input [15:0] data; output [3:0] sm_wei; output [6:0] sm_qout; output [3:0]secL_2,secH_2,minL_2,minH_2,hourL_2,hourH_2; output [3:0]secL_1,secH_1,minL_1,minH_1,hourL_1,hourH_1; output [3:0]secL,secH,minL,minH,hourL,hourH; output clk_div; output [1:0]option_1; output [6:0]qout; reg [1:0]option_1; reg [3:0]secL_1,secH_1,minL_1,minH_1,hourL_1,hourH_1; reg [3:0]secL_2,secH_2,minL_2,minH_2,hourL_2,hourH_2; reg [3:0]secL,secH,minL,minH,hourL,hourH; reg [6:0]qout,sm_qout; //分频--------------------------------------------------------------- parameter m=49999999; integer div_cnt=0; reg clk_div; always@(posedge clk) begin if(div_cnt==m) begin clk_div<=1'b1; div_cnt<=0; end else begin clk_div<=1'b0; div_cnt<=div_cnt+1; end end //计数------------------------------------------------------------- always@(posedge clk_div) begin if(set_mod==1) begin //清零 if(hourH_1==4'b0010 && hourL_1==4'b0011 && minH_1==4'b0101 && minL_1==4'b1001 && secH_1==4'b0101 && secL_1==4'b1001) begin secL_1<=4'b0000; secH_1<=4'b0000; minL_1<=4'b0000; minH_1<=4'b0000; hourL_1<=4'b0000; hourH_1<=4'b0000; end else //计数 if(secL_1==9) begin secL_1<=4'b0000; if(secH_1==5) begin secH_1<=4'b0000; if(minL_1==9) begin minL_1<=4'b0000; if(minH_1==5) begin minH_1<=4'b0000; if(hourL_1==9) begin hourL_1<=4'b0000; hourH_1<=hourH_1+1; end else hourL_1<=hourL_1+1; end else minH_1<=minH_1+1; end else minL_1<=minL_1+1; end else secH_1<=secH_1+1; end else secL_1<=secL_1+1; end else if(set_mod==0) begin //调时结果 secL_1<=secL_2; secH_1<=secH_2; minL_1<=minL_2; minH_1<=minH_2; hourL_1<=hourL_2; hourH_1<=hourH_2; end end //设置 always@(posedge set_option) begin if(option_1==2) option_1<=0; else option_1<=option_1+1; end //调时 always@(posedge time_add) begin if(set_mod==0) begin //清零 if(hourH_2==4'b0010 && hourL_2==4'b0011 && minH_2==4'b0101 && minL_2==4'b1001 && secH_2==4'b0101 && secL_2==4'b1001) begin secL_2<=4'b0000; secH_2<=4'b0000; minL_2<=4'b0000; minH_2<=4'b0000; hourL_2<=4'b0000; hourH_2<=4'b0000; end else //计数 //调分 if(option_1==0) begin if(minL_2==9) begin minL_2<=4'b0000; if(minH_2==5) minH_2<=4'b0000; else minH_2<=minH_2+1; end else minL_2<=minL_2+1; end //调时 if(option_1==1) begin if(hourL_2==9) begin hourL_2<=4'b0000; hourH_2<=hourH_2+1; end else hourL_2<=hourL_2+1; end end end //选择---------------------------------------------------------------- always@(secL_1 or secH_1 or minL_1 or minH_1 or hourL_1 or hourH_1 or secL_2 or secH_2 or minL_2 or minH_2 or hourL_2 or hourH_2) begin //计数 if(set_mod==1) begin secL<=secL_1; secH<=secH_1; minL<=minL_1; minH<=minH_1; hourL<=hourL_1; hourH<=hourH_1; end //调时 else if(set_mod==0 ) begin secL<=secL_2; secH<=secH_2; minL<=minL_2; minH<=minH_2; hourL<=hourL_2; hourH<=hourH_2; end end //fenpin integer clk_cnt; reg clk_400Hz; always @(posedge clk) if(clk_cnt==32'd100000) begin clk_cnt <= 1'b0; clk_400Hz <= ~clk_400Hz;end else clk_cnt <= clk_cnt + 1'b1; //位控制 reg [3:0]wei_ctrl=4'b1110; always @(posedge clk_400Hz) wei_ctrl <= {wei_ctrl[2:0],wei_ctrl[3]}; //段控制 reg [3:0]qout_ctrl; always @(wei_ctrl) case(wei_ctrl) 4'b1110:wei_ctrl=minL; 4'b1101:wei_ctrl=minH; 4'b1011:wei_ctrl=hourL; 4'b0111:wei_ctrl=hourH; endcase always@(minL) begin case(minL) 4'b0000:qout<=7'b1000000; 4'b0001:qout<=7'b1111001; 4'b0010:qout<=7'b0100100; 4'b0011:qout<=7'b0110000; 4'b0100:qout<=7'b0011001; 4'b0101:qout<=7'b0010010; 4'b0110:qout<=7'b0000010; 4'b0111:qout<=7'b1111000; 4'b1000:qout<=7'b0000000; 4'b1001:qout<=7'b0010000; default:qout<=7'b1111111; endcase end always@(minH) begin case(minH) 4'b0000:qout<=7'b1000000; 4'b0001:qout<=7'b1111001; 4'b0010:qout<=7'b0100100; 4'b0011:qout<=7'b0110000; 4'b0100:qout<=7'b0011001; 4'b0101:qout<=7'b0010010; 4'b0110:qout<=7'b0000010; 4'b0111:qout<=7'b1111000; 4'b1000:qout<=7'b0000000; 4'b1001:qout<=7'b0010000; default:qout<=7'b1111111; endcase end always@(hourL) begin case(hourL) 4'b0000:qout<=7'b1000000; 4'b0001:qout<=7'b1111001; 4'b0010:qout<=7'b0100100; 4'b0011:qout<=7'b0110000; 4'b0100:qout<=7'b0011001; 4'b0101:qout<=7'b0010010; 4'b0110:qout<=7'b0000010; 4'b0111:qout<=7'b1111000; 4'b1000:qout<=7'b0000000; 4'b1001:qout<=7'b0010000; default:qout<=7'b1111111; endcase end always@(hourH) begin case(hourH) 4'b0000:qout<=7'b1000000; 4'b0001:qout<=7'b1111001; 4'b0010:qout<=7'b0100100; 4'b0011:qout<=7'b0110000; 4'b0100:qout<=7'b0011001; 4'b0101:qout<=7'b0010010; 4'b0110:qout<=7'b0000010; 4'b0111:qout<=7'b1111000; 4'b1000:qout<=7'b0000000; 4'b1001:qout<=7'b0010000; default:qout<=7'b1111111; endcase end endmodule NET "set_mod" LOC = N13 ; NET "set_option" LOC = N3 ; NET "time_add" LOC = E2 ; NET "clk" LOC = B8 ; NET "minL" LOC = K14 ; NET "minH" LOC = M13 ; NET "hourL" LOC = J12 ; NET "hourH" LOC = F12 ; NET "qout[6]" LOC = L14 ; NET "qout[5]" LOC = H12 ; NET "qout[4]" LOC = N14 ; NET "qout[3]" LOC = N11 ; NET "qout[2]" LOC = P12 ; NET "qout[1]" LOC = L13 ; NET "qout[0]" LOC = M12 ;
HDU 2098分拆素数和 输出的数字不对 和网上进行了比对没找到问题在哪,求大神帮忙解答一下
``` #include<stdio.h> #include<math.h> int isPrime(int n){ int i; for(i=2;i<=sqrt(n);i++){ if(n%i==0){ return 0; } return 1; } } int main() { int n,i,j; int cnt; for(i=0;i<500;i++){ scanf("%d",&n); cnt=0; if(n>10000||n<0){ break; } if(n==0){ break; } for(j=3;j<n/2;j+=2){ if(isPrime(j)&&isPrime(n-j)){ cnt++; } } printf("%d\n",cnt); //cnt的输出不正确 } return 0; } ```
先序建立二叉树中的查找双亲操作
先序建立二叉树中查找孩子返回双亲那快函数怎么执行都是显示找不到双亲。大佬帮看看是我哪写错了呗。以下是完整代码: #include<cstdio> #include<cstdlib> #include<algorithm> using namespace std; typedef char DataType; typedef struct BitNode { DataType data; struct BitNode *lchild,*rchild; //创建左右节点 }*BitTree; /*初始化一个二叉树*/ void Init(BitTree &BT) { BT = (BitTree)malloc(sizeof(BitNode)); BT->data = NULL; return; } //先序建立二叉树 int BinTreeCreate(BitTree &BT) { char ch; scanf("%c", &ch); if(ch == '$') BT = NULL; else{ BT = (BitTree)malloc(sizeof(BitNode)); BT->data = ch; BinTreeCreate(BT->lchild); BinTreeCreate(BT->rchild); } return 0; } /*判断二叉树是否为空*/ bool BinTreeEmpty(BitTree BT) { if(BT == NULL) return true; return false; } /*先序遍历二叉树*/ void BinTraverse(BitTree BT) { if(BT == NULL) return; printf("%c",BT->data); if(BT->lchild != NULL) BinTraverse(BT->lchild); if(BT->rchild != NULL); BinTraverse(BT->rchild); } /*中序遍历二叉树*/ void MidTraverse(BitTree BT) { if(BT == NULL)return; MidTraverse(BT->lchild); printf("%c",BT->data); MidTraverse(BT->rchild); } /*后序遍历二叉树*/ void BhTraverse(BitTree BT) { if(BT == NULL)return; BhTraverse(BT->lchild); BhTraverse(BT->rchild); printf("%c",BT->data); } /*q求二叉树结点数*/ int BinTreeCount(BitTree BT) { int cnt; if(BT) { int cntLeft = BinTreeCount(BT->lchild); int cntRight = BinTreeCount(BT->rchild); cnt = cntLeft + cntRight + 1;//左子树的结点数加上右子树的结点数 } else cnt = 0; return cnt; } /*查找孩子返回双亲*/ BitTree back(BitTree T , char str){ if(T == NULL) return NULL ; if(T->lchild!= NULL&&T->lchild->data == str) { return T; } if(T->rchild!= NULL&&T->rchild->data == str){ return T; } else{ // back(T->lchild,str); // back(T->rchild,str); BitNode* P=NULL; if(P=back(T->lchild,str)) return P; if(P=back(T->rchild,str)) return P; } return NULL; } int main(){ BitTree BT; printf("<------欢迎使用二叉树系统------->\n"); printf("<------1.初始化二叉树----------->\n"); printf("<------2.先序建立二叉树--------->\n"); printf("<------3.判断二叉树是否为空----->\n"); printf("<------4.先序遍历二叉树--------->\n"); printf("<------5.中序遍历二叉树--------->\n"); printf("<------6.后序遍历二叉树--------->\n"); printf("<------7.求二叉树结点数--------->\n"); printf("<------8.查找孩子返回双亲------->\n"); printf("<------9.退出------------------->\n"); while(1){ int choose; char ch; BitTree T = NULL; BitTree p = NULL; printf("请输入选择:"); scanf("%d",&choose); if(choose == 9)break; switch(choose) { case 1: Init(BT); break; case 2: printf("请输入二叉树的元素:"); getchar(); BinTreeCreate(BT); break; case 3: if(BinTreeEmpty(BT)) printf("二叉树为空!\n"); else printf("二叉树不为空!\n"); break; case 4: printf("先序遍历二叉树序列如下:"); BinTraverse(BT); printf("\n"); break; case 5: printf("中序遍历二叉树序列如下;"); MidTraverse(BT); printf("\n"); break; case 6: printf("后序遍历二叉树序列如下:"); BhTraverse(BT); printf("\n"); break; case 7: printf("二叉树的结点数为 %d\n", BinTreeCount(BT)); break; case 8: printf("\n请输入要查找的值:"); getchar(); scanf("%c",&ch); back(T,ch); if(T==NULL){ printf("输入的值不存在双亲!!\n"); } else{ printf("输入结点的双亲为:%c",T); } break; } } return 0; }
CCPC2019-秦皇岛F HDU-6736为什么这个题目把前向星换成邻接表就能AC啊?
在用前向星存图并遍历的时候,会WA 而对于邻接表存的图,就不会WA,可以AC,为什么? ``` #include<bits/stdc++.h> using namespace std; typedef long long ll; const ll mod = 998244353; const int maxn = 3e5+100; const int maxm = 5e5+100; int n, m; struct node{ int to, next; node(){ } node(int a, int b):to(a), next(b){ } }; node edge[maxm]; int head[maxn]; int cnt; ll num; ll ans; ll vis[maxn]; void init(){ memset(head, -1, sizeof(head)); memset(vis, 0, sizeof(vis)); cnt = 0; num=0; } ll quick_pow(ll a, ll b){ ll res = 1; while(b){ if(b&1)res=(res*a%mod)%mod; a=(a*a)%mod; b>>=1; } return res; } void addedge(int u, int v){ edge[cnt] = node(v, head[u]); head[u]=cnt++; } void dfs(int u, int fa){ vis[u]=vis[fa]+1; for(int i=head[u]; ~i; i=edge[i].next){ int v=edge[i].to; if(v==fa)continue; if(!vis[v])dfs(v, u); else if(vis[u]>vis[v]){ ll tmp = vis[u]-vis[v]+1; num += tmp; //对于环内的边 2^k - 1,因为不能全删 ans = (ans%mod*(quick_pow(2, tmp)-1)%mod)%mod; } } } int main() { while(~scanf("%d%d", &n, &m)){ int u, v; init(); for(int i=1; i<=m; ++i){ scanf("%d%d", &u, &v); addedge(u, v); addedge(v, u); } if(m==0){ printf("0\n"); continue; } ans = 1; for(int i=1; i<=n; ++i){ if(!vis[i]){ dfs(i, i); } } ans = (ans%mod*(quick_pow(2, (ll)m-num))%mod)%mod;//环外的边 2^k个方案, 可以全删 printf("%lld\n", ans); } } ``` 而对于邻接表存的图,就不会WA,可以AC,为什么? ``` #include<bits/stdc++.h> using namespace std; typedef long long ll; const ll mod = 998244353; const int maxn = 3e5+100; const int maxm = 5e5+100; int n, m; /*struct node{ int to, next; node(){ } node(int a, int b):to(a), next(b){ } };*/ //node edge[maxm]; //int head[maxn]; //int cnt; ll num; ll ans; ll vis[maxn]; vector<int>G[maxn]; inline void init(){ //memset(head, -1, sizeof(head)); memset(vis, 0, sizeof(vis)); //cnt = 0; for(int i=0; i<maxn; ++i)G[i].clear(); num=0; } ll quick_pow(ll a, ll b){ ll res = 1; while(b){ if(b&1)res=(res*a%mod)%mod; a=(a*a)%mod; b>>=1; }//cout<<res<<endl; return res; } void addedge(int u, int v){ G[u].push_back(v); G[v].push_back(u); } void dfs(int u, int fa){ vis[u]=vis[fa]+1; for(auto v:G[u]){ if(v==fa)continue; if(!vis[v])dfs(v, u); else if(vis[u]>vis[v]){ ll tmp = vis[u]-vis[v]+1; num += tmp; ans = (ans%mod*(quick_pow(2, tmp)-1)%mod)%mod; } } } int main() { while(~scanf("%d%d", &n, &m)){ int u, v; init(); for(int i=1; i<=m; ++i){ scanf("%d%d", &u, &v); addedge(u, v); } if(m==0){ printf("0\n"); continue; } ans = 1; for(int i=1; i<=n; ++i){ if(!vis[i]){ dfs(i, 0); } } // cout << 1<<endl; ans = (ans%mod*(quick_pow(2, (ll)m-num))%mod)%mod;//环外的边 2^k个方案, 可以全删 printf("%lld\n", ans); } } ```
全志A40I按power键死机
全志A40I使用的是Android7系统,内核Linux3.10.65。使用的WiFi是AP6236 按power键出现死机。log打印如下: a40-boardcon:/ # [ 1422.126312] [DISP] disp_lcd_pwm_enable,line:1079:pwm device hdl is NULL [ 1422.164875] disp_runtime_idle [ 1422.700248] PM: suspend entry 2019-11-29 03:26:13.193275785 UTC [ 1422.706769] [pm]valid [ 1422.709253] PM: Syncing filesystems ... done. [ 1422.715960] PM: Preparing system for mem sleep [ 1422.723091] Freezing user space processes ... [ 1422.728251] last active wakeup source: eventpoll [ 1422.733714] [ 1422.735340] Freezing of tasks aborted after 0.005 seconds [ 1422.741380] Restarting tasks ... done. [ 1422.746143] sunxi-mmc 1c0f000.sdmmc: smc 1 p0 err, cmd 7, RTO !! [ 1422.746184] sunxi-mmc 1c0f000.sdmmc: smc 1 p0 err, cmd 7, RTO !! [ 1422.746214] sunxi-mmc 1c0f000.sdmmc: smc 1 p0 err, cmd 7, RTO !! [ 1422.746242] sunxi-mmc 1c0f000.sdmmc: smc 1 p0 err, cmd 7, RTO !! [ 1422.747082] sdioh_remove: Enter [ 1422.747088] dhdsdio_disconnect : no mutex held. set lock [ 1422.747095] bcmsdh_oob_intr_unregister: Enter [ 1422.747097] bcmsdh_oob_intr_unregister: irq is not registered [ 1422.747104] dhd_wlfc_deinit():3301, Already disabled! [ 1422.752940] PM: suspend exit 2019-11-29 03:26:13.245966118 UTC [ 1422.910357] dhd_detach(): thread:dhd_watchdog_thread:6a6 terminated OK [ 1422.917576] dhd_detach(): thread:dhd_rxf:6a8 terminated OK [ 1422.923968] dhd_dpc_thread: Unexpected up_cnt 0 [ 1422.929081] dhd_detach(): thread:dhd_dpc:6a7 terminated OK [ 1422.936715] wl_event_handler: was terminated [ 1422.941637] wl_destroy_event_handler(): thread:wl_event_handler:6a4 terminated OK [ 1423.250136] dhd_os_prealloc: failed to alloc memory, section: 7, size: 0bytes [ 1423.258093] dhdsdio_disconnect : the lock is released. [ 1423.264114] Unable to handle kernel paging request at virtual address 6b6b6b6b [ 1423.272328] pgd = c0004000 [ 1423.275320] [6b6b6b6b] *pgd=00000000 [ 1423.279270] Internal error: Oops: 5 [#1] PREEMPT SMP ARM [ 1423.282261] Modules linked in: sunxi_ir_rx gt9xxnew_ts bcm_btlpm bcmdhd xin_ncm r8152 ttyxin gpio_sunxi mali(O) nand(O) [ 1423.282261] CPU: 2 PID: 23224 Comm: kworker/u8:0 Tainted: G W O 3.10.65 #64 [ 1423.282261] Workqueue: kmmcd mmc_rescan [ 1423.282261] task: cc88dac0 ti: e0110000 task.ti: e0110000 [ 1423.282261] PC is at sdio_claim_host+0x30/0x40 [ 1423.282261] LR is at sdioh_detach+0x6c/0xac [bcmdhd] [ 1423.282261] pc : [<c0491fac>] lr : [<bf10db64>] psr: 20070013 [ 1423.282261] sp : e0111da0 ip : e0111db0 fp : e0111dac [ 1423.282261] r10: e484b414 r9 : 00000000 r8 : e41f89d8 [ 1423.282261] r7 : 00000000 r6 : bf16e400 r5 : e3d78b40 r4 : e431e000 [ 1423.282261] r3 : 6b6b6b6b r2 : e0111d40 r1 : 40070013 r0 : e4321800 [ 1423.282261] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel [ 1423.282261] Control: 10c5387d Table: 638e006a DAC: 00000015 [ 1423.282261] [ 1423.282261] PC: 0xc0491f2c: [ 1423.282261] 1f2c 05932354 13e00015 01821001 05831354 e89da800 e1a0c00d e92dd800 e24cb004 [ 1423.282261] 1f4c e92d4000 e8bd4000 e3500000 1a000000 e7f001f2 e5903000 e3530000 1a000000 [ 1423.282261] 1f6c e7f001f2 e5933000 e59301cc e89da800 e1a0c00d e92dd800 e24cb004 e92d4000 [ 1423.282261] 1f8c e8bd4000 e3500000 1a000000 e7f001f2 e5903000 e3530000 1a000000 e7f001f2 [ 1423.282261] 1fac e5930000 e3a01000 ebffce29 e89da800 e1a0c00d e92dd810 e24cb004 e24dd00c [ 1423.282261] 1fcc e92d4000 e8bd4000 e3500000 e1a0c002 e1a04003 1a000000 e7f001f2 e24230f0 [ 1423.282261] 1fec e353000f 9a000007 e5903000 e593318c e3130001 1a000003 e3540000 13e03015 [ 1423.282261] 200c 15843000 ea000008 e3a02000 e58d1000 e58d2004 e3a01001 e5900000 e1a0300c [ 1423.282261] [ 1423.282261] SP: 0xe0111d20: [ 1423.282261] 1d20 00000000 e4196a28 40070013 c06d2544 e0111d4c e0111d40 c0491fac 20070013 [ 1423.282261] 1d40 ffffffff e0111d8c e0111dac e0111d58 c06d2fd8 c000a168 e4321800 40070013 [ 1423.282261] 1d60 e0111d40 6b6b6b6b e431e000 e3d78b40 bf16e400 00000000 e41f89d8 00000000 [ 1423.282261] 1d80 e484b414 e0111dac e0111db0 e0111da0 bf10db64 c0491fac 20070013 ffffffff [ 1423.282261] 1da0 e0111dc4 e0111db0 bf10db64 c0491f88 00000000 e431e000 e0111ddc e0111dc8 [ 1423.282261] 1dc0 bf10ff34 bf10db04 e4321608 e4321600 e0111dfc e0111de0 c0490b0c bf10fe04 [ 1423.282261] 1de0 c0490ac4 e4321608 bf16e400 c0b6c880 e0111e14 e0111e00 c0324d90 c0490ad0 [ 1423.282261] 1e00 e432163c e4321608 e0111e2c e0111e18 c0324e04 c0324d10 e4321608 e4991ab0 [ 1423.282261] [ 1423.282261] IP: 0xe0111d30: [ 1423.282261] 1d30 e0111d4c e0111d40 c0491fac 20070013 ffffffff e0111d8c e0111dac e0111d58 [ 1423.282261] 1d50 c06d2fd8 c000a168 e4321800 40070013 e0111d40 6b6b6b6b e431e000 e3d78b40 [ 1423.282261] 1d70 bf16e400 00000000 e41f89d8 00000000 e484b414 e0111dac e0111db0 e0111da0 [ 1423.282261] 1d90 bf10db64 c0491fac 20070013 ffffffff e0111dc4 e0111db0 bf10db64 c0491f88 [ 1423.282261] 1db0 00000000 e431e000 e0111ddc e0111dc8 bf10ff34 bf10db04 e4321608 e4321600 [ 1423.282261] 1dd0 e0111dfc e0111de0 c0490b0c bf10fe04 c0490ac4 e4321608 bf16e400 c0b6c880 [ 1423.282261] 1df0 e0111e14 e0111e00 c0324d90 c0490ad0 e432163c e4321608 e0111e2c e0111e18 [ 1423.282261] 1e10 c0324e04 c0324d10 e4321608 e4991ab0 e0111e4c e0111e30 c03248c4 c0324de4 [ 1423.282261] [ 1423.282261] FP: 0xe0111d2c: [ 1423.282261] 1d2c c06d2544 e0111d4c e0111d40 c0491fac 20070013 ffffffff e0111d8c e0111dac [ 1423.282261] 1d4c e0111d58 c06d2fd8 c000a168 e4321800 40070013 e0111d40 6b6b6b6b e431e000 [ 1423.282261] 1d6c e3d78b40 bf16e400 00000000 e41f89d8 00000000 e484b414 e0111dac e0111db0 [ 1423.282261] 1d8c e0111da0 bf10db64 c0491fac 20070013 ffffffff e0111dc4 e0111db0 bf10db64 [ 1423.282261] 1dac c0491f88 00000000 e431e000 e0111ddc e0111dc8 bf10ff34 bf10db04 e4321608 [ 1423.282261] 1dcc e4321600 e0111dfc e0111de0 c0490b0c bf10fe04 c0490ac4 e4321608 bf16e400 [ 1423.282261] 1dec c0b6c880 e0111e14 e0111e00 c0324d90 c0490ad0 e432163c e4321608 e0111e2c [ 1423.282261] 1e0c e0111e18 c0324e04 c0324d10 e4321608 e4991ab0 e0111e4c e0111e30 c03248c4 [ 1423.282261] [ 1423.282261] R0: 0xe4321780: [ 1423.282261] 1780 00000000 00000002 02d00000 0000a9a6 00000200 00000080 000007d0 00000001 [ 1423.282261] 17a0 00000000 00000000 00000000 e3d788c0 00000000 00000000 00000000 00000000 [ 1423.282261] 17c0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 1423.282261] 17e0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 1423.282261] 1800 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b [ 1423.282261] 1820 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b [ 1423.282261] 1840 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b [ 1423.282261] 1860 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b [ 1423.282261] [ 1423.282261] R2: 0xe0111cc0: [ 1423.282261] 1cc0 c0485d44 c0485b6c 00000000 e0111d14 00000000 00000000 00000000 00020002 [ 1423.282261] 1ce0 e0111ce0 e0111ce0 c0485b40 00000000 00000000 e4196800 00000400 e0111d97 [ 1423.282261] 1d00 e0111d6c e0111d10 c0490454 c0485cd4 e0111d34 00000034 00000400 c00507a0 [ 1423.282261] 1d20 00000000 e4196a28 40070013 c06d2544 e0111d4c e0111d40 c0491fac 20070013 [ 1423.282261] 1d40 ffffffff e0111d8c e0111dac e0111d58 c06d2fd8 c000a168 e4321800 40070013 [ 1423.282261] 1d60 e0111d40 6b6b6b6b e431e000 e3d78b40 bf16e400 00000000 e41f89d8 00000000 [ 1423.282261] 1d80 e484b414 e0111dac e0111db0 e0111da0 bf10db64 c0491fac 20070013 ffffffff [ 1423.282261] 1da0 e0111dc4 e0111db0 bf10db64 c0491f88 00000000 e431e000 e0111ddc e0111dc8 [ 1423.282261] [ 1423.282261] R4: 0xe431df80: [ 1423.282261] df80 00000000 e42e9c80 c003d488 00000000 e431dfac e431dfa0 c003d4b8 c003d328 [ 1423.282261] dfa0 00000000 e431dfb0 c000fa78 c003d494 00000000 00000000 00000000 00000000 [ 1423.282261] dfc0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 1423.282261] dfe0 00000000 00000000 00000000 00000000 00000013 00000000 00001040 00001008 [ 1423.282261] e000 e3d78b40 e3d78ac0 00000000 00000000 00000000 00000000 00000000 00010100 [ 1423.282261] e020 00000000 00000040 00000040 00000080 00000000 00000000 00000000 00000000 [ 1423.282261] e040 00000002 00001070 00001070 00001000 00001038 00000000 00000000 00000000 [ 1423.282261] e060 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 1423.282261] [ 1423.282261] R5: 0xe3d78ac0: [ 1423.282261] 8ac0 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b [ 1423.282261] 8ae0 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b a56b6b6b [ 1423.282261] 8b00 000004e8 00000000 00000000 00000000 00000000 00000001 5a5a5a5a 5a5a5a5a [ 1423.282261] 8b20 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a a55a5a5a [ 1423.282261] 8b40 00000001 00000000 00000000 00000000 00000000 00000000 1234abcd e4321608 [ 1423.282261] 8b60 00000000 00000003 e3d78b00 e3d78ac0 00000000 5a5a5a5a 5a5a5a5a a55a5a5a [ 1423.282261] 8b80 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b [ 1423.282261] 8ba0 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b a56b6b6b [ 1423.282261] [ 1423.282261] R8: 0xe41f8958: [ 1423.282261] 8958 00000000 e41f8944 00000000 e4853f10 e4853f10 00000000 e41f8970 e41f8970 [ 1423.282261] 8978 e41f8978 e41f8978 e433d840 ffffffff 00000000 c0a743bc e49bcb00 00000000 [ 1423.282261] 8998 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 1423.282261] 89b8 00000000 00000000 00000000 e484b550 e4196a3c c0488298 e4873900 00000000 [ 1423.282261] 89d8 e41f89d8 e41f89d8 cc88dac0 e484b400 0001b691 00000081 00000000 73756c66 [ 1423.282261] 89f8 3a302d68 00003132 00000000 00000000 00000000 00000000 00000000 00000000 [ 1423.282261] 8a18 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 1423.282261] 8a38 00000000 00000000 f00003fa 0000416d 00000002 00000000 00000000 00000000 [ 1423.282261] [ 1423.282261] R10: 0xe484b394: [ 1423.282261] b394 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a [ 1423.282261] b3b4 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a [ 1423.282261] b3d4 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a [ 1423.282261] b3f4 5a5a5a5a 5a5a5a5a a55a5a5a 15be15be ffffffff ffffffff 00000008 00000004 [ 1423.282261] b414 e484b414 e484b414 00000004 00000003 e48f3ec0 cef7c940 e490e85c e490e85c [ 1423.282261] b434 0001c900 e490e001 c003e478 e484b400 ffffffff ffffffff 00000000 00000000 [ 1423.282261] b454 00000000 00000000 00000000 00000000 00200200 000153ac e48ea000 c003e690 [ 1423.282261] b474 e484b400 ffffffff ffffffff 00000000 00000000 00000000 00000000 00000000 [ 1423.282261] Process kworker/u8:0 (pid: 23224, stack limit = 0xe0110240) [ 1423.282261] Stack: (0xe0111da0 to 0xe0112000) [ 1423.282261] 1da0: e0111dc4 e0111db0 bf10db64 c0491f88 00000000 e431e000 e0111ddc e0111dc8 [ 1423.282261] 1dc0: bf10ff34 bf10db04 e4321608 e4321600 e0111dfc e0111de0 c0490b0c bf10fe04 [ 1423.282261] 1de0: c0490ac4 e4321608 bf16e400 c0b6c880 e0111e14 e0111e00 c0324d90 c0490ad0 [ 1423.282261] 1e00: e432163c e4321608 e0111e2c e0111e18 c0324e04 c0324d10 e4321608 e4991ab0 [ 1423.282261] 1e20: e0111e4c e0111e30 c03248c4 c0324de4 00000011 e4321608 e3c24408 000000b9 [ 1423.282261] 1e40: e0111e6c e0111e50 c03222ec c03247f8 00000001 e4321608 e4196800 000000b9 [ 1423.282261] 1e60: e0111e84 e0111e70 c0490f3c c03221e0 00000002 00000001 e0111ea4 e0111e88 [ 1423.282261] 1e80: c048fee8 c0490f1c e4196800 ffffff92 e41969e8 c07640a0 e0111ebc e0111ea8 [ 1423.282261] 1ea0: c0490000 c048fea8 e4196a3c e4196800 e0111ee4 e0111ec0 c0488350 c048ff20 [ 1423.282261] 1ec0: e41f89c0 e484b400 e4873900 e4196a3c e41f89d8 e484b414 e0111f24 e0111ee8 [ 1423.282261] 1ee0: c0040a8c c04882a4 c0b8f2e8 e41f89c0 e484b400 00000000 e0110000 e41f89c0 [ 1423.282261] 1f00: e484b400 c0b8f2e8 e0110000 e41f89d8 e484b400 e484b414 e0111f5c e0111f28 [ 1423.282261] 1f20: c0040ec4 c00407e8 00000000 e41f89c0 c0040c8c e4151e6c 00000000 e41f89c0 [ 1423.282261] 1f40: c0040c8c 00000000 00000000 00000000 e0111fac e0111f60 c00470ec c0040c98 [ 1423.282261] 1f60: c06d259c 00000000 e0111f94 e41f89c0 00000000 00000000 e0111f78 e0111f78 [ 1423.282261] 1f80: 00000000 00000000 e0111f88 e0111f88 e4151e6c c0047030 00000000 00000000 [ 1423.282261] 1fa0: 00000000 e0111fb0 c000fa78 c004703c 00000000 00000000 00000000 00000000 [ 1423.282261] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 1423.282261] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000 ffa38ad1 ffa38ad1 [ 1423.282261] [<c0491fac>] (sdio_claim_host+0x30/0x40) from [<bf10db64>] (sdioh_detach+0x6c/0xac [bcmdhd]) [ 1423.282261] [<bf10db64>] (sdioh_detach+0x6c/0xac [bcmdhd]) from [<bf10ff34>] (bcmsdh_sdmmc_remove+0x13c/0x174 [bcmdhd]) [ 1423.282261] [<bf10ff34>] (bcmsdh_sdmmc_remove+0x13c/0x174 [bcmdhd]) from [<c0490b0c>] (sdio_bus_remove+0x48/0x100) [ 1423.282261] [<c0490b0c>] (sdio_bus_remove+0x48/0x100) from [<c0324d90>] (__device_release_driver+0x8c/0xd4) [ 1423.282261] [<c0324d90>] (__device_release_driver+0x8c/0xd4) from [<c0324e04>] (device_release_driver+0x2c/0x38) [ 1423.282261] [<c0324e04>] (device_release_driver+0x2c/0x38) from [<c03248c4>] (bus_remove_device+0xd8/0xe8) [ 1423.282261] [<c03248c4>] (bus_remove_device+0xd8/0xe8) from [<c03222ec>] (device_del+0x118/0x17c) [ 1423.282261] [<c03222ec>] (device_del+0x118/0x17c) from [<c0490f3c>] (sdio_remove_func+0x2c/0x38) [ 1423.282261] [<c0490f3c>] (sdio_remove_func+0x2c/0x38) from [<c048fee8>] (mmc_sdio_remove+0x4c/0x78) [ 1423.282261] [<c048fee8>] (mmc_sdio_remove+0x4c/0x78) from [<c0490000>] (mmc_sdio_detect+0xec/0x114) [ 1423.282261] [<c0490000>] (mmc_sdio_detect+0xec/0x114) from [<c0488350>] (mmc_rescan+0xb8/0x474) [ 1423.282261] [<c0488350>] (mmc_rescan+0xb8/0x474) from [<c0040a8c>] (process_one_work+0x2b0/0x474) [ 1423.282261] [<c0040a8c>] (process_one_work+0x2b0/0x474) from [<c0040ec4>] (worker_thread+0x238/0x348) [ 1423.282261] [<c0040ec4>] (worker_thread+0x238/0x348) from [<c00470ec>] (kthread+0xbc/0xc8) [ 1423.282261] [<c00470ec>] (kthread+0xbc/0xc8) from [<c000fa78>] (ret_from_fork+0x14/0x20) [ 1423.282261] Code: e5903000 e3530000 1a000000 e7f001f2 (e5930000) [ 1424.510507] ---[ end trace a20d4dd70782290e ]--- [ 1424.515606] Kernel panic - not syncing: Fatal exception [ 1424.521496] CPU0: stopping [ 1424.524463] CPU: 0 PID: 1726 Comm: logd.klogd Tainted: G D W O 3.10.65 #64 [ 1424.530021] [<c0017fc4>] (unwind_backtrace+0x0/0xec) from [<c0014238>] (show_stack+0x20/0x24) [ 1424.530021] [<c0014238>] (show_stack+0x20/0x24) from [<c06cc684>] (dump_stack+0x20/0x28) [ 1424.530021] [<c06cc684>] (dump_stack+0x20/0x28) from [<c0015db0>] (handle_IPI+0x15c/0x2d0) [ 1424.530021] [<c0015db0>] (handle_IPI+0x15c/0x2d0) from [<c000a34c>] (gic_handle_irq+0x64/0x6c) [ 1424.530021] [<c000a34c>] (gic_handle_irq+0x64/0x6c) from [<c06d3200>] (__irq_usr+0x40/0x60) [ 1424.530021] Exception stack(0xe39c3fb0 to 0xe39c3ff8) [ 1424.530021] 3fa0: b335c620 b38c90a0 b38c6390 5de0fade [ 1424.530021] 3fc0: 5de08fd5 00000006 2e35f14e b38c90c0 b38c90c0 00000050 b30cf310 b38a0000 [ 1424.530021] 3fe0: b3c9af18 b32fe670 b3c8df03 b3c8df16 200e0030 ffffffff [ 1424.531507] CPU3: stopping [ 1424.531507] CPU: 3 PID: 0 Comm: swapper/3 Tainted: G D W O 3.10.65 #64 [ 1424.531507] [<c0017fc4>] (unwind_backtrace+0x0/0xec) from [<c0014238>] (show_stack+0x20/0x24) [ 1424.531507] [<c0014238>] (show_stack+0x20/0x24) from [<c06cc684>] (dump_stack+0x20/0x28) [ 1424.531507] [<c06cc684>] (dump_stack+0x20/0x28) from [<c0015db0>] (handle_IPI+0x15c/0x2d0) [ 1424.531507] [<c0015db0>] (handle_IPI+0x15c/0x2d0) from [<c000a34c>] (gic_handle_irq+0x64/0x6c) [ 1424.531507] [<c000a34c>] (gic_handle_irq+0x64/0x6c) from [<c06d3040>] (__irq_svc+0x40/0x70) [ 1424.531507] Exception stack(0xe48dff68 to 0xe48dffb0) [ 1424.531507] ff60: 00000003 00000000 000b6574 00000000 e48de000 00000015 [ 1424.531507] ff80: c0b8facc c0b91f44 c06db3a0 410fc075 c0a6848c e48dffbc e48dffc0 e48dffb0 [ 1424.531507] ffa0: c0010ee0 c0010ee4 600e0013 ffffffff [ 1424.531507] [<c06d3040>] (__irq_svc+0x40/0x70) from [<c0010ee4>] (arch_cpu_idle+0x34/0x3c) [ 1424.531507] [<c0010ee4>] (arch_cpu_idle+0x34/0x3c) from [<c006ab1c>] (cpu_startup_entry+0x1d8/0x244) [ 1424.531507] [<c006ab1c>] (cpu_startup_entry+0x1d8/0x244) from [<c06c62cc>] (secondary_start_kernel+0x118/0x130) [ 1424.531507] [<c06c62cc>] (secondary_start_kernel+0x118/0x130) from [<406c4460>] (0x406c4460) [ 1424.531508] CPU1: stopping [ 1424.531508] CPU: 1 PID: 0 Comm: swapper/1 Tainted: G D W O 3.10.65 #64 [ 1424.531508] [<c0017fc4>] (unwind_backtrace+0x0/0xec) from [<c0014238>] (show_stack+0x20/0x24) [ 1424.531508] [<c0014238>] (show_stack+0x20/0x24) from [<c06cc684>] (dump_stack+0x20/0x28) [ 1424.531508] [<c06cc684>] (dump_stack+0x20/0x28) from [<c0015db0>] (handle_IPI+0x15c/0x2d0) [ 1424.531508] [<c0015db0>] (handle_IPI+0x15c/0x2d0) from [<c000a34c>] (gic_handle_irq+0x64/0x6c) [ 1424.531508] [<c000a34c>] (gic_handle_irq+0x64/0x6c) from [<c06d3040>] (__irq_svc+0x40/0x70) [ 1424.531508] Exception stack(0xe48cdf68 to 0xe48cdfb0) [ 1424.531508] df60: 00000001 00000000 000ed2f6 00000000 e48cc000 00000015 [ 1424.531508] df80: c0b8facc c0b91f44 c06db3a0 410fc075 c0a6848c e48cdfbc e48cdfc0 e48cdfb0 [ 1424.531508] dfa0: c0010ee0 c0010ee4 600e0013 ffffffff [ 1424.531508] [<c06d3040>] (__irq_svc+0x40/0x70) from [<c0010ee4>] (arch_cpu_idle+0x34/0x3c) [ 1424.531508] [<c0010ee4>] (arch_cpu_idle+0x34/0x3c) from [<c006ab1c>] (cpu_startup_entry+0x1d8/0x244) [ 1424.531508] [<c006ab1c>] (cpu_startup_entry+0x1d8/0x244) from [<c06c62cc>] (secondary_start_kernel+0x118/0x130) [ 1424.531508] [<c06c62cc>] (secondary_start_kernel+0x118/0x130) from [<406c4460>] (0x406c4460) 尝试过在sys_config.fex的[sdc0]中加入non-removable 按power键不会死机 但是WiFi用不了。请各位大神帮看一下
相见恨晚的超实用网站
搞学习 知乎:www.zhihu.com 简答题:http://www.jiandati.com/ 网易公开课:https://open.163.com/ted/ 网易云课堂:https://study.163.com/ 中国大学MOOC:www.icourse163.org 网易云课堂:study.163.com 哔哩哔哩弹幕网:www.bilibili.com 我要自学网:www.51zxw
花了20分钟,给女朋友们写了一个web版群聊程序
参考博客 [1]https://www.byteslounge.com/tutorials/java-ee-html5-websocket-example
爬虫福利二 之 妹子图网MM批量下载
爬虫福利一:27报网MM批量下载    点击 看了本文,相信大家对爬虫一定会产生强烈的兴趣,激励自己去学习爬虫,在这里提前祝:大家学有所成! 目标网站:妹子图网 环境:Python3.x 相关第三方模块:requests、beautifulsoup4 Re:各位在测试时只需要将代码里的变量 path 指定为你当前系统要保存的路径,使用 python xxx.py 或IDE运行即可。
字节跳动视频编解码面经
引言 本文主要是记录一下面试字节跳动的经历。 三四月份投了字节跳动的实习(图形图像岗位),然后hr打电话过来问了一下会不会opengl,c++,shador,当时只会一点c++,其他两个都不会,也就直接被拒了。 七月初内推了字节跳动的提前批,因为内推没有具体的岗位,hr又打电话问要不要考虑一下图形图像岗,我说实习投过这个岗位不合适,不会opengl和shador,然后hr就说秋招更看重基础。我当时
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 顺便拉下票,我在参加csdn博客之星竞选,欢迎投票支持,每个QQ或者微信每天都可以投5票,扫二维码即可,http://m234140.nofollow.ax.
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入 假设现有4个人...
Python 基础(一):入门必备知识
目录1 标识符2 关键字3 引号4 编码5 输入输出6 缩进7 多行8 注释9 数据类型10 运算符10.1 常用运算符10.2 运算符优先级 1 标识符 标识符是编程时使用的名字,用于给变量、函数、语句块等命名,Python 中标识符由字母、数字、下划线组成,不能以数字开头,区分大小写。 以下划线开头的标识符有特殊含义,单下划线开头的标识符,如:_xxx ,表示不能直接访问的类属性,需通过类提供
这30个CSS选择器,你必须熟记(上)
关注前端达人,与你共同进步CSS的魅力就是让我们前端工程师像设计师一样进行网页的设计,我们能轻而易举的改变颜色、布局、制作出漂亮的影音效果等等,我们只需要改几行代码,不需...
国产开源API网关项目进入Apache孵化器:APISIX
点击蓝色“程序猿DD”关注我回复“资源”获取独家整理的学习资料!近日,又有一个开源项目加入了这个Java开源界大名鼎鼎的Apache基金会,开始进行孵化器。项目名称:AP...
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 欢迎 改进 留言。 演示地点跳到演示地点 html代码如下`&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;music&lt;/title&gt; &lt;meta charset="utf-8"&gt
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。 1. for - else 什么?不是 if 和 else 才
数据库优化 - SQL优化
前面一篇文章从实例的角度进行数据库优化,通过配置一些参数让数据库性能达到最优。但是一些“不好”的SQL也会导致数据库查询变慢,影响业务流程。本文从SQL角度进行数据库优化,提升SQL运行效率。 判断问题SQL 判断SQL是否有问题时可以通过两个表象进行判断: 系统级别表象 CPU消耗严重 IO等待严重 页面响应时间过长
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 c/c++ 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7
通俗易懂地给女朋友讲:线程池的内部原理
餐厅的约会 餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”我楞了一下,心里想女朋友今天是怎么了,怎么突然问出这么专业的问题,但做为一个专业人士在女朋友面前也不能露怯啊,想了一下便说:“我先给你讲讲我前同事老王的故事吧!” 大龄程序员老王 老王是一个已经北漂十多年的程序员,岁数大了,加班加不动了,升迁也无望,于是拿着手里
经典算法(5)杨辉三角
杨辉三角 是经典算法,这篇博客对它的算法思想进行了讲解,并有完整的代码实现。
编写Spring MVC控制器的14个技巧
本期目录 1.使用@Controller构造型 2.实现控制器接口 3.扩展AbstractController类 4.为处理程序方法指定URL映射 5.为处理程序方法指定HTTP请求方法 6.将请求参数映射到处理程序方法 7.返回模型和视图 8.将对象放入模型 9.处理程序方法中的重定向 10.处理表格提交和表格验证 11.处理文件上传 12.在控制器中自动装配业务类 ...
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹
面试官:你连RESTful都不知道我怎么敢要你?
面试官:了解RESTful吗? 我:听说过。 面试官:那什么是RESTful? 我:就是用起来很规范,挺好的 面试官:是RESTful挺好的,还是自我感觉挺好的 我:都挺好的。 面试官:… 把门关上。 我:… 要干嘛?先关上再说。 面试官:我说出去把门关上。 我:what ?,夺门而去 文章目录01 前言02 RESTful的来源03 RESTful6大原则1. C-S架构2. 无状态3.统一的接
求小姐姐抠图竟遭白眼?痛定思痛,我决定用 Python 自力更生!
点击蓝色“Python空间”关注我丫加个“星标”,每天一起快乐的学习大家好,我是 Rocky0429,一个刚恰完午饭,正在用刷网页浪费生命的蒟蒻...一堆堆无聊八卦信息的网页内容慢慢使我的双眼模糊,一个哈欠打出了三斤老泪,就在此时我看到了一张图片:是谁!是谁把我女朋友的照片放出来的!awsl!太好看了叭...等等,那个背景上的一堆鬼画符是什么鬼?!真是看不下去!叔叔婶婶能忍,隔壁老王的三姨妈的四表...
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看
SQL-小白最佳入门sql查询一
不要偷偷的查询我的个人资料,即使你再喜欢我,也不要这样,真的不好;
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // doshom...
致 Python 初学者
欢迎来到“Python进阶”专栏!来到这里的每一位同学,应该大致上学习了很多 Python 的基础知识,正在努力成长的过程中。在此期间,一定遇到了很多的困惑,对未来的学习方向感到迷茫。我非常理解你们所面临的处境。我从2007年开始接触 python 这门编程语言,从2009年开始单一使用 python 应对所有的开发工作,直至今天。回顾自己的学习过程,也曾经遇到过无数的困难,也曾经迷茫过、困惑过。开办这个专栏,正是为了帮助像我当年一样困惑的 Python 初学者走出困境、快速成长。希望我的经验能真正帮到你
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,...
程序员:我终于知道post和get的区别
是一个老生常谈的话题,然而随着不断的学习,对于以前的认识有很多误区,所以还是需要不断地总结的,学而时习之,不亦说乎
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU...
相关热词 c# plc s1200 c#里氏转换原则 c# 主界面 c# do loop c#存为组套 模板 c# 停掉协程 c# rgb 读取图片 c# 图片颜色调整 最快 c#多张图片上传 c#密封类与密封方法
立即提问