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 | — |
"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: suggest edit - editor shows newlines But at the "Review suggested edit" page, the differences are not clearly displayed. It shows all the answer text in a single "line": pending e... (more) |
— | over 4 years ago |
Suggested Edit | Post #277331 |
Suggested edit: formatting (more) |
helpful | over 4 years ago |
Edit | Post #277397 | Initial revision | — | over 4 years ago |
Answer | — |
A: Why don't format specifiers work with lists, dictionaries and other objects? When you use the variable without any format specifier (`print(f'{variable}')`), internally its `str` method is called. Considering your `Test` class, it already has this method: ```python class Test: def init(self, valor): self.valor = valor def str(self): print('c... (more) |
— | over 4 years ago |
Edit | Post #277396 | Initial revision | — | over 4 years ago |
Question | — |
Why don't format specifiers work with lists, dictionaries and other objects? When I want to print a number or a string, I can use f-strings (Python >= 3.6) or `str.format`, and I can use just the variable between braces, or use format specifiers. Ex: ```python num, text = 10, 'abc' passing just the variables print(f'{num} {text}') or #print('{} {}'.format(num, text)... (more) |
— | over 4 years ago |
Edit | Post #277331 | Post edited | — | over 4 years ago |
Suggested Edit | Post #277331 |
Suggested edit: Formatting (more) |
helpful | over 4 years ago |
Comment | Post #277232 |
I like the idea of using categories, we could use them to have canonical articles, and tag wikis would be restricted to usage instructions (perhaps with a link to the corresponding article?). Not sure about the category name and guidelines though - if I think of something, I'll post as another meta q... (more) |
— | over 4 years ago |
Edit | Post #277225 |
Post edited: |
— | over 4 years ago |
Edit | Post #277222 |
Post edited: |
— | over 4 years ago |
Edit | Post #277223 |
Post edited: |
— | over 4 years ago |
Edit | Post #277225 | Initial revision | — | over 4 years ago |
Question | — |
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: empty tag wiki I also noticed that I can't edit those info. Will it be possible for regular users to add tag wikis?[^1] And if there is such possibility, what are the recommendations for creating those wi... (more) |
— | over 4 years ago |
Edit | Post #277223 | Initial revision | — | over 4 years ago |
Answer | — |
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`: ```java String regex = "(?:([aeiou]+)[0-9]+|([123]+)[a-z]+)\\W+"; System.out.println("ae123.".replaceAll(regex, "$1$2")); System.out.println("111abc!!".replaceAll(regex, "$1$2")); ``` This prints... (more) |
— | over 4 years ago |
Edit | Post #277222 | Initial revision | — | over 4 years ago |
Question | — |
How can I emulate regular expression's branch reset in Java? I've got this sample regex: ```java Pattern p = Pattern.compile("(?:([aeiou]+)[0-9]+|([123]+)[a-z]+)\\W+"); ``` It basically has the following parts: - one or more lowercase vowels (`[aeiou]+`), followed by one or more digits (`[0-9]+`), or - one or more digits 1, 2 or 3 (`[123]+`), follo... (more) |
— | over 4 years ago |