Search Results

Search found 1870 results on 75 pages for 'matt mcclellan'.

Page 43/75 | < Previous Page | 39 40 41 42 43 44 45 46 47 48 49 50  | Next Page >

  • How do you update the aspnetdb membership IsApproved value?

    - by Matt
    I need to update existing users IsApproved status in the aspnet_Membership table. I have the code below that does not seem to be working. The user.IsApproved property is updated but it is not saving it to the database table. Are there any additional calls I need to make? Any suggestions? Thanks. /// <summary> /// Updates a users approval status to the specified value /// </summary> /// <param name="userName">The user to update</param> /// <param name="isApproved">The updated approval status</param> public static void UpdateApprovalStatus(string userName, bool isApproved) { MembershipUser user = Membership.GetUser(userName); if (user != null) user.IsApproved = isApproved; }

    Read the article

  • Add NSView from different nib

    - by Matt S.
    How can I add a subview when the new view is in a different xib file? The class for the different nib is an NSViewController and I'm using self = [super initWithNibName:@"NewView" bundle:nil]; to load the nib Can I just do something like: NewView *nv = [NewView new]; [oldView removeFromSuperView]; [mv addSubview:[nv theView]]; or do I have to do something different

    Read the article

  • Writing a DBMS in Python

    - by Matt Luongo
    Hey guys, I'm working on a basic DBMS as a pet project and planning to prototype in Python. I figure there's a reason there are only a few Python databases, and my gut agrees that my favorite language will be too slow to act as an honest performing database, but I'm looking forward to using it to learn what I need quickly. Would someone please contradict me? Is Python as ill-suited right now for this sort of thing as I think?

    Read the article

  • Basis for claim that the number of bugs per line of code is constant regardless of the language used

    - by Matt R
    I've heard people say (although I can't recall who in particular) that the number of bugs per line of code is roughly constant regardless of what language is used. What is the research that backs this up? Edited to add: I don't have access to it, but apparently the authors of this paper "asked the question whether the number of bugs per lines of code (LOC) is the same for programs written in different programming languages or not."

    Read the article

  • Cross platform unicode path handling

    - by Matt Joiner
    I'm using boost::filesystem for cross-platform path manipulation, but this breaks down when calls need to be made down into interfaces I don't control that won't accept UTF-8. For example when using the Windows API, I need to convert to UTF-16, and then call the wide-string version of whatever function I was about to call, and then convert any output back to UTF-8. While the wpath, and other w* forms of many of the boost::filesystem functions help keep sanity, are there any suggestions for how best to handle this conversion to wide-string forms where needed, while maintaining consistency in my own code?

    Read the article

  • How does load balancing work with multiple server with multiple DBs

    - by Matt
    I guess what im looking for is a description on how this all works together. I'm used to setting up one server with maybe another server to handel the DB. My question is how does the load balancer work where do all the script(php,python) files go? If i make a change to one i have to rsync them to all the server that the balancer refers to? Also does each server need client side DB's installed so they can reference the DB's that are on other servers? If there is a site that explains all this i would be happy to read it.

    Read the article

  • custom cells uitableview - cannot display all the rows

    - by Matt Facer
    Hi guys, I'm creating a uitableview with custom cells which I created in Interface Builder. There are currently three cells (UITableViewCell). I have a UITableView which is on the view. The code I have is fairly standard, but I cannot work out how to actually SHOW the three custom cells. I am using the cellForRowAtIndexPath method. My aim is to get a grouped uitableview which shows like the following Item - Name Settings - alert - time So the above indented view should be my grouped uitableview. The problem is, I cannot get it to show using code. The uitableview will ALWAYS be this. I am trying to replicate the settings style screen... so I do not have any arrays to display the uitableview cells. How do I actually display my three cells? I have the following code - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 2; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { if (section == 0) return 1; else return 2; } - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { if(section == 0) return @"Item"; else return @"Settings"; } So all I need to know is how to actually display my custom cells inside the tableview! Thanks for any information. I've searched for AGES in google .. all the tutorials use arrays to display data!

    Read the article

  • Recursion with an Array; can't get the right value to return

    - by Matt
    Recursive Solution: Not working! Explanation: An integer, time, is passed into the function. It's then used to provide an end to the FOR statement (counter<time). The IF section (time == 0) provides a base case where the recursion should terminate, returning 0. The ELSE section is where the recursive call occurs: total is a private variable defined in the header file, elsewhere. It's initialized to 0 in a constructor, elsewhere. The function calls itself, recursively, adding productsAndSales[time-1][0] to total, again, and again, until the base call. Then the total is returned, and printed out later. Well, that's what I hoped for anyway. What I imagined would happen is that I would add up all the values in this one column of the array and the value would get returned, and printed out. Instead if returns 0. If I set the IF section to "return 1", I noticed that it returns powers of 2, for whatever value time is. EG: Time = 3, it returns 2*2 + 1. If time = 5, it returns 2*2*2*2 + 1. I don't understand why it's not returning the value I'm expecting. int CompanySales::calcTotals( int time ) { cout << setw( 4 ); if ( time == 0 ) { return 0; } else { return total += calcTotals( productsAndSales[ time-1 ][ 0 ]); } } Iterative Solution: Working! Explanation: An integer, time, is passed into the function. It's then used to provide an end to the FOR statement (counter<time). The FOR statement cycles through an array, adding all of the values in one column together. The value is then returned (and elsewhere in the program, printed out). Works perfectly. int CompanySales::calcTotals( int time ) { int total = 0; cout << setw( 4 ); for ( int counter = 0; counter < time; counter++ ) { total += productsAndSales[counter][0]; } return total0; }

    Read the article

  • What's with "foo" and "bar" [closed]

    - by Matt S.
    Possible Duplicates: When foo and bar is not enough Code examples Foo Bar I've always wondered, why is there always "foo" and "bar" named as variables in most tutorials I've seen. Where did it come from? Why do we call them "foo" and "bar" why not something else?

    Read the article

  • Why isn't my algorithm for find the biggest and smallest inputs working?

    - by Matt Ellen
    I have started a new job, and with it comes a new language: Ironpython. Thankfully a good language :D Before starting I got to grips with Python on the whole, but that was only a week's worth of learning. Now I'm writing actual code. I've been charged with writing an algorithm that finds the best input parameter to collect data with. The basic algorithm is (as I've been instructed): Set the input parameter to a good guess Start collecting data When data is available stop collecting find the highest point If the point before this (i.e. for the previous parameter value) was higher and the point before that was lower then we've found the max otherwise the input parameter is increased by the initial guess. goto 2 If the max is found then the min needs to be found. To do this the algorithm carries on increasing the input, but by 1/10 of the max, until the current point is greater than the previous point and the point before that is also greater. Once the min is found then the algorithm stops. Currently I have a simplified data generator outputting the sin of the input, so that I know that the min value should be PI and the max value should be PI/2 The main Python code looks like this (don't worry, this is just for my edification, I don't write real code like this): import sys sys.path.append(r"F:\Programming Source\C#\PythonHelp\PythonHelp\bin\Debug") import clr clr.AddReferenceToFile("PythonHelpClasses.dll") import PythonHelpClasses from PHCStruct import Helper from System import Math helper = Helper() def run(): b = PythonHelpClasses.Executor() a = PythonHelpClasses.HasAnEvent() b.Input = 0.0 helper.__init__() def AnEventHandler(e): b.Stop() h = helper h.lastLastVal, h.lastVal, h.currentVal = h.lastVal, h.currentVal, e.Number if h.lastLastVal < h.lastVal and h.currentVal < h.lastVal and h.NotPast90: h.NotPast90 = False h.bestInput = h.lastInput inputInc = 0.0 if h.NotPast90: inputInc = Math.PI/10.0 else: inputInc = h.bestInput/10.0 if h.lastLastVal > h.lastVal and h.currentVal > h.lastVal and h.NotPast180: h.NotPast180 = False if h.NotPast180: h.lastInput, b.Input = b.Input, b.Input + inputInc b.Start(a) else: print "Best input:", h.bestInput print "Last input:", h.lastInput b.Stop() a.AnEvent += AnEventHandler b.Start(a) PHCStruct.py: class Helper(): def __init__(self): self.currentVal = 0 self.lastVal = 0 self.lastLastVal = 0 self.NotPast90 = True self.NotPast180 = True self.bestInput = 0 self.lastInput = 0 PythonHelpClasses has two small classes I wrote in C# before I realised how to do it in Ironpython. Executor runs a delegate asynchronously while it's running member is true. The important code: public void Start(HasAnEvent hae) { running = true; RunDelegate r = new RunDelegate(hae.UpdateNumber); AsyncCallback ac = new AsyncCallback(UpdateDone); IAsyncResult ar = r.BeginInvoke(Input, ac, null); } public void Stop() { running = false; } public void UpdateDone(IAsyncResult ar) { RunDelegate r = (RunDelegate)((AsyncResult)ar).AsyncDelegate; r.EndInvoke(ar); if (running) { AsyncCallback ac = new AsyncCallback(UpdateDone); IAsyncResult ar2 = r.BeginInvoke(Input, ac, null); } } HasAnEvent has a function that generates the sin of its input and fires an event with that result as its argument. i.e.: public void UpdateNumber(double val) { AnEventArgs e = new AnEventArgs(Math.Sin(val)); System.Threading.Thread.Sleep(1000); if (null != AnEvent) { AnEvent(e); } } The sleep is in there just to slow things down a bit. The problem I am getting is that the algorithm is not coming up with the best input being PI/2 and the final input being PI, but I can't see why. Also the best and final inputs are different each time I run the programme. Can anyone see why? Also when the algorithm terminates the best and final inputs are printed to the screen multiple times, not just once. Can someone explain why?

    Read the article

  • Performing your own runtime analysis of your code in C#

    - by Matt
    I have written a large C# app with many methods in many classes. I'm trying to keep a log of what gets called and how often during my development. (I keep a record in a DB) Every method is padded with the following calls: void myMethod() { log(entering,args[]); log(exiting,args[]); } Since I want to do this for all my methods, is there a better way to do this then having to replicate those lines of code in every method?

    Read the article

  • How do I prevent JAXB from binding superclass methods of the @XmlRootElement when marshalling?

    - by Matt Fisher
    I have a class that is annotated as the @XmlRootElement with @XmlAccessorType(XmlAccessType.NONE). The problem that I am having is that the superclass's methods are being bound, when I do not want them to be bound, and cannot update the class. I am hoping there is an annotation that I can put on the root element class to prevent this from happening. Example: @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) public class Person extends NamedObject { @XmlElement public String getId() { ... } } I would expect that only the methods annotated @XmlElement on Person would be bound and marshalled, but the superclass's methods are all being bound, as well. The resulting XML then has too much information. How do I prevent the superclass's methods from being bound without having to annotate the superclass, itself?

    Read the article

  • casting, converting, and input from textbox controls

    - by Matt
    Working on some .aspx.cs code and decided I would forget how to turn a textbox value into a useable integer or decimal. Be warned I'm pretty new to .asp. Wish I could say the same for c sharp. So the value going into my textbox (strawberryp_textbox) is "1" which I presume I can access with the .text property. Which I then parse into a int. The Error reads Format Exception was unhandled by user code. My other question is can I do operations on a session variable? protected void submit_order_button_Click(object sender, EventArgs e) { int strawberryp; int strawberrys; decimal money1 = decimal.Parse(moneybox1.Text); decimal money2 = decimal.Parse(moneybox2.Text); decimal money3 = decimal.Parse(moneybox3.Text); decimal money4 = decimal.Parse(moneybox4.Text); decimal money5 = decimal.Parse(moneybox5.Text); strawberryp = int.Parse(strawberryp_Textbox.Text); //THE PROBLEM RIGHT HERE! strawberrys = int.Parse(strawberrys_Textbox.Text); // Needs fixed int strawberryc = int.Parse(strawberryc_Textbox.Text); //fix int berryp = int.Parse(berryp_Textbox.Text); //fix int raspberryp = int.Parse(raspberryp_Textbox.Text); /fix decimal subtotal = (money1 * strawberryp) + (money2 * strawberrys) + (money3 * strawberryc) + (money4 * berryp) + (money5 * raspberryp); //check to see if you can multiply decimal and int to get a deciaml!! Session["passmysubtotal"] = subtotal; //TextBox2.Text; (strawberryp_Textbox.Text);//TextBox4.Text; add_my_order_button.Enabled = true; add_my_order_button.Visible = true; submit_order_button.Enabled = false; submit_order_button.Visible = false; strawberryp_Textbox.ReadOnly = false; strawberrys_Textbox.ReadOnly = false; strawberryc_Textbox.ReadOnly = false; berryp_Textbox.ReadOnly = false; raspberryp_Textbox.ReadOnly = false; Response.Redirect("reciept.aspx"); } Thanks for the help

    Read the article

  • Load remote csv into CHCSVParser

    - by Matt
    Hey guys. I'm using Dave DeLong's CHCSVParser to parse a csv. I can parse the csv locally, but I cannot get it load a remote csv file. I have been staring at my MacBook way too long today and the answer is right in front of me. Here's my code: NSString *urlStr = [[NSString alloc] initWithFormat:@"http://www.somewhere.com/LunchSpecials.csv"]; NSURL *lunchFileURL = [NSURL URLWithString:urlStr]; NSStringEncoding encoding = 0; CHCSVParser *p = [[CHCSVParser alloc] initWithContentsOfCSVFile:[lunchFileURL path] usedEncoding:&encoding error:nil]; [p setParserDelegate:self]; [p parse]; [p release]; Thanks for any help that someone can give me.

    Read the article

  • Unsure of how to get the right evaluation order

    - by Matt Fenwick
    I'm not sure what the difference between these two pieces of code is (with respect to x), but the first one completes: $ foldr (\x y -> if x == 4 then x else x + y) 0 [1,2 .. ] 10 and the second one doesn't (at least in GHCi): $ foldr (\x (y, n) -> if x == 4 then (x, n) else (x + y, n + 1)) (0, 0) [1,2 .. ] ....... What am I doing wrong that prevents the second example from completing when it hits x == 4, as in the first one? I've tried adding bang-patterns to both the x and to the x == 4 (inside a let) but neither seems to make a difference.

    Read the article

  • Why does gcc add symbols to non-debug build?

    - by Matt Holgate
    When I do a release build with gcc (i.e. I do not specify -g), I still seem to end up with symbols in the binary, and have to use strip to remove them. In fact, I can still breakpoint functions and get backtraces in gdb (albeit without line numbers). This surprised me - can anyone explain why this happens? e.g. #include <stdio.h> static void blah(void) { printf("hello world\n"); } int main(int argc, char *argv[]) { blah(); return 0; } gcc -o foo foo.c nm foo | grep blah: 08048374 t blah

    Read the article

  • CSS Design question, I've got myself completely turned around.

    - by Matt Dawdy
    Okay, I have a couple of other questions out there, but I think I'd better just ask from the beginning how you CSS experts would do this. Client's page is split into 2 rows -- header has some info, some aligned to left of page, some to right, some in the middle. This is currently done using a table. I'm fine with leaving this alone or changing it. My real question is that I need a page layout to handle the following: 2 columns - column on left is 200px, but can be "close" down to to 10px (not a slider, it's either 200 or 10 px). The column on the right needs to be as big as it needs to be -- which might be larger than the width of the page. When left column is "closed" then the right column slides over of course. Again, this right column might be 300px or it might be 4000 pixels (it's a reporting interface). Now, to add another wrinkle, SOME pages have 3 columns. The first 2 columns are each exactly 200px, and both can be "closed" down to 10 px each. But, the user may not close both columns, maybe just 1. Or none. Or both. The third column needs to act just like I described above, being able to be larger than the page width, and sliding over to take advantage of any of the "closed" left columns. Whew! I'm pretty confused as to how to go about this, as either I get it right but I can't scroll over to the right at all (overflow: hidden) and information is lost, or the right column jumps down below the left 2 columns and just looks plain stupid. My minimum browser requirements are IE8, FF3.5, Chrome and Safari (latest versions of all). Any and all pointers are gladly accepted.

    Read the article

  • How to cache YUI DataSource?

    - by Matt McCormick
    I'm setting up a YUI DataTable with filtering by following the steps on the YUI site However, I am using JSON as the DataSource ResponseType. When I type in a value to filter, the request will be sent to the server again. I find this to be wasteful as all the data has already been retrieved the first time. Is there a way to cache the initial data returned and then filter only according to that data so another AJAX request does not have to be made?

    Read the article

  • How to create a JAX-RS service where the sub-resource @Path doesn't have a leading slash

    - by Matt
    I've created a JAX-RS service (MyService) that has a number of sub resources, each of which is a subclass of MySubResource. The sub resource class being chosen is picked based on the parameters given in the MyService path, for example: @Path("/") @Provides({"text/html", "text/xml"}) public class MyResource { @Path("people/{id}") public MySubResource getPeople(@PathParam("id") String id) { return new MyPeopleSubResource(id); } @Path("places/{id}") public MySubResource getPlaces(@PathParam("id") String id) { return new MyPlacesSubResource(id); } } where MyPlacesSubResource and MyPeopleSubResource are both sub-classes of MySubResource. MySubResource is defined as: public abstract class MySubResource { protected abstract Results getResults(); @GET public Results get() { return getResults(); } @GET @Path("xml") public Response getXml() { return Response.ok(getResults(), MediaType.TEXT_XML_TYPE).build(); } @GET @Path("html") public Response getHtml() { return Response.ok(getResults(), MediaType.TEXT_HTML_TYPE).build(); } } Results is processed by corresponding MessageBodyWriters depending on the mimetype of the response. While this works it results in paths like /people/Bob/html or /people/Bob/xml where what I really want is /people/Bob.html or /people/Bob.xml Does anybody know how to accomplish what I want to do?

    Read the article

  • symfony 1.4 adding a BCC recipient to mailer

    - by Matt
    I know with swift directly you can create a Recipient_List and do -addBcc() . How would i do this same thing in the context of symfony 1.4 $message = $this->getMailer()->compose(); $message->setSubject(sfConfig::get('app_email_welcome_subject')); $message->setTo($user->getUsername()); $message->setFrom(sfConfig::get('app_email_from'));

    Read the article

  • Dynamically Forming a JSON object traversion without using eval.

    - by Matt Willhite
    Given I have the following: (which is dynamically generated and varies in length) associations = ["employer", "address"]; Trying to traverse the JSON object, and wanting to form something like the following: data.employer.address or data[associations[0]][association[1]] Without doing this: eval("data."+associations.join('.')); Finally, I may be shunned for saying this, but is it okay to use eval in an instance like this? Just retrieving data.

    Read the article

< Previous Page | 39 40 41 42 43 44 45 46 47 48 49 50  | Next Page >