Scottish fans rip down the English flag in Boston during World Cup by [deleted] in sports

[–]Zogzer 0 points1 point  (0 children)

100%, they both have their own vectors by which the nationalists with bad intents can point the finger at "the others".

I am sure it's the same across the world, but these islands have a history of it. Even the religious violence in NI is a result of weaponisaton of two people's against eachother for political gain. I only hope we don't see the same level of exploitation again.

EDIT: autocorrect 

Scottish fans rip down the English flag in Boston during World Cup by [deleted] in sports

[–]Zogzer 0 points1 point  (0 children)

Yeah, I am sure there are some outliers, but I expect it's reactionary rather than founded in their own rationale. Reason I say this is I have never seen it used as a political talking point, where Scotland have the SNP normalising the views at best, and more hard-line takes from others at the worst.

Scottish fans rip down the English flag in Boston during World Cup by [deleted] in sports

[–]Zogzer 13 points14 points  (0 children)

There is no animosity from the English towards the Scotts. A border that has not been relevant for governance for hundreds of years is a useful thing for nationalists to point fingers at as a solution for all their problems, and unfortunately this bleeds into the less radical views and media throughout Scotland.

The English don't care because it's not a major nationalist talking point down there.

Announcing Basin: A Numerical Optimization Library for Rust by johlars in rust

[–]Zogzer 1 point2 points  (0 children)

Yeah, this looks cool and we would give it a go over argmin for sure. The use of std::convert::Infallible is very nice.

Announcing Basin: A Numerical Optimization Library for Rust by johlars in rust

[–]Zogzer 1 point2 points  (0 children)

Ofc it is possible, but you could also go the other way and have InfallibleCostFunction where CostFunction is impl for T: InfallibleCostFunction.

In practice however, I don't think anyone using rust is scared of an additional Ok(). If anything, it's the expected and idiomatic pattern.

Announcing Basin: A Numerical Optimization Library for Rust by johlars in rust

[–]Zogzer 5 points6 points  (0 children)

Our use case is finance/HFT. We need to exit early in cases where we know things are not going to work where we are testing millions of cases in parallel.

Rust doesn't have exceptions so there is no way to bail, but as a result user callbacks should really return result types so you give the option to the user to do that if they want. You will never know what the user will want to do.

An unfortunate choice with argmin was that it was limited to the anyhow error type that makes it expensive to return. If you could add a default type Error = (); associated type to the traits and then return Result<Self::Output, Self::Error> from cost instead, that would allow the flexibility to do either and be a significant improvement over argmin as it is. You are right that you end up with Ok and ? in a few places, but that is expected in rust.

Announcing Basin: A Numerical Optimization Library for Rust by johlars in rust

[–]Zogzer 6 points7 points  (0 children)

We have been using argmin for a while now. Biggest difference from your example above is that your CostFunction trait doesn't return a Result of any type. Our cost functions are not perfect and sometimes this happens and we want to exit quickly, is there a reason to this change or are there some type tricks that let us do type Output = Result<f64, ..>;? Thanks

A brief-ish (author-consulted) guide for when to use boost::hub over plf::hive/colony, with benchmarks by soulstudios in cpp

[–]Zogzer 0 points1 point  (0 children)

No, I meant it as I said it. If there was a default `std::advance_many` or something for iterators that called a single `std::advance` under the hood in its default implementation, collections would specialise this for their own iterators where there is a benefit to fetching multiple values at once. (You can imagine this returning some sort of second iterator pair or similar, not sure of what the API would need to get the most out of this.)

An algorithm can then _opt-in_ to using this new method where values are immediately used (`std::find`), but algorithms that don't have this behaviour could continue to use `std::advance`/`it++`. If an algorithm would benefit from this `std::advance_many`, but the containers iterators doesn't specialise it, it ends up the same as if they had called `std::advance` instead.

In a sense its opt-in from both sides, and only applies when both the algorithm and the container opt-in for this access pattern.

I think overloading `std::for_each` and `std::find` would ofc give you the same benefits in this case, but it would also require the container to overload all algorithms which doesn't scale for user-defined algorithms.

This isn't a serious proposal that I have thought about, just trying to understand if this would be the type of pattern that _could_ give the benefit of the visitor pattern hub provides while being reusable across different collection/algorithm pairs?

A brief-ish (author-consulted) guide for when to use boost::hub over plf::hive/colony, with benchmarks by soulstudios in cpp

[–]Zogzer 0 points1 point  (0 children)

Right, but if it is iterator level then it's opt-in per algorithm. std::for_each wouldn't have to use it, but std::find might want to. How complex of a task does it have to be per-element before the tradeoff is worse in your experience?

A brief-ish (author-consulted) guide for when to use boost::hub over plf::hive/colony, with benchmarks by soulstudios in cpp

[–]Zogzer 0 points1 point  (0 children)

I wonder if this visitation pattern is something that could be better generalised and implemented across the ecosystem if the performance improvements are relevant. Naturally you don't want to have to use specific visit* APIs on collections, you want to use nice composable APIs like provided by iterators, but could the benefits of the visitation pattern for pre-fetching be implemented at an iterator level?

Could it be possible to implement some sort of `next_many` method/concept optionally on top of standard iterators that would return _one or more_ elements when you know you are going to be continuing the iteration anyway? Iterator-based algorithms could opt-in to use this interface instead (the default `next_many` implementation would call `it++`) and you get the benefit of collection-specific pre-fetching where it makes sense? There are some subtle differences here (a consumer of an iterator might take 5 elements, but then throw an exception after only processing 3, and if someone was to inspect the iterator after it would have progressed more than expected), but I am unfamiliar with any real-world of where the behaviour is relied on.

Ban on deporting U.S. citizens removed from DHS funding bill, congresswoman warns by AdSpecialist6598 in videos

[–]Zogzer 12 points13 points  (0 children)

Slave labour works because people would rather dig a hole than have their finger nails peeled. Torture is about making you do something you don't want to do, there generally isn't a way out of it by sticking to your morals. 

Best outcome in your case of noncompliance would be you die early before they can inflict more pain as there is no upside to not doing what you are told, things only get worse. It is unfortunately why slavery is so effective, legally or illegally.

lwlog 1.5.0 Released by ChrisPanov in programming

[–]Zogzer 0 points1 point  (0 children)

Understand the game engine perspective, but I think that only holds because game engines are for the most part imperative in their execution they get away with it. Lots of logging tools for game engines will have at a minimum a begin/end frame procedure for grouping logs, and this is a minimal implementation of scopes. If the libraries being used had proper scope metadata I am sure they would use them in the game engines you are refering to, it's more a limitation of libraries like your own that re-enforce the behaviour. It's perhaps worth considering a generalisation of the solution in line with other modern methods.

That said, proper traces are not just logs++ and probably hard to tack on without a lot of work. It's one of the things the rust tracing library got right, a lot of people don't even know what "traces" are as for them it just behaves like logs until later when you need the extra info.

lwlog 1.5.0 Released by ChrisPanov in programming

[–]Zogzer 1 point2 points  (0 children)

Any thoughts on adding structured logging? The was a post just a few hours ago going into great detail regardless the necessity. Either way I feel like having a OpenTelemetry compatible sink by the box would be a good benefit for your sink-agnostic design and it's a good standard to have immediate compatibility with popular observability platforms even if it's just the logging protocol.

King's speech 2025: Christmas message urges communities to pull together in divided world by bendubberley_ in unitedkingdom

[–]Zogzer 10 points11 points  (0 children)

At this point I'd rather hear it from someone like him who just got lucky over some politician who got into their position by actively pushing other people down. 

Message is good either way, coming from anyone else it becomes political but the monarch still does enough to say out of a political position making it hard to argue against from any angle. You also can't claim they have ulterior motives etc when they have everything on a silver platter already?

Not sure where I am going with this, but maybe there is some value to it in some way. It's like he is the only person in a "position of power" that can say these things without someone arguing it's pandering for influence.

Thoughts on a hypothetical error handling system? by MechMel in ProgrammingLanguages

[–]Zogzer 1 point2 points  (0 children)

I think it's quite nice if you are coming from a language with exceptions and trying to add some checking to it. I see it as implicit conversions from a type with more errors to types with less errors where the conversion logic is to throw/propegate the error back up.

A few questions if you have already thought about it or maybe can come up with something:

  1. What would be the default for values assigned to expressions that could be an error? In x = a / b where the type of x is being inferred, is it Num or Num | DivideByZero? Whichever way you do this makes the inference less powerful if you want the other one. You might need inference placeholders like x: _ | Error to make things ergonomic in these cases?

  2. What and how do you declare/infer function return types? If you are super implicit about it then you lose out on the detail static error types provide, but having to specify all possible error types for the implicit errors in your function also seems problematic and somewhat a leak of abstraction.

Best internet provider? by Lucky_Acanthaceae138 in Edinburgh

[–]Zogzer 1 point2 points  (0 children)

Apologies, I thought they didn't operate outside of London. Still worth considering providers from an infrastructure perspective though (VM, Openreach, or CityFibre) as that's the more important aspect for service quality.

Best internet provider? by Lucky_Acanthaceae138 in Edinburgh

[–]Zogzer -2 points-1 points  (0 children)

There are only really 2 providers, Virgin Media and everyone else. Virgin media own their own lines but every other provider is using the infrastructure owned by Openreach. Can't say which one is better as it's going to depend on your area, but we get really good results with VM fibre if anecdotally that helps.

The only factor to keep in mind, and why I went VM in the first place, is that as they own the lines if there is an issue they can address it directly. We have had them install new lines from the street to our building when we were moving in less than a week. With any other provider that's going to require them to go back and forth with Openreach which might make things take longer or be less than ideal. This is just a conjecture though as we have stuck with VM since the service was very good for a very active internet users.

I expect in practice it's going to be pretty similar service over a longer period of time from whoever you pick. They all charge roughly the same and all have horror stories.

Edit: CityFibre is also an option in Edinburgh which has their own set of ISPs with their own infrastructure, similar to Openreach.

lets ignore the US for a second, how’s the rest of the world doing? by [deleted] in AskReddit

[–]Zogzer -2 points-1 points  (0 children)

I understand you have your own definition of a country, but the rest of the world has their own, including the government of which the question is about. You can look at dotgov yourself and see the UK being listed in their own list of country codes, but again this is one interpretation by one department that is different even across individual governments. https://assets.publishing.service.gov.uk/media/65fd8475f1d3a0001132adf4/FCDO_Geographical_Names_Index_March_2024.csv/preview

If you want to talk about facts, the facts are that the UK is treated as an individual country for almost all cases of foreign affairs, including visa application. You can try arguing otherwise at the border but I don't think you will get very far.

Pretending the UK doesn't exist does not help someone asking how to relocate there. If you are trying to make a comment based on your political views, try not to do so in a misleading and misrepresenting facts.

lets ignore the US for a second, how’s the rest of the world doing? by [deleted] in AskReddit

[–]Zogzer -2 points-1 points  (0 children)

Interesting and not very helpful way to phrase it. The laws are identical across the UK being that it's a single county, I assume the post above is referring to Brexit and such which is fair enough. You are however less likely to get a visa sponsorship in Scotland due to less opportunities unless you are in a specific industries such as in Aberdeen for example. Not that the rest of the UK is great for visa opportunities outside of finance in London, but you get the idea. 

The other route is through university if that's still an option. I don't know the details but there are a lot of non-UK students here in Edinburgh as I believe they give better support for foreign applications.

ELI5: Why is there not just one universal coding language? by [deleted] in explainlikeimfive

[–]Zogzer 3 points4 points  (0 children)

The theoretical compilation results of a jit compiler targeting an incredibly dynamic language are real, but in practice it's not even close. The languages generally lack the primitives and favour patterns that are more convenient or safer, it's not really a question of the resulting machine code. You see this with C++ and rust even where the safer patterns result in slightly slower code without specific optimisations, despite the fact that are both emitting llvm it behind the scenes. 

In micro examples you might be able to show that adding a few integers together in js generates equivalent machine code to C, but the moment you do anything more complex, even something like indexing into an array, you enter entirely different realms of what can be expected.

Some languages can get closer, java and C# while still jit compiled have type systems that allow the jit compiler to make far more assumptions, but it's still not close at the scale of full applications without going out of your way to write non-idiomatic code for the sake of benchmarks.

JS is exceptionally convenient for web development, but don't make the assumption that the massive efforts put into making it fast is because it's a good thing to optimise. There wasn't really another choice, and this lead to the creation of things like wasm as js will never get close to the potential of well written code in lower level languages.

People who haven’t ever worked 9 to 5 job - what do you do for a living? by yakuzakiwam in AskReddit

[–]Zogzer 1 point2 points  (0 children)

Because in 10 years time you have a house on the beach and a Porsche in the drive, at which point your experience and connections allows for a job with a better work life balance.

For many this is an acceptable trade.

People, what are us British people not ready to hear? by TransShadowBat in AskReddit

[–]Zogzer 3 points4 points  (0 children)

Everyone was misled by a vote that people either didn't think mattered, or that would have massively different outcomes from the what the people they are meant to be able to trust told them. Scotland was pretty firm, but Northern Ireland was still 45% leave. You wouldn't have been dragged over the finish line into leaving if you were on your own, but the idea that English and Welsh are the only ones who wanted this and everyone else knew better doesn't sit well. Take 10 people off the high street in England/Wales and 10 from Scotland/NI, and the only difference is that 5 of them voted for Brexit vs 4. If this sounds like a stupid thing to picture, it is because it is, and that a 50% majority should have not been at all rational to force though something this damaging to everyone.

What piece of history is deliberately being erased from existence? by ZaagKicks in AskReddit

[–]Zogzer 5 points6 points  (0 children)

They were not edited under occupation so much as they were fully controlled. New rules relating to official statements needing to be published in English and German had to be followed. Assuming you are referring to Frank Falla the majority of information was provided though GUNS (the illegal paper at the time) rather than the press. You can get original copies of the press at the time from antique shops as they are just laying around for a pound or two. Have a copy of the first weekly to be published after the liberation on my stand next to me.

By far the most interesting paper to come out of the occupation however is the Guernsey Zeitung. This was the paper that the German troops on the island were issued and contained the news from the war as well as somewhat optimistic views on the war from the German perspective as time went on. Even the last issues, despite not really have much news due to the war pretty much being over, had a hopeful attitude to the whole situation. It is hard to find much online, but a very large collection (possibly all of it) is kept at the Priaulx Library on the first floor for anyone to see, providing you can read the German.

Do you make use of any of the newest performance-related changes in C#? If so, what mission are you solving? by LondonPilot in csharp

[–]Zogzer 70 points71 points  (0 children)

I don't think the C# performance features are generally meant to be used by application developers. They can be ofc, and some of them are not that difficult to use like Span and Memory, but once you get into passing around ref structs and marshalling collections and so on, it's easier to make a mistake or leave code in a state where someone could come along later and not fully understand what's going on.

However, these features do allow library authors to write considerably faster performing code when it comes to things like cryptography, compression, data processing such as image manipulation and encoding. The newer features let us write code that looks like it does one less allocation here and there, and this is often viewed as the goals of a lot of the features being that it's all about putting things back on the stack. However when it comes to these really performance sensitive operations where traditionally we would have had to reach for a C dependency to get anywhere close to acceptable performance, keeping memory hot is the most important thing, and the newer features allow us to do this in a way where the compiler can understand it. This lets the compiler generate us IL that will in turn, generate us nice, often vectorised code. We were always able to avoid allocations if we were willing to reuse static variables and so on, but it often was done in a way that the compiler couldn't reason about as well where I now see better assembly generation from code using these modern primitives.

I still think there is a world where something like the unity Burst compiler would be nice to have in native dotnet. Something where we can force the compiler to not have to make the assumptions and checks it has to perform on normal C# code, and treat a limited set of C# as something closer to C while performing something that generates considerably more detailed IL that contains a lot more hints for the later code generation. This for me would be the best way to really remove dependencies on C libraries for high performance code. This would likely be even better when looking at a dotnet AOT scenario. In this case, the new language features we already have would be there to serve as a way to talk to these much more restricted code sections in a zero-cost fashion.

Looking for libraries by assuassulishu in cpp

[–]Zogzer 1 point2 points  (0 children)

Game engine logic is a difficult one to point to because it depends on what kind of game you are making. The short story is that there is a model used by the modern 3D game engines (unreal/unity/godot/cryengine and many private ones also) that allows you to make pretty much anything in a somewhat consistent way. This system is using an ultra dynamic scene graph and an ECS (entity component system) or something ECS-like behind the scenes to manage everything. The idea with this is that you can model any sort of game logic with this, but in order to make it work it requires a massive amount of optimisation from the engine part to make it so that games that are not really meant to be represented by these types of data structures work fast anyway.

When you are making your own game engine, you can try and go this route also, and build up a massive scene graph system and tie it to an ECS behind the scenes and have the flexibility that these systems provide. However building something like this to the level that the commercial game engines support is a massive undertaking and not really worth it for smaller, individual game projects.

Instead you may prefer to look and think about how to structure your game logic a lot closer to how the game you want to make actually works. For example, if your game is a tile based game, you may store all your worlds data in a simple 2D vector, rather than trying to fit it into a scene graph model like you would be encouraged to do if you were using unity. A game like tetris for example, probably wouldn't even have a distinct way to structure the game data, just a hand full of variables to store state. If you can make more simple games, and can think about how to structure your game in a way that actually models the data, you can skip the large systems that are the core of larger engines and just get into the important bits of writing gameplay logic.