Search Results

Search found 1052 results on 43 pages for 'luke van diest'.

Page 23/43 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • How do I get the next token in a Cstring if I want to use it as an int? (c++)

    - by Van
    My objective is to take directions from a user and eventually a text file to move a robot. The catch is that I must use Cstrings(such as char word[];) rather than the std::string and tokenize them for use. the code looks like this: void Navigator::manualDrive() { char uinput[1]; char delim[] = " "; char *token; cout << "Enter your directions below: \n"; cin.ignore(); cin.getline (uinput, 256); token=strtok(uinput, delim); if(token == "forward") { int inches; inches=token+1; travel(inches); } } I've never used Cstrings I've never tokenized anything before, and I don't know how to write this. Our T.A.'s expect us to google and find all the answers because they are aware we've never been taught these methods. Everyone in my lab is having much more trouble than usual. I don't know the code to write but I know what I want my program to do. I want it to execute like this: 1) Ask for directions. 2) cin.getline the users input 3) tokenize the inputed string 4) if the first word token == "forward" move to the next token and find out how many inches to move forward then move forward 5) else if the first token == "turn" move to the next token. if the next token == "left" move to the next token and find out how many degrees to turn left I will have to do this for forward x, backward x, turn left x, turn right x, and stop(where x is in inches or degrees). I already wrote functions that tell the robot how to move forward an inch and turn in degrees. I just need to know how to convert the inputted strings to all lowercase letters and move from token to token and convert or extract the numbers from the string to use them as integers. If all is not clear you can read my lab write up at this link: http://www.cs.utk.edu/~cs102/robot_labs/Lab9.html If anything is unclear please let me know, and I will clarify as best I can.

    Read the article

  • How to use group by and having count in Linq

    - by Luke
    I am having trouble trying to convert the following query from SQL to Linq, in particular with the having count and group by parts of the query: select ProjectID from ProjectAssociation where TeamID in ( select TeamID from [User] where UserID in (4)) group by ProjectID having COUNT(TeamID) = (select distinct COUNT(TeamID) from [User] where UserID in (4)) Any advice on how to do so would be much appreciated.

    Read the article

  • How can you remove a field from a word document?

    - by Kevin van Zanten
    Dear reader, I'm working on a project where the user can insert data into a document using fields, document properties and variables. The user also needs to be able to remove the data from the document. So far, I've managed to remove the document property and variable, but I'm not sure how I would go about removing the field (that's already inserted into the document). Please advise. Yours sincerely, Kevin

    Read the article

  • XSS as attack vector even if XSS data not stored?

    - by Klaas van Schelven
    I have a question about XSS Can forms be used as a vector for XSS even if the data is not stored in the database and used at a later point? i.e. in php the code would be this: <form input="text" value="<?= @$_POST['my_field'] ?>" name='my_field'> Showing an alert box (demonstrate that JS can be run) on your own browser is trivial with the code above. But is this exploitable across browsers as well? The only scenario I see is where you trick someone into visiting a certain page, i.e. a combination of CSRF and XSS. "Stored in a database and used at a later point": the scenario I understand about CSS is where you're able to post data to a site that runs JavaScript and is shown on a page in a browser that has greater/different privileges than your own. But, to be clear, this is not wat I'm talking about above.

    Read the article

  • Get coordinates in parent, but not in stage.

    - by Bart van Heukelom
    I know about Flash's localToGlobal and globalToLocal methods to transform coordinates from the local system to the global system, but is there a way to achieve the intermediate? To transform coordinates from an arbitrary system to any other arbitrary system? I have a clickable object inside a Sprite, and the Sprite is a child of the stage. I want to retrieve the clicked point in the Sprite.

    Read the article

  • How do you deal with the conflict between ActiveSupport::JSON and the JSON gem?

    - by Luke Francl
    I am stumped with this problem. ActiveSupport::JSON defines to_json on various core objects and so does the JSON gem. However, the implementation is not the same -- the ActiveSupport version takes arguments and the JSON gem version doesn't. I installed a gem that required the JSON gem and my app broke. The issue is that I'm using to_json in a controller that returns a list of objects, but I want to control which attributes are returned. When code anywhere in my system does require 'json' I get this error message: TypeError: wrong argument type Hash (expected Data) I tried a couple of things that I read online to fix it, but nothing worked. I ended up re-writing the gem to use ActiveSupport::JSON.decode instead of JSON.parse. This works but it's not sustainable...I can't be forking gems every time I want to use a gem that requires the JSON gem. Update: The best solution of this problem is to upgrade to Rails 2.3 or higher, which fixed it.

    Read the article

  • Image appearing in the wrong place.

    - by Luke
    I have a list that I want to precede on each line with a small image. The CSS: .left div.arrow{background-image: url(../images/design/box.png); float:left; height:15px; width:15px; margin-right:2px;} .left a.list:link, a:visited, a:active {color:black; font-size:0.8em; text-decoration:none; display:block; float:left;} The HTML: <div class="panel">My quick links</div> <div class="arrow"></div> <a href="/messages.php?p=new" class="list">Send a new message</a> <br /> <div class="arrow"></div> <a href="/settings.php#password" class="list">Change my password</a> <br /> <div class="arrow"></div> <a href="/settings.php#picture" class="list">Upload a new site image</a> <br /> As you can see, each image should go before the writing. On the first line, the text "Send a new message" has the preceeding image. However, each line afterwards has the image at the end. So "Send a new message" has an image at the start and finish. It is like the images are staying at the end of the previous line. Any ideas?

    Read the article

  • css layout - break down

    - by Luke
    So I am trying to get the effect of having two frames inside a 750px wide frame. .news {width: 750px;} .news1 {width:550px;} .news2 {width:200px;} Very simple css at this stage. The html/php: <div class="news"> <div class="format"><a href='newspiece.php?news=<?echo $id?>'><?echo "$subject\n";?></a></div> <div class="news1"> <? echo "<div class='content'>"; echo nl2br($comment); echo "<a href='newspiece.php?news=$id'>..[read more]..</a>\n"; echo "</div>"; ?> <h5><? echo "Posted by <a href=\"userprofile.php?user=$posted\">$posted</a> on $final_date\n";?></h5> <? echo "<br />\n";?> </div> <div class="news2"> <img src="images/news/<? echo $id?>.jpg" /> </div> </div>] THe problem I am getting is that the image that should be on the right is going underneath. So in effect, news1 is above news2, rather than side by side. Any ideas?

    Read the article

  • Auto refresh when new user comes online

    - by Luke
    Hello. I have a table in the database which includes all active users. I then have a user list which needs refreshing to see who is the latest users online. Whats the best way to tackle this? The user list is always just who is in the active_users table. Thanks for reading.

    Read the article

  • Helping Kohana 3 ORM to speed up a little

    - by Luke
    I noticed that Kohana 3 ORM runs a "SHOW FULL COLUMNS" for each of my models when I start using them: SHOW FULL COLUMNS FROM `mytable` This query might take a few clock cycles to execute (in the Kohana profiler it's actually the slowest of all queries ran in my current app). Is there a way to help Kohana 3 ORM to speed up by disabling this behaviour and explicitly define the columns in my models instead?

    Read the article

  • Using nodereference + views to create combined view

    - by Ian Silber
    I'm trying to set up a relational View but not sure how to do it. Here's an example of what I'm going for using the node types Artist and Song. Artist Song Length Bob Dylan Like a Rolling Stone 2:00 Bruce Springsteen Atlantic City 4:00 Burce Springsteen Born to Run 5:24 Van Morrison Domino 3:22 Van Morrison Brown Eyed Girl 4:30 Assuming I have an Artist node type that has a node reference to Song (set to unlimited) and a Song data type with an additional field for length, how would I go about configuring the view to output this view? Thanks! Ian

    Read the article

  • CALayer and Off-Screen Rendering

    - by Luke Mcneice
    I have a Paging UIScrollView with a contentSize large enough to hold a number of small UIScrollViews for zooming, The viewForZoomingInScrollView is a viewController that holds a CALayer for drawing a PDF page onto. This allows me to navigate through a PDF much like the ibooks PDF reader. The code that draws the PDF (Tiled Layers) is located in: - (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx; And simply adding a 'page' to the visible screen calls this method automatically. When I change page there is some delay before all the tiles are drawn, even though the object (page) has already been created. What i want to be able to do is render the next page before the user scrolls to it, thus preventing the visible tiling effect. However, i have found that if the layer is located offscreen adding it to the scrollview doesn't call the drawLayer. Any Ideas/common gotchas here? I have tried: [viewController.view.layer setNeedsLayout]; [viewController.view.layer setNeedsDisplay]; NB: The fact that this is replicating the ibooks functionally is irrelevant within the context of the full app.

    Read the article

  • How can I integrate Java with .Net?

    - by Luke
    I have one SDK that is available in Java and another SDK that is available for .Net and would like to write a single application that interfaces with both of them. I imagine I will need to use a cross platform communication framework that can support named pipes (or other in memory communication), what is the best choice? After some more research I found Hessian -- does anyone know anything about the maturity of this project?

    Read the article

  • Drop down dynamic

    - by Luke
    I have seen it but dont know how to achieve it. The idea is that I have a drop down menu and when something is selected, something else will appear. Is it AJAX? Any ideas?

    Read the article

  • How can I expose an Objective-C function to JavaScript using WebKit on Mac OS X?

    - by Luke
    I understand to do this on the iPhone you need to trap link requests (as per my other iPhone question UIWebView Expose JavaScript) and you can easily do the reverse and access JavaScript from Obj-C code. However, I would like to have JavaScript be able to call some Objective-C functions that would somehow be registered with WebKit. I assume that you can do this better than trapping links like on the iPhone as on Mac OS X we have access to the full WebKit. I wish to basically do the reverse of Using JavaScript from Objective-C

    Read the article

  • C# - UpdateResource - To Remove A Resource

    - by Luke
    I am able to successfully add a resource to a file using UpdateResource and then remove it using: UpdateResource(HANDLE, "TYPE", "NUMER", 1033, IntPtr.Zero, 0); When I add a resource to the file it will add another even though there is an existing resource exactly the same, also I cannot remove any existing resources. When I try to remove an existing resource using that line I get the error ERROR_INVALID_PARAMETER. Any ideas?

    Read the article

  • WPF, Setting property with single value on multiple subcontrols

    - by Andre van Heerwaarde
    I have a parent contentcontrol which displays data via a datatemplate. The datatemplate contains a stackpanel with several usercontols of the same type. I like to set the property only once on the parent control, it must set the value of the property on all the subcontrols. But if there is a way to do it on the stackpanel it's also OK. The template can be changed at runtime and the values need also to be propagated to the new template. My current solution is to implement the property on both parent and subcontrol and use code to propagate the value from the parent to all the subcontrols. My question is: is there a better or other ways of doing this?

    Read the article

  • Redirect in combination with a rewrite condition in htaccess

    - by Robbert van den Bogerd
    Hi all! I've got a cms-driven website, with no option to change the code. What I want to accomplish is creating friendly url's, using only apaches mod-rewrite engine. The problem is I'm creating an infinite loop, because I first redirect the original url (index.php?id=21) to a friendly one (/friendly/) and then rewrite the '/friendly' part back to 'id=21' I know there should be an extra condition or parameter to avoid looping in this case, but I can´t get one of the possible solutions to work. Here´s the code: RewriteCond %{query_string} ^id=21$ [NC] RewriteRule /* /peuterspeelzaal? [R=301,L] RewriteRule ^peuterspeelzaal$ index.php?id=21 [L]

    Read the article

  • sql inner join problem

    - by Luke
    The following SQL query isn't working. I think the error is on the first line. SELECT SUBSTRING(tbl_news.comment, 1, 250) as tbl_news.comment, tbl_news.id, tbl_news.date, tbl_news.subject, tbl_users.username FROM tbl_news INNER JOIN tbl_users ON tbl_news.creator = tbl_users.id ORDER BY date DESC

    Read the article

  • How to monitor delayed_job with monit

    - by Luke Francl
    Are there any examples on the web of how to monitor delayed_job with Monit? Everything I can find uses God, but I refuse to use God since long running processes in Ruby generally suck. (The most current post in the God mailing list? God Memory Usage Grows Steadily.) Update: delayed_job now comes with a sample monit config based on this question.

    Read the article

  • While loop problems

    - by Luke
    I have put together the following code, the problem is that each while loop is only returning one set of data. $result = mysql_query("SELECT date FROM ".TBL_FIXTURES." WHERE compname = '$comp_name' GROUP BY date"); $i = 1; echo "<table cellspacing=\"10\" style='border: 1px dotted' width=\"300\" bgcolor=\"#eeeeee\">"; while ($row = mysql_fetch_assoc($result)) { $date=date("F j Y", $row['date']); echo $date; echo " <tr> <td>Fixture $i - Deadline on $date</td> </tr> "; $result = mysql_query("SELECT * FROM ".TBL_FIXTURES." WHERE compname = '$comp_name' AND date = '$row[date]' ORDER BY date"); while ($row = mysql_fetch_assoc($result)) { extract ($row); echo " <tr> <td>$home_user - $home_team V $away_user - $away_team</td> </tr> "; } $i++; } echo "</table>"; I should get many dates, and then each set of fixture below. At the moment, the first row from the first while loop is present, along with the data from the second while loop. However, it doesn't continue? Any ideas where I can correct this? Thanks

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >