Searching We Love Privacy Club

Twts matching #maps
Sort by: Newest, Oldest, Most Relevant

爲什麼 Golang Fasthttp 選擇使用 slice 而非 map 存儲請求數據
Fasthttp 是一個高性能的 Golang HTTP 框架,它在設計上做了許多優化以提高性能。其中一個顯著的設計選擇是使用 slice 而非 map 來存儲數據,尤其是在處理 HTTP headers 時。爲什麼呢?本文將從簡單到複雜,逐步剖析爲什麼 Fasthttp 選擇使用 slice 而非 map,並通過代碼示例解釋這一選擇背後高性能的原因Slice vs Map:基本概念——- ⌘ Read more

⤋ Read More

Erlang Solutions: Blockchain Tech Deep Dive | 6 Principles
Blockchain technology is transforming nearly every industry, whether banking,  government, fashion or logistics. The benefits of using blockchain are substantial. Businesses can lower transaction costs, free up capital, speed up processes, and enhance security and trust.

We’re mapping out the six key principles for blockchain integration success, so businesses can navigate the challenges and opportunities this disruptive tec … ⌘ Read more

⤋ Read More

golang 高性能無 GC 的緩存庫 bigcache 是怎麼實現的?
我們寫代碼的時候,經常會需要從數據庫裏讀取一些數據,比如配置信息或者諸如每週熱點商品之類的數據。如果這些數據既不經常變化,又需要頻繁讀取,那比起每次都去讀數據庫,更優的解決方案就是將它們放到應用的本地內存裏,這樣可以省下不少數據庫 IO,性能嘎一下就上來了。那麼現在問題就來了,假設我要在某個服務應用裏實現一個緩存組件去存各種類型的數據,該怎麼實現這個組件呢?從一個 map 說起———- ⌘ Read more

⤋ Read More

How to Search Reviews on Google Maps
Many people use Google Maps to find out about businesses, parks, locations, and destinations, by reading the reviews. While it’s one thing to browse through all of the reviews and read them, it can be very useful to narrow down reviews for something specific, like a keyword. Thus, it’s a desirable capability to be able … Read MoreRead more

⤋ Read More

Go map 讀寫性能優化 - 分片 map
基本在所有的編程語言中,都有 map 這種數據結構,Go 語言也不例外。我們知道 Go 是一門對併發支持得比較好的語言,但是 map 並不支持併發讀寫。比如,下面這種寫法是錯誤的:var m = make(map[int]int)var wg sync.WaitGroupwg.Add(2)// 啓動兩個協程序同時寫入 mapgo func() {    for i := 0; i < 100; i ⌘ Read more

⤋ Read More

How to Drop a Pin in Google Maps on iPhone or iPad
Dropping a pin on Google Maps allows you to mark a location on the map for sharing with others, for saving that spot for yourself to reference later, or even for getting directions to that pinned location. It’s a very useful feature of Google Maps that has wide applications, so if you’re a Google Maps … Read MoreRead more

⤋ Read More

Erlang Solutions: Introducing Wardley Mapping to Your Business Strategy
Since it’s creation in 2005, Wardley Mapping has been embraced by UK government institutions and companies worldwide. This is thanks to its unique ability to factor both value and change into the strategising process. It’s a powerful, fascinating tool that far more organisations across the world should be implementing today to make key choices for their future growth.

Ahead of my wider Wardley Mapping st … ⌘ Read more

⤋ Read More

#golang
A handy and powerful library to deal with unstructured data

The below piece of code shows an example of usage

type Person struct {<br/>    Firstname string   `structs:"firstname"`<br/>    Age       int      `structs:"age"`<br/>    Siblings  []Person `structs:"siblings,omitempty"`<br/>}

func main(){

k := knoa.Map().Set(“firstname”, “John”, “age”, 20)

k.Set(“siblings”, []Person{

{

Firstname: “Tim”,

Age: 29,

},

{

Firstname: “Bob”,

Age: 40,

},

})

k.Set(“age”, 23, “siblings[1].age”, 39)

var person Person … ⌘ Read more

⤋ Read More
In-reply-to » The original twt is unavailable. It may have been edited or deleted, or is from an unknown or muted feed.

@movq@www.uninformativ.de If I understand it correctly, gtk4 renders using OpenGL. That means some of that RAM that appears to be allocated is actually some trick of the OpenGL driver so that it can map address in RAM space to the GPU’s VRAM (depends a lot on your setup though).

What happens if you run it with GSK_RENDERER=cairo set?

⤋ Read More
In-reply-to » The original twt is unavailable. It may have been edited or deleted, or is from an unknown or muted feed.

So. Some bits.

i := fIndex(xs, 5.6)

Can also be

i := Index(xs, 5.6)

The compiler can infer the type automatically. Looks like you mention that later.

Also the infer is super smart.. You can define functions that take functions with generic types in the arguments. This can be useful for a generic value mapper for a repository

func Map[U,V any](rows []U, fn func(U) V) []V {
  out := make([]V, len(rows))
  for i := range rows { out = fn(rows[i]) }
  return out
}


rows := []int{1,2,3}
out := Map(rows, func(v int) uint64 { return uint64(v) })

I am pretty sure the type parameters goes the other way with the type name first and constraint second.

func Foo[comparable T](xs T, s T) int

Should be


func Foo[T comparable](xs T, s T) int

⤋ Read More

Новый офис Яндекса снаружи и внутри
В Москве продолжает строиться новая штаб-квартира Яндекса. Подземная часть офиса готова, и с октября работы идут на поверхности. Если вы окажетесь на улице Косыгина, то увидите здание, даже не заглядывая за забор. Тем временем в Яндекс Картах появилась 3D-модель нашего будущего дома «в сборе» — так он будет выглядеть в 2024 году, когда завершится стройка:

![](https://avatars.mds.yandex.net/get-yablogs/39006/file_16717 … ⌘ Read more

⤋ Read More