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 |
---|---|---|---|---|
Answer | — |
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 only this, it would match `THIS. ` (the word "THIS", plus the dot and space after it). ... (more) |
— | almost 4 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) |
— | almost 4 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) |
— | almost 4 years ago |
Edit | Post #280097 |
Post edited: Typo and some formatting |
— | almost 4 years ago |
Suggested Edit | Post #280097 |
Suggested edit: Typo and some formatting (more) |
helpful | almost 4 years ago |
Edit | Post #279599 |
Post edited: Fix link |
— | about 4 years ago |
Edit | Post #279716 |
Post edited: |
— | about 4 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) |
— | about 4 years ago |
Comment | Post #279716 |
@ArtOfCode Yes, I do. I've also added some more info, maybe it helps (more) |
— | about 4 years ago |
Edit | Post #279716 |
Post edited: |
— | about 4 years ago |
Edit | Post #279715 |
Post edited: |
— | about 4 years ago |
Edit | Post #279716 |
Post edited: |
— | about 4 years ago |
Edit | Post #279716 | Initial revision | — | about 4 years ago |
Question | — |
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. I also tested in MacOS 10.5.5/Chrome 83.0.4103.116, and the problem doesn't occur (all 3 tests - Window... (more) |
— | about 4 years ago |
Edit | Post #279715 | Initial revision | — | about 4 years ago |
Question | — |
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 please read this web application's log file and/or the web server's log file to find out what went wr... (more) |
— | about 4 years ago |
Edit | Post #279599 |
Post edited: |
— | about 4 years ago |
Edit | Post #279609 |
Post edited: |
— | about 4 years ago |
Comment | Post #279611 |
The answers are restored, thanks! (more) |
— | about 4 years ago |
Comment | Post #279609 |
@MonicaCellio The answers are restored, thanks! (more) |
— | about 4 years ago |
Comment | Post #279611 |
Thanks for the quick response. Good luck! (more) |
— | about 4 years ago |
Edit | Post #279609 | Initial revision | — | about 4 years ago |
Question | — |
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 that it was posted again, but I don't think that's the case because my vote is still there), but it h... (more) |
— | about 4 years ago |
Answer | — |
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'll have to use more advanced features, such as lookaheads: grep -P "^(?=([^;]+; )x1=y2)(?... (more) |
— | about 4 years ago |
Edit | Post #279002 |
Post edited: |
— | about 4 years ago |
Edit | Post #279002 |
Post edited: Formatting / added android tag |
— | about 4 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) |
— | about 4 years ago |
Comment | Post #278063 |
Related: https://software.codidact.com/q/277225 (more) |
— | over 4 years ago |
Suggested Edit | Post #277896 |
Suggested edit: Formatting tag names (more) |
declined | over 4 years ago |
Edit | Post #277898 |
Post edited: |
— | over 4 years ago |
Edit | Post #277898 |
Post edited: |
— | over 4 years ago |
Edit | Post #277898 |
Post edited: |
— | over 4 years ago |
Comment | Post #277901 |
I was about to ask that. Why put `.git` in `public_html` folder in the first place? (more) |
— | over 4 years ago |
Edit | Post #277898 | Initial revision | — | over 4 years ago |
Answer | — |
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: ```javascript let validTags = ['p', 'span', 'br', 'i', 'b', 'u']; let validAttribs = ['style', 'href']; function vali... (more) |
— | over 4 years ago |
Edit | Post #277860 |
Post edited: |
— | over 4 years ago |
Edit | Post #277860 |
Post edited: |
— | over 4 years ago |
Edit | Post #277860 |
Post edited: |
— | over 4 years ago |
Edit | Post #277860 |
Post edited: |
— | over 4 years ago |
Edit | Post #277860 |
Post edited: |
— | over 4 years ago |
Edit | Post #277860 | Initial revision | — | over 4 years ago |
Answer | — |
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()`). But the link above also mentions that "this behavior is not at all affected by how or where t... (more) |
— | over 4 years ago |
Edit | Post #277410 |
Post edited: |
— | over 4 years ago |
Edit | Post #277331 | Post edited | — | over 4 years ago |
Edit | Post #277410 | Initial revision | — | over 4 years ago |
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 |