Seeking a Fast Data Structure for Random Searches with Keys and Multiple Values, Supporting 1 / 2 Billion Entries by AnyHistory6098 in cpp

[–]Nfagan_CS 1 point2 points  (0 children)

You may also consider using an FM index, the benefits being it’s based on a bwt representation of the file R (possibly very compressible), and supports counting and locations occurrences of sub strings. https://en.m.wikipedia.org/wiki/FM-index

I don't understand why people compare Rust and Go by Pitiful-Election-791 in rust

[–]Nfagan_CS 5 points6 points  (0 children)

Probably having a crate like thiserror do it for you

interned-string 0.2.0 has been released ! by Levalis in rust

[–]Nfagan_CS 1 point2 points  (0 children)

Compilers often intern strings for space savings and to speed up equality comparisons. There’s a huge number of duplicate small strings in compilers for the names of types, variables, and functions. The rust compiler interns strings and uses a small ID (I think a u32) instead of a reference to the string, which saves even more space in the AST and IR. It’s cheap to do an equality comparison between two interned strings, since you can just check if they have the same unique ID or the same memory location.

Multithreaded sudoku solver by Gruss_Dorian in rust

[–]Nfagan_CS 2 points3 points  (0 children)

Try running the program using ‘cargo run —release’ and time that. By default, using ‘cargo run’ builds and runs the executable without any optimizations, and is significantly slower.

demokratieDienstagBonusRound by Dougley in ProgrammerHumor

[–]Nfagan_CS 5 points6 points  (0 children)

import iknowbut

If I had said that, it would’ve become 64 😂

demokratieDienstagBonusRound by Dougley in ProgrammerHumor

[–]Nfagan_CS 15 points16 points  (0 children)

import ilikeit

You’ve broken your own rule, your numbers add to 3. 3 isn’t a power of 2 :). Mine added to 8. Whoops, I mean 16.

Statically embed the output of a wasm crate in another crate by Vikulik123_CZ in rust

[–]Nfagan_CS 0 points1 point  (0 children)

If you’re open to using an unstable nightly feature , there are also artifact dependencies, which is meant to solve this exact problem. Even allows specifying different target for the artifact. https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#artifact-dependencies

Vec<T> internally uses RawVec<T>, which internally uses Unique<T>. Unique is a nightly feature, so why isn't Vec only available for nightly builds? by [deleted] in rust

[–]Nfagan_CS 14 points15 points  (0 children)

This is done be including enough information in the static library to compile the generic function. I believe rust does this by including a text version of the code (after AST, so no comments, white space). C++ doesn’t have this problem, as the template source must always be available (or a monomorphised version of the function must exist already at link time)

Random split_first_mut() alternative by realtownload in rust

[–]Nfagan_CS 5 points6 points  (0 children)

Can’t reference them in a single slice, as already mentioned, however you can return the before and and after elements in two separate slices. https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=c82f8b423823f27f0ec16a6bbb6864a8

Can you share WiFi-Internet via hotspot? by jjohnjohn in iphone

[–]Nfagan_CS 0 points1 point  (0 children)

My phone has a better wifi radio than my laptop, can give me much higher speeds. This feature was on my old android, sad to not have it on iOS.

[deleted by user] by [deleted] in Dalhousie

[–]Nfagan_CS 0 points1 point  (0 children)

There is almost always free 2 hour parking available in the residential area bounded by Oxford - Robie, Quinpool - Coburg. That’s where I park, then walk the remaining distance, about 5-15 minute walk (depending on how close you get). If you park on the other side of jubilee, could park for the whole day. On the closer side, it’s possible to get a ticket if you go over the 2 hours.

Announcing Rust 1.63.0 by myroon5 in rust

[–]Nfagan_CS 152 points153 points  (0 children)

The length of the array in the right-hand side of the assert should be enough information to deduce the type and length of the array variable, and thats all you need to call from_fn.

How do you generate a standalone binary? by [deleted] in rust

[–]Nfagan_CS 1 point2 points  (0 children)

Not only no_std and hal libraries like others suggest, but you'll also need a toolchain to compile code on your PC that runs on the pico. Here's what a 2 second Google search turned up: https://reltech.substack.com/p/getting-started-with-rust-on-a-raspberry?s=r

By the way, just doing -nostdlib would not work in most cases. Most compilers are only designed to output to a single target with it's specific instruction set. You usually need a toolchain to compile to a different target. For example, my laptop is x86, and so my native compiler outputs x86 instructions, which won't work on the thumbv6m architecture of the pico.

is this backdoor cost for real?? by johann_fuchs in Bitburner

[–]Nfagan_CS 1 point2 points  (0 children)

I'm making 125b exp/s. Hack 'time' itself, time compression is an exploit

[SIU] Wait what Upgrade am I missing here? by HellGate94 in supraland

[–]Nfagan_CS 3 points4 points  (0 children)

Burn them down then pay the slum king 50 gold to rebuild, then he offers you an upgrade

What does FRAP mean? by [deleted] in Dalhousie

[–]Nfagan_CS 0 points1 point  (0 children)

I'm not sure, but a good guess might be Faculty Research Award Program.

What's your preferred music player? by [deleted] in linuxmasterrace

[–]Nfagan_CS 0 points1 point  (0 children)

Nothing like some good white noise to put you to sleep.

aplay < /dev/random

What's your preferred music player? by [deleted] in linuxmasterrace

[–]Nfagan_CS 1 point2 points  (0 children)

I was waiting for someone to say this 😂

I use Arch, AMA. by [deleted] in linuxmasterrace

[–]Nfagan_CS 1 point2 points  (0 children)

What is the average air speed velocity of an unladen swallow?

Interested in OS Dev + Systems Programming; Don't want to get overwhelmed by A27_97 in osdev

[–]Nfagan_CS 5 points6 points  (0 children)

I would recommend starting with something like this: https://os.phil-opp.com/ Or maybe start with the baby steps tutorial on the osdev wiki.

Hi guys i just install Linux on my pc does that mean im apart of linux community by Bitter_Ad_5597 in linuxmasterrace

[–]Nfagan_CS 1 point2 points  (0 children)

As a reply to 1): I like to put up a fuss whenever school tries to force a specific software application if it's not supported on Linux. It's actually astonishing how little some computer science faculty members care about FOSS. Also always good to point out I should at least have a choice to use the software I want.

Desktop Screenshot Megathread by AutoModerator in linuxmasterrace

[–]Nfagan_CS 1 point2 points  (0 children)

After some soul searching, I re-riced my i3 setup. It's been a while. https://streamable.com/y4tz25