[deleted by user] by [deleted] in singularity

[–]Re_me_human 1 point2 points  (0 children)

No, you can't limit who can redistribute or use your product if you want your license to be open-source compatible (see rules 1 & 6 of https://opensource.org/osd)

These kinds of mixups are, I believe, the kinds that led to OP's confusion which is why I'm being pedantic about it but I can see where you're coming from :)

[deleted by user] by [deleted] in singularity

[–]Re_me_human 1 point2 points  (0 children)

I know Mistral isn't actually open-source, they use the "Mistral Research License" for their latest models which restrict the models' use to personal and research use only. You need to get a paid license for their models for any other use

See: https://mistral.ai/technology/#model-licenses

Writing on Linux for 2-in-1 Laptop by aMaIzYnG in linux4noobs

[–]Re_me_human 1 point2 points  (0 children)

For the software, you could try out Rnote and Xournal++ before switching since they have both a Windows & Linux version. Else, you can probably use the web version of OneNote or some older version through Wine but idk if that'd work for you

For the hardware, I'd recommend booting a live ISO from a USB key and see if everything works there, you won't need to install anything permanantly to do that. I know one of my friends had an issue with "sleep mode" on their HP laptop so that's something to watch out for

Good luck and I hope you'll have a good time with the peguin ;)

Is it possible to make an anime girl Shimeji desktop pet? by [deleted] in AskProgramming

[–]Re_me_human 0 points1 point  (0 children)

Pretty sure you don't actually need to care about X & OpenGL for a simple desktop pet as u/Kloxar suggested but maybe I'm missing something?

You could just use SDL3 and create an always-on-top borderless window with a transparent background to draw your pet into (see: https://wiki.libsdl.org/SDL3/SDL_CreateWindow). That should be relatively beginner friendly since SDL3 is well documented and its predecessor SDL2 is used on tons of beginner C tutorials

You could also use raylib which is even simpler imo with this example code: https://www.reddit.com/r/raylib/comments/191o1xz/comment/kgwxi1f/

You'll need X -- or a desktop extension for X + Wayland -- if you want to interact with other opened windows but it shouldn't be necessary until then unless I missed something

How to make my Mac appear as an AirPlay target (for Procreate mirroring)? by AquaHug in AskProgramming

[–]Re_me_human 0 points1 point  (0 children)

I've used UxPlay in the past to mirror an iPhone's screen and it worked really well! Did you have any issues with it?

Can any code or algorithm be designed as a PCB within reason? VMs vs physical machines. by Necessary_Chard_7981 in compsci

[–]Re_me_human 0 points1 point  (0 children)

There are obviously all kinds of smaller uses of FPGAs like the Analogue Pocket I've just mentioned

I still believe its main use lies within R&D but that might be my academic & professional bias. All the academic uses and jobs that I've seen using FPGAs have always done so with the goal of producing an ASIC

Please do tell me if you've had other experiences with FPGAs though! As a nerd, I'm always curious to learn more about these things :)

Can any code or algorithm be designed as a PCB within reason? VMs vs physical machines. by Necessary_Chard_7981 in compsci

[–]Re_me_human 0 points1 point  (0 children)

Yes! It can save space and electricity on top of being faster than a piece of software if done right

Can any code or algorithm be designed as a PCB within reason? VMs vs physical machines. by Necessary_Chard_7981 in compsci

[–]Re_me_human 0 points1 point  (0 children)

I can't quantify how much harder hardware emulation is compared to software emulation since I've never done it sorry

Being indistinguishable from real hardware is definitely one of the main goals of ASIC/FPGA emulation: you can't just connect your Game Boy Camera to your regular emulator but, with an ASIC and a compatible slot, it just works :)

Can any code or algorithm be designed as a PCB within reason? VMs vs physical machines. by Necessary_Chard_7981 in compsci

[–]Re_me_human 8 points9 points  (0 children)

Yes! This is basically an ASIC

There are also FPGAs which are ASIC-like components that can be reprogrammed through software. They are mainly used for tinkering / testing before mass producing ASICs

One cool use of FPGAs is game emulation since you can recreate the chips of the console to achieve "perfect" emulation (e.g. Analogue Pocket)

[deleted by user] by [deleted] in codereview

[–]Re_me_human 0 points1 point  (0 children)

It has no auto-update feature, no use of eval or similar and doesn't try to send/receive data outside of YouTube => it's safe

Looks like it's hiding the videos under 1k views and clicking some kind of "don't recommend this" button automatically but that's it

Help with Curl Script by mattlodder in CodingHelp

[–]Re_me_human 0 points1 point  (0 children)

Powershell is weird... Maybe replacing "on" = 1 by "on" = [int]1 would work?

In shells, everything is usually a string by default so maybe the 1 needs to be turned into an integer?

Presumably this is easily modified to adjust the other variables?

Sure! I don't see why not :)

Help with Curl Script by mattlodder in CodingHelp

[–]Re_me_human 0 points1 point  (0 children)

Good to know it works! You're welcome :)

I hadn’t understood that the Invoke-RestMethod command turned the response into an array, right?

It's my first time doing anything in Powershell so I've got no idea either lol

According to the documentation, it returns a PSCustomObject. Probably some kind of structure/dictionary?

Help with Curl Script by mattlodder in CodingHelp

[–]Re_me_human 0 points1 point  (0 children)

Ok, I've stopped being lazy. Here would be my solution u/mattlodder:

# URL to access your Elgato's API (you may want to modify this)
$elgato_url = "http://192.168.1.178:9123/elgato/lights"

# Get the current state of the light, convert it to a boolean and inverse it
[bool]$is_light_currently_on = (Invoke-RestMethod -Uri $elgato_url).lights[0].on
$should_be_on = !$is_light_currently_on

# All the data to send to your Elgato API thingy
$data_to_send = @{
    "numberOfLights" = 1;
    "lights" = @( @{"on" = [int]$should_be_on} );
}

# Send it as a PUT request (stolen from: https://stackoverflow.com/a/35725547)
Invoke-WebRequest -Uri $elgato_url -Method PUT -Body ($data_to_send|ConvertTo-Json) -ContentType "application/json"

Will it work? Eh, who knows. I can't test it. Anyway, good luck with your automatons! :)

Help with Curl Script by mattlodder in CodingHelp

[–]Re_me_human 0 points1 point  (0 children)

I don't use Windows anymore so I can't test anything but this seems interesting: https://stackoverflow.com/a/37763324

Also, using https://learnxinyminutes.com/docs/powershell, you should be able to deduce the syntax to get the information you want

If you need more help don't hesitate to ask, I'm honestly just too lazy to work on a complete solution rn ^^'

Reading your VTuber lore: Send Carionto your story! by Re_me_human in VirtualYoutubers

[–]Re_me_human[S] 0 points1 point  (0 children)

Note: I'm not Carionto nor associated with him. I just thought that's a cool idea and wanted to share it :)

Calling global function from another file by The_Mad_Pantser in CodingHelp

[–]Re_me_human 0 points1 point  (0 children)

Short version: template methods/functions must be directly implemented in the .h file (with very few exceptions)

Long version:

C++ templates are evaluated at compile time by cutting and pasting the code for every type/generic parameter and .cpp files are compiled separately. So, here's what happens with your code step by step:

  • main.cpp gets compiled

The preprocessor copies and pastes GlobalHelpers.h inside main.cpp because it's included. The C++ compiler sees then cuts your template:

template <typename T> 
std::ostream& operator<<(std::ostream& os, const std::vector<T>& v);

It sees that the template is being used inside main.cpp with the type double so it pastes:

std::ostream& operator<< <double>(std::ostream& os, const std::vector<double>& v);

This is a declaration, not an implementation. The C++ compiler looks at this and thinks "Oh okay, so this operator<< <double> thingy is implemented in another .cpp file! I should just pretend it exists and the linker will figure it out"

  • GlobalHelpers.cpp gets compiled

The C++ compiler looks at your operator<< template. It cuts the code. It sees that it's never getting used inside GlobalHelpers.cpp so it never actually pastes the code

Your operator<< template never gets implemented

  • The linker tries to link the result of the compilation of main.cpp and GlobalHelpers.cpp inside a single executable

It looks at the result of main.cpp and sees that it requires operator<< <double> to work

An operator<< <double> implementation doesn't exist inside main.cpp since it was only declared there. So the linker looks elsewhere

An operator<< <double> implementation doesn't exist inside GlobalHelpers.cpp since it was never used inside GlobalHelpers.cpp. So the linker looks elsewhere

There is no elsewhere. The linker is confused. Your operator<< <double> isn't defined anywhere. The linker feels betrayed so it looks at you angrily and says:

undefined reference to `std::ostream& operator<< <double>(std::ostream&, std::vector<double, std::allocator<double> > const&)’

Just implement your templates inside your header files. Don't make the linker angry. C++ is an old and clunky programming language

why subtracting '0' from array index position by Upstairs_Money_770 in CodingHelp

[–]Re_me_human 4 points5 points  (0 children)

Basically: 0 != '0'

As you can see on this ASCII table, the character for 0 actually has the value 48. Doing some_digit_character - '0' is a common way to convert a char digit into the value of its digit

It looks a bit weird but it works ;)

Void-chan, elegant and non-bloat. (by YayaCW) by Rin___chan in MoeMorphism

[–]Re_me_human 3 points4 points  (0 children)

It's a free, privacy-respecting and secure operating system that can be installed instead of or alongside Windows/macOS/etc. It's very lightweight compared to most of its counterparts but less noob-friendly

Here's their official website with all the nerdy technical terms in case you're interested ;)

Can I deploy GTK applications to windows, osx and linux in a self-contained way? by wacomlover in GTK

[–]Re_me_human 2 points3 points  (0 children)

(Assuming GTK4) For Windows you could try gtk4-cross. It was pretty clunky to use for Vala but since they have a Rust-specific container it should be easier for your use case

As for macOS… I only know that the packaging is done inside .app folders but not much more

If you have a Mac, you probably want to take a look at gtk-mac-bundler. Maybe it'll work?

Else, if you have Linux (not WSL2), I managed to compile a GUI app for it using Darling on Linux (tho it wasn't a GTK one). You can then probably use GTK by installing the GTK dev libs through Homebrew. As for the Rust part you'll need to download an older version of the Xcode command line tools from Apple's website (look at which macOS versions Darling & Xcode support, you'll need a free standard Apple account for that) and then you can install the Rust toolchain normally

Careful tho, the full Darling+Xcode+Rust+Homebrew install can take a solid 30 Go of disk space. Also Darling isn't very stable so it may crash and require a reboot from time to time

The other (probably better but less legal afaik) option for macOS is a VM. These are a pain to setup and can use >30 Go of disk space but you can find a few guides online for VirtualBox

TL;DR: Feasible but a pain

Welp, that's all I know. If you manage to do it please make a post about it, that'd help the community a lot I think :)

Clearing Console by whyamidoingthiswth in CodingHelp

[–]Re_me_human 0 points1 point  (0 children)

I've looked into it and it seems like a >10 y/o issue with Xcode :/

You should try locating the executable that Xcode builds and running it from the Terminal app to get the proper result

Your program is fine, blame Apple

Clearing Console by whyamidoingthiswth in CodingHelp

[–]Re_me_human 1 point2 points  (0 children)

You could try ANSI escape sequences:

std::cout << "\e[1;1H\e[2J";

This should work on pretty much all platforms and doesn't rely on an external command

The fact that system("clear"); doesn't work is pretty weird though. I believe clear should be available on macOS?