Search Results

Search found 1055 results on 43 pages for 'holy war'.

Page 3/43 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • RTS style fog of war woes

    - by Fricken Hamster
    So I'm trying to make a rts style line of sight fog of war style engine for my grid based game. Currently I am getting a set of vertices by raycasting in 360 degree. Then I use that list of vertices to do a graphics style polygon scanline fill to get a list of all points within the polygon. The I compare the new list of seen tiles and compare that with the old one and increment or decrement the world vision array as needed. The polygon scanline function is giving me trouble. I'm mostly following this http://www.cs.uic.edu/~jbell/CourseNotes/ComputerGraphics/PolygonFilling.html So far this is my code without cleaning anything up var edgeMinX:Vector.<int> = new Vector.<int>; var edgeMinY:Vector.<int> = new Vector.<int>; var edgeMaxY:Vector.<int> = new Vector.<int>; var edgeInvSlope:Vector.<Number> = new Vector.<Number>; var ilen:int = outvert.length; var miny:int = -1; var maxy:int = -1; for (i = 0; i < ilen; i++) { var curpoint:Point = outvert[i]; if (i == ilen -1) { var nextpoint:Point = outvert[0]; } else { nextpoint = outvert[i + 1]; } if (nextpoint.y == curpoint.y) { continue; } if (curpoint.y < nextpoint.y) { var curslope:Number = ((nextpoint.y - curpoint.y) / (nextpoint.x - curpoint.x)); edgeMinY.push(curpoint.y); edgeMinX.push(curpoint.x); edgeMaxY.push(nextpoint.y); edgeInvSlope.push(1 / curslope); if (curpoint.y < miny || miny == -1) { miny = curpoint.y; } if (nextpoint.y > maxy) { maxy = nextpoint.y; } } else { curslope = ((curpoint.y - nextpoint.y) / (curpoint.x - nextpoint.x)); edgeMinY.push(nextpoint.y); edgeMinX.push(nextpoint.x); edgeMaxY.push(curpoint.y); edgeInvSlope.push(1 / curslope); if (nextpoint.y < miny || miny == -1) { miny = curpoint.y; } if (curpoint.y > maxy) { maxy = nextpoint.y; } } } var activeMaxY:Vector.<int> = new Vector.<int>; var activeCurX:Vector.<Number> = new Vector.<Number>; var activeInvSlope:Vector.<Number> = new Vector.<Number>; for (var scanline:int = miny; scanline < maxy + 1; scanline++) { ilen = edgeMinY.length; for (i = 0; i < ilen; i++) { if (edgeMinY[i] == scanline) { activeMaxY.push(edgeMaxY[i]); activeCurX.push(edgeMinX[i]); activeInvSlope.push(edgeInvSlope[i]); //trace("added(" + edgeMinX[i]); edgeMaxY.splice(i, 1); edgeMinX.splice(i, 1); edgeMinY.splice(i, 1); edgeInvSlope.splice(i, 1); i--; ilen--; } } ilen = activeCurX.length; for (i = 0; i < ilen - 1; i++) { for (var j:int = i; j < ilen - 1; j++) { if (activeCurX[j] > activeCurX[j + 1]) { var tempint:int = activeMaxY[j]; activeMaxY[j] = activeMaxY[j + 1]; activeMaxY[j + 1] = tempint; var tempnum:Number = activeCurX[j]; activeCurX[j] = activeCurX[j + 1]; activeCurX[j + 1] = tempnum; tempnum = activeInvSlope[j]; activeInvSlope[j] = activeInvSlope[j + 1]; activeInvSlope[j + 1] = tempnum; } } } var prevx:int = -1; var jlen:int = activeCurX.length; for (j = 0; j < jlen; j++) { if (prevx == -1) { prevx = activeCurX[j]; } else { for (var k:int = prevx; k < activeCurX[j]; k++) { graphics.lineStyle(2, 0x124132); graphics.drawCircle(k * 20 + 10, scanline * 20 + 10, 5); if (k == prevx || k > activeCurX[j] - 1) { graphics.lineStyle(3, 0x004132); graphics.drawCircle(k * 20 + 10, scanline * 20 + 10, 2); } prevx = -1; //tileLightList.push(k, scanline); } } } ilen = activeCurX.length; for (i = 0; i < ilen; i++) { if (activeMaxY[i] == scanline + 1) { activeCurX.splice(i, 1); activeMaxY.splice(i, 1); activeInvSlope.splice(i, 1); i--; ilen--; } else { activeCurX[i] += activeInvSlope[i]; } } } It works in some cases but some of the x intersections are skipped, primarily when there are more than 2 x intersections in one scanline I think. Is there a way to fix this, or a better way to do what I described? Thanks

    Read the article

  • war Ant task with needxmlfile="false" still complains

    - by Menelaos Perdikeas
    I have the following war task in my build.xml and even though needxmlfile is set to false, Ant (version 1.8.2) complains when the web.xml file does not exist ("BUILD FAILED ... Deployment descriptor: /home/.../web/WEB-INF/web.xml does not exist") What am I missing? <target name="war" depends="build"> <mkdir dir="${build.dir}"/> <war needxmlfile="false" basedir="${webroot.dir}" warfile="${build.dir}/${project.distname}.war" webxml="${webinf.dir}/web.xml"> <exclude name="WEB-INF/${build.dir}/**"/> <exclude name="WEB-INF/src/**"/> <exclude name="WEB-INF/web.xml"/> </war> </target>

    Read the article

  • Better way to set unix permissions when deploying war file

    - by Chris G
    We have a vendor application where we download their updates and deploy a war file. We are deploying the war file on a unix application server running oracle application server 9i. I believe when we deploy the war file, we remove the previous install and then deploy the new war file. When we deploy the war file, sometimes we have to manually set the unix file permissions for the class and other files. We do this so all the unix user ids can run the processes they need. Is there a better way to do this?

    Read the article

  • Corrupted .WAR file after transfer from 32-64 bit Windows Server to Desktop or vice versa

    - by Albert Widjaja
    Hi All, Does anyone experience this problem of corrupted .WAR file after it has been copied over the network share ? this is .WAR file (Web Archive) the J2EE application file (.WAR file is compressed with the same zip algorithm i think ?) Scenario 1: Windows Server 2008 x64 transfer into Windows XP using RDP client (Local Devices and Resources) Scenario 2: Windows XP 32 bit transfer into Windows Server 2003 x64 using shared network drive (port 445 SMB ?) for both of the scenario it always failed / corrupted (the source code seems to be duplicated at the end of line when you open up in the Eclipse / Java IDE). but when in both scenario i compressed the file into .ZIP file everything is OK. can anyone explains why this problem happens ? Thanks, Albert

    Read the article

  • Update a war on Tomcat start up

    - by pater
    I want to setup an update process for an application running on Tomcat. The server which hosts tomcat is only open during working hours (it is an intraner application for a small company). I was thinking that I could upload the new war to the server and set up "something" to run on the next server boot. This something could be a bat file that will be executed on server start up but before the start up of the Tomcat service and it will delete the old war and its exploded folder. When I update manually the war I also delete the work folder of Tomcat (just to be sure). I know about hot deployment but I do not consider it an option since I am not very sure for the implications it might have on the users current working sessions. Is there a way to run such a bat file before Tomcat start up or an alternative way to do this update? Tomcat version isn't an issue. Now is running Tomcat 6 but I can upgrade to version 7 if needed.

    Read the article

  • Confusion about maven-war-plugin and jetty-maven-plugin

    - by waxwing
    I am trying to get the run-exploded goal of the jetty-maven-plugin to work correctly. I find the documentation somewhat lacking on what I need to do to set this up. I believe I have a standard WAR-file setup. (The reason I wrote "believe" is that I find the maven-war-plugin documentation lacking as well.) When I build my webapp using maven package, I get the following in my target folder: classes maven-archiver surefire-reports test-classes tmp mywebapp-version mywebapp-version.war where mywebapp-version is the exploded war and mywebapp-version.war is the packaged one. So far so good (I think?). Now, running mvn jetty:run-exploded, it seems the default deploy folder is target/tmp/webapp/mywebapp-version.war/. This folder exists, but contains no files except for a webapp-cache.xml. This seems wrong to me. I also tried to actively set the webApp configuration element to ${project.build.directory}/mywebapp-version/, but run-exploded seems to ignore it (despite the documentation stating otherwise). What am I doing wrong? It looks as if I am missing something simple since no one else appears to be running into the same problem.

    Read the article

  • Python vs. Perl in ten years time

    - by Richard
    If you were starting learning a new language today, for scripting and doing "various stuff" with it (from making useful programs to it being glue to several command line programs), would you go with Python or Perl (or some third option, although the battle usually comes to these two)? I've never much used dynamic languages at all, having been able to do everything I needed in traditional static ones. Did some scripting in Perl a couple of years ago, but that was more of a momentary fling, than an attempt to learn it well. Now I've some free time, and have decided to go along with one of these two, and play a little with them. I like Perl's syntax, but Python does seem to be taking rather big steps on overtaking that area. What do you think, which one is more worth learning and why? Also, what do you think, what will be Python's future in about 10 years ... will it overtake Perl and other scripting languages's as a dominant tool for that kind of work (I more often than not find it being implemented in various applications I'm using - for internal scripting and automating loading of data and similar operations), or will it find a balance and coexist along others (Perl)? What is its current "momentum" - does it comes by default with Linux distributions, as Perl does, or does it needs to be installed separately every time? Is it a language which can be expected "to just be there"?

    Read the article

  • Advice for creating fog of war on tilemap game XNA

    - by Sigh-AniDe
    I have created a 2D Tile Based game. The game has a single path that the sprite can move on. I want to create to make the entire screen black except for where the sprite is. The sprite has commands such as left where he keeps looking left, right where he keeps looking right and move forward where he moves in the direction he is looking. I want to make it such that when he looks left then the tile on the left of the sprites fog should be removed and so on for all the sides. What is the best way to do this? Is there any tutorials that you guys know of that i can take a look at? Thanks

    Read the article

  • The Patent War of All Against All

    <b>Brendan Scott&#8217;s Weblog:</b> "Glyn notes that the software is being licensed under a BSD licence and notes that is a good thing, but then observes that there is a patent encumbrance on the code, and indicates this is a bad thing."

    Read the article

  • How do you use blank lines in your code ?

    - by Matthieu M.
    There has been a few remarks about white space already in discussion about curly braces placements. I myself tend to sprinkle my code with blank lines in an attempt to segregate things that go together in "logical" groups and hopefully make it easier for the next person to come by to read the code I just produced. In fact, I would say I structure my code like I write: I make paragraphs, no longer than a few lines (definitely shorter than 10), and try to make each paragraph self-contained. For example: in a class, I will group methods that go together, while separating them by a blank line from the next group. if I need to write a comment I'll usually put a blank line before the comment in a method, I make one paragraph per step of the process All in all, I rarely have more than 4/5 lines clustered together, meaning a very sparse code. I don't consider all this white space a waste because I actually use it to structure the code (as I use the indentation in fact), and therefore I feel it worth the screen estate it takes. For example: for (int i = 0; i < 10; ++i) { if (i % 3 == 0) continue; array[i] += 2; } I consider than the two statements have clear distinct purposes and thus deserve to be separated to make it obvious. So, how do you actually use (or not) blank lines in code ?

    Read the article

  • Why do you hate Java? Is it the language or the framework? [closed]

    - by zneak
    According to you all, Java is the third most-hated language here. The two other most hated languages are PHP and VBScript. (It's quite funny how they stand together on the podium.) I'd like to make it known that the question mostly addresses people who don't like Java. I assume here a number of subjective opinions as facts because they're usually considered true among people who don't like Java, and I don't want to be convinced otherwise here. If you're a Java enthusiast, you might find this question frustrating. It's never been made clear if people hate Java itself, or if they hate it because of the framework, or if it's a mixture of the two. On a side you have the language, where you have: the "everything should be an object" philosophy, even in instances where it should obviously be something else (event handlers I'm pointing you); checked exceptions; the idea that all logic should be presented as methods and properties is a big no-no; the fact that "closures" created by anonymous types only include final variables and arguments, but will allow write access to any member of the parent class; a few more. On the other side, you have the JDK, with... its load of inconsistencies and overengineering; monolithic class hierarchies; meaningless base exceptions like IOException (though other frameworks have similar exception hierarchies); sluggish responsiveness even with Swing; a few more. My question is, do you think that, if either one (Java or the JDK) was taken alone, and the other was dropped in favor of something else, the new combination would be better? For instance, if you could use the C# syntax with the JDK (adapting get*/set* methods into properties, and interfaces with only one method into delegates), or the Java syntax with the .NET Framework (doing the inverse transformations), would things get better in your opinion?

    Read the article

  • Curly braces on their own line or not?

    - by TomWij
    Should curly braces be on their own line or not? What do you think about it? if (you.hasAnswer()) { you.postAnswer(); } else { you.doSomething(); } or should it be if (you.hasAnswer()) { you.postAnswer(); } else { you.doSomething(); } or even if (you.hasAnswer()) you.postAnswer(); else you.doSomething(); Please be constructive! Explain why, share experiences, back it up with facts and references... ;-)

    Read the article

  • Code Style - Do you prefer to return from a function early or just use an IF statement?

    - by Rachel
    I've often written this sort of function in both formats, and I was wondering if one format is preferred over another, and why. public void SomeFunction(bool someCondition) { if (someCondition) { // Do Something } } or public void SomeFunction(bool someCondition) { if (!someCondition) return; // Do Something } I usually code with the first one since that is the way my brain works while coding, although I think I prefer the 2nd one since it takes care of any error handling right away and I find it easier to read

    Read the article

  • Replace single file on tomcat-deployed war

    - by xain
    Hi, I'd like to know how to configure tomcat 6 in order to be able to replace a file from a war - for instance an image or a jsp - so I don't need to restart the server to keep it updated. I assume I'll have to deploy it as a directory - not just copying the war file to webapp ? Thanks.

    Read the article

  • WouldISurviveANuke Assesses Your Distance From Nuclear War Strike Sites

    - by Jason Fitzpatrick
    WouldISurviveANuke is a morbid Google Maps mashup that plots out the effective radius of nuclear weapons on major metropolitan areas, your distance from them, and your chances of survival. Visit the site, plug in your zipcode, and set the parameters (how big of a nuclear weapon and how large the nearest target city needs to be) to find out if you’re in the blast radius. We plugged in a downtown address in Detroit, MI. The verdict? Neither we nor the cockroaches will be coming out alive. If you plug in a location far enough away from the direct blast radius you’ll also get a quality of life report that spells out the effects of a local nuclear strike. As far as startling anti-nuclear proliferation arguments go, WouldISurviveANuke is an effective and interactive demonstration. Hit up the link below to try it out. WouldISurviveANuke [via Y! Tech] How to Run Android Apps on Your Desktop the Easy Way HTG Explains: Do You Really Need to Defrag Your PC? Use Amazon’s Barcode Scanner to Easily Buy Anything from Your Phone

    Read the article

  • Is it a bad idea to list every function/method argument on a new line and why?

    - by dgnball
    I work with someone who, every time they call a function they put the arguments on a new line e.g. aFunction( byte1, short1, int1, int2, int3, int4, int5 ) ; I find this very annoying as it means the code isn't very compact, so I have to scan up and down more to actually make any sense of the logic. I'm interested to know whether this is actually bad practice and if so, how can I persuade them not to do it?

    Read the article

  • Microsoft Access as a Weapon of War

    - by Damon Armstrong
    A while ago (probably a decade ago, actually) I saw a report on a tracking system maintained by a U.S. Army artillery control unit.  This system was capable of maintaining a bearing on various units in the field to help avoid friendly fire.  I consider the U.S. Army to be the most technologically advanced fighting force on Earth, but to my terror I saw something on the title bar of an application displayed on a laptop behind one of the soldiers they were interviewing: Tracking.mdb Oh yes.  Microsoft Office Suite had made it onto the battlefield.  My hope is that it was just running as a front-end for a more proficient database (no offense Access people), or that the soldier was tracking something else like KP duty or fantasy football scores.  But I could also see the corporate equivalent of a pointy-haired boss walking into a cube and asking someone who had piddled with Access to build a database for HR forms.  Except this pointy-haired boss would have been a general, the cube would have been a tank, and the HR forms would have been targets that, if something went amiss, would have been hit by a 500lb artillery round. Hope that solider could write a good query

    Read the article

  • Microsoft Access as a Weapon of War

    - by Damon
    A while ago (probably a decade ago, actually) I saw a report on a tracking system maintained by a U.S. Army artillery control unit.  This system was capable of maintaining a bearing on various units in the field to help avoid friendly fire.  I consider the U.S. Army to be the most technologically advanced fighting force on Earth, but to my terror I saw something on the title bar of an application displayed on a laptop behind one of the soldiers they were interviewing: Tracking.mdb Oh yes.  Microsoft Office Suite had made it onto the battlefield.  My hope is that it was just running as a front-end for a more proficient database (no offense Access people), or that the soldier was tracking something else like KP duty or fantasy football scores.  But I could also see the corporate equivalent of a pointy-haired boss walking into a cube and asking someone who had piddled with Access to build a database for HR forms.  Except this pointy-haired boss would have been a general, the cube would have been a tank, and the HR forms would have been targets that, if something went amiss, would have been hit by a 500lb artillery round. Hope that solider could write a good query :)

    Read the article

  • Microsoft Access as a Weapon of War

    - by Damon
    A while ago (probably a decade ago, actually) I saw a report on a tracking system maintained by a U.S. Army artillery control unit.  This system was capable of maintaining a bearing on various units in the field to help avoid friendly fire.  I consider the U.S. Army to be the most technologically advanced fighting force on Earth, but to my terror I saw something on the title bar of an application displayed on a laptop behind one of the soldiers they were interviewing: Tracking.mdb Oh yes.  Microsoft Office Suite had made it onto the battlefield.  My hope is that it was just running as a front-end for a more proficient database (no offense Access people), or that the soldier was tracking something else like KP duty or fantasy football scores.  But I could also see the corporate equivalent of a pointy-haired boss walking into a cube and asking someone who had piddled with Access to build a database for HR forms.  Except this pointy-haired boss would have been a general, the cube would have been a tank, and the HR forms would have been targets that, if something went amiss, would have been hit by a 500lb artillery round. Hope that solider could write a good query :)

    Read the article

  • Office lights on or off in programming department? How to decide? [closed]

    - by smp7d
    At my company, the programmers who sit in the same area are constantly fighting over whether the lights stay on or off. Because there is no official policy it makes it a particularly sticky situation. We are a typical cube-farm and we have those typical cube-farm fluorescent lights and smaller ones at our desks. With the lights off, it is difficult to read and you would probably need to turn on your desk light (which some people do anyway). All programmers in our department do most of their reading on their monitor because of the nature of our business. Some feel that we should have a vote to decide whether the lights stay on or off. A couple who prefer 'lights on' feel that the vote would need to be unanimous to turn them off as having them on is the more natural office setting. Those who want them off point out that all other departments keep their lights off. I have heard all of the arguments: -Fluorescent lights cause eye strain -Reading in dark causes eye strain -The desk lights can be used if light is needed -People from other departments feel uncomfortable approaching us in the "dark" -The monitors are harder to see in the light ... Right now, some of the developers turn off the lights and some turn them on. It really just depends who last walked by the switch. I am a bit sick of the controversy as it feels a bit childish at the moment. I'm tired of hearing about it and I'm tired of having to talk about it. I tried to help them decide but as I explained, voting wasn't enough. Do other programming departments have this same argument? What is the standard or traditionally accepted option in a programming area? Are there any good reasons for one way or the other outside of preference? How can we decide fairly? EDIT Just a little more info... We do not have clients/visitors come into our office. We do have windows and hall lights that make our environment plenty bearable with the lights off. It kind of resembles a meeting room that has the lights off during a powerpoint presentation.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >