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
81%
+7 −0
Q&A How to delete a remote branch in git?

The other answer already provides the more straighforward solution (push with --delete option). But there's an older syntax that also works: git push <remote-name> :<branch-name> N...

posted 2mo ago by hkotsubo‭

Answer
81%
+7 −0
Q&A How to verify if a year is leap in Java?

How to verify if a year is leap? Given a numeric value (such as 2023) or some object that represents a date (such as Date, Calendar, LocalDate, etc), how can I do it?

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

Question java date
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
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
81%
+7 −0
Meta 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 Git...

0 answers  ·  posted 2y ago by hkotsubo‭  ·  last activity 2y ago by Anonymous‭

81%
+7 −0
Q&A What problem does innerHTML solves?

tl;dr According to the documentation, innerHTML property "gets or sets the HTML or XML markup contained within the element". Basically, "that's all", but let's see it in more detail. It makes...

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

Answer
80%
+6 −0
Q&A Separate digits of a number in groups with different sizes

Before we start, I'd like to be a little bit pedantic regarding 00002451018 being a number. When we talk about numeric types/values, the zeroes at the beginning are irrelevant: 2, 02 and 000002 al...

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

Answer
80%
+6 −0
Q&A Why is git merge from rather than to?

I can't speak for the people who designed it, but I guess it was made this way because you can merge multiple branches all at once. Let's say I've created multiple branches: C---D => ...

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

Answer
80%
+6 −0
Q&A Is it OK to use scanf with a void pointer?

I've created a function that calls scanf passing a void pointer as argument: void read(const char *format, void *p) { scanf(format, p); } And tested it with different types: int n; read...

2 answers  ·  posted 2y ago by hkotsubo‭  ·  last activity 2y ago by Lundin‭

Question c pointers scanf
80%
+6 −0
Q&A When using the compare function in Array.prototype.sort, how to avoid an element to be processed more than once?

When using the Array.prototype.sort method, we can pass a compare function as argument. Then, this function can be used to process array's elements, so the comparison is made using some custom crit...

2 answers  ·  posted 2y ago by hkotsubo‭  ·  last activity 10mo ago by matthewsnyder‭

80%
+6 −0
Q&A Why object-oriented instead of class-oriented?

Why object-oriented instead of class-oriented? tl;dr Because you can "do OOP" without classes. Long answer A class is one possible way to implement object oriented programming. But it's n...

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

Answer
80%
+6 −0
Q&A Change font-family with JavaScript

To do that, you could change the selector from body to *, as the other answer said. By selecting only body, it won't change child elements that has defined a more specific rule, and that's why you ...

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

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

I've kinda found a very limited, not so elegant, far from ideal "solution", using replaceAll: String regex = "(?:([aeiou]+)[0-9]+|([123]+)[a-z]+)\\W+"; System.out.println("ae123.".replaceAll(regex,...

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

Answer
80%
+6 −0
Q&A How to parse a date with more than 3 decimal digits in the fractions of second?

The solution depends on the Java version you're using. First, let's see the solution for earlier versions, that doesn't use SimpleDateFormat. Then we'll see why the problem happens and alternatives...

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

Answer
80%
+6 −0
Q&A 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: SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM...

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

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
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
80%
+6 −0
Meta "Review suggested edit" page doesn't display Markdown source correctly

I recently suggested an edit to an answer. Basically, I formatted some code, adding code fences around it: But at the "Review suggested edit" page, the differences are not clearly displayed. I...

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

80%
+6 −0
Meta Can regular users add tag wikis? And what are the guidelines for creating them?

Checking the list of tags, I noticed that all of the tag wikis are empty, like this: I also noticed that I can't edit those info. Will it be possible for regular users to add tag wikis?1 And if th...

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

77%
+5 −0
Q&A Why is the switch statement not executing the correct case blocks?

The problem is the fallthrough behaviour of case statements. Basically, once a case's condition is met, all the others after that are also executed. Example: int x = 2; switch (x) { case 1: ...

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

Answer
77%
+5 −0
Q&A Understanding createTreeWalker method in the context of replacing strings (or parts of them)

How does storing replaced strings in the node variable makes a change in the text appearing to the end user? In your case, you're changing the textContent property. When accessed, it returns t...

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

Answer
77%
+5 −0
Q&A What are the types of DOM nodes?

any DOM "tree" node is actually a "branch" Not exactly. Document Object Model and Nodes According to the MDN documentation, the DOM (Document Object Model) is "the data representation of the...

posted 2y ago by hkotsubo‭

Answer
77%
+5 −0
Q&A Does a for...of loop must contain a variable without assignment sign, and why?

Does a for...of loop must contain a variable without assignment sign (=) Yes. and why? Because that's the syntax defined by the language specification. The people who defined it decided ...

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

Answer
77%
+5 −0
Q&A Recursion without a procedure ("function") in JavaScript

Yes, it's possible. In a more general way, every recursive algorithm can be converted to an iterative one (and vice-versa). You just need to use a stack. Internally, a recursive function will use...

posted 2y ago by hkotsubo‭

Answer
77%
+5 −0
Q&A How to use grep to print only specific word from a string

I wouldn't use grep. As the other answers already said, it's not the right tool for this job. Considering your specific case (fields separated by /), basename is the most straighforward way, as st...

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

Answer