Search Results

Search found 450 results on 18 pages for 'russ cam'.

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

  • C# How to pause/suspend a thread then continue it?

    - by Russ K
    I am making an application in C# which uses a winform as the GUI and a separate thread which is running in the background automatically changing things. Ex: public void run() { while(true) { printMessageOnGui("Hey"); Thread.Sleep(2000); . . } } How would I make it pause anywhere in the loop, because one iteration of the loop takes around 30 seconds. So I wouldnt want to pause it after its done one loop, I want to pause it on time. Thanks!

    Read the article

  • When compiling programs to run inside a VM, what should march and mtune be set to?

    - by Russ
    With VMs being slave to whatever the host machine is providing, what compiler flags should be provided to gcc? I would normally think that -march=native would be what you would use when compiling for a dedicated box, but the fine detail that -march=native is going to as indicated in this article makes me extremely wary of using it. So... what to set -march and -mtune to inside a VM? For a specific example... My specific case right now is compiling python (and more) in a linux guest inside a KVM-based "cloud" host that I have no real control over the host hardware (aside from 'simple' stuff like CPU GHz m CPU count, and available RAM). Currently, cpuinfo tells me I've got an "AMD Opteron(tm) Processor 6176" but I honestly don't know (yet) if that is reliable and whether the guest can get moved around to different architectures on me to meet the host's infrastructure shuffling needs (sounds hairy/unlikely). All I can really guarantee is my OS, which is a 64-bit linux kernel where uname -m yields x86_64.

    Read the article

  • Basic Client-Server Design for persistent connections?

    - by cam
    Here's as far as I understand it: Client & Server make connection Client sends server data Server interprets data, sends client data So on, and so forth, until client sends disconnect signal. I'm just wondering about implementation. Step 2 and 3 are confusing to me, maybe I'm over-complicating it. Is there anymore to interpreting the data than a giant switch statement? Any good books on client/server design? Specifically talking about multithreaded servers, scalability, and message design (byte 1 = header info, byte 2 = blah blah, etc)? Specifically geared towards C++.

    Read the article

  • Use stringWithFormat: as a file path in cocoa

    - by Cam
    Hello, I'm having a problem with a cocoa application that takes the value of a text field, and writes it to a file. The file path is made using stringWithFormat: to combine 2 strings. For some reason it will not create the file and the console says nothing. Here is my code: //Get the values of the text field NSString *fileName = [fileNameTextField stringValue]; NSString *username = [usernameTextField stringValue]; //Use stringWithFormat: to create the file path NSString *filePath = [NSString stringWithFormat:@"~/Library/Application Support/Test/%@.txt", fileName]; //Write the username to filePath [username writeToFile:filePath atomically:YES]; Thanks for any help

    Read the article

  • How do I do a join in ActiveRecord after records have been returned?

    - by Russ Bradberry
    I am using ActiveRecord in Rails 3 to pull data from two different tables in two different databases. These databases can not join on each other, but I have the need to do a simple join after-the-fact. I would like to preserve the relation so that I can chain it down the line. here is a simplified version of what I am doing browsers = Browser.all # <-- this is fairly small and can reside in memory events = Event.where(:row_date=>Date.today).select(:name, :browser_id) So as you can see, I want to join browsers in on the events relation, where browser_id should equal browsers.name. events is a relation and I can still add clauses to it down the line, so I dont want to run the query on the db just yet. How would I accomplish this?

    Read the article

  • Jquery Returning values to original

    - by Cam
    So my script works perfectly, but here is the issue, I have buttons (Sprite action here) that are 40px height, but the top 20 only shows perfectly. When you click the button ie img the bottom 20px show perfecto! but... Issue, i included in my script a way to return all others to there default (only one should be selected) now, how can I fix this issue that I seem unable to correct as I can select multiple of them ** USERS can switch ** The last part of the script that is the issue. Thanks $(document).ready(function() { $('.form_sub').hide(); $('.theader').addClass('active'); $('.theader_t').click(function() { $('.form_header').show(); $('.form_sub').hide(); $('.theader').addClass('active'); $('.sub_theader').removeClass('active'); }); $('.sub_theader_t').click(function() { $('.form_header').hide(); $('.form_sub').show(); $('.theader').removeClass('active'); $('.sub_theader').addClass('active'); }); $('.top_head_img').click(function() { $(this).css({ position: 'relative', bottom: '20px' }).siblings().css( 'bottom', '0' ); }); }); <ul class="top_head"> <li> <a href="javascript:void(0)" onClick="selectPic5('top');"><img src="custom/images/top2.jpg" alt="Left" border="0" class="top_head_img"/></a> </li> <li> <a href="javascript:void(0)" onClick="selectPic5('center');"><img src="custom/images/mid2.jpg" alt="Center" border="0" class="top_head_img"/></a> </li> <li> <a href="javascript:void(0)" onClick="selectPic5('bottom');"><img src="custom/images/bot2.jpg" alt="Right" border="0" class="top_head_img"/></a> </li> </ul>

    Read the article

  • Making a Game Without Graphics?

    - by cam
    Is it possible or even constructive to make a game without any graphics (but is intended to become graphical) I'm not good with graphics at all, so I'd like to write the skeleton for the game then have a graphics programmer/artist fill in the rest. I could write up all the major classes, and their interactions, and all the major functions/parts of the game. If so, what should I do to make it easier to integrate graphics into the game later on (every drawn object should have a Draw, Rotate, Collide, etc method) ?

    Read the article

  • Giving Users an Option Between UDP & TCP?

    - by cam
    After studying TCP/UDP difference all week, I just can't decide which to use. I have to send a large amount of constant sensor data, while at the same time sending important data that can't be lost. This made a perfect split for me to use both, then I read a paper (http://www.isoc.org/INET97/proceedings/F3/F3_1.HTM) that says using both causes packet/performance loss in the other. Is there any issue presented if I allow the user to choose which protocol to use (if I program both server side) instead of choosing myself? Are there any disadvantages to this? The only other solution I came up with is to use UDP, and if there seems to be too great of loss of packets, switch to TCP (client-side).

    Read the article

  • Get settings through a button action

    - by Russ Knudsen
    I am looking for a way to access user settings (I assume, NSUserDefaults?) through a button action. Let me back up and explain. What I have right now are 2 TextFields a label and a button. The user will type in measurements in the 2 TextFields. When they hit the button the label displays the volume of the measured object in Gallons. That part of it works great. Then I wanted to give the user options to output the volume in Liters instead of gallons. I would also like to give the user options to type in the measurements in Centimeters. So I setup a 'Settings.Bundle' and configured it with 2 'Multi Value' cells (Measurement units and Volumetric Units). Each Multi Value cell has its own list of different units the user can pick from. My main issue is I don't know how to access these settings through the button action. I may be thinking of this wrong, but what I'm looking for is something like; Button Action If settings key = 0 Then do the math in Inches, Display in Gallons If settings key = 1 Then do the math in Centimeters, Display in Gallons If settings key = 2 Then do the math in Inches, Display in Liters If settings key = 3 Then do the math in Centimeters, Display in Liters Etc... Is this possible? Am I thinking of this in the wrong way? What's the best way to do this?

    Read the article

  • Unit Test Organization

    - by cam
    I'm using Nunit for unit testing, and added another project called "Unit Testing" to my current solution. I referenced Nunit, and changed the Namespace to the same namespace used in the main project. I can't seem to figure out how to get access to all the classes, files, etc in the main project. Is there something I have to do to link two projects?

    Read the article

  • Where to Declare Structures, etc?

    - by cam
    Should all structs and classes be declared in the header file? If I declare a struct/class in a source file, what do I need to put in the header file so that it can be used in other files? Also, are there any resources that show some standard practices of C++ out there?

    Read the article

  • What information do you capture your software crashes in the field?

    - by Russ
    I am working on rewriting my unexpected error handling process, and I would like to ask the community: What information do you capture both automatic, and manually, when software you have written crashes? Right now, I capture a few items, some of which are: Automatic: Name of app that crashed Version of app that crashed Stack trace Operating System version RAM used by the application Number of processors Screen shot: (Only on non-public applications) User name and contact information (from Active Directory) Manual: What context is the user in (i.e.: what company, tech support call number, RA number, etc...) When did the user expect to happen? (Typical response: "Not to crash”) Steps to reproduce. What other bits of information do you capture that helps you discover the true cause of an applications problem, especially given that most users simply mash the keyboard when asked to tell you what happened. For the record I’m using C#, WPF and .NET version 4, but I don’t necessarily want to limit myself to those. Related: http://stackoverflow.com/questions/1226671/what-to-collect-information-when-software-crashes Related: http://stackoverflow.com/questions/701596/what-should-be-included-in-the-state-of-the-art-error-and-exception-handling-stra

    Read the article

  • MySQL from Silverlight on Linux Server

    - by cam
    I'm trying to access a MySQL database through Silverlight, and I know you can't do it directly, but the only way I know of is to use a WCF service. This won't run on the server I have, is there any other way to access the database (through PHP maybe)?

    Read the article

  • What information do you capture when your software crashes in the field?

    - by Russ
    I am working on rewriting my unexpected error handling process, and I would like to ask the community: What information do you capture both automatic, and manually, when software you have written crashes? Right now, I capture a few items, some of which are: Automatic: Name of app that crashed Version of app that crashed Stack trace Operating System version RAM used by the application Number of processors Screen shot: (Only on non-public applications) User name and contact information (from Active Directory) Manual: What context is the user in (i.e.: what company, tech support call number, RA number, etc...) When did the user expect to happen? (Typical response: "Not to crash”) Steps to reproduce. What other bits of information do you capture that helps you discover the true cause of an applications problem, especially given that most users simply mash the keyboard when asked to tell you what happened. For the record I’m using C#, WPF and .NET version 4, but I don’t necessarily want to limit myself to those. Related: http://stackoverflow.com/questions/1226671/what-to-collect-information-when-software-crashes Related: http://stackoverflow.com/questions/701596/what-should-be-included-in-the-state-of-the-art-error-and-exception-handling-stra

    Read the article

  • Randomly sorting an array

    - by Cam
    Does there exist an algorithm which, given an ordered list of symbols {a1, a2, a3, ..., ak}, produces in O(n) time a new list of the same symbols in a random order without bias? "Without bias" means the probability that any symbol s will end up in some position p in the list is 1/k. Assume it is possible to generate a non-biased integer from 1-k inclusive in O(1) time. Also assume that O(1) element access/mutation is possible, and that it is possible to create a new list of size k in O(k) time. In particular, I would be interested in a 'generative' algorithm. That is, I would be interested in an algorithm that has O(1) initial overhead, and then produces a new element for each slot in the list, taking O(1) time per slot. If no solution exists to the problem as described, I would still like to know about solutions that do not meet my constraints in one or more of the following ways (and/or in other ways if necessary): the time complexity is worse than O(n). the algorithm is biased with regards to the final positions of the symbols. the algorithm is not generative. I should add that this problem appears to be the same as the problem of randomly sorting the integers from 1-k, since we can sort the list of integers from 1-k and then for each integer i in the new list, we can produce the symbol ai.

    Read the article

  • How do I select and group by a portion of a string?

    - by Russ Bradberry
    Given I have data like the following, how can I select and group by portions of a string? Version Users 1.1.1 1 1.1.23 3 1.1.45 1 2.1.24 3 2.1.12 1 2.1.45 3 3.1.10 1 3.1.23 3 What I want is to sum up the users using version 1.1.x and 2.2.x and 3.3.x etc, but I'm not sure how I can group on a partial string in a select statement. edit What the data should return like is this: Version Users 1.1.XX 5 2.1.XX 7 3.1.XX 4 There is an infinite variable number of versions, some are in this format (major, minor, build) some are just major, minor and some are just major, the only time I want to "roll up" the versions is when there is a build.

    Read the article

  • How Do I Select a `td` Element in a Row That Has a Checkbox That is Checked?

    - by Russ Bradberry
    I have a table that looks somethings like this: <table> <tr class="row even"> <td><input type="checkbox" /></td> <td class="name">foo</td> <td class="metric">22</td> </tr> ...etc What I want to do is get an array of all td.metric only in rows that have the checkbox checked. This didn't work out as expected: var ticks = $.map($("tr td input:checked td.metric"), function(v,i){ return ... });

    Read the article

  • When Should I Use Threads?

    - by cam
    As far as I'm concerned, the ideal amount of threads is 3: one for the UI, one for CPU resources, and one for IO resources. But I'm probably wrong. I'm just getting introduced to them, but I've always used one for the UI and one for everything else. When should I use threads and how? How do I know if I should be using them?

    Read the article

  • Why doesn't this PHP execute?

    - by cam
    I copied the code from this site exactly: http://davidwalsh.name/web-service-php-mysql-xml-json as follows, /* require the user as the parameter */ if(isset($_GET['user']) && intval($_GET['user'])) { /* soak in the passed variable or set our own */ $number_of_posts = isset($_GET['num']) ? intval($_GET['num']) : 10; //10 is the default $format = strtolower($_GET['format']) == 'json' ? 'json' : 'xml'; //xml is the default $user_id = intval($_GET['user']); //no default /* connect to the db */ $link = mysql_connect('localhost','username','password') or die('Cannot connect to the DB'); mysql_select_db('db_name',$link) or die('Cannot select the DB'); /* grab the posts from the db */ $query = "SELECT post_title, guid FROM wp_posts WHERE post_author = $user_id AND post_status = 'publish' ORDER BY ID DESC LIMIT $number_of_posts"; $result = mysql_query($query,$link) or die('Errant query: '.$query); /* create one master array of the records */ $posts = array(); if(mysql_num_rows($result)) { while($post = mysql_fetch_assoc($result)) { $posts[] = array('post'=>$post); } } /* output in necessary format */ if($format == 'json') { header('Content-type: application/json'); echo json_encode(array('posts'=>$posts)); } else { header('Content-type: text/xml'); echo '<posts>'; foreach($posts as $index => $post) { if(is_array($post)) { foreach($post as $key => $value) { echo '<',$key,'>'; if(is_array($value)) { foreach($value as $tag => $val) { echo '<',$tag,'>',htmlentities($val),'</',$tag,'>'; } } echo '</',$key,'>'; } } } echo '</posts>'; } /* disconnect from the db */ @mysql_close($link); } And the php doesn't execute, it just displays as plain text. What's the dealio? The host supports PHP, I use it to run a Wordpress blog and other things.

    Read the article

  • What is the .NET attribuet to not compile a method is release mode

    - by Russ
    I know that if I have a block of code I don't want compiled when in release mode I can wrap that code block in: #if DEBUG while(true) { Console.WriteLine("StackOverflow rules"); } #endif This will keep this code block from compiling in any mode other than DEBUG. I know there is an attribute that can be placed on an entire method that will do that same, but for the life of me I can't remember what that attribute is. I believe that it’s down the System.Diagnostics namespace, but I'm not really sure. BTW: I'm using .NET 4, but I know this attribute existed in .NET 2 because I have used in in old projects. Thanks

    Read the article

  • Save All Values of Database to Text File?

    - by cam
    I was wondering if there was a way to extract all the values of a column, and then save each value into separate text files (labeled ANYTHING, 1-100 works fine). I know how to do this through another language, but I'm using SQL Server 2008 with Microsoft SQL Server Manager and it would save me some time from figuring out how to do it through C#.

    Read the article

  • Stack Overflow Accessing Large Vector

    - by cam
    I'm getting a stack overflow on the first iteration of this for loop for (int q = 0; q < SIZEN; q++) { cout<<nList[q]<<" "; } nList is a vector of type int with 376 items. The size of nList depends on a constant defined in the program. The program works for every value up to 376, then after 376 it stops working. Any thoughts?

    Read the article

  • Transforming OLTP Relational Database to Data Warehousing Model

    - by Russ Cam
    What are the common design approaches taken in loading data from a typical Entity-Relationship OLTP database model into a Kimball star schema Data Warehouse/Marts model? Do you use a staging area to perform the transformation and then load into the warehouse? How do you link data between the warehouse and the OLTP database? Where/How do you manage the transformation process - in the database as sprocs, dts/ssis packages, or SQL from application code?

    Read the article

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