|
Is there a hangout thread for CoC kind of like the TCC Weed Megathread or I guess the "poo poo that pisses you off" thread but more chill like "stuff you want to talk about and talk about with other programmers".
|
# ? Oct 30, 2012 19:35 |
|
|
# ? May 14, 2024 03:14 |
|
Physical posted:Is there a hangout thread for CoC kind of like the TCC Weed Megathread or I guess the "poo poo that pisses you off" thread but more chill like "stuff you want to talk about and talk about with other programmers". Don't think there's a hangout thread, but there's a hangout IRC channel. See the Cavern of Cobol FAQ.
|
# ? Oct 30, 2012 19:38 |
|
Physical posted:Is there a hangout thread for CoC kind of like the TCC Weed Megathread or I guess the "poo poo that pisses you off" thread but more chill like "stuff you want to talk about and talk about with other programmers". the irc channel
|
# ? Oct 30, 2012 19:38 |
|
Otto Skorzeny posted:1) what sort of floating point exceptions do you think you are going to encounter here? Subnormals don't raise anything, they're just slow as a turd. Sylink's probably talking about cumulative roundoff errors that will be dependent on the framerate (e.g. adding (float)1/2 twice isn't the same as adding (float)1/3 thrice), and since the framerate can be variable that means results can be variable too. In a physics simulation, that can be the difference between a ball bouncing left, bouncing right, blowing up everything, etc. It's a common problem in games that's solved by using a constant framerate for logic. (A fixed rate isn't enough for consistent floating point math, but it's one necessary piece.) Anyway, here's a simple example of one way you could do that (C): code:
|
# ? Oct 30, 2012 19:39 |
|
epalm posted:Don't think there's a hangout thread, but there's a hangout IRC channel. See the Cavern of Cobol FAQ. Otto Skorzeny posted:the irc channel
|
# ? Oct 30, 2012 19:53 |
|
Sylink posted:How do I add a tick rate into a program? I know game libraries often include these to limit the framerate and that is essentially what I need for command line output or something similar. This is because I imagine trying to calculate the time billions of times a second will add in all kinds of crazy errors. Getting the time in seconds takes about 60 ns the second time you try. Using the rdtsc instruction to get the time in "cycles" will take about 20 ns. I forget how long time(NULL) takes, but it does not make a system call and it is something between 60 ns and 600 ns. There's also something that takes 130 ns. I think clock_gettime(CLOCK_MONOTONIC, ...) takes 60 ns, but I can't exactly remember. shrughes fucked around with this message at 21:12 on Oct 30, 2012 |
# ? Oct 30, 2012 21:10 |
|
I need an idea for an algorithm. I've got a list of 2D points where each point points to the one on the right. These make up one polygon for each loop. If there's a hole in the polygon right now, the polygon just covers the hole. I need an algorithm to tesselate these polygons so the holes are actually holes instead of just another polygon. My structures looks like this:code:
Any ideas?
|
# ? Oct 30, 2012 21:22 |
|
I'd be willing to answer your question but first I'd like you to reply with the definition of "tesselate".
|
# ? Oct 30, 2012 21:23 |
|
Oh, sorry. I'd like to cut the polygons up in triangles. EDIT: like this one I've found a couple of algorithms, but they either don't work with loops, or I don't know how to use them with my data structure. Boz0r fucked around with this message at 21:31 on Oct 30, 2012 |
# ? Oct 30, 2012 21:24 |
|
Boz0r posted:Oh, sorry. I'd like to cut the polygons up in triangles. Then don't define it like that? Can't you just define it as 3->7->6->0 0->6->5->1 1->5->4->2 2->4->7->3
|
# ? Oct 30, 2012 21:31 |
|
Yeah, for that specific one, but I have to deal with arbitrary polygons.
|
# ? Oct 30, 2012 21:31 |
|
Boz0r posted:Oh, sorry. I'd like to cut the polygons up in triangles. My bad, I had a brain fart and completely forgot that usage.
|
# ? Oct 30, 2012 21:32 |
|
Boz0r posted:Yeah, for that specific one, but I have to deal with arbitrary polygons. I'unno, I'm sure there's probably a good use for this and I'm interested if there's an actual way to solve it, but why is whatever the data you're getting, allowed to be like that? Whatever's exporting the data probably should split it into 4 polys whenever whatever operation was done to it to make that scenario, otherwise imo the first image you provided is just two polygons over the top of each other. Just because someone wants data to mean something doesn't mean they can do a bad job at exporting/writing that data in the first place Mostly basing this off the fact I have no idea what this is for though, but SOMETHING had to create that data, and I assume if it's something like a 3D modelling program it should have split it into 4 polys to begin with.
|
# ? Oct 30, 2012 21:41 |
|
This looks very similar to a Delaunay triangulation. Is it? If not, will the algorithm work for this problem anyway?
|
# ? Oct 30, 2012 21:45 |
|
I'm trying to extract map information from BUILD Engine maps and convert them to 3D models That's how it's represented in their files. EDIT: That one actually looks like something I can use. I'll try giving it a shot. Boz0r fucked around with this message at 21:49 on Oct 30, 2012 |
# ? Oct 30, 2012 21:45 |
|
shrughes posted:Using the rdtsc instruction to get the time in "cycles" will take about 20 ns.
|
# ? Oct 30, 2012 22:56 |
|
And of course different cores can have different clock counts. And the clock frequency itself is variable more often than not.
|
# ? Oct 30, 2012 23:16 |
|
There's got to be some middle ground between using something like rdtsc and hoping your rtc syscall call uses a hardware RTC in some manner. Last I remember when I looked at sub-microsecond benchmarking seriously (literally 10 years ago), the only way to get a fairly accurate picture of function calls was to use both highly instrumented userland software like from Rational software and to utilize a kernel that uses event-based clocking for its multi-process management like HP/UX. The inaccuracy of timers was pretty much inversely proportional to the length of the function run indicating probably overhead of timing being at the minimum constant and possibly even higher as the measurement interval gets shorter.
|
# ? Oct 31, 2012 00:46 |
|
Physical posted:Is there a hangout thread for CoC kind of like the TCC Weed Megathread or I guess the "poo poo that pisses you off" thread but more chill like "stuff you want to talk about and talk about with other programmers". There used be a thread like this, but it got taken away. The coccest pics you got, was a thread where we posted terrible pictures of things, and whined about stuff. It closed when YOSPOS opened. YOSPOS (that forum next door), occasionally chats about programming, when it isn't talking about phones, cars or holding séances for the late steve jobs. http://forums.somethingawful.com/showthread.php?threadid=3481275 like this
|
# ? Oct 31, 2012 01:37 |
|
I also unfucked sn.printf.net
|
# ? Oct 31, 2012 01:52 |
|
JawnV6 posted:Depending on your processor you also get to learn all about C states and P states and after tearing your hair out for a while finally understand why you should probably just chuck it to the OS for the minuscule hit. It's not a miniscule hit and rdtsc has had no practical problems for measuring timings for us and could you please provide instructions for how to write a version of asking for the time that involves a syscall?
|
# ? Oct 31, 2012 10:47 |
|
Okay, got another question for you all. So I am learning about partial classes and partial methods. However I am not really understanding the purpose of it all. I understand how to write the code and what it does but I am wondering what the purpose of doing partial classes and methods is. Why don't you just write a whole method or class down in one file versus splitting them between two files? Wouldn't that make more sense?
|
# ? Oct 31, 2012 13:20 |
|
There are specific cases where partial classes and methods are useful, and they're not particularly useful in more general programming. One example where they are useful is for interacting with automatically generated code - having autogenerated code live in its own file, entirely separate from code written by you, is really handy. The Visual Studio designer does this, for example - when you ask it to create a form, it makes a *.cs file for you to write your code, and a *.designer.cs file which is where it puts the code it generates for that form. That way it can easily modify the *.designer.cs file when you make changes to the form, without worrying about messing up the code you've written.
|
# ? Oct 31, 2012 13:56 |
|
tef posted:There used be a thread like this, but it got taken away. The coccest pics you got, was a thread where we posted terrible pictures of things, and whined about stuff. It closed when YOSPOS opened. Also, I need to learn how to document code. Is Javadoc the standard and where is the best place to learn? Wikipedia is being pretty concise so far.
|
# ? Oct 31, 2012 14:57 |
|
Physical posted:Ah, why did it get taken away? In Java, it's certainly the standard. Not only will you have IDE integration in many cases, but there are built in tools to automatically convert your javadoc comments into a website just like the official docs.
|
# ? Oct 31, 2012 15:09 |
|
Physical posted:Ah, why did it get taken away? Depends on what code. Different projects and communities will have different conventions for code documentation. Different languages will have different tools and support for it, in some cases built directly into the language. In Java, I believe Javadoc is still the standard documenting tool.
|
# ? Oct 31, 2012 15:15 |
|
shrughes posted:It's not a miniscule hit and rdtsc has had no practical problems for measuring timings for us JawnV6 posted:Depending on your processor you also get to learn all about C states and P states and after tearing your hair out for a while finally understand why you should probably just chuck it to the OS for the minuscule hit.
|
# ? Oct 31, 2012 15:51 |
|
JawnV6 posted:Bolded the important bit, feel free take another whack at it: If you have a really old processor? Who cares?
|
# ? Oct 31, 2012 20:00 |
|
shrughes posted:If you have a really old processor? Who cares? Those problems would occur with relatively new processors in certain conditions rather than old ones
|
# ? Oct 31, 2012 20:13 |
|
When I have an array of 2D points(a loop), how can I know if they're clockwise or not, and if another point is inside or outside of the loop?
|
# ? Oct 31, 2012 20:31 |
|
Otto Skorzeny posted:Those problems would occur with relatively new processors in certain conditions rather than old ones Your response seems awfully vague.
|
# ? Oct 31, 2012 20:36 |
|
Boz0r posted:When I have an array of 2D points(a loop), how can I know if they're clockwise or not, and if another point is inside or outside of the loop? Do you already know whether they form a convex shape, or can you make no assumptions?
|
# ? Oct 31, 2012 20:36 |
|
shrughes posted:Your response seems awfully vague. It is, because I don't have the time or the inclination to make an effortpost on ACPI
|
# ? Oct 31, 2012 20:38 |
|
Otto Skorzeny posted:It is, because I don't have the time or the inclination to make an effortpost on ACPI Then please answer this simple question. When does ACPI affect values returned by rdtsc in modern processors?
|
# ? Oct 31, 2012 20:40 |
|
Internet Janitor posted:Do you already know whether they form a convex shape, or can you make no assumptions? No assumptions, sadly. It's just a bunch of 2D points with a pointer to the one on the right.
|
# ? Oct 31, 2012 20:48 |
|
shrughes posted:Then please answer this simple question. When does ACPI affect values returned by rdtsc in modern processors? This depends on whether you are interpreting the TSC as a "cycle counter" or a timer. In the latter case, anything recent will indeed be fine (and you can check whether you're recent enough quite easily); in the former case, you can still be hosed! Of course there are other gochas that I assume you're controlling for wrt core affinity etc - Agner Fogg's instruction latency work gives a good example of what you should account or at least control for.
|
# ? Oct 31, 2012 21:06 |
|
shrughes posted:Then please answer this simple question. When does ACPI affect values returned by rdtsc in modern processors? Triggering a SMI to enter SMM can completely and utterly trash timing-dependent / real-time code. You could literally leave OS execution and hit up an EFI runtime service exposed in the EFI System Table (or a call to some legacy BIOS code as well). On most platforms, hitting IO Port 0xB2 will have the effect of triggering some SMI handler, be it unlocking/locking flash, munging CMOS, etc. You really don't have guaranteed control over this unless say you happen to build your own BIOS and OS Kernel, and can kill off SMMs/SMIs to ensure real-time code executes properly. gently caress knows what Windows does with them, it's been awhile since I've had windbg or similar attached to a machine. movax fucked around with this message at 07:11 on Nov 1, 2012 |
# ? Nov 1, 2012 07:08 |
|
Why are we talking about this anyway? We don't even know how accurate Sylink needs the count to be.
|
# ? Nov 1, 2012 07:18 |
|
Boz0r posted:No assumptions, sadly. It's just a bunch of 2D points with a pointer to the one on the right. Can you assume that none of the edges cross each other? How about that the linked list is even circular (and not weird, like a p-shape)? e: and this is the kind of question where you'll get perfectly fine results from just googling "polygon clockwise test" and "point in polygon test"
|
# ? Nov 1, 2012 07:18 |
|
|
# ? May 14, 2024 03:14 |
|
yaoi prophet posted:Why are we talking about this anyway? We don't even know how accurate Sylink needs the count to be. Huh I went back and read his original post, setting up a 100Hz timer should be pretty trivial, I assume Python has some Timer class or similar in it. I don't know how demanding 100Hz timer + whatever executes every 100Hz would be interpreted by Python though, I've only written Python scripts that move files around From doing similar stuff on x86+Linux though, just leveraged the fact that kernel was already patched with Xenomai and used their real-time task/timer management services.
|
# ? Nov 1, 2012 07:21 |