怎么使用JavaScript让Textarea支持tab按键HTMLTextAreaElement.prototype.getCaretPosition = function () { //return the caret position of the textarea return this.selectionStart;};HTML……继续阅读 » 水墨上仙 7年前 (2018-04-08) 2080浏览 1360个赞
JAVA并发编程常识ppt附件下载JVM内存模型堆:所有对象全部放在共享堆空间中对象的属性在共享堆空间内堆内存单字节对齐,short不变栈:每个线程都有独立的线程栈空间线程栈只存基本类型和对象地址栈内存4字节对齐,short变int对象地址4字节,引用堆空间方法中局部变量在线程栈空间内局部变量不会竞争,线程安全方法参数在栈顶交叉,……继续阅读 » 开心洋葱 7年前 (2018-04-03) 1899浏览 0评论2003个赞
Spring Cloud Zuul Api GateWay Errors***************************APPLICATION FAILED TO START***************************Description:Parameter 0 of method sendResponseFi……继续阅读 » 开心洋葱 7年前 (2018-03-29) 2902浏览 1评论2385个赞
coco vscode 调试错误,没有解决,有解决的朋友可以提供下ar: attachRequest: address: 192.168.1.104 port: 5086ar: attachRequest: connectedar: _termiated: cocos firefox protocol error: received error pac……继续阅读 » 开心洋葱 7年前 (2018-03-23) 2095浏览 0评论2683个赞
Mui、Cordova 、ionic、Weex、React Native对比介绍:mui是最接近原生App体验的前端框架。 极小:100k的js文件,60k的css文件。原生编写,不依赖任何三方框架极强:xcode和Android studio里所有原生控件都具备高性能:精练的代码、适时的5+原生动画调用,达到原生应用的体验多端发布:……继续阅读 » 开心洋葱 7年前 (2018-03-23) 2966浏览 0评论964个赞
【已解决】No alive nodes found in your cluster错误php 集成Elasticsearch 时候,查询出现这个错,请检查配置的服务器IP是否正确,服务器是否开启。需要指定节点的ip和端口号,示例代码如下:……继续阅读 » 开心洋葱 7年前 (2018-03-23) 2438浏览 0评论2893个赞
ERROR: [5] bootstrap checks failed[1]: initial heap size [31457280] not equal to maximum heap size [1073741824]; this can cause resize pauses and prevents mlockall from locking th……继续阅读 » 开心洋葱 7年前 (2018-03-23) 1752浏览 9评论804个赞
elasticsearch 运行报错解决 Exception in thread “main” Exception in thread "main" 2018-03-23 11:03:44,430 main ERROR No log4j2 configuration file found. Using de……继续阅读 » 开心洋葱 7年前 (2018-03-23) 1465浏览 16评论1572个赞
v8::WasmCompiledModule::TransferrableModule::TransferrableModule(严重性 代码 说明 项目 文件 行 禁止显示状态错误 C2610 “v8::WasmCompiledModule::TransferrableModule::TransferrableModule(v8::WasmCompil……继续阅读 » 开心洋葱 7年前 (2018-03-22) 2755浏览 0评论648个赞
installation failed with message -99Application Installation FailedInstallation failed with message -99.It is possible that this issue is resolved by uninstalling an existing v……继续阅读 » 开心洋葱 7年前 (2018-03-22) 1832浏览 20评论541个赞
使用cocos2dx 编译android游戏客户端时,使用android studio 3.0以上就会出现如下错误Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details……继续阅读 » 开心洋葱 7年前 (2018-03-22) 2015浏览 48评论162个赞
$ git push --set-upstream master masterfatal: HttpRequestException encountered. ▒▒▒▒▒▒▒▒ʱ▒▒▒▒Username for 'https://github.com': veryloveTo https://github.com/……继续阅读 » 开心洋葱 7年前 (2018-03-22) 1598浏览 0评论2469个赞
spring-cloud-starter-eureka-server报错E:\Java\jdk1.8.0_144\bin\java -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dcom.sun.……继续阅读 » 开心洋葱 7年前 (2018-03-22) 2720浏览 0评论1701个赞
spring cloud starter eureka server报错E:\Java\jdk1.8.0_144\bin\java -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dcom.sun.……继续阅读 » 开心洋葱 7年前 (2018-03-22) 1629浏览 0评论801个赞
HTTP Status 500 – could not execute statement; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute statementtype Exception r……继续阅读 » 开心洋葱 7年前 (2018-03-21) 1527浏览 0评论965个赞
HTTP Status 500 – Unable to instantiate Action, productAction, defined for ‘product_save’ in namespace ‘/’productActiontype Exception reportmessage ……继续阅读 » 开心洋葱 7年前 (2018-03-21) 2529浏览 0评论2983个赞
HTTP Status 500 – Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove ‘readOnly’ marker ……继续阅读 » 开心洋葱 7年前 (2018-03-21) 1355浏览 0评论509个赞
结构化思维能力是啥?就是将杂乱无章的信息通过逻辑加工变成有条理信息的能力,包含信息识别能力、信息归类能力、信息概括能力、信息推理能力和信息表达能力五个部分。作为一个产品经理在需求调研、编写方案、讲解方案等场景下,学会合理运用结构化思维方法,可以让你变得更专业、更优秀,这样年薪30万+还远吗?下面结合产品经理的日常工作,谈一谈产品经理如何有效的运用结构化思……继续阅读 » 开心洋葱 7年前 (2018-03-12) 2607浏览 0评论1997个赞
RocketMQ 管理命令参考大全 sh mqadmin1.1. 控制台使用RocketMQ提供有控制台及一系列控制台命令,用于管理员对主题,集群,broker等信息的管理;l 登录控制台:首先进入RocketMQ工程,进入/RocketMQ/bin在该目录下有个mqadmin脚本l 查看帮助:在mqadmin下可以查看有哪些命令sh ……继续阅读 » 开心洋葱 7年前 (2018-03-10) 1904浏览 0评论1152个赞
export JAVA_HOME=/home/yang/java/export JRE_HOME=$JAVA_HOME/jreexport CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATHexport PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATHexport M2……继续阅读 » 开心洋葱 7年前 (2018-03-08) 2731浏览 0评论1034个赞
git init # 初始化本地git仓库(创建新仓库)git config –global user.name “xxx” # 配置用户名git config –global user.email “xxx@xxx.com” # 配置邮件git config –glo……继续阅读 » 开心洋葱 7年前 (2018-03-06) 1958浏览 0评论2049个赞
{"_nodes": {"total": 1,"successful": 1,"failed": 0},"cluster_name": "elasticsearch","nodes": {……继续阅读 » 开心洋葱 7年前 (2018-02-24) 2094浏览 0评论814个赞
gh-ost简单使用(站在巨人的肩膀上)gh-ost介绍与原理性的东西这里就不多做介绍,因为好雨云发布一篇文章,针对gh-ost原理写的已经非常详细,括号里之所以写(站在巨人的肩膀上),也是对好雨云的感谢与崇拜。 1. gh-ost工作模式gh-ost有三种工作模式:a:连接到从库,在主库做迁移。b:连接到主库,迁移过程所有操作都在主上……继续阅读 » 开心洋葱 7年前 (2018-02-24) 3077浏览 0评论206个赞
geth –networkid 123 –dev –datadir data1 –rpc –rpcaddr 47.104.228.59 –rpcport 8989 –port 3000 //自动创建矿区geth attach ipc:geth.ipc //进入矿区eth.……继续阅读 » 开心洋葱 7年前 (2018-02-17) 1990浏览 0评论2190个赞
单 master 模式也就是只有一个 master 节点,称不上是集群,一旦这个 master 节点宕机,那么整个服务就不可用,适合个人学习使用。多 master 模式多个 master 节点组成集群,单个 master 节点宕机或者重启对应用没有影响。优点:所有模式中性能最高缺点:单个 master 节点宕机期间,未被消费的消息在节点恢复之前……继续阅读 » 开心洋葱 7年前 (2018-02-10) 2383浏览 0评论2394个赞
RocketMQ 架构由这张图可以看到有四个集群,分别是 NameServer 集群、Broker 集群、Producer 集群和 Consumer 集群:NameServer: 提供轻量级的服务发现和路由。 每个 NameServer 记录完整的路由信息,提供等效的读写服务,并支持快速存储扩展。Broker: 通过提供轻量级的 Topic 和……继续阅读 » 开心洋葱 7年前 (2018-02-10) 2940浏览 0评论989个赞
RcoketMQ 是一款低延迟、高可靠、可伸缩、易于使用的消息中间件。具有以下特性:支持发布/订阅(Pub/Sub)和点对点(P2P)消息模型在一个队列中可靠的先进先出(FIFO)和严格的顺序传递支持拉(pull)和推(push)两种消息模式单一队列百万消息的堆积能力支持多种消息协议,如 JMS、MQTT 等分布式高可用的部署架构,满足至少一次消……继续阅读 » 开心洋葱 7年前 (2018-02-10) 3102浏览 0评论2347个赞
RocketMQ 单主部署快速入门 1、clone 源码并用 maven 编译git clone https://github.com/alibaba/RocketMQ.git /opt/RocketMQcd /opt/RocketMQ && mvn -Prelease-all -DskipTests c……继续阅读 » 开心洋葱 7年前 (2018-02-10) 1754浏览 0评论1978个赞
TensorFlow CPU切换到GPU,CPU/GPU互换with tf.Session() as ses: with tf.device("/gpu:1"): matrix1=tf.constant([[3.,3.]]) matrix2=tf.constant([[2.],[2.]])……继续阅读 » 开心洋葱 7年前 (2018-02-08) 2016浏览 0评论2101个赞
AttributeError: module ‘tensorflow‘ has no attribute ‘mul’tensorflow升级到1.0后新版本,tf.mul已经在新版本中被移除,请使用 tf.multiply 代替……继续阅读 » 开心洋葱 7年前 (2018-02-07) 2631浏览 0评论1089个赞
python过滤字符串中不属于指定集合的字符# -*- coding: utf-8 -*-import string# 生成所有字符的可复用的字符串,它还可以作为# 一个翻译表,指明“无须翻译”allchars = string.maketrans('', '')def makefilter(ke……继续阅读 » 水墨上仙 7年前 (2018-01-22) 1483浏览 1949个赞
用Python提取url链接中的域名与端口import urllib proto, rest = urllib.splittype("http://www.75271.com/11/12.htm") host, rest = urllib.splithost(rest) print host host, port……继续阅读 » 水墨上仙 7年前 (2018-01-21) 2347浏览 1088个赞
冒泡法排序Go语言版func BubbleSort(nums []int) { unsorted := true for unsorted { unsorted = false for i := len(nums) - 1; i > 0; i-- { if nums[i……继续阅读 » 水墨上仙 7年前 (2018-01-21) 2052浏览 1513个赞
go语言实现的简单http服务代码package mainimport ( "flag" "log" "net/http" "text/template")var addr = flag.String("addr&q……继续阅读 » 水墨上仙 7年前 (2018-01-20) 3022浏览 1235个赞
go语言编写的猜数字的小游戏代码随机生成一个数字,输入一个数字看是否匹对,匹配则结速,反之提示是大了还是小了转自:http://www.waylau.compackage mainimport ( "bufio" "fmt" "math/rand" "os"……继续阅读 » 水墨上仙 7年前 (2018-01-20) 1866浏览 2681个赞
python自动修改本机网关的代码#!/usr/bin/python#auto change gateway Created By mickelfengimport osimport random,reg='gateway 192.168.1.'rand=random.randint(1,3)test='……继续阅读 » 水墨上仙 7年前 (2018-01-20) 2472浏览 2029个赞
Go语言官方带了一个工具叫cgo,可以很方便的在Go语言代码中内嵌C代码或做C和Go代码的集成。下面是一段简单的在Go中内嵌C的实验代码:package main/*#include #include void say_hello() { printf("Hello World!\n");}*/……继续阅读 » 水墨上仙 7年前 (2018-01-20) 1527浏览 2326个赞
凡是线性回溯都可以归结为右递归的形式,也即是二叉树,因此对于只要求一个解的问题,采用右递归实现的程序要比回溯法要优美的多。def Test(queen,n): '''这个就不用说了吧,就是检验第n(下标,0-7)行皇后的位置是否合理''' q=queen[n] for i in xrange……继续阅读 » 水墨上仙 7年前 (2018-01-20) 3137浏览 941个赞
python检查序列seq 是否含有aset 中的项# -*- coding: utf-8 -*-def containsAny(seq, aset): """ 检查序列seq 是否含有aset 中的项 """ for c in seq: if c in ……继续阅读 » 水墨上仙 7年前 (2018-01-20) 3162浏览 146个赞
python十进制转二进制,可指定位数# convert a decimal (denary, base 10) integer to a binary string (base 2)# tested with Python24 vegaseat 6/1/2005def Denary2Binary(n): ''……继续阅读 » 水墨上仙 7年前 (2018-01-20) 1827浏览 204个赞
在python里面excel的简单读写操作我这里推荐使用xlrd(特别是读操作)到http://pypi.python.org/pypi/xlrd 去下载 xlrd库;import xlrd def open_excel(fileName="simple.xls"): try: fileH……继续阅读 » 水墨上仙 7年前 (2018-01-20) 3159浏览 2752个赞
用Python实现二分查找#!/usr/bin/env pythonimport sys def search2(a,m): low = 0 high = len(a) - 1 while(low <= high): mid = (low + high)/2 midval ……继续阅读 » 水墨上仙 7年前 (2018-01-20) 2596浏览 1431个赞
一行代码实现python字符串反转输出import reastring = 'hello world'revchars = astring[::-1]print(revchars)输出结果dlrow olleh ……继续阅读 » 水墨上仙 7年前 (2018-01-20) 1687浏览 902个赞
你可能已经猜到 switch 可能的形式了。case 体会自动终止,除非用 fallthrough 语句作为结尾。package mainimport ( "fmt" "runtime")func main() { fmt.Print("Go runs on ") s……继续阅读 » 水墨上仙 7年前 (2018-01-20) 1797浏览 2169个赞
在这个练习中,将会使用 Go 的并发特性来并行执行 web 爬虫。修改 Crawl 函数来并行的抓取 URLs,并且保证不重复。package mainimport ( "fmt")type Fetcher interface { // Fetch 返回 URL 的 body 内容,并且将在这个页面上……继续阅读 » 水墨上仙 7年前 (2018-01-20) 1887浏览 1587个赞