|
I've had close brushes with fortran in DSP code, like audio and image processing. A lot of black magic signal processing code started as fortran. For example, I am sure there's plenty of fortran in 5G tech, at least in the design tools if not the actual shipping silicon.
|
# ? Mar 27, 2021 20:21 |
|
|
# ? Jun 2, 2024 08:12 |
|
Bruegels Fuckbooks posted:If you'd told me five years ago that people were using a framework like this for embedded, I would've said something uncharitable like "are you smoking crack?" Maybe I'm just getting too old. I feel the same way... until someone makes me MicroJS
|
# ? Mar 27, 2021 22:31 |
|
There is Espruino. Now you can experience the computing power of 1945's ENIAC on a much smaller hardware platform!
|
# ? Mar 27, 2021 23:11 |
|
Tiny architectures are cool, but I don't think I'll ever go back to 8-bit micros. Having a clean 32-bit architecture is so nice. It would take a lot for me to look at a not-ARM micro.
|
# ? Mar 28, 2021 01:05 |
|
Devian666 posted:Mathematics intensive hobby projects. I don't really like C++ so I avoid it at all costs. Ah, have fun then In answer to your original question: I've gotten distracted by Haskell for hobby projects. It's worth checking out if you've only every used procedural languages
|
# ? Mar 28, 2021 18:32 |
|
HappyHippo posted:Ah, have fun then I used Haskell in computer science functional programming course. It is on my list to try again. It will no doubt still be as mind bending as when I used it in the 90s.
|
# ? Mar 29, 2021 05:09 |
|
I dunno if anyone here can help, but I've got a crystal reports question. Side bar, I dislike crystal reports and know enough to mess stuff up. I have a report which reports out several pieces of data related to sample_id from a view in the database. I'm trying to add in a data column date_created from a separate table in the same database with sample_id as the primary key. The issue is that date_created reports out 4 rows for each sample_id. I know what parameters I can use to filter for the particular row I want, but I only want to filter the data for this particular formula not the report as a whole so I can't use selection expert. When I try and use an if then else statement, it won't let me return a string as the else return it demands another date option. My question boils down to how do I filter data for one specific formula without creating a sub report?
|
# ? Mar 30, 2021 17:05 |
|
Quick (I hope) CSS question. I am working on a demo app representing a fictional online retailer, and I'm working on the retail web site now. I'm using a bootstrap 4 card to display individual products. The header contains the manufacturer, product name, and a price widget. The body contains the description. That's all working well. The problem is the footer. What I want to be there is:
The problem is that the centered text is centered between the age badge and the button. This means that if there is an age badge on some items and not on others, the centered text blocks do not line up. What I really want is that the text in the center is absolutely centered in the DIV, not between the two other elements. Here's the code (razor syntax): code:
code:
|
# ? Mar 31, 2021 22:06 |
|
If I understand what you're asking correctly, the way to do this is to doCSS code:
|
# ? Apr 1, 2021 17:01 |
|
Munkeymon posted:If I understand what you're asking correctly, the way to do this is to do I made one change to the age-badge, so that it always puts something out, so if the item isn't age-restricted it puts "All Ages!". Then changing the CSS to this seems to do the trick: code:
|
# ? Apr 1, 2021 18:05 |
|
Would probably be easiest to just make the footer a 1x3 grid
|
# ? Apr 1, 2021 21:46 |
|
HappyHippo posted:Would probably be easiest to just make the footer a 1x3 grid Hahaha, you’re absolutely right. I got so tied up in trying to use flex, I missed the obvious solution
|
# ? Apr 2, 2021 00:05 |
|
What sort of language features does my C-like toy language need to have in order to be considered Turing-complete? Right now it can evaluate algebraic expressions, load/store global variables, if/then/else, for/while/do, and call intrinsic functions in native code. It CANNOT define functions in its own language or do recursion. No local variables or scopes. This is just for a blurb in the release notes like "Version 1.4 is when this text editor became Turing-complete."
|
# ? Apr 2, 2021 23:34 |
|
ryanrs posted:What sort of language features does my C-like toy language need to have in order to be considered Turing-complete? Load/store variables and conditional repetition (e.g. for/while) are the two minimum characteristics for Turing complete, so that seems to qualify.
|
# ? Apr 2, 2021 23:40 |
including what you've already posted, if you can have an arbitrarily long sequence of values (e.g., stack, queue, linked list, eg) it's probably turing complete.
Ruzihm fucked around with this message at 23:45 on Apr 2, 2021 |
|
# ? Apr 2, 2021 23:42 |
|
Can you simulate a Turing machine in it?
|
# ? Apr 2, 2021 23:45 |
|
The language itself has only ints and floats. It can't express arrays or things like linked lists. But you could write a couple stack operators in native code and make it available in the language, so close enough. Thanks for the explanation!
|
# ? Apr 2, 2021 23:47 |
|
Does it let you form an infinite loop? The fact that you have for/while/do normally suggests Turing completeness since the only way to prevent that while having those structures is to have a statically known amount of iterations, maybe the lack of local variables accomplishes that.
|
# ? Apr 2, 2021 23:49 |
|
Yes, it can definitely get stuck in an infinite loop. e: I just realized I can read/write from arbitrarily-sized framebuffers, which can be used as stacks. So it's definitely Turing-complete. ryanrs fucked around with this message at 02:12 on Apr 4, 2021 |
# ? Apr 2, 2021 23:51 |
|
What languages have a cool syntax for multi-dimensional looping? In C you would do something like: for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { your crap here; }} But surely someone else has developed something snappier? Bonus points if it'll fit into a C-like language without seeming too alien.
|
# ? Apr 6, 2021 07:30 |
|
ryanrs posted:What languages have a cool syntax for multi-dimensional looping? In C you would do something like: Like these? https://en.m.wikipedia.org/wiki/Array_programming#Languages My first thought was list comprehensions in Haskell, but that's for permutations of arrays rather than matrices.
|
# ? Apr 6, 2021 07:49 |
|
Right now I have:pre:for [x=0..w, y=0..h] { blah(x, y); } pre:for [x=0..=10] { print(x); }
|
# ? Apr 6, 2021 08:01 |
|
ryanrs posted:Right now I have: Yes. The syntax suggests that it's syntactic sugar "for [x=0..w] for [y=0..h]", so the intuitive reading is that y varies fastest.
|
# ? Apr 6, 2021 09:30 |
|
Two options in python:code:
code:
|
# ? Apr 6, 2021 14:22 |
|
Just to get a general feeling: how frequently, and how comfortable, are you in using your debugging tools? For my small personal/work python scripts, I usually just toss "print" statements everywhere. Now that I'm trying to teach myself a little C, it seems like learning the basics of gdb could be useful.
|
# ? Apr 7, 2021 19:26 |
|
gdb can be very helpful, and you should know how to use it. But I don't disparage print statements. Sometimes they get the job done just as well.
|
# ? Apr 7, 2021 19:36 |
|
The debugger is the one of the first things I learn in any language, right after how to install it and set up a working project structure.
|
# ? Apr 7, 2021 19:36 |
|
Debuggers are extremely important, integrated ones doubly so. Once you feel comfortable enough, find an IDE which should have an integrated debugger of some kind. I believe even VS Code supports gdb and that's very lightweight! Stepping through code blind is possible, but it sucks in comparison to having all information for all parts you'll want to see. I reserve use of print statements for instances where using a debugger is impractical. For example, gathering data on possible race conditions, firmware that does not nicely support debugging, services that will just decide "lol I'm done" if you block for more than 10s, stuff that can only be found in production, etc. They absolutely have their use, but once you're familiar with using a debugger print statements should usually be reserved for contingency use. There's also adding print statements of some form for logging, which can be very important (having additional relevant information if an exception occurs, rather than just yeeting the stack trace further along), but those will generally exist in a separate logging framework of some kind and you can worry about that later. Lastly, print statements are excellent ways to step through trivial programs while tinkering. Seeing all of the results for each step at the end can be a lot better than having to click "next" and "continue" a lot. Don't feel like you're doing it wrong if you're using print statements while you're still getting used to the language, or programming as a whole.
|
# ? Apr 7, 2021 20:38 |
|
Hughmoris posted:Just to get a general feeling: how frequently, and how comfortable, are you in using your debugging tools? For interpreted languages such as python/R I find using a REPL way superior to debugging. I have a interpreter session open at all times while coding so I'm just executing stuff as I write it. If there's an error I can simply modify the problematic code and run that part again, no need to restart the whole script. It's just very convenient, you just need to bind the "execute the selection in the interpreter" to an easy keyboard shortcut.
|
# ? Apr 7, 2021 20:48 |
|
Hughmoris posted:Just to get a general feeling: how frequently, and how comfortable, are you in using your debugging tools? I'm constantly in debuggers and get really annoyed when I can't use one. Print statements and logging work great too. Python has pdb if you wanna try a new tool without learning a new language at the same time. One big benefit of debuggers that I use too infrequently is their ability to modify things. You can try out a fix without having to stop the world, recompile, restart, and get back to the state you were in. If you like having a repl, debuggers let you drop into a repl anywhere you like with all the local state ready for touching. I don't know if you're counting tools like address sanitizer, thread sanitizer, undefined behavior sanitizer, valgrind, etc. as debugging tools, but they're all very useful and it's nice to have enough familiarity to know when they might help solve your problem. Also, once it works, turning tossed-around print statements into verbose-level logs can work nicely. Odds are if you found them useful once, you'll find them useful again.
|
# ? Apr 7, 2021 21:26 |
|
Hughmoris posted:Just to get a general feeling: how frequently, and how comfortable, are you in using your debugging tools? yeah, the tracepoint function of gbd (and a lot of other languages/debuggers, even chrome does it now) is super useful because you can basically just put print statements wherever you want without having to recompile everything. print statements suck if you have long build times.
|
# ? Apr 7, 2021 22:44 |
|
Walh Hara posted:For interpreted languages such as python/R I find using a REPL way superior to debugging. I have a interpreter session open at all times while coding so I'm just executing stuff as I write it. If there's an error I can simply modify the problematic code and run that part again, no need to restart the whole script. It's just very convenient, you just need to bind the "execute the selection in the interpreter" to an easy keyboard shortcut. This helps while writing code but not debugging an entire existing code base.
|
# ? Apr 7, 2021 22:52 |
|
Bruegels Fuckbooks posted:yeah, the tracepoint function of gbd (and a lot of other languages/debuggers, even chrome does it now) is super useful because you can basically just put print statements wherever you want without having to recompile everything. print statements suck if you have long build times. This is actually a hugely awesome and underrated ability for some debuggers. You can modify the breakpoints to not pause, but instead to evaluate and execute some code snippet. You can also conditionally trigger the breakpoint, so if you end up in a state where dickbutt == null but shouldn't be you can see what everything else looks like and where things just were when they happened.
|
# ? Apr 7, 2021 22:56 |
|
I never studied maths or computer science but I do have some dev experience, and I'm applying now for a position as a junior backend dev, working in python. I don't want help with my homework, but I want to check my imposter syndrome real quick -- is it normal to get sent what amounts to a multiple choice knapsack problem challenge as a code challenge for a junior backend position? I'm going to do the rest and then try to leave as much time as possible to work on that, but from the few hours I've spent looking into it so far today, it seems a bit.. farfetched. Like, this is NP-complete stuff (e: right?), the dataset they link is only 20k rows so you could probably brute force it (but on a web app environment?), but they're asking how I'd recommend they scale that to add 5-20 million extra rows per month. Uhh... I guess I'd recommend "don't", but then again, I never studied computer science, so I don't know if this is A Normal Thing
boofhead fucked around with this message at 17:53 on Apr 8, 2021 |
# ? Apr 8, 2021 17:47 |
|
Ridiculous interview questions are a completely normal thing. It's also possible that whoever sent you the problem doesn't know that it's NP-complete and wouldn't know what that means.
|
# ? Apr 8, 2021 17:51 |
|
It is also possible that the answer they're looking for is an acknowledgement that the problem is NP-complete and some strategies for handling it anyway (because in reality sometimes you have to do that). Either way, it sounds a little weird for a junior position, but there's no real way to know which precise flavor of weird without talking to them more.
|
# ? Apr 8, 2021 18:12 |
|
Do they want an "optimal" answer or a "good enough" answer?
|
# ? Apr 8, 2021 18:33 |
|
The phrasing is literally:quote:Once the budget is defined, the tool must show a list of 11 players that constitute the best team one can have for this specific budget. In bold, too. I have some ideas for how I could approach a "best guess" kind of solution and then hopefully compare to pre-generated lists at certain budgets to see how far off I am, but let's see how much time I have (or how long it'll take to generate those lists) Thank you for your feedback, I was going a little crazy. I don't want any help with approaching the problem but it was nice to get confirmation that I'm not the world's dumbest dumb dumb. I'm definitely going to point to the NP-Completeness thing in my response, no way I'm copping a "aw, you didn't manage it? sorry, we're kinda looking for Rainman" for a junior dev role boofhead fucked around with this message at 18:44 on Apr 8, 2021 |
# ? Apr 8, 2021 18:41 |
|
boofhead posted:I never studied maths or computer science but I do have some dev experience, and I'm applying now for a position as a junior backend dev, working in python. I don't want help with my homework, but I want to check my imposter syndrome real quick -- is it normal to get sent what amounts to a multiple choice knapsack problem challenge as a code challenge for a junior backend position? I'm going to do the rest and then try to leave as much time as possible to work on that, but from the few hours I've spent looking into it so far today, it seems a bit.. farfetched. Like, this is NP-complete stuff (e: right?), the dataset they link is only 20k rows so you could probably brute force it (but on a web app environment?), but they're asking how I'd recommend they scale that to add 5-20 million extra rows per month. Uhh... I guess I'd recommend "don't", but then again, I never studied computer science, so I don't know if this is A Normal Thing If you're writing backend code it's not necessarily a web app environment. They've talked about scaling the data but have they talked about who'd be making the requests, how varied the inputs are to the request, and how many users would be making the request? Have they mentioned performance expectations, too? Is the problem space constrained in some way, like does the user only have 20 potential items out of the entire dataset that you need to optimize for? edit: You replied before I did. From that description, are players "active" for someone to pick from or do they have access to the entire dataset? Can players already be taken by other people or are you allowed to draft from the entire pool? etcetc Khorne fucked around with this message at 18:49 on Apr 8, 2021 |
# ? Apr 8, 2021 18:42 |
|
|
# ? Jun 2, 2024 08:12 |
|
raminasi posted:It is also possible that the answer they're looking for is an acknowledgement that the problem is NP-complete and some strategies for handling it anyway (because in reality sometimes you have to do that). Either way, it sounds a little weird for a junior position, but there's no real way to know which precise flavor of weird without talking to them more. This is the way I would approach it. If the interviewer is looking for this sort of answer, you've done the right thing, and if they fail you for not finding the optimum solution to an NP-hard problem at arbitrary scale, you've dodged a bullet.
|
# ? Apr 8, 2021 18:43 |