一–导读 前不久中国和外国RPEC协议的签订,标志着东亚自贸区的建立成功。现在韩国和日本要做贸易。日本一直监听着韩国总统的一举一动,但他又不会主动。(服务器的监听状态)只是被动的等着韩国总统先开口。……继续阅读 » Love&Share 4天前 2397浏览 0评论633个赞
关于微信小程序开发一直想写一篇相关的文章总结和记录下,结果拖延症犯了迟迟没有下笔;这不最近天气不错,于是找一个空闲的下午将这篇文章输出下(好像跟天气没啥关系😓),那我们就开始吧……继续阅读 » 哇喔WEB 4天前 1055浏览 0评论1446个赞
最近,让前端圈子振奋的消息莫过于 Vue 3.0 的发布,一个无论是性能还是 API 设计都有了重大升级的新版本。距离 Vue 3.0 正式版发布已经有一段时间了,相信相关生态周边库也正在适配新版本中……继续阅读 » 开心洋葱 4天前 1503浏览 0评论1055个赞
点估计的有效性、一致最小方差无偏估计(UMVUE)、零无偏估计法……继续阅读 » 江景景景页 4天前 2106浏览 0评论1195个赞
笔者关注云开发已经很久了,最近动手将之前做的一款团购小程序重构并迁移到了云开发上,同时将源码开源,本文整理了技术的选型、技术要点,欢迎感兴趣的朋友一起交流。……继续阅读 » 王喆(nasa) 4天前 1568浏览 0评论2732个赞
(目录) 1,前言 博主收录了一些在实际开发过程中,很实用且方便的JS操作符,熟练掌握的话,不仅代码看上去高大上(实为装逼),而且简洁大方。 2,代码+应用 2.1,短路运算符 || 从左往右 1,只……继续阅读 » 鹏多多 4天前 1896浏览 0评论1430个赞
在之前的博客中 关于vue的多页面标签功能,对于嵌套router-view缓存的最终无奈解决方法 有写过vue的多页签功能的解决方案 可以看到我当时那个多页签的组件还是比较简单 的,只有打开跟关闭功能……继续阅读 » 开心洋葱 4天前 1222浏览 0评论2523个赞
安装torch后,安装SageAttention,提示ModuleNotFoundError: No module named ‘torch‘,报错如下:Traceback (most recent call last):File “E:\Ai\ComfyUI\.venv\Lib\site-packages\pip\_……继续阅读 » 开心洋葱 12个月前 (03-15) 4169浏览 0评论1252个赞
编译安装SageAttentio时,提示这个错误:Error when trying to install SageAttention – distutils._msvccompiler has no attribute ‘_get_vc_env’ 解决办法:进入环境,输入下面脚本,降下版本,来源开心洋葱……继续阅读 » 开心洋葱 12个月前 (03-15) 3756浏览 0评论2223个赞
在当今的软件开发领域,数据库操作是一项至关重要的任务。MyBatis 作为一款出类拔萃的持久层框架,宛如一把利刃,极大程度地简化了数据库操作流程,让开发者从繁琐的 SQL 编码中解脱出来。不过,在实际的开发工作里,XML 配置的编写有时会显得繁琐复杂,就像在迷宫中寻找出路一样让人头疼。本文旨在分享一些 MyBatis 动态 SQL 的优……继续阅读 » 开心洋葱 1年前 (2025-02-10) 3807浏览 0评论308个赞
JavaScript检测用户电脑是mac还是pcif (navigator.userAgent.indexOf('Mac OS X') != -1) { $("body").addClass("mac");} else { $("body").addClass(&……继续阅读 » 水墨上仙 5年前 (2021-01-15) 2383浏览 925个赞
JavaScript判断Element是否支持 Attributefunction elementSupportsAttribute(element, attribute) { var test = document.createElement(element); if (attribute in test) { return true……继续阅读 » 水墨上仙 5年前 (2021-01-15) 3297浏览 2756个赞
这段代码提供了两个方法对数组进行随机重排<script>var count = 100000,arr = [];for(var i=0;i<count;i++){ arr.push(i);}//常规方法,sort()var t = new Date().getTime();Array.prototype.sort.cal……继续阅读 » 水墨上仙 5年前 (2021-01-15) 2743浏览 1830个赞
JavaScript控制元素的显示和隐藏<script type="text/javascript"><!-- function toggle_visibility(id) { var e = document.getElementById(id); if(e.style.di……继续阅读 » 水墨上仙 5年前 (2021-01-15) 2381浏览 2205个赞
这是一个JavaScript代码条使用的函数,在很多语言里都有类似的函数,用于输出所有的变量function var_dump( objElement, intLimit, intDepth ){ intDepth = intDepth?intDepth:0; intLimit = intLimit?intLimit:1; ……继续阅读 » 水墨上仙 5年前 (2021-01-15) 2858浏览 959个赞
JavaScript的大量字符串链接,如果直接使用加号链接,其实是非常消耗性能的,虽然现在的浏览器如firefox,chrome都会自动对其优化,但是我们在编程的时候还是尽量避免大量字符串直接用加号链接,尽量使用堆栈数组//直接使用加号链接字符串,慢var string = 'abc'; string += '……继续阅读 » 水墨上仙 5年前 (2021-01-15) 3015浏览 1736个赞
JavaScript定义变量也和性能有关,看看下面的代码你就明白了,只是把变量声明换了个地方就可以让代码变快//未优化的代码,很慢for(var i = 0; i < 1000; i++){var my_variable = 'This is my variable';// Do something with my_va……继续阅读 » 水墨上仙 5年前 (2021-01-15) 1406浏览 245个赞
有些JS是可以后加载的,如果一直等待JS加载完成可能非常影响网页上的其它功能实现,比如计数器一类的,jQuery可以对JS进行动态加载。方法1:$.getscript("test.js");方法2:function loadjs(file){ var head = $('head').remo……继续阅读 » 水墨上仙 5年前 (2020-11-25) 1932浏览 2971个赞
JavaScript随机打乱数组function Shuffle(o) { for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x); return o;};使用方法var testArray = ……继续阅读 » 水墨上仙 5年前 (2020-11-18) 2243浏览 1652个赞
JavaScript判断浏览器是否是IEvar isMSIE = /*@cc_on!@*/0;if (isMSIE) { // do IE-specific things} else { // do non IE-specific things} ……继续阅读 » 水墨上仙 5年前 (2020-11-06) 3447浏览 1410个赞
JavaScript不要在for循环语句里使用计算表达式和函数//慢for(var i = 0; i < my_array.length; i++)//也很慢for(var i = 0; i < myMethod(); i++)//快var length = my_array.length;for(var i = 0; ……继续阅读 » 水墨上仙 5年前 (2020-11-06) 2050浏览 1907个赞
一段简单的js代码,让浏览器自动点击按钮<script type="text/javascript"> function init(){ document.getElementById('button1').click(); } onl……继续阅读 » 水墨上仙 5年前 (2020-11-06) 3648浏览 597个赞
python提供了非常方便的日志模块#-*- coding:utf-8 -*-import logging# 配置日志信息logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(name)-12s %(levelname)-……继续阅读 » 水墨上仙 7年前 (2019-09-03) 2464浏览 1736个赞
split(string[, maxsplit]) | re.split(pattern, string[, maxsplit]):按照能够匹配的子串将string分割后返回列表。maxsplit用于指定最大分割次数,不指定将全部分割。import re p = re.compile(r'\d+')print p.spli……继续阅读 » 水墨上仙 7年前 (2019-09-03) 2309浏览 1359个赞
python 中map函数使用范例代码# build a dictionary that maps the ordinals from 32 to 255# to their ASCII character equivalents eg. 33: '!'# (note that 32 and 160 are spaces)……继续阅读 » 水墨上仙 7年前 (2019-09-03) 1966浏览 1495个赞
python统计文本文件内单词数量# count lines, sentences, and words of a text file# set all the counters to zerolines, blanklines, sentences, words = 0, 0, 0, 0print '-' * 50tr……继续阅读 » 水墨上仙 7年前 (2019-09-03) 1680浏览 1591个赞
Go语言获取数组长度// getting the length of an array is silly, because the length is part of the array's static typemyArray := [3]int{1, 2, 3}fmt.Println(len(myArray)) // prints 3……继续阅读 » 水墨上仙 7年前 (2019-09-03) 3343浏览 1702个赞
创建游戏$ cocos new -p com.yt.supermario -d ~/yt/game/ -l cpp supermario> 拷贝模板到 /Users/yt/yt/game/supermario> 拷贝 cocos2d-x ...> 替换文件名中的工程名称,'HelloCpp' 替换为 &……继续阅读 » 开心洋葱 7年前 (2019-09-03) 3172浏览 0评论1004个赞
Go语言排序与接口代码演示import "fmt"type Sorter interface { Len() int Less(i, j int) bool Swap(i, j int)}type Xi []inttype Xs []stringfunc (p Xi) Len() int { ……继续阅读 » 水墨上仙 7年前 (2019-09-03) 3332浏览 493个赞
Go语言写入字符串到文件代码package main import "fmt"import "os"func main() { fileName := "test.dat" dstFile,err := os.Create(fileName) if err!=nil……继续阅读 » 水墨上仙 7年前 (2019-09-03) 3350浏览 2302个赞
go语言里使用scp的范例// https://blogs.oracle.com/janp/entry/how_the_scp_protocol_workspackage mainimport ( "code.google.com/p/go.crypto/ssh" "crypto" &q……继续阅读 » 水墨上仙 7年前 (2019-09-03) 2027浏览 2025个赞
本范例演示了JS中如何通过String.prototype自定义字符串操作协议,本代码定义了两个操作方法,一个用于清除html标签,一个用来转换html标签,都非常有用String.prototype.stripslashes = function(){ return this.replace(/<.*?>/g, '……继续阅读 » 水墨上仙 7年前 (2019-09-03) 3362浏览 2116个赞
实现示例:sql: state=11 and (aa=2 or bb=3)mongodb: { state : “11” , $or : [ { aa : 2 } , { bb : 3 } ] }BasicDBObject whereEnd = new BasicDBObject();whereEnd.put(“s……继续阅读 » 开心洋葱 7年前 (2019-08-22) 1668浏览 0评论383个赞
angular8 添加 消息弹窗提示错误There is no directive with “exportAs” set to “bs-modal” Uncaught Error: Template parse errors:There is no directive with “export……继续阅读 » 开心洋葱 7年前 (2019-08-15) 2199浏览 0评论783个赞
start.spring.io替换国内地址start.75271.com解决spring boot start.spring.io 不能访问使用http://start.spring.io/ 生成工程目前不能访问,可以访问国内地址http://start.75271.comstart.spring.io 访问不了怎么办?这个可以这么解决Spring……继续阅读 » 开心洋葱 7年前 (2019-08-09) 2348浏览 0评论2326个赞
import org.apache.commons.codec.binary.Base64; public class c { public static void main(String[] args) throws Exception { // String base64Str = // &quo……继续阅读 » 开心洋葱 7年前 (2019-08-08) 2258浏览 0评论2099个赞
python计算数组、元祖等列表元素的和print( sum([1,2,3])) 返回值:6……继续阅读 » 水墨上仙 7年前 (2019-08-08) 3087浏览 1703个赞
python遍历字符串中的字符word = raw_input("Enter a word: ")print "\nHere's each letter in your word:"for letter in word: print letter……继续阅读 » 水墨上仙 7年前 (2019-08-08) 3226浏览 1364个赞
def isAString(anobj):return isinstance(anobj, basestring)def isAString(anobj): return isinstance(anobj, basestring)……继续阅读 » 水墨上仙 7年前 (2019-08-08) 2807浏览 914个赞
multipart/form-data类型的POST实体结构相对来说(常规的POST正文采用application/x-www-form-urlencoded格式)比较复杂,它常用于文件上传。下面是一个multipart/form-data格式的POST实体示例-----------------------------114782935826962 ……继续阅读 » 水墨上仙 7年前 (2019-08-08) 2553浏览 147个赞
python写日志的封装类# encoding:utf-8import sysimport loggingimport time def writeLog(message): logger=logging.getLogger() filename = time.strftime('%Y-%m-%d'……继续阅读 » 水墨上仙 7年前 (2019-08-08) 2203浏览 1946个赞
python链接Oracle数据库的代码,需要引用cx_Oracle库#coding=UTF-8 import cx_Oracle def hello(): '''Hello cx_Oracle示例: 1)打印数据库版本信息. 2)查询表数据.'……继续阅读 » 水墨上仙 7年前 (2019-08-08) 3148浏览 2126个赞
python 给目录下的图片批量加水印water.py 放到 图片文件夹里 然后cd 到当前文件夹 python water.py#coding=utf-8import Imageimport os#print list[0]#exit()def getlogo(x1,y1): im =Image.open("./&qu……继续阅读 » 水墨上仙 7年前 (2019-08-08) 1583浏览 440个赞
python正则查找所有匹配的字符串import re p = re.compile(r'\d+')print p.findall('one1two2three3four4') ### output #### ['1', '2', '3……继续阅读 » 水墨上仙 7年前 (2019-08-08) 3458浏览 271个赞
python zip和unzip数据# zipping and unzipping a string using the zlib module# a very large string could be zipped and saved to a file speeding up file writing time # and later rel……继续阅读 » 水墨上仙 7年前 (2019-08-08) 2679浏览 1854个赞