https://git-fork.com/
https://marcus116.blogspot.com/2019/09/git-git-client-fork.html
https://git-fork.com/
https://marcus116.blogspot.com/2019/09/git-git-client-fork.html
https://rapidapi.com/blog/access-global-weather-data-with-these-weather-apis/
https://docs.rapidapi.com/docs/php-1
https://curl.se/
https://github.com/curl/curl
※curl的definition:
curl is a tool to transfer data from or to a server, using one of the supported protocols (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP). The command is designed to work without user interaction.
curl offers a busload of useful tricks like proxy support, user authentication, FTP upload, HTTP post, SSL connections, cookies, file transfer resume, Metalink, and more.
※curl 學習完成的指令:
https://blog.techbridge.cc/2019/02/01/linux-curl-command-tutorial/
※POST 的請求頭content-type:
HTTP 協議是以 ASCII 碼 傳輸,創建在 TCP/IP 協議之上的應用層規範。規範把 HTTP 請求分為三個部分:狀態行、請求頭、消息主體。
協議規定 POST 提交的數據必須放在消息主體(entity-body)中,但協議並沒有規定數據必須使用什麼編碼方式。Content-type 一般只存在於 Post 方法中,因為 Get 方法是不含 “body” 的,它的請求參數都會被編碼到 url 後面,所以在 Get 方法中加 Content-type 是無用的。
→所以POST取得傳入的資料用req.body.xxx
→所以GET取得傳入的資料用req.query.xxx
chrome extension api reference: https://developer.chrome.com/docs/extensions/reference/
這篇說明得很好:
https://medium.com/%E9%BA%A5%E5%85%8B%E7%9A%84%E5%8D%8A%E8%B7%AF%E5%87%BA%E5%AE%B6%E7%AD%86%E8%A8%98/%E7%AD%86%E8%A8%98-%E5%BE%9E%E9%9B%B6%E9%96%8B%E5%A7%8B%E8%A3%BD%E4%BD%9C-chrome-%E5%A5%97%E4%BB%B6%E5%88%B0%E4%B8%8A%E6%9E%B6%E5%95%86%E5%BA%97-4971ed79ac77
注意: 在套件中每使用一個 API,就需要先在 manifest 檔案裡請求使用該 API 的權限
基本需要的檔案有以下幾個:
1. manifest.json
2. background.js
3. content.js
4. images/image16.png ( 用於右鍵選單中的項目icon 或 瀏覽器右上的套件顯示,亦可設定不同圖片)
5. popup.html 點開瀏覽器右上的icon時跳出的彈出窗
上架流程: https://developer.chrome.com/docs/webstore/publish/
簡單的說:
1. 須建立一個開發者帳戶,
2. 需繳一次性費用5美金/可上架20個extension)
3. 套件在正式被發佈到商店前,可能需要經過一系列的審查(為加快審查速度,有較基本的兩點可注意 a. 程式碼是否有好的可讀性與功能性(Performance Evaluation)b. 套件請求的權限範圍是否已盡可能最小化)
下面這個好像是firefox才用的,興趣缺缺
https://developer.mozilla.org/zh-TW/docs/Mozilla/Add-ons/WebExtensions/Your_first_WebExtension
https://developer.mozilla.org/zh-TW/docs/Mozilla/Add-ons/WebExtensions/Your_second_WebExtension
ssr:
beforeCreate
watch immediate
created
client端:
beforeCreate, beforeCreate client
watch immediate, watch immediate client
created, created client
mounted, mounted client
在本身就是client端的mounted加上client沒有意義,它會根據程式寫的順序由上到下執行
※有空測他們和上面那些比較它們的時機是?
computed取得資料在head之後
cookie是在client端才拿到的,head不可使用它
Interesting that the interview question asks about the advantages, without asking about disadvantages, for there are are both.
Streams are a more declarative style. Or a more expressive style. It may be considered better to declare your intent in code, than to describe how it's done:
return people
.filter( p -> p.age() < 19)
.collect(toList());
... says quite clearly that you're filtering matching elements from a list, whereas:
List<Person> filtered = new ArrayList<>();
for(Person p : people) {
if(p.age() < 19) {
filtered.add(p);
}
}
return filtered;
Says "I'm doing a loop". The purpose of the loop is buried deeper in the logic.
Streams are often terser. The same example shows this. Terser isn't always better, but if you can be terse and expressive at the same time, so much the better.
Streams have a strong affinity with functions. Java 8 introduces lambdas and functional interfaces, which opens a whole toybox of powerful techniques. Streams provide the most convenient and natural way to apply functions to sequences of objects.
Streams encourage less mutability. This is sort of related to the functional programming aspect -- the kind of programs you write using streams tend to be the kind of programs where you don't modify objects.
Streams encourage looser coupling. Your stream-handling code doesn't need to know the source of the stream, or its eventual terminating method.
Streams can succinctly express quite sophisticated behaviour. For example:
stream.filter(myfilter).findFirst();
Might look at first glance as if it filters the whole stream, then returns the first element. But in fact findFirst()
drives the whole operation, so it efficiently stops after finding one item.
Streams provide scope for future efficiency gains. Some people have benchmarked and found that single-threaded streams from in-memory List
s or arrays can be slower than the equivalent loop. This is plausible because there are more objects and overheads in play.
But streams scale. As well as Java's built-in support for parallel stream operations, there are a few libraries for distributed map-reduce using Streams as the API, because the model fits.
Disadvantages?
Performance: A for
loop through an array is extremely lightweight both in terms of heap and CPU usage. If raw speed and memory thriftiness is a priority, using a stream is worse.
Familiarity.The world is full of experienced procedural programmers, from many language backgrounds, for whom loops are familiar and streams are novel. In some environments, you want to write code that's familiar to that kind of person.
Cognitive overhead. Because of its declarative nature, and increased abstraction from what's happening underneath, you may need to build a new mental model of how code relates to execution. Actually you only need to do this when things go wrong, or if you need to deeply analyse performance or subtle bugs. When it "just works", it just works.
Debuggers are improving, but even now, when you're stepping through stream code in a debugger, it can be harder work than the equivalent loop, because a simple loop is very close to the variables and code locations that a traditional debugger works with.
我们了解到如果一个代码块被synchronized修饰了,当一个线程获取了对应的锁,并执行该代码块时,其他线程便只能一直等待,等待获取锁的线程释放锁,而这里获取锁的线程释放锁只会有两种情况:
1)获取锁的线程执行完了该代码块,然后线程释放对锁的占有;
2)线程执行发生异常,此时JVM会让线程自动释放锁。
那么如果这个获取锁的线程由于要等待IO或者其他原因(比如调用sleep方法)被阻塞了,但是又没有释放锁,其他线程便只能干巴巴地等待,试想一下,这多么影响程序执行效率。
因此就需要有一种机制可以不让等待的线程一直无期限地等待下去(比如只等待一定的时间或者能够响应中断),通过Lock就可以办到。
再举个例子:当有多个线程读写文件时,读操作和写操作会发生冲突现象,写操作和写操作会发生冲突现象,但是读操作和读操作不会发生冲突现象。
但是采用synchronized关键字来实现同步的话,就会导致一个问题:
如果多个线程都只是进行读操作,所以当一个线程在进行读操作时,其他线程只能等待无法进行读操作。
因此就需要一种机制来使得多个线程都只是进行读操作时,线程之间不会发生冲突,通过Lock就可以办到。
https://www.itread01.com/content/1544784485.html
樣式表一般在磁碟中,不會快取到記憶體中去。因為如果指令碼在磁碟當中,在執行該指令碼需要從磁碟中取到記憶體當中來,這樣的IO開銷是比較大的,有可能會導致瀏覽器失去響應
在Firefox下並沒有from memory cache以及from disk cache的狀態展現,相同的資源在chrome下是from disk/memory cache,但是Firefox統統是304狀態碼,即Firefox下會快取資源,但是每次都會請求伺服器對比當前快取是否更改,chrome不請求伺服器,直接拿過來用,這也是為啥chrome比較快的原因之一吧,當然以上是粗略的研究chrome資源的獲取策略,至於chrome如何保證資源的更新,即什麼時候200,什麼時候304還需要究
304状态码:服务端已经执行了GET,但文件未变化。
https://docs.google.com/presentation/d/e/2PACX-1vS1g5NUzMGao-bBoU9LT2m1HlPqO2gYb3LOT0JGeg55hKW7RYpGpTjzMy-LZqRv-Hjy4kvrEvbfhMnH/pub?fbclid=IwAR1XdYsJ-ATsJDNEDt3_2p2LaJcF_KbJSKeGn6-k35hsPNQvox0v53ksUhI&slide=id.gaef0604d2a_0_2322
http://www.moreonfew.com/how-to-convert-ltr-website-to-rtl-website/