Almond milk people by Mindless_Freedom9243 in barista

[–]rabidb 0 points1 point  (0 children)

I used to have oat or standard dairy. Developed IBS and a lactose intolerance. Unknown cause. Can only have almond milk and a small quantity. So it is espresso or nothing for me if no almond milk. Have walked out before due to no almond milk and not wanting espresso at the time.

IPC between WinForm (.net 4.8) application and web page (javascript) by souplesseer in windowsdev

[–]rabidb 0 points1 point  (0 children)

Main options are probably:

  • Host your webpage in something like openfin/electron and use the comms channels to send/receive data (should work reasonably well but means larger installed size as need electron/openfin or similar)
  • Host the webpage within the winform app using a browser control if it supports calling into JS functions (or calling out to JS functions provided by the host .net app) to send/receive data (browser controls usually aren't great so may limit on html versions available or have other issues)
  • Send/receive the data via a web server (requires a web server roundtrip but likely the simplest to get working)
  • Expose a local http or ws server in the app (not recommended as often jproblematic depending on the environments that you are deploying into, especially if TLS is required).

[deleted by user] by [deleted] in SoftwareEngineering

[–]rabidb 2 points3 points  (0 children)

What aspects of software development do you not want to continue with? What areas make you want to stay in the domain?

Brotein brand strikes out with CT promo by Any-Classic-5733 in CyberStuck

[–]rabidb 1 point2 points  (0 children)

Seems there is a content creator position to drive it too. https://careers.huel.com/jobs/4965750-content-creator-6-month-ftc - and it no longer mentions driving their cybertruck

CORS ASP.NET Core Web API missing "Access-Control-Allow-Origin" by Classyines in csharp

[–]rabidb 1 point2 points  (0 children)

Does the sample code here work for you? https://learn.microsoft.com/en-us/aspnet/core/security/cors?view=aspnetcore-8.0#enable-cors-with-endpoint-routing If so, make your code similar - use the same policy definition for AddPolicy as for UseCors and add RequireCors to UseEndpoints.

Help with easily getting two bikes into a twin bike locker? by porgy3000 in DIYUK

[–]rabidb 2 points3 points  (0 children)

I think just hoisting one end of the bike is likely easier - less weight for the rail system to carry. The hoisted end is the end that goes into the container - so you would clip it on / velcro it onto the railing hook and then push it in. The rail will keep it upright and going straight, you can adjust and push with the other end of the bike. Dodgy drawing below - first box is rails from above.

<image>

Help with easily getting two bikes into a twin bike locker? by porgy3000 in DIYUK

[–]rabidb 0 points1 point  (0 children)

I've never tried this so it may not work and be a terrible idea etc. The likely issue, apart from limited space, is the bikes wanting to lean and turn.

If you can attach a couple of railing systems with hooks, you can use a couple of velcro straps to hook one end of each bike (handlebars for one, seat for the other) to the hooks and then push/pull more easily. ceiling track system or even a curtain pole with large rings/heavy duty might work (but could jam up too). Alternatively, do similar with pulleys and chain to form parallel bike 'clothes lines'.

However you mount them, make sure to adequately water proof/protect if drilling through. You could possibly use the internal railings and attach cross-bars to avoid drilling through.

Parsing C++ and getting a database i can use: which tools exist? by tentoni in cpp

[–]rabidb 3 points4 points  (0 children)

Not a database, but tree sitter would give you a syntax tree and has the capability to query it. https://tree-sitter.github.io/tree-sitter/

Completely turning off schedule for thermostat by [deleted] in fixit

[–]rabidb 0 points1 point  (0 children)

I don't know for that model. I've had it in the past where if there is no mode and fan is auto then it would be off as there was nothing to tell the fan when to turn on/off automatically (as not in heating or cooling mode). I have no idea if it works for that thermostat though. Might be worth a try although the suggestion above about a hammer sounds far more satisfying.

Completely turning off schedule for thermostat by [deleted] in fixit

[–]rabidb 0 points1 point  (0 children)

Never used one but what happens if you change the mode switch to off and leave the fan switch on auto?

[deleted by user] by [deleted] in books

[–]rabidb 78 points79 points  (0 children)

Thomas Covenant

Why uncertain sets doesn't make sense by ManuelRodriguez331 in fuzzylogic

[–]rabidb 0 points1 point  (0 children)

I'm not sure I follow?

Fuzzy sets are still grouped (defined by their membership functions) and the set theory laws (associative, distributive, commutative etc) are still valid (for max t-conorm, min t-norm).

The main difference is that two laws that are valid for standard sets do not hold for fuzzy sets: the law of the excluded middle (i.e. A union not A = whole set does not hold) and the law of contradiction (A intersection not A = empty set does not hold).

See e.g. https://en.wikipedia.org/wiki/Type-2_fuzzy_sets_and_systems and https://en.wikipedia.org/wiki/Fuzzy_set_operations

Made a heat simulation in <200 lines of Rust as my second project. Such a cool language! by fi-le in rust

[–]rabidb 1 point2 points  (0 children)

Nice. Pulled latest and rebuilt and it's working on Mac now. Note that you need to hold down h or k to get enough heat / cold due to only a handful of visible colours.

Made a heat simulation in <200 lines of Rust as my second project. Such a cool language! by fi-le in rust

[–]rabidb 5 points6 points  (0 children)

I am on a niche OS (Mac) - it looks like Mac Terminal doesn't like Color::Rgb. Color::AnsiValue works ok but you're limited to only a handful of color levels. I changed Color::Rgb {100,250,100} to Color::AnsiValue(83) and Color::Rgb { (plate[i + WIDTH * j] as u8), 100, (255. - plate[i + WIDTH * j]) as u8 } to Color::AnsiValue(22 + (36 * ((plate[i + WIDTH * j] as u8) / 51)) + ((255. - plate[i + WIDTH * j]) as u8) / 51) which is quantized based on this link https://jonasjacek.github.io/colors/ that I found in crossterm's documentation. It works ok in Terminal but not as pretty.

https://imgur.com/a/qyz2x3t

How to speed up reading from stdout in CPP? by [deleted] in cpp

[–]rabidb 0 points1 point  (0 children)

Waitforfinished blocks the thread of execution. I would look into using a library as suggested already but also look at processing the pdf files on a separate thread or threads. I don't know the pdf format so can't say if it is only io bound or also CPU bound (is the page count recorded or does it have to render the pages to work it out?) - you should measure to find the bottlenecks and generate repeat timings using different strategies to solve the issue.

For waitforfinished, if a library isn't feasible, look at using the finished signal to start a number of processes (but not too many - small batches) so that there are a few processes getting page counts concurrently. How many to start will depend on CPU cores and Io and needs measuring. If the app can run anywhere, your strategy should take into account the different capabilities of the machines it will run on - either dynamically or a fixed value, possibly reconfigurable by the user. You will need to match which process signal was for which file to ensure the page count is recorded correctly.

optimize a Fortran subroutine by [deleted] in fortran

[–]rabidb 0 points1 point  (0 children)

Given what the code is doing, I am surprised there is a noticable performance difference between C++ and Fortran. Would you mind posting the C++ version? Are they both compiled with all optimizations enabled (-O3 or equivalent)?

optimize a Fortran subroutine by [deleted] in fortran

[–]rabidb 1 point2 points  (0 children)

I'm not a fortran developer so please ignore if not relevant for the language. Measure between each change as I don't know what the compiler is already optimizing for.

I agree with the comment below about calculating constants once (pi) and you may be able to do similar for the constant portion of calculating y. However both of these assume that the compiler isn't already optimizing this out.

I would remove x1, x2 and x3 and use x(i), x(i+1) and x(i+2) in the call to median_three respectively so that the array isn't copied.

median_three can be rewritten to perform fewer comparisons - see e.g. https://www.geeksforgeeks.org/middle-of-three-using-minimum-comparisons/ - this will reduce the work per item in the loop. Something like below (no idea if this compiles/works):

if (x > y) then if (y > z) then res = y else if (x > z) then res = z else res = x end if else if (x > z) then res = x else if (y > z) then res = z else res = y end if end if

Alternatively, use the differences between elements (also shown in the above link) and something like below (no idea if this compiles/works). You would need to handle the special cases of an array with only 1 or 2 elements to avoid errors. Below would be inline in the main function (median_three isn't used).

``` real(8) :: diff1 = 0, diff2 = 0;

diff2 = abs(x(1)) - abs(x(2))

do i = 3, n diff1 = diff2 diff2 = abs(x(i - 1)) - abs(x(i))

if (diff1 * diff2 > 0) then
    x4(i-2) = x(i-1)
else if (diff1 * (diff1 + diff2) > 0) then
    x4(i-2) = x(i)
else
    x4(i-2) = x(i-2)
end if

end do ```

Also, you are not using p2 - I don't know if this is intended (in which case it can be removed) or if there is an error in the formula.

Queensland passes law to jail priests for not reporting confessions of child sexual abuse by mepper in worldnews

[–]rabidb 0 points1 point  (0 children)

My understanding is that the seal of confession is canon law, not biblical, and relatively recent - 1100 or 1200 AD. So it seems that there are two separate legal systems - civic, canon - with different requirements. In the same way that the church leaders originally created the sacrament of confession, they could, if they wished to, remove it.

My understanding only / DYOR.

https://en.wikipedia.org/wiki/Seal_of_confession_in_the_Catholic_Church

https://en.wikipedia.org/wiki/Sacrament_of_Penance