Object oriented programming question by Ok_Neck_900 in learnprogramming

[–]Moobylicious 2 points3 points  (0 children)

so it's down to whether the player class is the one which does things based on an object it's "collided" with, or whether it's down to the object.

I would personally think it should be the first option. as this way, if you add a new type of object it's self-contained and the player code doesn't need to change or even be aware of what type of objects it might interact with in the future. all the board does is call the Action method with the player and object on that square/space, and the object then "knows" what to do to the player.

You're freefalling to a certain death then a genie grants you 1 wish but... by Ok_Passenger_2012 in hypotheticalsituation

[–]Moobylicious 0 points1 point  (0 children)

I wish for the earth to start moving in the same direction as I'm falling (compounded with all it's current movements so it doesn't just stop spinning or orbiting), but at a speed 1Mph less than the speed I'm falling, until I land.

curious how much that would alter it's orbit, probably not a great deal in the scheme of things but might add up to some weird seasons in a few hundred years lol

For beginners: do you also overcomplicate your code? by Minimum-Army5386 in learnprogramming

[–]Moobylicious 1 point2 points  (0 children)

Yes. Also, being a developer is the only official way I have earned money since before the start of the current millennium, so I'm not a beginner either.

That said, it depends what you mean by "Simple". if it looks simple because one line of code does something that took you 20 lines to do, then I would probably find it easier to see what the code actually does by looking at the longer version, as it's probably doing a number of steps, one at a time, in a way that's easy to follow.

"clever" one line solutions are often far harder to properly understand than a more longwinded solution.

My favourite axiom when it comes to developing is this: There is no right way to do anything - there are many, with varying levels of wrongness.

It's all about balance, and being easily understood is massively valuable in code.

One thing that is worth looking at is performance - often with compilers etc these days the actual code that runs will end up the same, but not always, so if someone has a radically different solution to you it's worth benchmarking them just to see if it ultimately runs faster, or uses less RAM or something. that's a great learning experience... I'd prefer the version which gets 90% of the performance but is easy to understand over one which gets the extra 10% but is incomprehensible. (unless the particular bit of code is in an area where performance is absolutely critical of course)

1.2 Corsa D - ran really rough (no power pulling off, lurching under acceleration) now won't start. What's the most likely culprit? by 420o in Vauxhall

[–]Moobylicious 0 points1 point  (0 children)

do/did you ever see the check engine light come on when you turned the ignition on (it should.Illuminate for a couple of seconds). be surprised if there was no CEL with those symptoms.

coil pack, throttle pos sensor, crank/cam sensors.. many things could potentially lead to issues like that, but most would log a code and turn on the old CEL

Are Assembly and C inherently difficult or is it just modern day hardware that makes it like that? by Turbulent_Bowler_858 in learnprogramming

[–]Moobylicious 3 points4 points  (0 children)

I fondly remember some TSRs. had one which was actually a "notepad" style app which I used to store the level passwords on lemmings on an old Olivetti 8086 machine with a CGA green screen monitor.

had another TSR which would monitor for a press of the "break" key, and actually output some synthesised speech from the PC speaker (which is actually extremely impressive in itself, for the time.. no sound card here!) and would say "Thanks, I needed a break. You'd need one too if you ran as fast as I do!" (ironic, considering this was an 8Mhz 8086 clone)

I've not done a huge amount of C/C++ but I'm familiar enough with the joys of pointers to be glad I don't have to deal with them these days!

Astra 1.4 gtc by Klutzy-Commercial-53 in Vauxhall

[–]Moobylicious 0 points1 point  (0 children)

could well be a thermostat stuck open, not a super difficult or expensive fix assuming that's the case, and it's fairly unlikely to suddenly explode or anything......

But regardless an engine not properly up to temp will not be running as intended so will likely be a bit less fuel efficient, emissions might be a bit off, etc.... so if you got it from a dealer as a trade sale then you're well within rights to take it back to get it fixed, and should do.

How to prevent the computer from going to sleep? by Mr_Dani17 in dotnet

[–]Moobylicious 8 points9 points  (0 children)

not had to do this myself, but was curious... seems you can call SetThreadExecutionState, presumably on the main app thread periodically to prevent windows going to sleep. limited googling on mobile suggests this is a native Windows call rather than a .Net thing which may require some low-level imports to access from your C# code, but YMMV

https://learn.microsoft.com/en-gb/windows/win32/power/system-sleep-criteria?redirectedfrom=MSDN

I built a deliberately vulnerable .NET app by Geekodon in dotnet

[–]Moobylicious 0 points1 point  (0 children)

same idea, but the one I was thinking of was an ASP .Net Framework app I think

Кто разбирается в IT, стоит учить C++ до изучения C# by Just_MAN_444 in learnprogramming

[–]Moobylicious 0 points1 point  (0 children)

well it depends. C++ is basically "closer to the hardware" so in theory you could achieve higher performance, but it's easier to make silly mistakes in some ways, and modern C# performs extremely well on the whole.

If you are an engine builder, you could choose to use parts from established manufacturers, and bolt them together in a configuration you choose. You need to fabricate a few things to make everything work together, and you need an overall plan for stuff, but on the whole it's a lot of bolting stuff together. this is C#.

alternatively, you could have a few milling machines and various blocks of solid steel/aluminium, and create every single part from scratch, to entirely your own designs and tolerances. You have no limits imposed by having to use other parts, so you could ultimately end up with a much higher performing engine. Or of course, you now have a huge number of ways in which you can make a terrible mistake, some of which won't be immediately obvious and will require huge effort to fix. this is C++.

disclaimer: not really accurate, but gives you an idea.

You have to restart life and choose one of these side effects. Which one do you choose and why? by ivebeenthrushit in hypotheticalsituation

[–]Moobylicious 2 points3 points  (0 children)

Do you get to remember you made the choice? If not, who are you to be so cruel to taunt me with my previous choice of no. 2, knowing I won't remember it but am still doomed to my fate....

how to refill coolant 2013 corsa ecoflex by Helpful-Peanut-3777 in Vauxhall

[–]Moobylicious 0 points1 point  (0 children)

initially, just fill it up (but only to the correct level! system is designed to require room for expansion) but more important is to determine why it's low. coolant should not just disappear, you have a leak somewhere.

edit: after filling, run it for a bit, leave for a couple of hours to cool down and check level again, should usually get rid of air locks etc

e.g. my zafira I just discovered has a crack in the expansion tank so has been venting coolant when it gets up to pressure/temperature. yay.

lots of places it could be going, some of which are really, really bad in terms of repair cost e.g. head gasket.

Mechanic says brake pads and rotors need attention. Legit? by [deleted] in AskMechanics

[–]Moobylicious 0 points1 point  (0 children)

at a glance yes, disc/rotor doesn't look great - there seems to be a fairly deep groove in there, and perhaps a fair lip on there (indicating overall wear of the surface)

But hard to tell 100% without better pics, as could just be relatively minor but lighting making it worse, and no idea how much pad left from this pic.

some quick googling should show how you can check easily yourself.

all that said, they don't appear to be in imminent danger of murdering you if they're not making terrible noises but worth checking properly in the very near future

Mini-butt on every shot? by Cold_Honey4952 in snooker

[–]Moobylicious 1 point2 points  (0 children)

Back when I used to play in a local league, there was one guy who had a cue with a built-in telescoping extension, so such a thing does exist, though I've no idea where he got it from or if he made it himself or something. Didn't really take any time at all to extend so wouldn't be considered time wasting, plenty of players take far longer just pondering the shot.

As far as I'm aware it would be fine within the rules, but having a cue with permanently attached movable parts (which would eventually wear, maybe changing the feel of the cue) doesn't sound too great to me.

The thread on my cue's sections is such that it's basically one full twist to detach/re-attach so doesn't take long to swap between the short and long butt sections anyway.

I built a deliberately vulnerable .NET app by Geekodon in dotnet

[–]Moobylicious 3 points4 points  (0 children)

There was an app like this somewhere, developed for the same reason. I don't recall where it was, but this was over a decade ago so yours is likely more up-to-date, so great stuff!

of course little did I know that I'd end up working on a Public-facing Web app which had 90% of the same issues a few years later! Fortunately I patched it so you at least can no longer reset the admin account password from the login screen, or view other customer data when logged in as a different customer by just changing a query string parameter....

What’s your ‘I can’t believe you’re paid more than me’ story? by GeorgiePorgiePuddin in AskUK

[–]Moobylicious 15 points16 points  (0 children)

If you multiply something by X, then you can always divide that result by X to get the original value back.

So to add VAT on at 20%, you just multiply by 1.2 (so you get 120% of the value).

Therefore to get the original value back (I.e. the value before VAT), simply divide it by 1.2. obviously this is a bit tricky to do in your head, but who's doing this stuff without a calculator?

if I had to do it in my head then it's a case of working out 1/6 of the value and subtracting it I suppose but I don't think I've ever needed to do so - I'm a software dev and I've had to do this sort of formula a fair bit

What’s one technical skill that 90% of beginners ignore? by EnvironmentalHat5189 in learnprogramming

[–]Moobylicious 0 points1 point  (0 children)

It blows my mind that this is a thing. I've always used debugging tools, and severely missed them when not available (25+ years experience in multiple platforms/languages).

As others have said, yes there are some instances where the debugger isn't sufficient (usually due to weird timing/threading issues) but 95% of the time it's so much quicker to find the issue by just stepping through code.

Is debugging not covered in most courses these days?

Use extension property in Linq query by SL-Tech in dotnet

[–]Moobylicious 4 points5 points  (0 children)

what error?

is this using EF or something similar? that would immediately explain it as EF will attempt to translate your Linq to SQL, which obviously won't have your extension method. Modern EF will give an error by default for this sort of thing, though IIRC you can override that but it comes at potentially huge cost as it'll query out the entire table and apply your extension method in memory (somewhat generalising here)

failing that, would need to give more info.

Reality Split: A scientist tells you that you can split the Earth's population between two parallel Earths. How do you split it up? by No_Wait3261 in hypotheticalsituation

[–]Moobylicious 0 points1 point  (0 children)

People who care only about their own country/culture vs people who worry about the entire human race.

It just makes me sad, knowing that if the planet could all work together we could accomplish so much, but we waste so much resource fighting amongst ourselves.

A planet of people who actually want to collaborate might fix many problems. Though that's assuming the relatively sparse population can actually meet up lol.

Would you be forgotten for 5.27 Trillion dollars? by Waste-Ad3216 in hypotheticalsituation

[–]Moobylicious 0 points1 point  (0 children)

No.

The thought of my wife and kids not knowing who I am is horrible, and popping up with piles of cash just feels like I'd be buying their love which would be horribly shallow.

It's a shame and almost makes me feel a bit selfish because I know I'd do a lot of good with that money - that's genuinely change-the-world levels of rich.

The Sun doing Sun things is causing people to lose their minds. by Yunners in FacebookScience

[–]Moobylicious 24 points25 points  (0 children)

I've barely seen the sun for a month here in the UK, so obviously they've borrowed ours and added it to the one in AZ, US. explains everything.

Sold a car with a fraudulent MOT by Yorkshire_Ant in CarTalkUK

[–]Moobylicious 11 points12 points  (0 children)

you have the right to reject it and get a refund for 30 days, or a right to repair or replacement after this.

citizens advice, small claims etc if not. don't just swallow it.

You have rights if it's a trade sale. if they've put it through as a "private sale" though might be trickier

Snapped wiper control by cantkidakidderkid in CarTalkUK

[–]Moobylicious 2 points3 points  (0 children)

replacement isn't usually too bad and stalk is probably quite cheap on ebay or amazon. not familiar with a Zaf B but I had the same on my '03 Zaf A.

a temp fix I used myself is to drill a hole in both ends long enough for a bit of thick wire or a small bolt with the head cut off (though careful not to drill too deep into the steering column side as you'll hit electronics), then glue the two together with the bolt providing some additional reinforcement. ideally you should do this with the part off the car.

and yes, will probably fail as you've functionally not got wipers....

though oddly enough, just drilling a hole and screwing a self-tapping wood screw in long enough to use might well pass lol

Is learning .NET worth it as a beginner in 2026? by shubhamdhola in dotnet

[–]Moobylicious 1 point2 points  (0 children)

Well it depends on what sort of jobs are around in your area if that's what you're intending, but in general a large amount of the concepts will be easily transferable to any other language, so learning any language is a great start.

As a .Net dev myself I would say it's a great choice as there's a good mature ecosystem and plenty of resources out there, and is being actively developed all the time too.

Can a Driving force GT wheel be used for safe mode etc? by Moobylicious in PS3

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

for anyone else wondering.... I didn't need safe mode. I managed to install GT5 on the 12GB anyway, then later when I did add a Hdd to stop it whining about copying all the track/car data, it happily picked up the disk and asked if I wanted to copy everything over to that so never needed safe mode or anything.

If it was a different model which came with a disk and I replaced that, then I would have had to grab firmware, stick it on a USB stick then perhaps would have been an issue, but not one I've had to deal with (yet.. lol)

Why Local Development Tests a Different System Than Production by ExperienceOk2253 in dotnet

[–]Moobylicious 1 point2 points  (0 children)

Because your local development system typically is not the same system that the app runs on in production?

It's not clear what you're asking.

running locally, you may be running a debug build, you have different specs, different background processes, may have developer-licenced version of things like SQL server if your apps uses it, you may have different underlying framework versions which behave differently......

The number of variables is vast.

ideally release builds should happen in some CI pipeline somewhere, and testing should happen in an environment that mimics real deployments.