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.

Posts by hkotsubo‭

81 posts
85%
+10 −0
Q&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 explai...

posted 3y ago by hkotsubo‭  ·  edited 2y ago by hkotsubo‭

Answer
89%
+15 −0
Q&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 r...

posted 3y ago by hkotsubo‭  ·  edited 2y ago by hkotsubo‭

Answer
75%
+4 −0
Meta 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 pos...

0 answers  ·  posted 3y ago by hkotsubo‭  ·  edited 3y ago by Monica Cellio‭

81%
+7 −0
Q&A Accessibility standard/s for multilined <input type="text"> fields

The standard for multi-line text input is to use a textarea. Don't use input type="text", it won't work. I'm not sure why you don't want to use a textarea, but after reading this answer, I hope you...

posted 3y ago by hkotsubo‭  ·  edited 3y ago by hkotsubo‭

Answer
85%
+10 −0
Q&A Where did my proper divisor sum program went wrong?

When you do x=y=z=[], you're making x, y and z point to the same list. Example: x=y=z=[] # add element to x x.append(1) # add element to y y.append(2) # but x, y and z all point to the same l...

posted 3y ago by hkotsubo‭  ·  edited 3y ago by hkotsubo‭

Answer
77%
+5 −0
Code Reviews Detecting balanced parentheses in Python

Instead of replacing the brackets, you could do just one loop, and keep a stack with the opening brackets. Every time you find a closing bracket, check if it corresponds to the stack top: if it's n...

posted 3y ago by hkotsubo‭  ·  edited 3y ago by hkotsubo‭

Answer
83%
+8 −0
Code Reviews Counting Sundays without Python datetime module

First of all, I've added a print in your code to show the dates: if days % 7 == 0 and current_day == 1: print(f'{current_year}-{current_month:>02}-{current_day:>02}') sundays += 1 ...

posted 3y ago by hkotsubo‭

Answer
66%
+2 −0
Q&A How can I emulate regular expression's branch reset in Java?

Currently, Java 16 is the latest version, and there's no support to branch reset yet. But one - still far from ideal - alternative is to use lookarounds: Pattern pattern = Pattern.compile("([aeiou...

posted 3y ago by hkotsubo‭

Answer
88%
+13 −0
Q&A What does the "\s" shorthand match?

The complete set of characters matched by the \s shorthand varies according to the language/API/tool/engine you're using. In addition to that, there might be configurations that change this behavi...

posted 3y ago by hkotsubo‭  ·  edited 2y ago by hkotsubo‭

Answer
85%
+10 −0
Q&A What does the "\s" shorthand match?

I've seen some regular expressions (regex) using \s when they want to match a space, but I noticed that it also matches line breaks. Example: the regex [a-z]\s[0-9] (lowercase ASCII letter, follow...

1 answer  ·  posted 3y ago by hkotsubo‭  ·  last activity 2y ago by hkotsubo‭

Question regex whitespace
81%
+7 −0
Q&A Why is this client code getting the wrong date for a few hours a day?

First of all, we need to understand what a JavaScript Date actually is. And surprisingly, it's not exactly a date (at least not in terms of having unique values for day, month, year, hour, minute a...

posted 3y ago by hkotsubo‭  ·  edited 3y ago by hkotsubo‭

Answer
75%
+4 −0
Meta Text with many diacritic marks are not displayed correctly in posts

When posting this question, I noticed a difference between editor's preview and the post's final render. When editing, the preview correctly shows the Zalgo Text: But after the post is saved, i...

1 answer  ·  posted 3y ago by hkotsubo‭  ·  edited 3y ago by ArtOfCode‭

Question bug status-declined
92%
+22 −0
Q&A How does Zalgo Text work, and how can I prevent my application from accepting it?

First, let's see how Zalgo Text works. Unicode Combining Characters Unicode defines the concept of combining characters. Basically, some characters can be combined with others, to "make/create"...

posted 3y ago by hkotsubo‭  ·  edited 5mo ago by hkotsubo‭

Answer
88%
+14 −0
Q&A How does Zalgo Text work, and how can I prevent my application from accepting it?

A Zalgo Text is something like this: T̃͟͏̧̟͓̯̘͓͙͔o̤̫͋ͯͫ̂ ̥͍̫̻͚̦͖͇̌ͪ̇ͤ̑̐͋̾̕i̢͖̩͙͐͑ͬ̄̿̍̚ͅn̵̢̼̙̳̒̄ͥ̋̐v̡̟̗̹̻̜͕̲ͣ̐ͤͤ͒́oͫ͂̆͑ͩ҉͇̰͚̹̠̫͔̗k̷̭̬̭͙̹̺̯ͩ̌̾̒̋̓ͤ͛͘͠e̥͙̓̄̕ ̵̫͈ͪţ̱̺̺̑̿̉̌͛̂̇h͙̣̬̓̂͞ę̡̲̟͎͉̟͛̓̉̆̉͘ ͬ̒...

1 answer  ·  posted 3y ago by hkotsubo‭  ·  last activity 5mo ago by hkotsubo‭

Question string character
81%
+7 −0
Q&A SQL timestamp for daylight saving day when clock goes 1 hour back.

This behaviour is documented here: "... an ambiguous timestamp that could fall on either side of a jump-back transition is assigned the UTC offset that prevailed just after the transition." S...

posted 3y ago by hkotsubo‭  ·  edited 3y ago by hkotsubo‭

Answer
80%
+6 −0
Q&A How to match standard email addresses with regex?

Matching a valid email address can be as complicated as you want it to be. If you want to be compliant with RFC 5322, the regex will be a monster (see below). But if you want a subset of it, with...

posted 3y ago by hkotsubo‭  ·  edited 3y ago by hkotsubo‭

Answer
71%
+3 −0
Meta Border-bottom of inline code is (sometimes) not displayed when it's in the last line of a paragraph

After I wrote this answer, I could notice that, when there's inline code in the last line of a paragraph, sometimes the border-bottom of the inline code text is not displayed. One case is when the...

0 answers  ·  posted 3y ago by hkotsubo‭  ·  edited 3y ago by Monica Cellio‭

84%
+9 −0
Q&A What are field separators in operating-programming languages (such as Bash)?

In Bash, IFS is an internal variable and it stands for "Internal Field Separator" <- according to this link, it "determines how Bash recognizes fields, or word boundaries, when it interprets cha...

posted 3y ago by hkotsubo‭  ·  edited 3y ago by hkotsubo‭

Answer
84%
+9 −0
Q&A Python Regex to parse multiple "word. word. word."

First of all, let's understand why your regex didn't work. The first part is \w+\.\s, which is "one or more alpha-numeric characters" (\w+), followed by a dot and a space (\.\s). If the regex was ...

posted 3y ago by hkotsubo‭  ·  edited 2y ago by hkotsubo‭

Answer
71%
+3 −0
Meta I can't choose any tags when posting a question

The problem described below occurs in Windows 10 and Chrome 87.0.4280.66 (64 bits, JavaScript enabled). I could post this question only in mobile (Chrome/iOS 14.2), where the problem doesn't occur....

0 answers  ·  posted 3y ago by hkotsubo‭  ·  edited 5mo ago by hkotsubo‭

66%
+2 −0
Meta Error 500 when trying to comment

I've tried to post a comment in this question, and when I clicked in "Post" button, I've got this error message: 500 Internal Server Error If you are the administrator of this website, then ple...

0 answers  ·  posted 3y ago by hkotsubo‭  ·  edited 3y ago by Monica Cellio‭

66%
+2 −0
Meta I answered a question that was deleted, then undeleted, and my answer disappeared

Yesterday I answered this question. This morning, when I visited site, the question has disappeared, so my guess is that it was deleted. But now I saw that it was undeleted (I initially thought t...

1 answer  ·  posted 3y ago by hkotsubo‭  ·  edited 3y ago by Monica Cellio‭

66%
+2 −0
Q&A How can I write an egrep (grep -E) regexp that matches lines containing two stanzas in arbitrary order?

Can that even be done without having to repeat either or resorting to more advanced processing than pure regular expressions I don't think it can. If you don't want to repeat x1=y2 and c5=d6, you...

posted 3y ago by hkotsubo‭  ·  edited 3y ago by hkotsubo‭

Answer
85%
+10 −0
Q&A Can regex be used to check if input conforms to a very strict subset of HTML?

tl;dr Although it can be done with regex (and work for "most" cases), I still prefer to use a parser. Long answer I'd use something such as DOMParser to do the job: let validTags = ['p', 'span', 'b...

posted 3y ago by hkotsubo‭  ·  edited 3y ago by hkotsubo‭

Answer
80%
+6 −0
Q&A Function call; `this` gets bound to unexpected value

This MDN link might help to explain that: When a function is called as a method of an object, its this is set to the object the method is called on. Which is your first example (calling obj.a())....

posted 3y ago by hkotsubo‭  ·  edited 3y ago by Alexei‭

Answer