August 16, 2022
August 16, 2022
今天才知道,非箭头函数和非 native 函数都可以作为构造函数
所以可以用一个匿名构造函数来创建一个匿名对象:`new function() { ... }`
我甚至查不到相关的说法,只看到有一个 stackoverflow 问题: https://stackoverflow.com/questions/40096704/new-function-vs-new-function
然后,会发生什么事情呢,调用了 bind()函数绑定了 this 值的函数也可以用一个新的空对象去调用,本来连 apply 和 call 都无法更改 this 值的:
```
function test() {
console.log('调用 test()函数, this 值是:', this);
}
test = test.bind({ a: 1 });
test();
new test();
```
真的太容易混淆了吧:
```
typeof Function
'function'
typeof function() {}
'function'
typeof new Function
'function'
typeof new function() {}
'object'
```
#function #new #test #typeof #调用 #stackoverflow #bind #Function #函数 #匿名
所以可以用一个匿名构造函数来创建一个匿名对象:`new function() { ... }`
我甚至查不到相关的说法,只看到有一个 stackoverflow 问题: https://stackoverflow.com/questions/40096704/new-function-vs-new-function
然后,会发生什么事情呢,调用了 bind()函数绑定了 this 值的函数也可以用一个新的空对象去调用,本来连 apply 和 call 都无法更改 this 值的:
```
function test() {
console.log('调用 test()函数, this 值是:', this);
}
test = test.bind({ a: 1 });
test();
new test();
```
真的太容易混淆了吧:
```
typeof Function
'function'
typeof function() {}
'function'
typeof new Function
'function'
typeof new function() {}
'object'
```
#function #new #test #typeof #调用 #stackoverflow #bind #Function #函数 #匿名
September 2, 2022
Linux c 编程问题请教,同一时间运行多个相同的程序,如何确保每个程序生成的随机数在彼此之间也是随机的?
https://stackoverflow.com/questions/822323/how-to-generate-a-random-int-in-c
这个问题最高赞的回答不能满足我的要求,因为同一时间运行多个相同的程序,生成的随机数在这几个程序之间都是一样的,因为种子都是当前时间。
我希望有一种办法能生成真正的随机数。
#随机数 #生成 #程序 #https #stackoverflow #com #questions #822323 #how #generate
https://stackoverflow.com/questions/822323/how-to-generate-a-random-int-in-c
这个问题最高赞的回答不能满足我的要求,因为同一时间运行多个相同的程序,生成的随机数在这几个程序之间都是一样的,因为种子都是当前时间。
我希望有一种办法能生成真正的随机数。
#随机数 #生成 #程序 #https #stackoverflow #com #questions #822323 #how #generate
September 16, 2022
2100 年有哪些编程语言或编程范式还会活着?
嗯看看有没有从公元 2100 年穿越回来的朋友吗?告诉一点人生的经验
这里有一份来自 21 世纪 20 年代的列表可以参考着看
https://insights.stackoverflow.com/survey/2021
比如以后一个人寿命很长 可以活 150 岁,那么一个人的职业生涯可以有一百年,是不是 如果说出去我有 80 年 Java 经验, 我有 90 年 HTML 经验,这个就比较好
在评估一个东西是否活得久时,一种思考思路是:经典 MVC 这种解决小问题的编程范式或许是要比具体某一门语言(比如 PHP ) or 工具(比如 git )活得久,只要有对应的问题存在 短平快的 solution 就是它,it beats anyone so it lives on.
-
#比如 #经验 #短平快 #2100 #21 #20 #https #insights #stackoverflow #com
嗯看看有没有从公元 2100 年穿越回来的朋友吗?告诉一点人生的经验
这里有一份来自 21 世纪 20 年代的列表可以参考着看
https://insights.stackoverflow.com/survey/2021
比如以后一个人寿命很长 可以活 150 岁,那么一个人的职业生涯可以有一百年,是不是 如果说出去我有 80 年 Java 经验, 我有 90 年 HTML 经验,这个就比较好
在评估一个东西是否活得久时,一种思考思路是:经典 MVC 这种解决小问题的编程范式或许是要比具体某一门语言(比如 PHP ) or 工具(比如 git )活得久,只要有对应的问题存在 短平快的 solution 就是它,it beats anyone so it lives on.
-
#比如 #经验 #短平快 #2100 #21 #20 #https #insights #stackoverflow #com
September 22, 2022
Xcode 如何跳转方法具体代码实现处?
用 Xcode 开发时,想查看某个方法的具体实现。但是 Jump to Definition 后,只有函数签名,没有具体代码实现。要如何才能跳转到代码实现处呢?
搜了下,在 stackoverflow 上发现相同的问题: https://stackoverflow.com/questions/8748340/xcode-shortcut-for-jumping-to-implementation-of-a-method , 但是没有有效的回答
#stackoverflow #代码 #实现 #跳转 #Xcode #Jump #Definition #https #com #questions
用 Xcode 开发时,想查看某个方法的具体实现。但是 Jump to Definition 后,只有函数签名,没有具体代码实现。要如何才能跳转到代码实现处呢?
搜了下,在 stackoverflow 上发现相同的问题: https://stackoverflow.com/questions/8748340/xcode-shortcut-for-jumping-to-implementation-of-a-method , 但是没有有效的回答
#stackoverflow #代码 #实现 #跳转 #Xcode #Jump #Definition #https #com #questions
September 23, 2022
Google 搜索时发现居然有假的 GitHub,还是 gov.cn
我在搜索 openwrt 编译的时候看到了一个奇奇怪怪的链接,点进去 chrome 提示仿冒网站,我一看域名发现不对劲
**https--github--com.proxy.huizhou.gov.cn**
居然是 gov.cn ,顺着这个 **proxy.huizhou.gov.cn** 域名发现还有一个假的 stackoverflow
stackoverflow--com.proxy.huizhou.gov.cn
现在都流行钓鱼执法了吗?
#gov #cn #-- #proxy #huizhou #com #stackoverflow #域名 #openwrt #chrome
我在搜索 openwrt 编译的时候看到了一个奇奇怪怪的链接,点进去 chrome 提示仿冒网站,我一看域名发现不对劲
**https--github--com.proxy.huizhou.gov.cn**
居然是 gov.cn ,顺着这个 **proxy.huizhou.gov.cn** 域名发现还有一个假的 stackoverflow
stackoverflow--com.proxy.huizhou.gov.cn
现在都流行钓鱼执法了吗?
#gov #cn #-- #proxy #huizhou #com #stackoverflow #域名 #openwrt #chrome
October 3, 2022
如何让所有流量全走 clash 进行处理?
想整整 stable diffusion,发现直接用 pip 安装 git 包走了代理又好像没代理,折腾了好几次彻底放弃了,一个个 git 下来再安装的,有没有办法让所有流量全去走代理呢?
先排除网络问题,再说硬件能不能用,不然这也太折磨了,StackOverflow 也不会有人问这些问题,因为他们不会遇到这种特殊的网络环境
#git #代理 #安装 #包走 #网络 #全去 #stable #diffusion #pip #StackOverflow
想整整 stable diffusion,发现直接用 pip 安装 git 包走了代理又好像没代理,折腾了好几次彻底放弃了,一个个 git 下来再安装的,有没有办法让所有流量全去走代理呢?
先排除网络问题,再说硬件能不能用,不然这也太折磨了,StackOverflow 也不会有人问这些问题,因为他们不会遇到这种特殊的网络环境
#git #代理 #安装 #包走 #网络 #全去 #stable #diffusion #pip #StackOverflow
October 8, 2022
Cookie 的 Secure 有点迷惑人
根据官方说明,cookie 的属性项包含 secure 时,不会将 cookie 在 header 中明文发送到服务器,也就是说只有 https 协议下才会发送此 cookie ,防止被中间人攻击。
比如
```
document.cookie = "tagname = test; secure"
```
本来这点是确保安全的,挺好。
但是根据 https://stackoverflow.com/questions/37234687/how-to-set-cookie-secure-flag-using-javascript 的解释,如果是 http 协议的话,不光不能发送,连在浏览器端通过 document.cookie=来设置都不行了——这个“禁止”动作的思维跳跃比较大。
那我怎么存一些只在浏览器端保存一段时间的信息啊?😳
#cookie #secure #https #document #浏览器 #发送 #header #tagname #test #stackoverflow
根据官方说明,cookie 的属性项包含 secure 时,不会将 cookie 在 header 中明文发送到服务器,也就是说只有 https 协议下才会发送此 cookie ,防止被中间人攻击。
比如
```
document.cookie = "tagname = test; secure"
```
本来这点是确保安全的,挺好。
但是根据 https://stackoverflow.com/questions/37234687/how-to-set-cookie-secure-flag-using-javascript 的解释,如果是 http 协议的话,不光不能发送,连在浏览器端通过 document.cookie=来设置都不行了——这个“禁止”动作的思维跳跃比较大。
那我怎么存一些只在浏览器端保存一段时间的信息啊?😳
#cookie #secure #https #document #浏览器 #发送 #header #tagname #test #stackoverflow
October 12, 2022
October 19, 2022
October 24, 2022
November 8, 2022
浏览器的网站如何关闭电脑?或者发起关机请求? Windows10 系统
遇到个神奇的问题:
我司目前依托 Win10 系统 + 浏览器的**定制化机器**,搞了一些业务设备,离谱的是:这个机器没有关机按钮(有强制关机的电源键)
业务人员干脆就拔电源,导致现在有机器开始故障了——引导丢失。
于是问我们:能不能加个关机的按钮——在网站上,用 JavaScript……
查了一下 Google 和 StackOverflow ,没啥方便快捷的方法。
请问神通广大的朋友们,有没有什么想法?
#关机 #机器 #按钮 #电源 #我司 #Win10 #就拔 #JavaScript #Google #StackOverflow
遇到个神奇的问题:
我司目前依托 Win10 系统 + 浏览器的**定制化机器**,搞了一些业务设备,离谱的是:这个机器没有关机按钮(有强制关机的电源键)
业务人员干脆就拔电源,导致现在有机器开始故障了——引导丢失。
于是问我们:能不能加个关机的按钮——在网站上,用 JavaScript……
查了一下 Google 和 StackOverflow ,没啥方便快捷的方法。
请问神通广大的朋友们,有没有什么想法?
#关机 #机器 #按钮 #电源 #我司 #Win10 #就拔 #JavaScript #Google #StackOverflow
November 17, 2022
November 29, 2022
OpenAPI 新项目 ChatGPT
https://openai.com/blog/chatgpt/
没有 stackoverflow 心里也不慌了。
你问它代码怎么写,里面有什么 bug ,他都能告诉你。
#https #openai #com #blog #chatgpt #stackoverflow #bug #代码 #里面 #心里
https://openai.com/blog/chatgpt/
没有 stackoverflow 心里也不慌了。
你问它代码怎么写,里面有什么 bug ,他都能告诉你。
#https #openai #com #blog #chatgpt #stackoverflow #bug #代码 #里面 #心里
December 1, 2022
chrome ext manifest v3 的 service worker (Inactive) 问题
https://stackoverflow.com/questions/66618136/persistent-service-worker-in-chrome-extension
这里的方案基本都试过一遍,感觉都没有完全解决这个问题,进程总是过一段时间就被杀掉了。有人解决过这个问题么?
#https #stackoverflow #com #questions #66618136 #persistent #service #worker #chrome #extension
https://stackoverflow.com/questions/66618136/persistent-service-worker-in-chrome-extension
这里的方案基本都试过一遍,感觉都没有完全解决这个问题,进程总是过一段时间就被杀掉了。有人解决过这个问题么?
#https #stackoverflow #com #questions #66618136 #persistent #service #worker #chrome #extension
December 3, 2022
December 5, 2022
2022 年 Linux 桌面用户数超过 macOS
https://survey.stackoverflow.co/2022/#section-most-popular-technologies-operating-system

#https #2022 #DE #linuxovermacos27ca4cff7f1d1e26 #png #survey #stackoverflow #co #section #most
https://survey.stackoverflow.co/2022/#section-most-popular-technologies-operating-system

#https #2022 #DE #linuxovermacos27ca4cff7f1d1e26 #png #survey #stackoverflow #co #section #most
December 28, 2022
December 28, 2022
有什么好用的 stackoverflow 的客户端吗?
友友们?有什么什么 app 能看 stackoverflow 的,求推荐,还是只能网页端看?
#友友 #app #stackoverflow #网页 #什么 #推荐 #只能 #还是
友友们?有什么什么 app 能看 stackoverflow 的,求推荐,还是只能网页端看?
#友友 #app #stackoverflow #网页 #什么 #推荐 #只能 #还是
January 1, 2023