How to simulating two client-controlled vehicles colliding (sensibly) in a typical client/server setup for a network game? I did read this eminent blog post on how to do distributed network physics in general (without traditional client prediction), but this question is specifically on how to handle collisions of owned objects.
Example
Say client A is 20 ms ahead of server, client B 300 ms ahead of server (counting both latency and maximum jitter). This means that when the two vehicles collide, both clients will see the other as 320 ms behind - in the opposite direction of the velocity of the other vehicle. Head-to-head on a Swedish highway means a difference of 16 meters/17.5 yards!
What not to try
It is virtually impossible to extrapolate the positions, since I also have very complex vehicles with joints and bodies all over, which in turn have linear and angular positions, velocities and accelerations, not to mention states from user input.
Hi, how can I get a list of windows shown on the taskbar on Windows 7? I have tried EnumWindows, but I'm getting way more windows than those shown on the taskbar (800 vs 15).
If you had to describe your language of choice as a superhero, which would it be and why?
VB.NET would be The Thing. Not considered pretty and shunned by a few, but does a lot of heavy lifting without any of the glamour.
Browsing around Stackoverflow, I get overwhelmed with the number of "Why should I learn Python/Ruby/PHP/.Net/jQuery..." and the list goes on. Most answers, although good, are usually battles from language A programmer to language B programmer detailing why one piece sucks more than another.
People can discuss the theoretical benefits of one over another but in the end, money/glitz talks and the rest walks. I am more interested in the potential opportunity that can come from one language or another over others. A little background, I am a project manager turned novice 'programmer' out of corporate necessity within the small company I currently work with so I have both relatively no set preference or experience, more out of curiosity. While I realize all are not created equal and for similar things, I think it would be interesting to start a list of the best websites / web applications built on specific languages/frameworks just to highlight the possibilities with each and give somebody like me motivation to say "How the heck was that done? Time to buy a book/take a class and learn."
Tell me and I will forget,
Show me and I will learn,
Involve me and I will understand
- Teton Lakota
I know there's a lot of resource for this via google, but I just wanted to hear personally from people who have experienced this before. I've programmed in C for 3 years and C++ for a year and now I am moving to C#. I know this is not going to be a so hard transition but could you guys that had this same experience with me share resources on a good book, article, or blog to make my study experience more efficient. Any tips/tricks or gotchas when moving to C#?
Here's one article that I can find via google. Looking for more goodies from experienced developers here.
If you're trying to build an application that needs to have the highest possible sustained network bandwidth, for multiple and repetitive file transfers (not for streaming media), will having 2 or more NICs be beneficial?
Sorry for this english related question but I only came across that expression in the context of IT. What does abstracting over something mean ? For example abstracting over objects or abstracting over classes.
Thanks
JavaScript is known as a language with many weird features. This probably makes it a good language to write extremely obfuscated and hard to understand code in (in the style of The International Obfuscated C Code Contest).
What would be your best example of obfuscated JavaScript code (5 lines maximum)? I am thinking that it should be very hard to understand, but also have an element of style or humor in it.
And for clarity: using obfuscation tools is not the point, of course. Hand crafting only!
I'm lucky enough to share a room with 3 other people at work. One of them, a senior programmer who's very talkative in general, tends to ask me various questions throughout the day. While some of them are surely ' legitimate', many questions could have been answered by putting in just slightly more search effort on their part.
I really don't mind be asked stuff, and I can also cope with beginner questions, but this is seriously interrupting my flow. I clearly remember Joel talking about how private offices increase productivity because they prevent too easy questions from being asked.
How should I deal with this situation? Getting a private office is out of the question, sadly. It's difficult to approach him directly, and he blissfully ignored the slight hints I tried to give.
Why is CompareAndSwap instruction considered expensive?
I read in a book:
"Memory barriers are expensive, about as
expensive as an atomic compareAndSet()
instruction."
Thanks!
One of the drivers I'm developing has caused a BSOD. Unfortunately a dump file was not created since it was not configured / low resources. I was trying to reproduce this crash but no luck so far.
Is there any way to get some info using WinDbg or any other tool?
I have this information:
A screenshot of the BSOD
The .sys file.
Its pdb
The source code
The machine it was crashed on
I have everything except the dump itself.
Your help will be much appreciated.
As I said above, no dump (/minidump) exists. This is the actual problem.
For this specific crash, I know I won't be able to get the stack. Just getting the specific line of code will be good enough. Because the BSOD contains the module's address, it seems like there should be a way to detect which line exactly is it. As I mentioned above, I do have the .sys file, the pdb and the source code.
This is the specific code taken from MSDN: SYSTEM_SERVICE_EXCEPTION.
How can I know from there what was the specific line? and/or the specific exception raised?
I'm creating a generic list class that has a member of type Array(Array of ).
The problem is the class descruction,because the class is supposed to be used for types from byte to types inheriting TObject.
Specifically:
destructor Destroy;
var elem:T;
begin
/*if(T is Tobject) then //Check if T inherits TObject {Compiler error!}
for elem in FData do TObject(elem).Free;*/ // do not know how to do it
SetLength(FItems,0); //FItems : Array of T
inherited Destroy;
end;
How do I check if T is TObject so I can free every member if the typeidenitifier is a class,for example?
Hi,
Is there any reason behind using this date as standard for time manipulation? I have seen this standard in Java as well as in Python. These two languages I am aware of. Is other popular languages also follows the same standard?
Please describe.
I have to develop a whiteboard application in which both the local user and the remote user should be able to draw simultaneously, is this possible? If possible then any logic?
I have already developed a code but in which i am not able to do this, when the remote user starts drawing the shape which i am drawing is being replaced by his shape and co-ordinates.
This problem is only when both draw simultaneously.
any idea guys?
Hi all,
I'm finding a way to write a mobile application that could stimulate clicking some buttons on the phone. Based on my check, it's not possible to do with J2ME. How about Symbian? Is it possible?
I want to divide a list in "a specific number of" sublists.
That is, for example if I have a list List(34, 11, 23, 1, 9, 83, 5) and the number of sublists expected is 3 then I want List(List(34, 11), List(23, 1), List(9, 83, 5)).
How do I go about doing this? I tried grouped but it doesn't seem to be doing what I want.
PS: This is not a homework question. Kindly give a direct solution instead of some vague suggestions.
In every technical publication, and on this site too, people are always comparing OO languages to Smalltalk. My experience is in Java: is Smalltalk so important that I should study it?
Newbie question:
On Unix, in a program with a parent and some children:
- How can the parent alert the children efficiently to do some work.. ?
- Or how can the children wait for parent signal to start doing some work?
Thanks
I'm starting a new project and don't know which language to use.
My 'must have' requirements are:
Be able to run on Windows/LinuxMacOs natively (native executable) - user should be able to just run the exe (when on Windows for example) and see the results.
No runtimes/interpreters (no jvm, clr, etc) - one file download should be enough to run the application.
Full unicode support.
Be able to manipulate OS threads (create them, run multiple tasks in parallel on multi-core CPUs, etc).
Be reasonably fast (Python level performance and better).
To have some kind of standard library that does low-level, mundane tasks.
Not very niche and have some community behind it to be able to ask questions.
My 'nice to have' requirements are:
Language should be functional
It should have good string manipulation capabilities (not necessarily regex)
Not extremely hard to learn
I'm thinking about Haskell now but keeping in mind OCaml as well.
Please advice if my choice is correct.
Hi Everyone:
I am wondering if there is some way to align text on the right of a photo, and keep the text in that same "box" even after the image ends using HTML and CSS. A quick "diagram" of what I am attempting to accomplish is below:
------- --------
------- --------
-Image- - Text -
------- --------
------- --------
--------
--------
Thanks for any help!
G'day,
How do you work with someone when they haven't been able to see that there is a range of other languages out there beyond "The One True Path"?
I mean someone who hasn't grown up to realise that the modern software professional has a range of tools in his toolbox. Someone who has a well-equipped toolbox and then selects the best tool for the job at hand.
The person who's knee jerk reaction is, for example, "We must do this is C++!" "Everything must be done in C++!"
What's the best approach for these people? How do you open them up to the fact that "not everything is a nail."
cheers,