Search Results

Search found 1551 results on 63 pages for 'ryan brown'.

Page 19/63 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • Can you overload controller methods in ASP.Net MVC?

    - by Eric Brown
    Im curious to see if you can overload controller methods in ASP.Net MVC. Whenever I try, I get the error below. The two methods accept different arguements. Is this something that cannot be done? The current request for action 'MyMethod' on controller type 'MyController' is ambiguous between the following action methods:

    Read the article

  • Refactor custom wizard to reduce flicker

    - by Matthew Brown
    I have implemented a custom wizard control in C# windows forms by creating a base form which has the shared components and then making child forms for each step of the process. I then have a class which hides/shows the child forms when you move from one step to another. The problem is that flickering is bad when moving between forms. Does anyone know a way to either keep this method and reduce the flicker or refactor it to make it use a single form (which should definitely reduce the flicker)?

    Read the article

  • Play DVDs in Python?

    - by Zachary Brown
    I want to write a custom DVD player using python that plays for 30 seconds, then pauses and asks a question. Once the question is anwered, it tells the user if they are right or wrong and gives them a Resume button to resume DVD playback. How do I do this. I have never written a DVD player before, but I am open to learning!

    Read the article

  • How do I echo out something different when reached last row?

    - by Josh Brown
    I am wanting to not echo out the comma at the end of the echo after the last row. How can I do that? Here is my code: <?php header("Content-type: application/json"); echo '{"points":['; mysql_connect("localhost", "user", "password"); mysql_select_db("database"); $q = "SELECT venues.id, venues.lat, venues.lon, heat_indexes.temperature FROM venues, heat_indexes WHERE venues.id = heat_indexes.venue_id"; $res = mysql_query($q) or die(mysql_error()); while ($point = mysql_fetch_assoc($res)) { echo $point['lat'] . "," . $point['lon'] . "," . $point['temperature'] . ","; } mysql_free_result($res); echo ']}'; ?>

    Read the article

  • Using inheritance and polymorphism to solve a common game problem

    - by Barry Brown
    I have two classes; let's call them Ogre and Wizard. (All fields are public to make the example easier to type in.) public class Ogre { int weight; int height; int axeLength; } public class Wizard { int age; int IQ; int height; } In each class I can create a method called, say, battle() that will determine who will win if an Ogre meets and Ogre or a Wizard meets a Wizard. Here's an example. If an Ogre meets an Ogre, the heavier one wins. But if the weight is the same, the one with the longer axe wins. public Ogre battle(Ogre o) { if (this.height > o.height) return this; else if (this.height < o.height) return o; else if (this.axeLength > o.axeLength) return this; else if (this.axeLength < o.axeLength) return o; else return this; // default case } We can make a similar method for Wizards. But what if a Wizard meets an Ogre? We could of course make a method for that, comparing, say, just the heights. public Wizard battle(Ogre o) { if (this.height > o.height) return this; else if (this.height < o.height) return o; else return this; } And we'd make a similar one for Ogres that meet Wizard. But things get out of hand if we have to add more character types to the program. This is where I get stuck. One obvious solution is to create a Character class with the common traits. Ogre and Wizard inherit from the Character and extend it to include the other traits that define each one. public class Character { int height; public Character battle(Character c) { if (this.height > c.height) return this; else if (this.height < c.height) return c; else return this; } } Is there a better way to organize the classes? I've looked at the strategy pattern and the mediator pattern, but I'm not sure how either of them (if any) could help here. My goal is to reach some kind of common battle method, so that if an Ogre meets an Ogre it uses the Ogre-vs-Ogre battle, but if an Ogre meets a Wizard, it uses a more generic one. Further, what if the characters that meet share no common traits? How can we decide who wins a battle?

    Read the article

  • How to add a "handle bar" to a sliding div

    - by Josh Brown
    I have a small splash page and have a browser-wide div that acts as a wrapper and have a div inside of #wrapper that is attached to a $.click(); event to slide the wrapper div out to view the browser-size background photo. I'm wanting to implement a small button/link that will slide in on the bottom right corner after the wrapper div is hidden. I know it is probably mainly CSS, but am needing some help. Thanks in advance for your help! PS: Using jQuery as my framework.

    Read the article

  • CI PHP if statement w/ sql syntax

    - by Kevin Brown
    This is a quick syntax question... I need to block out an HTML element if two SQL statements are true w/ php. If the status = 'closed', and if the current user is logged in. I can figure out the calls, I just need to see an example of the syntax. :) So, If SQL status=closed, and if current_user=is_logged_in()...something like that.

    Read the article

  • T-SQL query and group by reporting help

    - by Dayton Brown
    So I have some data that looks like this. `USERID1 USERID2` 1 10 2 20 2 30 3 40 3 50 1 10 2 20 2 30 3 50 I want a query that produces the following `USERID1 COUNT` 2 2 3 2 It's a group by query that shows me the count of unique USERID2 for each USERID1 that has more than 1 USERID2 associated with it. God I hope you aren't as confused as I am by that last statement.

    Read the article

  • Get location of element you just pushed into vector C++

    - by Satchmo Brown
    I am curious about how pushing back into a vector works. I want a way to push back an element and then be able to add it's location in the vector to a double array serving as a type of map. Something like this: // Create a bomb Bomb b; b.currentTime = SDL_GetTicks(); b.explodeTime = SDL_GetTicks() + 3000; b.owner = player; b.power = 2; b.x = x; b.y = y; bombVec.push_back(b); bombs[y][x] = THIS_IS_WHAT_I_WANT; This way when I explode the bomb, I can check the map and then have an ID in the vector to deal with. Every non bomb square will have a -1. Also, just curious. Imagine I have 3 elements in a vector. I delete the second one and then add another. Does the new element go in the same location as the one that was deleted? Thanks!

    Read the article

  • WiX, how to prevent files from uninstalling though we forgot to set Permanent="yes"

    - by Doc Brown
    We have a product installer created with Wix, containing a program package ("V1") and some configuration files. Now, we are going to make a major upgrade with a new product code, where the old version of the product is uninstalled and "V2" is installed. What we want is to save one of the configuration files from uninstalling, since it is needed for the V2, too. Unfortunately, we forgot to set the Permanent="yes" option when we delivered V1 (read this question for more information). Here comes the question: is there an easy way of preventing the uninstall of the file anyhow? Of course, we could add a custom action to the script to backup the file before uninstallation, and another custom action to restore it afterwards, but IMHO that seems to be overkill for this task, and might interfere with other parts of the MSI registration process.

    Read the article

  • Why can't decimal numbers be represented exactly in binary?

    - by Barry Brown
    There have been several questions posted to SO about floating-point representation. For example, the decimal number 0.1 doesn't have an exact binary representation, so it's dangerous to use the == operator to compare it to another floating-point number. I understand the principles behind floating-point representation. What I don't understand is why, from a mathematical perspective, are the numbers to the right of the decimal point any more "special" that the ones to the left? For example, the number 61.0 has an exact binary representation because the integral portion of any number is always exact. But the number 6.10 is not exact. All I did was move the decimal one place and suddenly I've gone from Exactopia to Inexactville. Mathematically, there should be no intrinsic difference between the two numbers -- they're just numbers. By contrast, if I move the decimal one place in the other direction to produce the number 610, I'm still in Exactopia. I can keep going in that direction (6100, 610000000, 610000000000000) and they're still exact, exact, exact. But as soon as the decimal crosses some threshold, the numbers are no longer exact. What's going on? Edit: to clarify, I want to stay away from discussion about industry-standard representations, such as IEEE, and stick with what I believe is the mathematically "pure" way. In base 10, the positional values are: ... 1000 100 10 1 1/10 1/100 ... In binary, they would be: ... 8 4 2 1 1/2 1/4 1/8 ... There are also no arbitrary limits placed on these numbers. The positions increase indefinitely to the left and to the right.

    Read the article

  • Using Mergesort to calculate number of inversions in C++

    - by Brown
    void MergeSort(int A[], int n, int B[], int C[]) { if(n > 1) { Copy(A,0,floor(n/2),B,0,floor(n/2)); Copy(A,floor(n/2),n-1,C,0,floor(n/2)-1); MergeSort(B,floor(n/2),B,C); MergeSort(C,floor(n/2),B,C); Merge(A,B,0,floor(n/2),C,0,floor(n/2)-1); } }; void Copy(int A[], int startIndexA, int endIndexA, int B[], int startIndexB, int endIndexB) { while(startIndexA < endIndexA && startIndexB < endIndexB) { B[startIndexB]=A[startIndexA]; startIndexA++; startIndexB++; } }; void Merge(int A[], int B[],int leftp, int rightp, int C[], int leftq, int rightq) //Here each sub array (B and C) have both left and right indices variables (B is an array with p elements and C is an element with q elements) { int i=0; int j=0; int k=0; while(i < rightp && j < rightq) { if(B[i] <=C[j]) { A[k]=B[i]; i++; } else { A[k]=C[j]; j++; inversions+=(rightp-leftp); //when placing an element from the right array, the number of inversions is the number of elements still in the left sub array. } k++; } if(i=rightp) Copy(A,k,rightp+rightq,C,j,rightq); else Copy(A,k,rightp+rightq,B,i,rightp); } I am specifically confused on the effect of the second 'B' and 'C' arguments in the MergeSort calls. I need them in there so I have access to them for Copy and and Merge, but

    Read the article

  • Combining a web application with another (larger).

    - by Kevin Brown
    I'm writing a web app, initially meant to be stand-alone--it's essentially a survey with user-management/authentication built on Codeigniter. The company I'm doing this for wants to merge it with their main system so that it acts like a feature, or a sub-app of their website. What is the best thing for me to do? I think I could do one of two things: Finish my application, as I had planned to initially, and let them handle the merging.It would probably save me a headache. Stop where I am in development, and migrate my authentication system to theirs, migrate the payment system to use theirs, and then finish the app. In your opinion, or experience, what is the best thing to do?

    Read the article

  • Hyperlink in Silverlight AccordionItem HeaderTemplate

    - by Charlie Brown
    I have created a HeaderTemplate for my accordions where I want to display a text block on one side of the header and a hyperlink on the right side. The display is working correctly, but the click event is not called when the user clicks, I'm guessing b/c the header itself is trapping the click for expand/contract. <layoutToolkit:Accordion> <layoutToolkit:AccordionItem IsSelected="True"> <layoutToolkit:AccordionItem.HeaderTemplate> <DataTemplate> <StackPanel Orientation="Horizontal" Height="20"> <TextBlock Margin="0,0,700,0">Cancel Postcards</TextBlock> <HyperlinkButton Content="Next Call" Foreground="Blue" Click="NextCancel_Click" /> </StackPanel> </DataTemplate> </layoutToolkit:AccordionItem.HeaderTemplate> ..... more code .... Is there a way to get the hyperlink to respond to events without practically creating a new control?

    Read the article

  • How do I create a custom network connection entry?

    - by David Brown
    I have a Sprint MiFi 3G router that exposes its current signal strength over HTTP. I've developed a very simple tray application that displays this. However, what I would really like to do is create a custom network connection entry so the router's 3G signal strength (along with the current network version) displays when clicking on the network connections tray icon (in Windows 7, at least). Is it possible to do this with a shell extension or something (preferably in C#)? If so, how?

    Read the article

  • Is there a "Language-Aware" diff?

    - by JS
    (Appologies for the poor title. I'm open to suggestions for a better one. "Language-gnostic", perhaps?) Does there exist a diff utility (preferably *nix-based) that will diff files based on how a (selectable) language compiler would view the code? For example, to a Python compiler, these two 'graphs are identical: # The quick brown fox jumped vs: # The quick brown # fox jumped Telling most diffs (at least the one's I'm familiar with) to ignore spaces and linebreaks still causes them to flag a difference due to the extra '#'. "Language-sensitivity" would sure help to cut down on the "noise". Ideally, it would work in xemacs....(<-- probably pushing my luck? :-)

    Read the article

  • Find all the child node of specific value in C#

    - by sara brown
    <main> <myself> <pid>1</pid> <name>abc</name> </myself> <myself> <pid>2</pid> <name>efg</name> </myself> </main> that is my XML file named simpan. I have two button. next and previous. What i want to do is, all the info will shows off on the TextBox when the user click the button. The searching node will be based on the pid. Next button will adding 1 value of pid (let's say pid=2) and it will search on the node that have the same value of pid=2. it also will show the name for the pid=2. (showing name=abc) Same goes to the previous button where it will reduce 1value of pid (pid=1). Does anybody knows how to do this? //-------------EDIT------------------ thanks to L.B, im trying to use his code. however i got an error. is my implementation of code correct? private void previousList_Click(object sender, EventArgs e) { pid = 14; XDocument xDoc = XDocument.Parse("C:\\Users\\HDAdmin\\Documents\\Fatty\\SliceEngine\\SliceEngine\\bin\\Debug\\simpan.xml"); var name = xDoc.Descendants("myself") .First(m => (int)m.Element("PatientID") == pid) .Value; textETA.Text = name; //////////////////// }

    Read the article

  • intersection of three sets in python?

    - by Phil Brown
    Currently I am stuck trying to find the intersection of three sets. Now these sets are really lists that I am converting into sets, and then trying to find the intersection of. Here's what I have so far: for list1 in masterlist: list1=thingList1 for list2 in masterlist: list2=thingList2 for list3 in masterlist: list3=thingList3 d3=[set(thingList1), set(thingList2), set(thingList3)] setmatches c= set.intersection(*map(set,d3)) print setmatches and I'm getting set([]) Script terminated. I know there's a much simpler and better way to do this, but I can't find one...

    Read the article

  • Simple startup on boot of misc application (Java based) on Ubuntu Linux 8+ as a daemon

    - by Berlin Brown
    What is the easiest way to have an application launch at startup on Ubuntu server as daemon? This is a java application (java com.run.run.Run) etc. How would I have it launch as a user and possibly have access to write to some log file where the user has permissions to write? And if I don't end up doing that, how would I launch the application as the root user at startup. Edited: It is a headless server, I don't have access to the desktop applications.

    Read the article

  • Codeigniter: Library function--I'm stuck

    - by Kevin Brown
    I have a library function that sets up my forms, and submits data. They're long, and they work, so I'll spare you reading my code. :) I simply need a way for my functions to determine how to handle the data. Until now, the function did one thing: Submit a report for the current user. NOW, the client has requested that an administrator also be able to complete a form--this means that the form would be filled out, and it would CREATE a user at the same time, whereas the current function EDITS and is accessed by an EXISTING user. Do I need a separate function to do essentially the same thing? How do I make one function perform two tasks? One to update a user, and if there is no user, create one. Current controller: function survey() { $id = $this->session->userdata('id'); $data['member'] = $this->home_model->getUser($id); //Convert the db Object to a row array $data['manager'] = $data['member']->row(); $manager_id = $data['manager']->manager_id; $data['manager'] = $this->home_model->getUser($manager_id); $data['manager'] = $data['manager']->row(); $data['header'] = "Home"; $this->survey_form_processing->survey_form($this->_container,$data, $method); } Current Library: function survey_form($container) { //Lots of validation stuff $this->CI->validation->set_rules($rules); if ( $this->CI->validation->run() === FALSE ) { // Output any errors $this->CI->validation->output_errors(); } else { // Submit form $this->_submit(); } $this->CI->load->view($container,$data); The submit function is huge too. Basically says, "Update table with data where user_id=current user" I hope this wasn't too confusing. I'll create two functions if need be, but I'd like to keep redundancy down! }

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >