Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Activity for hkotsuboâ€
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Question | — |
How to parse a date with more than 3 decimal digits in the fractions of second? I'm using `SimpleDateFormat` to parse a string containing a date/time, but the result has a different date, hour, minute, second and millisecond: ```java SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS"); Date date = sdf.parse("2021-10-01T10:30:45.123456789"); Syste... (more) |
— | over 3 years ago |
Edit | Post #283597 |
Post edited: |
— | over 3 years ago |
Edit | Post #283597 |
Post edited: |
— | over 3 years ago |
Edit | Post #283597 |
Post edited: |
— | over 3 years ago |
Comment | Post #283596 |
I've updated my answer, now that I confirmed that `example` is the `ul`'s class (more) |
— | over 3 years ago |
Edit | Post #283597 |
Post edited: |
— | over 3 years ago |
Edit | Post #283597 | Initial revision | — | over 3 years ago |
Answer | — |
A: Function.prototype.call() TL;DR To count the number of `li` items, just do: ```javascript console.log(document.querySelectorAll('ul.example > li').length); ``` That's all, no need to complicate with `filter.call` (but I'll explain that too, hang on). Adapt that to your HTML Of course you could change the se... (more) |
— | over 3 years ago |
Comment | Post #283596 |
You don't need to add everything, just the first 4 or 5 lines or so. I just want to confirm if `example` is the `ul`'s class (more) |
— | over 3 years ago |
Comment | Post #283596 |
Also, if you're testing the code in browser's console, that explains the `undefined`, because calling `console.log(whatever)` in browser's console prints the `whatever` value and also prints the return of `console.log` function (which is `undefined`). Anyway, please confirm where/how you're testing t... (more) |
— | over 3 years ago |
Comment | Post #283596 |
Can you provide an example of the HTML? I'm assuming that `.example` refers to the `ul` element, but it'd be nice if you could confirm that (more) |
— | over 3 years ago |
Edit | Post #282855 |
Post edited: |
— | over 3 years ago |
Edit | Post #282855 |
Post edited: |
— | over 3 years ago |
Suggested Edit | Post #283196 |
Suggested edit: Fixed code block and rephrased a little (more) |
helpful | over 3 years ago |
Comment | Post #283058 |
@#53305 Thanks! Regarding "celebrate excellent answers", perhaps something similar to bounties? I don't know, there are some discussions about not having rep at all, so maybe we'll need another way to do it... (more) |
— | over 3 years ago |
Edit | Post #283058 |
Post edited: |
— | over 3 years ago |
Edit | Post #283058 |
Post edited: |
— | over 3 years ago |
Edit | Post #283059 |
Post edited: |
— | over 3 years ago |
Edit | Post #283059 | Initial revision | — | over 3 years ago |
Question | — |
Enable syntax highlighting for D language According to this answer, Codidact uses highlight.js for syntax highlight, and "support whatever languages are enabled by default in that package". And according to this table (in highlight.js GitHub), D language is enabled by default (no need for additional packages), but it also says that "our d... (more) |
— | over 3 years ago |
Edit | Post #283058 |
Post edited: use D syntax highlight in code blocks |
— | over 3 years ago |
Edit | Post #283058 |
Post edited: |
— | over 3 years ago |
Edit | Post #283058 | Initial revision | — | over 3 years ago |
Answer | — |
A: How to get string length in D? > what ways can I get a string's length in D? There are many different ways, and that will depend on the content of the strings, their types, and how you define the terms "character" and "length". If you're dealing only with ASCII characters, using `length` - as pointed by the other answers - w... (more) |
— | over 3 years ago |
Edit | Post #282908 |
Post edited: |
— | over 3 years ago |
Edit | Post #282908 | Initial revision | — | over 3 years ago |
Answer | — |
A: What's the difference between =, == and === operators in JavaScript? Assignment (`=`) `=` is the assignment operator: it assigns a value to "something". One important detail is that an assignment expression not only assigns a value, but it also returns it. This allows chaining, such as: ```javascript x = y = z = 1; // all variables will be assigned the value... (more) |
— | over 3 years ago |
Edit | Post #282855 |
Post edited: |
— | over 3 years ago |
Edit | Post #282855 |
Post edited: |
— | over 3 years ago |
Edit | Post #282855 | Initial revision | — | over 3 years ago |
Answer | — |
A: What's the difference between Inheritance and Polymorphism? > What you're asking is a very broad topic, and it'd require entire books to cover everything. For the sake of simplicify, I'll just stick to the basics. Inheritance Inheritance can be explained as an "is a" relation, or a specialization of a especific type. Borrowing (and extending) the e... (more) |
— | over 3 years ago |
Edit | Post #282832 |
Post edited: I've tried to rephrase the question, making it more clear and focused (also, removed tag with typo and replaced by one with correct spelling) |
— | over 3 years ago |
Suggested Edit | Post #282832 |
Suggested edit: I've tried to rephrase the question, making it more clear and focused (also, removed tag with typo and replaced by one with correct spelling) (more) |
helpful | over 3 years ago |
Edit | Post #282753 |
Post edited: |
— | over 3 years ago |
Comment | Post #282752 |
Yes, in this case, if you merge only branch A, it won't include B. Another alternative is to apply specific commits, using `cherry-pick`: https://git-scm.com/docs/git-cherry-pick (more) |
— | over 3 years ago |
Edit | Post #282753 |
Post edited: |
— | over 3 years ago |
Edit | Post #282753 |
Post edited: |
— | over 3 years ago |
Edit | Post #282753 |
Post edited: |
— | over 3 years ago |
Comment | Post #282752 |
I've answered the first part (merge both A and B). Regarding the second part ("*backport feature-A without bringing along feature-B in the future*"), I didn't understand what you want to do... (more) |
— | over 3 years ago |
Edit | Post #282753 | Initial revision | — | over 3 years ago |
Answer | — |
A: What's the correct way to merge a branch and its dependent branch back to master? > I think a branch is a set of commits Well, technically no, it's not. But first things first. DAG (Directed Acyclic Graph) Personally, Git became much more easier to understand after I've read things like this. The "whoa" moment was when it compares Git to a DAG (Directed Acyclic Grap... (more) |
— | over 3 years ago |
Comment | Post #282752 |
I'm guessing that `feature/null-rows-VER-74021-VER-75002` is branch A and `feature/ct-comparisons-VER-75425` is branch B, and you want to merge both to master, right? (more) |
— | over 3 years ago |
Comment | Post #282752 |
If I understood correctly, just merging B is enough, as B was branched from A (thus, B "contains" all A commits, as there were no further commits in A). Can you add the output of `git log --graph --format="%ad %h [%p] %d"`, just to confirm how your repo history is? (more) |
— | over 3 years ago |
Comment | Post #282732 |
With HTML, you can't. You could use another script language, but I don't know of any that is supported by all browsers (at least not widely supported like JavaScript is) (more) |
— | over 3 years ago |
Comment | Post #282673 |
@#8046 I saw that the post is working now, but the OP user is not deleted. Was the user restored? I'm just curious to know what happened. Anyway, thanks for fixing it!
(more) |
— | over 3 years ago |
Edit | Post #282673 | Initial revision | — | over 3 years ago |
Question | — |
Error 500 in one specific post (the rest of the site is fine) I've got a HTTP Error 500 when trying to access this post. Here's the quote error ID's: `ef4f6ec1-8d0f-4be3-9553-36e01b5f01c4` and `bbeb9bf9-2c58-43b1-be05-c9e914bb80bf`. I've browsed to another posts and pages and all of them are working fine. It seems that only that specific post causes the... (more) |
— | over 3 years ago |
Comment | Post #282670 |
`while (min < max)` - this is an infinite loop, because both `min` and `max` never change their values anywhere in the loop. Thus, `i` ends up accessing some position out of the array's bounds, which usually causes a segfault - I didn't test the code to see if there are more problems, but at a first ... (more) |
— | over 3 years ago |
Comment | Post #282532 |
If I understood correctly, **maybe** what you actually need is a Static Site Generator: https://snipcart.com/blog/choose-best-static-site-generator (I use Jekyll for my personal blog, BTW). Not sure if that's what you're looking for, but take a look at the concept in general, maybe it's a different a... (more) |
— | over 3 years ago |
Edit | Post #282544 |
Post edited: Improved grammar, formatted code |
— | over 3 years ago |