|
zfleeman posted:The web design/development thread must be on DB3, or something, so I'm going to ask my potentially asinine question here. Check out vNucleus, they are a goon run virtual host provider in SA-MART. They have pretty good prices, give goons a discount, and even offer packages where they will do all maintenance for you.
|
# ? Nov 13, 2015 16:21 |
|
|
# ? May 31, 2024 08:59 |
|
zfleeman posted:TLDR: I need a cheap/low-maintenance host. Any suggestions? I've had nothing but good luck with a $5/mo digitalocean droplet for stuff like this.
|
# ? Nov 13, 2015 16:26 |
|
LP0 ON FIRE posted:I have one table missing from the sidebar on phpMyAdmin. How do I get it back? I can still access the table if I click on the database and go to the list of tables. By the way I figured this out: Show hidden navigation tree items. (The lightbulb)
|
# ? Nov 13, 2015 19:17 |
|
In a graph, what's the best way to find the shortest path between a vertex and a region/subgraph? I think in an arbitrary graph with no special/nice properties you're stuck taking the min path between the source and all possible target vertices adjacent to nodes outside the subgraph?
Linear Zoetrope fucked around with this message at 13:33 on Nov 14, 2015 |
# ? Nov 14, 2015 13:30 |
|
Jsor posted:In a graph, what's the best way to find the shortest path between a vertex and a region/subgraph? I think in an arbitrary graph with no special/nice properties you're stuck taking the min path between the source and all possible target vertices adjacent to nodes outside the subgraph? You can start by modifying the graph and collapsing the entire region-of-interest to a single vertex. Then you just do a single vertex-vertex shortest-path.
|
# ? Nov 14, 2015 13:37 |
|
Jabor posted:You can start by modifying the graph and collapsing the entire region-of-interest to a single vertex. Then you just do a single vertex-vertex shortest-path. Right, and then you can just do a linear search on the vertices in the region to find one adjacent to the last node in the path to your region-vertex. (Though I guess this method starts to break down if you allow arbitrarily disjoint subgraphs)
|
# ? Nov 14, 2015 13:38 |
Use a single source shortest path algorithm to find the shortest path to every node in the graph, then pick the best node inside the subgraph.
|
|
# ? Nov 14, 2015 13:51 |
|
Jsor posted:Right, and then you can just do a linear search on the vertices in the region to find one adjacent to the last node in the path to your region-vertex. Specifically you'd want the one with the shortest edge-weight to an adjacent node, though obviously that's not an issue if you have an unweighted graph. You could also tag the edges leading into your merged region with their original destination vertex as you're constructing the modified graph, instead of doing a separate scan at the end to figure it out. I don't see any reason it wouldn't work on a disjoint region-of-interest?
|
# ? Nov 14, 2015 14:13 |
|
Collapsing the region of interest is fine if all the edge weights are positive, but it might be tricky if you have negative edge weights or the region spans several connected components.
|
# ? Nov 14, 2015 17:19 |
|
I have a few coworkers who struggle with regular expressions. Would it be a good idea to introduce VerbalExpressions into our code base? Has anybody used it and liked it?
|
# ? Nov 14, 2015 23:52 |
|
NihilCredo posted:I have a few coworkers who struggle with regular expressions. Would it be a good idea to introduce VerbalExpressions into our code base? Has anybody used it and liked it? CopyValuetoRegister(0, RegisterNumber1).IncrementRegister(RegisterNumber1).AddFirstRegistertoSecondRegister(Register1,Register2).GotoSection("My Section") mystes fucked around with this message at 20:34 on Nov 15, 2015 |
# ? Nov 15, 2015 20:28 |
|
ADD ONE TO COUNT GIVING COUNT
|
# ? Nov 15, 2015 20:32 |
|
mystes posted:Are your coworkers struggling with assembly language too? Maybe you should try VerbalAssembly(TM): You joke, but x86 extension set mnemonics are now up to things like VCVTTPD2UQQ (or the slightly clearer _mm512_mask_cvtt_roundpd_epu64 in practice in C/C++-world) so you'd better clarify what you intended somewhere when you use the things.
|
# ? Nov 16, 2015 00:20 |
|
I have the dangerous notion of trying to get one more 3rd-party layer to put on top of an enterprise web framework (ASP.NET, J2EE, Django--doesn't matter) for representing what really is just a giant, searchable table through a web UI. It would be easy enough to declare all the values I care about, but the data is just so regular that I don't see a need to actually have to code most of it. Mostly I want to make sure other users can toy with it without me having to monkey with the code most of the time. There are a few fields were I anticipate having to do some things, but it should be rare. Is there any stuff I can readily try for this kind of thing?
|
# ? Nov 16, 2015 19:14 |
|
mystes posted:Are your coworkers struggling with assembly language too? Maybe you should try VerbalAssembly(TM):
|
# ? Nov 17, 2015 13:31 |
|
NihilCredo posted:If I had to read assembly code only every now and then, yeah, I'd totally appreciate a more verbose syntax in exchange for not having to memorise the command list. If it were a more frequent activity then it'd be worth the effort to remember the compact syntax. But if you only have to read it now and then, then you're not losing that much time googling the ops you don't remember when you do have to read it.
|
# ? Nov 17, 2015 17:50 |
|
I had this question in an interview: Given 6 coins, 5 are real and one is fake. The fake one can be either heavier or lighter than the real ones. I had write a solution to find the fake coin using a balance only three times and find if the fake coin is heavy or light. I stumbled through the problem by writing a bunch of if statements for every case. What would be a more elegant way to solve this by iterating through it? I realized I needed to use an adversarial algorithm but couldn't figure out how to do it without a bunch of repetitive if/else statements.
|
# ? Nov 19, 2015 03:02 |
|
dangling pointer posted:I had this question in an interview: Given 6 coins, 5 are real and one is fake. The fake one can be either heavier or lighter than the real ones. I had write a solution to find the fake coin using a balance only three times and find if the fake coin is heavy or light. Divide and conquer.
|
# ? Nov 19, 2015 03:11 |
|
LeftistMuslimObama posted:Divide and conquer. "no I'm not answering this dumb question" or "hold on let me google this because that's what I'd do in a real life scenario" Is what I always want to say but don't. Compare 2v2 and they'll either be equal or not equal. Then just do some other stuff based on the result. If they're equal the fake is in the other 2, if they're not then the other 2 are legit. Sex Bumbo fucked around with this message at 04:10 on Nov 19, 2015 |
# ? Nov 19, 2015 04:05 |
|
Sex Bumbo posted:Compare 2v2 and they'll either be equal or not equal. Then just do some other stuff based on the result. If they're equal the fake is in the other 2, if they're not then the other 2 are legit. Ya, thats what I did just broke them into sets of 2 and made a bunch of if statements from there. Seemed like there was a better way to do it besides make an if statement for ever case but maybe not.
|
# ? Nov 19, 2015 04:17 |
|
It's not a very good interview question.
|
# ? Nov 19, 2015 04:19 |
|
I noticed a few typos recently in the documentation for an open source library I'm using for a side project. The documentation is up on GitHub (the documentation site itself is generated using Sphinx) and there's even a "edit this page on GitHub" link at the top of all the pages on the deployed website. Is it obnoxious to open a pull request just to fix small typos? I've noticed things like "the" spelled as "tbe" or an extra word that makes a sentence grammatically incorrect and looks like it was meant to be deleted. It seems like it would be really obnoxious to open a pull request for a single typo, but maybe if I found a bunch and did it in one PR it wouldn't be so bad. Are these types of minor contributions welcome, or are they generally considered rude? If it matters it's a project backed by a commercial company. Cryolite fucked around with this message at 05:43 on Nov 19, 2015 |
# ? Nov 19, 2015 04:21 |
|
I wouldn't make a PR for each individual one, but you could definitely try doing a bunch of them in a single PR. All they have to do to to accept your changes is click on one button, so it's not very hard for them. If they can't be arsed to do it then gently caress 'em.
|
# ? Nov 19, 2015 04:43 |
|
Any contribution is welcome. Feel free to open a PR even to fix a single character typo. If anything they will appreciate the involvement. If they have lots of open PRs with no activity then don't bother, the project is dead.
|
# ? Nov 19, 2015 04:51 |
|
dangling pointer posted:I had this question in an interview: Given 6 coins, 5 are real and one is fake. The fake one can be either heavier or lighter than the real ones. I had write a solution to find the fake coin using a balance only three times and find if the fake coin is heavy or light. This is a bad interview question. Not only has everyone heard it, but it's not a terribly interesting implementation.
|
# ? Nov 19, 2015 05:06 |
|
Cryolite posted:I noticed a few typos recently in the documentation for an open source library I'm using for a side project. The documentation is up on GitHub (the documentation site itself is generated using Sphinx) and there's even a "edit this page on GitHub" link at the top of all the pages on the deployed website. I'm nominally in charge of an OSS library on GH (also largely backed by a company, though I'm not sure that matters) and I can say PRs for corrections or improvements are always welcome.
|
# ? Nov 19, 2015 05:07 |
|
A PR for a single typo in a comment would make me wonder why you're wasting my time, but anything more substantial is always appreciated.
|
# ? Nov 19, 2015 05:39 |
|
Cryolite posted:I noticed a few typos recently in the documentation for an open source library I'm using for a side project. The documentation is up on GitHub (the documentation site itself is generated using Sphinx) and there's even a "edit this page on GitHub" link at the top of all the pages on the deployed website. Do it. Not rude at all. If you make a PR and don't hear back for a month, well, you tried but they're not interested. Personally I'd press the "merge" button lickety-split. quote:If it matters it's a project backed by a commercial company. They might want you to sign something giving them the rights to your changes, but hopefully they've made that easy.
|
# ? Nov 19, 2015 05:41 |
|
dangling pointer posted:Ya, thats what I did just broke them into sets of 2 and made a bunch of if statements from there. Seemed like there was a better way to do it besides make an if statement for ever case but maybe not. You can use recursion (which typically goes hand-in-hand with divide and conquer) and end up with only a single if statement (for detecting your base case). Everyone is saying it's a lame interview question, but it's not intended to be challenging. It's intended to see if you know about divide and conquer and recursion, because if you don't there's probably some followup questions necessary.
|
# ? Nov 19, 2015 06:21 |
|
LeftistMuslimObama posted:You can use recursion (which typically goes hand-in-hand with divide and conquer) and end up with only a single if statement (for detecting your base case). What's the way to do it with a conditionless recursive step? I can't figure it out. And the reason it's a lame interview question isn't that it's challenging, or not challenging - the reason is that 95% of people who can answer it are just regurgitating what they've seen previously. It's trivia, not problem-solving.
|
# ? Nov 19, 2015 10:36 |
|
LeftistMuslimObama posted:You can use recursion (which typically goes hand-in-hand with divide and conquer) and end up with only a single if statement (for detecting your base case). Then ask a question about divide and conquer. This sounds like you're expecting a smug interviewer to respond "ah, you solved it, and efficiently, but not using the specific solution I was expecting!"
|
# ? Nov 19, 2015 14:22 |
|
Volmarias posted:Then ask a question about divide and conquer. This sounds like you're expecting a smug interviewer to respond "ah, you solved it, and efficiently, but not using the specific solution I was expecting!" Not smugly, no. Maybe our interviews here are weird, but if they gave a weak solution to this problem our interviewers would talk with them more about programming techniques and try to get a feel for what they've learned, and how quickly they'll grasp the solution once it's given to them. The followups can help determine if the person is at least equipped to learn anything they didn't already come in knowing. We hire a shitload of fresh college grads though. I suspect if you had a decent amount of experience on your resume we'd just skip those sorts of soft filter questions.
|
# ? Nov 19, 2015 16:56 |
|
What kind of strange person believes that the recursive answer is the more correct one? It's ok if you want to find out how the candidate thinks and where he's as level wise, but maybe not use a gotcha question. Open ended "how would you implement this" will get you what you want while being clear to the candidate exactly what you're asking of them.
|
# ? Nov 19, 2015 18:27 |
|
I really want to know the solution that isn't a thicket of conditional logic.
|
# ? Nov 19, 2015 18:32 |
|
Also perhaps not limiting it to 6 coins and 3 moves.
|
# ? Nov 19, 2015 18:33 |
|
I originally heard of it as 12 coins and 4 moves, but while the solution I know to that one shares enough principles with the 6-3 version that I was able to deduce the latter solution, it's not just a recursive expansion, and neither of them are (as far as I can tell) a recursive expansion from a base case.
|
# ? Nov 19, 2015 19:20 |
|
Is this the point where we post our buggy and crappy solutions to the problem, and then everyone complains about them? Because I'm all for that. C code:
Xerophyte fucked around with this message at 19:28 on Nov 19, 2015 |
# ? Nov 19, 2015 19:25 |
|
GrumpyDoctor posted:I really want to know the solution that isn't a thicket of conditional logic. Volmarias posted:Also perhaps not limiting it to 6 coins and 3 moves. In principle, you can always get a solution for N coins in ceil(ln2(N)) experiments by recursive division. code:
experiment is a recursive function which generates experiments. It takes two parameters: a list of coins which includes the oddly-weighted coin, and a list of coins which does not include the oddly-weighted coin. If the list of possibly-oddly-weighted coins is empty, then we're in an impossible situation. If the list of possibly-oddly-weighted coins is a single-element list, then we know the answer. If we have two coins of unknown weight, and no coins that we know are the correct weight, then we don't have enough information to solve the problem (all we can do is verify that the two coins are, in fact, different weights). If we have two coins of unknown weight, and at least one coin that we know is the correct weight, then we pick one of the unknown coins and weigh it against the known one. If they are the same, then the other one of the unknowns is the oddly-weighted one. If we have more than two coins of unknown weight, and no coins of known weight, then we divide the coins in half, then divide one of the halves again. This gives us three sets: A (1/4 of the original set), B (1/4 of the original set), and R (the remainder). If A has the same weight as B, then the oddly weighted one is in R. If A differs from B, then either A or B has the oddly-weighted one. If we have more than two coins of unknown weight, and some coins of known weight, then we divide the unknown coins in half, pick one of the halves, and weight it against the same number of coins from the known-good set (by construction, our known-good set if we have one is always at least half the total coins rounded down, which is more than the at most one quarter of the total coins that we are weighing against it, so we will always have enough known-good coins to do this). This algorithm works for 6 coins in 3 experiments, and it scales well, but it's not perfect; there are more division rules that are needed to get the optimal answer. For example, this algorithm fails on three coins by entering an endless loop trying to weight the empty list against itself. It also gives a suboptimal path for 7 coins, by sometimes needing 4 experiments when only 3 should suffice. Doing it properly gets a little messier, but the general idea of recursive divide-and-conquer by trying to refine the set of possibly-oddly-weighted coins by half each time is fairly simple.
|
# ? Nov 19, 2015 19:43 |
|
GrumpyDoctor posted:I originally heard of it as 12 coins and 4 moves, but while the solution I know to that one shares enough principles with the 6-3 version that I was able to deduce the latter solution, it's not just a recursive expansion, and neither of them are (as far as I can tell) a recursive expansion from a base case. It involves a bunch of return statements instead. I didn't say no conditional logic, just fewer if statements. I also didn't think about it too hard so I'm probably missing a corner case in there.
|
# ? Nov 19, 2015 19:55 |
|
|
# ? May 31, 2024 08:59 |
|
Hate conditional logic? Smuggle the decisionmaking through flow control instead!
|
# ? Nov 19, 2015 19:57 |