Search Results

Search found 709 results on 29 pages for 'aaron stewart'.

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

  • strcmp() but with 0-9 AFTER A-Z? (C/C++)

    - by Aaron
    For reasons I completely disagree with but "The Powers (of Anti-Usability) That Be" continue to decree despite my objections, I have a sorting routine which does basic strcmp() compares to sort by its name. It works great; it's hard to get that one wrong. However, at the 11th hour, it's been decided that entries which begin with a number should come AFTER entries which begin with a letter, contrary to the ASCII ordering. They cite the EBCDIC standard has numbers following letters so the prior assumption isn't a universal truth, and I have no power to win this argument... but I digress. Therein lies my problem. I've replaced all appropriate references to strcmp with a new function call nonstd_strcmp, and now need to implement the modifications to accomplish the sort change. I've used a FreeBSD source as my base: http://freebsd.active-venture.com/FreeBSD-srctree/newsrc/libkern/strncmp.c.html if (n == 0) return (0); do { if (*s1 != *s2++) return (*(const unsigned char *)s1 - *(const unsigned char *)(s2 - 1)); if (*s1++ == 0) break; } while (--n != 0); return (0); I guess I might need to take some time away to really think about how it should be done, but I'm sure I'm not the only one who's experienced the brain-deadness of just-before-release spec changes.

    Read the article

  • 3d / 2.5d game library for iphone and pc

    - by Aaron Qian
    I'm trying to make a 2d shooter game with 3d background. The player and enemies are essentially just quads with textures. The background will be simple 3d polygons with textures and some fog and light. Therefore, I don't need a really powerful 3d library. I tried Unity3D and Torque2D, but I don't like to use their GUI editors. I prefer to work with code. So, is there a cross platform (mainly windows and iPhone) 3d / 2.5d game library, commercial or open source? I assume it will be only limited to c, c++, and object-c due to apple's new ToS.

    Read the article

  • Java Inheritance - Getting a Parameter from Parent Class

    - by Aaron
    I'm trying to take one parameter from the parent class of Car and add it to my array (carsParked), how can i do this? Parent Class public class Car { protected String regNo; //Car registration number protected String owner; //Name of the owner protected String carColor; /** Creates a Car object * @param rNo - registration number * @param own - name of the owner **/ public Car (String rNo, String own, String carColour) { regNo = rNo; owner = own; carColor = carColour; } /** @return The car registration number **/ public String getRegNo() { return regNo; } /** @return A String representation of the car details **/ public String getAsString() { return "Car: " + regNo + "\nColor: " + carColor; } public String getColor() { return carColor; } } Child Class public class Carpark extends Car { private String location; // Location of the Car Park private int capacity; // Capacity of the Car Park - how many cars it can hold private int carsIn; // Number of cars currently in the Car Park private String[] carsParked; /** Constructor for Carparks * @param loc - the Location of the Carpark * @param cap - the Capacity of the Carpark */ public Carpark (String locations, int room) { location = locations; capacity = room; } /** Records entry of a car into the car park */ public void driveIn() { carsIn = carsIn + 1; } /** Records the departure of a car from the car park */ public void driveOut() { carsIn = carsIn - 1; } /** Returns a String representation of information about the carpark */ public String getAsString() { return location + "\nCapacity: " + capacity + " Currently parked: " + carsIn + "\n*************************\n"; } }

    Read the article

  • How should I cleanly track selected item in ASP.NET MVC?

    - by Aaron Anodide
    Is there a better way to track the selected item than how I do it in the code below which implements a row of navigation links. @Html.ActionLink( "PreApproval", "Summary", new { mode = "preapproval" }, new { @class = Model.Mode == "preapproval" ? "selected" : "notselected" }) | @Html.ActionLink( "ActionNeeded", "Summary", new { mode = (string)null }, new { @class = string.IsNullOrWhiteSpace(Model.Mode) ? "selected" : "notselected" }) | ... Should I try to encasulate the functionality of menu navigation or is this a standard approach?

    Read the article

  • Month to Date in SQL Server 2008

    - by Aaron Smith
    Hopefully this will be an easy one to answer. I am working on a table that requires MTD data. One of our SQL guys told me to use MONTH (@monthtodate)= 11 Where @monthtodate is set to GetDate() in the parameter list in SQL Server Management Studio. So in "theory", he says, it should select the month (11) and then get today and return all the requested data in between those two dates. But I'm thinking this isn't correct. In looking at my data I'm starting to think that It's just returning data for the whole month of November instead of just MTD. I guess, technically, anything that has 0 won't be calculated. However that just means it's poorly written code correct? In your opinions, would this be the better way to return MTD data: production_date <= @today and Production_Date >= DATEADD(mm, DATEDIFF(mm, 0, @today), 0) Thanks in advance everyone!

    Read the article

  • actionscript display timer

    - by Aaron
    ok so im using real basic code for a small game and ive got a timer set up on one room and cant get it to display in the endgame room please help? this is the code i used var gameStartTime:uint; var gameTime:uint; var gameTimeField:TextField; gameTimeField = new TextField(); gameTimeField.x = 900; gameTimeField.y = 50; addChild(gameTimeField); gameStartTime = getTimer(); gameTime = 0; addEventListener(Event.ENTER_FRAME,showTime); function showTime(event:Event) {gameTime = getTimer()-gameStartTime; gameTimeField.text = "Time: "+clockTime(gameTime); } function clockTime(ms:int) { var seconds:int = Math.floor(ms/100); var minutes:int = Math.floor(seconds/60); seconds -= minutes*60; var timeString:String = minutes+":"+String(seconds+100).substr(1,2); return timeString; }

    Read the article

  • How to op-en file and view in a rich text box using vb.net?

    - by Aaron Warnke
    Hi I am trying to open and view a files text in a rich text box. Here is what I have please let me know what I am doing wrong? Private Sub loadButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles loadButton.Click ' Displays an OpenFileDialog so the user can select a Cursor. Dim openFileDialog1 As New OpenFileDialog() openFileDialog1.Filter = "Cursor Files|*.txt" openFileDialog1.Title = "Select a Cursor File" If openFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then ' Assign the cursor in the Stream to the Form's Cursor property. Me.mainRTBox = New Text(openFileDialog1.OpenFile()) End If End Sub

    Read the article

  • How do you stop echo of multiple values with 'foreach' in PHP?

    - by Aaron EA
    How do you when using custom fields in Wordpress echo just the first value using foreach? Currently the code is: <?php for(get_field('venue_event') as $post_object): ?> <a href="<?php echo get_permalink($post_object); ?>"><?php echo get_the_title($post_object) ?></a> <?php endforeach; ?> This takes the field from the wordpress page (the field is a link to another page), creates a link to that page using get_permalink but when I want to echo the page title it does it, but then it also echos all other values that are not needed.

    Read the article

  • SEO for Computer Software Engineering Topics

    - by Michael Aaron Safyan
    I'm currently trying to SEO my development and coding search custom search engine as well my website that has a variety of coding and development resources. I would like to increase the number of links to my website, but I don't want to simply generate spam. What are some places that I should submit my website, where the content would be considered relevant rather than just spam? Thanks.

    Read the article

  • C++ include .h includes .cpp with same name as well?

    - by aaron
    so I have text.cpp, which 'includes' header.h, and then I have a header.cpp which includes header.h. How is header.cpp compiled as well? I'm walking through a guide here, and thoroughly confused. Also, what is the correct terminology for what I am asking? I know I sound like a moron, and I apologize, but I'm ignorant. Oh, main is in test.cpp. Also, if header.cpp includes , why can't I use iostream function calls in text.cpp if it is included? If I include iostream in text.cpp will it be included in the program twice (in other words, bloat it)?

    Read the article

  • PHP APC - Why is loading cached array op codes slow?

    - by Aaron Kreider
    I'm using APC to reduce my loading time for my PHP files. My files load very fast, except for one file where I define more than 100 arrays. This 270 kb file takes 200 ms to load. The rest of the files are full of objects, methods, and functions. I'm wondering: does OP code caching not work as well for arrays? My APC cache should be big enough to handle all of my classes. Currently 40% of my cache is free. My hit rate is 99%. apc.shm_size=32 M apc.max_file_size = 1M apc.shm_segments= 1 APC 3.1.6 I'm using PHP 5.2, Apache 2, and Windows Vista.

    Read the article

  • Scoping in embedded groovy scripts

    - by Aaron Digulla
    In my app, I use Groovy as a scripting language. To make things easier for my customers, I have a global scope where I define helper classes and constants. Currently, I need to run the script (which builds the global scope) every time a user script is executed: context = setupGroovy(); runScript( context, "global.groovy" ); // Can I avoid doing this step every time? runScript( context, "user.groovy" ); Is there a way to setup this global scope once and just tell the embedded script interpreter: "Look here if you can't find a variable"? That way, I could run the global script once. Note: Security is not an issue here but if you know a way to make sure the user can't modify the global scope, that's an additional plus.

    Read the article

  • Generic class for performing mass-parallel queries. Feedback?

    - by Aaron
    I don't understand why, but there appears to be no mechanism in the client library for performing many queries in parallel for Windows Azure Table Storage. I've created a template class that can be used to save considerable time, and you're welcome to use it however you wish. I would appreciate however, if you could pick it apart, and provide feedback on how to improve this class. public class AsyncDataQuery<T> where T: new() { public AsyncDataQuery(bool preserve_order) { m_preserve_order = preserve_order; this.Queries = new List<CloudTableQuery<T>>(1000); } public void AddQuery(IQueryable<T> query) { var data_query = (DataServiceQuery<T>)query; var uri = data_query.RequestUri; // required this.Queries.Add(new CloudTableQuery<T>(data_query)); } /// <summary> /// Blocking but still optimized. /// </summary> public List<T> Execute() { this.BeginAsync(); return this.EndAsync(); } public void BeginAsync() { if (m_preserve_order == true) { this.Items = new List<T>(Queries.Count); for (var i = 0; i < Queries.Count; i++) { this.Items.Add(new T()); } } else { this.Items = new List<T>(Queries.Count * 2); } m_wait = new ManualResetEvent(false); for (var i = 0; i < Queries.Count; i++) { var query = Queries[i]; query.BeginExecuteSegmented(callback, i); } } public List<T> EndAsync() { m_wait.WaitOne(); return this.Items; } private List<T> Items { get; set; } private List<CloudTableQuery<T>> Queries { get; set; } private bool m_preserve_order; private ManualResetEvent m_wait; private int m_completed = 0; private void callback(IAsyncResult ar) { int i = (int)ar.AsyncState; CloudTableQuery<T> query = Queries[i]; var response = query.EndExecuteSegmented(ar); if (m_preserve_order == true) { // preserve ordering only supports one result per query this.Items[i] = response.Results.First(); } else { // add any number of items this.Items.AddRange(response.Results); } if (response.HasMoreResults == true) { // more data to pull query.BeginExecuteSegmented(response.ContinuationToken, callback, i); return; } m_completed = Interlocked.Increment(ref m_completed); if (m_completed == Queries.Count) { m_wait.Set(); } } }

    Read the article

  • jQuery drag and drop behavior with partially transparent image

    - by Aaron
    I'm trying to develop a drag-and-drop behavior based on the jQuery UI draggable behavior but am running into some road blocks. I want to be able to drag several images with transparent regions around a region of the screen. I want the user to be able to drag the image he clicks and not just whatever draggable div or PNG happens to be z-indexed on top. The below image is a screen grab from my test page. If I click the lower left region of the blue square through the red thing I should drag the square and not the red thing. The red thing is what gets dragged though because it is on top and the browser does not care about the transparency. My question is, how can I make it behave as expected in this situation and drag the square instead? Edit: Seems I can't attach images as a new user. See this URL for my example image: http://i42.tinypic.com/r1g4sk.png

    Read the article

  • How do I use a batch copy to update files?

    - by Aaron
    Hello, I need help writing a batch file to update templates on a database. Basically, all our clients have their own folder, with multiple templates inside. Due to the computer illiteracy of my office (sigh), there's no real better way to fix this. However, I need a way to update those templates in a batch. For instance \\SERVER\New Client Template Folder\Correspondence\Transmittal Letter.WPD is updated. I then need to copy it to: \\SERVER\Client Files\Client 1\Correspondence; \\SERVER\Client Files\Client 2\Correspondence; ...etc. Essentially, I need to copy to \\SERVER\Client Files\\*\\, and I need to make it a batch file that I can train someone else to use whenever I leave this job. How can I do that? Thanks.

    Read the article

  • Clickonce Online Only Uninstall

    - by Aaron Bush
    Is there an established way to uninstall an application that was deployed via ClickOnce using the Online Only method? I found it's location buried deep in the %APPDATA% tree, but I want to make sure I back it out all the way without creating future problems when I reinstall it.

    Read the article

  • C++ for Ruby scripters

    - by Aaron Cohen
    I am a fairly capable Ruby scripter/programmer, but have been feeling pressure to branch out into C++. I haven't been able to find any sites along the lines of "C++ for Ruby Programmers". This site exists for Python (which is quite similar, I know). Does anyone know of a guide that can help me translate my Ruby 'thoughts' into C++?

    Read the article

  • ResXResourceWriter Chops off end of file

    - by Aaron Salazar
    I'm trying to create a .resx file from a dictionary of strings. Luckily the .Net framework has a ResXResourceWriter class. The only problem is that when I create the file using the code below, the last few lines of my generated resx file are missing. I checked my Dictionary and it contains all the string pairs that I expect. public void ExportToResx(Dictionary<string,string> resourceDictionary, string fileName) { var writer = new ResXResourceWriter(fileName); foreach (var resource in resourceDictionary) { writer.AddResource(resource.Key, resource.Value); } } Unfortunately, it is a little difficult to show the entire resx file since it has 2198 (should have 2222) lines but here is the last little bit: ... 2195 <data name="LangAlign_ReportIssue" xml:space="preserve"> 2196 <value>Report an Issue</value> 2197 </data> 2198 <data name="LangAlign_Return BTW, notice that the file cuts off right at the end of that "n" in "LangAlign_Return". The string should read "LangAlign_ReturnToWorkspace". The file should also end at line 2222.

    Read the article

  • PC reboots spontaenously: debugging tips [closed]

    - by aaron
    I swapped my core 2 duo for a quad core recently, and generally things run fine, but every now and then my computer just restarts. I don't even get a blue screen (Vista 32). Core temp isn't a problem. My thinking is that my power supply is inadequate, but I haven't been able to test that (one idea was to under clock the cpu to see if that helped, but going up in speed was the only simple thing to do in the BIOS) Two cases where I semi-consistanly get problems: - Borderlands windowed after some period of time (and some other games, but Borderlands does it pretty regularly) - watching a video (e.g. quicktime/vlc) and having another video running Another thought is non-cpu heat? Maybe the graphics card? Any thoughts on how to track this down appreciated. Thanks!

    Read the article

  • What performance indicators can I use to convince management that I need my development PC upgraded?

    - by Aaron Daniels
    At work, my PC is slow. I feel that I can be way more productive if I just wasn't waiting for Visual Studio and everything else to respond. My PC isn't bad (dual-core, 3GB of RAM), but there is a lot of corporate software and whatnot to slow everything down and sometimes lock it up. Now, some developers have begun getting Windows 7 machines with 8 GB of RAM. Of course, I start salivating at this. However, I was told that I "had to justify" why I should get a new machine. I can think of a lot of different things, but I am curious as to what every one else on SO would have to say. NOTE: Ideally, these reasons should be specifically related to .NET development in Visual Studio on a Windows machine. This isn't a "how can I make my machine faster" question.

    Read the article

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