|
I've used svn in groups for smaller programming projects, but it's never been very organized and I honestly don't know a lot about how to manage a repository. I'm about to start working on a new project and I want to make it a bit more organized. I want to set up the repository so that each person working on the project can work on their own branch that might be a bit experimental and can incorporate their changes back into the trunk version after a certain amount of QA is done. The only problem is I have no idea how to do this and even if I messed around with it I have no idea if I'm doing it right. So what's the right way to accomplish this?
|
# ? Mar 30, 2009 02:11 |
|
|
# ? May 29, 2024 19:40 |
|
Fruit Smoothies posted:Edit: It seems like the program wants to put more than two things in a box. Yeah, I was only solving for a general case; you'd express size limitations in that guard function. If your problem is really just this trivial then I don't see why a program is needed. I mean, let's say you have 12 elements in 6 pairs: pre:A A' B B' C C' D D' E E' F F' pre:A B' B C' C D' D E' E F' F A'
|
# ? Mar 30, 2009 02:23 |
|
Contero posted:I've used svn in groups for smaller programming projects, but it's never been very organized and I honestly don't know a lot about how to manage a repository. I'm about to start working on a new project and I want to make it a bit more organized. We already told you in the C++ thread: use git.
|
# ? Mar 30, 2009 03:09 |
|
Contero posted:I've used svn in groups for smaller programming projects, but it's never been very organized and I honestly don't know a lot about how to manage a repository. I'm about to start working on a new project and I want to make it a bit more organized.
|
# ? Mar 30, 2009 03:35 |
|
ShoulderDaemon posted:What, precisely, are you trying to do? It really is complicated to explain, but the best way to think of it is like adjectives/words. The trouble is, they're not as simple and easily paired as with "hot" and "warm" for example. Some words can be paired with around 6 others, while some can only be paired with three. This means that doing manually nearly always results in not knowing how to pair up the difficult ones. I'm not even sure if there is a solution to this data set.
|
# ? Mar 30, 2009 13:58 |
|
Fruit Smoothies posted:It really is complicated to explain, but the best way to think of it is like adjectives/words. The trouble is, they're not as simple and easily paired as with "hot" and "warm" for example.
|
# ? Mar 30, 2009 15:03 |
|
Fruit Smoothies posted:It really is complicated to explain, but the best way to think of it is like adjectives/words. The trouble is, they're not as simple and easily paired as with "hot" and "warm" for example. There's 66 possible pairs formed from 12 categories. Make a list of them, and remove any from the list that are invalid. Then, use a backtracking algorithm to recursively insert them one box at a time while ensuring you aren't inserting a duplicate into the list.
|
# ? Mar 30, 2009 15:13 |
|
Dijkstracula posted:If you don't mind getting your hands dirty with a backtracking logic language like Prolog, this sounds like a good constraint programming problem. (refresher: Variables start with a capital, and atoms (string constants) start with a lowercase letter, and statements end with a period). in foo.pl: code:
code:
You can add new rules like can_pair(foo,Y) :- member(Y, [abacus, zebra, foxtrot]). to say goo can pair with abacus, zebra or foxtrot. Edit: This is a simple generate and test program. It is possible to optimize this significantly. tef fucked around with this message at 16:22 on Mar 30, 2009 |
# ? Mar 30, 2009 15:14 |
|
huge sesh posted:I don't think you really want to try to implement the logic backend that Haskell has in Pascal. What? Haskell doesn't have a logic backend.
|
# ? Mar 30, 2009 15:17 |
|
tef posted:
So this simply tells if a set of boxes is allowed or not, based on the constraints of the allowed pairs?
|
# ? Mar 30, 2009 15:24 |
|
I'm pretty stuck on this, so if someone is able to shed some light that would be very helpful! The Excel megathread looks like it is no longer live, so hope this is the right place to put it. Background The spreadsheet I'm working on contains data on several companies used for comparative purposes. Row 1 contains the company names (column A, B, C etc) and the data for each company is contained in row 3 and below, as in the mock-up: code:
The median calculation for revenue, for example, would be code:
The problem I'm trying to do a more complicated formula - I want to go along row 4 and count only those cells with a value of, say, equal or less than 15, but only if those columns have been selected. The basic formula I had been using was this, which worked fine, but doesn't take into account whether the company is 'selected' or not: code:
code:
|
# ? Mar 30, 2009 16:00 |
|
Fruit Smoothies posted:So this simply tells if a set of boxes is allowed or not, based on the constraints of the allowed pairs? No. It's *generate* and test. By passing a variable in, it will search for a value that is a valid set of pairs from the given elements: code:
The trick with prolog is that you simply state what you want, and then prolog finds it for you. You can also call it with a set and a list of pairs to see if it is a valid combination. Or call it with a list of pairs and find out the set of elements. Or call it with two variables to enumerate all possible sets of elements and pairs. Edit: To give a simpler example: Every prolog expression is really a question: code:
I wrote rules to say that a list of elements and a list of pairs is valid if it could make one pair, and the rest of the elements could be made into pairs. The prolog interpreter searches for a possible case where the rule is true. By supplying variables, I can enumerate cases where the rule is true. The program itself is very trivial and basic prolog, if you can write up the rules in a pastebin or link to them, I can try to add it to the example I wrote above. tef fucked around with this message at 16:24 on Mar 30, 2009 |
# ? Mar 30, 2009 16:11 |
|
Col posted:I'm pretty stuck on this, so if someone is able to shed some light that would be very helpful! The Excel megathread looks like it is no longer live, so hope this is the right place to put it. First result from google: http://www.ozgrid.com/Excel/count-if.htm A less elegant approach that I've seen would be to create a hidden column, and then for each row use the formula (not tested): =IF(AND(B4="Yes",C4<=15), 1, 0) Then sum the values in the hidden column
|
# ? Mar 30, 2009 16:47 |
|
I guess what I don't get about any of these bits of code, is when the program stops, and where it starts. I have realised a good example of this problem is that of the numbers 1-12. If you add a constraint that prime numbers can't be paired with each other, you very quickly end up with an interesting set of allowed pairings:code:
(1,4)(2,6)(3,8)(7,10)(9,12)
|
# ? Mar 30, 2009 16:49 |
|
Fruit Smoothies posted:I guess what I don't get about any of these bits of code, is when the program stops, and where it starts. I have realised a good example of this problem is that of the numbers 1-12. If you add a constraint that prime numbers can't be paired with each other, you very quickly end up with an interesting set of allowed pairings: Look up backtracking algorithms and the n-queens problem, I think it would be the best solution for your current problem.
|
# ? Mar 30, 2009 16:59 |
|
Fruit Smoothies posted:I guess what I don't get about any of these bits of code, is when the program stops, and where it starts. We're using programming paradigms that don't have as strictly-defined concepts of execution as you're used to. Fruit Smoothies posted:I have realised a good example of this problem is that of the numbers 1-12. If you add a constraint that prime numbers can't be paired with each other, you very quickly end up with an interesting set of allowed pairings: You decide that an earlier decision must have been wrong, so you back up and try something else. This is hidden in the List monad in Haskell, and in the unification algorithm in Prolog. Fruit Smoothies posted:Of course, this example strikes me as impossible, because the pairs are pretty much restricted to odd-even. This would work if 2 wasn't a prime number. (Correct me if I'm wrong, here) There are six primes and six nonprimes in the range 1..12 (assuming you count 1 as prime) so the solution is quite straightforward. (1,4),(2,6),(3,8),(5,9),(7,10),(11,12) And, obviously, any substitution of the above where primality is preserved.
|
# ? Mar 30, 2009 17:08 |
|
ShoulderDaemon posted:And, obviously, any substitution of the above where primality is preserved. I counted 9 as prime Would it be true to say that starting at every point in the list, and considering all of the other items' compatibility would solve this problem? Although it would be inefficient?
|
# ? Mar 30, 2009 17:17 |
|
Fruit Smoothies posted:I counted 9 as prime I'm not exactly sure what you mean... An inefficient but easy-to-verify solution to the general problem is: code:
|
# ? Mar 30, 2009 17:31 |
|
Fruit Smoothies posted:I guess what I don't get about any of these bits of code, is when the program stops, and where it starts. In mine it starts by taking two items, trying to pair them, and then moves onto the rest of them. It stops when it runs out of items to pair, or if it can't pair the remaining items. In the latter case, it will not produce a solution.
|
# ? Mar 30, 2009 18:08 |
shrughes posted:What? Haskell doesn't have a logic backend. Sorry, I was confused.
|
|
# ? Mar 30, 2009 20:54 |
|
I have no point here, I just like saying "Curry-Howard isomorphism".
|
# ? Mar 30, 2009 21:42 |
|
Not as cool as the Curly Howard isomorphism.
|
# ? Mar 30, 2009 22:39 |
|
http://www.youtube.com/watch?v=c8Zl0a2-wqw
|
# ? Mar 30, 2009 23:20 |
|
chocojosh posted:First result from google: http://www.ozgrid.com/Excel/count-if.htm Many thanks, I had missed this with my search terms. In the end, something similar to this works fine: code:
Thanks again.
|
# ? Mar 31, 2009 14:43 |
|
I'm having a problem with a bison grammar. It's meant to accept variable declarations and assignments such as:code:
code:
|
# ? Mar 31, 2009 17:19 |
|
When it's trying to parse a program, and it can read "" from the head of input (i.e. always), it doesn't know whether to treat that as an access_qualifier or a scope_qualifier. This sort of thing is an excellent reason to strongly avoid empty productions. The easiest solution is to pull the empty productions out of those two symbols and duplicate their users, like so: code:
|
# ? Mar 31, 2009 17:40 |
|
rjmccall posted:When it's trying to parse a program, and it can read "" from the head of input (i.e. always), it doesn't know whether to treat that as an access_qualifier or a scope_qualifier. Your solution was spot on, thanks.
|
# ? Mar 31, 2009 18:06 |
|
How hard is it to transition from verilog to VHDL? For my internship this summer I'll be doing fpga poo poo but it will be in VHDL. I have no VHDL experience since my school uses verilog instead.
|
# ? Mar 31, 2009 22:54 |
|
This is the code that's executed when you "Show Containing Folder" in Firefox's Download Manager on Windows.code:
Basically, it calls explorer.exe directly in order to pass some flags on the command line that make the file selected automatically. I want to change this so that it uses the default handler for Folders -OR- have it call something other than explorer.exe. I use an XYplorer as a file manager, and I want "Show Containing Folder" to use that instead. Is this possible to do by writing an extension? Would I have to write a whole new Download Manager replacement to override just this one method? mlnhd fucked around with this message at 15:54 on Apr 1, 2009 |
# ? Apr 1, 2009 15:51 |
|
ht
DholmbladRU fucked around with this message at 22:32 on Apr 1, 2009 |
# ? Apr 1, 2009 16:05 |
|
Melonhead posted:[firefox download manager code] I don't know about writing an extension to replace the behavior, but you might want to suggest a patch to Firefox to change this behavior because as you've discovered it's not strictly correct. Instead of executing Explorer, one should just ShellExecute the path itself and the shell registered in HKEY_CLASSES_ROOT\Folder\shell\[action]\command will take care of business. code:
csammis fucked around with this message at 16:11 on Apr 1, 2009 |
# ? Apr 1, 2009 16:08 |
|
My friend and I are completely lost on an assembly language program. Its fairly simple, but we are newbs to assembly. Anyway, we are making a calculator that takes in two two-digit values (0 to 48) and adds them together. We are having trouble with A) collecting the input and storing it . . . somewhere B) converting ASCII to binary. Any help would be appreciated. Thanks.
|
# ? Apr 2, 2009 06:12 |
|
TheSneak posted:My friend and I are completely lost on an assembly language program. Its fairly simple, but we are newbs to assembly. Anyway, we are making a calculator that takes in two two-digit values (0 to 48) and adds them together. We are having trouble with A) collecting the input and storing it . . . somewhere B) converting ASCII to binary. Any help would be appreciated. Thanks.
|
# ? Apr 2, 2009 10:35 |
|
I'm writing a program that needs to solve a variant on the Traveling Salesman Problem - but instead of the constraint being that every node must be visited exactly once, I only need to make sure that each node is visited at least once. Is this also NP-complete? Is there anything in the literature that could help me out? All I've found through Google are sites dealing with the standard TSP. edit: This is for a graph of about 470 nodes if it makes a difference, I know for TSP anything above 40 gets pretty crazy Lamont Cranston fucked around with this message at 17:53 on Apr 3, 2009 |
# ? Apr 3, 2009 17:51 |
|
Sadly, no, it doesn't make it easier. Have you looked into the approximation algorithms? Kruskal's gives you a factor-of-two approximation which can generally be optimized into something quite reasonable.
|
# ? Apr 3, 2009 19:33 |
|
Changing it to "at least once" has no effect on the problem. Any graph can be transformed into one where the triangle inequality holds (i.e. ∀x∀y∀z: d_{xy}+d_{yz} > d_{xz}), and once that is done the optimal path will obviously not include visiting any nodes twice, as A->B->A->C could be replaced with A->B->C without increasing the length.
|
# ? Apr 3, 2009 19:38 |
|
Plorkyeran posted:Changing it to "at least once" has no effect on the problem. Any graph can be transformed into one where the triangle inequality holds (i.e. ∀x∀y∀z: d_{xy}+d_{yz} > d_{xz}), and once that is done the optimal path will obviously not include visiting any nodes twice, as A->B->A->C could be replaced with A->B->C without increasing the length. I'm not sure I follow - my graph theory's not the best though. Here's a broad simplification of my graph: Click here for the full 1052x984 image. How could I traverse this, hitting each node, if I don't do any backtracking? Maybe TSP is less similar than I thought?
|
# ? Apr 3, 2009 20:48 |
|
TSP is usually formalized over complete graphs. Usually, we can use infinite-weight edges to make an arbitrary graph complete; the original graph has a Hamiltonian cycle iff the completed graph has a cycle with finite weight. It's still NP-complete.
|
# ? Apr 3, 2009 21:46 |
|
Lamont Cranston posted:How could I traverse this, hitting each node, if I don't do any backtracking? Maybe TSP is less similar than I thought? EDIT: I came back to check on this thread and couldn't resist fixing my typo. gold brick fucked around with this message at 22:59 on Apr 3, 2009 |
# ? Apr 3, 2009 22:16 |
|
|
# ? May 29, 2024 19:40 |
|
Going back to backtracking, the algorithm makes sense. What doesn't make sense is a way of storing the paths, and making it reversible. Below is my latest pseudo-implementation in Delphi. The whole thing is horribly messy and confusing. I'm half tempted to post in the "small app" thread tbh. I must be missing something obvious here, as it shouldn't be this complicated. code:
|
# ? Apr 4, 2009 19:33 |