Search Results

Search found 4242 results on 170 pages for 'mark simson'.

Page 54/170 | < Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | 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 (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

  • WCF Duplex Interaction with Web Server

    - by Mark Struzinski
    Here is my scenario, and it is causing us a considerable amount of grief at the moment: We have a vendor web service which provides base level telephony functionality. This service has a SOAP api, which we are leveraging to build up a custom UI that is integrated into our in house web apps. The api functions on 2 levels. You make standard client calls into the service to initiate actions, such as Login, Place Call, Hang Up, etc. On a different thread, the service sends events back to the client to alert the user of things that are occurring on the system (agent successfully logged in, call was disconnected, etc). I implemented a WCF service to sit between the web server and the vendor service. This WCF service operates in duplex mode, establishing a 2 way connection with the web server. The web server makes outbound calls to the WCF service, which routes them to the vendor's web service. Events are received back to the WCF service, which passes them onto the web server via a callback channel on the WCF client. As events are received on the web server, they are placed into a hash table with the user's name as the key, and a .NET queue as the value to hold the event. Each event is enqueued to the agent who owns it. On a 2 second interval, the web page polls the web server via an ajax request to get new events for the logged in user. It hits the hash table for the user key, dequeues any events that are present, and serializes them back up to the web page. From there, they are processed in order and appropriate messages are displayed to the user. This implementation performs well in a single user scenario. The second I put more than 1 user on the system, I start getting frequent timeouts with the following CommunicationException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond We are running Windows Server 2008 R2 both servers. Both the web app and WCF service are running on .NET 3.5. The WCF service is running under the net.tcp protocol in duplex mode. The web app is ASP.NET MVC 2. Has anyone dealt with anything like this scenario? Is there a more efficient way (or a widely accepted pattern) to implement this?

    Read the article

  • Only replace first matching element using PHP's mb_ereg_replace

    - by Mark L
    Hello, I want to replace only the first matching element in a string instead of replacing every matching element in a string $str = 'abc abc abc'; $find = 'abc'; $replace = 'def'; echo mb_ereg_replace( $find, $replace, $str ); This will return "def def def". What would I need to change in the $find or $replace parameter in order to get it to return "def abc abc"?

    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

  • System.ComponentModel.Component in Visual Studio 2008

    - by Mark A Johnson
    I'm maintaining a .Net 2.0 application using Visual Studio 2008. When the application was built, it was originally in Visual Studio 2003 and made use of the System.ComponentModel.Component class for data access. You can drag and drop commands, connections, etc onto the designer surface of the component. In 2008, the data access classes don't "stick" to the component. I.e., the code for the command does not get generated in the class. when did this change? 2005? is there a replacement for this behavior, perhaps using the db pro edition? 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

  • Somewhere to download CSS coverflow?

    - by Mark
    This is my favorite coverflow: http://paulbakaus.com/lab/js/coverflow/ Is there some way to download this? Or is there an implementation guide? All I see are some blog posts with nothing on how to implement. Thanks.

    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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • Python - How to pickle yourself?

    - by Mark
    I want my class to implement Save and Load functions which simply do a pickle of the class. But apparently you cannot use 'self' in the fashion below. How can you do this? self = cPickle.load(f) cPickle.dump(self,f,2)

    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

  • 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

  • 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

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