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 matthewsnyderâ€
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Edit | Post #289748 | Initial revision | — | 2 days ago |
Answer | — |
A: Alternatives to `EXPLAIN ANALYZE` for queries that won't complete You can try to break up the query into CTEs, and then see if any of the individual CTEs are unusually slow. I am guessing the query is not just one select, but probably has subqueries, window functions, aggregations, joins and so on. All of these can be split into CTEs pretty easily (if you have q... (more) |
— | 2 days ago |
Edit | Post #289725 | Initial revision | — | 4 days ago |
Question | — |
Is there a text version of pickle? Is there a Python serialization format that has capabilities similar to Pickle, but is text based? The problem I always have with pickle is that it's binary, so I can't manually view or edit the data. The standard library includes `json`, but that requires a tedious converting of types at read ... (more) |
— | 4 days ago |
Comment | Post #289633 |
While this makes sense, it seems a bit strange.
1) Isn't it bad to use exceptions for flow control?
2) Wouldn't this be surprising to a user who expects that `Ctrl+C` will *terminate* the program? (more) |
— | 13 days ago |
Edit | Post #289605 |
Post edited: |
— | 14 days ago |
Comment | Post #289605 |
No, just checking between calls is enough. (more) |
— | 16 days ago |
Edit | Post #289605 | Initial revision | — | 16 days ago |
Question | — |
Listen for key events in a CLI app I have a Python program like this: ```python done = False while u and not done: i = u.pop() print(f"Processing {i}") dobigtask(i) finishup() ``` Since this takes a long time, the user might get tired of waiting. I want the program to also continually listen for a keystroke, s... (more) |
— | 16 days ago |
Comment | Post #289588 |
Why don't you just try changing it and see if it runs slower? (more) |
— | 16 days ago |
Edit | Post #289589 |
Post edited: |
— | 16 days ago |
Edit | Post #289589 |
Post edited: |
— | 16 days ago |
Edit | Post #289589 |
Post edited: |
— | 16 days ago |
Edit | Post #289589 |
Post edited: |
— | 16 days ago |
Comment | Post #289589 |
The two previous questions explain the issue in more detail, but I'm adding my own summary in the hopes that it will be useful to other readers. (more) |
— | 16 days ago |
Edit | Post #289589 | Initial revision | — | 16 days ago |
Answer | — |
A: What is the point of pipx? Dependency conflicts are the problem pipx aims to solve, in the context of installing CLI programs. When you install a Python package, by default pip will also install their dependent packages so that you don't get `ImportError`s when trying to use the package. These dependencies are explicitly co... (more) |
— | 16 days ago |
Comment | Post #289575 |
Thank you! That actually does answer my question. (more) |
— | 16 days ago |
Comment | Post #289575 |
First, it's more accurate to say that `pip` is for installing python *packages*. When you say "dependencies", that makes it sound as if it can't install "tools", when in fact it can install any package. I am not aware of pip being specced specifically as to exclude installing non-dependencies. This i... (more) |
— | 19 days ago |
Edit | Post #289566 | Initial revision | — | 22 days ago |
Answer | — |
A: How should I organize material about text encoding in Python into questions? Much of this is already covered in various sources like https://docs.python.org/3/howto/unicode.html. Although there are issues with relying on links, I figure official documentation is probably fair game. I would start with two types of question: "Where can I find detailed information about t... (more) |
— | 22 days ago |
Comment | Post #289514 |
Didn't know about `at` - seems like what I was looking for. Is this better [than systemd-run](https://linux.codidact.com/posts/289510/289511#answer-289511)? (more) |
— | 29 days ago |
Edit | Post #289509 | Initial revision | — | 30 days ago |
Question | — |
How can a Python program send itself to the background? Is it possible for a Python program to send itself in the background? For example, on Linux you can do `nohup somecmd &` and any program will run in the background. Some programs also support switches like `-d` (daemonize) to run in the background without `nohup`/`&`. How can a Python program do t... (more) |
— | 30 days ago |
Edit | Post #289508 | Initial revision | — | 30 days ago |
Question | — |
How can I schedule a later task in Python? I want my CLI Python program to schedule a task, and then exit. After some times has passed (say 10 minutes) the task should execute. The task can be a Python method or a shell command, whatever is easier. I can convert my use case to accommodate it. This would be on Linux only. How can I sc... (more) |
— | 30 days ago |
Edit | Post #289484 |
Post edited: |
— | 30 days ago |
Edit | Post #289506 | Initial revision | — | 30 days ago |
Answer | — |
A: Clone .git repo into current dir, without touching files One way to do it is to simply clone the repo elsewhere and move the .git file to the current one. (more) |
— | 30 days ago |
Edit | Post #289505 | Initial revision | — | 30 days ago |
Question | — |
Clone .git repo into current dir, without touching files I have git repo where the .git is deleted. I didn't realize it until after I made some changes to the code. I want to re-create the `.git` by cloning. However I don't want it to touch the files that I already have. When the `.git` is cloned, I will run git checkout and it will detect my changes as... (more) |
— | 30 days ago |
Comment | Post #280700 |
This is a very transactional way to look at it. Taken to its logical conclusion, it implies there's no point contributing to open source at all.
I understand that some people choose to provide their work for free and resent the fact that they don't get more money out of it. Not all FOSS devs are l... (more) |
— | about 1 month ago |
Edit | Post #289486 | Initial revision | — | about 1 month ago |
Answer | — |
A: Git: How to clone only a few recent commits? This is called a shallow clone and it's supported by a git-clone argument: ``` git clone --depth 5 ``` (more) |
— | about 1 month ago |
Edit | Post #289484 | Initial revision | — | about 1 month ago |
Question | — |
Git: How to clone only a few recent commits? How do I clone the repository with only part of the history? For example, let's say I want to download only the last 5 commits out of thousands. (more) |
— | about 1 month ago |
Edit | Post #289445 |
Post edited: |
— | about 1 month ago |
Comment | Post #289443 |
I agree on that as well. "How pipx works" is interesting and useful, but it's not pertinent information. It should be in a separate post. (more) |
— | about 1 month ago |
Comment | Post #289443 |
This has some information but it seems a bit too biased in favor of pipx. The first three paragraphs don't add anything. There's some speculation about features that are not actually part of pipx. In the bulleted list, IMO 3, 4 and 6 are already things you get in pip. That said, there are some reason... (more) |
— | about 1 month ago |
Edit | Post #289445 | Initial revision | — | about 1 month ago |
Answer | — |
A: Is it wrong to demand features in open-source projects? "Demanding features" falls under an umbrella called "design". Design work doesn't show up directly in the commits (unless you maintain a design doc) but it is work nonetheless. Suggesting features is volunteer design work. In principle, the maintainer should welcome such work just as they would w... (more) |
— | about 1 month ago |
Comment | Post #289427 |
@#56342 But look what we get if we follow your logic: pip, pipx, apt, brew, cargo (and probably Julia, which I don't know) can all install packages in system locations. Then saying that "pipx is like apt or brew because it installs packages" makes no sense, because pip does that too. So why would you... (more) |
— | about 1 month ago |
Comment | Post #289427 |
@#53177 I was thinking of `apt` and `brew`, not `Nuget`. This is because the linked page calls them out as examples. AFAIK `nuget` is basically the pip of C#, which is probably why pipx docs don't use it as an example.
Anyways, I was hoping that the question does not require you to guess what I un... (more) |
— | about 1 month ago |
Edit | Post #289427 |
Post edited: |
— | about 1 month ago |
Edit | Post #289427 |
Post edited: |
— | about 1 month ago |
Edit | Post #289427 |
Post edited: |
— | about 1 month ago |
Edit | Post #289427 |
Post edited: |
— | about 1 month ago |
Edit | Post #289427 |
Post edited: |
— | about 1 month ago |
Edit | Post #289427 | Initial revision | — | about 1 month ago |
Question | — |
What is the point of pipx? Background - Many Python programs now recommend installing with pipx, and there is a sense that you shouldn't install with pip anymore, you should use tools like pipx. Main Question - However, what does pipx actually do that makes it such a preferred alternative to pip? Thoughts - I check... (more) |
— | about 1 month ago |
Edit | Post #289316 |
Post edited: |
— | about 1 month ago |
Edit | Post #289319 |
Post edited: |
— | about 1 month ago |
Comment | Post #289318 |
I will also accept answers with *original* terminology, on the condition that the terminology proposed is clear, well justified and the names are not particularly clumsy.
Caveat: If someone does produce an established terminology, such as something from a well known textbook, I may favor that over... (more) |
— | about 1 month ago |
Edit | Post #289319 | Initial revision | — | about 1 month ago |
Answer | — |
A: Terms for types of functions with respect to side effects I know that 1 is sometimes called a pure function - although apparently a pure function must also not vary when the input is constant. By negation, the other kind are called impure functions, although this seems to me biased towards the idea that side effects are bad. I've seen procedure used f... (more) |
— | about 1 month ago |
Edit | Post #289318 |
Post edited: |
— | about 1 month ago |
Edit | Post #289318 | Initial revision | — | about 1 month ago |
Question | — |
Terms for types of functions with respect to side effects Mathematically, the purpose of a function is to return an output. However, in a programming context functions often have side effects. It is even common to call functions for the side effects alone. The classic example is `print(x)`, which has a useful side effect and no output. It seems to me tha... (more) |
— | about 1 month ago |
Edit | Post #289316 |
Post edited: |
— | about 1 month ago |
Edit | Post #289316 |
Post edited: |
— | about 1 month ago |
Edit | Post #289316 | Initial revision | — | about 1 month ago |
Question | — |
Readable syntax for executing many callables with useful side effects In Python, multiprocessing is easy to do if you follow a "list projection" paradigm. Say you want to take a list of inputs `X` and apply some function `f` to every `xi`, such that `yi = f(xi)` and the `yi` comprise the output list `Y`: ```python y = multiprocessing.Pool().map(f, x) ``` Is the... (more) |
— | about 1 month ago |
Comment | Post #289289 |
Indeed! I might as well share the `gmto` script I've been using:
```
#!/usr/bin/env sh
#
# Checkout to the specified branch and merge the current one into it
# with a merge commit. Usage:
#
# gmto <target-branch>
#
# Intended for a workflow like:
# 1. Develop feature in branch my-feature
... (more) |
— | about 1 month ago |
Comment | Post #289299 |
Wouldn't that person still need to check out the feature branch first, before merging it? I would expect that people don't blindly merge other people's branches with such zeal that even a checkout is too flow breaking. (more) |
— | about 1 month ago |
Edit | Post #288670 |
Post edited: |
— | about 1 month ago |
Edit | Post #289289 | Initial revision | — | about 1 month ago |
Question | — |
Why is git merge from rather than to? Why does `git merge` take the source branch rather than the destination branch as a parameter? The most common merge case by far for me is "Okay, this branch looks good, let's merge it into branch X", where X is often something like `master`. Normally, if you're merging, you would expect that s... (more) |
— | about 1 month ago |
Comment | Post #289170 |
There also seems to be a strange but widespread cargo cult about contracts, where people think just because professional lawyers write very obtuse and wordy contracts, that if they write one in simple language it's somehow not valid. In reality there is nothing wrong with writing a contract in your o... (more) |
— | about 2 months ago |
Comment | Post #289170 |
As for the legalities - a lot of people act like copyright is some magic spell that works automatically but it doesn't. There is no copyright police that will come stop me automatically as soon as I use your work without proper license, the way they would stop me from stealing your car even if you di... (more) |
— | about 2 months ago |
Comment | Post #289170 |
That's a good point - CC BY would "catch" the LLMs on attribution. However it has the side effect of also requiring humans to do it. Personally speaking, I don't care about making people do the busywork of citing my posts just for some trivial copy and paste from them. If I cared to take credit I'd p... (more) |
— | about 2 months ago |
Comment | Post #289250 |
I would also like to know. Although I feel like this is somewhat moot - most people who care about navigating with the keyboard use more advanced tools like Vimium, Qutebrowser or Lynx rather than relying on just tabbing. (more) |
— | about 2 months ago |
Comment | Post #289255 |
If anyone is wondering, you can do `f"{8} cans of {'spam'}"` as well. F strings can take strings, you just have to leverage the fact that there are two alternate quote styles in Python. Normally, things you pass to f-strings would be variables though, otherwise it's easier to just write `"8 cans of s... (more) |
— | about 2 months ago |
Edit | Post #289255 |
Post edited: |
— | about 2 months ago |
Edit | Post #289255 |
Post edited: |
— | about 2 months ago |
Edit | Post #289255 | Initial revision | — | about 2 months ago |
Answer | — |
A: How can I build a string from smaller pieces? `+` is string concatenation and only be applied by strings. Non-string operands like numbers or class instances must be converted to strings using `str()`. That's all there really is to it, except Python has some syntactic sugar that hides this in certain situations. When I have a list `u` of thin... (more) |
— | about 2 months ago |
Edit | Post #289162 |
Post edited: I think it would be easier to discuss individual points if they were numbers rather than bullets. |
— | about 2 months ago |
Suggested Edit | Post #289162 |
Suggested edit: I think it would be easier to discuss individual points if they were numbers rather than bullets. (more) |
helpful | about 2 months ago |
Edit | Post #289172 | Initial revision | — | about 2 months ago |
Answer | — |
A: How can Q&A sites coexist with LLMs? My take on this: Q&A sites used to fill two distinct roles, but only one of these (the more boring one that doesn't matter anyway) is usurped by LLMs. The interesting one is not yet in danger of being supplanted. There's always been two types of questions on StackOverflow: Trivial, highly spec... (more) |
— | about 2 months ago |
Edit | Post #289171 | Initial revision | — | about 2 months ago |
Question | — |
How can Q&A sites coexist with LLMs? New LLMs like ChatGPT are now creating competition with Q&A sites like Codidact and StackOverflow. Moreover, this is parasitic: LLMs get "boosted" by Q&A sites because they can use them for training, but Codidact does not benefit from AI models for example because AI content is not allowed here. D... (more) |
— | about 2 months ago |
Comment | Post #289159 |
You might want to add the official link about the ChatGPT user agent: https://platform.openai.com/docs/plugins/bot (more) |
— | about 2 months ago |
Edit | Post #289170 | Initial revision | — | about 2 months ago |
Answer | — |
A: Should we disallow ChatGPT-User crawler (and others) from scraping Software Codidact? `robots.txt` amounts to politely asking people to please not crawl you, so I wouldn't expect it to do much. At the same time, you might as well ask politely, to avoid giving the impression that you do want them to crawl you. Letting Google crawl you is fine because Google actually sends traffic ba... (more) |
— | about 2 months ago |
Comment | Post #289155 |
Actually I did, and I also searched online, which is why I'm confused. There appears to be your way, and also `git submodule update`, and also `git submodule foreach git pull`, and I can't figure out which way is "best" or what the differences are. (more) |
— | about 2 months ago |
Edit | Post #289156 | Initial revision | — | about 2 months ago |
Question | — |
`git submodule foreach git pull` in parallel I use `git submodule foreach git pull` to update my submodules. There's quite a few and it appears that `foreach` is updating them one by one, instead of in parallel. How can I do it in parallel? (more) |
— | about 2 months ago |
Edit | Post #289155 | Initial revision | — | about 2 months ago |
Question | — |
How do I pull new changes in git submodules? I have a git repository with some submodules. When the submodule repos get new commits on the remote, how can I pull them all? (more) |
— | about 2 months ago |
Comment | Post #289009 |
Anyways, I guess it's a moot point since clearly the community has decided this is not an interesting topic for the Software section. (more) |
— | about 2 months ago |
Comment | Post #289009 |
That doesn't really make sense to me. The answer doesn't have much to do with statistics, all the statistical work would be done at the training stage which I am trying to avoid. The stats would be embedded in the pre-trained model. This question about wrapping existing software in my own code, so it... (more) |
— | about 2 months ago |
Comment | Post #289112 |
I edited the question to make it clearer why the docs sound (at least to me) like it can be done. (more) |
— | about 2 months ago |
Edit | Post #288982 |
Post edited: |
— | about 2 months ago |
Comment | Post #288623 |
I think the discussion of how to implement a comprehensive tax calculator is a separate issue from this question. Unless I've missed something, OP does not say that he is specifically trying to build a TurboTax alternative. The examples he gave sound like some kind of billing/transaction processing s... (more) |
— | about 2 months ago |
Edit | Post #289047 |
Post edited: |
— | about 2 months ago |
Comment | Post #289047 |
I thought it was freeware, not FOSS! I would still like to find a solution for VSC, though. (more) |
— | about 2 months ago |
Comment | Post #289091 |
Why exactly do you find it clumsy? Is it just because there are 2 steps and you would have expected 1? (more) |
— | about 2 months ago |
Comment | Post #289092 |
Does this also delete tag and create it again at another commit? (more) |
— | about 2 months ago |
Comment | Post #289085 |
The question is a bit confusing because the requirement is not clearly stated and the code examples are complex and hard to follow. Can you edit the question and say what arguments exactly the function should take, and what it is expected to return? We can then provide an implementation. (more) |
— | about 2 months ago |
Edit | Post #289047 |
Post edited: |
— | 2 months ago |
Edit | Post #289047 | Initial revision | — | 2 months ago |
Question | — |
"Move symbol" refactor for Python in Visual Studio Codium Is there a way to add support for "move symbol" in Python code for VS Codium? PyCharm can do this, but I am looking for a VSC solution. PyLance can do this, but PyLance itself is closed source, and does not work in Codium after version 2023.6.40. VS Codium supports Jedi, but from what I coul... (more) |
— | 2 months ago |
Comment | Post #288843 |
What about software that works on top of existing AIs via their API, but implements a bunch of prompt engineering to extend their functionality? A good example is https://github.com/Significant-Gravitas/Auto-GPT.
Do you think questions about a tool like AutoGPT would be more suited for Power Users... (more) |
— | 2 months ago |
Edit | Post #289024 | Initial revision | — | 2 months ago |
Answer | — |
A: To transfer, or not to, that is the question: whether 'tis nobler to let it stay or to take arms against Stack Overflow's dominance of FAQ canonicals Hi and welcome to the site. :) I think the idea of a canonical like the one you linked is great. A lot of newbies have too little understanding of their topic to identify common patterns. So they keep asking many trivial variations of the same handful of basic questions. People with even intermedi... (more) |
— | 2 months ago |
Edit | Post #289009 |
Post edited: |
— | 2 months ago |
Edit | Post #289009 |
Post edited: |
— | 2 months ago |
Edit | Post #289009 |
Post edited: |
— | 2 months ago |
Comment | Post #289009 |
My goal here is to get an answer that is maybe 1-5 paragraphs, that outlines the main elements of such a setup, and drops enough specific keywords that I can figure out the rest by searching online. So while the question sounds broad, I'm not asking for a lot of *depth*.
Edit suggestions welcome! (more) |
— | 2 months ago |
Edit | Post #289009 | Initial revision | — | 2 months ago |
Question | — |
How do I use an existing AI model to classify pornographic images? In the last few months, AI has advanced considerably, notably in the area of generating images. We now have powerful models like DALL-E, Stable Diffusion, etc. These are quite competent at generating an image based on a text prompt. Can any existing models be used as a simple binary classifier of ... (more) |
— | 2 months ago |
Edit | Post #288982 | Initial revision | — | 2 months ago |
Question | — |
Does Snowflake NATURAL JOIN support outer-style join? I like using `NATURAL JOIN` in Snowflake, because I find it more elegant than explicit join clauses. However, it appears that the natural join behaves similar to an inner join, in that null values of the join key(s) are dropped. In some cases, I want to do a natural join, but I want to include col... (more) |
— | 2 months ago |
Comment | Post #288920 |
Hmm. Well, I would solve the concurrency issue by something like a [semaphore](https://en.wikipedia.org/wiki/Semaphore_(programming)) (I assume you have multiple threads here). SQLite also supports [write-ahead logging](https://www.sqlite.org/wal.html) to deal with concurrent writes (I haven't used W... (more) |
— | 2 months ago |
Comment | Post #288920 |
@#63591 Is enforcing types the only problem, or are there others? (more) |
— | 2 months ago |
Comment | Post #288920 |
Embedding Postgres/MySQL is a bad idea, they're huge and designed specifically not to be embedded. There are other *embedded* databases besides SQLite, but you should state exactly what your issue is with SQLite. (more) |
— | 3 months ago |
Comment | Post #288884 |
Worth saying that ORMs are very complex, advanced things. They require advanced knowledge of both SQL and Python. If either is lacking, things will be very confusing.
Moreover, unless you are doing some very complicated stuff (eg. large codebase maintained over years), the ORM often creates more b... (more) |
— | 3 months ago |
Edit | Post #288893 | Initial revision | — | 3 months ago |
Answer | — |
A: Can pandas be used as a database backend for persistent storage? SQL is as good as it gets, generally speaking. The best engine for a small project is SQLite. If you need more, the next step is Postgres. Postgres is very capable and it's unlikely that you'll need more even as a medium sized company. But it sounds like you're asking about small personal projects. ... (more) |
— | 3 months ago |
Comment | Post #288764 |
Aha, I see. That does sound like a good reason to do multiple local copies. (more) |
— | 3 months ago |
Edit | Post #288765 |
Post edited: Used mainstream mathematical term for the concept being asked about |
— | 3 months ago |
Edit | Post #288068 |
Post edited: Converted example data to CSV for easy copy/paste, rearranged for readability. Deleted "what I tried": In this case, the question is simple enough so I think it's better to keep it short. |
— | 3 months ago |
Comment | Post #288764 |
Isn't this exactly what branches are meant to take care of? What specifically would not work if you simply used a branch here? Are you worried about accidentally pushing commits to the `upgrade` branch without meaning to? (more) |
— | 3 months ago |
Suggested Edit | Post #288765 |
Suggested edit: Used mainstream mathematical term for the concept being asked about (more) |
helpful | 3 months ago |
Edit | Post #288862 | Initial revision | — | 3 months ago |
Answer | — |
A: Prevent vscode from inserting new lines in the middle of my code on format. It sounds like you have a Java formatter configured (by default?) and VSC is applying it to your code automatically (on save?). How code is formatted If your only gripe is these specific stylistic choices, but you do want auto-formatting for other things, you must figure out what formatter is bei... (more) |
— | 3 months ago |
Suggested Edit | Post #288068 |
Suggested edit: Converted example data to CSV for easy copy/paste, rearranged for readability. Deleted "what I tried": In this case, the question is simple enough so I think it's better to keep it short. (more) |
helpful | 3 months ago |
Edit | Post #288861 | Initial revision | — | 3 months ago |
Answer | — |
A: Remove entries by two-column ID everywhere, that meet a condition somewhere This is solved in 2 steps: Find rows matching remove conditions Do anti-left-join on the the composite key `(Die, Cell)` To filter out the rows: ``` Read in the data df = pd.readcsv("data.csv") Identify cells with low current b100 = df[(df["Resistance"] < 100000) & (df["Current"] == 1... (more) |
— | 3 months ago |
Edit | Post #288842 | Initial revision | — | 3 months ago |
Question | — |
Are AI prompt engineering questions on topic? Recently, AI models like ChatGPT have shown themselves capable of generating content and even source code. Just like with human helpers, clear and precise communication is key (especially when asking for big tasks) to avoid being misunderstood and receiving a response different from what was desired.... (more) |
— | 3 months ago |
Comment | Post #288841 |
This is very similar to the existing answer, but I didn't want to suggest edit because I wasn't sure the OP meant to write it that way. I thought I'd add it as a "ELI5" version, though. (more) |
— | 3 months ago |
Edit | Post #288841 | Initial revision | — | 3 months ago |
Answer | — |
A: When using the compare function in Array.prototype.sort, how to avoid an element to be processed more than once? Create a hash map and precalculate the sort key in it: ```js // Set up: Create mock input let u = ['4', '16', '8', '2', '6']; function expensivekeyfn(x) { console.log("Doing expensive operation on: " + x) return String(x); } // Create an optimized sort function let sortKey = {} u.... (more) |
— | 3 months ago |
Comment | Post #285715 |
Obviously C pointers can do everything references do. Indeed, what other languages call "references" are just locked down pointers. So do these alleged C++ programmers have an actual point? Aren't they just splitting hairs? (more) |
— | 3 months ago |
Edit | Post #288787 | Initial revision | — | 3 months ago |
Answer | — |
A: How do I find disjoint sets in a dataset Your example is a bipartite graph in adjacency list format. The cars are nodes on the left, the people are nodes on the right. When a person "has" a car, there is an edge between the car and person. Your question is equivalent to asking for the connected components of the graph. This can be done w... (more) |
— | 3 months ago |
Comment | Post #288753 |
This is what I was looking for. But does this restrict you to one `extre-index-url`, or can you also specify multiple? (more) |
— | 3 months ago |
Edit | Post #288735 | Initial revision | — | 3 months ago |
Question | — |
How to configure Python pip to look for packages in a private index first? When I run `pip install foo`, pip looks for `foo` in PyPi. I want it to look for it first in a private repo, let's say `pypi.bar.com`. Only if `foo` cannot be found in `pypi.bar.com`, should `pip` then look for it in PyPi. How can I configure pip to do this? (more) |
— | 3 months ago |
Edit | Post #288668 |
Post edited: |
— | 3 months ago |
Edit | Post #288685 | Initial revision | — | 3 months ago |
Answer | — |
A: For scripting what are the pros and cons of command line arguments versus capturing input at the start? I largely agree with existing answers, but wanted to add this: In many cases, there is no clear answer one way or the other. Take the program `wc` which counts characters and lines. Should the interface be `wc file.txt` or `cat file.txt | wc`? Compelling arguments can be made for the value of eith... (more) |
— | 3 months ago |
Edit | Post #288671 |
Post edited: |
— | 3 months ago |
Edit | Post #288671 | Initial revision | — | 3 months ago |
Answer | — |
A: Should I delete my trivial, lack-of-research question? I don't think the question is trivial. Maven is very complex and confusing at first. The documentation is also quite something. It's not easy to figure out what's going on unless you already know. Your question explains a valuable thing. My real concern is discoverability: It has nothing to do... (more) |
— | 3 months ago |
Comment | Post #278190 |
To be fair, the "tutorial sites" are content farms that are SEO'd out the wazoo. They're not trying to promote knowledge, they are trying to get the most search hits with the least effort. The articles are by necessity always going for the whole headline. It's like the saying "all chiefs, no indians"... (more) |
— | 3 months ago |
Comment | Post #278190 |
The quote reminded me of Wikipedia in the 2000's. This was exactly their problem, the biggest one by far, for many years. Back when you would get an F on your middle school homework for citing wikipedia, the early adopter experts (professors and other SMEs) were struggling to create "proper" content ... (more) |
— | 3 months ago |
Edit | Post #288670 | Initial revision | — | 3 months ago |
Answer | — |
A: Do we want a wiki (or similar) alongside Q&A? There are a few ways to understand "wiki". 1. Like wikipedia - an interlinked web of articles in a standardized format. 2. Like SO's documentation project or Github wikis - a stripped down wiki that is kind of sort of like a wiki but also weirdly shallow. 3. A post without answers, where the pos... (more) |
— | 3 months ago |
Comment | Post #278211 |
I disagree that self-answering is "awkward". I get where you're coming from, but if you think about it, it's actually extremely natural. Self answering questions is one of the most popular teaching styles from K-12 to college and beyond. Everyone is familiar with it. The ancient Greeks used it to ela... (more) |
— | 3 months ago |
Comment | Post #288668 |
SO had a neat thing where you could post your JS code as a https://jsfiddle.net/ and it would show up as interactive.
What is the feasibility of doing that, but for SQL, so that people can create tables and run queries? Obviously we would first have to find a program that does in browser SQL, but ... (more) |
— | 3 months ago |
Comment | Post #288660 |
If this question reaches a conclusion, it would be good if the CD software could try to detect a user is trying to post tabular data (based on tags?), and display a link to here. (more) |
— | 3 months ago |
Comment | Post #288668 |
Also, technically Markdown supports tables - SO is just not compliant and doesn't render them. But maybe CD could add support for rendering them? That would be pretty cool! (more) |
— | 3 months ago |
Comment | Post #288668 |
I know you're asking about spreadsheet, so SQL is kind of a weird option for you. But as a general solution to "tabular data", I think it's probably a great choice, so I included for other people who will see this answer later. You can always skip SQL and try CSV or Markdown. (more) |
— | 3 months ago |
Edit | Post #288668 | Initial revision | — | 3 months ago |
Answer | — |
A: Best practices for posting tabular data Some good options to consider: SQL `create table as` statements. This way you can define multiple tables all in one file, that can be copy/pasted easily. It also matches a very common thing: SQL exercises in things like Leetcode. CSV. It's a bit ugly, but it's very easy to work with it, and man... (more) |
— | 3 months ago |
Comment | Post #277930 |
Thanks for the edit, @#53177! I agree that this example is better.
Out of curiosity, why do you say the fuzzy wuzzy is problematic? Is it because `zz` is repetitive, and you could do a bad solution by merely counting chars? (more) |
— | 3 months ago |
Edit | Post #277930 |
Post edited: I don't think all the history of the SO question helps and it distracts from the main point. I used a new example in case it's a copyright thing. IMO the new version is much shorter, but asks the same thing. |
— | 3 months ago |
Edit | Post #288623 |
Post edited: |
— | 3 months ago |
Edit | Post #288623 |
Post edited: |
— | 3 months ago |
Edit | Post #288623 | Initial revision | — | 3 months ago |
Answer | — |
A: What is a good modern language to use for a Business Rules project? SQL is the right tool for this job. You say the data is already in a database, probably a SQL database You don't have to deal with moving the data out of the database and "into a programming language" as you would with others This is an extremely common application of SQL, and you will find a... (more) |
— | 3 months ago |
Suggested Edit | Post #277930 |
Suggested edit: I don't think all the history of the SO question helps and it distracts from the main point. I used a new example in case it's a copyright thing. IMO the new version is much shorter, but asks the same thing. (more) |
helpful | 3 months ago |
Comment | Post #278366 |
The title says "combine the first character with another cell" but then in the example you are also doing case changes. The case change really doesn't have anything to do with the concatenation. IMO conflating two separate questions like this into one confuses things, and makes the question less usef... (more) |
— | 3 months ago |
Comment | Post #288621 |
Another way to deal with the commas and dots is to use the https://help.libreoffice.org/6.0/en-US/text/scalc/01/func_numbervalue.html function, which lets you directly say what the digit and group separators are for that number. (more) |
— | 3 months ago |
Comment | Post #288552 |
Wait, is this generating a requirements based on static analysis of the code? Wow, that definitely solves my problem, better! Thanks. (more) |
— | 3 months ago |
Edit | Post #288490 | Initial revision | — | 3 months ago |
Answer | — |
A: Queries to count points lying on arbitrary line Since you didn't mention memory, I'll assume O(N^2) is acceptable. Setup pseudocode: ``` for every p1, p2: ln = line(p1, p2) pointsonline[ln.m, ln.c] += [p1, p2] ``` If there are at least 2 colinear points on your line, you can get them in O(1) with `pointsonline[m, c]`. If not, yo... (more) |
— | 3 months ago |
Edit | Post #288489 | Initial revision | — | 3 months ago |
Answer | — |
A: How to prevent Visual Studio Code from opening an extra blank window? I was able to fix this by deleting the `/.config/VSCode/Workspaces` folder. To figure this out, I: Backed up my `VSCode` folder to `/var/tmp` Deleted `/.config/VSCode`, after this VS Code stopped opening two windows (and created a lot of new files in `VSCode/`) Used `fd` to make a list... (more) |
— | 3 months ago |
Comment | Post #288201 |
It would be a lot easier to use something like Jinja for this, or even plain Python, or similar tools in other languages. `jq` can also do it. The advantage of these is that they are more flexible and better documented. (more) |
— | 3 months ago |
Edit | Post #288488 |
Post edited: |
— | 3 months ago |
Edit | Post #288488 |
Post edited: |
— | 3 months ago |
Edit | Post #288488 |
Post edited: |
— | 3 months ago |
Edit | Post #288488 | Initial revision | — | 3 months ago |
Question | — |
Automatically install all packages needed When running various Python scripts, I often need to do this annoying dance: ```shell $ python script.py ... ModuleNotFoundError: No module named 'foo' $ pip install foo $ python script.py ... ModuleNotFoundError: No module named 'bar' $ pip install bar $ python script.py ... ModuleNotFou... (more) |
— | 3 months ago |
Edit | Post #288420 |
Post edited: |
— | 3 months ago |
Edit | Post #288420 |
Post edited: |
— | 3 months ago |
Edit | Post #288420 | Initial revision | — | 3 months ago |
Answer | — |
A: When would one not want to return an interface? I think the main reason to do this is when the interfaces fail to account for some subtlety of the contract between caller and implementation. For example, let's pretend for a moment that your use case is a performance edge case, and `List` in particular can handle it due to a peculiarity of its i... (more) |
— | 3 months ago |
Edit | Post #288419 | Initial revision | — | 3 months ago |
Answer | — |
A: Why are commas not needed for modulo string formatting when printing? `%` is one of the oldest Python syntaxes for interpolating strings. It basically works like: ``` templatestring % datatuple ``` In fact, you can literally do that: ``` >>> s = "%d %d" >>> t = (1, 2) >>> s % t '1 2' ``` `templatestring` is the template, `datatuple` is the values to be... (more) |
— | 3 months ago |
Comment | Post #288367 |
Hmm... That unfortunately didn't change anything, I tried both true and false. It wasn't set before. (more) |
— | 3 months ago |
Comment | Post #288299 |
No, and yes alembic is probably the solution here :) I had forgotten about it. (more) |
— | 3 months ago |
Comment | Post #288299 |
The test data is created ad-hoc and not managed.
For example, say I'm developing a microblogging webapp with users and tweets. I'll run it, create some users, post some test messages, and done: I have fairly realistic data in the database for testing features like a "feed" view.
I am looking fo... (more) |
— | 3 months ago |
Comment | Post #288330 |
>Great answers both answer...
Yes, but IMO a great answer (generalized) is wasted on a specific troubleshooting question, because many people will ignore it because they think they have a different problem, even though the answer applies to them anyway.
My point is that generalized, great answe... (more) |
— | 3 months ago |
Comment | Post #288304 |
I'd say I'm well aware of the duplicates. There is an antipattern on SO where a newbie asks "hey here's my code it's crashing why", and then the question gets closed as a duplicate, but the duplicate (for a newbie) is impossible to recognize as such. The close notice gives very little explanation, no... (more) |
— | 3 months ago |
Comment | Post #288302 |
I'm on Arch Linux. This is likely not an issue that happens with a clean install, but something to do with my workspaces, or other configuration. I'm hoping someone might now where to look for the problem. (more) |
— | 3 months ago |
Edit | Post #288330 | Initial revision | — | 3 months ago |
Answer | — |
A: Are code troubleshooting posts allowed? These questions are very helpful to the person asking, and great for driving activity. I think it is good to allow these questions to be asked and to answer them. At the same time, they are not good for keeping on the site indefinitely. Many years ago, I did not understand what lambdas were and as... (more) |
— | 3 months ago |
Edit | Post #288257 |
Post edited: |
— | 3 months ago |
Edit | Post #288257 |
Post edited: |
— | 3 months ago |
Comment | Post #288321 |
I would say yes.
1. People who hate recs can avoid them by not going into that section.
2. People with PTSD from Stack's moderation can clearly see that yes, recs are okay.
3. Outdoors already set the precedent.
That is, assuming it's not a lot of work to add a section. If it requires changes... (more) |
— | 3 months ago |
Edit | Post #288321 | Initial revision | — | 3 months ago |
Question | — |
How are software recommendations handled? How are software recommendations handled on https://software.codidact.com/ ? https://outdoors.codidact.com/ has a "gear recommendations" section, so it seems like Codidact is open to the idea. I saw https://software.codidact.com/posts/287107 but it's about books specifically. What about questio... (more) |
— | 3 months ago |
Comment | Post #285739 |
I agree with this, but I think it will be unhelpful down the line to characterize UI/UX as "choosing fonts and colors". UI design and UX design are design disciplines with a lot of depth beyond that. Using that phrasing risks alienating a lot of actual design experts and also perpetuates an unhelpful... (more) |
— | 3 months ago |
Edit | Post #288305 |
Post edited: |
— | 3 months ago |
Edit | Post #288305 | Initial revision | — | 3 months ago |
Answer | — |
A: Should I post a link to the Github repo for code reviews? If it's so large that you must link the repo rather than reposting code, I think it is too large to reasonably expect anyone to review. Bored people will read a couple dozen lines, and point out a thing or two. But nobody (?) is bored enough to audit 1k+ LoC just for the asking. I personally would... (more) |
— | 3 months ago |
Comment | Post #286000 |
I think he means he's a noob of the site, not a noob of Python. (more) |
— | 3 months ago |
Edit | Post #288304 | Initial revision | — | 3 months ago |
Answer | — |
A: Questions easily answered by studying a beginner-level book Beginner questions are not a "huge problem" for StackOverflow. They are the main reason SO got big at all. During what I would call its "peak", the joke going around was that the best documentation for any software is its SO tag. SO responded to this by creating a whole site feature around it, and ma... (more) |
— | 3 months ago |
Edit | Post #288302 | Initial revision | — | 3 months ago |
Question | — |
How to prevent Visual Studio Code from opening an extra blank window? When I run `code .` in a directory, Visual Studio Code opens two windows. The first is empty, the second shows directory I was in as expected. I checked `/.config/VSCode/Workspaces` and there is only one in there for a different folder, so that can't be it. I found a bug about this https://gith... (more) |
— | 3 months ago |
Edit | Post #288299 |
Post edited: |
— | 3 months ago |
Edit | Post #288299 | Initial revision | — | 3 months ago |
Question | — |
How to migrate after SQLalchemy schema changes? When I set up my object mappings with SQLalchemy, everything works well enough. It even creates the tables for me if they don't exist. However, if I decide to add/remove columns (aka fields) from an object, it starts erroring out with my old test data because it's got the old column set. Obviously... (more) |
— | 3 months ago |
Comment | Post #288060 |
It seems like the question can be rephrased as: "Why doesn't Python have the same syntax as Javascript?" Well, why would it? Obviously different languages have different syntax and it makes no sense to expect otherwise. If they had the same syntax they would be the same language. (more) |
— | 3 months ago |
Comment | Post #288257 |
That command looks confusing and difficult to type/edit to me, which is why I used the form that I did. The temp files are not a problem if you put them in /tmp/, they'll get cleaned up automatically at next boot. (more) |
— | 3 months ago |
Edit | Post #288257 |
Post edited: |
— | 3 months ago |
Edit | Post #288257 | Initial revision | — | 3 months ago |
Answer | — |
A: grep AND search for multiple words in files Between-lines relations are not easy to look for with grep, which is a line filter. You could use a regex that spans lines, but I find this annoying because of all the flags you have to set. Grep has a switch for printing the filenames instead of matching lines. You can put each in a file. Once yo... (more) |
— | 3 months ago |