Go不是内部或外部命令

I've been trying to set up my Go workspace, but it doesn't seem to be working. Whenever I type in echo %GOPATH%, it echoes C:Users\y\GoWorkspace. But whenever I type go, it says go is not recognized as an internal or external command. This is the same for any other Go command.

I am using Windows 8 64-bit with Go 1.2.2 32-bit. I have also tried Go 1.2.2 64-bit, but it didn't change anything.

展开翻译

译文

我一直在尝试设置Go工作区,但是它似乎没有用。 每当我键入 echo%GOPATH%</ code>时,它都会回显 C:Users \ y \ GoWorkspace </ code>。 但是,每当我键入 go </ code>时,都会说 go不被识别为内部或外部命令</ code>。 这与其他所有Go命令相同。</ p>

我正在使用Windows 8 64位和Go 1.2.2 32位。 我还尝试了64位Go 1.2.2,但没有任何改变。</ p>
</ div>

dsdtszi0520538
dsdtszi0520538 您是否已将安装位置添加到%PATH%?
接近 6 年之前 回复

2个回答

GOPATH is the path that go uses when you build or test go applications. It does not tell Windows where your go executable is. For this you have to set you path environment variable. You can also set your GOBIN environment variable.

展开翻译

译文



GOPATH是在构建或测试go应用程序时go使用的路径。 它不会告诉Windows go可执行文件在哪里。 为此,您必须设置路径环境变量。 您还可以设置GOBIN环境变量。</ p>
</ div>

dongyi7966
dongyi7966 现在可以正常工作了,我丢失了一个引号。
接近 6 年之前 回复
doufangzhang4454
doufangzhang4454 这不起作用,我在路径中添加了“ C:\ Go”,并将GOBIN设置为“ C:\ Go”
接近 6 年之前 回复

As @JohnGilmore has pointed out the GOPATH is the location the Go tools use (executables). To set the location to the go executable so that Windows can find the command you will need to set your PATH variable.

On Windows:

SET %PATH%=%PATH%;C:\Go\bin

You can also set this so that it is in every new environment by typing 'env' into the Start->search and then choose 'Edit the system environment variables'.

doudu6100
doudu6100 谢谢,问题是我缺少一个引号。
接近 6 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
go能实现类似父类指针作为参数传入?
例如C++中 ``` class Fu { public: Fu(){...} void say(){...} }; class Zi : public Fu { public: Zi(){...} void say(){...} }; void Work(Fu **fu) { cout << "" << endl; } int main() { Fu *people1 = new Zi; Fu *people2 = new Zi; people1->say(); people2->say(); Work(people1); ... Work(people2); return 0; } ``` 像这种情况go语言怎么实现?我只知道接口可以实例化结构体,不过并不能像C++那样作为函数的传入参数,因为类型还是本身
定义一个指向 char 的指针数组?
定义一个指向 char 的指针数组 , 其中数组的每一个元素均是指向字符串的指针,同时定义一个 char 型的双重指针变量;利用双重指针进行 char 型指针数组中字符串的顺序输出。 解题思路:利用双重指针中指针变量与 char 型指针数组的关系进行输出。 参考代码: #include "stdio.h" #include "malloc.h" #include "string.h" #define NUM 1 struct STUDENT { char STU_ID[8]; char STU_NAME[10]; int STU_AGE; int STU_SCORE; }; int main(int argc, char* argv[]) { int i; // 定义由 3 个元素构成的数组,每个元素都是指针,此处将每个指针指向一个常亮字符串 char *CS[3] = {"Follow me","Roger that","Go Go Go"}; char **p; // 双重指针 // 在此处添加 for 循环,使用指针数组 CS 依次打印字符串,每行打印一个 for(i=0; i<3; i++) { // 学生补充代码 // 将数组中的信息赋值给指针,便于通过指针打印字符串信息 { }//end of 学生补充代码 printf("%s\n", *p); } return 1; }
关于编写链码时的报错error: RPC failed; curl 18 transfer closed with outstanding read data remaining
从书上看到,编写链码之前应该确定在本系统中有 Hyperledger Fabric 提供的相关API,如果本地系统中没有相关的API,请执行如下下载命令: ``` go get -u github.com/hyperledger/fabric/core/chaincode/shim ``` 我执行之后,报错 ``` # cd .; git clone https://github.com/hyperledger/fabric /home/yous/go/src/github.com/hyperledger/fabric 正克隆到 '/home/yous/go/src/github.com/hyperledger/fabric'... error: RPC failed; curl 18 transfer closed with outstanding read data remaining fatal: The remote end hung up unexpectedly fatal: 过早的文件结束符(EOF) fatal: index-pack failed package github.com/hyperledger/fabric/core/chaincode/shim: exit status 128 ``` 查了百度,基本上都在说 curl的postBuffer的默认值太小 我重新设置了一下还是不行。 我发现https://github.com/hyperledger/fabric/core/chaincode/shim 根本打不开网页,是不是这个包被关闭或删除了呢?
go语言怎么对MySQL的事务进行封装
go语言怎么对MySQL事务进行封装,自动commit 自动close 不用增删查改每次都写一遍
Go Go Gorelians 怎么来写
Problem Description The Gorelians travel through space using warp links. Travel through a warp link is instantaneous, but for safety reasons, an individual can only warp once every 10 hours. Also, the cost of creating a warp link increases directly with the linear distance between the link endpoints. The Gorelians, being the dominant force in the known universe, are often bored, so they frequently conquer new regions of space in the following manner. 1) The initial invasion force finds a suitable planet and conquers it, establishing a Regional Gorelian Galactic Government, hereafter referred to as the RGGG, that will govern all Gorelian matters in this region of space. 2) When the next planet is conquered, a single warp link is constructed between the new planet and the RGGG planet. Planets connected via warp links in this manner are said to be part of the Regional Gorelian Planetary Network, that is, the RGPN. 3) As additional planets are conquered, each new planet is connected with a single warp link to the nearest planet already in the RGPN, thus keeping the cost of connecting new planets to the network to a minimum. If two or more planets are equidistant from the new planet, the new planet is connected to whichever of them was conquered first. This causes a problem however. Since planets are conquered in a more-or-less random fashion, after a while, the RGGG will probably not be in an ideal location. Some Gorelians needing to consult with the RGGG might only have to make one or two warps, but others might require dozens---very inconvenient when one considers the 10-hour waiting period between warps. So, once each Gorelian year, the RGGG analyzes the RGPN and relocates itself to an optimal location. The optimal location is defined as a planet that minimizes the maximum number of warps required to reach the RGGG from any planet in the RGPN. As it turns out, there is always exactly one or two such planets. When there are two, they are always directly adjacent via a warp link, and the RGGG divides itself evenly between the two planets. Your job is to write a program that finds the optimal planets for the RGGG. For the purposes of this problem, the region of space conquered by the Gorelians is defined as a cube that ranges from (0,0,0) to (1000,1000,1000). Input The input consists of a set of scenarios where the Gorelians conquer a region of space. Each scenario is independent. The first line of the scenario is an integer N that specifies the total number of planets conquered by the Gorelians. The next N lines of the input specify, in the order conquered, the IDs and coordinates of the conquered planets to be added to the RGPN, in the format ID X Y Z. An ID is an integer from 1 to 1000. X, Y, and Z are integers from 0 to 1000. A single space separates the numbers. A value of N = 0 marks the end of the input. Output For each input scenario, output the IDs of the optimal planet or planets where the RGGG should relocate. For a single planet, simply output the planet ID. For two planets, output the planet IDs, smallest ID first, separated by a single space. Sample Input 5 1 0 0 0 2 0 0 1 3 0 0 2 4 0 0 3 5 0 0 4 5 1 0 0 0 2 1 1 0 3 3 2 0 4 2 1 0 5 3 0 0 10 21 71 76 4 97 32 5 69 70 33 19 35 3 79 81 8 31 91 17 67 52 31 48 75 48 90 14 4 41 73 2 21 83 74 41 69 26 32 30 24 0 Sample Output 3 2 4 31 97
Go语言同包下引用不同文件的全局指针变量为什么为nil呢?
在同包中定义了一个sql.DB指针全局变量, 并在Init方法中将其赋值, 可是在同包中使用这个变量的时候, 却被告知变量为nil, 请问造成这种问题的原因是什么呢? 应该如何解决较为妥善一点呢? model.go ``` package db import ( "database/sql" "fmt" _ "github.com/go-sql-driver/mysql" ) var db *sql.DB func Init() { db, err := sql.Open("mysql", "root@kong@tcp(127.0.0.1:3306)/blog") if err != nil { fmt.Println(err) } db.SetMaxIdleConns(50) db.Ping() } ``` demo.go ``` package db import "fmt" func Print() { fmt.Println(db) } ``` main.go ``` package main func main() { db.Init() db.Print() } ``` 结果: ``` <nil> ```
今天偶然看见一段Python大神写的代码,觉得好厉害,我在想go是不是也能实现一样的方法
今天在维护一个别人写的Python项目,改一个接口,去看了一下项目里面封装了一个方法特别好用,这个方法是数据库层面的,接收四个参数,第一个参数是model实体类,第二个参数是查询成功后需要返回数据的那些字段的一个配置是一个字典类型,第三个参数是区间筛选需要对哪个字段进行区间筛选也是一个字典,四个参数是排序规则也是一个字段,并且这个方法适用于任何一个model实体,第一个参数必传,后面的随意 该方法在返回的时候还自动转成了json,key对应model的字段名 value对应model该字段的值,我在想go怎么封装类似这样的方法 具体项目涉密我就不截图代码了,我说一下大概实现的一个方法 假设我有一个user表 ``` class User(Base): __tablename__ = 'approval_favourable' id = Column(BigInteger(), primary_key=True) username = Column(String()) password = Column(String()) nickname = Column(String()) addtime = Column(Datetime()) ``` 假设我有一个query_db()的方法 ``` def query_db(entity_model,query_dict,Interval,sort) ``` 这个方法接口四个参数,第一个 当我只传一个参数的时候 ``` query_db(User) ``` 返回的结果是这样 ``` [ { "id":1, "username":"admin", "password":"admin", "nickname":"admin", "addtime":"20200101" }, { "id":2, "username":"admin", "password":"admin", "nickname":"admin", "addtime":"20200102" }, { "id":3, "username":"admin", "password":"admin", "nickname":"admin", "addtime":"20200103" } ] ``` 当我传两个参数的时候 ``` query_dict=[ { "field_name":"username" } ] query_db(User,query_dict) ``` 返回的结果是这样的 ``` [ { "username":"admin" }, { "username":"admin" }, { "username":"admin" } ] ``` 当我传三个参数的时候 ``` query_dict=[ { "field_name":"username" }, { "field_name":"addtime" } ] Interval=[ { "field_name":"addtime", "max_value":"这里是时间戳", "min_value":"这里是时间戳" } ] query_db(User,query_dict,Interval) ``` 返回的结果是这样的 ``` [ { "username":"admin", "addtime":"20200101" }, { "username":"admin", "addtime":"20200102" } ] ``` 当我传四个参数的时候 ``` query_dict=[ { "field_name":"username" }, { "field_name":"addtime" }, { "field_name":"id" } ] Interval=[ { "field_name":"addtime", "max_value":"这里是时间戳", "min_value":"这里是时间戳" } ] sort=[ { "field_name":"id", "sort":"desc" } ] query_db(User,query_dict,Interval,sort) ``` 返回的结果是这样的 ``` [ { "id":2, "username":"admin", "addtime":"20200102" }, { "id":1, "username":"admin", "addtime":"20200101" } ] ``` 如果用go语言去实现应该怎么实现呢? 封装的方法适用所有的model实体
阿里云服务器go get 执行完没有src文件夹
![图片说明](https://img-ask.csdn.net/upload/202003/19/1584592529_562670.png) - #### 执行完之后进入GOPATH路径ls,结果只有pkg的文件夹,没有src - ![图片说明](https://img-ask.csdn.net/upload/202003/19/1584592600_356220.png)
javascript safari浏览器使用document.execCommend()中文兼容bug
由于需求需要编写一个简易编辑器,仅仅只有加粗,倾斜和下划线,要求不能使用第三方库,所以就使用了div的contenteditable="true"属性加document.execCommend()的api来自己编写, 编写后发现了safari的中文兼容bug,查看了网上许多简易编辑的案例,发现都有这个bug, 即:safari 英文输入切换正常 中文输入模式下,点击取消加粗,依然是加粗样式 ``` <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.10/vue.min.js"></script> <style> .content-edit i { font-style: italic !important; } .content-edit b { font-weight: bold !important; } .upload-header { width: 100%; box-sizing: border-box; padding: 43px 58px 31px 58px; display: flex; align-items: center; justify-content: space-between; } .upload-header div { width: 156px; font-size: 52px; } .upload-header i { width: 37px; height: 69px; display: block; background: url("../../static/fanhui.svg") no-repeat; background-size: 100%; } .upload-header .center { text-align: center; } .upload-header .right { text-align: right; } .title-edit { padding: 54px 58px 48px 58px; box-sizing: border-box; border-bottom: 1px solid rgba(216, 216, 216, 1); font-size: 42px; font-weight: 600; color: rgba(54, 54, 54, 1); } .title-edit input { font-weight: 600; color: rgba(54, 54, 54, 1); width: 100%; border: none; } .content-edit { height: 300px; padding: 48px 58px; box-sizing: border-box; overflow-y: scroll; font-size: 42px; color: rgba(73, 73, 73, 1); } .content-edit * { font-size: 42px; color: rgba(73, 73, 73, 1); } .edit-tool { padding: 0 58px; box-sizing: border-box; width: 100%; height: 144px; display: flex; justify-content: space-between; border: 1px solid rgba(218, 218, 218, 1); border-left: none; border-right: none; } .edit-tool .left .active { color: blue; } .edit-tool .right .active { border: 1px solid #c8c8c8; } .edit-tool .left { height: 144px; display: flex; align-items: center; } .edit-tool .right>div { float: left; overflow: hidden; margin-top: 15px; } .edit-tool .left input { display: block; width: 40px; padding: 14px 55px; border: none; font-size: 64px; background: none; } .edit-tool .left input:nth-child(1) { padding: 14px 55px; padding-left: 14px; } .underline { text-decoration: underline; } .edit-tool .right button { padding: 0; display: block; overflow: hidden; width: 60px; height: 60px; border-radius: 100% 100% 100% 100%; -webkit-appearance: none; margin: 24px 24px; border: none; } .edit-tool .right .active { border: 10px solid #c8c8c8; } </style> </head> <body> <!-- app --> <div id="app"> <div class="edit-container"> <header class="upload-header"> <div class="left" @click="returnPage"> <i></i> </div> <div class="center">编辑</div> <div class="right">保存</div> </header> <div class="title-edit"> <input type="text" v-model="htmlObj.title"> </div> <div v-html="htmlObj.content" spellcheck="false" class="content-edit" contenteditable="true" @input="editChange" ref="editor" @paste="pasteText" @click="onClick($event)"> <!-- <p>{{htmlObj.content}}</p> --> </div> <!-- <new-edit></new-edit> --> <div class="edit-tool"> <div class="left"> <input class="bold" :class="{ active: iconList[0].choose }" value="B" type="button" @click="iconClick($event, 'bold', 'style')"> <input class="bias" :class="{ active: iconList[1].choose }" value="I" type="button" @click="iconClick($event, 'italic', 'style')"> <input class="underline" :class="{ active: iconList[2].choose }" value="U" type="button" @click="iconClick($event, 'underline', 'style')"> </div> <div class="right"> <div> <button style="background:rgba(110,110,110,1);" :class="{ active: iconList[3].choose }" @click="iconClick($event, 'foreColor1', 'style')"></button> </div> <div> <button style="background:rgba(241,89,108,1);" :class="{ active: iconList[4].choose }" @click="iconClick($event, 'foreColor2', 'style')"></button> </div> <div> <button style="background:rgba(241,223,3,1);" :class="{ active: iconList[5].choose }" @click="iconClick($event, 'foreColor3', 'style')"></button> </div> <div> <button style="background:rgba(80,227,194,1);" :class="{ active: iconList[6].choose }" @click="iconClick($event, 'foreColor4', 'style')"></button> </div> </div> </div> </div> </div> </body> <script> var app = new Vue({ el: "#app", data() { return { innerText: "", htmlObj: { title: "", content: "" }, selectedRange: "", iconList: [{ // hover名字 name: "粗体", // 点击事件处理 type: "bold", // 是否被选中 canChoose: true, choose: false }, { name: "斜体", type: "italic", canChoose: true, choose: false }, { name: "下划线", type: "underline", canChoose: true, choose: false }, { name: "字体颜色", type: "foreColor1", canChoose: true, drop: true, choose: false }, { name: "字体颜色", type: "foreColor2", drop: true, canChoose: true, choose: false }, { name: "字体颜色", type: "foreColor3", drop: true, canChoose: true, choose: false }, { name: "字体颜色", type: "foreColor4", drop: true, canChoose: true, choose: false } ], activeIconList: [] }; }, mounted() { window.localStorage.setItem( "moduleList", '[{"type":1,"title":"12","content":"<p>13333</p>"}]' ); this.htmlObj = JSON.parse(window.localStorage.getItem("moduleList"))[0]; }, methods: { onClick(event) { let that = this; console.log(event); if (event.target.tagName == 'DIV') { return false; } this.activeIconList = []; let target = event.target; this.changeTagStyle(target); let newArr = this.activeIconList.filter(function (x, index, self) { return self.indexOf(x) === index; }); for (let i = 0; i < this.iconList.length; i++) { if (newArr[i] === "B") { this.iconList[0].choose = true; } else if (newArr[i] === "U") { this.iconList[2].choose = true; } else if (newArr[i] === "I") { this.iconList[1].choose = true; } else { this.iconList[i].choose = false; } } }, isToolTag(el) { if (el.tagName == "B") return true; else return false; }, changeTagStyle(el) { if ( el.tagName == "B" || el.tagName == "I" || el.tagName == "U" || el.tagName == "FONT" ) { this.activeIconList.push(el.tagName); console.log(el.parentNode.tagName); } else if (el.tagName == "DIV") { return; } this.changeTagStyle(el.parentNode); }, changeStyle(type) { switch (type) { case "bold": console.log("blod"); console.log(this.iconList[0].choose); if (window.navigator.userAgent.indexOf('AppleWebKit') > -1 && this.iconList[0].choose === true) { console.log('取消选中 光标后移') let sel = document.getSelection(); console.log(sel.anchorNode.nodeType); //文本节点为3,元素节点为1 console.log(sel.anchorNode.parentNode.parentNode); // window.getSelection().removeAllRanges(); // console.log(sel); this.keepLastIndex(sel.anchorNode.parentNode.parentNode); // let cursorPos = selection.anchorOffset; // let oldContent = selection.sel.nodeValue; // let newContent = // oldContent.substring(0, cursorPos) + // toInsert + // oldContent.substring(cursorPos); // selection.anchorNode.nodeValue = newContent; // let range=sel.getRangeAt(0); // range.setStart(range.startContainer,3); // console.log(sel); // console.log(sel.getRangeAt(0)); // console.log(sel.focusOffset); } document.execCommand("bold", false); // document.execCommand("insertHtml", 'a',false); break; case "underline": if (this.iconList[2].choose === false) { document.execCommand("underline", false); } else { document.execCommand("removeFormat", false); } // document.execCommand("underline", false); break; case "italic": document.execCommand("italic", false); break; case "foreColor1": document.execCommand("foreColor", 0, "rgba(110,110,110,1)"); break; case "foreColor2": document.execCommand("foreColor", 0, "rgba(241,89,108,1)"); break; case "foreColor3": document.execCommand("foreColor", 0, "rgba(241,223,3,1)"); break; case "foreColor4": document.execCommand("foreColor", 0, "rgba(80,227,194,1)"); break; default: console.log("none"); } }, // insertAfter(newNode, curNode) { // console.log(curNode.parentNode); // curNode.parentNode.insertBefore(newNode, curNode.nextElementSibling); // }, iconClick(event, type, dropType) { event.preventDefault(); console.log(event); this.$refs.editor.focus(); // let $el=this.$refs.editor; // this.keepLastIndex($el); this.selectedRange = this.getSelect(); if (event.target.classList.contains("active")) { //解决safari中文光标位置 //获取光标所在位置的节点, console.log( window.getSelection().getRangeAt(0).startContainer.parentElement ); let el = window.getSelection().getRangeAt(0).startContainer.parentElement; // let span=document.createElement('span'); // this.insertAfter(span,el); // console.log(el); // el.focus(); // var selection = window.getSelection(); // let span = document.createElement("span"); // let range = document.createRange(); // range.collapse(false); // range.insertNode(span); // selection.removeAllRanges(); /*清空所有Range对象*/ // range.setStart( // span, // 0 // ); // range.setEnd( // span, // 1 // ); // selection.addRange(range); // this.placeCaretAtEnd(span); } // 恢复光标 // this.restoreSelection(); // 恢复光标 // this.restoreSelection(); // 修改所选区域的样式 this.changeStyle(type); this.$nextTick(() => { // if (dropType) {//下拉菜单的type // type = dropType // } //改变当前元素的样式 let sourceArr = JSON.parse(JSON.stringify(this.iconList)); let arr = sourceArr.map((val, index) => { if (type === val.type && val.canChoose) { val.choose = val.choose ? false : true; } // else { // if (val.drop) { // val.choose = false; // } // } return val; }); // if (type === 'clear') { // var a = this.getSelect() // if (a.startOffset === a.endOffset) { // document.execCommand('insertHTML', false, '&nbsp') // // return false // } // arr = arr.map((val, index) => { // val.choose = false // return val // }) // } this.iconList = arr; }); }, //获取选中 getSelect() { if (window.getSelection) { /*主流的浏览器,包括chrome、Mozilla、Safari*/ var sel = window.getSelection(); console.log(sel.getRangeAt(0)); if (sel.rangeCount > 0) { return sel.getRangeAt(0); } } else if (document.selection) { /*IE下的处理*/ return document.selection.createRange(); } return null; }, placeCaretAtEnd(el) { //传入光标要去的jq节点对象 el.focus(); if ( typeof window.getSelection != "undefined" && typeof document.createRange != "undefined" ) { var range = document.createRange(); range.selectNodeContents(el); range.collapse(false); var sel = window.getSelection(); sel.removeAllRanges(); sel.addRange(range); } else if (typeof document.body.createTextRange != "undefined") { var textRange = document.body.createTextRange(); textRange.moveToElementText(el); textRange.collapse(false); textRange.select(); } }, restoreSelection() { var selection = window.getSelection(); console.log(this.selectedRange); let range = document.createRange(); if (this.selectedRange) { try { selection.removeAllRanges(); /*清空所有Range对象*/ range.setStart( this.selectedRange.startContainer, this.selectedRange.startOffset ); range.setEnd( this.selectedRange.endContainer, this.selectedRange.endOffset ); } catch (ex) { /*IE*/ document.body.createTextRange().select(); document.selection.empty(); } /*恢复保存的范围*/ selection.addRange(this.selectedRange); } }, returnPage() { this.$router.go(-1); }, editChange() { // console.log(this.$refs.editor.children); let that = this; if (this.$refs.editor.children.length == 0) { this.$refs.editor.value = `<p></p>`; // setTimeout(() => { // that.keepLastIndex(e.target); // }, 5); } }, //获取光标 getCaret() {}, //设置光标 setCaret() {}, //保存光标 saveCaret() {}, //插入节点 insertHtmlAtCaret(html) { let sel, range; if (window.getSelection) { // IE9 and non-IE sel = window.getSelection(); if (sel.getRangeAt && sel.rangeCount) { range = sel.getRangeAt(0); range.deleteContents(); // Range.createContextualFragment() would be useful here but is // non-standard and not supported in all browsers (IE9, for one) let el = document.createElement("div"); el.innerHTML = html; let frag = document.createDocumentFragment(), node, lastNode; while ((node = el.firstChild)) { lastNode = frag.appendChild(node); } range.insertNode(frag); // Preserve the selection if (lastNode) { range = range.cloneRange(); range.setStartAfter(lastNode); range.collapse(true); sel.removeAllRanges(); sel.addRange(range); } } } else if (document.selection && document.selection.type != "Control") { // IE < 9 document.selection.createRange().pasteHTML(html); } }, //光标定位在末尾 keepLastIndex(obj) { if (window.getSelection) { //ie11 10 9 ff safari obj.focus(); //解决ff不获取焦点无法定位问题 var range = window.getSelection(); //创建range range.selectAllChildren(obj); //range 选择obj下所有子内容 range.collapseToEnd(); //光标移至最后 } else if (document.selection) { //ie10 9 8 7 6 5 var range = document.selection.createRange(); //创建选择对象 //var range = document.body.createTextRange(); range.moveToElementText(obj); //range定位到obj range.collapse(false); //光标移至最后 range.select(); } }, //粘贴事件处理 async pasteText(e) { e.stopPropagation(); e.preventDefault(); let text; if (navigator.clipboard) { text = await navigator.clipboard.readText(); } else { text = e.clipboardData.getData("text/plain"); } let self = this; // 在等待一段时间后,在当前光标位置,粘贴处理后的文本 setTimeout(function () { let selection = document.getSelection(); let cursorPos = selection.anchorOffset; let oldContent = selection.anchorNode.nodeValue; // 通过 Dom 去除所有样式 // let oDiv = document.createElement("div"); // oDiv.innerHTML = pasteData; let toInsert = text; let newContent = oldContent.substring(0, cursorPos) + toInsert + oldContent.substring(cursorPos); selection.anchorNode.nodeValue = newContent; // if(window.navigator.userAgent.indexOf('AppleWebKit')>-1){ let rag = document.createRange(); rag.selectNodeContents(selection.anchorNode); //必须传node rag.collapse(false); let sel = window.getSelection(); sel.removeAllRanges(); sel.addRange(rag); // } // console.log(selection); // let range=selection.getRangeAt(0); // range.setStart(range.startContainer,parseInt(cursorPos+toInsert.length)); // console.log(range); }, 200); return false; } } }) // document.onselectionchange = function() { // console.log('New selection made'); // let selection = document.getSelection(); // console.log(selection.type); // } </script> </html> ```
新人求问:程序提示无法解析的外部符号,无法解析的外部命令
源代码如下 此处为头文件golf.h //headfile golf #ifndef _golf_ const int len=40; struct golf { char fullname[len]; int handicap; }; void setgolf(golf & g,char *name,int hc); int setgolf(golf & g); void handicap(golf & g,int hc); void showgolf(const golf &g); #endif 函数的声明 fu.cpp //declare the functions #include<iostream> #include<cstring> #include"golf.h" void setgolf(golf & g,const char *name,int hc) { name=g.fullname; g.handicap=hc; } int setgolf(golf & g) { std::cin>>g.fullname; std::cin>>g.handicap; std::string c; c=g.fullname; if(c.empty()) return 0; else return 1; } void handicap(golf & g,int hc) { g.handicap=hc; } void showgolf(const golf &g) { std::cout<<g.fullname<<"and"<<g.handicap; } //主函数部分:gl.cpp #include<iostream> #include"golf.h" int main() { golf ann[2]; setgolf(ann[0],"dazhoang",14); int go=setgolf(ann[1]); handicap(ann[0],14); std::cout<<go; showgolf(ann[0]); std::cout<<std::endl; showgolf(ann[1]); system("pause"); return 0; }
HC-06为什么通过手机调试助手发送数据没有反应?怎么进入buffer1和buffer0这两个模式?求大神指导下
void Communication_Decode(void) { if(buffer[0]==0x00) { switch(buffer[1]) { case 0x01: forward_lde=1;go(); return; case 0x02: forward_lde=1;back();return; default: return; } } if(buffer[0]==0x01) { switch(buffer[1]) { case 0x01: BUZZER=0; return; case 0x02: BUZZER=1; return; } } } 下面是串口中断的设置
Go Deeper 深度的问题
Problem Description Here is a procedure's pseudocode: go(int dep, int n, int m) begin output the value of dep. if dep < m and x[a[dep]] + x[b[dep]] != c[dep] then go(dep + 1, n, m) end In this code n is an integer. a, b, c and x are 4 arrays of integers. The index of array always starts from 0. Array a and b consist of non-negative integers smaller than n. Array x consists of only 0 and 1. Array c consists of only 0, 1 and 2. The lengths of array a, b and c are m while the length of array x is n. Given the elements of array a, b, and c, when we call the procedure go(0, n, m) what is the maximal possible value the procedure may output? Input There are multiple test cases. The first line of input is an integer T (0 < T ≤ 100), indicating the number of test cases. Then T test cases follow. Each case starts with a line of 2 integers n and m (0 < n ≤ 200, 0 < m ≤ 10000). Then m lines of 3 integers follow. The i-th(1 ≤ i ≤ m) line of them are ai-1 ,bi-1 and ci-1 (0 ≤ ai-1, bi-1 < n, 0 ≤ ci-1 ≤ 2). Output For each test case, output the result in a single line. Sample Input 3 2 1 0 1 0 2 1 0 0 0 2 2 0 1 0 1 1 2 Sample Output 1 1 2
Go Go Gorelians 用程序实现
Problem Description The Gorelians travel through space using warp links. Travel through a warp link is instantaneous, but for safety reasons, an individual can only warp once every 10 hours. Also, the cost of creating a warp link increases directly with the linear distance between the link endpoints. The Gorelians, being the dominant force in the known universe, are often bored, so they frequently conquer new regions of space in the following manner. 1) The initial invasion force finds a suitable planet and conquers it, establishing a Regional Gorelian Galactic Government, hereafter referred to as the RGGG, that will govern all Gorelian matters in this region of space. 2) When the next planet is conquered, a single warp link is constructed between the new planet and the RGGG planet. Planets connected via warp links in this manner are said to be part of the Regional Gorelian Planetary Network, that is, the RGPN. 3) As additional planets are conquered, each new planet is connected with a single warp link to the nearest planet already in the RGPN, thus keeping the cost of connecting new planets to the network to a minimum. If two or more planets are equidistant from the new planet, the new planet is connected to whichever of them was conquered first. This causes a problem however. Since planets are conquered in a more-or-less random fashion, after a while, the RGGG will probably not be in an ideal location. Some Gorelians needing to consult with the RGGG might only have to make one or two warps, but others might require dozens---very inconvenient when one considers the 10-hour waiting period between warps. So, once each Gorelian year, the RGGG analyzes the RGPN and relocates itself to an optimal location. The optimal location is defined as a planet that minimizes the maximum number of warps required to reach the RGGG from any planet in the RGPN. As it turns out, there is always exactly one or two such planets. When there are two, they are always directly adjacent via a warp link, and the RGGG divides itself evenly between the two planets. Your job is to write a program that finds the optimal planets for the RGGG. For the purposes of this problem, the region of space conquered by the Gorelians is defined as a cube that ranges from (0,0,0) to (1000,1000,1000). Input The input consists of a set of scenarios where the Gorelians conquer a region of space. Each scenario is independent. The first line of the scenario is an integer N that specifies the total number of planets conquered by the Gorelians. The next N lines of the input specify, in the order conquered, the IDs and coordinates of the conquered planets to be added to the RGPN, in the format ID X Y Z. An ID is an integer from 1 to 1000. X, Y, and Z are integers from 0 to 1000. A single space separates the numbers. A value of N = 0 marks the end of the input. Output For each input scenario, output the IDs of the optimal planet or planets where the RGGG should relocate. For a single planet, simply output the planet ID. For two planets, output the planet IDs, smallest ID first, separated by a single space. Sample Input 5 1 0 0 0 2 0 0 1 3 0 0 2 4 0 0 3 5 0 0 4 5 1 0 0 0 2 1 1 0 3 3 2 0 4 2 1 0 5 3 0 0 10 21 71 76 4 97 32 5 69 70 33 19 35 3 79 81 8 31 91 17 67 52 31 48 75 48 90 14 4 41 73 2 21 83 74 41 69 26 32 30 24 0 Sample Output 3 2 4 31 97
golang unexpected directory layout when building
```go goroot: /usr/local/Cellar/go/1.13.3/libexec gopath: /Users/mac/go goVersion: 1.13.3 /Users/mac/go | Makefile src | main mr mrapps .....blablabla ``` ```go unexpected directory layout: import path: _/Users/mac/go/src/mr root: /Users/mac/go/src dir: /Users/mac/go/src/mr expand root: /Users/mac/go expand dir: /Users/mac/go/src/mr separator: / ``` 上面的bug是我用如下代码build的时候碰到的 。。 ``` $ pwd /Users/mac/go/mrapps $ go build -buildmode=plugin wc.go ``` wc.go contents ```import "../mr"``` 这是MIT 6.824网课的lab1 第一步就卡住了。。救救
go语言数组添加元素为什么都是重复的
我从MySQL里面查询到一个结构体数组,然后把结构体遍历存到map里面去,接着在把map存到数组里面去,结果我发现存出来的数据怎么都是重复的,通过下标和append都不好使,好奇怪? 代码如下所示 ``` func (this *Admin_Usre) Tojsons(user []Admin_Usre) []map[string]interface{} { data:=make(map[string]interface{}) res:=make([]map[string]interface{},len(user)) for i:=0;i<len(user);i++{ data["id"]=user[i].ID data["username"]=user[i].Username data["nickname"]=user[i].Nickname data["createdat"]=user[i].CreatedAt if i==0{ print("进来了") res[0]=data } if i==1{ res[1]=data } if i==2{ res[2]=data } fmt.Println(data) fmt.Println(i) fmt.Println(res) } return res } ``` 打印结果如下所示: ``` 进来了map[createdat:2020-02-29 21:24:17 +0800 CST id:1 nickname: username:wzt] 0 [map[createdat:2020-02-29 21:24:17 +0800 CST id:1 nickname: username:wzt] map[] map[] map[] map[] map[] map[] map[] map[] map[]] map[createdat:2020-02-29 21:38:30 +0800 CST id:2 nickname: username:wzt] 1 [map[createdat:2020-02-29 21:38:30 +0800 CST id:2 nickname: username:wzt] map[createdat:2020-02-29 21:38:30 +0800 CST id:2 nickname: username:wzt] map[] map[] map[] map[] map[] map[] map[] map[]] map[createdat:2020-03-04 21:53:16 +0800 CST id:3 nickname: username:] 2 [map[createdat:2020-03-04 21:53:16 +0800 CST id:3 nickname: username:] map[createdat:2020-03-04 21:53:16 +0800 CST id:3 nickname: username:] map[createdat:2020-03-04 21:53:16 +0800 CST id:3 nickname: userna me:] map[] map[] map[] map[] map[] map[] map[]] map[createdat:2020-03-04 21:54:57 +0800 CST id:4 nickname: username:] 3 [map[createdat:2020-03-04 21:54:57 +0800 CST id:4 nickname: username:] map[createdat:2020-03-04 21:54:57 +0800 CST id:4 nickname: username:] map[createdat:2020-03-04 21:54:57 +0800 CST id:4 nickname: userna me:] map[] map[] map[] map[] map[] map[] map[]] map[createdat:2020-03-04 21:55:38 +0800 CST id:5 nickname: username:] 4 [map[createdat:2020-03-04 21:55:38 +0800 CST id:5 nickname: username:] map[createdat:2020-03-04 21:55:38 +0800 CST id:5 nickname: username:] map[createdat:2020-03-04 21:55:38 +0800 CST id:5 nickname: userna me:] map[] map[] map[] map[] map[] map[] map[]] map[createdat:2020-03-04 21:56:18 +0800 CST id:6 nickname: username:] 5 [map[createdat:2020-03-04 21:56:18 +0800 CST id:6 nickname: username:] map[createdat:2020-03-04 21:56:18 +0800 CST id:6 nickname: username:] map[createdat:2020-03-04 21:56:18 +0800 CST id:6 nickname: userna me:] map[] map[] map[] map[] map[] map[] map[]] map[createdat:2020-03-04 21:59:52 +0800 CST id:7 nickname: username:] 6 [map[createdat:2020-03-04 21:59:52 +0800 CST id:7 nickname: username:] map[createdat:2020-03-04 21:59:52 +0800 CST id:7 nickname: username:] map[createdat:2020-03-04 21:59:52 +0800 CST id:7 nickname: userna me:] map[] map[] map[] map[] map[] map[] map[]] map[createdat:2020-03-04 22:00:33 +0800 CST id:8 nickname: username:] 7 [map[createdat:2020-03-04 22:00:33 +0800 CST id:8 nickname: username:] map[createdat:2020-03-04 22:00:33 +0800 CST id:8 nickname: username:] map[createdat:2020-03-04 22:00:33 +0800 CST id:8 nickname: userna me:] map[] map[] map[] map[] map[] map[] map[]] map[createdat:2020-03-04 22:03:52 +0800 CST id:9 nickname: username:] 8 [map[createdat:2020-03-04 22:03:52 +0800 CST id:9 nickname: username:] map[createdat:2020-03-04 22:03:52 +0800 CST id:9 nickname: username:] map[createdat:2020-03-04 22:03:52 +0800 CST id:9 nickname: userna me:] map[] map[] map[] map[] map[] map[] map[]] map[createdat:2020-03-04 22:06:32 +0800 CST id:10 nickname: username:] 9 [map[createdat:2020-03-04 22:06:32 +0800 CST id:10 nickname: username:] map[createdat:2020-03-04 22:06:32 +0800 CST id:10 nickname: username:] map[createdat:2020-03-04 22:06:32 +0800 CST id:10 nickname: use rname:] map[] map[] map[] map[] map[] map[] map[]] ``` 结果就是这样的 我用append也是一样的 第一次map中的数据id为1 数组存入了1条id为1的数据 第二次map中的数据id为2 数组存入了2条id为2的数据 第三次map中的数据id为3 数组存入了3条id为3的数据 以此类推下去 我很奇怪,当i等于1的时候都没有进入到i等于0这个if条件 它怎么会把数据为下标为0的这个数据给覆盖了
Go Deeper 算法的实现
Problem Description Here is a procedure's pseudocode: go(int dep, int n, int m) begin output the value of dep. if dep < m and x[a[dep]] + x[b[dep]] != c[dep] then go(dep + 1, n, m) end In this code n is an integer. a, b, c and x are 4 arrays of integers. The index of array always starts from 0. Array a and b consist of non-negative integers smaller than n. Array x consists of only 0 and 1. Array c consists of only 0, 1 and 2. The lengths of array a, b and c are m while the length of array x is n. Given the elements of array a, b, and c, when we call the procedure go(0, n, m) what is the maximal possible value the procedure may output? Input There are multiple test cases. The first line of input is an integer T (0 < T ≤ 100), indicating the number of test cases. Then T test cases follow. Each case starts with a line of 2 integers n and m (0 < n ≤ 200, 0 < m ≤ 10000). Then m lines of 3 integers follow. The i-th(1 ≤ i ≤ m) line of them are ai-1 ,bi-1 and ci-1 (0 ≤ ai-1, bi-1 < n, 0 ≤ ci-1 ≤ 2). Output For each test case, output the result in a single line. Sample Input 3 2 1 0 1 0 2 1 0 0 0 2 2 0 1 0 1 1 2 Sample Output 1 1 2
--go_out: protoc-gen-go: 系统找不到指定的文件。
protoc --go_out=plugins=grpc:. hello.proto --go_out: protoc-gen-go: 系统找不到指定的文件。
Go Go Gorelians 编写的思路
Problem Description The Gorelians travel through space using warp links. Travel through a warp link is instantaneous, but for safety reasons, an individual can only warp once every 10 hours. Also, the cost of creating a warp link increases directly with the linear distance between the link endpoints. The Gorelians, being the dominant force in the known universe, are often bored, so they frequently conquer new regions of space in the following manner. 1) The initial invasion force finds a suitable planet and conquers it, establishing a Regional Gorelian Galactic Government, hereafter referred to as the RGGG, that will govern all Gorelian matters in this region of space. 2) When the next planet is conquered, a single warp link is constructed between the new planet and the RGGG planet. Planets connected via warp links in this manner are said to be part of the Regional Gorelian Planetary Network, that is, the RGPN. 3) As additional planets are conquered, each new planet is connected with a single warp link to the nearest planet already in the RGPN, thus keeping the cost of connecting new planets to the network to a minimum. If two or more planets are equidistant from the new planet, the new planet is connected to whichever of them was conquered first. This causes a problem however. Since planets are conquered in a more-or-less random fashion, after a while, the RGGG will probably not be in an ideal location. Some Gorelians needing to consult with the RGGG might only have to make one or two warps, but others might require dozens---very inconvenient when one considers the 10-hour waiting period between warps. So, once each Gorelian year, the RGGG analyzes the RGPN and relocates itself to an optimal location. The optimal location is defined as a planet that minimizes the maximum number of warps required to reach the RGGG from any planet in the RGPN. As it turns out, there is always exactly one or two such planets. When there are two, they are always directly adjacent via a warp link, and the RGGG divides itself evenly between the two planets. Your job is to write a program that finds the optimal planets for the RGGG. For the purposes of this problem, the region of space conquered by the Gorelians is defined as a cube that ranges from (0,0,0) to (1000,1000,1000). Input The input consists of a set of scenarios where the Gorelians conquer a region of space. Each scenario is independent. The first line of the scenario is an integer N that specifies the total number of planets conquered by the Gorelians. The next N lines of the input specify, in the order conquered, the IDs and coordinates of the conquered planets to be added to the RGPN, in the format ID X Y Z. An ID is an integer from 1 to 1000. X, Y, and Z are integers from 0 to 1000. A single space separates the numbers. A value of N = 0 marks the end of the input. Output For each input scenario, output the IDs of the optimal planet or planets where the RGGG should relocate. For a single planet, simply output the planet ID. For two planets, output the planet IDs, smallest ID first, separated by a single space. Sample Input 5 1 0 0 0 2 0 0 1 3 0 0 2 4 0 0 3 5 0 0 4 5 1 0 0 0 2 1 1 0 3 3 2 0 4 2 1 0 5 3 0 0 10 21 71 76 4 97 32 5 69 70 33 19 35 3 79 81 8 31 91 17 67 52 31 48 75 48 90 14 4 41 73 2 21 83 74 41 69 26 32 30 24 0 Sample Output 3 2 4 31 97
Go Fishing 的计算
Problem Description This summer vacation, FZU-ACM members get together for training in the name of dream. Some of them like fishing. One afternoon M members of them go fishing together around the lake, they bring many buckets with them and put their fish in either one of N buckets, they can only remember the number of fish they catch, and the number of fish in every bucket. When the sun went down, everyone wants to take away the part belonging to him, so they need to split the N buckets into more buckets (here we can assume the number of buckets they own is unlimited). They want to minimize the times of split. They are so tired, so ask you to help them solve their puzzle. Each time they can only split the fish in one bucket into two buckets. Input The input consists of several test cases. The first line of each case contains two integers N,M.(1<=N,M<8) N representing the number of buckets they put their fish in, and M representing the number of ACM members that go fishing. The next line contains N integers representing the number of fish in each bucket. The next line contains M integers representing the number of fish each ACM member catch. Output Output the minimal times they need to split the fish. Sample Input 2 3 1 2 1 1 1 4 3 2 4 4 3 5 5 3 Sample Output 1 1
go语言编译时报错can't load package 怎么解决?
go的编译器在 F 盘下,我的项目包gocode在E盘中,我写了个小的Go程序,单独的在main下执行 go build main.go 没有问题,但在gocode下执行就会报如下错误,请问是怎么回事? 我的环境变量是 变量名 GOPATH 变量值 E:\gocode! 变量名 GOROOT 变量值 F:\VS_code\SDK PATH下 %GOROOT%\bin [图片说明](https://img-ask.csdn.net/upload/201910/13/1570978042_774426.png)
在中国程序员是青春饭吗?
今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...
《MySQL 性能优化》之理解 MySQL 体系结构
本文介绍 MySQL 的体系结构,包括物理结构、逻辑结构以及插件式存储引擎。
【资源】一个C/C++开发工程师的学习路线(已经无路可退,唯有逆风飞翔)【内附资源页】
声明: 1)该文章整理自网上的大牛和专家无私奉献的资料,具体引用的资料请看参考文献。 2)本文仅供学术交流,非商用。所以每一部分具体的参考资料并没有详细对应。如果某部分不小心侵犯了大家的利益,还望海涵,并联系博主删除。 3)博主才疏学浅,文中如有不当之处,请各位指出,共同进步,谢谢。 4)此属于第一版本,若有错误,还需继续修正与增删。还望大家多多指点。大家都共享一点点,一起为祖国科研的推进...
程序员请照顾好自己,周末病魔差点一套带走我。
程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。
20道你必须要背会的微服务面试题,面试一定会被问到
写在前面: 在学习springcloud之前大家一定要先了解下,常见的面试题有那块,然后我们带着问题去学习这个微服务技术,那么就会更加理解springcloud技术。如果你已经学了springcloud,那么在准备面试的时候,一定要看看看这些面试题。 文章目录1、什么是微服务?2、微服务之间是如何通讯的?3、springcloud 与dubbo有哪些区别?4、请谈谈对SpringBoot 和S...
达摩院十大科技趋势发布:2020 非同小可!
【CSDN编者按】1月2日,阿里巴巴发布《达摩院2020十大科技趋势》,十大科技趋势分别是:人工智能从感知智能向认知智能演进;计算存储一体化突破AI算力瓶颈;工业互联网的超融合;机器间大规模协作成为可能;模块化降低芯片设计门槛;规模化生产级区块链应用将走入大众;量子计算进入攻坚期;新材料推动半导体器件革新;保护数据隐私的AI技术将加速落地;云成为IT技术创新的中心 。 新的画卷,正在徐徐展开。...
轻松搭建基于 SpringBoot + Vue 的 Web 商城应用
首先介绍下在本文出现的几个比较重要的概念: 函数计算(Function Compute): 函数计算是一个事件驱动的服务,通过函数计算,用户无需管理服务器等运行情况,只需编写代码并上传。函数计算准备计算资源,并以弹性伸缩的方式运行用户代码,而用户只需根据实际代码运行所消耗的资源进行付费。Fun: Fun 是一个用于支持 Serverless 应用部署的工具,能帮助您便捷地管理函数计算、API ...
Python+OpenCV实时图像处理
目录 1、导入库文件 2、设计GUI 3、调用摄像头 4、实时图像处理 4.1、阈值二值化 4.2、边缘检测 4.3、轮廓检测 4.4、高斯滤波 4.5、色彩转换 4.6、调节对比度 5、退出系统 初学OpenCV图像处理的小伙伴肯定对什么高斯函数、滤波处理、阈值二值化等特性非常头疼,这里给各位分享一个小项目,可通过摄像头实时动态查看各类图像处理的特点,也可对各位调参、测试...
2020年一线城市程序员工资大调查
人才需求 一线城市共发布岗位38115个,招聘120827人。 其中 beijing 22805 guangzhou 25081 shanghai 39614 shenzhen 33327 工资分布 2020年中国一线城市程序员的平均工资为16285元,工资中位数为14583元,其中95%的人的工资位于5000到20000元之间。 和往年数据比较: yea...
为什么猝死的都是程序员,基本上不见产品经理猝死呢?
相信大家时不时听到程序员猝死的消息,但是基本上听不到产品经理猝死的消息,这是为什么呢? 我们先百度搜一下:程序员猝死,出现将近700多万条搜索结果: 搜索一下:产品经理猝死,只有400万条的搜索结果,从搜索结果数量上来看,程序员猝死的搜索结果就比产品经理猝死的搜索结果高了一倍,而且从下图可以看到,首页里面的五条搜索结果,其实只有两条才是符合条件。 所以程序员猝死的概率真的比产品经理大,并不是错...
害怕面试被问HashMap?这一篇就搞定了!
声明:本文以jdk1.8为主! 搞定HashMap 作为一个Java从业者,面试的时候肯定会被问到过HashMap,因为对于HashMap来说,可以说是Java集合中的精髓了,如果你觉得自己对它掌握的还不够好,我想今天这篇文章会非常适合你,至少,看了今天这篇文章,以后不怕面试被问HashMap了 其实在我学习HashMap的过程中,我个人觉得HashMap还是挺复杂的,如果真的想把它搞得明明白...
毕业5年,我问遍了身边的大佬,总结了他们的学习方法
我问了身边10个大佬,总结了他们的学习方法,原来成功都是有迹可循的。
python爬取百部电影数据,我分析出了一个残酷的真相
2019年就这么匆匆过去了,就在前几天国家电影局发布了2019年中国电影市场数据,数据显示去年总票房为642.66亿元,同比增长5.4%;国产电影总票房411.75亿元,同比增长8.65%,市场占比 64.07%;城市院线观影人次17.27亿,同比增长0.64%。 看上去似乎是一片大好对不对?不过作为一名严谨求实的数据分析师,我从官方数据中看出了一点端倪:国产票房增幅都已经高达8.65%了,为什...
推荐10个堪称神器的学习网站
每天都会收到很多读者的私信,问我:“二哥,有什么推荐的学习网站吗?最近很浮躁,手头的一些网站都看烦了,想看看二哥这里有什么新鲜货。” 今天一早做了个恶梦,梦到被老板辞退了。虽然说在我们公司,只有我辞退老板的份,没有老板辞退我这一说,但是还是被吓得 4 点多都起来了。(主要是因为我掌握着公司所有的核心源码,哈哈哈) 既然 4 点多起来,就得好好利用起来。于是我就挑选了 10 个堪称神器的学习网站,推...
这些软件太强了,Windows必装!尤其程序员!
Windows可谓是大多数人的生产力工具,集娱乐办公于一体,虽然在程序员这个群体中都说苹果是信仰,但是大部分不都是从Windows过来的,而且现在依然有很多的程序员用Windows。 所以,今天我就把我私藏的Windows必装的软件分享给大家,如果有一个你没有用过甚至没有听过,那你就赚了????,这可都是提升你幸福感的高效率生产力工具哦! 走起!???? NO、1 ScreenToGif 屏幕,摄像头和白板...
阿里面试,面试官没想到一个ArrayList,我都能跟他扯半小时
我是真的没想到,面试官会这样问我ArrayList。
曾经优秀的人,怎么就突然不优秀了。
职场上有很多辛酸事,很多合伙人出局的故事,很多技术骨干被裁员的故事。说来模板都类似,曾经是名校毕业,曾经是优秀员工,曾经被领导表扬,曾经业绩突出,然而突然有一天,因为种种原因,被裁员了,...
大学四年因为知道了这32个网站,我成了别人眼中的大神!
依稀记得,毕业那天,我们导员发给我毕业证的时候对我说“你可是咱们系的风云人物啊”,哎呀,别提当时多开心啦????,嗯,我们导员是所有导员中最帅的一个,真的???? 不过,导员说的是实话,很多人都叫我大神的,为啥,因为我知道这32个网站啊,你说强不强????,这次是绝对的干货,看好啦,走起来! PS:每个网站都是学计算机混互联网必须知道的,真的牛杯,我就不过多介绍了,大家自行探索,觉得没用的,尽管留言吐槽吧???? 社...
良心推荐,我珍藏的一些Chrome插件
上次搬家的时候,发了一个朋友圈,附带的照片中不小心暴露了自己的 Chrome 浏览器插件之多,于是就有小伙伴评论说分享一下我觉得还不错的浏览器插件。 我下面就把我日常工作和学习中经常用到的一些 Chrome 浏览器插件分享给大家,随便一个都能提高你的“生活品质”和工作效率。 Markdown Here Markdown Here 可以让你更愉快的写邮件,由于支持 Markdown 直接转电子邮...
看完这篇HTTP,跟面试官扯皮就没问题了
我是一名程序员,我的主要编程语言是 Java,我更是一名 Web 开发人员,所以我必须要了解 HTTP,所以本篇文章就来带你从 HTTP 入门到进阶,看完让你有一种恍然大悟、醍醐灌顶的感觉。 最初在有网络之前,我们的电脑都是单机的,单机系统是孤立的,我还记得 05 年前那会儿家里有个电脑,想打电脑游戏还得两个人在一个电脑上玩儿,及其不方便。我就想为什么家里人不让上网,我的同学 xxx 家里有网,每...
2020 年,大火的 Python 和 JavaScript 是否会被取而代之?
Python 和 JavaScript 是目前最火的两大编程语言,但是2020 年,什么编程语言将会取而代之呢? 作者 |Richard Kenneth Eng 译者 |明明如月,责编 | 郭芮 出品 | CSDN(ID:CSDNnews) 以下为译文: Python 和 JavaScript 是目前最火的两大编程语言。然而,他们不可能永远屹立不倒。最终,必将像其他编程语言一...
史上最全的IDEA快捷键总结
现在Idea成了主流开发工具,这篇博客对其使用的快捷键做了总结,希望对大家的开发工作有所帮助。
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
这种新手都不会范的错,居然被一个工作好几年的小伙子写出来,差点被当场开除了。
谁是华为扫地僧?
是的,华为也有扫地僧!2020年2月11-12日,“养在深闺人不知”的华为2012实验室扫地僧们,将在华为开发者大会2020(Cloud)上,和大家见面。到时,你可以和扫地僧们,吃一个洋...
AI 没让人类失业,搞 AI 的人先失业了
最近和几个 AI 领域的大佬闲聊 根据他们讲的消息和段子 改编出下面这个故事 如有雷同 都是巧合 1. 老王创业失败,被限制高消费 “这里写我跑路的消息实在太夸张了。” 王葱葱哼笑一下,把消息分享给群里。 阿杰也看了消息,笑了笑。在座几位也都笑了。 王葱葱是个有名的人物,21岁那年以全额奖学金进入 KMU 攻读人工智能博士,累计发表论文 40 余篇,个人技术博客更是成为深度学习领域内风向标。 ...
2020年,冯唐49岁:我给20、30岁IT职场年轻人的建议
点击“技术领导力”关注∆每天早上8:30推送 作者|Mr.K 编辑| Emma 来源|技术领导力(ID:jishulingdaoli) 前天的推文《冯唐:职场人35岁以后,方法论比经验重要》,收到了不少读者的反馈,觉得挺受启发。其实,冯唐写了不少关于职场方面的文章,都挺不错的。可惜大家只记住了“春风十里不如你”、“如何避免成为油腻腻的中年人”等不那么正经的文章。 本文整理了冯...
神级宝库!GitHub 标星 1.2w+,Chrome 最天秀的插件都在这里啦!
作者 | Rocky0429 来源 | Python空间 大家好,我是 Rocky0429,一个沉迷 Chrome 不能自拔的蒟蒻… 作为一个在远古时代用过什么 IE、360、猎豹等浏览器的资深器哥,当我第一次了解 Chrome 的时候,就被它的美貌给吸引住了… 就在我用了一段时间之后,我坚决的卸载了电脑上其它碍眼的浏览器,并觉得在之前的搬砖生涯中,我不配当哥,我只配是个沙雕… ...
作为一名大学生,如何在B站上快乐的学习?
B站是个宝,谁用谁知道???? 作为一名大学生,你必须掌握的一项能力就是自学能力,很多看起来很牛X的人,你可以了解下,人家私底下一定是花大量的时间自学的,你可能会说,我也想学习啊,可是嘞,该学习啥嘞,不怕告诉你,互联网时代,最不缺的就是学习资源,最宝贵的是啥? 你可能会说是时间,不,不是时间,而是你的注意力,懂了吧! 那么,你说学习资源多,我咋不知道,那今天我就告诉你一个你必须知道的学习的地方,人称...
那些年,我们信了课本里的那些鬼话
教材永远都是有错误的,从小学到大学,我们不断的学习了很多错误知识。 斑羚飞渡 在我们学习的很多小学课文里,有很多是错误文章,或者说是假课文。像《斑羚飞渡》: 随着镰刀头羊的那声吼叫,整个斑羚群迅速分成两拨,老年斑羚为一拨,年轻斑羚为一拨。 就在这时,我看见,从那拨老斑羚里走出一只公斑羚来。公斑羚朝那拨年轻斑羚示意性地咩了一声,一只半大的斑羚应声走了出来。一老一少走到伤心崖,后退了几步,突...
张朝阳回应迟到 1 分钟罚 500:资本家就得剥削员工
loonggg读完需要2分钟速读仅需 1 分钟大家我,我是你们的校长。前几天,搜狐的董事局主席兼 CEO 张朝阳和搜狐都上热搜了。原因很简单,就是搜狐出了“考勤新规”。一封搜狐对员工发布...
立即提问