|
weird posted:it took it over a decade to support c99 at all and it still doesn't support all of it And people are still writing code against Python 2 and Perl 5 and Fortran 90. I mean, I'd hope for better from Microsoft, but I can't say I'm really surprised either.
|
# ? May 20, 2016 23:13 |
|
|
# ? Jun 8, 2024 05:52 |
|
TooMuchAbstraction posted:To get multiple return values in C++, you need to put the extra return values into the parameter list for the function, and pass them by reference or by pointer, yes. http://www.cplusplus.com/reference/utility/pair/ http://www.cplusplus.com/reference/tuple/ (not to mention : https://en.wikipedia.org/wiki/Return_value_optimization )
|
# ? May 21, 2016 02:41 |
|
ToxicFrog posted:You can also just pull in the individual symbols you want, e.g. using std::string; means you can now refer to it as just string but you don't end up with the rest of std all over the place. I'm a CS student at a school that primarily uses C++, and this will save me so much time. Thank you!
|
# ? May 21, 2016 03:11 |
weird posted:it took it over a decade to support c99 at all and it still doesn't support all of it And the product is called Visual C++, not Visual C. It just happens to also support the parts of C that are sufficiently similar to C++.
|
|
# ? May 21, 2016 12:41 |
|
TooMuchAbstraction posted:And people are still writing code against Python 2 and Perl 5 and Fortran 90. python 3 is bad and perl 6 doesn't exist.
|
# ? May 21, 2016 17:32 |
|
This is probably the wrong thread but I couldn't find anything that seemed to fit better. How hard would it be to make something that could spoof mouse input based on the real-world distance of mouse travel? Like say I wanted to consistently spoof moving my mouse X inches horizontally? Or even just measure the real world travel? I've looked for something that would do this for a couple months now and all I can find is things that seem to track mouse pointer movement in real world units.
|
# ? May 22, 2016 16:03 |
|
It's not possible in general because if the mouse gets lifted off the desk, you're boned. It also depends on system settings. So, by trial and error you could figure out the gain in physical units (you could write a short calibration routine: "move the mouse 6 inches and click") but you'll never be confident in the position. If you want to track physical movement you should look into motion tracking technologies. I use it for research and I'm not familiar enough with cheaper, consumer-grade options to recommend one but I know they exist. The wii was supposed to bring motion capture to the masses, then the kinect, but that was like 5 years ago so I'm not sure what the best option is these days. Edit: oops I was responding to the measure question, not the spoof question. If you just mean moving the cursor as if the mouse has moved X inches, once you've measured the gain with a calibration routine it should be straightforward. SurgicalOntologist fucked around with this message at 16:35 on May 22, 2016 |
# ? May 22, 2016 16:33 |
You have things like pen digitizers, which often also support a mouse accessory, those give you absolute positioning of the pointing device on the digitizer surface. But if you actually wanted to track an arbitrary object around a space, you would probably have to look into things like triangulation of an RFID tag against multiple receivers etc. As for actually spoofing input, depends on the OS, but on Windows there is the SendInput function which is the standard way to generate input when you aren't a hardware driver.
|
|
# ? May 22, 2016 16:42 |
|
Keep in mind that movement of the cursor onscreen depends on how quickly the mouse moves. If I move my mouse very slowly, I can cover a foot or two in the time it takes the cursor to traverse the screen; conversely, if I give the mouse a rapid twitch, then I can cross the entire screen in an inch of real-world distance. This depends on your mouse sensitivity settings, but I've no idea how those actually work, whether they're linear or exponential or whatever.
|
# ? May 22, 2016 21:25 |
|
TooMuchAbstraction posted:Keep in mind that movement of the cursor onscreen depends on how quickly the mouse moves. If I move my mouse very slowly, I can cover a foot or two in the time it takes the cursor to traverse the screen; conversely, if I give the mouse a rapid twitch, then I can cross the entire screen in an inch of real-world distance. This depends on your mouse sensitivity settings, but I've no idea how those actually work, whether they're linear or exponential or whatever. That's mouse acceleration ('enhance pointer precision' on Windows). The first thing I turn off on any device
|
# ? May 22, 2016 21:56 |
|
Suspicious Dish posted:python 3 is bad oh word?
|
# ? May 23, 2016 14:47 |
|
Munkeymon posted:oh word? Yeah, but Python 2 is far worse because of its stupid, broken text model.
|
# ? May 23, 2016 15:08 |
|
python 3's text model doesn't even make basic sense though
|
# ? May 23, 2016 16:32 |
|
Python 3 is fine. And by fine I mean it's broken in a lot of ways, but so is everything in the world.
|
# ? May 23, 2016 16:43 |
|
Is Python 3 so poo poo that someone starting new projects that don't have Python 2-specific package dependencies would still have a reason to prefer 2 over 3? Or is 3 just poo poo enough that it's not worth switching from 2?
|
# ? May 23, 2016 16:48 |
|
I haven't done any investigation, but everything I'd heard was "Python 3 is an improvement over Python 2, but there's still major third-party libraries that aren't available in 3 yet so everyone's still writing against 2", and it's been like that for years. Albeit, presumably the number of major libraries that aren't available in Python 3 has been slowly decreasing.
|
# ? May 23, 2016 16:51 |
|
GameCube posted:Is Python 3 so poo poo that someone starting new projects that don't have Python 2-specific package dependencies would still have a reason to prefer 2 over 3? Or is 3 just poo poo enough that it's not worth switching from 2? Well, I'm going to say you should just use 3 if you don't have dependencies on 2. Then someone else is going to go "yeah, but this and this and this is broken on 3" and then I'm going to go "yeah, but this and this and this is broken on 2" and then blah blah blah. TooMuchAbstraction posted:I haven't done any investigation, but everything I'd heard was "Python 3 is an improvement over Python 2, but there's still major third-party libraries that aren't available in 3 yet so everyone's still writing against 2", and it's been like that for years. Albeit, presumably the number of major libraries that aren't available in Python 3 has been slowly decreasing. A few years ago I was still hitting lots of major libraries that were not Python 3 compatible. A couple years ago, there were major libraries that were not compatible, but not every project needs every major library. A year ago 75% of the time you didn't even have to think about whether you'd need to use 2. Nowadays, you can probably default to 3. The thing with Python is that it gets overused because for people with whom python "clicks", it "clicks" so well that you want to use it for everything. edit: Actually, Python has had all of its problems fixed. quote:
Thermopyle fucked around with this message at 19:10 on May 23, 2016 |
# ? May 23, 2016 16:56 |
|
TooMuchAbstraction posted:I haven't done any investigation, but everything I'd heard was "Python 3 is an improvement over Python 2, but there's still major third-party libraries that aren't available in 3 yet so everyone's still writing against 2" This is basically not true at all anymore, Edit: It's not even true for gevent anymore. BigRedDot fucked around with this message at 04:02 on May 24, 2016 |
# ? May 24, 2016 03:59 |
|
I must not use Python enough because I don't even know what version I've used in the past.
|
# ? May 24, 2016 04:06 |
|
With MS Office, one can make applications based on the underlying tool. For example, you can make entry screens for Excel Spreadsheets, and presumably you can make complete database applications with MS Access. Is there any similar functionality with Google Docs? Could I make a web-enabled app that interacts with peoples' calendars, email, and a simple Google Docs database or spreadsheet?
|
# ? May 24, 2016 19:46 |
|
You mean use their API? https://developers.google.com/sheets/
|
# ? May 24, 2016 20:50 |
|
Munkeymon posted:You mean use their API? https://developers.google.com/sheets/ Perhaps, thanks!
|
# ? May 24, 2016 21:04 |
|
I have an idea for a programming/web dev project, but I'm unsure where to start for the web portion. High-level, I want to create a website where users can upload files and associate some tags/a description with these files (files are on the order of 1 MB max, probably closer to 50 kB more typically). I then want a client-side program that can fetch these files from the server and do something with the files. I need help figuring out where to start for developing the web portion. I've never done any web development/web work (beyond HTML/CSS for a personal website), let alone a website which allows third parties to upload files, so I'm clueless what the relevant libraries/programs/etc are. Usage will be happening on desktops/laptops (no mobile development necessary, currently). I'd like some advice in what technologies to look into for safely and correctly creating a server/database for users to upload these files with some associated metadata, and preferably something that's easily interfaced with from a programming language (C++ or Python are preferred, as I'm comfortable with them). E- all the clientside stuff, working with the file after I've downloaded it from the server, I'm good with. It's just all the interfacing with the server/the database itself that I need help with man in the eyeball hat fucked around with this message at 02:45 on May 25, 2016 |
# ? May 25, 2016 01:55 |
|
You want Python? Look into Django. It's pretty easy to set up and has all the bells and whistles you'd expect from a modern web framework. Database-wise you can get started using SQLite in like two lines of config, and easily transfer your schemas (if not necessarily your data) to more appropriate databases once you're ready. Like, switching from SQLite to an Amazon S3 PostGresQL database should just be a matter of changing your Django configuration.
|
# ? May 25, 2016 03:42 |
|
Django's great but really heavy. It's worth looking into, but I'd check out Flask as well.
|
# ? May 25, 2016 04:39 |
|
TooMuchAbstraction posted:And people are still writing code against Python 2 and Perl 5 and Fortran 90. I think you mean Fortran 77. Because Fortran 90 is a definitive improvement (hello structured programming!) which makes it a... somewhat decent language in my opinion. But there's a shitton of legacy code in f77 and it's an absolute nightmare. Fortran 95 and beyond is like uh... not necessarily bad but seriously who cares about doing OOP in loving fortran lol
|
# ? May 25, 2016 13:35 |
|
KernelSlanders posted:Django's great but really heavy. It's worth looking into, but I'd check out Flask as well. Flask is great and useful, but Django being "heavy" is, most of the time, not a reason to switch to Flask. For most projects over most projects lifespans, there's no cost to the batteries-included nature of Django.
|
# ? May 25, 2016 17:28 |
|
Read some quick stuff on Flask, looks easier than I expected. When I get a chance I'll look into Django as well. On the whole seems easier than I anticipated, just need to set up an old computer for a server and get to toying with this to figure things out. Web dev seems really intimidating to start.
|
# ? May 25, 2016 18:26 |
|
Zlocista posted:I have an idea for a programming/web dev project, but I'm unsure where to start for the web portion. If you are going the SPA route, or don't want to write a backend for this, you can look at services like Firebase and FileStack. Firebase will handle your hosting, authentication, authorization, and any sort of NoSQL database stuff you might want, and FileStack will do a similar thing but for uploading large files.
|
# ? May 25, 2016 22:37 |
|
Has anyone encountered data in a .pam file? Apparently it's some kind of image format but this is supposed to be positional data picked up from a motion-capture camera system. It could easily be that I was sent the wrong file or its some propriety format. The people I'm dealing with are like three steps removed from the actual technology that created it. I don't want to go back to them unless I really have to. All I can tell is that it's binary but I'm not really sure how to guess at the format. If I load it into Python I get a bunch of bytes interspersed with strings (that make sense). In the header at least, in the rest of the file it's all bytes. I assume they're floats of some kind but I'm not sure what to try next. The only time I've dealt with binary files was when communicating with some hardware over a serial port and the manual told me exactly what bytes did what. So, is there any chance of reverse-engineering this without knowing any more, or do I tell my contact to scour whatever crappy software they use for an export option?
|
# ? May 26, 2016 00:04 |
|
SurgicalOntologist posted:Has anyone encountered data in a .pam file? Apparently it's some kind of image format but this is supposed to be positional data picked up from a motion-capture camera system. It could easily be that I was sent the wrong file or its some propriety format. The people I'm dealing with are like three steps removed from the actual technology that created it. I don't want to go back to them unless I really have to. There may be no need. In addition, there's an already written library with support for this, PyPNG supports it (apparently). Sinestro fucked around with this message at 00:11 on May 26, 2016 |
# ? May 26, 2016 00:08 |
|
Wow that was fast, thanks. I guess my google-fu is weak today.
|
# ? May 26, 2016 00:12 |
|
SurgicalOntologist posted:Has anyone encountered data in a .pam file? Apparently it's some kind of image format but this is supposed to be positional data picked up from a motion-capture camera system. It could easily be that I was sent the wrong file or its some propriety format. The people I'm dealing with are like three steps removed from the actual technology that created it. I don't want to go back to them unless I really have to. You already kinda have an answer but did you run file on it to determine more info about the file type? Your description of "a bunch of bytes interspersed with strings" is typical of many file formats.
|
# ? May 26, 2016 00:13 |
|
Hmm maybe that's not it because the header doesn't seem to match the format described in that spec. I'll see if PyPNG can make sense of it. file just returns 'data'.
|
# ? May 26, 2016 00:25 |
|
Symbolic Butt posted:I think you mean Fortran 77. Because Fortran 90 is a definitive improvement (hello structured programming!) which makes it a... somewhat decent language in my opinion. Let me tell you about object-oriented COBOL! (Yes, actually a thing - https://supportline.microfocus.com/documentation/books/sx51/oppubb.htm)
|
# ? May 26, 2016 11:34 |
|
I'm making a little Arkanoid game in Javascript. I store the level in a 10x10 array of arrays like socode:
If I were going to be making 150 levels or something I'd make a little level editor and store something like { color: 'blue', strength: '3', powerup: 'none' } in each array location. But what I'm wondering is what would be a handy way to store 3 values in one variable? Years and years ago when I did this in Turbo Pascal I just used used a 16-bit value and used the first 4 bits for one value, the next 4 for the next... and then I just did the values like $082a, and that meant power up #8, brick takes 2 hits to break, and is sprite # 10 I thought about just using a 3 digit # like 1028. I can / by 100 to get the sprite #, / 10 to get the strength, and then what's left to get the power up #. I want something I can use a fixed length for so that the map array stays human-readable. Any other suggestions?
|
# ? May 27, 2016 14:17 |
|
Bob Morales posted:But what I'm wondering is what would be a handy way to store 3 values in one variable? Years and years ago when I did this in Turbo Pascal I just used used a 16-bit value and used the first 4 bits for one value, the next 4 for the next... and then I just did the values like $082a, and that meant power up #8, brick takes 2 hits to break, and is sprite # 10 You could use an array to store it, which would stretch it out a bit but keep it human-readable. Otherwise I think the 3-digit # idea is solid because you're probably not going to have more than 10 of each value type. If you're looking for more complexity, you could keep a map of brick types for one level and a separate map describing which bricks go where. So if your first level has only 3 types of bricks you'd have something like: code:
IT BEGINS fucked around with this message at 15:33 on May 27, 2016 |
# ? May 27, 2016 15:31 |
|
Bob Morales posted:I'm making a little Arkanoid game in Javascript. I store the level in a 10x10 array of arrays like so You can have the map straight up just be an array of all brick objects. You are just making your life hard trying to map them to some template and then match by strings. Don't try doing some weird math to fit values into a 16bit number... you can't even HAVE 16bit numbers in JavaScript, ALL numbers are 64bits.
|
# ? May 27, 2016 15:48 |
|
I don't know much javascript, but can't you put a structure or object reference in the array? Using an integer split up into fields feels like 1991 C. (not that it won't work)
|
# ? May 27, 2016 15:52 |
|
|
# ? Jun 8, 2024 05:52 |
|
Skandranon posted:You can have the map straight up just be an array of all brick objects. You are just making your life hard trying to map them to some template and then match by strings. Don't try doing some weird math to fit values into a 16bit number... you can't even HAVE 16bit numbers in JavaScript, ALL numbers are 64bits. And floating point at that, if I recall.
|
# ? May 27, 2016 16:29 |