|
Nietzschean posted:This is something that I'm sure is really simple for you guys: http://forums.somethingawful.com/showthread.php?threadid=2415898
|
# ? May 25, 2012 21:45 |
|
|
# ? Jun 1, 2024 20:52 |
|
I don't think a tiny app request is necessary for something that can be done in autohotkey like he suggested.
|
# ? May 25, 2012 21:56 |
|
Orzo posted:I don't think a tiny app request is appropriate for something that can be done in autohotkey like he suggested. The tiny app thread has done lots of little AutoIT and AHK scripts...
|
# ? May 25, 2012 21:57 |
|
Oh. I stand corrected, then. I guess I thought it was simpler than it actually is.
|
# ? May 25, 2012 21:58 |
|
I'd like to write something to control a piece of hardware that communicates via TCP packets; The command interface guide (http://www.ti.com/lit/ug/dlpu007a/dlpu007a.pdf) seems straightforward enough, but I've never done anything like this and have no idea what language I should be using. My experience is in matlab/fortran/some C, none of which seems particularly suitable for this sort of thing (the matlab instrument control toolbox looks good, but I can't afford it ). Any suggestions?
|
# ? May 28, 2012 20:35 |
C would be okay for that task, especially since you'll be fiddling with single bytes and such anyway, for constructing the command packets. However I really question the design of that protocol. Why is it run over TCP if it requires commands to be sent in individual packets? It sounds like they wanted to use UDP but decided not to for <insert bad reason>. At least the way I read it you have to make sure the commands blocks you send are sent in one physical IP packet each, and no more than one per packet. So to use the stream protocol you have to be aware of the MTU and disable Nagle's algorithm and more lame things.
|
|
# ? May 28, 2012 20:59 |
|
Hey guys, im working on a program that will basically detect my hand in a poker game, and fold it if it doesn't meet certain criteria. Basically my program so far works like this: -Detect if its my turn preflop -Detect my Position on the table -Scan for cards I'm a bit new to programming and im not sure of the best way to go about checking to see if the cards match my criteria. I basically right now have images of all the cards, and my program scans for them.
|
# ? May 30, 2012 20:17 |
|
Phiberoptik posted:Hey guys, im working on a program that will basically detect my hand in a poker game, and fold it if it doesn't meet certain criteria. So you're already able to grab images of your cards (and if it's hold'em, the cards on the table) already? If the card images are always static (they should be), then you could just do a naive sequential compare to a map of all 52 card images to their rank/suit values. From there you'd have your card values and then your next design problem (evaluating the collection of individual cards as a "hand")
|
# ? May 30, 2012 20:31 |
|
No Safe Word posted:So you're already able to grab images of your cards (and if it's hold'em, the cards on the table) already? If the card images are always static (they should be), then you could just do a naive sequential compare to a map of all 52 card images to their rank/suit values. From there you'd have your card values and then your next design problem (evaluating the collection of individual cards as a "hand") Right now the way im doing it is I run a loop to detect for each of the two hole cards. Once I get them, I'm not too sure what to do with it to get it to evaluate as a "hand", and compare it to the hands that I want to fold.
|
# ? May 30, 2012 20:48 |
|
Phiberoptik posted:Right now the way im doing it is I run a loop to detect for each of the two hole cards. Once I get them, I'm not too sure what to do with it to get it to evaluate as a "hand", and compare it to the hands that I want to fold. Still not clear on exactly what it is that you are looping over and what you have as your inputs. As a related aside, thanks to archive.org you can read the series on codingthewheel.com about building a poker bot from scratch, complete with sample code. Specifically, this installment which has sample code for a specific online poker site, though it's probably dated by now. His approach to finding out the cards you have is to intercept the text message that tells you what your hole cards are simply via regular expressions.
|
# ? May 30, 2012 21:04 |
|
Right now Ive gotten it to the point where Itll tell me my two cards, so say "Ac" in one variable, and "Ad" in another variable. I'm wondering what the best way it is to compare to a list of hands Id like to fold.
|
# ? May 30, 2012 21:45 |
|
When you invoke vi in Unix, what program is actually being executed?
|
# ? May 30, 2012 21:49 |
|
Harold Ramis Drugs posted:When you invoke vi in Unix, what program is actually being executed? Run code:
code:
Edit: on my ubuntu server, it appears to be /usr/bin/vim.basic
|
# ? May 30, 2012 21:53 |
|
Harold Ramis Drugs posted:When you invoke vi in Unix, what program is actually being executed? It will most likely be vim on OS X and Linux, nvi on *BSD, god only knows what on any other system.
|
# ? May 30, 2012 21:54 |
|
Harold Ramis Drugs posted:When you invoke vi in Unix, what program is actually being executed? It depends. I'm going to assume you meant to ask "how do I find out what program is actually being executed". type vi (or whence vi on some systems) will tell you the location of the file that is actually being run. (If it's a shell function then type, at least in bash, will also show you the source). Then you can just check if it's a symlink or something, and follow it if so until you find the end: code:
You can also just run the program and then check /proc, which may be useful (if, say, /usr/bin/vim.tiny is actually a shell script that exec()s /usr/local/bin/emacs or similar): code:
|
# ? May 30, 2012 22:06 |
|
Phiberoptik posted:Right now Ive gotten it to the point where Itll tell me my two cards, so say "Ac" in one variable, and "Ad" in another variable. I'm wondering what the best way it is to compare to a list of hands Id like to fold. You probably want to write some helper functions that pull out information about the cards. I'm thinking in an OO way, but something like card.suit() that would return the suit and card.value() that would return the numeric value. Then you'd build rules based on that, like code:
|
# ? May 30, 2012 22:35 |
|
Sinestro posted:It will most likely be vim on OS X and Linux, nvi on *BSD, god only knows what on any other system. code:
|
# ? May 31, 2012 13:59 |
|
I'm taking an intro to programming course and the professor wants us to SSH onto the schools server and use emacs to do our work. When I SSH from my MacBook Air and try to run emacs I get this error(?).code:
|
# ? May 31, 2012 16:55 |
|
Pretty sure that means that whatever client software you're using is connecting in a mode not supported by the school's server/emacs. Try this: http://stackoverflow.com/questions/6788402/error-opening-terminal-xterm-256color (also it was the second Google result for the error message, c'mon)
|
# ? May 31, 2012 16:59 |
|
I'm way too loving stupid to code, but I'm trying to learn C# for some reason. Anyway quick question, I have this repeating wall of if/then statements to handle hover image transitions. Is there a way to call this code from another cs or something, so my main.cs doesn't look like poo poo? If I know what it's called I can google it, no need to handhold, but I am brand new to this besides some high school basic HTML classes so nothing cryptic or missing some obvious (to you) info please.
|
# ? May 31, 2012 17:00 |
|
If I'm understanding you correctly, you may want to google 'classes' in C# and read/implement a basic tutorial. Because it sounds like you've written your entire program in one file/class.
|
# ? May 31, 2012 17:07 |
|
Orzo posted:If I'm understanding you correctly, you may want to google 'classes' in C# and read/implement a basic tutorial. Because it sounds like you've written your entire program in one file/class. That's exactly what I did, because it started off simple and spiraled as I kept thinking of things I wanted to try.
|
# ? May 31, 2012 17:12 |
|
Scaramouche posted:Pretty sure that means that whatever client software you're using is connecting in a mode not supported by the school's server/emacs. Thanks dude. Didn't think to google the error message.
|
# ? May 31, 2012 17:29 |
|
KidDynamite posted:Thanks dude. Didn't think to google the error message. You have now completed your IT support training. Go forth and solve all the world's problems!
|
# ? May 31, 2012 17:38 |
|
Pudgygiant posted:That's exactly what I did, because it started off simple and spiraled as I kept thinking of things I wanted to try. Classes and functions (well, 'methods' in C#) are things you want to look at. If you're using Visual Studio it should handle making sure that things in different files are visible to each other, so you should be able to see stuff in different files (provided they have correct access modifiers), but if you're not, you'll have to find out how the C# compiler looks up source files and stuff.
|
# ? May 31, 2012 18:26 |
|
Scaramouche posted:Pretty sure that means that whatever client software you're using is connecting in a mode not supported by the school's server/emacs. Bash code:
|
# ? May 31, 2012 18:37 |
|
How do people produce animated videos? Are there tutorials or guides for that? For instance https://www.youtube.com/watch?v=6Wf8yEb1cwY
|
# ? May 31, 2012 20:00 |
|
Sil posted:How do people produce animated videos? Are there tutorials or guides for that? For instance https://www.youtube.com/watch?v=6Wf8yEb1cwY Uh, this doesn't really have anything to do with programming. You take an animation tool, and you draw some stuff, and then you animate it. Actually, just go download a trial of Flash CS6 from Adobe, and then start learning. Flash is pretty much the standard animation tool for all productions (TV, movie, web) at this point, even if it's not published to a SWF file. It excels at static vector graphics alone, and really shines when you go to animation. Suspicious Dish fucked around with this message at 20:07 on May 31, 2012 |
# ? May 31, 2012 20:03 |
|
I'm trying to locate variations on known phrases in user-entered text that could be totally irrelevant crap. Example: Known Phrases: 'Inboard Motor', 'Fiberglass Body' User Garbage: "<>bThis is the most booootiful boat you've ever seen! </b>You will want to have carnal relations the fishing pole mounts! Inboard motor" From Googling and reading Wikipedia, I found the Smith-Waterman algorithm, which seems to do what I want even if I skip the alignment step and take the computed score as a percentage of the possible maximum score if the full text of the known feature was found (code). Problem is, I'm worried that I missed something that might fit better because every mention of S-W is in the context of protein or genetic analysis. Maybe I'm just in need of a decent substitution matrix for QWERTY keyboard errors (that I tried to find but couldn't), but maybe I ran in the wrong direction. Anyone have any tips?
|
# ? May 31, 2012 21:10 |
|
I've got no idea about Smith-Waterman but one thing you might want to consider as well is idiosyncratic pluralization (e.g. pants, gauntlets, tooth/teeth, etc.) which I've used the Porter Stemming algorithm in the past: http://tartarus.org/martin/PorterStemmer/ Depending on the size of your dataset/what you're trying to accomplish you also might want to look into a search platform. We've used SOLR/Lucene to great effect in the past for site search/keyword analysis (though there's some runup if you're not familiar with it): http://lucene.apache.org/solr/
|
# ? May 31, 2012 22:24 |
|
In the current version of my web app, users can select a set of pronouns they would like to be referred to by. They can elect to be referred to by "he", "she", or "it". I'm considering whether to maintain this in a future iteration of the app. I was considering adding the option of being referred to by "they". But I also allow translation into other languages, and other languages might have totally different sets of pronouns and so it might be impossible to translate the connotations behind one or more sets of pronouns, resulting in inferior translation. I'm not sure whether to just drop the option to select a set of pronouns entirely, and have everybody just referred to as "they" where necessary. I guess this is what most people would do? Obviously this is an aesthetic consideration and difficult to justify spending much time on.
|
# ? Jun 1, 2012 13:55 |
|
Generally, I think if you allow something to be configured by the end-user, you should provide all valid options. With genders & sex that can become a pain in the rear end to maintain, so I vote for "they/their" for everybody.
|
# ? Jun 1, 2012 17:07 |
|
I'm trying to do something in Python but my main subject matter here has to do with console I/O so I'm posting here. I'm about to embark on writing my own line reading code. I'm using Stackless Python and I want the interpreter to take a break from the keyboard I/O to run other stuff if nobody is actively typing stuff in. I see some OS-specific ways to poll for things in the keyboard buffer, which seems fine enough to do a nap on when nothing is happening; I can make that less obnoxious if I totally nap when the window isn't active or otherwise no attention is being paid to it. (edit: just realized "nap" needs to be defined here. Stackless Python will schedule another thread on specific calls, and I have a runtime running that manages the context switching on a call to a nap() method I wrote. This way other stuff can unblock and run) I'm trying to figure out how shells and consoles know how to react to tabs, backspaces, deletes, and arrow keys. Say, when I hit up arrow it knows to scroll through the history. If I look at this C code under the hood, I'm seeing stuff like fgets(), which implies to me that command should block. I can't see how it would come back with the arrow key. I know in Python there is the cmd module for reacting to all those specials keys. However, I am trying to figure out how these keyboard read operations can escape out to transmit those special keys. This is something in the long term I can probably figure out just by grinding through it, but I was hoping for some general conventions or tips on how those special cases get handled normally--even in C-level code which we have under the hood here. In the short term I want to just use a Win32 window for the console interaction but I expect to eventually move to some GUI widget and would prefer to standardize things enough that it won't be a big rewrite to handle that. Rocko Bonaparte fucked around with this message at 18:56 on Jun 1, 2012 |
# ? Jun 1, 2012 18:49 |
|
Localizing gender is a pain. So is not enforcing cisnormativity. Go with gender-neutral or be prepared for a long tail of work.
|
# ? Jun 1, 2012 18:52 |
|
Rocko Bonaparte posted:I'm trying to figure out how shells and consoles know how to react to tabs, backspaces, deletes, and arrow keys. Say, when I hit up arrow it knows to scroll through the history. If I look at this C code under the hood, I'm seeing stuff like fgets(), which implies to me that command should block. I can't see how it would come back with the arrow key. I know in Python there is the cmd module for reacting to all those specials keys. Rather, I am trying to figure out how these calls under the hood to read keys can escape out and send that along for the higher-level stuff to react to it. In Unix, this general topic is called "line discipline", and you should read the general manual about terminals, man 4 tty. I don't know the fundamental concepts in Windows, but I believe kbhit still exists. In either case, user code that takes this over is not supposed to ever use the streaming interfaces for that device, which basically automatically handle/ignore all the special editing keystrokes.
|
# ? Jun 1, 2012 19:04 |
|
rjmccall posted:Localizing gender is a pain. So is not enforcing cisnormativity. Go with gender-neutral or be prepared for a long tail of work. I was considering in the choice selection, making the connotations of each set explicit. as in code:
The way I see it it's a nice thing to do to let people select the way they would like to be referred to, within reason. I don't care about cisnomativity or any stupid poo poo like that, if anyone bothers me with nonsense I'm happy to tell them to go screw themselves.
|
# ? Jun 1, 2012 19:30 |
|
I'm working with C++ libraries and their associated Python bindings in Windows, and I still don't have a complete understanding of how all the pieces of the build process fit together. Here are a few questions that it'd be very helpful to have cleared up: 1. If I compile a C library with MinGW, can I link against it in a MSVC project, or do I need to keep things entirely homogeneous? 2. True or false: A C++ application compiled as 64-bit on Windows (XP or 7 regardless, MSVS or MinGW regardless) will run on any 64-bit version of Windows (XP or 7 regardless). A C++ application compiled in the same fasion as 32-bit will run on WinXP, WinXP x64, Win7, or Win7 x64. 3. True or false: If I'm building a 64-bit application, any dependencies I link against must be 64-bit as well. Here's some long-winded and meandering background information, if you're into that: quote:I've been developing in C++ and Python for a few years now, but the software build process still mystifies me in a lot of ways. I have some passable hand-wavy knowledge of how code is compiled to machine instructions in C and C++, but I'm not too familiar with linking and dependencies.
|
# ? Jun 1, 2012 20:05 |
wasabimilkshake posted:I'm working with C++ libraries and their associated Python bindings in Windows, and I still don't have a complete understanding of how all the pieces of the build process fit together. Here are a few questions that it'd be very helpful to have cleared up: a. What standard library is used. b. What name mangling is used. If you are exporting C++ objects, there is a third thing: c. What memory layout is used for objects. I believe MinGW is able to build against several different MSVC standard libraries. Make sure you use the same library for both. (Bad things can happen if you have two different standard libraries loaded in one process, especially if code linked against one allocates some memory and code linked against the other attempts to free that memory.) However I'm quit sure that MinGW does not produce MSVC-compatible C++ object layouts. You need to a common interface defined purely in terms of C types and functions to be able to call MSVC code from MinGW code and vice versa. wasabimilkshake posted:2. True or false: A C++ application compiled as 64-bit on Windows (XP or 7 regardless, MSVS or MinGW regardless) will run on any 64-bit version of Windows (XP or 7 regardless). A C++ application compiled in the same fasion as 32-bit will run on WinXP, WinXP x64, Win7, or Win7 x64. What matters are what version of the Windows headers are used. The value of the WIN32_WINNT preprocessor define before inclusion of <windows.h> controls what APIs are available, so you can use that to force yourself to code against an earlier version of Windows. wasabimilkshake posted:3. True or false: If I'm building a 64-bit application, any dependencies I link against must be 64-bit as well. All code running in a process must be either 32 bit or 64 bit, you can't have a process with mixed bitness of code. A 32 bit process trying to load a 64 bit DLL will fail, so will a 64 bit process trying to load a 32 bit DLL.
|
|
# ? Jun 1, 2012 20:22 |
|
Hammerite posted:That way the intended use case is clear to anyone reading in any supported language, even if (say) two possible choices are implemented as identical sets of pronouns in their language. This still assumes that they have a reasonably equivalent set of pronouns (or pronouns at all), and that pronoun choice does not affect conjugation or sentence structure, or that there are a similar set of pronoun forms compared to English, or that pronouns are used in the same scenarios as english. None of these assumptions are safe. Ultimately, the only way you could reliably translate into other languages would be to create a separate table of strings for all language + gender combinations you wanted to support.
|
# ? Jun 1, 2012 22:55 |
|
|
# ? Jun 1, 2024 20:52 |
|
wasabimilkshake posted:1. If I compile a C library with MinGW, can I link against it in a MSVC project, or do I need to keep things entirely homogeneous? Every compiler has CRT baggage, from MSVC2010 requiring msvr100.dll, Cygwin requiring cygwin.dll, and MinGW requiring libgcc.a and sometimes libmingwex.a. quote:2. True or false: A C++ application compiled as 64-bit on Windows (XP or 7 regardless, MSVS or MinGW regardless) will run on any 64-bit version of Windows (XP or 7 regardless). A C++ application compiled in the same fasion as 32-bit will run on WinXP, WinXP x64, Win7, or Win7 x64. New versions of Windows introduce new APIs, so an application built for a new API won't work on an older version of Windows. Windows XP 64-bit is particularly lovely for not supporting anything useful but surprisingly popular in some financial circles. I'd like to know how to package pyzmq into another installer as I maintain the Windows installer for ZeroMQ. Packaging Python bindings is a mystery.
|
# ? Jun 2, 2012 00:27 |