Search Results

Search found 4270 results on 171 pages for 'mark dawson'.

Page 55/171 | < Previous Page | 51 52 53 54 55 56 57 58 59 60 61 62  | Next Page >

  • Sorting Arrays by More the One Value, and Prioritizing the Sort based on Column data.

    - by Mark Tomlin
    I'm looking for a way to sort an array, based on the information in each row, based on the information in certain cells, that I'll call columns. Each row has columns that must be sorted based on the priority of: timetime, lapcount & timestamp. Each column cotains this information: split1, split2, split3, laptime, lapcount, timestamp. laptime if in hundredths of a second. (1:23.45 or 1 Minute, 23 Seconds & 45 Hundredths is 8345.) Lapcount is a simple unsigned tiny int, or unsigned char. timestamp is unix epoch. The lowest laptime should be at the get a better standing in this sort. Should two peoples laptimes equal, then timestamp will be used to give the better standing in this sort. Should two peoples timestamp equal, then the person with less of a lapcount get's the better standing in this sort. By better standing, I mean closer to the top of the array, closer to the index of zero where it a numerical array. I think the array sorting functions built into php can do this with a callback, I was wondering what the best approch was for a weighted sort like this would be.

    Read the article

  • Sorting Arrays by More the One Value, and Prioritizing the Sort based on Column data.

    - by Mark Tomlin
    I'm looking for a way to sort an array (we call this a row), with an array of values (that I'll call columns). Each row has columns that must be sorted based on the priority of: timetime, lapcount & timestamp. Each column cotains this information: split1, split2, split3, laptime, lapcount, timestamp. laptime if in hundredths of a second. (1:23.45 or 1 Minute, 23 Seconds & 45 Hundredths is 8345.) Lapcount is a simple unsigned tiny int, or unsigned char. timestamp is unix epoch. The lowest laptime should be at the get a better standing in this sort. Should two peoples laptimes equal, then timestamp will be used to give the better standing in this sort. Should two peoples timestamp equal, then the person with less of a lapcount get's the better standing in this sort. By better standing, I mean closer to the top of the array, closer to the index of zero where it a numerical array. I think the array sorting functions built into php can do this with a callback, I was wondering what the best approch was for a weighted sort like this would be.

    Read the article

  • SqlLite/Fluent NHibernate integration test harness initialization not repeatable after large data se

    - by Mark Rogers
    In one of my main data integration test harnesses I create and use Fluent NHibernate's SingleConnectionSessionSourceForSQLiteInMemoryTesting, to get a fresh session for each test. After each test, I close the connection, session, and session factory, and throw out the nested StructureMap container they came from. This works for almost any simple data integration test I can think, including ones that utilize Fluent NHib's PersistenceSpecification object. When I test the application's lengthy database bootstrapping process, which creates and saves thousands of domain objects, I start seeing issues. It's not that the setup and tear down fails, in fact, the test successfully bootstraps the in-memory database as the application would bootstrap the real database in the production environment. The problem occurs when the database bootstrapping occurs a second time on a new in-memory database, with a new session and session factory. The error is: NHibernate.StaleStateException : Unexpected row count: 0; expected: 1 The row count is indeed Unexpected, the row that the application under test is looking for should be in the session. You see, it's not that any data from the last integration test is sticking around, it's that for some reason the session just stops working mid-database-boostrap. And I've looked everywhere for a place I might be holding on to an old session and I can't find one. I've searched through the code for static singleton objects, but there are none anywhere near the code in question. I have a couple StructureMap InstanceScope singleton's but they are getting thrown out with each nested container that is lost after every test teardown. I've tried every possible variation on disposing and closing every object involved with each test teardown and it still fails on this lengthy database bootstrap. But non-bootstrap related database tests appear to work fine. I'm starting to run out of options and may have to surrender lengthy database integration tests in favor of WatiN-based acceptance tests. Can anyone give me any clue about how I can figure out why some of my SingleConnectionSessionSourceForSQLiteInMemoryTesting aren't repeatable? Any advice at all, about how to make an NHibernate SqlLite database integration test harness repeatable?

    Read the article

  • Calculating negative fractions in Objective C

    - by Mark Reid
    I've been coding my way through Steve Kochan's Programming in Objective-C 2.0 book. I'm up to an exercise in chapter 7, ex 4, in case anyone has the book. The question posed by the exercise it will the Fraction class written work with negative fractions such as -1/2 + -2/3? Here's the implementation code in question - @implementation Fraction @synthesize numerator, denominator; -(void) print { NSLog(@"%i/%i", numerator, denominator); } -(void) setTo: (int) n over: (int) d { numerator = n; denominator = d; } -(double) convertToNum { if (denominator != 0) return (double) numerator / denominator; else return 1.0; } -(Fraction *) add: (Fraction *) f { // To add two fractions: // a/b + c/d = ((a * d) + (b * c)) / (b * d) // result will store the result of the addition Fraction *result = [[Fraction alloc] init]; int resultNum, resultDenom; resultNum = (numerator * f.denominator) + (denominator * f.numerator); resultDenom = denominator * f.denominator; [result setTo: resultNum over: resultDenom]; [result reduce]; return result; } -(Fraction *) subtract: (Fraction *) f { // To subtract two fractions: // a/b - c/d = ((a * d) - (b * c)) / (b * d) // result will store the result of the addition Fraction *result = [[Fraction alloc] init]; int resultNum, resultDenom; resultNum = numerator * f.denominator - denominator * f.numerator; resultDenom = denominator * f.denominator; [result setTo: resultNum over: resultDenom]; [result reduce]; return result; } -(Fraction *) multiply: (Fraction *) f { // To multiply two fractions // a/b * c/d = (a*c) / (b*d) // result will store the result of the addition Fraction *result = [[Fraction alloc] init]; int resultNum, resultDenom; resultNum = numerator * f.numerator; resultDenom = denominator * f.denominator; [result setTo: resultNum over: resultDenom]; [result reduce]; return result; } -(Fraction *) divide: (Fraction *) f { // To divide two fractions // a/b / c/d = (a*d) / (b*c) // result will store the result of the addition Fraction *result = [[Fraction alloc] init]; int resultNum, resultDenom; resultNum = numerator * f.denominator; resultDenom = denominator * f.numerator; [result setTo: resultNum over: resultDenom]; [result reduce]; return result; } -(void) reduce { int u = numerator; int v = denominator; int temp; while (v != 0) { temp = u % v; u = v; v = temp; } numerator /= u; denominator /= u; } @end My question to you is will it work with negative fractions and can you explain how you know? Part of the issue is I don't know how to calculate negative fractions myself so I'm not too sure how to know. Many thanks.

    Read the article

  • CSS3 Gradient Borders

    - by Mark
    I'm trying to apply a gradient to a border, I thought it was as simple as doing this: border-color: -moz-linear-gradient(top, #555555, #111111); This does not work, does anyone know what the correct way to do border gradients is. Thanks.

    Read the article

  • How are SaaS/Mult-Tenancy apps implementing email notifications (sending and receving)?

    - by Mark Redman
    Given multi-tenant application, How are vendors implementing email notifications from an email account setup and programming perspective: Sending emails could come from a generic account: eg [email protected] or [email protected], this seems reasonable considering reply addresses and lilnks can be contained within the email contents. Receiving Emails: How would an application receive email, for instance; to generate support tickets or assign comments in an email to a project/task. I have seen ID's within the subject and some reply to addresses containing the account name eg: [email protected] I realise one can programatically connect to a pop3 server and receive emails and look for the IDs with the subject, but is there a way of setting up and receiving email to a single pop3 account from multiple sub-host name email addresses (not sure on terminology there) eg: [email protected] or [email protected] and check the Account Name from the address? (similar to checking subdomains on a URL) Any practices, experience, comments or sughestions? (not sure its relevant, but using C# asp.net-mvc and services etc)

    Read the article

  • Good way to capture/replay sessions from Apache Log?

    - by Mark Harrison
    For performance testing, I would like to capture some traffic from a production server and use that as a basis to replay the request to a test server in order to simulate a realistic load in our development environment. These are all stateless queries, so no issues regarding cookies, sessions, etc. The Apache log timestamps everything down to a 1 second resolution, but that's not fine enough granularity for our peak times. What's the best way to capture more fine-grained timestamps for replay? And is there some ab-like load generating program that can use this data to replicate load?

    Read the article

  • Stop propagating deletes

    - by Mark
    Is it just me or is anyone else finding EF very difficult to use in a real app :( I'm using it as the data layer and have created custom business objects. I'm having difficulty converting the business objects back to EF objects and updating/adding/deleting from the database. Does anyone know a good, simple example of doing this? Actually the current problem that's driving me nuts is when I delete something EF tries to delete other related stuff as well. For example, if I delete an invoice it will also delete the associated customer! Seems odd. I can't figure out how to stop it doing this. // tried: invoiceEfData.CustomerReference = null; // also tried invoiceEfData.Customer = null; context.DeleteObject(invoiceEfData); context.SaveChanges(); // at this point I get a database error due to it attempting to delete the customer

    Read the article

  • Safari Jquery Dialog and Ckeditor

    - by Mark Milford
    Hi I am using a CKEditor in a Jquery Dialog... and in Safari the first time it loads it works but each subsequent time it is blank and no buttons or anything else works in the ckeditor... I have looked at http://stackoverflow.com/questions/2539855/ckeditor-instance-in-a-jquery-dialog and added the suggested dialog-patch.js but it doesn't help $("#TextDialog").dialog({height:400,width:650, modal:true,closeOnEscape:true, autoOpen:false, open: function(event, ui) { $("#Text").ckeditor(); }, close: function(event, ui) { CKEDITOR.remove($("#Text").ckeditorGet()); }}); That is my code, and it works it all browsers (well Chrome, IE and FF) but not in Safari!

    Read the article

  • Are JSF 2.x ViewScoped Beans Thread Safe?

    - by Mark
    I've been googling for a couple hours on this issue to no eval. WELD docs and the CDI spec are pretty clear regarding thread safety of the scopes provided. For example: Application Scope - not safe Session Scope - not safe Request Scope - safe, always bound to a single thread Conversation Scope - safe (due to the WELD proxy serializing access from multiple request threads) I can't find anything on the View Scope defined by JSF 2.x. It is in roughly the same bucket as the Conversation Scope in that it is very possible for multiple requests to hit the scope concurrently despite it being bound to a single view / user. What I don't know is if the JSF implementation serializes access to the bean from multiple requests. Anyone have knowledge of the spec or of the Morraja/MyFaces implementations that could clear this up?

    Read the article

  • How can I hide tracing code in Visual Studio IDE C# ?

    - by Mark
    As I'm starting to put more tracing in my code, i'm realizing it adds a lot of clutter. I know Visual Studio allows you to hide and reveal code, however, i'd like to be able group code into "tracing" code and then hide it and reveal at will as i'm reading the code. I suppose it could do this either per file or per class or per function. Is there any way to do this? What do you guys do? Adding some clarification The hide current feature kind of allows you to do this except that when the code is hidden, you can't tell if its tracing or not. You also can't say "hide all tracing code" and "reveal all tracing code" which is useful when reading a function depending on what you are trying to do.

    Read the article

  • how to initialize a 2d array in perl

    - by Mark
    How do I initialize a 2d array in perl? I am trying the following code: 0 use strict; 10 my @frame_events = (((1) x 10), ((1) x 10)); 20 print "$frame_events[1][1]\n"; but it gives the following error: Can't use string ("1") as an ARRAY ref while "strict refs" in use at ./dyn_pf.pl line 20. This syntax only seems to initialize a 1d array as print "$frame_events[1]\n" works. Though perl doesn't give any error during the assignment.

    Read the article

  • Entry Level Programming Jobs with Applied Math Degree

    - by Mark
    I am about to finish my B.Sc. in Applied Math. I started out in CS a few years back had a bit of a change of heart and decided to go the math route. Now that I am looking for career options finishing up and I'm just wonder how my Applied Math degree will look when applying for programming jobs. I have taken CS courses in C++/Java/C and done 2 semester of Scientific Computing with MATLAB/Mathematica and the like, so I feel like i at least know how to program. Of course I am lacking some of the theoretical courses on the CS. I'd very much like to know how I stack up for a programming job as a math major. Thanks.

    Read the article

  • Reading in Russian characters (Unicode) using a basic_ifstream<wchar_t>

    - by Mark
    Is this even possible? I've been trying to read a simple file that contains Russian, and it's clearly not working. I've called file.imbue(loc) (and at this point, loc is correct, Russian_Russia.1251). And buf is of type basic_string<wchar_t> The reason I'm using basic_ifstream<wchar_t> is because this is a template (so technically, basic_ifstream<T>, but in this case, T=wchar_t). This all works perfectly with english characters... while (file >> ch) { if(isalnum(ch, loc)) { buf += ch; } else if(!buf.empty()) { // Do stuff with buf. buf.clear(); } } I don't see why I'm getting garbage when reading Russian characters. (for example, if the file contains ??? ??? ???, I get "??E", 5(square), K(square), etc...

    Read the article

  • MVVM-Light: The target "RunCodeAnalysis" does not exist in the project when i do build??

    - by mark smith
    Hi there, Just built myself a mvvmlight app and if i press f5 TO COMPILE and run all works ok, it displays the wpf window but if i do a BUILD i get an error Error 1 The target "RunCodeAnalysis" does not exist in the project. I am using the visual studio 2010 professional version RTM The only thing i see strange is the target framework which is set to .NET framework 4 client profile Anybody know why this happens??

    Read the article

  • Is there a way to add name/value functionality to jquery autocomplete for .net?

    - by Mark Kadlec
    I've recently added the JQuery autocomplete plug in and have a textbox that autocompletes a list of employees. It works great and I commend the authors of the plugin. I think the textbox would be MUCH more useful though, when upon selecting, we can extract the StaffID (Ie. retreive the value of the selection). My code is below and you can see that I am simply adding the staff names, would be nice to associate IDs. Does anyone know of any way to do this? My JQuery: $(document).ready(function() { $("#txtStaff").autocomplete('autocompletetagdata.aspx'); }); My ASPX page: protected void Page_Load(object sender, EventArgs e) { StaffViewListClass staffList = StaffViewListClass.GetStaff(); StringBuilder sb = new StringBuilder(); foreach (StaffViewClass staff in staffList) { sb.Append(staff.FullName).Append("\n"); } Response.Write(sb.ToString()); }

    Read the article

  • Using objective-c objects with an NSDictionary

    - by Mark
    I want store a URL against a UILabel so that when a user touches the label it takes them to that URL in a UIWebView. I have declared a NSDictionary like so: NSMutableArray *linksArray = [[NSMutableArray alloc] init]; [linksArray addObject: [NSValue valueWithNonretainedObject: newsItem1ReadMoreLabel]]; [linksArray addObject: [NSValue valueWithNonretainedObject: newsItem2ReadMoreLabel]]; [linksArray addObject: [NSValue valueWithNonretainedObject: newsItem3ReadMoreLabel]]; [linksArray addObject: [NSValue valueWithNonretainedObject: newsItem4ReadMoreLabel]]; [linksArray addObject: [NSValue valueWithNonretainedObject: newsItem5ReadMoreLabel]]; //NSString *ageLink = @"http://www.theage.com.au"; NSArray *defaultLinks = [NSArray arrayWithObjects: @"1", @"2", @"3", @"4", @"5", nil]; self.urlToLinkDictionary = [[NSMutableDictionary alloc] init]; self.urlToLinkDictionary = [NSDictionary dictionaryWithObjects:defaultLinks forKeys:linksArray]; Considering I used a NSValue as the key, how do I get/set the URL associated with that key given that I only have references to the UILabels? this is what I have but it doesn't work: for(NSValue *key in [self.urlToLinkDictionary allKeys]) { if ([key nonretainedObjectValue] == linkedLabel) { [self.urlToLinkDictionary setValue:[newsItem link] forKey: key]; } } but I get an error: "objc_exception_throw" resolved

    Read the article

  • What is the best algorithm for this problem?

    - by mark
    What is the most efficient algorithm to solve the following problem? Given 6 arrays, D1,D2,D3,D4,D5 and D6 each containing 6 numbers like: D1[0] = number D2[0] = number ...... D6[0] = number D1[1] = another number D2[1] = another number .... ..... .... ...... .... D1[5] = yet another number .... ...... .... Given a second array ST1, containing 1 number: ST1[0] = 6 Given a third array ans, containing 6 numbers: ans[0] = 3, ans[1] = 4, ans[2] = 5, ......ans[5] = 8 Using as index for the arrays D1,D2,D3,D4,D5 and D6, the number that goes from 0, to the number stored in ST1[0] minus one, in this example 6, so from 0 to 6-1, compare each res array against each D array My algorithm so far is: I tried to keep everything unlooped as much as possible. EML := ST1[0] //number contained in ST1[0] EML1 := 0 //start index for the arrays D While EML1 < EML if D1[ELM1] = ans[0] goto two if D2[ELM1] = ans[0] goto two if D3[ELM1] = ans[0] goto two if D4[ELM1] = ans[0] goto two if D5[ELM1] = ans[0] goto two if D6[ELM1] = ans[0] goto two ELM1 = ELM1 + 1 return 0 //bad row of numbers, if while ends two: EML1 := 0 start index for arrays Ds While EML1 < EML if D1[ELM1] = ans[1] goto two if D2[ELM1] = ans[1] goto two if D3[ELM1] = ans[1] goto two if D4[ELM1] = ans[1] goto two if D5[ELM1] = ans[1] goto two if D6[ELM1] = ans[1] goto two ELM1 = ELM1 + 1 return 0 three: EML1 := 0 start index for arrays Ds While EML1 < EML if D1[ELM1] = ans[2] goto two if D2[ELM1] = ans[2] goto two if D3[ELM1] = ans[2] goto two if D4[ELM1] = ans[2] goto two if D5[ELM1] = ans[2] goto two if D6[ELM1] = ans[2] goto two ELM1 = ELM1 + 1 return 0 four: EML1 := 0 start index for arrays Ds While EML1 < EML if D1[ELM1] = ans[3] goto two if D2[ELM1] = ans[3] goto two if D3[ELM1] = ans[3] goto two if D4[ELM1] = ans[3] goto two if D5[ELM1] = ans[3] goto two if D6[ELM1] = ans[3] goto two ELM1 = ELM1 + 1 return 0 five: EML1 := 0 start index for arrays Ds While EML1 < EML if D1[ELM1] = ans[4] goto two if D2[ELM1] = ans[4] goto two if D3[ELM1] = ans[4] goto two if D4[ELM1] = ans[4] goto two if D5[ELM1] = ans[4] goto two if D6[ELM1] = ans[4] goto two ELM1 = ELM1 + 1 return 0 six: EML1 := 0 start index for arrays Ds While EML1 < EML if D1[ELM1] = ans[0] return 1 //good row of numbers if D2[ELM1] = ans[0] return 1 if D3[ELM1] = ans[0] return 1 if D4[ELM1] = ans[0] return 1 if D5[ELM1] = ans[0] return 1 if D6[ELM1] = ans[0] return 1 ELM1 = ELM1 + 1 return 0 As language of choice, it would be pure c

    Read the article

  • Django stupid mark_safe?

    - by Mark
    I wrote this little function for writing out HTML tags: def html_tag(tag, content=None, close=True, attrs={}): lst = ['<',tag] for key, val in attrs.iteritems(): lst.append(' %s="%s"' % (key, escape_html(val))) if close: if content is None: lst.append(' />') else: lst.extend(['>', content, '</', tag, '>']) else: lst.append('>') return mark_safe(''.join(lst)) Which worked great, but then I read this article on efficient string concatenation (I know it doesn't really matter for this, but I wanted consistency) and decided to update my script: def html_tag(tag, body=None, close=True, attrs={}): s = StringIO() s.write('<%s'%tag) for key, val in attrs.iteritems(): s.write(' %s="%s"' % (key, escape_html(val))) if close: if body is None: s.write(' />') else: s.write('>%s</%s>' % (body, tag)) else: s.write('>') return mark_safe(s.getvalue()) But now my HTML get escaped when I try to render it from my template. Everything else is exactly the same. It works properly if I replace the last line with return mark_safe(unicode(s.getvalue())). I checked the return type of s.getvalue(). It should be a str, just like the first function, so why is this failing?? Also fails with SafeString(s.getvalue()) but succeeds with SafeUnicode(s.getvalue()). I'd also like to point out that I used return mark_safe(s.getvalue()) in a different function with no odd behavior.

    Read the article

  • How do I do an AJAX post to a url within a class library but not the same IIS Web Application?

    - by Mark Adesina
    I have been working with ajax and there has been no problems below is how my ajax post code look like: $.ajax({ type: "POST", url: '<%=ResolveUrl("TodoService.asmx/CreateNewToDo")%>', data: jsonData, contentType: "application/json; charset=utf-8", datatype: "json", success: function () { //if (msg.d) { $('#ContentPlaceHolder1_useridHiddenField').val(""); $('#ContentPlaceHolder1_titleTextBox').val(""); $('#ContentPlaceHolder1_destTextBox').val(""); $('#ContentPlaceHolder1_duedateTextBox').val(""); alert('Your todo has been saved'); // } }, error: function (msg) { alert('There was an error processing your request'); } }); However, the problem came up when I try to get the url to a webservice that is located in a class library within the same solution.

    Read the article

  • How to collect the new "Applications and Services Logs" found on Windows 7 or Windows Server 2008 us

    - by Mark
    In Windows Server 2008 and Windows 7 there are new Events categorized under "Applications and Services Logs". There is also a subfolder called Microsoft which has tons of subfolders as well. Is there any way to collect these events through WMI? For the regular "Windows Logs" such as Application and Security, it is possible to use the Win32_NTLogEvent WMI class in the cimv2 namespace. However, this class does not provide access to the new Microsoft event logs. Any ideas?

    Read the article

< Previous Page | 51 52 53 54 55 56 57 58 59 60 61 62  | Next Page >