|
That is why Java will only let you use final “variables” for anonymous inner classes.
Does StartTestConvert() receive by value/copy or by reference? ( Does it matter?)
I would tend to wrap some of this into a class. I have moved in the direction of hiding threads/locks/async/await etc as much as possible from the client code.
new Runner(i).launch();
|
|
|
|
|
int n = i;
Amazing solution from an amazing language to cut the code clutter delivered to you by the Cool Kids on the Codeblock!
|
|
|
|
|
From the good, old K&R C bible:
A for that does not include a continue:
for (e1; e2; e3)
Block;
is equivalent to:
e1;
while(e2)
{
Block;
e3;
}
Replace e1 with (int i = 0;) and it will become clear what is the scope of i, and why it will have value 11.
All subsequent languages like C++, java, C# etc. follows the same logic, since nobody dares to change what DMR (may God rest his soul in peace) has ruled.
|
|
|
|
|
ChatGPT explained this to me. I feel bad that I couldn't figure this one out
Question to ChatGPT:
In this example c# code "i" can equal 11. can you fix it?
for (int i=0; i <= 10; i++)
{
var task = Task.Run(async () =>
{
var convertResp = await StartTestConvert(i);
... other stuff
});
}
Response:
Yes, in the provided code, the variable i is captured by the async lambda expression, which means by the time the async operations inside the lambda complete, the value of i may have changed. To fix this, you need to capture the loop variable correctly. Here's a way to do it:
for (int i = 0; i <= 10; i++)
{
int current = i;
var task = Task.Run(async () =>
{
var convertResp = await StartTestConvert(current);
});
}
By capturing the loop variable inside the loop, you ensure that each async operation receives its own copy of the loop variable, preventing the issue where the value of i changes before the async operation completes.
|
|
|
|
|
I just had a conversation with ChatGPT about the topic. It was interesting that I was asking it questions about some specifics about what it was explaining and it did not fall over into a "I'm sorry, 2 plus 2 does equal 5" type of conversation. That has happened a lot to me in the past when trying to understand something.
|
|
|
|
|
I will continue to utilize my logitech but perhaps some here will find this useful.
Coolest mouse ever[^]
|
|
|
|
|
I'm not sure about the 'coolest' part... probably there is some heat involved...
"If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization." ― Gerald Weinberg
|
|
|
|
|
I wonder who will be the first.
GCS/GE d--(d) s-/+ a C+++ U+++ P-- L+@ E-- W+++ N+ o+ K- w+++ O? M-- V? PS+ PE Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
The shortest horror story: On Error Resume Next
|
|
|
|
|
I have to imagine it somehow has the smarts to know when your finger is leaving your desk so for example you scratch an itch, or start typing, or write something down on a piece of paper. Otherwise the pointer constantly trying to follow you will get really annoying, really fast.
Especially if the solution is to temporarily take it off.
Hard to tell from 17-second video (preceeded by two unskippable 15-second ads, thanks YouTube).
|
|
|
|
|
dandy72 wrote: preceeded by two unskippable 15-second ads, thanks YouTube
Isn't it fascinating that the company chooses to host the video on YouTube instead on its own web server? Like they try to monetize their own ads (not really)...
(I use FF with uBlock Origin - no YouTube ads)
"If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization." ― Gerald Weinberg
|
|
|
|
|
one of the co-founders here. Besides other sensors, the ring has also a camera and an 8-core parallel processor. So it recognizes different situations and objects like a keyboard and pauses. When your hand goes back to the desk, the 'mouse' works immediately. If you want to make sure it's off, just rotate your hand accordingly.
Will post soon more videos of our currently running preview sessions where people experience these things first hand.
Sorry about the ads, we cannot disable them on YouTube. You are right, we will need a better solution.
|
|
|
|
|
mspad wrote: a camera and an 8-core parallel processor
In a standard, finger-sized ring? Is that overkill, or necessary? How hot does it get? And I would imagine it needs a battery.
Either way...color me intrigued, I'm definitely keeping an eye out for this.
Has anyone thought about what might be possible with multiple rings working together?
And...scrollwheels are now a must for me. Any emulation for that? I would imagine the most natural thing would be to make up/down gestures with the middle finger.
|
|
|
|
|
I guess we all love a very responsive 'mouse'... so running a few neural networks for every mouse update requires definitely an 8-core. Fun fact, we started out with an ARM-M4 dual core and it was too slow but also way too power hungry. It's absolutely amazing how power-efficient these edge chips got! The ring gets mildly warm but certainly not as much as you would expect from such a powerhouse.
Our ring lives on the index finger and also senses what's going on with your thumb, middle finger, any keyboard in proximity, etc. That's also necessary for e.g. scrolling. It's the same gesture as on a trackpad: move your index and middle finger up and down on the desk.
|
|
|
|
|
Does it work in the dark?
|
|
|
|
|
nope, the ring requires some ambient light. Also, pointing a very bright light directly into the camera will make it hard for the ring...
|
|
|
|
|
|
Could you paint a Green Lantern logo on the top? Do you have to charge it once every 24 hours? Could they get Ryan Renolds to do their ads?
I’ve given up trying to be calm. However, I am open to feeling slightly less agitated.
I’m begging you for the benefit of everyone, don’t be STUPID.
|
|
|
|
|
MarkTJohnson wrote: Could they get Ryan Reynolds to do their ads? I kind of doubt he'd be willing to do it.
Software Zen: delete this;
|
|
|
|
|
How do you right click? (You know, the context menu?)
|
|
|
|
|
|
If this thing is smart enough that I could use this without moving my hand off the keyboard, then great. But as others have mentioned, not sure how this will work when I scritch and itch.
|
|
|
|
|
From the site : "As soon as your index finger touches the table, the mouse pointer starts following your fingertip. When you lift again your fingertip to scratch or pick your nose, the mouse pointer stops moving."
|
|
|
|
|
And how it knows that I'm touching the table and not my face or the keyboard? The video is way to short, like they afraid to show a full work environment...
"If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization." ― Gerald Weinberg
|
|
|
|
|
Marc Clifton wrote: use this without moving my hand off the keyboard
I didn't even think about this. That'd be neat.
OTOH, if you need to click, while your hand is still resting on a key...how do you do that?
|
|
|
|
|