They are more or less equivalent. One has obscure feature X other has obscure feature Y, one is a bit faster on A, other is a bit faster on B, the defaults are a bit different, and one is written in Rust, the other in C++.
Pick the one you like, or both. I have both on my machine, and tend to use the one that does what I want with the least options. I also use GNU grep when I don't need the speed or features of either ug and rg.
One thing I never liked about ripgrep is that it doesn't have a pager. Yes, it can be configured to use the system-wide ones, but it's an extra step (and every time I have to google how to preserve colors) and on Windows you're SOL unless you install gnu utils or something. The author always refused to fix that.
Ugrep not only has a pager built in, but it also allows searching the results which is super nice! And that feature works on all supported platforms!
Interesting - for me a built-in pager is an antifeature. I don't want to figure out how to leave the utility. Worst of all, pager usually means that sometimes you get more pages and you need to press q to exit, and sometimes not. Annoying. I often type yhe next command right away and the pager means I get stuck, or worse, pager starts doing something in response to my keys (looking at you, `git log`).
Then again I'm on Linux and can always pipe to less if I need to. I'm also not the target audience for ugrep because I've never noticed that grep would be slow. :shrug:
Some terminal emulators (kitty for sure) support "open last command output in pager". Works great with a pager that can understand ANSI colors - less fussing around with variables and flags to preserve colors in the pager
I referenced bat because I've found that suggesting cygwin sometimes provokes a negative reaction. The GP also mentioned needing to install GNU tooling as if it were a negative.
I'm sure you know but windows command prompt always came with its inbuilt pager -- more. So, you could always do "dir | more" or "rg -p "%*" | more ". (more is good with colors without flags)
I didn't! I'm not a Windows user. Colors are half the battle, so that's good. Will it only appear if paging is actually needed? That's what the flags to `less` do in my wrapper script above. They are rather critical for this use case.
For me, it's a lot easier to compile a static binary of a C++ app than a Rust one. Never got that to work. Also nice to have compatibility with all of grep's arguments.
For an up-to-date performance comparison of the latest ugrep, please see the ugrep performance benchmarks [at https://github.com/Genivia/ugrep-benchmarks]. Ugrep is faster than GNU grep, Silver Searcher, ack, sift. Ugrep's speed beats ripgrep in most benchmarks.
Although being faster in some cases, ripgrep lacks archive search support (no, transparent decompression ignoring the archive structure is not enough) which works great in ugrep.
I find myself returning to grep from my default of rg because I'm just too lazy to learn a new regex language. Stuff like word boundaries "\<word\>" or multiple patterns "\(one\|two\)".
If you consider it "the weirdest ever", I'm guessing that I'm probably older than you. I've certainly been using regex long before PCRE became common.
As a vim user I compose 10s if not 100s of regexes a day. It does not use PCRE. Nor does sed, a tool I've been using for decades. Do you also recommend not using these?
I use all of those tools but the inconsistency drives me crazy as it's hard to remember which syntax to use where. Here's how to match the end of a word:
ripgrep, Python, JavaScript, and practically every other non-C language: \b
Did you know that not all of those use the same definition of what a "word" character is? Regex engines differ on the inclusion of things like \p{Join_Control}, \p{Mark} and \p{Connector_Puncuation}. Although in the case of \p{Connector_Punctuation}, regex engines will usually at least include underscore. See: https://github.com/BurntSushi/rebar/blob/f9a4f5c9efda069e798...
And then there's \p{Letter}. It can be spelled in a lot of ways: \pL, \p{L}, \p{Letter}, \p{gc=Letter}, \p{gc:Letter}, \p{LeTtEr}. All equivalent. Very few regex engines support all of them. Several support \p{L} but not \pL. See: https://github.com/BurntSushi/rebar/blob/f9a4f5c9efda069e798...
Isn't that inconsistent with the way Perl's regex syntax was designed? In Perl's syntax an escaped non-ASCII character is always a literal [^1], and that is guaranteed not to change.
That's nice for beginners because it saves you from having to memorize all the metacharacters. If you are in doubt you on whether something has a special meaning, you just escape it.
Yes, it's inconsistent with Perl. But there are many things in ripgrep's default regex engine that are inconsistent with Perl, including the fact that all patterns are guaranteed to finish a search in linear time with respect to the haystack. (So no look-around or back-references are supported.) It is a non-goal of ripgrep to be consistent with Perl. Thankfully, if you want that, then you can get pretty close by passing the -P/--pcre2 flag.
With that said, I do like Perl's philosophy here. And it was my philosophy too up until recently. I decided to make an exception for \< and \> given their prevalence.
It was also only relatively recently that I made it possible for superfluous escapes to exist. Prior to ripgrep 14, unrecognized escapes were forbidden:
I had done it this way to make it possible to add new escape sequences in a semver compatible release. But in reality, if I were to ever add new escape sequences, it use one of the ascii alpha-numeric characters, as Perl does. So I decided it was okay to forever and always give up the ability to make, e.g., `\@` mean something other than just matching a literal `@`.
`\<` and `\>` are forever and always the lone exceptions to this. It is perhaps a trap for beginners, but there are many traps in regexes, and this seemed worth it.
Note that `\b{start}` and `\b{end}` also exist and are aliases for `\<` and `\>`. The more niche `\b{start-half}` and `\b{end-half}` also exist, and those are what are used to implement the -w/--word-regexp flag. (Their semantics match GNU grep's -w/--word-regexp.) For example, `\b-2\b` will not match in `foo -2 bar` since `-` is not a word character and `\b` demands `\w` on one side and `\W` on the other. However, `rg -w -e -2` will match `-2` in `foo -2 bar`:
I initially was going to cancel as well - I don't care that much about the fast shipping, and if you hit the minimum order, you get free shipping anyway. But, it means 3% back instead of 5% on the Amazon visa, so if you spend more than 150/12*50=625/month, prime is negative cost. Especially using it for many groceries, I usually hit that.
In addition to the normal vaccuum insulation layer, it has a layer that does a (constant-temperature) phase change at ~140F. If your drink is hotter than this, energy flows out of the drink, cooling it and liquifying the layer. If you drink is cooler, energy flows into the drink, solidifying the layer.
Just a quick, non-hostile technical nitpick: I don't believe that at any point, energy will actually be flowing back into the drink. If the drink is cooler, the insulator layer will become a significantly worse conductor, preventing heat from flowing outward as well as from the liquid-phase insulator, but thermodynamics/the law of entropy shouldn't really allow for the energy to flow back into the liquid, even when the insulator does re-solidify.
If you rapidly cool the drink, you're definitely right - energy would flow PCM -> drink. Otherwise, it's semantic if GP is correct. There would be dynamic equilibrium, i.e. flow of thermal energy in both directions, but no true flow from PCM->drink.
3a) drink cools to 140-epsilon before PCM liquifies fully
4a) PCM gives energy to drink in dynamic equilibrium, while also losing energy to environment, solidifying
5a) PCM is entirely solid at 140
6a) PCM drops below 140. drink gives energy to PCM and PCM to environment. drink -> PCM thermal conductivity is presumably much higher than PCM -> env, so drink and PCM remain at same temp
OR
3b) PCM liquifies fully before drink hits 140-epsilon
4b) drink and PCM stay at thermal equilibrium (see 6a) while cooling toward 140. energy flows drink -> PCM and PCM -> environment. The former is faster, so the PCM continues liquifying
5b) PCM is entirely liquid at 140. Due to thermal equilibrium, drink is also at 140.
You seem to assume that the PCM encapsulates the drink on all sides. But the cup has a lid, which doesn't have a PCM inside, and which isn't perfectly isolated.
So there will be energy going from the drink to the environment through the lid, which in turn allows energy to flow back from PCM -> drink.
When the "insulator layer" (a phase change material or PCM) is between phases, it can absorb or emit energy without changing temperature.
The drink on the other hand will change temperature as it looses energy.
The drink will lose energy through the lid, leading to a small temperature gradient between the PCM and the drink. This gradient should allow energy to flow back from the PCM into the drink.
Its „Temperfect insulation“ is most likely a PCM i.e. a phase changing material storing heat in a phase transition. It absorbs or releases heat depending on the outer temperature by means of a physical phase transition (not sure if this is really liquid-solid but perhaps a crystal reconfiguration).
Sigh, anywhere I can buy this for my wife and I in Australia? The shipping for 2 cups is $60 USD, and it all totals out to something like $250 AUD which is completely unjustifiable.
Insulated keep cup on display at any cafe is around $15-25 AUD.
> The formula looks at the variables below, and then spits out a "number" for every Googler. Each PA VP gets a % to cut, and as such there is a threshold. Anyone below that threshold gets RIF'd.
Variables are:
1) Location of labor. US Premium Plus was largely impacted versus cheaper areas.
2) Tenure and performance in level.
3) "Runway" of comp. (e.g. base salary vs MRP. eg. .8 of MRP Googlers have a long runway, vs 1.x of MRP Googlers are basically top of band, and 'tenured' with no runway except promo
4) Promo velocity
Anyways, I didn't understand the acronyms so I decided to feed it to GPT and it definitely made it easier to understand:
Google is using a formula to determine which employees will be laid off (known as RIF: Reduction in Force)
The formula takes into account various factors such as location of labor (with US Premium Plus areas being more heavily impacted), tenure and performance in the current level, "runway" of compensation (the difference between base salary and maximum potential salary), and promo velocity (how quickly the employee has been promoted within the company)
This formula calculates a "number" for each employee based on these factors
Each Product Area Vice President (PA VP) is given a percentage of employees they must lay off
Employees with a score below a certain threshold, determined by the formula, will be laid off
I'm not the GP, so I don't get to make that call. If they say no that's the end of the story. It's frustrating, but ultimatly just how it is.
There's no possibility of a second opinion either because I'm really damn lucky to even have access to a GP, the waiting list for one is ~3-4 years long right now if you don't already have one.
That's crazy. Where do you live? In Poland I just skipped the insurance system to get ADHD meds and went to a psychiatrist specialising in ADHD privately - $70 for a 20 minute visit seems a bit steep but it's better than waiting years.
No, that's impossible. I live in a Canadian province where the provincial healthcare situation is very, very bad.
There are no private doctors and private psychiatrists are not legally allowed to perscribe. ADHD medication is controlled so only NPs, GPs, and (I think) psychologists are permitted to write a script for it.
Basically there are no options for me except the ones I have already taken, short of moving to a different province thousands of kilometers away.
Can they prescribe non-stimulant ADHD medications? I imagine those are less-strictly regulated.
My previous psychiatrist said he's had some luck with patients on stimulants lowering their stimulant doses and adding a non-stimulant treatment like Strattera, but his patients rarely had success stopping all stimulants and taking only Strattera. That's just one docs opinion, but having been treated for adhd for 15 years, it doesn't surprise me.
So, consider yourself lucky you don't already need stimulants to get by. Some of the newer non-stimulant options may be effective for you, and you won't have to deal with the "druggy" aspect of being on stimulants for work. Stimulants can seriously affect your life, both positively and negatively. You might be able to get things done that you never would have done before - I felt like I was finally able to compete at a normal level when I started - but you might retreat from society at the same time, be less interested in spending time with loved ones or building relationships, and then there's all the short-term side-effects like trouble sleeping or losing interest in eating.
Basically my experience has been a double-edged sword and it's bittersweet. For every way that it's benefited me, ADHD meds negatively affect me in some other way and it's hard to quantify the net balance.
> So, consider yourself lucky you don't already need stimulants to get by.
I wish that were the case, I've been heavily "abusing" Redbull and Claritan-D (non-drowsey with sudafed, I found this helped purely by accident a few years ago) for years just so I can barely function enough to hold down a job. It's probably part of why my blood pressure is so bad in the first place.
I have to put literally all the energy I have into work, by the time 1700 rolls around I have no energy left to give for anything, I just crash. Most nights even getting supper is a huge ordeal, much less anything else.
Non-stimulant drugs might be an viable option, I haven't inquired about that yet, but I intend too.
I apreciate you giving a small window into what the medication has been like for you. How it would affect me and how I'd change on it has been one of my main concerns should I somehow actually get perscribed anything. At this point I'd try anything because the older I get the less sustainable this all becomes.
Medical tourism is an option too, I think. If you visited a doctor in another country, and obtained a prescription, you'd be allowed to bring it with you back to Canada, right?
> you'd be allowed to bring it with you back to Canada, right?
You’d never be able to get a foreign prescription filled in Canada, federal and provincial regulations forbid that. Brining medicine back would be fine, but then you can’t get more without an expensive flight again.
If I lived near the US border I’d just get an American doctor and get prescriptions filled in America, but I’m nowhere even remotely close to the border.
How are you not informed in advance? Every job I've had, there's a contract I sign in advance with all terms, and no addendum on day one. I'd think you could refuse to sign an addendum, and even sue for promissory estoppel if they fire you for not signing.
Yes, a lawsuit aimed at a big corporation will be surely at the fingertips of everyone who is forced by circumstances to sign such clauses.
Let's be real, most people will sign whatever is presented to them on day 1 of their new employment because they need money now. They could refuse to sign, in which case they will be shown the door and encouraged to seek opportunities elsewhere.
That in 4 years time they might've won a legal battle they can't afford is little consolation when they won't be able to make rent now.
Nevermind that once they are in a legal battle, they'll have great difficulty being hired again.
Please don't take offense, but the level of disconnect shown on HN from the prospects and struggles of an average person is sometimes staggering.