|
lifg posted:You might like “The Architecture of Open Source Applications” https://aosabook.org/en/ where people who built (or helped build?) well known projects talk about the how. Each chapter is short, so it’s easy to browse through, and then you can read the actual code with a nice understanding of how it’s actually put together and why. Amazing, thank you! Exactly what I was looking for
|
# ? Jun 16, 2023 04:26 |
|
|
# ? May 30, 2024 20:49 |
|
kliras posted:google, reddit, and so kinda suck for this, so does anyone know a good guides for getting into opencv for analyzing and tracking (e-)sports and other videogame progress? just for recorded video, no live stuff required This doesn't cover the second part of "especially when there are multiple menu and scene changes" but take a look at https://github.com/Maknee/LeagueMinimapDetectionOpenCV if you haven't seen it before. The core logic of "sweep the grid looking for good matches against a fixed library of icons" is very simple: https://github.com/Maknee/LeagueMinimapDetectionOpenCV/blob/master/detection.py. The drawback of this approach is that you need a static or easy-to-fetch mapping of fixed assets you're looking for in the image. You can probably extend this to cover certain menu and scene changes as long as you have some clips of what you're trying to compare against.
|
# ? Jun 17, 2023 01:13 |
|
This came up in another thread and it's a nice little puzzle:smackfu posted:I play a daily game where you have to guess a year that three things happened, and it tells you how close your guess was with a clue. Here's what I've got so far:
Are there any errors I'm not seeing? Is it possible to improve on this? ultrafilter fucked around with this message at 19:41 on Jun 24, 2023 |
# ? Jun 24, 2023 19:39 |
|
ultrafilter posted:This came up in another thread and it's a nice little puzzle: You're starting the linear search 1 step too early. You want to continue doing the binary search until the before and after ranges are both the minimum. Though that only saves at most 1 guess in this case where the minimum bracket is 2 years.
|
# ? Jun 24, 2023 19:51 |
|
Broadly I think the bsearch approach is asymptotically optimal. A few pedantic notes that I'm not even sure will necessarily improve the practical best case scenario (since the maximum range of dates is bounded to be 51 - worst case is you're 25 off in one direction or 25 in another, so you don't have that many iterations):quote:If the error range you got was the smallest possible, start linearly searching in that range until you get the answer. quote:If the error gets larger, you know you picked the wrong direction, so the range is now [y_1, b]. If it doesn't, you guessed the right direction, so the range is now [a, y_1]. quote:If the error gets larger I also wonder whether choosing a, the extrema of the range, is optimal; or rather, I wonder if you can infer more information than by just bisecting from the very end (and also wonder how the particular ranges that get handed back from the game could change what the right strategy is here), but I've been mulling it over for a few minutes and don't have a good intuition yet. Fun to think about, though.
|
# ? Jun 24, 2023 20:04 |
|
If your first guess is 1-2 off, you can’t do better than three extra guesses in the worst case: your second guess can’t give different answers for all four of the remaining possibilities, so there’s always at least two years for which you have the exact same information. In fact, guessing any of the four possibilities has the same formal outcomes: either your guess was correct or there’s exactly one year which you’ve just proven either correct or incorrect. So the optimal strategy is the obvious one: guess the one you think is most likely that you haven’t ruled out. The less obvious strategies all involve picking a less likely (or impossible) answer in order to get more information on a subsequent guess, which just can’t actually work in your favor if you assume your guesses have at least a 1-in-K likelihood of being correct. I can’t be bothered to generalize that to less accurate first guesses; git gud.
|
# ? Jun 24, 2023 20:26 |
|
ultrafilter posted:This came up in another thread and it's a nice little puzzle: If you’re eg 3-5 years out then the range is the two disjoint intervals [y-5, y-3], [y+3, y+5].
|
# ? Jun 24, 2023 20:55 |
|
Here's a question that's not technical: I am considering doing contract / contract to hire positions for the first time. I know every position will probably be different, but I have at least one question: are they still typically At-Will employment? If I find something better, I can still bail?
|
# ? Jun 29, 2023 15:15 |
|
Magnetic North posted:Here's a question that's not technical: I am considering doing contract / contract to hire positions for the first time. I know every position will probably be different, but I have at least one question: are they still typically At-Will employment? If I find something better, I can still bail? When I was doing contract work this was spelled out in the contract. My understanding was I could be sued for leaving without following the contract so I made sure it spelled out a reasonable timeframe and that it was mutual, but this was based on the laws in my jurisdiction so ymmv.
|
# ? Jun 29, 2023 15:42 |
|
Are there any go-to recs for algorithms and data structures stuff? I know there’s a million courses and video series but that’s sort of the problem: I don’t know which ones are good and which are horrible, or what prerequisites they expect me to have. I never did a CS degree or anything so I’m at a loss.
|
# ? Jun 30, 2023 20:23 |
|
Surprise T Rex posted:Are there any go-to recs for algorithms and data structures stuff? I know there’s a million courses and video series but that’s sort of the problem: I don’t know which ones are good and which are horrible, or what prerequisites they expect me to have. http://algorithms.wtf
|
# ? Jun 30, 2023 20:29 |
|
Surprise T Rex posted:Are there any go-to recs for algorithms and data structures stuff? I know there’s a million courses and video series but that’s sort of the problem: I don’t know which ones are good and which are horrible, or what prerequisites they expect me to have. Bob Sedgewick’s Coursera course is good to start. Imho the most important thing is to have an interactive component so you’re not just passively watching lectures and MOOCs are good for that. IIRC he has two algorithms MOOCs which would put you in very good stead; the first only assumes basic programming skills. An alternative that I really like but might not be appropriate for a beginner necessarily is Eric Demain’s MIT OCW lectures.
|
# ? Jun 30, 2023 21:34 |
|
Wikipedia had very good animations of the different sorting algorithms.
|
# ? Jun 30, 2023 22:33 |
|
Yak Shaves Dot Com posted:Thanks for clearing that up! It sounds like I could make a couple of excel scripts, and if VB.NET comes up, feign familiarity and mention how close to C# it is. And wouldn't you know it, we're back in my comfort zone! I'll def look into WinForms, though. If you know C#, you know VB.NET. The only things you can do in VB.NET that you can’t do the exact same way in C# are pretty minor and esoteric. All you have to do is learn some new keywords, most of which are actually more sensible in VB.NET once you get over the case insensitivity.
|
# ? Jun 30, 2023 23:56 |
|
Surprise T Rex posted:Are there any go-to recs for algorithms and data structures stuff? I know there’s a million courses and video series but that’s sort of the problem: I don’t know which ones are good and which are horrible, or what prerequisites they expect me to have. Is this for interviewing purposes? One thing that helped me was implementing data structures/algorithms myself and then solving problems with them. Like reverse the order of a stack, build your own hash map with collision resolution, make a linked list queue, write your own quick sort and pivot algo.
|
# ? Jul 1, 2023 00:40 |
|
Not for interviewing purposes. So far in my experience in the UK we don’t really seem to get those sorts of questions in interviews. It’s mostly for my own curiosity because I feel like I’m quite senior and this sort of stuff is a pretty big gap in my knowledge, and also to recommend stuff to a direct report of mine who is curious as well.
|
# ? Jul 1, 2023 08:46 |
|
Surprise T Rex posted:Are there any go-to recs for algorithms and data structures stuff? I know there’s a million courses and video series but that’s sort of the problem: I don’t know which ones are good and which are horrible, or what prerequisites they expect me to have. If you are like me and have very little interest in the mathematical, formal proofs, etc aspects of it, the Head First series actually seemed to have a nice book about data structures. For the most part, a lot of these boil down to going to Wikipedia, looking at a chart of all of the relevant algorithms or structures for some specific aspect, and picking the right one based on whatever is most important running time wise once you understand the basic concepts of them.
|
# ? Jul 1, 2023 17:34 |
I had a bunch of unsaved editors in Visual Studio Code and just left them unsaved because every time I re-opened the program it would re-open them. It got updated to a new version and now all the unsaved editors are gone. Any way to get them back?
|
|
# ? Jul 11, 2023 16:38 |
|
Save them next time? I doubt they guarantee pending buffers will remain through any restart.
|
# ? Jul 11, 2023 16:54 |
|
Look at the recent documents list, and save your work from now on.
|
# ? Jul 11, 2023 16:55 |
|
don’t trust any software that loses any significant amount of user data on crash or restart
|
# ? Jul 11, 2023 17:05 |
|
I would start looking for another text editor, yeah. Reflexively mashing the Save hotkey is so 2004. I might give up on the search and come back resigned to vscode, but I'd still search.
|
# ? Jul 11, 2023 17:28 |
|
I’m putting together a little AI prompting challenge, where teams compete to solve a coding problem using a single prompt, and we compare results based on performance, length of prompt, solution complexity, etc. does anyone happen to have recommendations on a good problem to design against, without leaning directly into LeetCode? I’m afraid that using a LC problem would have a lot of solutions already baked into the training sets, and would really appreciate a problem that would introduce a lot of novel approaches and prompts.
Gin_Rummy fucked around with this message at 20:15 on Jul 11, 2023 |
# ? Jul 11, 2023 20:10 |
|
Gin_Rummy posted:I’m putting together a little AI prompting challenge, where teams compete to solve a coding problem using a single prompt, and we compare results based on performance, length of prompt, solution complexity, etc. does anyone happen to have recommendations on a good problem to design against, without leaning directly into LeetCode? I’m afraid that using a LC problem would have a lot of solutions already baked into the training sets, and would really appreciate a problem that would introduce a lot of novel approaches and prompts. Implement the hit videogame "Asteroids"
|
# ? Jul 11, 2023 20:17 |
|
Polio Vax Scene posted:I had a bunch of unsaved editors in Visual Studio Code and just left them unsaved because every time I re-opened the program it would re-open them. It got updated to a new version and now all the unsaved editors are gone. Any way to get them back? Also maybe people have different feelings about but imo don't even accumulate too many saved but uncommitted changes? You can always squash the history later for other people's consumption if needed mystes fucked around with this message at 20:28 on Jul 11, 2023 |
# ? Jul 11, 2023 20:25 |
|
I am very strongly of the opinion that if running git reset --hard would ever make you lose a meaningful amount of work then you went way too long without committing.
|
# ? Jul 11, 2023 23:16 |
this wasnt anything super important, just chicken scratch ive accumulated over the months. just wondering if vscode maybe saves those "unsaved" editors somewhere. it must, if it can get them back after a restart, but I'm willing to accept that a version upgrade wiped out wherever they were.
|
|
# ? Jul 11, 2023 23:45 |
|
Polio Vax Scene posted:this wasnt anything super important, just chicken scratch ive accumulated over the months. just wondering if vscode maybe saves those "unsaved" editors somewhere. it must, if it can get them back after a restart, but I'm willing to accept that a version upgrade wiped out wherever they were. I'd be snarky and post a LMGTFY but too lazy and just found a SuperUser. I'd assume everything is deleted but who knows maybe it's just corrupted. EDIT: However, I would say this is NOT the main use case of VS Code. You should find something that is always autosaving your data. gariig fucked around with this message at 00:09 on Jul 12, 2023 |
# ? Jul 12, 2023 00:06 |
|
Vi auto saves pretty well. And there’s never a reason to upgrade, so there’s no worry about a new version breaking anything. I seriously keep a tab open with Vi all day, just for notes.
|
# ? Jul 12, 2023 00:13 |
|
VSCode can auto save if you tell it to, like most editors these days. Several different triggers selections, even! Intentionally leaving unsaved data in a tool that is not explicitly for that just seems misguided. If you don’t want some modifications to end up in a branch then stash is a great way to quickly push it to the side, and bring it back later. Or make a temp branch to commit to and go back, branches are cheap and quick to use!
|
# ? Jul 12, 2023 00:37 |
|
lifg posted:Vi auto saves pretty well. And there’s never a reason to upgrade, so there’s no worry about a new version breaking anything. I don't even use tmux anymore after vim added :term
|
# ? Jul 12, 2023 00:45 |
|
NeoVim is good if only because it got the vim dev to actually do anything.
|
# ? Jul 12, 2023 00:52 |
|
necrotic posted:NeoVim is good if only because it got the vim dev to actually do anything. Neovim is worse than vim though
|
# ? Jul 12, 2023 00:55 |
|
leper khan posted:Neovim is worse than vim though “If only”
|
# ? Jul 12, 2023 01:02 |
|
The only thing neovim can do now that vim can’t, that matters to me at least, is be a fully embedded editor in VSCode. I get actual vim not some dumb emulator inside of vscode!
|
# ? Jul 12, 2023 01:04 |
|
necrotic posted:VSCode can auto save if you tell it to, like most editors these days. Several different triggers selections, even! https://code.visualstudio.com/docs/editor/codebasics#_hot-exit says "VS Code will remember unsaved changes to files when you exit by default." It is explicitly a tool for that. It doesn't work, apparently, but why is that op's fault? I've kept untitled documents open for years in editors that actually work.
|
# ? Jul 12, 2023 01:05 |
|
pokeyman posted:https://code.visualstudio.com/docs/editor/codebasics#_hot-exit says "VS Code will remember unsaved changes to files when you exit by default." It is explicitly a tool for that. I did not know they explicitly documented this as a thing, though it still doesn’t guarantee it’ll work beyond updates. And it fortunately lists where to find these files if needed. I’ll rescind my “wrong tool for the job” but still find it misguided to assume it will always forever have those “unsaved” files. If you definitely want a thing… save it to where _you_ control? edit: to expand, features like this are usually to prevent crashes of the app or computer from losing data. Not “I haven’t saved my changes for three weeks and it should always be there”.
|
# ? Jul 12, 2023 01:07 |
|
Gin_Rummy posted:I’m putting together a little AI prompting challenge, where teams compete to solve a coding problem using a single prompt, and we compare results based on performance, length of prompt, solution complexity, etc. does anyone happen to have recommendations on a good problem to design against, without leaning directly into LeetCode? I’m afraid that using a LC problem would have a lot of solutions already baked into the training sets, and would really appreciate a problem that would introduce a lot of novel approaches and prompts. To avoid training data contamination you can use problems posted after 2021. It appears to much worse at those RPATDO_LAMD fucked around with this message at 11:02 on Jul 12, 2023 |
# ? Jul 12, 2023 10:53 |
|
hello i am not a developer I use VS Code to modify JSON files from time to time. The biggest thing I have to correct in the JSON is a bunch of values that have been transmitted to our software as 0's instead of as incrementing numbers. For example, every block of revenue information starts with this line: code:
I'm currently doing that with find + replace. It's not horrible but I'm sure it could be done more quickly. Is there a way to do that with some kind of script or tool in VS Code? (yes this is in a sprint to be fixed in the actual system so i no longer need to worry about it but i think it's fairly low priority so it's not gonna get worked in the immediate future)
|
# ? Jul 13, 2023 13:18 |
|
|
# ? May 30, 2024 20:49 |
|
The way I would automate that would be to write a program to ingest the JSON, modify it, and then spit it back out. I don't know of any editors that are able to do the kind of incrementation that you want, though it wouldn't surprise me if emacs could do it. But also, that would require learning emacs, which is more work than the first solution I described.
|
# ? Jul 13, 2023 13:29 |