Search Results

Search found 502 results on 21 pages for 'wacky doug'.

Page 11/21 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Small questions for AJAX onreadystatechange

    - by Doug
    xmlhttp.onreadystatechange=function() { So this says onreadystatechange, invoke function(). Can I put parameters in function()? Second question, what does it mean when someone writes, xmlhttp.onreadystatechange=statechanged? Does that mean it will always be true or something?

    Read the article

  • Question about function returning array data

    - by Doug
    var grossBrackets = new Array( '300', '400', '500', '600', '700', '800', '900', '1000' ); function bracketSort( itemToSort ) { for( index = 0 ; index < grossBrackets.length ; index++ ) { if ( itemToSort < grossBrackets[index] ) { bracketData[index]++; } else if ( itemToSort > grossBrackets[7] ) { grossBrackets[7]++; } } return bracketData; } This is my current code, and I basically want to sort the data into their proper brackets. My source code is really long, but when I input these numbers into the function: 200.18 200.27 200.36 200.45 200.54 bracketData prints 5,5,5,5,5,5,5,5 or is there a better way to do this? Brackets: <300, <400, <500, <600, <700, <800, <900, <1000, greater than 1000

    Read the article

  • Can I get an example please?

    - by Doug
    $starcraft = array( "drone" => array( "cost" => "6_0-", "gas" => "192", "minerals" => "33", "attack" => "123", ) "zealot" => array( "cost" => "5_0-", "gas" => "112", "minerals" => "21", "attack" => "321", ) ) I'm playing with oop and I want to display the information in this array using a class, but I don't know how to construct the class to display it. This is what I have so far, and I don't know where to go from here. Am I supposed to use setters and getters? class gamesInfo($game) { $unitname; $cost; $gas; $minerals; $attack; }

    Read the article

  • Computer science advances in past 5 years

    - by Doug Stanhope
    I don't have a computer science background and only have a rudimentary knowledge of what CS is all about. However, I wonder, what are the most significant CS advances of -say- the last five years. To give you an idea of how clueless I am, I couldn't name one of these advances. But, please don't spare me all the gory details. I'm not looking for an education in CS or a story about the history of CS. As far as this question is concerned: only the past five years matter! :-)

    Read the article

  • HttpSendRequest not getting latest file from server

    - by Doug Kavendek
    I am having an issue with my HTTP requests in my app, such that if the remote file is the same size as the local file (even though its modified time is different, as its contents have been changed), attempts to download it return quickly and the newer file is not downloaded. In short, the process I am following is: Setting up an HTTP connection with the INTERNET_FLAG_RESYNCHRONIZE flag and calling HttpSendRequest(); then checking the HTTP status code and finding it to be "200". If the remote file is updated, but remains the same size as the local copy: The local file is unchanged after running the app. If I call HttpQueryInfo() with HTTP_QUERY_LAST_MODIFIED after sending the request, it gives me the actual last modified time of the server's file, which I can see is different from the local file I am trying to have it overwrite. If the remote file is updated, and the file size becomes different from the local copy: It is downloaded and overwrites the local copy as expected. Here's a fairly abridged version of the code, to cut out helpers and error checking: // szAppName = our app name HINTERNET hInternetHandle = InternetOpen( szAppName, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0 ); // szServerName = our server name hInternetHandle = InternetConnect( hInternetHandle, szServerName, INTERNET_DEFAULT_HTTP_PORT, NULL, NULL, INTERNET_SERVICE_HTTP, NULL, 0 ); // szPath = the file to download LPCSTR aszDefault[2] = { "*/*", NULL }; DWORD dwFlags = 0 | INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP | INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS | INTERNET_FLAG_KEEP_CONNECTION | INTERNET_FLAG_NO_AUTH | INTERNET_FLAG_NO_AUTO_REDIRECT | INTERNET_FLAG_NO_COOKIES | INTERNET_FLAG_NO_UI | INTERNET_FLAG_RESYNCHRONIZE; HINTERNET hHandle = HttpOpenRequest( hInternetHandle, "GET", szPath, NULL, NULL, aszDefault, dwFlags, 0 ); DWORD dwTimeOut = 10 * 1000; // In milliseconds InternetSetOption( hInternetHandle, INTERNET_OPTION_CONNECT_TIMEOUT, &dwTimeOut, sizeof( dwTimeOut ) ); InternetSetOption( hInternetHandle, INTERNET_OPTION_RECEIVE_TIMEOUT, &dwTimeOut, sizeof( dwTimeOut ) ); InternetSetOption( hInternetHandle, INTERNET_OPTION_SEND_TIMEOUT, &dwTimeOut, sizeof( dwTimeOut ) ); DWORD dwRetries = 5; InternetSetOption( hInternetHandle, INTERNET_OPTION_CONNECT_RETRIES, &dwRetries, sizeof( dwRetries ) ); HttpSendRequest( hInternetHandle, NULL, 0, NULL, 0 ); Since I have found I can query the remote file's last modified time, and find it to be accurate, I know it's actually getting to the server. I thought that specifying INTERNET_FLAG_RESYNCHRONIZE would force the file to resynch if it's out of date. Do I have it all wrong? Is this just how it's supposed to work?

    Read the article

  • ASP.NET application using old connection string.

    - by Doug S.
    I am trying to publish a website using ASP.NET MVC3 EF and CODEFIRST with a SQL Server 2008 backend. On my local machine I was using a sql express db for development, but now that I am pushing live, I want to use my hosted production database. The problem is that when I try to run the application, it is still using my local db connection string. I have completely removed the old connection string from my web.config file and am using the <clear /> tag before creating the new connection string. I have also cleaned the solution and rebuilt, but somehow it is still connecting to the old db. What am I missing? This is the new connection string: <connectionStrings> <clear /> <add name="CellularAutomataDBContext" connectionString=" Server=XXX; Database=CellularAutomata; User ID=XXX; Password=XXX; Trusted_Connection=False" providerName="System.Data.SqlClient" /> </connectionStrings>

    Read the article

  • Declaring an array

    - by Doug
    $a[]="Anna"; $a[]="Brittany"; $a[]="Cinderella"; $a[]="Diana"; $a[]="Eva"; $a[]="Fiona"; $a[]="Gunda"; When declaring it this way, does it automatically increase the index? Why is this ideal?

    Read the article

  • Calling PHP functions within HEREDOC strings

    - by Doug Kavendek
    In PHP, the HEREDOC string declarations are really useful for outputting a block of html. You can have it parse in variables just by prefixing them with $, but for more complicated syntax (like $var[2][3]), you have to put your expression inside {} braces. In PHP 5, it is possible to actually make function calls within {} braces inside a HEREDOC string, but you have to go through a bit of work. The function name itself has to be stored in a variable, and you have to call it like it is a dynamically-named function. For example: $fn = 'testfunction'; function testfunction() { return 'ok'; } $string = <<< heredoc plain text and now a function: {$fn()} heredoc; As you can see, this is a bit more messy than just: $string = <<< heredoc plain text and now a function: {testfunction()} heredoc; There are other ways besides the first code example, such as breaking out of the HEREDOC to call the function, or reversing the issue and doing something like: ?> <!-- directly outputting html and only breaking into php for the function --> plain text and now a function: <?PHP print testfunction(); ?> The latter has the disadvantage that the output is directly put into the output stream (unless I'm using output buffering), which might not be what I want. So, the essence of my question is: is there a more elegant way to approach this? Edit based on responses: It certainly does seem like some kind of template engine would make my life much easier, but it would require me basically invert my usual PHP style. Not that that's a bad thing, but it explains my inertia.. I'm up for figuring out ways to make life easier though, so I'm looking into templates now.

    Read the article

  • Populate textboxes with XmlNode.Attributes

    - by Doug
    I have Data.xml: <?xml version="1.0" encoding="utf-8" ?> <data> <album> <slide title="Autum Leaves" description="Leaves from the fall of 1986" source="images/Autumn Leaves.jpg" thumbnail="images/Autumn Leaves_thumb.jpg" /> <slide title="Creek" description="Creek in Alaska" source="images/Creek.jpg" thumbnail="images/Creek_thumb.jpg" /> </album> </data> I'd like to be able to edit the attributes of each Slide node via GridView (that has a "Select" column added.) And so far I have: protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { int selectedIndex = GridView1.SelectedIndex; LoadXmlData(selectedIndex); } private void LoadXmlData(int selectedIndex) { XmlDocument xmldoc = new XmlDocument(); xmldoc.Load(MapPath(@"..\photo_gallery\Data.xml")); XmlNodeList nodelist = xmldoc.DocumentElement.ChildNodes; XmlNode xmlnode = nodelist.Item(selectedIndex); titleTextBox.Text = xmlnode.Attributes["title"].InnerText; descriptionTextBox.Text = xmlnode.Attributes["description"].InnerText; sourceTextBox.Text = xmlnode.Attributes["source"].InnerText; thumbTextBox.Text = xmlnode.Attributes["thumbnail"].InnerText; } The code for LoadXmlData is just a guess on my part - I'm new to working with xml in this way. I'd like have the user to slected the row from the gridview, then populate a set of text boxes with each slide attributed for updating back to the Data.xml file. The error I'm getting is Object reference not set to an instance of an object" at the line: titleTextBox.Text = xmlnode.Attributes["@title"].InnerText; so I'm not reaching the attribute "title" of the slide node. Thanks for any ideas you may have.

    Read the article

  • JQuery display issue...

    - by Doug
    My fieldset doesn't display onclick, what am I doing wrong? $(document).ready(function(){ $('#More').toggle( function() { $('#search', this).slideDown(); }, function() { $('#search', this).slideUp(); }); }); <div> Item 1 <a href="#" id="More">Item 2</a> Item 3 <fieldset id="search" style="display: none;"> <form> <input type="text"> </form> </fieldset> </div>

    Read the article

  • learn ubuntu book

    - by dole doug
    Hi there I'm cs student and we did some unix programming at school, but most of use are using windows os. I have decided to go on ubuntu. Besides installing ubuntu and using it, what book will teach me the "must" things to know about *nix OS?

    Read the article

  • In Rails, how should I implement a Status field for a Tasks app - integer or enum?

    - by Doug
    For a Rails 3.0 Todo app, I have a Tasks model with a Status field. What's the best way to store the Status field data (field type) and still display a human-readable version in a view (HTML table)? Status can be: 0 = Normal 1 = Active 2 = Completed Right now I have this: Rails Schema Here: create_table "tasks", :force = true do |t| t.integer "status", :limit = 1, :default = 0, :null = false Rails Model Here: class Task < ActiveRecord::Base validates_inclusion_of :status, :in => 0..2, :message => "{{value}} must be 0, 1, or 2" Rails View Here: <h1>Listing tasks</h1> <table> <tr> <th>Status</th> <th>Name</th> <th></th> <th></th> <th></th> </tr> <% @tasks.each do |task| %> <tr> <td><%= task.status %></td> <td><%= task.name %></td> <td><%= link_to 'Show', task %></td> <td><%= link_to 'Edit', edit_task_path(task) %></td> <td><%= link_to 'Delete', task, :confirm => 'Are you sure?', :method => :delete %></td> </tr> <% end %> </table> Requirements Store a Task's status in the db such that the values are easily localizable, i.e. I'm not sure I want to store "normal", "active", "completed" as a string field. Solution must work with Rails 3.0. Questions: Should I store the field as an integer (see above)? If so, how do I display the correct human readable status in an HTML table in my Rails view, e.g. show "Active" instead of "1" in the HTML table. Should I use an enum? If so, is this easy to localize later? Should I use straight strings, e.g. "Normal", "Active", "Completed" Can you provide a quick code sample of the view helper, controller or view code to make this work?

    Read the article

  • How to implement menuitems that depend on current selection in WPF MVVM explorer-like application

    - by Doug
    I am new to WPF and MVVM, and I am working on an application utilizing both. The application is similar to windows explorer, so consider an app with a main window with menu (ShellViewModel), a tree control (TreeViewModel), and a list control (ListViewModel). I want to implement menu items such as Edit - Delete, which deletes the currently selected item (which may be in the tree or in the list). I am using Josh Smith's RelayCommand, and binding the menuitem to a DeleteItemCommand in the ShellViewModel is easy. It seems like implementing the DeleteItemCommand, however, requires some fairly tight coupling between the ShellViewModel and the two child view models (TreeViewModel and ListViewModel) to keep track of the focus/selection and direct the action to the proper child for implementation. That seems wrong to me, and makes me think I'm missing something. Writing a focus manager and/or selection manager to do the bookkeeping does not seem too hard, and could be done without coupling the classes together. The windowing system is already keeping track of which view has the focus, and it seems like I'd be duplicating code. What I'm not sure about is how I would route the command from the ShellViewModel down to either the ListViewModel or the TreeViewModel to do the actual work without making a mess of the code. Some day, the application will be extended to include more than two children, and I want the shell to be as ignorant of the children as possible to make that extension as painless as possible. Looking at some sample WPF/MVVM applications (Karl Shifflett's CipherText, Josh Smith's MVVM Demo, etc.), I haven't seen any code that does this (or I didn't understand it). Regardless of whether you think my approach is way off base or I'm just missing a small nuance, please share your thoughts and help me get back on track. Thanks!

    Read the article

  • git: How to diff changed files versus previous versions after a pull?

    - by doug
    I'm new to git, using it via Terminal on Snow Leopard. When I run "git pull" I often want to know what changed between the last version of a file and the new one. Say I want to know what someone else committed to a particular file. How is that done? I'm assuming it's "git diff" with some parameters for commit x versus commit y but I can't seem to get the syntax. I also find "git log" confusing a bit and am not sure where to get the commit ID of my latest version of the file versus the new one.

    Read the article

  • Background not changing to red

    - by Doug
    http://dougymak.com/jquery/# First time playing with jQuery, and kind of stuck already. I'm expecting the background to change to red on hover, but it's not for some reason. Can anyone give me a hand? Thanks!

    Read the article

  • How can I launch a missile?

    - by doug.stanhope
    I am working on an open-source missile launcher application. I have added a big red button to a Form that says "Launch Missile". When I click the button, the event handler gets called. From the event handler I call a method named LaunchMissile(). So far so good, but how do you launch a missile from C# code? Will I have to write this code myself or is there an API or third party library for launching missiles? Please add sample code for various launch scenarios: orbit, moon, mars, etc.

    Read the article

  • date() is showing December 1969

    - by Doug
    $sql = "SELECT * FROM news ORDER BY `news_id` DESC LIMIT 1"; $result = mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_assoc($result); $date = $row['time_posted']; echo "<i> " .date("Y/m/d", $date) . "</i>: "; I used timestamp in mysql. So, what's the problem?

    Read the article

  • FindControl in DataList Edit Mode

    - by Doug
    As a new .net/C# web begginner, I always get tripped up when I try to use FindControl. Blam -flat on my face. Here is my current FindControl problem: I have an .aspx page and Form, then ajax updatePanel, inside it there is my DataList (DataList1) that has an EditItemTemplate: that has the following: <EditItemTemplate> <asp:Label ID="thumbnailUploadLabel" runat="server" text="Upload a new thumbnail image:"/><br /> <asp:FileUpload ID="thumbnailImageUpload" runat="server" /> <asp:Button ID="thunbnailImageUploadButton" runat="server" Text="Upload Now" OnClick="thumbnailUpload"/><br /> </EditItemTemplate> In my C# code behind I have the OnClick code for the fileUpload object: protected void thumbnailUpload(object s, EventArgs e) { if (thumbnailImageUpload.HasFile) { //get name of the file & upload string imageName = thumbnailImageUpload.FileName; thumbnailImageUpload.SaveAs(MapPath("../../images/merch_sm/" + imageName)); //let'em know that it worked (or didn't) thumbnailUploadLabel.Text = "Image " + imageName + "has been uploaded."; } else { thumbnailUploadLabel.Text = "Please choose a thumbnail image to upload."; } So of course I'm getting "Object reference not set to an instance of an object" for the FileUpload and the Label. What is the correct syntax to find these controls, before dealing with them in the OnClick event? The only way Ive used FindControl is something like: label thumbnailUploadLabel = DataList1.FindControl("thumbnailUploadLabel") as Label; But of course this is throwing the "Object reference not set to an instance of an object" error. Any help is very much appreciated. (I've also seen the 'recursive' code out there that is supposed to make using FindControl easier. Ha! I'm so green at C# that I don't even know how to incorporate those into my project.) Thanks to all for taking a look at this.

    Read the article

  • Why do System.IO.Log SequenceNumbers have variable length?

    - by Doug McClean
    I'm trying to use the System.IO.Log features to build a recoverable transaction system. I understand it to be implemented on top of the Common Log File System. The usual ARIES approach to write-ahead logging involves persisting log record sequence numbers in places other than the log (for example, in the header of the database page modified by the logged action). Interestingly, the documentation for CLFS says that such sequence numbers are always 64-bit integers. Confusingly, however, the .Net wrapper around those SequenceNumbers can be constructed from a byte[] but not from a UInt64. It's value can also be read as a byte[], but not as a UInt64. Inspecting the implementation of SequenceNumber.GetBytes() reveals that it can in fact return arrays of either 8 or 16 bytes. This raises a few questions: Why do the .Net sequence numbers differ in size from the CLFS sequence numbers? Why are the .Net sequence numbers variable in length? Why would you need 128 bits to represent such a sequence number? It seems like you would truncate the log well before using up a 64-bit address space (16 exbibytes, or around 10^19 bytes, more if you address longer words)? If log sequence numbers are going to be represented as 128 bit integers, why not provide a way to serialize/deserialize them as pairs of UInt64s instead of rather-pointlessly incurring heap allocations for short-lived new byte[]s every time you need to write/read one? Alternatively, why bother making SequenceNumber a value type at all? It seems an odd tradeoff to double the storage overhead of log sequence numbers just so you can have an untruncated log longer than a million terabytes, so I feel like I'm missing something here, or maybe several things. I'd much appreciate it if someone in the know could set me straight.

    Read the article

  • CSS Extra Small Spacing

    - by Doug
    http://www.dougymak.com/cnit133/hw8.part4.html So if you look at the tabs and look at hw2, you'll notice it has a little extra spacing that overlaps the spacing on the right. That's because wrapped the div in the <li>. You will notice the others not having it. I don't understand why is it making that extra little spacing after I wrap it. Just for the record, this is for CSS spacing which has nothing to do with the JS.

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >