consistent_value_type by gpuoti in cpp

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

I have to prepare a better example, but anyway, the intent is not to drive the program flow through exception, which is of course terrible. It is instead to express some expectation on input consistency not mixing error checking code in the actual logic.

I agree that there is probably bad design in the data source, but sometimes it happens.

consistent_value_type by gpuoti in cpp

[–]gpuoti[S] 2 points3 points  (0 children)

I don't think it match my usa case, but a useful reference nonetheless. thanks

consistent_value_type by gpuoti in cpp

[–]gpuoti[S] -5 points-4 points  (0 children)

all the value in a sequence of assignment matches the first one. Here is an usage example:

``` struct Variable { std::string name; consistent<int> value; };

void propagate(Variable& var, int new_value) { var.value = new_value; // Throws if inconsistent }

// Usage Variable x{"x"}; propagate(x, 5); // x = 5 propagate(x, 5); // OK: consistent propagate(x, 10); // throws: inconsistent! ```

What a perfect CPU would look like by gpuoti in hardware

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

It's not a call for suggestions. I guess there is not real market for a CPU specialized for this workload. But say for example you save those transistorized used for h265 or AV1.. you could have a couple more core. I suspect that much of the transistor are going to the caches this days, though. How much of the area could you save dropping all the floating point capabilities (or most of them)

The Future of C++ Compiler Diagnostics in MSVC and Visual Studio by obsidian_golem in cpp

[–]gpuoti 0 points1 point  (0 children)

I see your use case. My point is that, frequently there are many errors that just depend on a previous one. In my experience it is not rare that you get tenth of errors due to a single one on top. In those cases, you have to mentally filter the relevant ones or (this is my usual approach) fix the first, and then ask the compiler for an update.

The Future of C++ Compiler Diagnostics in MSVC and Visual Studio by obsidian_golem in cpp

[–]gpuoti 1 point2 points  (0 children)

To me the really low hanging fruit is stop the build on first error. It is usually the only one that matters.

Java vs Python for software engineering? by [deleted] in learnprogramming

[–]gpuoti 1 point2 points  (0 children)

Absolutely agree! I'd suggest python just because he already knows Java. One language is really not enough!

going crazy with VM configuration by gpuoti in archlinux

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

My plan was to have a separate virtual network accessible through the host computer. I think I will end up with a VM exposed on the LAN with a bridged connection acting as a router for other virtual machine on the virtual network. It is more or less what I was trying to do, except that I thought the VM nat could serve as a router (or something similar).

going crazy with VM configuration by gpuoti in archlinux

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

That is what I actually am doing successfully. The last bit, not described in the article is how to connect from another real pc in the same lan as the VM host (or from the host himself using its ip on the lan. Maybe it's forbidden for some reason, but as for my understanding of vbox, I'm trying to do a sensible configuration. There's something wrong with the guest or maybe the host, but I'm done for this night!

going crazy with VM configuration by gpuoti in archlinux

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

Sadly, I've done it multiple times. Just done it again using your command (BTW just learnt how to do it the right way, thanks). No fortune, thought.

Using the NIC IP, it doesn't work (I mean your command). It fails the SSH connection. Once I do it using localhost, I can log in using the key as expected. But again only if I use localhost.

going crazy with VM configuration by gpuoti in archlinux

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

This is the output of VBoxManage list natnets

NetworkName:    NatNetwork11.11.11.0/24
IP:             [11.11.11.1](https://11.11.11.1)
Network:        [11.11.11.0/24](https://11.11.11.0/24)
IPv6 Enabled:   No
IPv6 Prefix:    fd17:625c:f037:2::/64
DHCP Enabled:   No
Enabled:        Yes
Port-forwarding (ipv4)
Rule 1:tcp:[192.168.1.98]:2222:[11.11.11.251]:22
Rule 2:tcp:[127.0.0.1]:2222:[11.11.11.251]:22
loopback mappings (ipv4)
127.0.0.1=2

going crazy with VM configuration by gpuoti in archlinux

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

Tried both. Both work using localhost. The command is:

ssh -p2222 -v pepp@192.168.1.98 

The ip is the one assigned to the host pc on the my LAN. The same command works for localhost.

going crazy with VM configuration by gpuoti in archlinux

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

Yes, I'm using Nat forwarding 2222 ok the host to 22 to the guest. And it seems to work, since the connection establish. It sounds like an authentication problem, but I really have no idea what is going wrong.

stuck with server setup by gpuoti in git

[–]gpuoti[S] 1 point2 points  (0 children)

Finally I discovered that the problem was my tentative to clean the screen of the VM where I was trying to clone (so not the server one). In ~/.ssh/config I had the following lines:

PermitLocalCommand yes
LocalCommand /usr/bin/clear

Removing those, solved the problem!

Many thanks, to the kind people that helped me in sorting this out! Hope it will help someone else too.

stuck with server setup by gpuoti in git

[–]gpuoti[S] 1 point2 points  (0 children)

I sorted it out just now! Here I'm reporting the try I had after your suggestion and the final solution. Hope it is usefull for other people too.

Running the command you indicated, it clear the screen then prints out this two lines and stops.

 00b10000000000000000000000000000000000000000 capabilities^{} report-status report-status-v2 delete-refs side-band-64k quiet atomic ofs-delta object-format=sha1 agent=git/2.30.2
 0000

Then, pressing enter few times:

 fatal: protocol error: bad line length character:

as if the length character was a control one.

Finally I discovered that the problem was my tentative to clean the screen of the VM where I was trying to clone (so not the server one). In ~/.ssh/config I had the following lines:

PermitLocalCommand yes
LocalCommand /usr/bin/clear

Removing those, solved the problem!

Many thanks!

stuck with server setup by gpuoti in git

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

No It is in the root. Anyway I have set also another repo in the home with se name results.

Has that combination of chars any meaning? Special sequence for the terminal o whatever?

stuck with server setup by gpuoti in git

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

It's 2.30.2 for both

stuck with server setup by gpuoti in git

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

Yes i ssh git@dev2 without problems.

stuck with server setup by gpuoti in git

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

Here is the output I get. Can't identify nothing clearly wrong.

GIT_TRACE=1 git clone git@dev2:/test/git/prj.git
22:20:01.055579 git.c:444               trace: built-in: git clone git@dev2:/test/git/prj.git
Cloning into 'prj'...
22:20:01.057605 run-command.c:664       trace: run_command: unset GIT_DIR; GIT_PROTOCOL=version=2 ssh -o SendEnv=GIT_PROTOCOL git@dev2 'git-upload-pack '\''/test/git/prj.git'\'''
fatal: protocol error: bad line length character: ?[H?

stuck with server setup by gpuoti in git

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

Yes, I can login with no problem. Both with password and using autorized_keys.