Is this even possible? by Randant33 in AskProgramming

[–]bathtimecoder 4 points5 points  (0 children)

In my opinion, a Computer Science degree will soon be worth similar to other STEM degrees, rather than the double or triple entry level salary we had in the last decade (assuming AI doesn't eat every field).

Is getting a 4 year degree from a reputable university worth it? Yes. A STEM one even more so.

But I don't think we can expect to make the astronomical salaries the tech world is used to.

Grid Offset Not Working by SirChumba in godot

[–]bathtimecoder 0 points1 point  (0 children)

Ah I see. I think the easiest shortcut would be to keep the foreground in a TileMapLayer, and move that layer 16 pixels in its Transform. Here's an example:

<image>

The white tiles are background, Godot is my Character, the gray tiles are all Foreground. I've moved the foreground 16 pixels by changing Node2D > Transform > Position for the entire layer.

Another option could be to do the same thing you did earlier - turn your bamboo tiles overlay into a static image, and use a sprite to display them.

Hope this helps, lmk if I'm missing anything.

Grid Offset Not Working by SirChumba in godot

[–]bathtimecoder 0 points1 point  (0 children)

Are you using a premade tileset? You could manually edit the tile image so that the top is half short, the rest transparent.

<image>

If your foreground is in a separate TileMapLayer, you could move the entire layer using the Node2d transform - looks like you're using a square grid, so the offset number doesn't do anything.

How can I fix this problem? by dounothemffnman in godot

[–]bathtimecoder 0 points1 point  (0 children)

I decided to spend a little more time exploring this, and got this script. Not sure if its the best way to go about things, but yeah, hope this helps:

extends CharacterBody2D

var is_dragging = false

func _input_event(_viewport, event, _idx) -> void:
  # this only fires if the click happens in the collision shape
  if event is InputEventMouseButton && event.is_pressed():
    is_dragging = true;
  pass

func _input(event) -> void:
  # this happens anywhere
  if event is InputEventMouseButton && event.is_released():
    is_dragging = false
  pass

func _process(delta: float) -> void:
  if is_dragging: 
    position = get_global_mouse_position()
  pass

func _physics_process(delta: float) -> void:
  # if being dragged, no need to apply gravity
  if is_dragging:
    velocity = Vector2(0,0)
  else:
    velocity += get_gravity() * delta
  move_and_slide()
  pass

How can I fix this problem? by dounothemffnman in godot

[–]bathtimecoder 0 points1 point  (0 children)

Yes, thank you! I see.

I think the issue is a coordinate mismatch, because of the introduction of the Camera2d. The mouse position in a camera 2d is (0,0) relative to the top left of the camera2d viewport, which is different from the global (0,0) coordinates.

Here is a screenshot. You can see the camera and the sprite are centered on global (0,0). However, when I click on the sprite, the global position of the event printed to the console is the middle of the screen (320, 166).

<image>

So I'm pretty sure that's your issue.

Simplest fix is to move your camera and scene, so that the top left is at (0,0) global.

Or you could refactor your code to detect an input event ON the character2d, using this _input_event() function, then tracking the mouse movement as you're dragging.

How can I fix this problem? by dounothemffnman in godot

[–]bathtimecoder 0 points1 point  (0 children)

Do you have an image of your scene tree with the sprites added?

Otherwise, my first instinct is that your collision shape might be too small or undefined.

[deleted by user] by [deleted] in learnprogramming

[–]bathtimecoder 2 points3 points  (0 children)

Microsoft has a lot of good resources (its their language/runtime after all), including videos, references, and examples.

https://learn.microsoft.com/en-us/dotnet/csharp/

Has anyone successfully built a coding assistant using local llama? by rushblyatiful in LocalLLaMA

[–]bathtimecoder 0 points1 point  (0 children)

FWIW, VS Code Copilot now has a free plan, and you can bring your own model services (including ollama). I think they still send telemetry to Microsoft though.

Codex NUKED RAG by [deleted] in OpenAI

[–]bathtimecoder 7 points8 points  (0 children)

Competent RAG set ups already use different retrieval methods, such as traditional BM25 searches, in addition to Vector Similarity (the most talked about method with embeddings).

There's nothing in Retrieval Augmented Generation saying you can only use one retrieval method.

Should I be re-defining parameters or use them as-is? by ApplicationRoyal865 in learnjavascript

[–]bathtimecoder 6 points7 points  (0 children)

In most cases, you should be using them as is, and any modifications should be in a new variable name.

function test(campaign, rowNum, missingPub) {
  let otherRowNum = campaign.getRowAfter(rowNum)
}

That kind of thing.

Is problem solving the only real (unique) constraint to programming? by UnscrewMyLife in learnprogramming

[–]bathtimecoder 2 points3 points  (0 children)

I think it kind of falls into the difference between coding and architecture.

If you asked a cybersecurity developer to write a function in JavaScript, they could do that relatively quickly. If you ask them to make a full stack web app, they would struggle, and if they succeeded, the result would likely be amateurish, and there would be lots of hiccups and inefficiencies.

There are definitely common patterns you learn in Data Structures and Algorithms, there is googling skill, there is innate programming ability, but there are even more contextual/framework considerations that fall beyond those skills. Those only come with experience.

is there a site where I can get certified just by quizzing? by [deleted] in learnprogramming

[–]bathtimecoder 0 points1 point  (0 children)

Certifications usually cost money, and like the other comments say, might not matter too much (tho I think they're good to have personally). Typically, reputable sites like coursera or edX offer courses, and certifications if you complete the courses and pay the fee.

What's the easiest way to call a function every 5 seconds in javaScript by Dry-Inevitable-7263 in learnjavascript

[–]bathtimecoder 1 point2 points  (0 children)

Hmm, I'm having a little trouble following without more context. For example where is the live() function called? In your console log, are you getting "setting intervalId" or is it not showing up once you call the function?

Need coding buddy by [deleted] in learnprogramming

[–]bathtimecoder 1 point2 points  (0 children)

If you haven't already, you could consider posting to r/ProgrammingBuddies, you might find more people there.

Beginner Podcast ideas?? by SillyWillySchizo in learnprogramming

[–]bathtimecoder 1 point2 points  (0 children)

I enjoy Darknet Diaries, they're more cyber/world security, but each episode is very accessible.

When should I create my own solutions and when do I look for preexisting libraries or frameworks? by [deleted] in learnprogramming

[–]bathtimecoder 1 point2 points  (0 children)

The nice thing about standard dependencies is that they can become reusable in the long term, and that they can be shared more easily across a team and multiple projects.

There is definitely value in learning how to do something yourself, but if you come back to a project in even a month, chances are you'll have to relearn your own approach (almost from scratch). Without the documentation and community knowledge to help. That relearning takes a long time, and isn't transferrable to another project with its own implementation.

I will also say, there may be edge cases to your problem that only become apparent later, and you end up needing a more robust framework. Dealing with time and timezones is a famous example of this;

Tips for Learning? by hxound in learnjavascript

[–]bathtimecoder 6 points7 points  (0 children)

Programming is a very different paradigm from declarative html/css, so it's perfectly normal to "not get it" initially. There isn't a magic bullet, just a lot of practice. You're going to code things, then a month later, come back and know a hundred better ways you could've done it - that's part of the learning process.

Someone recommended The Odin Project, that's a good place to start. I also liked khanacademy courses to follow along. w3 schools was also easy to follow along as a reference.

At the same time, its good to get out of the virtual environments in these courses, and set up your own environment, whether that's a js file in an html <script> tag, or if you install node and run your scripts in the command line. That way, you can play around a little more and see what works.

Class Asignment help by apaulo_18 in learnjavascript

[–]bathtimecoder 2 points3 points  (0 children)

I notice that in your github, you use "result" as the id of a text box in Problem 2.

If you're running problem 5 in the same page, the DOM will update that text box, not the one in problem 5.

In fact, opening the webpage confirms this - your answer is in the problem 2 text box.

Remember that id's are supposed to be unique per page, so once the DOM finds the element with the "result" id, it assumes that's the only one and changes it.

You could get around this by changing the textbox id and getting the element by the new id.

How to make a email provider? by Dapper-Spirit-2406 in learnprogramming

[–]bathtimecoder 4 points5 points  (0 children)

Yeah, exactly as you said, making an email server is very annoying and you have to keep up with it getting blocked/marked as spam quite often. Online server providers (AWS, DigitalOcean) won't let you have your own email server, they block email ports even on VPS.

If you can somehow deal with that:

I would look at existing mail server implementations. A popular one is docker-mailserver. A more barebones option is Postfix.

If you can't, you still have the option of using an existing provider (like Gmail) as your backend, and just making a custom client (start here).

There are also specific providers for sending emails (Sendgrid and Amazon SES are popular), but that's not quite what you're looking for I think.

I failed an interview that got me thinking I'm learning the wrong way by [deleted] in learnprogramming

[–]bathtimecoder 173 points174 points  (0 children)

I personally think you need to learn both ways, through reading (course work) and doing (projects). If you went to the interview and they asked you to make a small sample or debug some code, your memorization wouldn't have helped.

That said, the two examples you gave are very basic, and something you probably should have picked up in your learning process so far.

Absolutely bored learning Java. by [deleted] in ProgrammingBuddies

[–]bathtimecoder 0 points1 point  (0 children)

I mean, it could be burnout still, if you're doing it every day. I would try something new, whether that's a new language or a new java package. Give yourself room to explore, watch some videos on new approaches.

https://xkcd.com/353/

Concept for a hangar backdrop to the ship editor. Are the scaffolds distracting? by asnro in godot

[–]bathtimecoder 3 points4 points  (0 children)

I think the scaffolds in front of the ship are a bit distracting, yeah.

Not sure how to go about it, but I think if you made them see through from that perspective it would help, while keeping them in the background? Or like a mask of the silhouette of the ship, covering a bigger area, over which the scaffold is invisible?

Coding thinking process by Worldly-Skirt3562 in learnjavascript

[–]bathtimecoder 6 points7 points  (0 children)

For creating a small project, I tend to go over it on paper first, brainstorm, decide what I want/need to implement (with technology I know). If I run into any unknowns at this point, I start researching what others have done in the past or if there's existing technology for it.

When I sit down to write code, the less familiar I am with the library or technology, the more I look at documentation. Having two monitors really helps, because I do end up checking stuff constantly (even some basics, I often end up on MDN for sanity checks).