Friday 14 July 2023

Collation of livetime (liverc) results for a user

I race little toy cars for plastic trophies! 

In all, i've got 6 RC cars. Not just your average kmart, warehouse, wallmart put some AA batteries in and watch them crawl along at a top speed of "walking pace", no way.

My 1/10th on-road car will do at least 60km/h (38mph) down our back straight, and it's 1/8th big brother will do something like 80-85km/h (50mph-ish). Some of our club members have cars, on our 85m back straight, will top 109km/h... impressive right!

Our results are collected via a transponder system from mylaps, everytime our cars passes over a wire, the transponder communicates with the timing computer and it logs its lap. 
Now this is where my problem started.... 

The results were hard to read on the website. All the data was there but it was hard to compare your first qualifying round to the second and then to your finals, because they showed on different pages. Therefor you needed lots of tabs open if you didn't want to go back and forth.

Initially i started writing this in PHP, i have a server that is always on the internet, so i just lodged it as part of my site. Using a fetch routine, i would go and get the page that had results on it, and then parse the page, looking for the results, collate them and then just show all the results in one hit. It wasn't the most elegant thing, but it worked. 

As you can guess i ran into a few problems, but i got there in the end. 

With that done, my thought was that now every time someone wanted to use this, my server was the one fetching all the results, and that could be quite taxing on page responses. 

So idea 2 then came to mind, lets write this in Javascript! The server would serve up the site, and the javascript would essentially do all the heavy lifting locally, it would be more or less like the user was browsing the site as it was coming from their computer. 
Ran into lots of issues here, the big one was CORS or Cross-origin resource sharing. Basically i couldn't grab the site locally then serve it up to you. This is pretty much how scammers work lol. 

I had been talking to a friend at work randomly about being able to get data from pages that didn't have any sort of API. He had recently come across a project that turned any website into an API! In walks wrapAPI!

So this ended up being magic, wrote the whole thing out to be just fetch and parsing data. 

Work pivoted for me, and i started working with react, which mean't i needed a project to work on, so i thought i would further refine this tool to be written in react, javascript worked, but it was very cumbersome.

Anyhow - long story short, i got practice with react, racers at our local clubs now get to enjoy a tool that shows all their race data in one hit, not having to have multiple tabs open, everyone wins!

Check out my collation tool

Wednesday 31 May 2023

Slow speed using Evoluent mouse with linux mint 21.1

Recently i installed a fresh copy of linux mint 21.1

I've got a nice new 4K monitor that someone donated to me, which then hooked up to another donated PC fitted with a Nvidia 1060 6GB GPU nicely. 

While that's not impressive, it is for me. I always get the hand-me-downs, which is why i like running linux so much as these machines are always fast, they just out perform windows even when being old. 

Anyhow, i also have a nice Evoluent Vertical 4 Mouse, This mouse is great if you have some OOS (occupational over use syndrome). Stemming from my Cad days this mouse really saved my wrist from horrible all day pains

So with my 4K monitor, i scaled the 4K image up 200%, so both monitors were approx the same resolution. However the mouse point was slow. 

Even with the speed sliders at full, it was a real slog to try and get the pointer from one screen to another.

I thought it was something to do with the scaling that i had done with the driver, but when i tried another mouse, i didn't see the same effect, therefor leading me to assume that it was something special with this mouse. 

I found a great post in the end about increasing the mouse sensitivity. trying this out proved to be the fix that i needed. 

To see the current settings, use:

xinput --list-props "HOLTEK Evoluent VerticalMouse 4" | grep -i 158

Then to try new settings use: 

xinput --set-prop 8 158 2.000000 0.000000 0.000000 0.000000 2.000000 0.000000 0.000000 0.000000 1.000000

According to the post, the values you want to be tweaking are the two "2.00000" from the above command. These are the X and Y axis respectively 

Once i found mine, as suggested, i popped this into my ~/.bashrc, so that everytime the computer reboots, it will set the values i want.

Now.. where is my coffee....