上一页 1 2 3 4 5 6 7 8 9 10 ··· 19 下一页

2022年8月22日

psql 定义变量

摘要: DO $$ DECLARE myvar integer; BEGIN SELECT 5 INTO myvar; DROP TABLE IF EXISTS tmp_table; CREATE TABLE tmp_table AS SELECT * FROM yourtable WHERE id = m 阅读全文

posted @ 2022-08-22 15:38 空明流光 阅读(72) 评论(0) 推荐(0)

2022年8月18日

java stopwatch 使用

摘要: public class Program { public static void main(String[] args) throws InterruptedException { var sw = new StopWatch("模板测试"); sw.start("任务1"); Thread.sl 阅读全文

posted @ 2022-08-18 14:36 空明流光 阅读(1122) 评论(1) 推荐(0)

2022年8月15日

idea java maven 依赖项冲突问题排查方法

摘要: 在maven中右键单击需要排查的项目,按下图方法,打开依赖项可视化界面 在弹出界面中按Ctrl+F,搜索你要查看的依赖项,一般都会标注版本,有多个依赖项的自己判断吧 阅读全文

posted @ 2022-08-15 16:07 空明流光 阅读(665) 评论(0) 推荐(0)

2022年8月10日

c# .net core entity framework postgresql 使用

摘要: 环境:vs2022 .net6 工具:EFCore Power Tools v2.5.1074.vsix 右键单击项目,上下文件菜单选择 “EFCore工具” -> "反向工程",然后按照提示连接数据库,生成时 “实体路径” 填写成相对项目的根目录的相对路径,勾选 “在生成的代码中包含连接字符串” 阅读全文

posted @ 2022-08-10 10:36 空明流光 阅读(496) 评论(0) 推荐(0)

2022年8月8日

java mybatis LambdaQueryWrapper 与 QueryWrapper 混合使用

摘要: 虽然我很讨厌低效的mybatis,没办法,搞java只能用它,虽然不能跨表、不能跨库,查询都这么费劲,谁让它生态好呢 var query = new QueryWrapper<SocietyMember>() .select("*") .lambda(); query = query.in(Soci 阅读全文

posted @ 2022-08-08 11:23 空明流光 阅读(1053) 评论(0) 推荐(0)

2022年8月5日

java 访问 postgresql

摘要: var driver = new org.postgresql.Driver(); var databaseProperties = new Properties(); databaseProperties.setProperty("user", databaseUsername); databas 阅读全文

posted @ 2022-08-05 14:31 空明流光 阅读(754) 评论(0) 推荐(0)

2022年8月2日

java springboot 方法返回 header, javascript 可访问

摘要: var servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); var response = servletRequestAttributes.getResp 阅读全文

posted @ 2022-08-02 10:40 空明流光 阅读(740) 评论(0) 推荐(0)

2022年7月29日

vue 实现自定义下拉多选框控件 Checkbox Select

摘要: 网上看了别人写的控件,bug太多,于是仿着自己写了一个 控件:checkableSelect.vue <template> <el-select v-bind="$attrs" v-model="selectedValue" multiple @change="changeSelect"> <el- 阅读全文

posted @ 2022-07-29 13:51 空明流光 阅读(4253) 评论(0) 推荐(0)

2022年7月20日

java stream group by 对结果 value 进行二次 map 示例

摘要: var result = societyMemberService.list(new LambdaQueryWrapper<SocietyMember>() .eq(SocietyMember::getSocietyId, societies.stream().map(x -> x.getId()) 阅读全文

posted @ 2022-07-20 11:41 空明流光 阅读(1719) 评论(0) 推荐(0)

2022年7月14日

java stream 多字段排序

摘要: 我觉得最实用的当属这种原形: var comparator= Comparator.comparing((SocietyMember x)->x.getSocietyId()) .thenComparing(x-> studentMap.get(x.getStudentUuid()).getMatc 阅读全文

posted @ 2022-07-14 18:08 空明流光 阅读(413) 评论(0) 推荐(0)

java mybatis 分页查询

摘要: Page<SignLog> page = new Page<SignLog>(pageIndex + 1, pageSize); Page<SignLog> pagedData = signLogService.page(page,new LambdaQueryWrapper<SignLog>() 阅读全文

posted @ 2022-07-14 14:33 空明流光 阅读(66) 评论(0) 推荐(0)

2022年7月13日

c# 计算文件的 md5 编码

摘要: using (FileStream fs = File.OpenRead(path)) { using (var crypto = MD5.Create()) { var md5Hash = crypto.ComputeHash(fs); return md5Hash; } } 阅读全文

posted @ 2022-07-13 17:41 空明流光 阅读(271) 评论(0) 推荐(0)

2022年7月11日

c# 以共享只读方式打开被其它应用占用的文件

摘要: IWorkbook workbook = null; using (var fs = new FileStream(filepath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) { workbook = new HSSFWorkboo 阅读全文

posted @ 2022-07-11 17:04 空明流光 阅读(635) 评论(0) 推荐(0)

2022年7月5日

java spring 事务流程控制包装 transactionscope

摘要: java spring 中 @transactional 导致整个方法都是事务,无法提前 commit,为了缓存同步,需要在 commit 后清空缓存,就办不到了。 因 c# transactionscope 很方便,于是封装了一个线程安全的 java 版的 transactionscope imp 阅读全文

posted @ 2022-07-05 18:16 空明流光 阅读(177) 评论(0) 推荐(0)

2022年6月30日

asp.net webform 动态调试技巧

摘要: <script runat="server"> protected void TextBox1_TextChanged(object sender, EventArgs e) { Trace.Warn("TextBox1_TextChanged"); } </script> <script runa 阅读全文

posted @ 2022-06-30 10:19 空明流光 阅读(142) 评论(0) 推荐(0)

2022年6月28日

wpf 播放视频以及循环播放

摘要: url: <MediaElement Source="{Binding url}" /> public Uri url { get { return new Uri("http://vjs.zencdn.net/v/oceans.mp4", UriKind.Absolute) ; } } 文件路径: 阅读全文

posted @ 2022-06-28 16:34 空明流光 阅读(697) 评论(0) 推荐(0)

wpf 中的 repeater ------- ItemsControl

摘要: <ItemsControl ItemsSource="{Binding Path=imageNames}" Padding="10"> <ItemsControl.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding}" /> </DataTe 阅读全文

posted @ 2022-06-28 15:22 空明流光 阅读(420) 评论(0) 推荐(0)

2022年6月22日

wpf 布局要点备忘

摘要: 通用: VerticalContentAlignment="Stretch" :内部子控件会垂直100%高度 HorizontalContentAlignment="Stretch" :内部子控件会水平100%宽度 HorizontalAlignment="Left" :设置之后会左对齐,水平方向不 阅读全文

posted @ 2022-06-22 13:53 空明流光 阅读(155) 评论(0) 推荐(0)

wpf xaml 中的计算绑定不用convert

摘要: 安装: Install-Package CalcBinding 基本使用方法:xmlns:c="clr-namespace:CalcBinding;assembly=CalcBinding" 示例: <TextBox xmlns:syswin="clr-namespace:System.Window 阅读全文

posted @ 2022-06-22 11:14 空明流光 阅读(600) 评论(0) 推荐(0)

2022年6月21日

wpf listbox 无选中背景,及纵向横向排列完整实例

摘要: 建议使用ItemsControl替代,ListBox限制太多<TabItem Header="我的Tab页" Name="tabItem1"> <TabItem.Resources> <SolidColorBrush x:Key="Item.MouseOver.Background" Color=" 阅读全文

posted @ 2022-06-21 19:01 空明流光 阅读(437) 评论(0) 推荐(0)

WPF ListBox横向排列自动换行显示表单

摘要: 建议使用ItemsControl替代,ListBox限制太多 如果只是单纯的让ListBox可以横向配列,这样很简单,只需要更改ListBox的ItemsPanel模板就可以,例如: <ListBox><ListBox.ItemsPanel><ItemsPanelTemplate><WrapPane 阅读全文

posted @ 2022-06-21 17:15 空明流光 阅读(1723) 评论(0) 推荐(0)

2022年5月28日

table 固定表头备忘

摘要: 方案1:使用一个table实现 优点:列可以自适应,无论如何也不会出现对不齐的风险 缺点:滚动条出现在了header区域,美中不足 使用了vue语法,但很容易看懂,自己改成纯HTML也可以 <table class="table-fixedHeader" cellpadding="0" cellsp 阅读全文

posted @ 2022-05-28 10:00 空明流光 阅读(471) 评论(0) 推荐(0)

2022年5月24日

c++ 数字类型转string

摘要: #include <string> using namespace std; std::to_string(x) 几乎所有的数字类型都可以转 阅读全文

posted @ 2022-05-24 20:34 空明流光 阅读(414) 评论(0) 推荐(0)

2022年5月20日

java: You aren’t using a compiler supported by lombok, so lombok will not work and has been disabled

摘要: idea 报错:java: You aren’t using a compiler supported by lombok, so lombok will not work and has been disabled.Your processor is: com.sun.proxy.$Proxy27 阅读全文

posted @ 2022-05-20 16:03 空明流光 阅读(4543) 评论(1) 推荐(1)

2022年5月19日

fastjson 反序列化复杂类型或泛型类型

摘要: 示例代码如下: var images = com.alibaba.fastjson.JSON.parseObject(society.getImages(),new TypeReference<String[]>(){}); 阅读全文

posted @ 2022-05-19 15:39 空明流光 阅读(216) 评论(0) 推荐(0)

2022年5月17日

tomcat 打开实时控制台

摘要: cd进入tomcat/logs/文件夹下 tail -f catalina.out 阅读全文

posted @ 2022-05-17 16:20 空明流光 阅读(177) 评论(0) 推荐(0)

centos 7 tomcat 8 开机自启

摘要: 在 /usr/lib/systemd/system 创建文件 tomcat.service,内容如下: [Unit] Description=Tomcat After=syslog.target network.target remote-fs.target nss-lookup.target [S 阅读全文

posted @ 2022-05-17 15:36 空明流光 阅读(53) 评论(0) 推荐(0)

2022年5月13日

java idea 使用 var 关键字定义变量

摘要: 1. 安装 lombok 插件 2. 设置依赖项,根据自己插件版本不同,可能需要引入不同版本 <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.18.8</vers 阅读全文

posted @ 2022-05-13 13:34 空明流光 阅读(1278) 评论(0) 推荐(0)

2022年5月11日

java spring boot 读取 application.properties

摘要: import org.springframework.core.io.DefaultResourceLoader; import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceLoad 阅读全文

posted @ 2022-05-11 15:45 空明流光 阅读(210) 评论(0) 推荐(0)

2022年5月8日

如何强制 windows 11在远程登录时不显示壁纸

摘要: 运行 "gpedit.msc" 找到 “计算机配置\管理模板\远程桌面服务\远程桌面会话主机\远程会话环境\” 在右侧,找到“强制删除远程桌面壁纸”,改为已启用就可以了 阅读全文

posted @ 2022-05-08 23:27 空明流光 阅读(628) 评论(0) 推荐(0)

centos ssh连接卡在【To escape to local shell, press 'Ctrl+Alt+]'.】的解决方法

摘要: 默认一个网卡正常,但只要禁用、去掉或第一个网卡上不了网, 就一直很慢或者看似连上了但经常超时,哎,坑多的要死,困扰很久了,终于解决了 解决方法: 修改文件 /etc/ssh/sshd _config 中的UseDNS选项为 UseDNS no 阅读全文

posted @ 2022-05-08 18:15 空明流光 阅读(1142) 评论(0) 推荐(0)

2022年5月7日

c#使用redis

摘要: using System; using System.Collections.Generic; using System.Linq; using System.Text; using StackExchange.Redis; namespace RedisDemo { public static c 阅读全文

posted @ 2022-05-07 10:44 空明流光 阅读(1405) 评论(0) 推荐(0)

2022年5月6日

centos7下安装Redis5.0.2

摘要: 1、下载redis 地址 http://download.redis.io/releases/redis-5.0.2.tar.gz 2、解压tar -zxf redis-5.0.2.tar.gz 3、make编译 3.1 如果缺少gcc环境需要 yum install gcc 3.2 报错: [ro 阅读全文

posted @ 2022-05-06 20:33 空明流光 阅读(219) 评论(0) 推荐(0)

hyper-v 设置NAT网络备忘

摘要: 1.首先创建一个内部虚拟交换机 2.设置这个虚拟交换机IP和网关为192.168.137.1/255.255.255.0 3.虚拟机中的设置网关:192.168.137.1,掩码:255.255.255.0,IP:192.168.137.2 开始随便设置(比如设置为192.168.137.10) 完 阅读全文

posted @ 2022-05-06 17:48 空明流光 阅读(308) 评论(0) 推荐(0)

Centos7.4 使用 yum 安装 PostgreSql v10

摘要: 转自 https://www.csdn.net/tags/NtDaMgwsNjQ3MTgtYmxvZwO0O0OO0O0O.html 1、浏览器打开 https://www.postgresql.org/download/linux/redhat/ 、安装资源 rpm 、客户端、服务端 yum in 阅读全文

posted @ 2022-05-06 17:07 空明流光 阅读(494) 评论(0) 推荐(0)

2022年5月5日

vue 给路由增加自定义信息meta属性

摘要: const routes = [ { path: '/', component: index, name: 'index', meta: { // 增加 title: '首页', keepAlive: true } }, { path: '/list', component: list, name: 阅读全文

posted @ 2022-05-05 10:35 空明流光 阅读(1219) 评论(0) 推荐(0)

2022年4月28日

java 中使用正则

摘要: var str = "a222b333c"; var matcher = Pattern.compile("\\d+").matcher(str); while(matcher.find()) { //输出匹配到数据 System.out.println(matcher.group()); //拿到 阅读全文

posted @ 2022-04-28 16:06 空明流光 阅读(127) 评论(0) 推荐(0)

java 中使用 tuple

摘要: java 中默认没有 tupple, 写惯了其它语言,很不习惯 引入以下jar包 <dependency> <groupId>com.othelle.jtuples</groupId> <artifactId>jtuples</artifactId> <version>0.1.3</version> 阅读全文

posted @ 2022-04-28 15:01 空明流光 阅读(3084) 评论(0) 推荐(0)

2022年4月25日

java stream 转字符串数组

摘要: var orgs = (String[]) taskOrganizationService.list(new LambdaQueryWrapper<TaskOrganization>() .eq(TaskOrganization::getTaskId, t.getId()) .orderByAsc( 阅读全文

posted @ 2022-04-25 09:59 空明流光 阅读(1186) 评论(0) 推荐(0)

mybatis plus 多字段排序

摘要: var tasks = taskService.list(new LambdaQueryWrapper<Task>() .eq(Task::getTermUuid, termUuid) .orderByDesc(true, Task::getBeginTime, Task::getCreateTim 阅读全文

posted @ 2022-04-25 09:57 空明流光 阅读(5895) 评论(1) 推荐(0)

上一页 1 2 3 4 5 6 7 8 9 10 ··· 19 下一页

导航