摘要: 下面的 employee.c 演示了如何在函数中通过malloc分配堆内存,并返回调用方。 为关注重点,把memset()和free()都省了。 #include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct emp 阅读全文
posted @ 2020-04-11 00:22 god with us 阅读(668) 评论(0) 推荐(1) 编辑
摘要: 任何基类可以出现的地方,都可以用子类来替代。 下面摘录一个单链表的示例: #include <stdio.h> #include <stdlib.h> #include <string.h> struct node { struct node * next; }; struct list { str 阅读全文
posted @ 2020-04-08 14:04 god with us 阅读(241) 评论(0) 推荐(0) 编辑
摘要: c snowflake id twitter 阅读全文
posted @ 2020-04-01 00:19 god with us 阅读(556) 评论(0) 推荐(0) 编辑
摘要: java实现爬虫常用的第三方包: httpclient,for http jsoup,for dom rhino,for js jackson,for json pom.xml摘录 启用log4j基本配置,在main方法中加入语句: 阅读全文
posted @ 2019-03-20 12:35 god with us 阅读(5927) 评论(2) 推荐(1) 编辑
摘要: databasedriverurlremark MySql com.mysql.jdbc.Driver jdbc:mysql://localhost:3306/xxx mysql-connector-java 5 MySql com.mysql.cj.jdbc.Driver jdbc:mysql:/ 阅读全文
posted @ 2019-02-26 23:24 god with us 阅读(275) 评论(0) 推荐(0) 编辑
摘要: 非web环境的spring应用 springframework提供的spring容器,非常适合应用于javaweb环境中。 同时,spring组件的低耦合性为普通java应用也提供了足够的支持。 以下,我们通过一个范例来了解spring在普通java application project中的应用。 阅读全文
posted @ 2019-02-26 14:25 god with us 阅读(1038) 评论(0) 推荐(0) 编辑
摘要: Eclipse 构建 JPA Project 时,需要指定 JPA的实现,如:下图中的EclipseLink 2.7.3,这其实是一个自定义的用户库。 看看,这个用户库包含persistence接口和eclipselink提供的实现。 上述的用户库包含的jar包都在下面的压缩包中: EclipseL 阅读全文
posted @ 2019-02-22 23:02 god with us 阅读(658) 评论(0) 推荐(0) 编辑
摘要: 某项目webapp下有子目录res,其中有img、css、js等存放静态资源的文件夹。 在定义了dispacher-servlet的<url-pattern>/</url-pattern>后, 为访问静态资源,特别在dispacher-servlet.xml定义了<mvc:resource/>标签 阅读全文
posted @ 2019-02-17 20:43 god with us 阅读(6982) 评论(0) 推荐(0) 编辑
摘要: 单一职责原则(Single Responsibility Principle, SRP):一个类只负责一个功能领域中的相应职责,或者可以定义为:就一个类而言,应该只有一个引起它变化的原因。 它用于控制类粒度大小。 开闭原则(Open-Closed Principle, OCP):一个软件实体应当对扩 阅读全文
posted @ 2018-10-18 01:52 god with us 阅读(177) 评论(0) 推荐(0) 编辑
摘要: JDBC访问MySql异常 Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: java.sql.SQLException: 阅读全文
posted @ 2018-10-15 01:24 god with us 阅读(8279) 评论(0) 推荐(4) 编辑