Search Results

Search found 204 results on 9 pages for 'sarah vessels'.

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

  • javascript robot

    - by sarah
    hey guys! I need help making this robot game in javascript (notepad++) please HELP! I'm really confused by the functions <html> <head><title>Robot Invasion 2199</title></head> <body style="text-align:center" onload="newGame();"> <h2>Robot Invasion 2199</h2> <div style="text-align:center; background:white; margin-right: auto; margin-left:auto;"> <div style=""> <div style="width: auto; border:solid thin red; text-align:center; margin:10px auto 10px auto; padding:1ex 0ex;font-family: monospace" id="scene"></pre> </div> <div><span id="status"></span></div> <form style="text-align:center"> PUT THE CONTROL PANEL HERE!!! </form> </div> <script type="text/javascript"> // GENERAL SUGGESTIONS ABOUT WRITING THIS PROGRAM: // You should test your program before you've finished writing all of the // functions. The newGame, startLevel, and update functions should be your // first priority since they're all involved in displaying the initial state // of the game board. // // Next, work on putting together the control panel for the game so that you // can begin to interact with it. Your next goal should be to get the move // function working so that everything else can be testable. Note that all nine // of the movement buttons (including the pass button) should call the move // function when they are clicked, just with different parameters. // // All the remaining functions can be completed in pretty much any order, and // you'll see the game gradually improve as you write the functions. // // Just remember to keep your cool when writing this program. There are a // bunch of functions to write, but as long as you stay focused on the function // you're writing, each individual part is not that hard. // These variables specify the number of rows and columns in the game board. // Use these variables instead of hard coding the number of rows and columns // in your loops, etc. // i.e. Write: // for(i = 0; i < NUM_ROWS; i++) ... // not: // for(i = 0; i < 15; i++) ... var NUM_ROWS = 15; var NUM_COLS = 25; // Scene is arguably the most important variable in this whole program. It // should be set up as a two-dimensional array (with NUM_ROWS rows and // NUM_COLS columns). This represents the game board, with the scene[i][j] // representing what's in row i, column j. In particular, the entries should // be: // // "." for empty space // "R" for a robot // "S" for a scrap pile // "H" for the hero var scene; // These variables represent the row and column of the hero's location, // respectively. These are more of a conveniece so you don't have to search // for the "H" in the scene array when you need to know where the hero is. var heroRow; var heroCol; // These variables keep track of various aspects of the gameplay. // score is just the number of robots destroyed. // screwdrivers is the number of sonic screwdriver charges left. // fastTeleports is the number of fast teleports remaining. // level is the current level number. // Be sure to reset all of these when a new game starts, and update them at the // appropriate times. var score; var screwdrivers; var fastTeleports; var level; // This function should use a sonic screwdriver if there are still charges // left. The sonic screwdriver turns any robot that is in one of the eight // squares immediately adjacent to the hero into scrap. If there are no charges // left, then this function should instead pop up a dialog box with the message // "Out of sonic screwdrivers!". As with any function that alters the game's // state, this function should call the update function when it has finished. // // Your "Sonic Screwdriver" button should call this function directly. function screwdriver() { // WRITE THIS FUNCTION } // This function should move the hero to a randomly selected location if there // are still fast teleports left. This function MUST NOT move the hero on to // a square that is already occupied by a robot or a scrap pile, although it // can move the hero next to a robot. The number of fast teleports should also // be decreased by one. If there are no fast teleports left, this function // should just pop up a message box saying so. As with any function that alters // the game's state, this function should call the update function when it has // finished. // // HINT: Have a loop that keeps trying random spots until a valid one is found. // HINT: Use the validPosition function to tell if a spot is valid // // Your "Fast Teleport" button s

    Read the article

  • select and jstl query

    - by sarah
    Hi All, I am displaying data in combo box using ${role} the requirement is on clcik of edit i want to show the preselected value in the drop down ,suppose i have cat,rat and i selected rat and i saved it in database ,now when i want to edit the details i want to show rat first in drop down as pre selected and then cat,how to od this ?

    Read the article

  • Help with infrequent segmentation fault in accessing boost::unordered_multimap or struct

    - by Sarah
    I'm having trouble debugging a segmentation fault. I'd appreciate tips on how to go about narrowing in on the problem. The error appears when an iterator tries to access an element of a struct Infection, defined as: struct Infection { public: explicit Infection( double it, double rt ) : infT( it ), recT( rt ) {} double infT; // infection start time double recT; // scheduled recovery time }; These structs are kept in a special structure, InfectionMap: typedef boost::unordered_multimap< int, Infection > InfectionMap; Every member of class Host has an InfectionMap carriage. Recovery times and associated host identifiers are kept in a priority queue. When a scheduled recovery event arises in the simulation for a particular strain s in a particular host, the program searches through carriage of that host to find the Infection whose recT matches the recovery time (double recoverTime). (For reasons that aren't worth going into, it's not as expedient for me to use recT as the key to InfectionMap; the strain s is more useful, and coinfections with the same strain are possible.) assert( carriage.size() > 0 ); pair<InfectionMap::iterator,InfectionMap::iterator> ret = carriage.equal_range( s ); InfectionMap::iterator it; for ( it = ret.first; it != ret.second; it++ ) { if ( ((*it).second).recT == recoverTime ) { // produces seg fault carriage.erase( it ); } } I get a "Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address..." on the line specified above. The recoverTime is fine, and the assert(...) in the code is not tripped. As I said, this seg fault appears 'randomly' after thousands of successful recovery events. How would you go about figuring out what's going on? I'd love ideas about what could be wrong and how I can further investigate the problem. Update I added a new assert and a check just inside the for loop: assert( carriage.size() > 0 ); assert( carriage.count( s ) > 0 ); pair<InfectionMap::iterator,InfectionMap::iterator> ret = carriage.equal_range( s ); InfectionMap::iterator it; cout << "carriage.count(" << s << ")=" << carriage.count(s) << endl; for ( it = ret.first; it != ret.second; it++ ) { cout << "(*it).first=" << (*it).first << endl; // error here if ( ((*it).second).recT == recoverTime ) { carriage.erase( it ); } } The EXC_BAD_ACCESS error now appears at the (*it).first call, again after many thousands of successful recoveries. Can anyone give me tips on how to figure out how this problem arises? I'm trying to use gdb. Frame 0 from the backtrace reads "#0 0x0000000100001d50 in Host::recover (this=0x100530d80, s=0, recoverTime=635.91148029170529) at Host.cpp:317" I'm not sure what useful information I can extract here. Update 2 I added a break; after the carriage.erase(it). This works, but I have no idea why (e.g., why it would remove the seg fault at (*it).first.

    Read the article

  • display tag query

    - by sarah
    I have code: <display:table name="sessionScope.allUserslist" id="userList" export="false" pagesize="1"> <display:column title="Select" style="width: 90px;"> <input type="checkbox" name="optionSelected" value="<c:out value='${userList.loginName}'/>"/> </display:column> <display:column property="loginName" sortable="false" title="UserName" paramId="loginName" style="width: 150px; text-align:center" href="./editUser.do?method=editUser"/> <display:column property="role" sortable="false" title="UserRole" paramId="role" style="width: 150px; text-align:center"/> </display:table> On click of login name, I am moving to a new page where I need to get all the of user, I am just getting the name not the role, on click of link I am calling an action where in the method I am trying to read the data from the form using User u=(User)form; u.getRole(); but it's null. Where am I going wrong ?

    Read the article

  • Securing WinForms Application suggestions

    - by Sarah Fordington
    I've been looking for a simple key/license system for our users. Its partly to stop piracy (avoid users from sharing the application around) and the other half to track the number of 'licensed users' we have. I have already read a few good suggestions on SO but I'm curious as to how people have implemented the 30 day evaluation criteria. Do you generate a key that stores the date somewhere and do a comparison each time or is it a little more complicated - deleting the file/removing the registry shouldn't deactivate. Are there any example implementations out there that can give me a head start? The irony is that our PM doesn't want to license a third-party system to do it for us. This is for a Windows Forms application.

    Read the article

  • HTML Frameset Query

    - by sarah
    Hi I have the following code for framset display <FRAMESET ROWS="18%,*" > <FRAME SRC="./views/Title_Page.html" NAME=TITLE SCROLLING=NO MARGINHEIGHT=1 noresize="noresize"> <FRAMESET COLS="20%,*"> <FRAME SRC="./views/Navigation_Page.jsp" NAME=SIDEBAR noresize="noresize" scrolling="no"> <FRAME SRC="./views/Welcome.html" NAME=MAIN noresize="noresize"> </FRAMESET> <NOFRAMES>NOFRAMES stuff </NOFRAMES> </FRAMESET> I want to add a logout link which logges out of the app ,when i add a link in Title_Page.html it logges out only that frame but not the others,how will handle it?i want to log out completly from all the frames

    Read the article

  • Change the colour of ablines on ggplot

    - by Sarah
    Using this data I am fitting a plot: p <- ggplot(dat, aes(x=log(Explan), y=Response)) + geom_point(aes(group=Area, colour=Area))+ geom_abline(slope=-0.062712, intercept=0.165886)+ geom_abline(slope= -0.052300, intercept=-0.038691)+ scale_x_continuous("log(Mass) (g)")+ theme(axis.title.y=element_text(size=rel(1.2),vjust=0.2), axis.title.x=element_text(size=rel(1.2),vjust=0.2), axis.text.x=element_text(size=rel(1.3)), axis.text.y=element_text(size=rel(1.3)), text = element_text(size=13)) + scale_colour_brewer(palette="Set1") The two ablines represent the phylogenetically adjusted relationships for each Area trend. I am wondering, is it possible to get the ablines in the same colour palette as their appropriate area data? The first specified is for Area A, the second for Area B. I used: g <- ggplot_build(p) to find out that the first colour is #E41A1C and the second is #377EB8, however when I try to use aes within the +geom_abline command to specify these colours i.e. p <- ggplot(dat, aes(x=log(Explan), y=Response)) + geom_point(aes(group=Area, colour=Area))+ geom_abline(slope=-0.062712, intercept=0.165886,aes(colour='#E41A1C'))+ geom_abline(slope= -0.052300, intercept=-0.038691,aes(colour=#377EB8))+ scale_x_continuous("log(Mass) (g)")+ theme(axis.title.y=element_text(size=rel(1.2),vjust=0.2), axis.title.x=element_text(size=rel(1.2),vjust=0.2), axis.text.x=element_text(size=rel(1.3)), axis.text.y=element_text(size=rel(1.3)), text = element_text(size=13)) + scale_colour_brewer(palette="Set1") It changes the colour of the points and adds to the legend, which I don't want to do. Any advice would be much appreciated!

    Read the article

  • HIbernate query

    - by sarah
    Hi I want to execute a query using hibernate where the requirment is like select * from user where regionname='' that is select all the users from user where region name is some data How to write this in hibernate The below code is giving result appropraitely Criteria crit= HibernateUtil.getSession().createCriteria(User.class); crit.add(Restrictions.eq("regionName", regionName));

    Read the article

  • javascript server issue

    - by sarah
    Onchage of selection i am calling a javascript to make a server call using struts1.2 but its not making a call.Please let me know where i am going wrong,below is the code <html:form action="/populate"> <html:select property="tName" onchange="test()">"> <html:option value="">SELECT</html:option> <html:options name="tList" /> </html:select> </html:form> and stuts-config has <action path="/populate" name="tForm" type="com.testAction" validate="false" parameter="method" scope="request" > <forward name="success" path="/failure.jsp" /> </action> and javascript is function test(){ var selObj = document.getElementById("tName"); var selIndex = selObj.selectedIndex; if (selIndex != 0) { document.form[0].selIndex.action="/populate.do?method=execute&testing="+selIndex; document.form[0].submit(); } }

    Read the article

  • html:checkbox query

    - by sarah
    Hi All, i have the following code . and in Form is have property called isActive of type char ,how would i get the checked value of it ,i am getting some symbols like 'o' if checked. I am using userform.getIsActive() ,where i am going wrong .I want 'y' or 'n' values

    Read the article

  • dynamic drop down

    - by sarah
    Hi, i want to display a drop down dynamically that is the values should be from database,i have the list holding the values,how would i use it now ?

    Read the article

  • request payload versus query string parameters

    - by Sarah Sides
    I am absolutely in the dark when it comes to this request payload that I'm seeing in my Chrome browser. A Query string will have a variable attached like session:2g0SoEE but this payload has just one long string I'm guessing is in base64. I do understand that the request payload can have whatever, but how do I use it? Can I do a post with jquery and send this request payload? For example: $.post(url, {variable: "variable"}, function(data){}); When this posts it will send &variable=variable this will be found as query string parameter in the headers sent in chrome. In this game I'm playing I see another piece of info being sending in the header called a payload request. I'm a confused as to how this is read, used, made, how I can reduplicate this? Here is something similar: Chrome is caching an HTTP PUT request and How to retrieve Request Payload

    Read the article

  • How to Detect in Windows Registry if user has .Net Framework installed?

    - by Sarah Weinberger
    How do I detect in the Windows Registry if a user has .Net Framework installed? I am not looking for a .Net based solution, as the query is from InnoSetup. I know from reading another post here on Stack Overflow that .Net Framework is an inplace upgrade to 4.0. I already know how to check if a user has version 4.0 installed on the system, namely by checking the following: function FindFramework(): Boolean; var bVer4x0: Boolean; bVer4x0Client: Boolean; bVer4x0Full: Boolean; bSuccess: Boolean; iInstalled: Cardinal; begin Result := False; bVer4x0Client := False; bVer4x0Full := False; bVer4x0 := RegKeyExists(HKLM, 'SOFTWARE\Microsoft\.NETFramework\policy\v4.0'); bSuccess := RegQueryDWordValue(HKLM, 'Software\Microsoft\NET Framework Setup\NDP\v4 \Client', 'Install', iInstalled); if (1 = iInstalled) AND (True = bSuccess) then bVer4x0Client := True; bSuccess := RegQueryDWordValue(HKLM, 'Software\Microsoft\NET Framework Setup\NDP\v4 \Full', 'Install', iInstalled); if (1 = iInstalled) AND (True = bSuccess) then bVer4x0Full := True; if (True = bVer4x0Full) then begin Result := True; end; end; I checked the registry and there is no v4.5 folder, which makes sense if .Net Framework 4.5 is an inplace upgrade. Still, the Control Panel Programs and Features includes the listing. I know that probably "issuing dotNetFx45_Full_setup.exe /q" will have no bad effect if installing on a system that already has version 4.5, but I still would like to not install the upgrade if the upgrade already exists, faster and less problems.

    Read the article

  • sql query not executing

    - by sarah
    Hi, Not able to execute a query ,i need to check if end date is greater than today in the following query Getting an error invalid query select * from table1 where user in ('a') and END_DATE >'2010-05-22' getting an error liter string does not match

    Read the article

  • how to deal with pdf annotation with ipad in objective c?

    - by Sarah
    Hello, I know that it may sound a silly question but i am really very confused. I am to work with one application that is having operations like PDF loading,annotation, scrolling,zooming and other such functions. Now my question is that i am little bit confused about what template i should use as i went through Quartz 2D Programming Guide and was little bit confused whether i'll be able to apply the above shown functions with the same guideline,as it displays the pdf page on the whole screen. Or is there any other way around? Please help me..Can i use UIWebView for the same functions as i listed above? I ll be grateful if you can help me. Thank you.

    Read the article

  • How to prevent hotlinking of flv files?

    - by Sarah
    How to, using PHP and/or .htaccess prevent hotlinking? There's a site, which is allowed to access the flv files located on my server, however I've noticed that there are many requests from other domains as well... Here's the actual rule: RewriteCond %{HTTP_REFERER} !^http://alloweddomain.com/.*$ [NC] RewriteRule .flv denied.php [NC,L] It's working OK except for Firefox, because FF is not sending referrer info when accessing .flv files...

    Read the article

  • handling multiple buttons in a form in struts

    - by sarah
    Hi All, I am facing an issue while handling multiple buttons in a form using struts. I have three buttons add,delete and go .I have made forward as hidden and on click of a button i would get the name of the button. The problem is with go button on click of that i want to call a javascript and then call the action and return to the same page .

    Read the article

  • Coordinating typedefs and structs in std::multiset (C++)

    - by Sarah
    I'm not a professional programmer, so please don't hesitate to state the obvious. My goal is to use a std::multiset container (typedef EventMultiSet) called currentEvents to organize a list of structs, of type Event, and to have members of class Host occasionally add new Event structs to currentEvents. The structs are supposed to be sorted by one of their members, time. I am not sure how much of what I am trying to do is legal; the g++ compiler reports (in "Host.h") "error: 'EventMultiSet' has not been declared." Here's what I'm doing: // Event.h struct Event { public: bool operator < ( const Event & rhs ) const { return ( time < rhs.time ); } double time; int eventID; int hostID; }; // Host.h ... void calcLifeHist( double, EventMultiSet * ); // produces compiler error ... void addEvent( double, int, int, EventMultiSet * ); // produces compiler error // Host.cpp #include "Event.h" ... // main.cpp #include "Event.h" ... typedef std::multiset< Event, std::less< Event > > EventMultiSet; EventMultiSet currentEvents; EventMultiSet * cePtr = &currentEvents; ... Major questions Where should I include the EventMultiSet typedef? Are my EventMultiSet pointers obviously problematic? Is the compare function within my Event struct (in theory) okay? Thank you very much in advance.

    Read the article

  • Getting a PasteScript error when I try to serve an existing Pylons app.

    - by Sarah
    I'm trying to serve an existing Python 2.5 Pylons application on OS X Snow Leopard. I've already installed Python 2.5 and set it as the default Python installation, installed paster, and installed the version of Pylons the app needs (0.9.6.1) as well as other eggs... but when I cd to the main folder and do "paster serve development.ini" I get the following: File "/usr/local/bin/paster", line 5, in <module> from pkg_resources import load_entry_point File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/pkg_resources.py", line 2603, in <module> File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/pkg_resources.py", line 666, in require File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/pkg_resources.py", line 565, in resolve pkg_resources.DistributionNotFound: PasteScript==1.7.3 I definitely have done "easy_install PasteScript==1.7.3" and I still get this error. Is there something really obvious I'm missing? Help? Thanks in advance.

    Read the article

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