closure-library
pystring
closure-library | pystring | |
---|---|---|
5 | 7 | |
4,841 | 833 | |
0.2% | 0.0% | |
6.6 | 0.0 | |
6 days ago | 10 months ago | |
JavaScript | C++ | |
Apache License 2.0 | BSD 3-clause "New" or "Revised" License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
closure-library
-
For processing strings, streams in C++ can be slow
> "I recently learned that some Node.js engineers prefer stream classes when building strings, for performance reasons." Pretty much tells you everything you need to know about node js, I guess.
Google Closure Library includes a StringBuffer class. [1]
I recall it having explanatory notes, but I don't see them in the code now. JavaScript engines can optimize a string concatenating to in-place edit, if there is only one reference to the first string. The StringBuffer class keeps the reference count at one, guaranteeing this optimization is available, even if the StringBuffer itself is ever shared.
[1] https://github.com/google/closure-library/blob/master/closur...
- Closure Library Is in Maintenance Mode
-
Tailscale/golink: A private shortlink service for tailnets
This made me wonder what the oldest go-link (from inside Google) discoverable on the public internet is. So far I've found one going back to 2013 (but there should definitely be some from the mid 2000s): https://github.com/google/closure-library/blame/11ed104958a2...
(Fun fact: go-links are so critical to Google ops, that they're expected to be accessible in a "everything is down" scenario.)
-
Which Type, Currency Values In DB?
For data type I always use DECIMAL(#, 6). So 6 decimal places. This accommodates all generally agreed upon rounding standards for calculating interest, taxes, discounts, etc. So for me, something like $12.75 USD will look like 12.750000 in the database. I store the 3-letter currency code in a separate column. I know what the base value for each currency is on the code side in our framework, which has a currency library that reads a dataset that has every currency stored like this (the 'rules' key is a bitmask per Google's i18n currency.js):
- How do I find out what functions are called when a button is pressed in Chrome Console?
pystring
-
Why are strings and IO so complicated?
If you are used to python strings give pystring from Sony Imageworks a go. https://github.com/imageworks/pystring
-
For processing strings, streams in C++ can be slow
If performance matters, write your own specialized string processing code which works on "raw" data in memory buffers. If convenience matters look at https://github.com/fmtlib/fmt (or std::format which AFAIK is less feature rich) and https://github.com/imageworks/pystring.
-
Is this a valid use for goto?
Personally I use pystring for my projects as I use both C++ and python so the api is familiar.
-
Is there a std::string::split or something similar?
I've been using this for a number of years https://github.com/imageworks/pystring Works really well especially if you are used to python strings.
-
How can remove the space at the beginning and end of the tokens?
I use this https://github.com/imageworks/pystring for most of my string processing (as I write a lot of both C++ and Python), you can use the lstrip / rstrip and strip methods, you just need to drop in the .cpp and .h files to your projects. It makes life so much easier.
-
Help With File Reading
There are various libraries out there that make this much easier such as boost. Personally I use pystirng https://github.com/imageworks/pystring as I use loads of python too.
What are some alternatives?
golink - A private shortlink service for tailnets
scnlib - scanf for modern C++
go-links - The open source go links app at the core of Trotto.
aoc2023 - C++23 aoc 2023
wesher - wireguard overlay mesh network manager
lexy - C++ parsing DSL
go - Another Google-like Go short link service
FilesAndParsing
yggdrasil-go - An experiment in scalable routing as an encrypted IPv6 overlay network