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‭

89 posts
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 4y ago by hkotsubo‭  ·  edited 4y ago by hkotsubo‭

Answer
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 4y ago by hkotsubo‭  ·  edited 4y ago by Monica Cellio‭

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 4y ago by hkotsubo‭  ·  edited 4y ago by Monica Cellio‭

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
66%
+2 −0
Meta Is there a workaround to highlight code blocks if the language doesn't have syntax highlight enabled?

I've seen that recently two requests to add syntax highlight to some languages were deferred (this and this). According to the status-deferred tag description: "the requested feature will not be i...

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

66%
+2 −0
Q&A How to run a remote JavaScript file from GitHub?

As you're using userscripts, I'm assuming this code is supposed to run in a browser. Hence, you could download the scripts and add its contents to the page's DOM (by using a script element). For t...

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

Answer
66%
+2 −0
Q&A How can the Caesar cipher be implemented in Java?

Caesar Cipher originally deals only with letters (ASCII "A" to "Z", without diacritics/accents), so I'm not sure why you included ۤ$%& in your answer. And using indexOf (as you did) is not ver...

posted 3y ago by hkotsubo‭

Answer
66%
+2 −0
Q&A Delete all occurrences of a character in a webpage with vanilla JavaScript

Some comments and your answer are doing this: document.body.innerHTML = document.body.innerHTML.replace(/x/g, '*'); But as explained in the comments, this is not a good solution, because it can...

posted 2y ago by hkotsubo‭

Answer
60%
+1 −0
Q&A What input functions can I use in TIO's PHP?

You could use fgets to read from STDIN. And to print the message, just use the short tag (<?= whatever, which is a shorthand to <?php echo whatever; ?>): <?='Hello, '.fgets(STDIN).'!'...

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

Answer
60%
+1 −0
Q&A Are there practical reasons for designing a method-only class/object?

It depends. Regarding "grouping functions/methods": as a general rule, you should group things that make sense to be together. Yes, it's a very broad and generic rule, and somewhat subjective. How...

posted 3y ago by hkotsubo‭

Answer
60%
+1 −0
Q&A How to uncollapse the first and second tiers of a link tree in JavaScript?

According to the documentation, the hasAttribute method expects only one argument (the attribute's name), and it tells only if that attribute is present, regardless of its value. Hence, the return ...

posted 2y ago by hkotsubo‭

Answer
60%
+1 −0
Q&A How to group a flat list of attributes into a nested lists?

You could create a dictionary to map each attribute to its respective list of items. Then you get the dictionary values to create the final list. Something like this: import re pattern = re.comp...

posted 9mo ago by hkotsubo‭  ·  edited 9mo ago by hkotsubo‭

Answer
50%
+0 −0
Q&A Mocking methods with arguments

Based on your answer, I guess you just wanted to have a list of unique arguments that were passed to B::add. In that case, you could use a Set instead of a List: // "Type" is whatever type B:add r...

posted 3y ago by hkotsubo‭

Answer
50%
+0 −0
Q&A In javascript is there really a good reason to never check for boolean true || false such as if(var){}else{}?

As mentioned in another answer, when you have code such as if (someVar), you're subject to truthiness. To be more precise, this code will run under the rules of Boolean coercion. In JavaScript, wh...

posted 7mo ago by hkotsubo‭  ·  edited 7mo ago by hkotsubo‭

Answer