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.

Activity for hkotsubo‭

Type On... Excerpt Status Date
Comment Post #285918 @#53280 Thanks for the feedback and suggestions. I've updated the answer.
(more)
about 2 years ago
Comment Post #285911 Related: https://meta.codidact.com/posts/277244
(more)
about 2 years ago
Comment Post #285811 There are some classic examples, such as "_I'm querying the database and showing the info in HTML and it doesn't work_". If the problem is in the database (maybe in the query, or in how you're processing the results), the HTML part is irrelevant: just print the data to show how wrong it is, and how t...
(more)
about 2 years ago
Comment Post #285784 @#53483 Then please edit the question and show the code that uses Bouncy Castle, specifically the part that fails, so we can reproduce the problem.
(more)
about 2 years ago
Comment Post #285784 I don't get it, `javax.mail` doesn't use Bouncy Castle (BC). Perhaps the `mdnCreator.createMDNData()` method creates an object that uses BC to generate mime data? As you didn't provide the code for `createMDNData`, I've made a simple test: ```java ByteArrayInputStream in = new ByteArrayInputStrea...
(more)
about 2 years ago
Comment Post #285801 I've made a test in Python 3, and python-dotenv worked fine: ```python import os from dotenv import load_dotenv load_dotenv() # both os.environ and os.getenv worked print(os.environ["MY_ID"], os.environ["TOKEN"]) print(os.getenv("MY_ID"), os.getenv("TOKEN")) ``` The `.env` file is ex...
(more)
about 2 years ago
Comment Post #285190 Instead of `form id="#prcf_form"`, it should be `form id="prcf_form"`. The `#` is used only in the selector, it indicates that you're searching for an id. But in the HTML, there should be no `#`
(more)
over 2 years ago
Comment Post #285190 `document.querySelector('#prcf_form')` didn't return a `form` element. Have you checked in your HTML if there's a form with `id="prcf_form"`?
(more)
over 2 years ago
Comment Post #285130 The answer below is basically doing what I suggested (using `fetch` and `FormData` to send the data via POST). As you didn't say if it worked, I assumed it didn't work and therefore there might be some missing details (because based on what I could understand, that code should work)
(more)
over 2 years ago
Comment Post #285169 This code is simply defining the list's structure and the functions that will manipulate it. What exactly you didn't understand?
(more)
over 2 years ago
Comment Post #285130 In the PHP file you're getting `$_POST['email']`, which means that it's getting the email sent by the client (if the backend will get another email that the client side can't know, then where/how it will be done?). Well, it seems that there is a *lot* of missing information, please edit the question ...
(more)
over 2 years ago
Comment Post #285154 @#54710 Have you read [the link I suggested](https://software.codidact.com/posts/284849)? I believe it explains what you need to know
(more)
over 2 years ago
Comment Post #285130 @#36363 "send data" means making a http request, using fetch with POST method (there's an example in the [docs](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#supplying_request_options)). And you can use [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) t...
(more)
over 2 years ago
Comment Post #285130 @#36363 Then I suggest you to edit the question and add this information there. But anyway, if you want to execute behavior.php, you'll have to send data to it (which is basically what I described above)
(more)
over 2 years ago
Comment Post #285148 Regarding string handling, [this post](https://software.codidact.com/posts/284849) might be helpful
(more)
over 2 years ago
Comment Post #285130 After the last edit it's still unclear what you mean by "*apply backend behavior*". Do you have a `form action="URL A"` and want to send all its data to URL B using JavaScript?
(more)
over 2 years ago
Comment Post #285130 Not sure if that's what you need, but if I understood correctly, it'd be something like this: ```javascript let form = // get the form somehow (for example, with querySelector) form.addEventListener('submit', function(e) { e.preventDefault(); // don't submit the form fetch('backend.url') ...
(more)
over 2 years ago
Comment Post #285019 @#36363 Could you add a link to the website, so we can at least check the HTML and try to see what the problem is? Because your code *should* work. Just double checking the basic stuff: what does `document.querySelector("#example")` return? When you run your code, does any error message appear in th...
(more)
over 2 years ago
Comment Post #285019 Maybe - and that's a *wild guess* - the JavaScript code is running before the HTML is loaded, and it can't find the input field. Check if the `script` tag is before the form and change it to be after. Or add an event listener to run after the page is loaded: ```javascript document.addEventListene...
(more)
over 2 years ago
Comment Post #284981 @#36363 I've made a simple test: ```javascript var old = document; document.write('abc'); console.log(old === document); // true ``` Which means that the document didn't change (only its child nodes). Another test to check if child nodes changed: ```javascript // keep reference to origina...
(more)
over 2 years ago
Comment Post #284981 @#36363 My understanding is that the document itself is not removed, only its child nodes. But I'll make more tests as soon as I can
(more)
over 2 years ago
Comment Post #284911 @#53305 To add a little bit more pedantry, the filter predicate doesn't have to be exactly a boolean, because in Python [any object can be tested for truth value](https://docs.python.org/3/library/stdtypes.html#truth-value-testing). Which means I can do this: ```python values = ['abc', '', [], ['...
(more)
over 2 years ago
Comment Post #284853 @#36363 You're welcome, glad to help!
(more)
over 2 years ago
Comment Post #284806 @#54649 I've made [this test](https://ideone.com/EkRHga) and surprisingly using string slices is faster than doing the math. Try to change the algorithm and see if it makes some difference
(more)
over 2 years ago
Comment Post #284806 @#54649 For quick performance tests you can use the [`timeit` module](https://docs.python.org/3/library/timeit.html). I've made [a simple example](https://ideone.com/xjEhaR), and creating the function inside the loop was about 50%~60% slower.
(more)
over 2 years ago
Comment Post #284806 You're creating the function inside the loop, so for every iteration a new function is created. But that's not needed at all, creating it just once outside the loop is enough. Not sure how much it'll improve performance, but it certainly won't make it worse
(more)
over 2 years ago
Comment Post #284612 I agree that having some way to indicate the relevant versions can be useful in many cases, but I don't know what's the best way to do it (if I come up with something, I'll certainly post an answer). SE's attempt seems to be convoluted, but I guess only time will tell...
(more)
over 2 years ago
Comment Post #284465 @#36363 `div` doesn't work, but `span` and `p` seems to do. Check [this test](https://a.dev.codidact.org/posts/315) I've made on the dev server.
(more)
over 2 years ago
Comment Post #284444 Whether is cheap or not, it depends. If you think it is, then go for it :-) Just reminding that it's not only one instance, there's also the cost of an extra method call every time you get/set/delete an attribute. If that's not a concern, and you think is worth the convenience of having the syntat...
(more)
over 2 years ago
Comment Post #284386 @#36363 I'm very sorry if I sounded arrogant or offensive. It really wasn't my intention. I've just tried to give constructive feedback - but it seems that I have completely failed, and for that I again sincerely apologize. Anyway, I stand by my answer. To understand the terminology (bubbling, pro...
(more)
over 2 years ago
Comment Post #284465 If you're just looking for a shorter way to write the left-to-right mark character, there isn't. Are you editing the HTML directly? Because you can set specific parts of the page to have a different text direction. Ex: `מתודת <span dir="ltr">document.write()</span>` - if the page is configured as ...
(more)
over 2 years ago
Comment Post #284465 @#36363 If you put the text inside HTML, with `dir` attribute set to "rtl", it works: `<div dir="rtl">מתודת document.write()</div>` (at least in the editor's preview it worked, not sure if it will in the rendered post)
(more)
over 2 years ago
Comment Post #284444 Sorry, I meant "additional instance for each dictionary".
(more)
over 2 years ago
Comment Post #284444 If that's a good idea, it depends on what you need. Is this functionality (syntatic sugar) worth the overhead of having an additional class for each dictionary you want to wrap? It's hard to tell without knowing the requirements and/or motivations to have such class (it's only syntatic sugar/"ters...
(more)
over 2 years ago
Comment Post #284420 @#36363 And I apologize for sounding like an accusation, I really didn't mean that.
(more)
over 2 years ago
Comment Post #284420 @#36363 If you have problems with long texts, I'm afraid there's nothing I can do to help. You asked lots of things, and in order to answer everything, it needs a reasonable amount of text (and I also admit I have difficulty to be succint, which makes things even "worse" for you). It seems we got to...
(more)
over 2 years ago
Comment Post #284420 @#36363 It is - IMO - one of the most confusing things of the language...
(more)
over 2 years ago
Comment Post #284420 Anyway, I'm also a non-native speaker of English, and don't know how to make the answer clearer... Perhaps we both must work on our English skills :-)
(more)
over 2 years ago
Comment Post #284420 @#36363 Well, I would say that JavaScript as a whole is a confusing language. Have you studied about [this](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this)? :-)
(more)
over 2 years ago
Comment Post #284420 @#36363 You asked **lots** of things, including many misconceptions and misunderstandings about the language, and there was no way to address all of them with a short answer. Complaining that it's "too long", and saying that due to your junior level you can't understand advanced topics, are wrong rea...
(more)
over 2 years ago
Comment Post #284415 Complementing the comment above, when you set the value of something, you're replacing the old value by the new one, which is the same as changing the value. To me, both words can be used interchangeably - unless there's a special use case where they can differ (in the that case, could you provide th...
(more)
over 2 years ago
Comment Post #284386 @#36363 As you removed `setInterval`/`setTimeout` from the question, I've also removed that from the answer - and also did a complete rewrite, hope it's more focused now.
(more)
over 2 years ago
Comment Post #283058 @#53249 I'm kinda ambivalent when it comes to Unicode. I have many rants about it (I believe lots of things could've been done differently), but on the other hand, I don't have a better solution and recognize the huge effort behind it. I love that they could come up with a solution for a complex prob...
(more)
over 2 years ago
Comment Post #284386 @#36363 Anyway, I've updated the answer (but I'll review it again later). Perhaps you should edit the question and make clear what are the exact things that you want to know. Do you want to know how events work, or just the meaning of specific terms (or something else)? I tried to cover everything, ...
(more)
over 2 years ago
Comment Post #284386 @#36363 I had no way to be sure about what you know and what you don't, hence I tried to put everything I thought it was relevant. And, as I said in the answer: "*when I say "events", I'm talking about [this](https://developer.mozilla.org/en-US/docs/Web/API/Event)*" <- this link goes to the relevant ...
(more)
over 2 years ago
Comment Post #284355 Please take this as constructive criticism. If you want to create a programming language, perhaps you should go back a few steps and first study some relevant topics such as parsers/lexers, [BNF](https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form), grammars, etc. To start with a simple parser/lex...
(more)
over 2 years ago
Comment Post #284274 `open` accepts only one URL. You'll probably have to add a callback after the first request is finished: ```javascript ajax.onload = function () { // Request finished, make another AJAX call here var anotherAjax = new XMLHttpRequest(); // anotherAjax.open, send, etc... }; ajax.send...
(more)
over 2 years ago
Comment Post #284256 @#54212 Less code != better. Just because you typed less characters, it doesn't necessarily mean it's "better" (BTW, most IDE's can autocomplete the imports for you, which makes this point even more irrelevant, IMO). What you should seek is clear, concise, semantic and correct code, regardless of its...
(more)
over 2 years ago
Comment Post #284160 In that case, I suggest you to edit the question and make it more clear what happened. As currently written, it gives the impression that the XML is not displayed at all (at least I had this impression)
(more)
over 2 years ago
Comment Post #284160 I'm using Chrome and, although it shows the same message you've got, it actually shows the XML, see: https://software.codidact.com/uploads/LqhGnpwbtbMQ3wuTCWePjTua - that said, what exactly is your browsing showing and what did you expect to see?
(more)
over 2 years ago