|
Runaway Five posted:I have a question and a half. quote:Also, is there such a thing as a hash map?
|
# ? Nov 6, 2008 19:14 |
|
|
# ? May 15, 2024 03:51 |
|
Runaway Five posted:Is there a STL form of a hash table, one that would work in O(k) time and preferably have a subscript operator? Thanks in advance. http://www.boost.org/doc/libs/1_37_0/doc/html/unordered.html
|
# ? Nov 6, 2008 19:41 |
|
So I have a macro in SPSS 14 I used written by someone who has since left the project. The macro exports tables from SPSS to excel and then groups them. I recently upgraded to Office 2007 and now the macro doesn't work. Debugging it tracks the error here the arrow is below. When that happens I get the following error: "10091ActiveX Automation: no such property or method." Any thoughts? it pastes the table into Excel but when it needs to covert from an object it seems to die. code:
|
# ? Nov 6, 2008 22:24 |
|
(Language: C) I'm trying to read from either a file, or stdin, one character at a time. code:
Thanks. Nahrix fucked around with this message at 07:02 on Nov 7, 2008 |
# ? Nov 7, 2008 06:49 |
|
Just type Ctrl+D for EOF. (Probably doesn't work on Windows, but 1) I don't want to doublecheck, 2) gently caress Windows anyway)
|
# ? Nov 7, 2008 06:58 |
|
Oh, sorry. To clarify, I just want to user to type something in and hit enter.
|
# ? Nov 7, 2008 07:00 |
|
Avenging Dentist posted:Just type Ctrl+D for EOF. IIRC, it's Ctrl+Z on Windows, although who the gently caress knows what that does to stdin in a Windows terminal. Nahrix, there are two problems you'll have when using a terminal. The first is that terminal input is line-buffered by default, so you won't get your 'character at a time' until the user hits enter. The second is that, yes, EOF is a little weird on a stream attached to a terminal. That said, I don't really see the difficulty; just invent an 'end' command, check for it in the loop, and break if you see it? rjmccall fucked around with this message at 07:21 on Nov 7, 2008 |
# ? Nov 7, 2008 07:17 |
|
Nahrix posted:Oh, sorry. To clarify, I just want to user to type something in and hit enter. Replace EOF with '\n'?
|
# ? Nov 7, 2008 07:19 |
|
If you want character at a time, you can use getch and kbhit. My idiot programming teacher has a hardon for them.
|
# ? Nov 8, 2008 01:32 |
|
ante posted:If you want character at a time, you can use getch and kbhit. My idiot programming teacher has a hardon for them. Pft, nonstandard functions are cheating.
|
# ? Nov 8, 2008 01:47 |
|
Here's a wacky question. I need an algorithm for anonymous distributed reputation. Distributed reputation is tough, but I can't come up with any possible way to make it anonymous. I'm guessing it's just not possible, but I'm wondering if there's any research along those lines Any suggestions?
|
# ? Nov 8, 2008 09:21 |
|
Vanadium posted:Pft, nonstandard functions are cheating. He also tells us to ALWAYS use nodep.h What is nodep.h, you say? It contains all of two lines, both #defines that suppress deprecation warnings. He gives us an installer to run on all of the machines we code on to place nodep.h in the proper folder. Because your program should be completely free of deprecation warnings, no matter how important they are.
|
# ? Nov 8, 2008 10:59 |
|
ZorbaTHut posted:Here's a wacky question. Collaborative signing algorithms can be applied to this in theory, I guess. The concept of anonymous reputation seems very nearly contradictory, though; what's your actual problem domain?
|
# ? Nov 8, 2008 11:21 |
|
ZorbaTHut posted:Here's a wacky question. I would suggest the following things in order:
Does this help any - I remember this being at a codecon: http://www.geekness.net/tools/aura/ Can't you just rely on the network layer to provide anonynimity )and what is your threat model for it anyway)?
|
# ? Nov 8, 2008 11:33 |
|
ante posted:He also tells us to ALWAYS use nodep.h In his defense, if you are using Visual C++, Microsoft foolishly "deprecated" ISO C++ functions in favor of Microsoft "safe" versions.
|
# ? Nov 8, 2008 21:28 |
|
Nahrix posted:(Language: C) Is there a reason why this sort of thing wouldn't work: code:
|
# ? Nov 9, 2008 03:33 |
|
I sorta feel silly posting an Excel question here, but I'm stuck on this one. My problem:
|
# ? Nov 9, 2008 05:04 |
|
ShoulderDaemon posted:Collaborative signing algorithms can be applied to this in theory, I guess. The concept of anonymous reputation seems very nearly contradictory, though; what's your actual problem domain? tef posted:Can't you just rely on the network layer to provide anonynimity )and what is your threat model for it anyway)? World of Warcraft. Yeah, I'm a geek. I want a system where people can rate other players up or down based on their skill. A good distributed reputation system can take care of most malicious behavior, but the fundamental problem is that the points of data - as near as I can tell - must be public out of necessity. Which means if I rate Jimbo as "awful", Jimbo can find out about this. I'm trying to come up with any possible way I can make it "safer" to rate people down, such that the algorithm still works but people don't have to end up in dramabomb situations. I'm failing, and I'm not sure it's possible, but I'd feel more comfortable if I could somehow prove it was not possible. Right now it's mostly annoying me.
|
# ? Nov 9, 2008 20:12 |
|
ZorbaTHut posted:World of Warcraft. Yeah, I'm a geek. quote:I want a system where people can rate other players up or down based on their skill. How will you deal with cycles ? quote:I'm failing, and I'm not sure it's possible, but I'd feel more comfortable if I could somehow prove it was not possible. If it's distributed, then it's public. There might be some really really smart ways around this, but you're just raising the bar for attacks. quote:Right now it's mostly annoying me. Technical solutions to social problems often work out this way.
|
# ? Nov 9, 2008 20:38 |
|
tef posted:How will you deal with cycles ? It's pretty easy to come up with some moderately clever graph-theory methods to deduce someone's reputation based off your own. You build a little bit of falloff into the model and it'll converge on some value. Not a problem. tef posted:If it's distributed, then it's public. There might be some really really smart ways around this, but you're just raising the bar for attacks. I'm not convinced about this. There exist quite a few fascinating secure distributed protocols for complicated things (for example, choosing random values is a classic example). I agree that, in the most obvious form of the algorithm, when everyone needs to know exactly what everyone has rated everyone else, it's impossible to hide data. That said, I don't know if it's possible to accomplish the same thing while still preserving anonymity in any sense, or what the whole shebang would look like. That's what I'm curious about.
|
# ? Nov 9, 2008 21:21 |
|
ZorbaTHut posted:I agree that, in the most obvious form of the algorithm, when everyone needs to know exactly what everyone has rated everyone else, it's impossible to hide data. That said, I don't know if it's possible to accomplish the same thing while still preserving anonymity in any sense, or what the whole shebang would look like. That's what I'm curious about. Edit: removed some bad implementations that you really shouldn't use There's a blind signature scheme that kind of works for this situation, but it requires slightly esoteric encryption. Assume Alice is trying to rate Bob.
If you can depend on a central ratings clearinghouse there are simpler solutions. Clearinghouses can trivially mask rater data by simply executing the reputation algorithm themselves and only returning concrete results. ShoulderDaemon fucked around with this message at 22:11 on Nov 9, 2008 |
# ? Nov 9, 2008 22:09 |
|
ShoulderDaemon posted:There's a blind signature scheme that kind of works for this situation, but it requires slightly esoteric encryption. Assume Alice is trying to rate Bob.[list] Well that's pretty dang clever. I suppose the only objection I have is that the obvious thing for Bob to say is "okay, I've signed it, now you have to reveal what it is" and, of course, 99% of people will reveal it instantly unless it's bad. Kind of an instant giveaway. Also, if a group goes badly, everyone would probably just reject rating requests from everyone else ("ha ha can't rate me down now, sucka!") That said, while I'm not sure it works for this place, it's pretty drat neat and is definitely bordering on the problem space I'm looking at. I need to go pick up a copy of that book. ShoulderDaemon posted:If you can depend on a central ratings clearinghouse there are simpler solutions. Clearinghouses can trivially mask rater data by simply executing the reputation algorithm themselves and only returning concrete results. Agreed, this would make everything massively simpler - unfortunately it's just plain not possible
|
# ? Nov 9, 2008 22:59 |
|
ZorbaTHut posted:Well that's pretty dang clever. I suppose the only objection I have is that the obvious thing for Bob to say is "okay, I've signed it, now you have to reveal what it is" and, of course, 99% of people will reveal it instantly unless it's bad. Kind of an instant giveaway. If we admit some DRM, I think this is doable: All messages to be tagged by some globally unique number, ideally a large random nonce. When Alice and Bob first meet, Alice has Bob blind-sign two messages: a good rating, and a bad rating. As many times as he wants, Bob has Alice reveal both messages then discard them and repeat the exchange: this is to convince Bob that Alice is not cheating by generating two bad ratings or two good ratings or messages with non-unique identifiers. The final pair is not revealed to Bob. At any later time, Alice may simultaneously publish one message and discard the other. It's important that the software handling this makes a strong effort to prevent saving a message after its pair has been published, as Alice needs this for plausible deniability: If Bob tries to find out who published a bad rating, he can ask people who have published ratings about him, but they can just point to any published good rating and claim that was their own. Bob could get around this by demanding they show him an unpublished bad rating (which would prove that if they published at all, it was a good rating); this is why Alice should not be able to save the unpublished member of a pair.
|
# ? Nov 9, 2008 23:20 |
|
ShoulderDaemon posted:If we admit some DRM, I think this is doable: That's kind of clever also, and actually not entirely infeasible. It doesn't really rely on DRM, it just relies on plausible deniability, and if the default implementation does exactly that, then you can't really expect people to have the alternate message lying around. In this case, there's still unfortunately two major issues: * First, while we have a working "rating" system, we don't have any kind of a "web of trust" system. It's pretty easily breakable by just generating a billion "this guy is awesome" messages - since there's no way to tell whether the person who wrote a message is a guy you trust or not, there isn't really a way to tell whether a message should be trusted or not. * Second, it relies on the ratee using the software also, which I can't guarantee. I'd like this to work on people who aren't using the software - obviously they won't be able to give out ratings, but they should be ratable, otherwise the entire thing kind of collapses. I think this solves a totally fascinating problem that I didn't even think was solvable, though This is definitely going to take more thought, you're bringing up some very neat constructions that I never considered before.
|
# ? Nov 10, 2008 00:02 |
|
ZorbaTHut posted:First, while we have a working "rating" system, we don't have any kind of a "web of trust" system. It's pretty easily breakable by just generating a billion "this guy is awesome" messages - since there's no way to tell whether the person who wrote a message is a guy you trust or not, there isn't really a way to tell whether a message should be trusted or not. Orthogonal problem. Trusting someone's ability to rank people accurately is completely different from trusting their in-game behaviour. Manage trust with a public-key-and-signed-affidavit system, like PGP. You'd want to allow ratings to be either signed or unsigned, and have a (probably configurable) default weight for unsigned- or signed-by-unreachable- ratings. If you want signatures and anonymous ratings, then you can have the software examine trust networks, identify medium-to-large-sized groups of people it is part of that have positive minimal intertrust, and negotiate to create a new pseudo-identity that everyone in the group holds the private key for, and everyone trusts with the same minimal intertrust they have with the rest of the group. Then anyone in that group can sign ratings with the pseudo-identity's key instead of their own, and plausibly claim someone else in the group published that rating, but the trust web still finds the signer and assigns it an appropriate trust weight (no worse than the path to the least-trusted person in the group). You can probably score pseudo-identities based on the minimal intertrust they represent multiplied by the number of users known to hold the key; that gives you a function that approaches some "useful anonymity" metric which the software can use to decide what identities to use when signing rankings. There's an externality where you want to make sure that the group includes other people likely to issue rankings for the rankee; you probably need to defer to the user somehow for that. ZorbaTHut posted:Second, it relies on the ratee using the software also, which I can't guarantee. I'd like this to work on people who aren't using the software - obviously they won't be able to give out ratings, but they should be ratable, otherwise the entire thing kind of collapses. You might be able to get away with just the pseudo-identity solution I posted above, and having ratings signed by the ranker (or ranker's pseudo-identity) rather than by the rankee. This opens up to allowing ranking-spam against a person, however. A better solution is to allow rankings to be optionally signed by the rankee using the old protocol, in addition to optionally signed by the ranker (or a pseudo-identity). If the rankee is a user of the software (that is, if they have a published public key), then vastly reduce the weight (possibly to zero? you need some protection against people who publish a key then never agree to ranking exchanges, though. Better might be to make reputation from [-1, 1] but unsigned ranks can only shift it in the range [-0.5, 0.5] or so) on rankings not signed by them. So, you can rank people who don't use the software, but if they want protection against ranking-spam, they have incentive to use the software and publish a key. That not only lets them rank other people and view their own rank, it also protects them from spam and makes other users more confident that their ranking is genuine. There are still a few issues. A person can create a pseudo-identity with a group of other people, then use that identity to sign positive rankings for himself. You probably want to forbid "self-signatures" of this form, so just enforce that pseudo-identities can't sign rankings on their members. That's a really hard problem, because it assumes that the machines of everyone who has a key for a given pseudo-identity are secure (otherwise someone could hack in to one, steal a key, and use that pseudo-identity to sign rankings on themselves). This is a very hard problem, and you need to get into serious revocation systems for trust webs and a complicated nested-identity publishing scheme. And there's pretty much nothing stopping someone from generating positive rankings for themself that are unsigned by a ranker or signed by a ranker that's not part of the trust web; all you can do is depend on the trust web to weight those poorly and limit their impact. Edit: Oh yeah, there's a flaw in the protocol I had above for paired-rank-exchange. Alice sends Bob two down-ranks, Bob signs, sends them back, then demands a disclosure and protocol restart (to check if Alice is cheating), Alice simply disconnects and later publishes both down-ranks. Bob lacks an effective revocation system, and if we gave him one he could use it against published down-ranks and artifically boost his reputation. You have to depend on trusting the software here, or move to a doubly-blinded protocol. A simple augmentation may be that Bob uses a separate, unpublished key to sign all the responses that he intends to immediately demand disclosure on, so Alice can't usefully publish them; this is probably the best way to solve the problem, but it does add some overhead in terms of additional keys. Note that Bob has to sign them somehow, otherwise he has no real evidence that Alice isn't sending two down-ranks, then when asked to disclose, responding with a down-rank and an up-rank. ShoulderDaemon fucked around with this message at 00:50 on Nov 10, 2008 |
# ? Nov 10, 2008 00:38 |
|
ShoulderDaemon posted:Edit: removed some bad implementations that you really shouldn't use What kind of encryption do you use where Adecrypt(Bsign(X)) == Bsign(Adecrypt(X)) ?
|
# ? Nov 10, 2008 03:36 |
|
oldkike posted:What kind of encryption do you use where Adecrypt(Bsign(X)) == Bsign(Adecrypt(X)) ? There's a few methods, but the simplest is RSA and blinding multiplication. Basically, Bob has an RSA key Bpri, Bpub, and n. Alice picks a random integer in [1, n] called Amul. Alice wants to get the message txt signed.
|
# ? Nov 10, 2008 03:48 |
|
ShoulderDaemon posted:There's a few methods, but the simplest is RSA and blinding multiplication. Ah, that's really cool. So its really kind of a one time pad encryption before signing.. I googled and this wikipedia article has a very concise summary: http://en.wikipedia.org/wiki/Blind_signature
|
# ? Nov 10, 2008 04:12 |
|
My girlfriend has been making fun little comic strips from funny situations we've been in, talked about, or just kinda made up. Recently we decided to start putting them online as a webcomic. I've been searching for a nice template or layout for something like that but I can't find one that really fits a webcomic. I would make one myself but I have very limited skills in CSS. So my question is, is there a website that teaches CSS without going incredibly in depth? I already know HTML on the web end and C++ on the programming end(completely unrelated, I know.) Secondly, does anyone know of a few good templates for something like this?
|
# ? Nov 10, 2008 10:13 |
|
Krimlander posted:Secondly, does anyone know of a few good templates for something like this? You should ask in the webcomics thread in BSS.
|
# ? Nov 10, 2008 10:56 |
|
Vanadium posted:You should ask in the webcomics thread in BSS. Never even saw that or thought to look there. Thank you!
|
# ? Nov 10, 2008 19:40 |
|
I am trying to go through some training for C# CD's and having problems with this example. Apparently it works fine on their end, but I get an error "the type or namespace 'Lion'does not exist in the namespace 'CD3'. I didn't see any universal C# thread, so I came here. Help? code:
|
# ? Nov 11, 2008 20:02 |
|
Works for me too. There is a general .NET thread. You are not splitting this up into multiple files, are you?
|
# ? Nov 11, 2008 20:14 |
|
Vanadium posted:Works for me too. There is a general .NET thread. Actually, it was split into a couple different files, I haven't tried it as posted. What would the difference be? <e> They had it in multiple files, and I split it up like that and ended up copying almost their entire layout to try and figure it out. When I put it all in one file it works fine. I made sure the namespace was exactly the same on all pages. Although it works on one page, I probably need to understand why it didn't work over multiple pages as I learn more and end up referencing things from different code files. Where did I go wrong? hallik fucked around with this message at 20:39 on Nov 11, 2008 |
# ? Nov 11, 2008 20:26 |
|
Welp, I just figured it might have to do with the package visibility thing, but I am not sure how that works because I am not in fact a .NET developer, so I just pasted everything together and then it worked. Edit: I am using mono
|
# ? Nov 11, 2008 20:35 |
|
Vanadium posted:Welp, I just figured it might have to do with the package visibility thing, but I am not sure how that works because I am not in fact a .NET developer, so I just pasted everything together and then it worked. OK Thanks. Maybe I will try the .NET thread to have the difference explain
|
# ? Nov 11, 2008 20:40 |
|
I'm trying to use the CFileDialog::GetFolderPath() function in C++ to return a string value containing a folder path (eg "C:/Documents") instead of a single file (eg "C:/Documents/results.csv"). code:
Help?
|
# ? Nov 12, 2008 02:54 |
|
Savings Clown posted:I'm trying to use the CFileDialog::GetFolderPath() function in C++ to return a string value containing a folder path (eg "C:/Documents") instead of a single file (eg "C:/Documents/results.csv"). What assert? I don't see any assert there, or any m_hWnd. Did you forget to paste half your sample code, or did you ask the wrong question?
|
# ? Nov 12, 2008 04:02 |
|
Sorry, yeah, it's in the MFC library for CFileDialogcode:
Savings Clown fucked around with this message at 09:12 on Nov 12, 2008 |
# ? Nov 12, 2008 04:40 |
|
|
# ? May 15, 2024 03:51 |
|
Is there an easy to use C or C++ API that allows me to capture data from a webcam? Being cross-platform would be nice but I can deal with just windows. I'd just rather not delve into directshow/whatever the hell it's called these days if I can avoid it.
|
# ? Nov 13, 2008 00:35 |