- 博客(785)
- 资源 (122)
- 问答 (1)
- 收藏
- 关注
原创 Java fastjson 错误总结
JSON parse error: parseLong error, field : 0; nested exception is com.alibaba.fastjson.JSONException: parseLong error, field : 01.spring controller 接收传参引起的JSON parse error: parseLong error, field : fieldname; nested exception is com.alibaba.fastjson.J.
2021-07-20 19:16:20 6090
原创 epoll simple demo using stdin stdout
#include<cstdio>#include<unistd.h>#include<sys/epoll.h>constexpr int max_events=10;int main(){ int efd = epoll_create(1024); if(efd == -1){ printf("epoll ceate failed"); return -1; .
2021-07-08 15:32:26 279
原创 C va_start va_end va_list
voiderrMsg(const char *format, ...){va_list argList;int savedErrno;savedErrno = errno; /* In case we change it here */va_start(argList, format);outputError(TRUE, errno, TRUE, format, argList);va_end(argList);errno = savedErrno;}
2021-07-06 15:25:42 78
原创 Linux 域名解析
#include<iostream>#include<unistd.h>#include<netdb.h>#include<sys/types.h>#include<netinet/in.h>#include<sys/socket.h>#include<arpa/inet.h>using namespace std;int main(){ struct hostent *h; .
2021-07-05 18:13:10 121
原创 Spring cloud feign 传参数要注意Date
Feign 传参 可能在 服务那方传入的是日期string,new Date(string)就是错误的一定要注意 feign 传参Date ,最好还是 直接格式化日期string 接收吧。
2021-07-02 15:37:49 345
原创 Java spring cloud gatewayGlobalFilter中调用feign问题
import com.google.gson.Gson;import common.util.Result;import common.util.SpringUtils;import feign.AuthService;import lombok.SneakyThrows;import lombok.extern.slf4j.Slf4j;import org.springframework.cloud.gateway.filter.GatewayFilterChain;import or...
2021-07-01 18:10:28 2577 2
转载 C++ windows base output
HANDLE hConOut, hConIn;hConIn = GetStdHandle(STD_INPUT_HANDLE);hConOut = GetStdHandle(STD_OUTPUT_HANDLE);void zputc (WCHAR c){ DWORD wc; WriteConsoleW(hConOut, &c, 1, &wc, 0);}void zprintf ( const WCHAR *fmt, ...){ UINT r, i, j, .
2021-06-28 17:36:20 131
原创 C++ 模板多继承
#include <iostream>#include<string>#include <unordered_set>class Customer{private: std::string name;public: Customer(std::string const&n):name(n){} std::string getName() const{ return name; }};struct .
2021-06-27 19:25:29 220 1
原创 Java Spring cloud gateway nacos 配置
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/ma.
2021-06-18 16:47:21 322
原创 Java Spring boot nacos 服务发现配置
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"&g.
2021-06-17 22:16:58 93
转载 Java Spring boot 配置 websocket(其中一种方式)
import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;import org.springframework.web.socket.server.standard.ServerEndpointExporter;@Configurationpublic class WebSocketConfig { @Bean pu..
2021-06-08 10:31:02 630
原创 Java JWT
String token = JWT.create().withAudience("rowsx") .sign(Algorithm.HMAC256("12345678")); Pointer.lg(token); JWTVerifier verifier = JWT.require(Algorithm.HMAC256("12345678")) .withAudience("rowsx") .build(); DecodedJWT decodedJWT = veri...
2021-06-04 16:05:57 223
原创 Java jjwt
// Key key = Keys.secretKeyFor(SignatureAlgorithm.HS256); String password = "12345678"; Key key = Keys.hmacShaKeyFor(JJwtUtil.data256Length(password));// key = new SecretKeySpec(password.getBytes(StandardCharsets.UTF_8),"AES"); String jws = Jw..
2021-06-04 15:46:21 356
转载 C++ QT抓取桌面
QScreen *screen_ = QApplication::primaryScreen(); QPixmap pic = screen_->grabWindow(0); QBuffer buffer(&result); buffer.open(QIODevice::WriteOnly); bool isok = pic.save(&buffer, "jpg");
2021-06-04 11:09:27 666
转载 C++ 获取所有窗口
// WinAPI.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。//#include<Windows.h>#include <iostream>BOOL CALLBACK window_callback(HWND window, LPARAM lParam) { char title[255]; GetWindowTextA(window, title, sizeof(title)); std::cout << title.
2021-06-04 10:57:50 2420 1
转载 C++ hdc和bitmap utilities
#include "stdafx.h"#include "PeeperLib.h"#include "PeeperZip.h"#include "Base64.h"#include <afxinet.h>#pragma comment(lib, "Wininet.lib")BOOL WINAPI PL_InitSocket(){#define MAJOR_VERSION 1#define MINOR_VERSION 2 int nStatus = 0; WORD wM.
2021-06-04 10:55:04 613
转载 C++ 获取远程桌面的部分代码(jsmpeg-vnc)
#define WIN32_LEAN_AND_MEAN#include <Windows.h>#include <stdio.h>#include <stdlib.h>#include "grabber.h"grabber_t *grabber_create(HWND window, grabber_crop_area_t crop) { grabber_t *self = (grabber_t *)malloc(sizeof(grabber_t));.
2021-06-04 09:32:38 833
转载 Spring boot 轻量级代理
import org.springframework.boot.web.client.RestTemplateBuilder;import org.springframework.cloud.client.loadbalancer.LoadBalanced;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;import or...
2021-04-11 22:59:49 166
原创 Makefile 独立编译所有cpp文件并执行
all_cpp: *.cpp for cpp in $^; \ do \ echo $$cpp; \ g++ $$cpp -o $$cpp.out; \ doneall_run: *.out for exe in $^; \ do \ echo ./$$exe; \ ./$$exe; \ donea.out: check_types.cpp g++ $<run: a.out ./$<clean: rm -rf *.ou...
2021-04-01 20:22:06 478
原创 vmware workstation 共享文件夹 (Linux)
/usr/bin/vmhgfs-fuse .host:/ /home/xiuye/shares -o subtype=vmhgfs-fuse,allow_other
2021-03-28 21:42:38 314
原创 C++ 指针的变与不变
#include<iostream>using namespace std;int main(){ int a = 10; const int *cia = &a; int * const ica = &a; //*cip = 12; // error! //ica = &a; // error! return 0;}
2021-03-28 18:18:29 398
原创 0xb8000 显示器可以换行输出字符
#include"gdt.h"//screen only here size#define screen_width 80#define screen_height 25extern "C" void clear_screen();extern "C" void print_char(u8 x,u8 y,char c){ //firstly,check pos if(x>=screen_width){ y++; x=0; } if(y>=scree.
2021-03-27 21:21:13 1143 4
原创 C++ 数据类型大小(所占用字节数)
#include<iostream>using namespace std;#define str(type) #type#define sz(type) cout<< str(type) << ":" << sizeof(type) << "B"<< endl; int main(){ sz(void); sz(char); sz(unsigned char); sz(short); sz(unsig.
2021-03-27 16:17:05 196
转载 Java CRC32
// SevenZip/CRC.javapackage SevenZip;public class CRC{ static public int[] Table = new int[256]; static { for (int i = 0; i < 256; i++) { int r = i; for (int j = 0; j < 8; j++) if ((r & 1) != 0) r = (r >>> 1.
2021-03-13 00:04:02 216
原创 CMake arm 编译 参数设置
#THIS FILE IS AUTO GENERATED FROM THE TEMPLATE! DO NOT CHANGE!set(CMAKE_SYSTEM_NAME Generic)set(CMAKE_SYSTEM_VERSION 1)cmake_minimum_required(VERSION 3.17)# specify cross compilers and toolsset(CMAKE_C_COMPILER arm-none-eabi-gcc)set(CMAKE_CXX_COMPI.
2021-02-22 16:57:52 2520 2
原创 CLion C++ SDL cmake
//#include <iostream>#include <xiuye>using namespace xiuye;#include <windows.h>#include <windowsx.h>#include<SDL.h>void msg(const char*str){ MessageBoxA(nullptr,str,"Message",MB_OK);}int main(int argc,char .
2021-02-22 01:04:45 378 1
原创 C++ mpg(要自己备一个)输出frame失败
// SDL_Demo1.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。//#include <iostream>#include<output>extern "C" {#include<libavcodec/avcodec.h>}using namespace xiuye;#define INBUF_SIZE 4096static void pgm_save(unsigned char* buf, int wra.
2021-02-06 18:20:24 279
转载 C++ SDL2 play YUV (流畅,不会卡住)
/** * SDL2播放RGB/YUV * * 本程序使用SDL2播放RGB/YUV视频像素数据。SDL实际上是对底层绘图 * API(Direct3D,OpenGL)的封装,使用起来明显简单于直接调用底层 * API。 * * 函数调用步骤如下: * * [初始化] * SDL_Init(): 初始化SDL。 * SDL_CreateWindow(): 创建窗口(Window)。 * SDL_CreateRenderer(): 基于窗口创建渲染器(Render)。 * SDL.
2021-02-06 16:17:08 375
转载 C# YUV4202RGB 工具方法
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.IO;namespace YUV4202RGB{ public static class YUVHelper { /// <summary> /// YUV420图片字节数据保存为.bmp图片 /// </summary.
2021-02-03 18:31:24 528 1
原创 SDL2 播放 YUV 原始视频数据
//#define SDL_MAIN_HANDLED#include<SDL.h>#include<iostream>using namespace std;int main(int argc, char* argv[]) { //very important and serious about YUV format //cif 352*288 , otherwise fail to play!!! const int width = 352, height = .
2021-02-02 19:28:14 304 2
转载 Windows copy bitmap
HBITMAP CopyBitmap( HBITMAP hbm) { HDC hdcSrc = CreateCompatibleDC(NULL); HDC hdcDst = CreateCompatibleDC(NULL); HBITMAP hbmOld, hbmOld2, hbmNew; BITMAP bm; GetObject(hbm, sizeof(bm), &bm); hbmOld = SelectObject(hdcSrc, hbm); .
2021-02-02 10:21:40 205
原创 Java 二进制处理
package com.xiuye.util.merge;import java.io.IOException;import java.io.OutputStream;import java.nio.file.Files;import java.nio.file.Path;import java.nio.file.Paths;import java.util.Objects;import com.xiuye.util.Pointer;import com.xiuye.util.log..
2021-01-26 10:00:42 450
原创 Java 工具方法 首字母大写,类字段map映射,对比字段赋值
public static Map<String, Field> getPropertyMap(Class<?> clazz) { Map<String, Field> ret = map(); for (Field f : clazz.getDeclaredFields()) { ret.put(f.getName(), f); } return ret; }...
2021-01-13 10:52:11 675 1
原创 Java 以逗号合并多组数据
private void appendValueWithComma(Object srcVo, Object destVo) { try { Class<?> destClazz = destVo.getClass(); Class<?> srcClazz = srcVo.getClass(); Field[] fs = destClazz.getDeclaredFields(); .
2021-01-08 17:57:17 450
原创 JavaScript 移除下划线驼峰命名、替换字符串、数据库字段映射转换...
let arr = [ "phase_a1","phase_a2","phase_b1","phase_b2"];// let vals = ['B', 'C', 'E', 'F', '1', '2', '4', '5'];let vals = ['A', 'D', '0', '3'];function templateReplaceCaseWhen(keys, values) { let ret = 'count('; for (let key of keys) { .
2021-01-07 17:42:15 495
原创 C++ write simple debugger
Simple Debugger:#include<Windows.h>#include<tchar.h>#include <strsafe.h>#include<locale.h>//#include<stdlib.h>void GetErrorMessage(DWORD errCode, LPTSTR errMsg,DWORD size) { FormatMessage( //FORMAT_MESS.
2020-12-30 18:04:28 226
转载 C++ windows Address Windowing Extensions (not OK)
#include <windows.h>#include <stdio.h>#include <tchar.h>#define MEMORY_REQUESTED 1024*1024 // request a megabyteBOOLLoggedSetLockPagesPrivilege(HANDLE hProcess, BOOL bEnable);void _cdecl main(){ BOOL bResult; .
2020-12-29 14:27:37 137
转载 C++ Obtaining a File Name From a File Handle
#include <windows.h>#include <stdio.h>#include <tchar.h>#include <string.h>#include <psapi.h>#include <strsafe.h>#define BUFSIZE 512BOOL GetFileNameFromHandle(HANDLE hFile){ BOOL bSuccess = FALSE; TCHA.
2020-12-29 13:51:52 191
转载 C++ Creating a File Mapping Using Large Pages (未成功)
#include <windows.h>#include <tchar.h>#include <stdio.h>#include<locale.h>#include<conio.h>#define BUF_SIZE 65536TCHAR szName[] = TEXT("LARGEPAGE");typedef int (*GETLARGEPAGEMINIMUM)(void);void DisplayError(const w.
2020-12-29 13:19:52 237
转载 C++ Creating Named Shared Memory
#include <windows.h>#include <stdio.h>#include <conio.h>#include <tchar.h>#include<locale.h>#define BUF_SIZE 256TCHAR szName[] = TEXT("Global\\MyFileMappingObject");TCHAR szMsg[] = TEXT("Message from first process.");.
2020-12-29 11:46:52 159
my mine x.jar
2020-08-08
windows nasm 2.13.1
2017-09-04
linux nasm-2.13.01 编译成功
2017-09-04
nasm-2.13.01-win64
2017-09-04
jna_4.2.1 java
2017-09-03
spring-boot-1.5.6-src
2017-08-18
go语言SDK1.8
2017-03-06
rust-1.15.1-i686-pc-windows-msvc
2017-02-27
DOSBox0.74-win32
2017-01-21
java证书开发包(修正版)
2017-01-19
java证书开发工具包
2017-01-18
my jsonp with spring
2017-01-12
grub2 loader加载kernel和输出helloworld(x86)
2021-03-27
cocos2dx android apk javascript
2020-02-04
cocos2dx android apk
2020-02-04
freeglut.zip
2019-12-31
我的工具类upgrade2
2019-05-08
我的工具类upgrade1
2019-05-07
类型操作工具类
2019-05-04
jboss-eap-7.1.0
2018-03-08
UEFI规范参考文档
2017-12-28
apr-iconv linux 编译成功
2017-09-04
apr linux 编译成功
2017-09-04
apr-util linux 编译成功
2017-09-04
linux apache2 编译成功
2017-09-03
linux eclipse
2017-09-03
java就是调库吗?只要有就是调
2015-11-04
TA创建的收藏夹 TA关注的收藏夹
TA关注的人