template html go

通过freemarker与itext实现html转pdf

因果 因一些合同、发票等单据需要生成pdf文档,并且审核通过后需给该pdf文档盖章,所以需要生成pdf的解决方案。 实践中遇到的问题 其实单独使用itext也可以实现pdf的生成,但通过文本域进行实现数据的动态替换存在局限性,如动态表格就不能友好的进行动态生成,生成了也是个绝对定位,假如文档后面还存 ......
freemarker itext html pdf

Go - Creating Struct Instances

Problem: You want to create an instance of a struct. Solution: Create a struct instance directly using the name of the struct, or a pointer to a struc ......
Instances Creating Struct Go

html 全选或全不选小案例

lf 你爱好的运动是? 全选/全不选 足球 篮球 羽毛球 乒乓球 <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>lf</title> <script type="text/javascript"> function sel ......
案例 html

go.搭建简单Gin项目

新建gin_demo project 获取gin框架: go get -u github.com/gin-gonic/gin 建一个main方法 package main import "github.com/gin-gonic/gin" import _ "net/http" func main( ......
项目 Gin go

HTML+CSS随笔

这是我的学习笔记,重点是我容易忘的内容,并不全面 配合以下内容学习就很全面了 黑马程序员pink老师前端入门教程 HTML HTML文件基础结构解析 <!DOCTYPE html> <html lang="zh-han"> <head> <meta charset="UTF-8"> <meta na ......
随笔 HTML CSS

HTML图片和文本居中对齐

原理比较简单就不上图片了 你也许听说过在行元素中使用vertical-align: middle; 可以实现居中对其,但实际使用上,常常没有作用。 其实行元素有四条线分别是: 顶线 中线 基线 底线 默认行元素是基线对齐的(两个元素的基线在同一高度) 下面代码相当于图片的基线和文字的中线对齐(图片的 ......
文本 图片 HTML

超能组合:python 的开发效率 + go 的并发 + shell 的短小精悍

工具思维:利用合适的工具做合适的事情,然后合理地加以组合。 在”谈谈程序员应当具备的技术思维“一文中谈到了工具思维。本文对工具思维作一发挥运用。 批量下载图片 程序员总是有点”美图“爱好的。由于程序员通常又是比较”懒惰“的(可没有那个耐心和体力去一页页点开再点击按钮),那么,就会想到用程序来自动化拉 ......
短小精悍 超能 效率 python shell

Go - Parsing Time Displays Into Structs

func main () { str := "4:31am +0800 on Oct 1, 2021" layout := "3:04pm - 0700 on Jan 2, 2006" t , err := time . Parse ( layout , str ) if err != nil { ......
Displays Parsing Structs Into Time

Go - Formatting time

func main () { t := time . Now () fmt . Println ( t . Format ( "3:04PM" )) fmt . Println ( t . Format ( "Jan 02, 2006" )) } When you run this you shou ......
Formatting time Go

Go - Measuring Lapsed Time

Problem: You want to measure the lapsed time and make sure that it is accurate. Solution: Use the monotonic clock in the Time struct to find the lapse ......
Measuring Lapsed Time Go

go语言ent教程:使用zerolog定制ent日志

背景:ent开始debug模式后,可以输出日志,但是我们想为ent接入zerolog,该怎么做呢? 一、引入zerolog go get -u github.com/rs/zerolog 二、自定义zerolog配置 customLog := func(args ...any) { str := f ......
ent zerolog 语言 教程 日志

go语言ent教程:开启debug调试模式

背景:ent模式是没有开启debug模式的 开启ent的调试模式有2种方法: 一、通过配置选项开启 client, err := ent.Open("mysql", "root:dev@123456@tcp(localhost:3306)/test?parseTime=True", ent.Debu ......
语言 模式 教程 debug ent

Go - Representing Duration

Problem: You want to specify a duration of time. Solution: Use the Duration type to represent a span of time. The main representation for a span of ti ......
Representing Duration Go

Go - Representing Time Zones

Problem: You want to include the time zone information in a Time struct. Solution: The Time struct includes a Location , which is the representation o ......
Representing Zones Time Go

vue-router.esm.js:2065 Uncaught (in promise) Error: Redirected when going from "/login?redirect=%2Fhome" to "/home" via a navigation guard.

原因: vue-router路由版本更新产生的问题,导致路由跳转失败抛出该错误; 真正的原因是由于返回了一个Promise对象, 正常的跳转由then方法执行 当正常的路由跳转, 被"路由导航守卫"拦截并重新指定路由时, 由于 this.$router.push() 返回的是Promise对象, 此 ......

kubelet.go 2466 Error getting node not found

kubeadm初始化kubernetes集群报错,kubelet服务提示:kubelet.go:2466] "Error getting node" err="node \"k8s3-master\" not found处理记录。 0. ENV kubernetes 1.22.x/1.23.x/1. ......
kubelet getting Error found 2466

Go - Decoding Data with a Customized Binary Format to Structs

Problem: You want to decode the customized binary format back to structs. Solution: Use the encoding/binary package to take data from the binary forma ......
Customized Decoding Structs Binary Format

Go - Encoding Data to a Customized Binary Format

Problem: You want to encode struct data to a customized binary format. Solution: Design your customized format and use the encoding/binary package to ......
Customized Encoding Binary Format Data

Go - Decoding gob Format Data to Structs

Problem: You want to decode gob format data back to structs. Solution: Use the encoding/gob package to decode the gob format data back to structs. fun ......
Decoding Structs Format Data gob

Go - Encoding Data to gob Format Data

Problem: You want to encode structs into binary gob format. Solution: Use the encoding/gob package to encode the structs into bytes that can be stored ......
Data Encoding Format gob Go

C++模板template应用总结

引言 模板(Template)指C++程序设计设计语言中采用类型作为参数的程序设计,支持通用程序设计。C++ 的标准库提供许多有用的函数大多结合了模板的观念,如STL以及IO Stream。 函数模板 在c++入门中,很多人会接触swap(int&, int&)这样的函数类似代码如下: void s ......
template 模板

使用html和js写一个音乐播放器

代码如下 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>音乐播放器</title> <style> @font-face { font-family: 'ChillCalligraphy'; src: url('./img/C ......
播放器 音乐 html

2023-10-04:用go语言,现有一棵无向、无根的树,树中有 n 个节点,按从 0 到 n - 1 编号 给你一个整数 n 和一个长度为 n - 1 的二维整数数组 edges , 其中 edge

2023-10-04:用go语言,现有一棵无向、无根的树,树中有 n 个节点,按从 0 到 n - 1 编号 给你一个整数 n 和一个长度为 n - 1 的二维整数数组 edges , 其中 edges[i] = [ai, bi] 表示树中节点 ai 和 bi 之间存在一条边。 每个节点都关联一个价 ......
整数 数组 节点 长度 语言

HTML学习笔记——简单介绍

什么是HTML HTML: HyperText Markup Language HTML是一种用来告知浏览器如何组织页面的标记语言。其由一系列的元素组成,这些元素用来包围或者标记不同部分的内容,让它以某种方式呈现或者工作。 简单拆分一个 HTML 元素 观察下面一个HTML元素 <p> Hello ......
笔记 HTML

go定时任务

目录go定时任务TimeNewTimerNewTickercron文档 go定时任务 Time NewTimer package main import ( "fmt" "time" ) func cronTimer() { /** timer定时器 实现一些定时操作 本质通过chan阻塞实现 且只 ......
任务

关于 HTML 元素是否能够正确响应用户点击事件的讨论

已知两组 HTML 元素: <input disabled />, <button tabindex="0">, <button (click)="foo($event)"></button> <div tabindex="0"></div>, <p (click)="foo($event)"></ ......
元素 事件 用户 HTML

HTML Canvas 画布

HTML <canvas>画布元素用于通过脚本(通常是JavaScript)动态绘制图形。 <canvas> 画布元素只是图形的容器。您必须使用脚本来实际绘制图形。 <canvas>有几种用于绘制路径、框、圆、文本和添加图像的方法。 绘制canvas <!DOCTYPE html> <html la ......
画布 Canvas HTML

[回顾-前端]从简陋的html到单网页再到全栈开发

👉点我去作业一 👉点我去作业二 👉点我去作业三(抱歉,还没部署到服务器里,这个只能在我自己的电脑里用) 👉点我去作业四 其实这依然是个博客 粗糙的作业一 当时只学过html,css,js的快速入门,对盒子<div>的玩法还不太熟,还只会用浮动盒子float和绝对定位,结局就是写两句html就 ......
前端 网页 html

Go语言中泛型的一个用法

type OperationWithData[T any] func() (T, error) type Operation func() error func (o Operation) withEmptyData() OperationWithData[struct{}] { return fu ......
语言

Go - Creating JSON Data Streams from Structs

Problem: You want to create streaming JSON data from structs. Solution: Create an encoder using NewEncoder in the encoding/json package, passing it an ......
Creating Streams Structs Data JSON