Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

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
Comment Post #284103 A simple approach is to have a dictionary (so you store as `vars['x'] = x_value`). Of course this doesn't handle different scopes, but for a very simple interpreter, it's a starting point... As a side note, this has absolutely nothing to do with being OOP or not.
(more)
over 2 years ago
Comment Post #283975 If I understood correctly, `require` seems to be the way to go. If you're getting an infinite loop, the problem probably isn't `require` itself, but something that the required script is doing
(more)
over 2 years ago
Comment Post #277488 For anyone wondering about the "demons flying out of the nose" meme, [here's the relevant link](https://groups.google.com/g/comp.std.c/c/ycpVKxTZkgw/m/S2hHdTbv4d8J?hl=en)
(more)
over 2 years ago
Comment Post #283861 I'd appreciate the nomination, but I'm not willing to be a moderator, nor do I have the condition to do it right now. If this changes in the future, I'll let y'all know, but for now, I'm afraid I can't.
(more)
over 2 years ago
Comment Post #283839 Regarding warnings, they're usually meant to tell you "*Hey, there's something strange here, you should take a look*". You shouldn't ignore them, unless there's a very good reason - which is not the case of your code, IMO.
(more)
over 2 years ago
Comment Post #283839 Yes, it can crash, because this leads to undefined behaviour. Try to search for a number that's not in the array, what will it return? I've tested in a Ubuntu machine, with g++ (it returns `6`) and clang++ (*Illegal instruction* error), but as all undefined behaviours, this can vary a lot. IMO, you s...
(more)
over 2 years ago
Comment Post #283712 Although it "works", it's not the only solution (and IMO, not even the best - for many reasons that don't fit in this space, I usually don't consider global variables as my first choice). You could pass the variable as an argument to the function, for example (or, depending on what you need, make the...
(more)
over 2 years ago
Comment Post #283596 I've updated my answer, now that I confirmed that `example` is the `ul`'s class
(more)
over 2 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 2 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 2 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 2 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)
almost 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)
almost 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)
almost 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)
almost 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)
almost 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)
almost 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)
almost 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)
almost 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)
almost 3 years ago
Comment Post #282532 Perhaps you should edit and clarify the question. At least for me, I'm failing to see what the actual problem is. Why can't you use PHP (as you confirmed you're already using) as some `include`'s will do the job, and why limiting the number of lines is such a serious issue/requirement (so "serious" t...
(more)
almost 3 years ago
Comment Post #282532 I'm afraid you're focusing on the wrong issues. 80 lines is not large, and nesting is good to make things easy and convenient for the dev team: it makes the code clearer and easier to understand and maintain (on the other hand, keeping everything in one non-nested line just for the sake of having few...
(more)
almost 3 years ago
Comment Post #282525 I've seen those being called "single page" and "multi page" forms. But I don't believe there's a formal standard for that
(more)
almost 3 years ago
Comment Post #282487 If we're meant to be pedantic/technically accurate, we'd never call it "string", but if you call it that way, people - at least anyone familiar with the language - will usually know that you actually mean "*a contiguous sequence of chars terminated by the null character (`\0`)*" (regardless of how it...
(more)
almost 3 years ago
Comment Post #282487 @Istiak‭ Actually, it's a little bit more complicated than that. A pointer to some type `T` is, let's say, "interchangeable" with an array of `T` (actually, the pointer points to the array's first element). In C, a string is actually an array of chars (terminated by `\0`), so a `char *` (a pointer to...
(more)
almost 3 years ago
Comment Post #282344 `input type="text"` is single line by definition. If you want multiline input, use a `textarea` - unless there's a good reason to not use it (and I don't see - and can't imagine - any reason for that)
(more)
almost 3 years ago
Comment Post #282283 @elgonzo There's still the challenge of code-golfing the code (make it as small as possible). But as I said, I'm not the best one to suggest anything about that, so it's "left as an exercise to the reader (aka Derrick)" :-)
(more)
almost 3 years ago
Comment Post #282233 @elgonzo AFAIK, lists in Python can't be preallocated. You can create one with N elements, and then use those already-created spaces. I've tested here, but that didn't make the code much faster.
(more)
almost 3 years ago
Comment Post #282233 And the `timeit` module already takes care of most "disturbances", and does the tests as clean as possible, running each test lots of times and doing some other stuff that I admit I don't fully know (but I've read some docs mentioning some things it does to eliminate any disturbances). Anyway, I incr...
(more)
almost 3 years ago
Comment Post #282233 @elgonzo The "unbalanced in the beginning" took `1.2465003237593919e-05` seconds - note the scientific notation, with "e-05" in the end, which actually means `0.0000124...` seconds.
(more)
almost 3 years ago
Comment Post #281886 Actually, `print` will add a new line if you set `$\ = "\n"`. The doc mentions that: "*If the output record separator (`$\`) is not `nil`, it is appended to the output*" - as the [default value is `nil`](https://ruby-doc.org/docs/ruby-doc-bundle/Manual/man-1.4/variable.html#bslash), `print` won't nor...
(more)
almost 3 years ago
Comment Post #281871 Actually, `print` will add a new line if you set `$\ = "\n"`
(more)
almost 3 years ago
Comment Post #281762 From my experience, the main issue in any ticket system is when users can't explain their problem with enough details (and we need to contact them to get those details). Markdown, as a markup language, (with **formatting purposes only**), wouldn't help to solve this problem - because it's a communica...
(more)
almost 3 years ago
Comment Post #281585 I agree that in most cases we simply shouldn't do it. But the main subject of the question is Zalgo Text, so how could I show an example without actually showing it? I believe the question is a valid case where this should be done, otherwise the post would lack important information. Anyway, if the d...
(more)
about 3 years ago
Comment Post #281555 I recognize this is probably a minor issue, as text like that will be rarely used in posts, so I don't mind if this issue gets low priority.
(more)
about 3 years ago
Comment Post #281511 I guess "*passwords and other data*" refer to the passwords themselves saved in your browser config (so it offers an option to auto-fill login forms). After you login, each website might set a cookie with your token/credential info, but Chrome has no way to know which cookies are related to authentic...
(more)
about 3 years ago
Comment Post #281288 When handling dates in a system, one should prefer to send/receive in a standard format (to make parsing easier), and only when presenting this to users, a specific localized format is chosen - BTW, that's exactly what browsers (and probably your mail client) do: internally, the `input` value is in I...
(more)
about 3 years ago
Comment Post #281288 Date formats are specific to locale/culture/country/etc. What makes sense to one doesn't necessarily make to another (in Japan, the "normal" order is year-month-day, in USA, month-day-year, and so on - nobody is "wrong"). But ISO 8601 is not intended to be locale oriented, because it was designed to ...
(more)
about 3 years ago
Comment Post #281288 ISO 8601 is intended to be "locale agnostic" and unambiguous, and this "biggest to smallest units" approach is IMO a good choice, with advantages already pointed by previous comments. It's an information exchange format, not a human friendly one (although it *is* friendly once you get used to it)
(more)
about 3 years ago
Comment Post #281288 According [to MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date), the displayed format of `input type=date` can change according to the browser's locale. My guess is that mail clients might do something similar when interpreting HTML. Not sure if this can be changed (without s...
(more)
about 3 years ago
Comment Post #281036 @MonicaCellio I noticed that it also happens in other sites (example: https://meta.codidact.com/posts/281048) - Would it be worth posting this problem in Codidact Meta? Or having it just here is enough?
(more)
about 3 years ago
Comment Post #280959 @CodeFarmer I've upated the answer, but based on your edit, I think the options that I've had previously suggested might work
(more)
about 3 years ago
Comment Post #280933 You're closing the parentheses before `format`, so you're calling `format` on the value returned by `print` (which is `None`). It should be `print("{} {}".format(inspect.currentframe().f_code.co_name, path.basename(__file__)))` - https://ideone.com/4z9NRl
(more)
about 3 years ago
Comment Post #279716 @MonicaCellio Now it's working. Also, I could post this comment, so the other problem that I reported ([this one](https://software.codidact.com/posts/279715)) seems to be fixed as well
(more)
over 3 years ago
Comment Post #279715 @Someone I noticed that the notification inbox is not working, but only in some pages. Couldn't find a pattern though
(more)
over 3 years ago
Comment Post #279716 @ArtOfCode Yes, I do. I've also added some more info, maybe it helps
(more)
over 3 years ago
Comment Post #279611 The answers are restored, thanks!
(more)
over 3 years ago
Comment Post #279609 @MonicaCellio The answers are restored, thanks!
(more)
over 3 years ago
Comment Post #279611 Thanks for the quick response. Good luck!
(more)
over 3 years ago
Comment Post #278540 In regex, parentheses create a capturing group (which means that anything that matches the expression inside them becomes a separate group). My guess is that, when a group is present, only its contents are kept and the rest are ignored/removed - I couldn't find any info about that in the docs, though...
(more)
over 3 years ago