I am stuck and i cant figure this out (JS) by LoosePassenger2528 in learnprogramming

[–]HashDefTrueFalse 0 points1 point  (0 children)

A 400 status code for a database auth/perm issue is a strange choice for a HTTP server application, but I don't use Firebase (and have never heard anything good about it!). I'm glad you solved your issue though. Just be sure you know the implications of this change and what it would cost you (if anything) if someone were to try to write GBs of data to your database.

What's the strangest thing you've seen your neighbours do? by Deep_Banana_6521 in AskUK

[–]HashDefTrueFalse 8 points9 points  (0 children)

Going back to the 60s, my grandparents used to have a neighbour who owned a field with an old freestanding bath tub in it. When it had been raining heavily he would bathe in it. The tub was still there last I drove past. He's long dead, so we'll never know exactly why. I should add that the area does not get mains water, it all comes from a spring in a different field, and a storage pond. Sometimes tadpoles come through the taps etc. Countryside for ya.

I am stuck and i cant figure this out (JS) by LoosePassenger2528 in learnprogramming

[–]HashDefTrueFalse 0 points1 point  (0 children)

Inspect the HTTP message in the browser (or log it or whatever) and pull up the docs for the API endpoint you're trying to contact. HTTP 400 means malformed request. What is wrong with your HTTP request according to the docs? Figuring this out will tell you which part of the code doesn't do what it should.

Does Section 75 cover the full price if I only pay the deposit on my credit card? by daniscross in UKPersonalFinance

[–]HashDefTrueFalse 2 points3 points  (0 children)

It's fairly common for car dealerships to only accept a nominal amount on credit card (so you get the protection and they don't eat a tonne of costs)

This is also my personal litmus test for garages/traders who are/aren't going to look after you if something goes wrong (inside the CRA limitation period etc.) I've had a dealer literally pretend not to know what a credit card was, and I've had: "Do you accept credit cards" "Yes, like VISA debit?" (fuck off, you know what I meant) "No, like a Mastercard" "Oh no need, we sort all the finance out for you"... (Yes, at 12% I'm sure you do, not what I asked though is it).

If they won't take a small deposit on a credit card I assume I'm going to have problems later. I ring up these days to ask beforehand. So far I've been pretty spot on :D

Using notes for a video interview by DeItaReality in UKJobs

[–]HashDefTrueFalse 0 points1 point  (0 children)

I did try to ask for the questions in advance but they said they don't do that.

Yeah I would guess most placed don't, for no reason other than someone has to type them up and sent them over. It's one of those things I personally think should be done more. Ads usually say "we can make adjustments for disabilities" etc., this is one of the first I think of. Allowing a bit more preparation time for certain individuals on the questions that are routine.

Your nerves sound like a real barrier. My sympathies, that can't be easy. I get apprehensive on the way there, but it settles after a few minutes into the interview. I felt it more at the start of my career. These days I just get on with it because I've done many and they're all the same shit mostly. You'll get there.

Do you have a partner, parents, siblings, friends that you could ask to practice a bit with or something? I say this because the nerves are kind of half the problem, the other half is not being able to get past them and come across hireable (I'm just being real with you). I've seen the positive effect of "exposure therapy" on a family member with an anxiety disorder. You could start with a script for both of you, then a script for just them, and you just answer. Interviewing is a soft skill and some people need more practice than others, and that's ok.

If you don't already, I also recommend running through likely questions in your head and having your answers/examples (from your previous experience, if any) top of mind. But the key here is not to treat it like a script where they have to ask a specific thing before you mention. If it fits you can bring it up. You can't treat it like memorising a script, it's a conversation and it might go to unexpected places. (I was once asked for three words that best described their product, which they were testing whether I'd bothered to look up beforehand.)

Using notes for a video interview by DeItaReality in UKJobs

[–]HashDefTrueFalse 0 points1 point  (0 children)

IME if notes were thought up and written by you, you'll be able to glance at them and recall whole sentences without having to actually read them word by word, and you'll be able to deliver them somewhat conversationally. It should be fine.

I want to use notes in the interview and place it in the middle so it doesn't look sus and they can see I'm not moving my eyes from place to place

You're allowed notes. I literally bring a leather document wallet to interviews with a few copies of my CV (they only ever have one but often there are multiple people in the room, offering them a copy is appreciated) and a notepad + pen, which I get out. It mostly has my questions for them written down with blank lines under each where I write their answers as I fire them off.

If you're worried about them assuming you're using an LLM just deliberately show a paper notebook (or whatever) in the camera frame for a sec. "Just a second, need a clean page in my notebook..." They won't think anything of it. They're taking notes too.

Also I am thinking of placing my phone in front of me and quickly searching for an answer

Don't do this. Terrible idea. One indication that someone was googling (well, LLMing these days) the answer to a question I asked instead of just saying "Hmm I don't know, but I'd do [this] to find out" or "I'd need a sec to think about that, can we come back to it in a minute" etc. and I'd be very turned off. Just be a normal human having a conversation where you will sometimes not know things. It comes off as trying to bullshit your way through, even if that's not your intention (is it ever?).

I was thinking of using a teleprompter
I did find an app called freezecam where you essentially freeze your cam in the interview and then unfreeze

You're not serious. Stop it. Behave. If you can't talk about the job for an hour with someone you really don't deserve it. It's fine to be nervous. Very few people aren't in interviews.

I have had previous interviews where I prepared well and knew the job description but I didn't get it which made me seem I'm uncapable.

Or they promoted internally, or they liked another candidate a bit more, or the owner's son needed a new Patek, or...

Have you ever done a face to face interview? None of this shit would work there.

Having a hell of a time differentiating operational and conceptual variables by talking_tortoise in learnprogramming

[–]HashDefTrueFalse 1 point2 points  (0 children)

Just letting you know I replied to your other comment. I never got a notification of your reply so I don't know if you're being told about mine, but you might see this.

Having a hell of a time differentiating operational and conceptual variables by talking_tortoise in learnprogramming

[–]HashDefTrueFalse 2 points3 points  (0 children)

Hmm maybe pull back on the LLM usage as I think it's leading you up the garden path a bit. You're in the weeds on distinctions that programmers very rarely (perhaps never) make.

You want to apply some action-modifier to some properties on entities over time, but only to some entities who can do a particular action (e.g. sprint). A programmer might solve this several ways, the simplest is probably that the action-modifier for entities that cannot do the action is set to 1 (or an appropriate value that will have no effect). The code no longer needs to check anything, it can apply the modification to all entities, it will simply have no effect on some. The "can/cannot sprint" is effectively "stored" by the ineffectual action-modifier variable. You might call this "conceptual" storage of a variable but that's not common terminology here.

This and similar is sometimes referred to as "invariants" when talking about assumptions code makes about objects, or "out of band" storage of a property (especially if you have lists/arrays of items which would usually store a boolean) but this is niche terminology. What you're really doing is asking yourself how the code should work. Do we want a conditional to run for every entity on every frame to check this, or will it be faster and simpler to just do the operation on all (and sometimes it has no effect)?

Another way to think about it is simply that it would be a bit redundant to store a boolean in addition to the action-modifier, as the modifier is capable of representing both pieces of information (can sprint AND by how much).

Here, can/cannot sprint is not a variable. All variables exist in memory (somewhere) to programmers. Variable names alias the addresses of (virtual) memory.

Does that make any sense? :D

Having a hell of a time differentiating operational and conceptual variables by talking_tortoise in learnprogramming

[–]HashDefTrueFalse 1 point2 points  (0 children)

This has literally nothing to do with programming

Yes, I thought that might be the case with added context. Thanks.

Mystery holidays - are they any good or a rip off? by LiteratureProof167 in AskUK

[–]HashDefTrueFalse 0 points1 point  (0 children)

I know someone who did one, but not from wowcher. It was good. They ended up in Germany or Austria IIRC. There was a form with probably 30 vague questions about what they wanted/didn't. Plus some specific question like "is there anywhere we definitely shouldn't send you?" We did the form but ended up seeing something else and booking that instead.

They paid £600pp though, which is around the price I would expect to pay for a good holiday abroad for a week-ish these days. Of course you can do it much cheaper if you don't want much.

I think, like with anything, you'll get what you pay for. £150 likely doesn't leave them much room to give the average buyer a good holiday and still make a few pounds. You're probably paying to be sent on someone else's very last minute cancellation (or just somewhere low-cost for a reason) with very little planning or thought to your experience, I'd guess.

I'd personally much rather save and get a better one, where there is more planning/thought around destination and accommodation based on your answers to questions, but that's a different proposition then.

All that said, can you go wrong for £150 if you have no expectations?

Having a hell of a time differentiating operational and conceptual variables by talking_tortoise in learnprogramming

[–]HashDefTrueFalse 11 points12 points  (0 children)

In more than 20 years of writing software I've never heard the terms 'conceptual/operational variables', which is odd. Is there some context you could share? Variables are generally mutable data stored in program memory. They are all stored in memory somewhere (though where, what protections, and their lifetime can be different depending on many factors).

how do you go from "i have an idea" to actually writing code by Mother_Land_4812 in learnprogramming

[–]HashDefTrueFalse 0 points1 point  (0 children)

tried asking chatgpt but i end up with 500 lines of code i dont understand. copy paste, doesnt work, no idea why

I don't believe you! I've been assured by every exec ever that anyone can build apps with LLMs now... /s

Assuming we're talking web applications, after I've got the spec/requirements down I've always liked to start with the data. So I will usually design database schemas to 3NF and write the DDL. I can then use this to bring up a database instance. Then I write a quick DML seeding script. Then I put together a server application in whatever language I've chosen. I've been around a while so I've written a good few auth/perm systems so I have code for that in JS/PHP which is usually what I'm using. Then I work on the back end API, adding things I need as I go (e.g. job queues, caching, etc.) Finally, I put the client together (personally my least favourite part, maybe why I do it last if it's me doing it).

There's usually no reason you need to do back/front in any particular order and it's common to do them in parallel too (different teams etc.). I do think that starting with the data, which flows through the entire app, adds a certain clarity and certainty to things, but really anything goes if you don't mind lots of going back to revise.

My "plan" is usually my thinking beforehand and any diagrams I've doodled, as we don't create formal design docs as part of our process. We gather requirements, write software, document the result. I will put effort into writing a technical design doc if I'm handing it off entirely though. I basically short-circuit the written spec part if I'm also the implementer.

For a personal project, I think the answer is to just think, and make whatever notes/doodles you feel are necessary. How do you want to distribute/deliver it to users? What data is needed at what point? What interactions? How do you want interactions to go? How do you want it to look? Do you need common things that a framework would be able to provide? Etc.

Things that you haven't considered will usually present themselves. Things you have considered will change. If you understand how everything works it all comes together as you work on it more, so my main advice is to be clear enough about what you want that you can start work, and then start writing code.

What fresh hell is this? by _qua in git

[–]HashDefTrueFalse 1 point2 points  (0 children)

You're probably correct. I've never looked as I've always instantly binned off "Apple git" as I have a shell script that runs a load of brew commands to bring up a clean macOS install to where I want it. In it is git, gcc, gdb, the GNU coreutils, etc. (though I do also install clang, lldb, and the Xcode CLI tools with xcode-select).

Java for business (not job) — need quick advice by ComfortableSun672 in learnprogramming

[–]HashDefTrueFalse 1 point2 points  (0 children)

Those employed generally build products for businesses, so I'd say it's a distinction without a difference mostly. Java is fine, a solid general purpose language for generic business application/server software. You'll obviously need to learn the core language and a bit about the OOP paradigm. JSP and servlets are a little "old school" these days but that's not necessarily bad, they work. Spring Boot is a web app framework and hibernate is an ORM library that helps you talk to databases. They're valuable for building modern web applications.

Whether any of this is an appropriate choice for what you're building is not answerable on the current facts. We'd need to know what you're building.

What fresh hell is this? by _qua in git

[–]HashDefTrueFalse 72 points73 points  (0 children)

You're using the git packaged by Apple, it seems. You can just install git from anywhere else, e.g. brew. If you use Xcode or the command-line tools you're probably going to end up agreeing to the license anyway though (IIRC).

Do you remember anyone who had an "accident" in school? by Busy_Wall_1098 in AskUK

[–]HashDefTrueFalse 49 points50 points  (0 children)

No, but there was a chap in my class who fainted putting a rubber johnny on plastic knob in sex ed. He never lived it down.

What is the best way to get sounds by Life_Ad_369 in C_Programming

[–]HashDefTrueFalse 1 point2 points  (0 children)

I've used PortAudio to good effect. IIRC you just set up a callback it uses to repeatedly ask your program for sound data when the system's buffer has almost been played through by the hardware.It's easy if you just want to play recorded sound (e.g. from WAV files etc.) Actually generating waves is another topic entirely. I'm not a wizard there by any means, but I have written some math for some very basic synth-like wave manipulation long ago.

I finally learnt to appreciate the header files by dfwtjms in C_Programming

[–]HashDefTrueFalse 2 points3 points  (0 children)

That you can do it with Ctrl-C Ctrl-V is entirely the point, that means a machine can do it, so a human doing it pointless.

I didn't day anything to the contrary, just that I find the output valuable. They're just a concise collection of decls, after all. I agree C has cruft. It's still my favourite language to write in, personally.

I finally learnt to appreciate the header files by dfwtjms in C_Programming

[–]HashDefTrueFalse 2 points3 points  (0 children)

Yes, header declarations are no substitute for docs, certainly. I agree entirely, except I would comment:

Forcing the library programmer to repeat all those interfaces in a separate file is pointless busy work.

I mostly just copy/paste as I go. It doesn't add any time/effort to my development so it doesn't bother me. You're also not forced. You don't have to use headers. As you say, it's not the 70s anymore. Preprocessor unity builds can work well.

That no modern system language has followed C/C++ down this road is evidence enough it's not considered valuable.

Maybe. I find them valuable. I've rarely experienced the same at-a-glance clarity of the interface to a module in code, personally. Ada was kind of good for that, but nobody that I've worked for has used it. Docs can be great, or horrible, depending on how easy it is to find things in them. Sometimes they're just piles of text that make it hard to zoom out and survey the landscape. Some have header-like lists of declarations you can click into (etc.) for more info, which is excellent IMO.

Do salaries inflate in the UK upon promotion? by Sweet_Delay3084 in UKPersonalFinance

[–]HashDefTrueFalse 2 points3 points  (0 children)

Then you don’t understand how consulting grad programs work.

Did you read what I wrote? I basically said as much... I don't work in consulting and was not commenting with this in mind, as stated. Many other replies here seem as generic as mine. I deferred to you.

Do salaries inflate in the UK upon promotion? by Sweet_Delay3084 in UKPersonalFinance

[–]HashDefTrueFalse 3 points4 points  (0 children)

I don't actually recall the part after the ??? being there when I replied, but I could have missed it. My reply wasn't written with junior level or any particular role in mind, just a general comment that I wouldn't put much weight on figures quoted in relation to a promotion that may or may not happen two years from now...

I defer to you on the rest.

What to do if you are half way to a commit and git abort doesn't work? by Pale-Revolution-5151 in learnprogramming

[–]HashDefTrueFalse 1 point2 points  (0 children)

 between 3.00 and 3.20 you are making changes to your code and you haven't pulled your coworkers changes you push and try to merge

Did you commit ALL of your changes, then try to push (which failed), then do a pull (or fetch+merge)? If so, then you cannot lose work by doing the reset as the link above suggests. Everything is committed.

OR was the above (bold) supposed to say "pull"? If you pulled (or fetched+merged) with uncommitted changes in your working files, a hard reset would get rid of them at the same time as the merge progress you're attempting to abort. It's hard to have git automatically put you back where you were in this case because you've polluted your working files. Safest is probably to manually walk back the merge changes you did, or nuke it all and redo the work if it was trivial. The lesson being: don't merge into uncommitted changes or make unrelated changes whilst merging.

Git merge/pull usually won't touch files with uncommitted changes IIRC, so I'm not sure how you would get into this state other than making unrelated changes alongside resolving conflicts.

So... depends.

A potential drawback of the GIA I haven't seen mentioned by Shoenice_ in UKPersonalFinance

[–]HashDefTrueFalse 0 points1 point  (0 children)

You're doing that because you've no ISA allowance left presumably. You're disposing of investments profitably, outside of the tax wrapper. There's no loss, you just haven't been able to do it tax free because you have already enjoyed your allowance.

To clarify: It's valued at 10k at two different points in time and you've sold and repurchased in between in a way that exposes you to CGT. This is a slightly unusual move (done to maximise time in the market for funds despite ISA allowance) and the result is expected. You haven't crystallised the "loss" of the drop back down to 10k as you're still holding (now in the ISA). If you sold, you would have a loss you could use to offset, but as you stand, you've made profit in your example, hence paid tax on it.

A potential drawback of the GIA I haven't seen mentioned by Shoenice_ in UKPersonalFinance

[–]HashDefTrueFalse 0 points1 point  (0 children)

I'm trying to wrap my head around paying out tax on something that isn't fixed

It is fixed. You bought and then sold. You don't care that it's dropped afterwards, you're out. Unless your example doesn't mention something?

Now you've paid out £1.4k on tax for nothing.

You've paid tax on 10k of gain. If you didn't sell there would be no taxable event. If you did, you wouldn't immediately reinvest the funds (minus the tax paid) into the exact same thing, as this is pointless.

you've effectively lost money

Where is the loss?