|
Thanks Andy, really appreciated.
I will consider writing an article on this. Maybe when I'm on my holidays next month, then hopefully I'll get enough free time. If I don't overplay my PS3, that is hehe.
Now I "only" need to get good at writing articles... ARGH!
2+2=5 for very large amounts of 2
(always loved that one hehe!)
|
|
|
|
|
Hi all,
Is there anyone could point out any way in bypassing a firewall via compression techniques? would appreciate if any available algorithm (java) is provided as well.
What i want is for the software to basically compress the files or sites in order to bypass the firewall instead of hiding the IP address. Is it possible?
Tried google but couldnt get the answer i m looking for.
Thanks
|
|
|
|
|
|
What is a good algorithm to calculate if a square is intersecting a rectangle?
I noticed in Windows forms the picture box Rectangle had an "intersect" function but I would like to program something on those lines with an algorithm instead.modified on Monday, March 8, 2010 7:52 PM
|
|
|
|
|
There is no PictureBox.Intersect; maybe you are confusing with Rectangle.Intersect?
are the rectangles always orthogonal (parallel to the axes)? (if so, use Rectangle.Interset)
or under an arbitrary but fixed angle? or a variable angle?
|
|
|
|
|
Luc Pattyn wrote: There is no PictureBox.Intersect; maybe you are confusing with Rectangle.Intersect?
Ah yes I confused my self that is what I meant, a rectangle intersection
|
|
|
|
|
I figured out a solution my self, wasn't as tricky as I had thought, being 2am didn't help though:
public bool HitTest(Sprite paddle)
{
bool left = _ball.Position.X + _ball.Width > paddle.Position.X;
bool right = _ball.Position.X < paddle.Position.X + paddle.Width;
bool up = _ball.Position.Y + _ball.Height > paddle.Position.Y;
bool down = _ball.Position.Y < paddle.Position.Y + paddle.Height;
return (left && right && up && down);
}
|
|
|
|
|
Does anyone have any experience with writing parallel algorithms. I am teaching my self CUDA; Nvidia's C language with parallel extensions for G80 (Tesla) and GT200 (Tesla) GUP's. I am having a hard time with the concepts of thinking of threads in so many different dimensions. Is there a good source of parallel design architecture anyone knows of that might help me better understand this concept? With CUDA you literally have to think in 5 dimensions at once just to get decent data parallelism at CGMA (compute to global memory access) above 1.0.
The book I am reading is: Programming Massively Parallel Processors. It is based on: SIMT (single-instruction, multiple-thread) where as CPU's are based on: SIDM (single-instruction, multiple-data). and the book tries to cover both topics at once, which is a little confusing since CUDA supports running on CPU or GPU in parallel data access.
The book is intended for undergraduates and I am about at that level, but have no formal training in a university, only professional mentoring. Can some one point me in the right direction? I am a visual learner, the book is full of diagrams, but all the diagrams seem to show data and events flowing in every direction at once.
Currently I have covered: History of GPU computing, Introduction to CUDA (Matrix Multiplication Example), CUDA Threads (Same Examples), CUDA Memories (same examples), and now working on: Performance Considerations; this chapter is kind of mind blowing!
~TheArch
|
|
|
|
|
have you done any non-CUDA multi-threading ?
|
|
|
|
|
yes, I have worked extensively with threading and even use to debug parallel threading architecture on Java UI's what took advantage of multiple processors on super spark servers. threading it no problem. I fully understand the concept, however on a GPU it is a bit different, the developer is forced to use the parallel design-constructs of the GPU, and to get the correct memory bandwidth ratios of processing data-parallelism you are forced to design the code so it takes advantage of the hardware, simple loops with nested loops and control flow logic seriously complicates the process.
this constraint is a difficult concept to understand, grasp, and implement. Just for matrix multiplication you have to think in three dimensions just to get a global memory ratio of 1.0, which barely makes use of the full processing power of the GPu, stream processors are also used hand have limitations on the number of current threads that can execute a 'block' a quadrant of GPU cores sharing global memory.
so to make full use of a G80 GPU the code has to be written in such a fashion (a dependency caused by manufacturing costs and lithography techniques) to process the three dimensions of the multiplication in what I consider a strange and cumbersome way, where each matrix (G1, G1, R1) are further divided to make use if faster but smaller shared memory which cuts the bandwidth in half. so now you are thinking in six dimensions and also have to consider how many threads a stream processor can handle for the process just to achieve 748Mb band-with and full GPU utilization.
it is algorithms like I have no experience designing.
but I have a strong desire to learn, even if the approach seems unintuitive and abstract!
------Modification-------
I wrote the response on the bus, couldn't hardly see the screen I was typing into, I think I am going to put a sugestion in the site sugestions box to make it wasier to respond to threads using a mobile device, I use to be a mobile device programmer. I could do it in a peice of cake.
-------------------------
~TheArch
|
|
|
|
|
ah...
unfortunately, this sounds like it's well beyond anything i've done.
good luck !
|
|
|
|
|
Hi,
So I am coding CUDA stuff since a year now.
I started to program the examples that they showed in their documentation.
I found that really helpful. I also liked this article :
[^]
Actually, I would not recommend any of the books, because the documentation from Nvidia is enough, but maybe it helps you.
Have fun, cheers
You have the thought that modern physics just relay on assumptions, that somehow depends on a smile of a cat, which isn’t there.( Albert Einstein)
|
|
|
|
|
I have a mapping program. Upon the map are laid polygons that represent rooms in a building.
The program must tell which room a tracked asset is in, AND if the asset is not within any of the rooms, it must tell which is the closest room to its location.
I have already implemented the code that can tell which polygon contains a given point, BUT I can't see how to figure out the closest polygon to a given point if the point is not within any polygon.
In other words, if the point is not within any of the polygons, how do I figure out which polygon it is closest to?
|
|
|
|
|
Do you mean closest to the walls or closest to the doors?
Because if it is about tracking an asset, it should be closest to the door.
This could be one approach:
You could create a virtual circle around the point and find all polygon falling on it. if there are none, increase the size of circle. eg a circle of 10, 20,40,80 and so on. when you do encounter one polygon, thats your winner. In case you get more than one, reduce the circle slowly till you get a single.
|
|
|
|
|
Thanks! I think this is the plan I will choose, except instead of a circle, I may use a rectangle to make the math easier.
|
|
|
|
|
Hi,
you could replace each polygon by a single point, representing either the room's center, or its door(s); then search for the nearest point by calculating distance squared, and taking the minimum value of those.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
I will consider this as a backup plan in case I can't make the other one work.
Thanks for your input!
|
|
|
|
|
|
've seen that before.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
I will definitely look into that. Thanks!
|
|
|
|
|
What if you iterate over every line segment, and determine argmin(d(ThePoint,line-seg)), the polygon containing the line-seg is closest to the point.
Would that be too slow? The formula for d(point, line-segment) is not pretty and there might be ton of line segments (right? about how many segments do you expect?)modified on Friday, February 19, 2010 1:00 PM
|
|
|
|
|
Actually I came across the formula for figuring the point on a line that is closest to a given point.
It's not too bad, but I don't yet have a sense of how fast it would be with the average layout containing 50+ polygons, and each polygon containing at least 4 and likely many more line segments.
|
|
|
|
|
50 times 4 doesn't sound to bad yet, but "many more" is really a lot... Could it be worth a try? It does seem "cleaner" to me than expanding a circle until it hits something
|
|
|
|
|
I think you're right. I would like to try it, especially since the math would be simpler than the other solution.
|
|
|
|
|
The problem with circle approach is that you need to calculate the radius to every point to determine if it is within the circle, determining the radius of the next circle and iterating through it again.
This is worse than determining the distance to each point once and taking the one with the smallest radial distance.
If you need to do this in real time, you want to take an approach where you break the world up into 2 kinds of polygons, 'rooms', which are obvious, or 'not rooms', where the border between 'not room' polygons is the line equidistant between 2 rooms.
This way, every polygon is a room, or the area closest to a particular room.
If you know what polygon you are in, you either know the room you are in, or the room you are closest to.
You use the same code to determine which polygon you are in, either way.
The only special code is breaking up the world ahead of time.
RichardOpacity, the new Transparency.
|
|
|
|