??xml version="1.0" encoding="utf-8" standalone="yes"?>久久精品国产亚洲一区二区,69SEX久久精品国产麻豆,午夜精品久久久久http://m.shnenglu.com/wythern/X presents Y for a better Zzh-cnSat, 05 Jul 2025 06:39:02 GMTSat, 05 Jul 2025 06:39:02 GMT60[转]在Linux下如何创建ramdiskhttp://m.shnenglu.com/wythern/archive/2020/02/26/217165.htmlwythernwythernWed, 26 Feb 2020 07:17:00 GMThttp://m.shnenglu.com/wythern/archive/2020/02/26/217165.htmlhttp://m.shnenglu.com/wythern/comments/217165.htmlhttp://m.shnenglu.com/wythern/archive/2020/02/26/217165.html#Feedback0http://m.shnenglu.com/wythern/comments/commentRss/217165.htmlhttp://m.shnenglu.com/wythern/services/trackbacks/217165.htmlRefer to How to Easily Create Ramdisk on Linux

This tutorial will show you how to quickly create a RAM disk in any Linux distro (Debian, Ubuntu, Linux, Fedora, Arch Linux, CentOS, etc). Compared to commercial Windows RAM disk software that costs money, Linux can utilize this cool feature 100% free of charge.

What is RAM Disk?

RAM disk is also known as RAM drive. It’s a portion of your RAM that are formated with a file system. You can mount it to a directory on your Linux system and use it as a disk partition.

Why use RAM disk?

RAM is ultra-fast compared to even the fastest solid state drive (SSD). As you may know, the main performance bottleneck in today’s computer is the speed of hard drive, so moving programs and files to the RAM disk yields super fast computing experience.

Pros of RAM disk:

  • Ultra-fast
  • Can sustain countless reads and writes

Cons of RAM disk:

  • RAM is volatile which means all data in RAM disk will be lost when the computer shutdowns or reboots. However, this can be a pro in some situations, if you use it wisely.
  • RAM is expensive so it has limited capacity. You need to make sure not allocate too much space for RAM disk, or the operating system would run out of RAM.

You can do a lot of interesting things with RAM disk.

  • RAM disk is best suited for temporary data or caching directories, such as Nginx FastCGI cache. If you use a SSD and there will be a lot of writes to a particular directory, you can mount that directory as a RAM disk to reduce wear out of SSD.
  • I also use RAM disk to temporary store screenshots when writing articles on this blog, so when my computer shut down, those screenshots will automatically be deleted on my computer.
  • You may not believe it, but I use RAM disk to run virtual machines inside VirtualBox. My SSD is about 250G. I can’t run many VMs directly on the SSD and I’m not happy about the speed of my 2TB mechanical hard drive (HDD). I can move the VM from HDD to RAM disk before starting the VM, so the VM can run much faster.  After shutting down the VM, I move the VM files back to HDD, which takes less than 1 minute. This of course requires your computer to have a large capacity RAM.

How to Create a RAM Disk in Any Linux Distro

First make a directory which can be anywhere in the file system such as

sudo mkdir /tmp/ramdisk

If you want to let every user on your Linux system use the RAM disk, then change its permission to 777.

sudo chmod 777 /tmp/ramdisk

Next, check how much free RAM are left on your system with htop command line utility because we don’t want to use too much RAM.

htop

easily create ram disk linux

Then all left to do is to specify the file system typeRAM disk sizedevice name and mount it to the above directory. You can see from the screenshot above that I have plenty of free RAM, so I can easily allocate 1GB for my RAM disk. This can be done with the following one-liner. It will be using tmpfs file system and its size is set to 1024MB. myramdisk is the device name I gave to it.

sudo mount -t tmpfs -o size=1024m myramdisk /tmp/ramdisk

To allocate 10G for the RAM disk, run this instead.

sudo mount -t tmpfs -o size=10G myramdisk /tmp/ramdisk

If we issue the following command

mount | tail -n 1

We can see it’s successfully mounted.

create linux ramdisk

Now if I copy my VirtualBox machines file (5.8G) into the RAM disk, my RAM usage suddenly goes up to 9.22G.

linux automount ramdisk

If I unmount RAM disk,

sudo umount /tmp/ramdisk/

Everything in that directory will be lost and RAM usage goes down to original.

linux ramdisk file system

This is how you can test if your RAM disk is working.

Test RAM Disk Speed

To test write speed of RAM disk, you can use dd utility.

sudo dd if=/dev/zero of=/tmp/ramdisk/zero bs=4k count=100000

Which gave me 2.8GB/s write speed.

linux ramdisk speed test

To test read speed, run:

sudo dd if=/tmp/ramdisk/zero of=/dev/null bs=4k count=100000

Which gave me 3.1 GB/s read speed.

I also did a speed test on my SSD. The write speed is 534MB/s and read speed 1.6GB/s.

Auto-mount on System Boot

Edit /etc/fstab file.

sudo nano /etc/fstab

Add an entry like this:

myramdisk  /tmp/ramdisk  tmpfs  defaults,size=1G,x-gvfs-show  0  0

x-gvfs-show will let you see your RAM disk in file manager. Save and close the file. Your Linux system will automatically mount the RAM disk when your computer boots up.

To mount it immediately without reboot, run the following command.

sudo mount -a


wythern 2020-02-26 15:17 发表评论
]]>
在truffle或其他测试环境下如何得到contract的返回?/title><link>http://m.shnenglu.com/wythern/archive/2019/11/28/217004.html</link><dc:creator>wythern</dc:creator><author>wythern</author><pubDate>Thu, 28 Nov 2019 10:13:00 GMT</pubDate><guid>http://m.shnenglu.com/wythern/archive/2019/11/28/217004.html</guid><wfw:comment>http://m.shnenglu.com/wythern/comments/217004.html</wfw:comment><comments>http://m.shnenglu.com/wythern/archive/2019/11/28/217004.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/wythern/comments/commentRss/217004.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/wythern/services/trackbacks/217004.html</trackback:ping><description><![CDATA[<p>    1. 使用pure或者view函数Q直接拿到返回|但不是所有的函数都能声明成pure/view?/p> <p>    2. 使用event包装q回|但是在emit之前q回的函数是没有event的,如果需要每条path都返回有意义的return valueQ可能需要定义很多个event。(不考虑require throw的情况下Q?/p> <p>    3. 使用web3.eth.Contract.callQ需要ABI和deployed addressQ这个用法有个缺Ҏ(gu)函数变成了(jin)constant的,卛_1一h法改变合U内部状态,只能说在特定的场景下有用?/p> <p>    4. EIP-758(<a >https://eips.ethereum.org/EIPS/eip-758</a>)Q返回returnData在subscribe的通道上,但是看目前的状态还是draft?/p> <p><br /></p><img src ="http://m.shnenglu.com/wythern/aggbug/217004.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/wythern/" target="_blank">wythern</a> 2019-11-28 18:13 <a href="http://m.shnenglu.com/wythern/archive/2019/11/28/217004.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[转]CRLF和LF在跨q_工作时候带来的?ch)恼以?qing)解决Ҏ(gu)http://m.shnenglu.com/wythern/archive/2019/03/27/216318.htmlwythernwythernWed, 27 Mar 2019 05:29:00 GMThttp://m.shnenglu.com/wythern/archive/2019/03/27/216318.htmlhttp://m.shnenglu.com/wythern/comments/216318.htmlhttp://m.shnenglu.com/wythern/archive/2019/03/27/216318.html#Feedback0http://m.shnenglu.com/wythern/comments/commentRss/216318.htmlhttp://m.shnenglu.com/wythern/services/trackbacks/216318.html在此

在用git提交代码时候,有时候会(x)遇到一个问题,是自己明明只修改了(jin)其中几行Q提交上M后发现整个文仉被修改了(jin)Q在讄?jin)格式风g后还?sh)(x)有提交不上ȝ情况Q这个时候经常让人摸不到头脑Q其实就是CRLF和LF在作?/p>

CRLF LF CR 都是什么意思:(x)

  • CRLF: 是carriagereturnlinefeed的羃写。中文意思是回R换行?/p>

  • LF: 是line feed的羃写,中文意思是换行?/p>

  • CR: 是carriagereturn的羃写。中文意思是回R?/p>

单的换行回RZ么会(x)引出q么多的问题呢,关键在于操作pȝ之间的分歧:(x)

早期的macpȝ使用CR当做换行Q现在也已经l一成了(jin)LF

Unix(包含现在大量使用的linux)pȝ使用LF

windowspȝ使用LFCR当做换行Q自作聪明的兼容性?Q)(j)

也正是因Z同系l的分歧Q在多h协作共同开发的时候,可能D提交代码时候生问题?/p>

解决Ҏ(gu)Q?/h2>

Android Studio内部可以讄不同模式Q具体位|在setting-->搜烦(ch)code style见下图:(x)





















讄格式

其中有四个选项System-Dependent LF CR CRLFQ默认是System-DependentQ也是Ҏ(gu)你是什么系l选择什么类型,如果惌自定义的话可以在q里讄Q以后创建的C码也默认用设|的方式

而如果想单独修改某个文g的类型,也可以在右下角进行修改,见下图:(x)

单独修改某个文g

跨^台合作时候的解决方式Q?/h2>

当我们用git库提交代码的时候,有的人可能用macQ有的h使用linuxQ有的h使用windowsQ不同的开发环境如果都是按照自ql的方式L修改换行cdQ难免会(x)让代码库整体混ؕ或者生许多没有必要的代码更新

那么解决该问题的方式有:(x)core.autocrlf命o(h)

gitZ(jin)防止以上问题Cؕ跨^台合作开发,使用命o(h)可以转化LF和CRLF

具体体现为:(x)

  • git config --global core.autocrlf true


Git可以在你push时自动地把行l束WCRLF转换成LFQ而在pull代码时把LF转换成CRLF。用core.autocrlf来打开此项功能Q如果是在Windowspȝ上,把它讄成trueQ这样当{և代码ӞLF?x)被转换成CRLF

  • git config --global core.autocrlf input

Linux或Macpȝ使用LF作ؓ(f)行结束符Q当一个以CRLFl束W的文g不小?j)被引入时你肯定惌行修正,把core.autocrlf讄成input来告?Git 在push时把CRLF转换成LFQpull时不转换

  • git config --global core.autocrlf false

在本地和代码库中都保留C(j)RLFQ无论pullq是push都不变,代码库什么样Q本地还是什么样?/p>

当然在多q_工作时候,最好还是约定用LFQ还是CRLFQ然后不同系l进行对应的讄Q这h工作规范Q也有利于提高工作效率,希望以上可以帮助大家?/strong>



作者:(x)sososun
链接Qhttps://www.jianshu.com/p/dd7464cf32b5
来源Q简?br />书著作权归作者所有,M形式的{载都误pM者获得授权ƈ注明出处?/div>

wythern 2019-03-27 13:29 发表评论
]]>How to shuffle arrays and slices in Gohttp://m.shnenglu.com/wythern/archive/2019/01/17/216208.htmlwythernwythernThu, 17 Jan 2019 12:27:00 GMThttp://m.shnenglu.com/wythern/archive/2019/01/17/216208.htmlhttp://m.shnenglu.com/wythern/comments/216208.htmlhttp://m.shnenglu.com/wythern/archive/2019/01/17/216208.html#Feedback0http://m.shnenglu.com/wythern/comments/commentRss/216208.htmlhttp://m.shnenglu.com/wythern/services/trackbacks/216208.html在此

׃Go没有为slice提供shuffle函数Q所以需要自己想办法。由于我只需要随Zơ遍? -> NQ所以这Dcode最匚w?br />
func main() {
  vals := []int{10, 12, 14, 16, 18, 20}
  r := rand.New(rand.NewSource(time.Now().Unix()))
  for _, i := range r.Perm(len(vals)) {
    val := vals[i]
    fmt.Println(val)
  }
}

ggo不像scala有U惰性求值的Ҏ(gu),所以这里的r.Perm()q是产生?jin)一个sliceQ如果N很大可能是个问题?br />




wythern 2019-01-17 20:27 发表评论
]]>
go test 用args带参?/title><link>http://m.shnenglu.com/wythern/archive/2018/08/14/215845.html</link><dc:creator>wythern</dc:creator><author>wythern</author><pubDate>Tue, 14 Aug 2018 09:04:00 GMT</pubDate><guid>http://m.shnenglu.com/wythern/archive/2018/08/14/215845.html</guid><wfw:comment>http://m.shnenglu.com/wythern/comments/215845.html</wfw:comment><comments>http://m.shnenglu.com/wythern/archive/2018/08/14/215845.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/wythern/comments/commentRss/215845.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/wythern/services/trackbacks/215845.html</trackback:ping><description><![CDATA[<div>试中想通过命o(h)行传递一些参数给test funcQ网上找?jin)一些资料但q程不是很顺利,q里记录一下?/div> <div></div> <div>首先go test有一?args的参数说可以辑ֈq个目的Q但实测下来发现有没有没区别。。?/div> <div>google查到的大部分也是用到?jin)flagcd?/div> <div>flag.go的注释写的比较清?/div> <div> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #008000; ">/*</span><span style="color: #008000; "><br />     Package flag implements command-line flag parsing.<br /> <br />     Usage:<br /> <br />     Define flags using flag.String(), Bool(), Int(), etc.<br /> <br />     This declares an integer flag, -flagname, stored in the pointer ip, with type *int.<br />         import "flag"<br />         var ip = flag.Int("flagname", 1234, "help message for flagname")<br />     If you like, you can bind the flag to a variable using the Var() functions.<br />         var flagvar int<br />         func init() {<br />             flag.IntVar(&flagvar, "flagname", 1234, "help message for flagname")<br />         }<br />     Or you can create custom flags that satisfy the Value interface (with<br />     pointer receivers) and couple them to flag parsing by<br />         flag.Var(&flagVal, "name", "help message for flagname")<br />     For such flags, the default value is just the initial value of the variable.<br /> <br />     After all flags are defined, call<br />         flag.Parse()<br />     to parse the command line into the defined flags.<br /> <img src="http://m.shnenglu.com/Images/dot.gif" alt="" /><br /> </span><span style="color: #008000; ">*/</span></div> </div> <div></div> <div>因此需要做的事情就是:(x)</div> <div>1. 定义flagQ这个需要在main()执行之前完成Q我q里在test文g里面用全局变量完成Q但a可以攑֜函数里面?/div> <div> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #000000; ">var (<br />     </span><span style="color: #008000; ">//</span><span style="color: #008000; "> Define global args flags.</span><span style="color: #008000; "><br /> </span><span style="color: #000000; ">    pA </span><span style="color: #000000; ">=</span><span style="color: #000000; "> flag.Int(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">a</span><span style="color: #000000; ">"</span><span style="color: #000000; ">, </span><span style="color: #000000; ">0</span><span style="color: #000000; ">,  </span><span style="color: #000000; ">"</span><span style="color: #000000; ">a.</span><span style="color: #000000; ">"</span><span style="color: #000000; ">)<br />     a </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #000000; ">0</span><span style="color: #000000; "><br /> )</span></div> </div> <div>2. parse flagQ这个要在test func执行之前Q所以可以考虑加入一个init()在test文g里?/div> <div> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #000000; ">func init() {<br />     flag.Parse()<br />     a </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #000000; ">*</span><span style="color: #000000; ">pA<br /> }</span></div> </div> <div>后面使用q些变量没有问题(sh)(jin)Q比如这?/div> <div> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #000000; ">func TestInit(t </span><span style="color: #000000; ">*</span><span style="color: #000000; ">testing.T) {<br />     flag.Parse()<br />     t.Log(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">a = </span><span style="color: #000000; ">"</span><span style="color: #000000; ">, a)<br /> }<br /> </span></div> </div> <div></div> <div>q里用到的主要是flag的功能,试用发现有没有-args问题?sh)大Q所以这个用法可能不是很W合go test的要求,先用h再说?jin)?/div> <div></div> <div></div> <div></div><div></div><div>REF</div> <div>1. https://www.golangtc.com/t/584cbd16b09ecc2e1800000b</div> <div>2. https://stackoverflow.com/.../process-command-line-arguments-in-go-test</div><div>3. https://hsulei.com/2017/08/23/gotest如何使用自定义参?</div> <div><cite><br /></cite></div> <div></div><img src ="http://m.shnenglu.com/wythern/aggbug/215845.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/wythern/" target="_blank">wythern</a> 2018-08-14 17:04 <a href="http://m.shnenglu.com/wythern/archive/2018/08/14/215845.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[转]shell中if条g字符丌Ӏ数字比对,[[ ]]和[ ]区别http://m.shnenglu.com/wythern/archive/2018/08/14/215844.htmlwythernwythernTue, 14 Aug 2018 08:44:00 GMThttp://m.shnenglu.com/wythern/archive/2018/08/14/215844.htmlhttp://m.shnenglu.com/wythern/comments/215844.htmlhttp://m.shnenglu.com/wythern/archive/2018/08/14/215844.html#Feedback0http://m.shnenglu.com/wythern/comments/commentRss/215844.htmlhttp://m.shnenglu.com/wythern/services/trackbacks/215844.html原文在此

学习(fn)shell的时候L被shell里的条g判断方式搞得头疼Q经怸知道?用[],[[]],(())q是test,letQ而很有书把它们的关p讲解的很清?应该是我(zhn)性差或是看书太少)Q今天ȝ一下,基础的东西如它们 的用方法不再赘qͼ重点说说它们的区别的使用时应该注意的地方?br />
先说[]和testQ两者是一L(fng)Q在命o(h)行里test expr和[ expr ]的效果相同。test的三个基本作用是判断文g、判断字W串、判断整数。支持用与或非表辑ּq接h。要注意的有Q?br />
1.test中可用的比较q算W只?=?=Q两者都是用于字W串比较的,不可用于整数比较Q整数比较只能?eq, -gtq种形式。无论是字符串比较还是整数比较都千万不要使用大于号小于号。当?dng)如果你实在想用也是可以的Q对于字W串比较可以使用括L(fng)转义形式Q?如果比较"ab"?bc"Q[ ab \< bc ]Q结果ؓ(f)真,也就是返回状态ؓ(f)0.

然后是[[ ]]Q这是内|在shell中的一个命令,它就比刚才说的test强大的多?jin)。支持字W串的模式匹配(使用=~操作W时甚至支持shell的正则表?式)(j)。简直强大的令h发指Q逻辑l合可以不用test?a,-o而?amp;&,||q样更亲切的形式(针对c、JavaE序?。当 ?dng)也不用想的太复杂Q基本只要记?br />1.字符串比较时可以把右边的作ؓ(f)一个模式(q是双的字W串不加双引L(fng)情况下。如果右边的字符串加?jin)双引号Q则认ؓ(f)是一个文本字W串。)(j)Q而不仅仅是一个字W串Q比如[[ hello == hell? ]]Q结果ؓ(f)真?/p>

另外要注意的是,使用[]和[[]]的时候不要吝啬空|每一两辚w要有I格Q[[ 1 == 2 ]]的结果ؓ(f)“?#8221;Q但[[ 1==2 ]]的结果ؓ(f)“?#8221;Q后一U显然是错的


3.最后就是let?())Q两者也是一L(fng)(或者说基本上是一L(fng)Q双括号比letE弱一?。主要进行算术运?上面的两个都不行)Q也比较适合q?行整数比较,可以直接使用熟?zhn)?lt;,>{比较运符。可以直接用变量名如var而不需?varq样的Ş式。支持分号隔开的多个表辑ּ



wythern 2018-08-14 16:44 发表评论
]]>
一张图?jin)解公链和私?/title><link>http://m.shnenglu.com/wythern/archive/2018/08/01/215813.html</link><dc:creator>wythern</dc:creator><author>wythern</author><pubDate>Wed, 01 Aug 2018 06:05:00 GMT</pubDate><guid>http://m.shnenglu.com/wythern/archive/2018/08/01/215813.html</guid><wfw:comment>http://m.shnenglu.com/wythern/comments/215813.html</wfw:comment><comments>http://m.shnenglu.com/wythern/archive/2018/08/01/215813.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/wythern/comments/commentRss/215813.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/wythern/services/trackbacks/215813.html</trackback:ping><description><![CDATA[<div><img src="https://cdn-images-1.medium.com/max/1600/0*s0QUH2j9SAetBKQv." alt="" longdesc="private_and_public_chain" /><img src="http://m.shnenglu.com/images/cppblog_com/wythern/0_x2A_s0QUH2j9SAetBKQv..png" alt="" longdesc="private_and_public_chain" /></div><div>囄来源Qhttps://blog.slock.it/public-vs-private-chain-7b7ca45044f</div><img src ="http://m.shnenglu.com/wythern/aggbug/215813.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/wythern/" target="_blank">wythern</a> 2018-08-01 14:05 <a href="http://m.shnenglu.com/wythern/archive/2018/08/01/215813.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Full go tool list (keep constructing)http://m.shnenglu.com/wythern/archive/2018/07/21/215794.htmlwythernwythernSat, 21 Jul 2018 06:09:00 GMThttp://m.shnenglu.com/wythern/archive/2018/07/21/215794.htmlhttp://m.shnenglu.com/wythern/comments/215794.htmlhttp://m.shnenglu.com/wythern/archive/2018/07/21/215794.html#Feedback0http://m.shnenglu.com/wythern/comments/commentRss/215794.htmlhttp://m.shnenglu.com/wythern/services/trackbacks/215794.html
go get github.com/golang/lint/golint
go get github.com/kisielk/errcheck
go get golang.org/x/tools/cmd/benchcmp
go get github.com/cespare/prettybench
go get github.com/ajstarks/svgo/benchviz
go get golang.org/x/tools/cmd/stringer
go get github.com/josharian/impl
go get golang.org/x/tools/cmd/goimports
go get sourcegraph.com/sqs/goreturns
go get code.google.com/p/rog-go/exp/cmd/godef
go get github.com/nsf/gocode
go get golang.org/x/tools/cmd/oracle
go get golang.org/x/tools/cmd/gorename
go get github.com/kisielk/godepgraph


wythern 2018-07-21 14:09 发表评论
]]>
Some materials about RPC transaction call.http://m.shnenglu.com/wythern/archive/2018/07/14/215784.htmlwythernwythernSat, 14 Jul 2018 09:00:00 GMThttp://m.shnenglu.com/wythern/archive/2018/07/14/215784.htmlhttp://m.shnenglu.com/wythern/comments/215784.htmlhttp://m.shnenglu.com/wythern/archive/2018/07/14/215784.html#Feedback0http://m.shnenglu.com/wythern/comments/commentRss/215784.htmlhttp://m.shnenglu.com/wythern/services/trackbacks/215784.html

Introduction

Solidiay doc about ABI and contract access.
https://solidity.readthedocs.io/en/develop/abi-spec.html
https://solidity.readthedocs.io/en/latest/introduction-to-smart-contracts.html?highlight=selfdestruct
http://www.ethdocs.org/en/latest/contracts-and-transactions/accessing-contracts-and-transactions.html
http://ethdocs.org/en/latest/contracts-and-transactions/contracts.html#testing-contracts-and-transactions
https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=suicide [global variables like msg.sender]
ABI intro in Ethereum Wiki.
https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI#argument-encoding
https://github.com/ethereum/go-ethereum/wiki/Contract-Tutorial
JAON rpc api of Eth.
https://github.com/ethereum/wiki/wiki/JSON-RPC#json-rpc-api
https://github.com/ethereum/wiki/wiki/JavaScript-API#contract-methods
Deploy a contract using RPC.
https://github.com/rsksmart/rskj/wiki/Deploying-contracts-using-RPC-calls
A tool to generate the grpc server code for a contract
https://github.com/getamis/grpc-contract

How to test.

http://ethereum-tests.readthedocs.io/en/latest/test_types/transaction_tests.html
https://github.com/ethereum/cpp-ethereum/blob/develop/doc/generating_tests.rst
go-ethereum里面有一批vm和contract相关的testsQ结合ABI和contract的定义,可以很容易的写一批自己定制的试Q从web3js或者直接在go project里面调用都可以?/div>



wythern 2018-07-14 17:00 发表评论
]]>What is shade jar, and what is its purpose.http://m.shnenglu.com/wythern/archive/2017/06/19/215009.htmlwythernwythernMon, 19 Jun 2017 03:23:00 GMThttp://m.shnenglu.com/wythern/archive/2017/06/19/215009.htmlhttp://m.shnenglu.com/wythern/comments/215009.htmlhttp://m.shnenglu.com/wythern/archive/2017/06/19/215009.html#Feedback0http://m.shnenglu.com/wythern/comments/commentRss/215009.htmlhttp://m.shnenglu.com/wythern/services/trackbacks/215009.html

https://stackoverflow.com/questions/13620281/what-is-the-maven-shade-plugin-used-for-and-why-would-you-want-to-relocate-java


Uber JAR, in short, is a JAR containing everything.

Normally in Maven, we rely on dependency management. An artifact contains only the classes/resources of itself. Maven will be responsible to find out all artifacts (JARs etc) that the project depending on when the project is built.

An uber-jar is something that take all dependencies, and extract the content of the dependencies and put them with the classes/resources of the project itself, in one big JAR. By having such uber-jar, it is easy for execution, because you will need only one big JAR instead of tons of small JARs to run your app. It also ease distribution in some case.

Just a side-note. Avoid using uber-jar as Maven dependency, as it is ruining the dependency resolution feature of Maven. Normally we create uber-jar only for the final artifact for actual deployment or for manual distribution, but not for putting to Maven repository.


Update: I have just discovered I haven't answered one part of the question : "What's the point of renaming the packages of the dependencies?". Here is some brief updates and hopefully will help people having similar question.

Creating uber-jar for ease of deployment is one use case of shade plugin. There are also other common use cases which involve package renaming.

For example, I am developing Foo library, which depends on a specific version (e.g. 1.0) of Bar library. Assuming I cannot make use of other version of Bar lib (because API change, or other technical issues, etc). If I simply declare Bar:1.0 as Foo's dependency in Maven, it is possible to fall into a problem: A Qux project is depending on Foo, and also Bar:2.0 (and it cannot use Bar:1.0 because Qux needs to use new feature in Bar:2.0). Here is the dilemma: should Qux use Bar:1.0 (which Qux's code will not work) or Bar:2.0 (which Foo's code will not work)?

In order to solve this problem, developer of Foo can choose to use shade plugin to rename its usage of Bar, so that all classes in Bar:1.0 jar are embedded in Foo jar, and the package of the embedded Bar classes is changed from com.bar to com.foo.bar. By doing so, Qux can safely depends on Bar:2.0 because now Foo is no longer depending on Bar, and it is using is own copy of "altered" Bar located in another package.



wythern 2017-06-19 11:23 发表评论
]]>
˾þô߽| AVһþ| 99þþƷһ| ƷһþþƷ| ˶ݺɫۺϾþ| 㽶þƵ| þԭavapp| Ʒþ޲| þˬ˸߳AV | þAV뾫Ʒ| ݺɫþþһ| 99reþùƷҳ| 97Ʒ˾þþô߽97| ޹˾þþƷ| þۺϹ׾Ʒ| þ99Ʒŷ| þ99ֻƵƷ8| ݾƷŮ˾þþþþ | þۺav| þĻƷѩ| þ޾Ʒۿ| 99þþƷëƬѲ| þˬˬƬav鷳| þ99һ| 99þþƷһ | þWWW˳ɡƬ| þҹɫƷAV| þùAVJUST鶹| ٸþĻ| 99ȾþֻоƷ68| þseƷһƷ| 7777þĻ| þҹɫƷվ| þֻоƷ18| ޾Ʒþþþȥq | þþƷ| þһ| þùŷպƷ| 鶹AV뾫Ʒþ| ԭƷ99þþƷ66| þþƷAV㽶|