|
Say I have 2 columns of data in excel such as:code:
code:
|
# ? Oct 13, 2010 14:24 |
|
|
# ? Jun 5, 2024 02:39 |
|
Jewbert: if I understand what you're asking, that sounds like exactly what pivot tables are for. Does it have to be a macro?
|
# ? Oct 13, 2010 14:51 |
|
Why so it is. I love these general question threads. They always make me feel so stupid. Thanks Internet Janitor.
|
# ? Oct 13, 2010 14:58 |
|
I've been working with some Qt GUI stuff in C++, and honestly every time I try to use signals/slots, I just get kind of baffled. It is completely alien to me. I always end up just programming it like I would a standard .net application, with an event call. Luckily Qt supports this well and I've gotten away with it, but I need to get better at Signals/slots sometime. I have a couple of books but they haven't really made me any smarter on the whole thing. Any suggestions for a good tutorial to learn signals/slots better? Literally the only thing I've done with them is make some display dials/spinboxes match in a couple of places where it was convenient.
|
# ? Oct 14, 2010 03:59 |
|
greatn posted:I always end up just programming it like I would a standard .net application, with an event call. Luckily Qt supports this well and I've gotten away with it, but I need to get better at Signals/slots sometime. quote:Any suggestions for a good tutorial to learn signals/slots better?
|
# ? Oct 14, 2010 15:06 |
|
http://libsigc.sourceforge.net/
|
# ? Oct 14, 2010 15:59 |
|
http://www.boost.org/doc/libs/1_44_0/doc/html/signals2.html
|
# ? Oct 14, 2010 16:25 |
|
A little javascript help please? I'm trying to produce a multiplication table that looks like this but using nested loops instead of handcoding each line. If you could either point out a syntax error or nesting location error that would be very helpful. Handcoded table: code:
I have commmented where I think the "if" statement should go for the first row and first column but I'm not sure how to proceed. Every statement I've tried so far either resulted in either just one cell being populated or the script looping back and crashing. code:
|
# ? Oct 14, 2010 17:57 |
|
code:
code:
First Time Caller fucked around with this message at 22:01 on Oct 14, 2010 |
# ? Oct 14, 2010 21:49 |
|
This is killing me, and I don't know exactly how to explain it, much less fix it. However, I think it's my problem. I recently had my work laptop reimaged so I'm installing SQL Server Express again. It installed with a named instance (SQLEXPRESS), so when I open SQL Studio I have to connect to MACHINE NAME\SQLEXPRESS. What I need to be able to do is have SQLEXPRESS be what I would name the "default" instance on my machine, so that I can connect to simply my MACHINE NAME and have it resolve. Does that make sense? I understand that I can also connect to myself via 127.0.0.1, localhost, and ., but I need to do it by machine name for these purposes. Any ideas? EDIT: I've enabled Named Pipes on the SQLEXPRESS instance, and restarted the services, but that doesn't seem to have done anything. ZentraediElite fucked around with this message at 22:19 on Oct 14, 2010 |
# ? Oct 14, 2010 22:15 |
|
First Time Caller posted:helpful advice That set me on the right path. Thanks very much.
|
# ? Oct 16, 2010 03:35 |
|
Generally how do people handle doing time-consuming tasks in a GUI callback function? I have some code that has to shuffle some stuff around, which takes just enough time to be annoying, but not enough time to perhaps put a cancel action on it. So I thought in the callback I'd put the requisite code in a thread and detach it. I am figuring this is the simple solution but I wondered if there were some more advanced concepts I should be thinking about right now before I, say, do this all over the place. In this case I'm using C++ with Boost and FLTK.
|
# ? Oct 16, 2010 17:56 |
|
I have a Windows app that I'm writing in python and will be packaging up with py2exe or something similar. It requires a DLL to be registered on Windows. I'm not familiar with distribution of Windows apps. What's the best way to handle this for end users instead of making them open a command prompt with admin privileges and typing "regsvr32.exe blah.dll"? I can of course register it programatically from python, but that still doesn't solve the needing admin privs...
|
# ? Oct 16, 2010 18:58 |
|
Thermopyle posted:I have a Windows app that I'm writing in python and will be packaging up with py2exe or something similar. It requires a DLL to be registered on Windows. I'm not familiar with distribution of Windows apps. You'll need to write an installer. It's pretty easy to get started with NSIS, and it's free, so you should definitely check it out.
|
# ? Oct 16, 2010 19:12 |
|
Rocko Bonaparte posted:Generally how do people handle doing time-consuming tasks in a GUI callback function? I have some code that has to shuffle some stuff around, which takes just enough time to be annoying, but not enough time to perhaps put a cancel action on it. So I thought in the callback I'd put the requisite code in a thread and detach it. I am figuring this is the simple solution but I wondered if there were some more advanced concepts I should be thinking about right now before I, say, do this all over the place. In this case I'm using C++ with Boost and FLTK. Pretty sure this is the right way to do it.
|
# ? Oct 16, 2010 21:04 |
|
Bozart posted:Pretty sure this is the right way to do it. Yep. Even if you were gonna pop up a dialog box with a cancel option, you'd still want to fork off a thread so your user can interact with the rest of the application (unless it makes no sense to do so while you're doing the action, like playing music from an MP3 player while you're copying music to it or something).
|
# ? Oct 17, 2010 00:32 |
|
Not quite a programming question, but an IDE question. I'm using eclipse and remote-systems-explorer plugin to do SCP stuff. The problem is, almost at random it choses various files and silently saves them to cache instead of remote end, and then starts loading it from cache. Meaning the remote end never gets updated. I've been searching google high and low and cant find any documentation to tell me how to induce it to cut this poo poo out, and eclipse IRC on freenode isn't being useful at all. Any eclipse boffins got ideas on the cause of this?
|
# ? Oct 18, 2010 08:56 |
|
Moscow SML. I have to write a function that returns the average age of the people in an ancestry tree who have a registered birth and death. The returned value has to be int option. The data types are code:
agesum counts the age of the people with a registered birth and death and sums them. avage finally divides the summed ages with the number of dead people to find the average age. code:
code:
|
# ? Oct 18, 2010 17:34 |
|
ufarn posted:dead counts the number of dead people with a registered birth and death. Why not have a single function that returns a maybe (int, int)? ufarn posted:
This error message is pretty clear. The context wants an int — because you're adding something to an int — but you're providing an object with function type. You don't think you are, but you are. That's because the grammar rules for fun declarations are a little wierd, so instead of parsing as a single parameter matching the pattern AncTree(Person(_,_, Year b, Year d), mt, ft)), this parses as two curried parameters matching the patterns AncTree and (Person(_,_, Year b, Year d), mt, ft)). You have to parenthesize constructor patterns at the top level, I'm afraid.
|
# ? Oct 18, 2010 18:39 |
|
rjmccall posted:Why not have a single function that returns a maybe (int, int)? rjmccall posted:This error message is pretty clear. The context wants an int — because you're adding something to an int — but you're providing an object with function type. You don't think you are, but you are. That's because the grammar rules for fun declarations are a little wierd, so instead of parsing as a single parameter matching the pattern AncTree(Person(_,_, Year b, Year d), mt, ft)), this parses as two curried parameters matching the patterns AncTree and (Person(_,_, Year b, Year d), mt, ft)). You have to parenthesize constructor patterns at the top level, I'm afraid. What exactly does parenthesizing the constructor patterns at top level entail? Do you mean writing (AncTree (Person (_, _, Year b, Year d), mt, ft))? It's an assignment I've been mulling over for ages, and it's driving me crazy.
|
# ? Oct 18, 2010 18:52 |
|
ufarn posted:Don't think I didn't try, but I just couldn't figure it out. Okay. It might make the rest of your class easier if you can. ufarn posted:I had a feeling about that, but I didn't recall hearing of it being possible in SML. Currying? Definitely possible in SML. ufarn posted:What exactly does parenthesizing the constructor patterns at top level entail? Do you mean writing (AncTree (Person (_, _, Year b, Year d), mt, ft))? Yep. The idea is that the pattern grammar looks kindof like this: code:
code:
Also, when the compiler sees an identifier pattern, it has to figure out whether you're trying to match a specific no-argument constructor or whether you're just binding a variable. To do that, it has to look up the name to see if it's the name of a known constructor. This lookup — like everything else in the language — is case-sensitive. So if your type declaration has it as Anctree, it needs to be exactly that; your code has it inconsistent, and I suspect that you'd have gotten a better error message except that you also had the capitalization wrong. rjmccall fucked around with this message at 19:27 on Oct 18, 2010 |
# ? Oct 18, 2010 19:21 |
|
rjmccall posted:Cool tips. code:
code:
|
# ? Oct 18, 2010 21:05 |
|
That message is saying that, syntactically, the different cases of your fun are taking different numbers of arguments. Here that's because the following is parsed (for the same reasons as above) as two different arguments:ufarn posted:| doede AneTrae _ = SOME 0; This should almost certainly be "| doede _ = SOME 0". Except I don't think that's the right logic, because I think you should be recursing on the ancestor's parents regardless of whether you have year data for that ancestor. (I assume that your functions, types, and constructors are inconsistently named because you are actually writing this in Danish and translating them into English for the forum).
|
# ? Oct 18, 2010 22:02 |
|
rjmccall posted:That message is saying that, syntactically, the different cases of your fun are taking different numbers of arguments. Here that's because the following is parsed (for the same reasons as above) as two different arguments: code:
It's also made me realize that my final function is going to return an int value, and not an int option value, meaning that I'll have to revise the code. Again. Sigh. I think I'll let the auxiliary functions return int and convert it to int option in the final function. Although that sounds messy as hell and besides the point, but I'm all about just making something that runs where I am right now. ufarn fucked around with this message at 00:59 on Oct 19, 2010 |
# ? Oct 19, 2010 00:53 |
|
I don't know why you think that's a problem. Logically, there's a very good reason your final function has to return an option type: it's possible to have no matching people in an ancestor tree, so you have to have some way to indicate that, because you can't take an average of zero numbers. That's not true of your helper functions! There's no place where it makes anything simpler to return NONE instead of SOME 0, which is a pretty compelling argument that you don't really want an option type.
|
# ? Oct 19, 2010 01:39 |
|
I'm trying to write a plugin for Joomla that will pull a city from a Geolocation database and based on where they are, show a different version of a website. Our company owns skating rinks in 2 cities, and corporate wants each rink to have its own information on the site and calendars, as opposed to mixed together. The problem is, I'm not even sure where to begin with this, or where I could find a good free Geolocation database that isn't based on country, but IP, Zip Code, or cities. This plugin would more than likely be written in php. Basically in a nutshell.. Site 1 has an event on the 19th - Family Night Site 2 has an event on the 19th - Free Skate and corporate wants it to only show the location nearest you via information on the website and calendar instead of both of those events. Any suggestions? Is this even possible?
|
# ? Oct 21, 2010 12:48 |
|
I revised my Moscow ML code from before to this:code:
I briefly checked the values, and I think these are the valid ages: 1: 59 2: 60 3: 71 4: 71 5: 27 ----- 5: 288 288 div 5 = 57 I recall getting a value somewhat close to 288, if not that, but I must have messed up something in the code. dead seems to work, but agesum is obviously totally bonkers. I don't really have a clue what is up - dead might be botched as well. Everything compiles just fine.
|
# ? Oct 21, 2010 14:21 |
|
I've got a drive with about 100k+ of files with all of these spread across some 600+ folders amounting to a total of 300Gbs+. All the folders are named appropriately, 1,2,3,56,57,102,etc. [code] Parent Folder -1(Folder) -2 -3(expanded folder) +fileblah.001 +fileblah.002 +fileblah.003 What I need to do is put these files into a zip, of course I really don't want a 300gb zip, so I'm thinking I could do a bunch of 5GB+ zips. My question is, is XCOPY capable of at least moving these all into one folder? Or am I going to have to program something to do this, and if so how would I figure this out in Java? I know a bit, but if someone could point me in the right direction, that'd help and I could probably take it from there.
|
# ? Oct 21, 2010 16:03 |
|
Tab8715 posted:My question is, is XCOPY capable of at least moving these all into one folder? Or am I going to have to program something to do this, and if so how would I figure this out in Java? I know a bit, but if someone could point me in the right direction, that'd help and I could probably take it from there. If you're running a relatively recent OS I suggest checking out the Powershell thread since it sounds like something that could do pretty easily. The original poster is pretty active and has actually provided run-ready scripts and so on for other people who post their problems there.
|
# ? Oct 21, 2010 18:50 |
|
code:
|
# ? Oct 22, 2010 20:26 |
|
That's just the infix cons notation:code:
|
# ? Oct 22, 2010 21:20 |
|
To elaborate a bit, cons just creates "dotted pairs". The cdr of a pair can be another pair, which can have a cdr that's a pair, and so on. If the cdr of the last pair is '(), then it's a list. Otherwise it's just a series of dotted pairs. http://en.wikipedia.org/wiki/Cons#Lists might explain it better.
|
# ? Oct 23, 2010 01:28 |
|
Anyone here a pro with ANTLR? I'm developing a toy language to play around with, and I have a situation in my grammar where I want to reuse a set of rules in two different contexts, but where something recognized deeper down in the parse tree relies on the context way further up. To try to elaborate: I have the usual set of expression rules for a typical programming language, for operator precedence and such. For simplicity, let's pretend I have expressions that look like this: code:
code:
Does ANTLR have a simple way of expressing this, without having two separate copies of the rules that are exactly the same except for the definition of "literal" at the end? I've tried digging around in the docs but haven't really found anything that seems to work.
|
# ? Oct 23, 2010 19:14 |
|
We're programming a Zork-like game for my data structures class. I have a menu using a do-while loop and a switch statement. One of the menu options then requires the user to input a string of text that may contain spaces. getline(cin, theString) is failing me. If I put it at the beginning of my code, outside of the loops and switch statement, like so string theString; getline(cin, theString); cout << theString << endl; It works perfectly fine. But when I choose the menu option, and it goes to that case statement which contains the getline, it is like the getline statement gets completely stepped over. The program doesn't stop and wait for the user to input anything, it just keeps right on going and reprints the menu and awaits for a new menu input. Anyone know why getline won't work in a switch statement within a do-while loop, and if so any easy fixes?
|
# ? Oct 24, 2010 00:30 |
|
Aluminum Record posted:We're programming a Zork-like game for my data structures class. I have a menu using a do-while loop and a switch statement. One of the menu options then requires the user to input a string of text that may contain spaces. getline(cin, theString) is failing me. If I put it at the beginning of my code, outside of the loops and switch statement, like so Second, problems like this are often caused by mixing ">>" and getline -- ">>" doesn't eat \n, so the return that the user enters when they're finished with the "\n" is still sitting there on the input buffer, and then the getline sees that keypress and figures that thats the end of the line that it is looking for. This can be solved a number of ways -- I think the easiest way is to call getline once to "prime" it for the "real" call.
|
# ? Oct 24, 2010 01:24 |
|
Flobbster posted:The catch is, I want the "literal" rule in the grammar (see the "factor" rule) to be syntactically different depending on whether I'm parsing it coming from "statement1" or "statement2". It is almost like you are doing something context sensitive. Yes, you are going to have to duplicate the rules (I think) but you might be able to hack it with a composite grammar So you import it twice (well you can't do this but you can make a copy of it and import it) and override different rules when you do
|
# ? Oct 24, 2010 05:02 |
|
Flobbster posted:Anyone here a pro with ANTLR? To be honest, you might get as far knocking up the parser yourself recursive decent style (it is pretty much what antlr does) if you've got a non LL(*) grammar (which it sounds like you have, but you can transform it into one) So far you will have had to remove left factors and left recursion (and then add that back in post-hoc for left associative operators), and now you're going to have to translate it again to get it to work in your toolkit. Although it is pretty inevitable to mutate the rules some. Another thing to look at is PEG style parsing toolkits or combinator parsing libraries, as it should be easier to compose the grammar fragments by creating functions that return new rules. (Although if you're a little mad, I'd recommend writing a left-corner recursive descent parser (essentially, you build up the tree from the left-most token, and then predict down). so you'd parse [1 + 2] by recognizing 1 as an expression, and then predicting + expr to follow an expression. aaanyway.....)
|
# ? Oct 24, 2010 05:09 |
|
Aluminum Record posted:It works perfectly fine. Generally you post the code that does not.
|
# ? Oct 24, 2010 21:03 |
|
I figured it out. Thanks!
Waltzing Along fucked around with this message at 02:22 on Oct 26, 2010 |
# ? Oct 26, 2010 01:56 |
|
|
# ? Jun 5, 2024 02:39 |
|
Waltzing Along posted:Edit: I changed the const in the loop to the actual #s and it works perfectly. So that is what the problem was. I've messed up my const statements and have no idea what I did wrong. code:
|
# ? Oct 26, 2010 02:13 |