Search Results

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

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

  • Repeated properties design pattern

    - by Mark
    I have a DownloadManager class that manages multiple DownloadItem objects. Each DownloadItem has events like ProgressChanged and DownloadCompleted. Usually you want to use the same event handler for all download items, so it's a bit annoying to have to set the event handlers over and over again for each DownloadItem. Thus, I need to decide which pattern to use: Use one DownloadItem as a template and clone it as necessary var dm = DownloadManager(); var di = DownloadItem(); di.ProgressChanged += new DownloadProgressChangedEventHandler(di_ProgressChanged); di.DownloadCompleted += new DownloadProgressChangedEventHandler(di_DownloadCompleted); DownloadItem newDi; newDi = di.Clone(); newDi.Uri = "http://google.com"; dm.Enqueue(newDi); newDi = di.Clone(); newDi.Uri = "http://yahoo.com"; dm.Enqueue(newDi); Set the event handlers on the DownloadManager instead and have it copy the events over to each DownloadItem that is enqeued. var dm = DownloadManager(); dm.ProgressChanged += new DownloadProgressChangedEventHandler(di_ProgressChanged); dm.DownloadCompleted += new DownloadProgressChangedEventHandler(di_DownloadCompleted); dm.Enqueue(new DownloadItem("http://google.com")); dm.Enqueue(new DownloadItem("http://yahoo.com")); Or use some kind of factory var dm = DownloadManager(); var dif = DownloadItemFactory(); dif.ProgressChanged += new DownloadProgressChangedEventHandler(di_ProgressChanged); dif.DownloadCompleted += new DownloadProgressChangedEventHandler(di_DownloadCompleted); dm.Enqueue(dif.Create("http://google.com")); dm.Enqueue(dif.Create("http://yahoo.com")); What would you recommend?

    Read the article

  • IIS and Flash forceSmoothing issue

    - by Mark Kennerley
    Hi everyone, I am incorporating a Flash Flickr Polaroid file into my site, http://www.no3dfx.com/polaroid/ But I am having problems with the images being smooth. I have edited the code throughout with forceSmoothing = true and _quality = best. It all works and looks smooth if I test the file in the preview window and if I run the HTML file. But as soon as I put the file under IIS the smoothing stops. All my flash players are v10+ I have turned the IIS compression off but no luck. Can anyone please help with this? Thanks, Clyde

    Read the article

  • Looking for streaming xml pretty printer in C/C++ using expat or libxml2

    - by Mark Zeren
    I'm looking for a streaming xml pretty printer for C/C++ that's either self contained or that uses libxml2 or expat. I've searched a bit and not found one. It seems like something that would be generally useful. Am I missing an obvious tool that does this? Background: I have a library that outputs xml without whitespace all on one line. In some cases I'd like to pretty print that output. I'm looking for a BSD-ish licensed C/C++ library or sample code that will take a raw xml byte stream and pretty print it. Here's some pseudo code showing one way that I might use this functionality: void my_write(const char* buf, int len); PrettyPrinter pp(bind(&my_write)); while (...) { // ... get some more xml ... const char* buf = xmlSource.get_buf(); int len = xmlSource.get_buf_len(); int written = pp.write(buf, len); // calls my_write with pretty printed xml // ... error handling, maybe call write again, etc. ... } I'd like to avoid instantiating a DOM representation. I already have dependencies on the expat and libxml2 shared libraries, and I'd rather not add any more shared library dependencies.

    Read the article

  • Automatically charge PayPal account?

    - by Mark
    I'd like to automatically charge my members a variable amount of money based on the services they use on my website. They would accumulate a balance owing, and then every week they would be charged for that amount. Is there a way I can do this without having to store their credit card information in my database? (Similar to my last question, but I just realized I don't really want to go through the headaches and liability issues of having to safely store CC info)

    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

  • Best ways to collaborate with small number of people

    - by Mark Szymanski
    Hi, I am collaborating with someone on a project and currently use Skype for collaboration. I like it because we can be on a call to say things that are hard to say by typing out. We can share our screens so we can help with code writing. And we can use the text chat to copy-paste code between each other. We also use Subversion for version control. I just wanted to know what other people used for collaborating with others so I could see whats out there to use. Thanks!

    Read the article

  • ASP.NET Gridview Checkbox value to DataTable

    - by Mark
    Hey all, First off, im using a checkbox to highlight a true or false value from a dataset which I want to be able to change it. Unfortunately databinding the DataTable to the GridView checkboxes doesnt work (as you probably know) as it requires it to be in "edit" mode. The way I've gotten round this is having the checkbox reading the data table value seperately rather than being databound and locked: Checked='<%# Convert.ToBoolean(Eval("myValue")) %>' So that solves checkbox values from DataTable - GridView, now I need to do the opposite having the changed checkbox values go from GridView - DataTable as it is not ready to submit it to my data source (SQL) just yet. I figure I need to run a loop through the GridView rows, thats a give'un, what I can't figure out is how to replace/update just a single value in a row of a DataTable , only the ability to add or remove an entire row by the looks of things (something I don't want to do). So can anyone offer a workaround? Or is there a way to have a databound but always editable checkbox in a gridview?

    Read the article

  • Browser security when calling HTTP assets via a SWF on a HTTPS site

    - by Mark Ursino
    We have a site that runs on HTTPS and needs to pull in various JS assets to run a video player on the page. We get a browser security warning on this page because the JS files we are externally calling are being accessed via HTTP, not HTTPS. E.g. // HTTP reference on a HTTPS site <script src="http://the-cdn.tld/player.js"></script> Simply accessing this one JS assets via HTTP and not HTTPS will cause the browser security warning which we need to get rid of. The provider of the JS file does not support an HTTPS equivalent (like Google Analytics does). We would ideally love to just do the following, but the provider does not have this: // HTTPS reference on a HTTPS site <script src="https://the-cdn.tld/player.js"></script> One option we had was to just download a copy of the JS file and serve it on the HTTPS site, however we have concerns with this as it is not recommended by the provider and will not include updates from them. Assuming we cannot do that, we were thinking a possible other option would be to use a SWF file as a proxy. We were thinking that we could have one of our flash guys create a SWF that loads in the HTTP-served JS file to the page. We were wondering that if this SWF makes the request, would that prevent the browser from showing the security warning or not? I assumed that we would still see the warning since the SWF is still making the request through the browser, but I wanted to see what the hive mind thinks.

    Read the article

  • Can the behaviour of new HTML5 form types be overridden?

    - by Mark Perkins
    I was wondering if anyone knew if it were possible to override the default behaviour of browsers that support the new HTML input types such as type="email" and type="date"? I appreciate that I could test if a browser supports an input type and provide a fallback for those browsers that don't, but what I want to know is is there any way to prevent that default behaviour from happening in browsers that do support it? For instance, if in Opera I want to use the date input type, but I don't want Opera to display the native datepicker (i.e. I want to replace it with my own custom one) is that possible? Are there any DOM events triggered like onDatePickerShow that one can hook into? I don't believe that this is possible, but if anyone knows for sure one way or the other I would love to hear from you.

    Read the article

  • Workaround for basic syntax not being parsed.

    - by Mark Tomlin
    I want to have a class property that allow for an expression to take place on the right side of the equals sign. All versions of PHP choke on the following code, but it is written in this way to allow for easier extendibility in the future. /* Example SDK Class */ class SDK { /* Runtime Option Flags */ // Strings # 0: Makes no change to the strings. var $STRING_NONE = (1 << 0); # 1: Removes color codes from the string. var $STRING_STRIP_COLOR = (1 << 1); # 2: Removes language codes from the string. var $STRING_STRIP_LANG = (1 << 2); # 3: Removes all formatting from the string. var $STRING_STRIP = SELF::STRING_STRIP_COLOR & SELF::STRING_STRIP_LANG; # 4: Converts color codes to HTML & UTF-8. var $STRING_HTML = (1 << 3); # 8: Converts color codes to ECMA-48 escape color codes & UTF-8. var $STRING_CONSOLE = (1 << 4); # 16: Changes player names only. var $STRING_NAMES = (1 << 5); # 32: Changes host names only. var $STRING_HOSTS = (1 << 6); function SDK($fString = SELF::STRING_HTML & SELF::STRING_NAMES & SELF_HOST) { // constructor code. } } $SDK &= new SDK(SDK::STRING_NONE); (1 << 0) seems like very basic syntax to me, and is not fathomable why PHP would not allow for such a thing. Can anyone think of a work around that would maintain readability and future expandability of the following code?

    Read the article

  • Replace in place, parsing & string manipulation.

    - by Mark Tomlin
    I'm trying to replace a set of characters within a string. The string may or may not have any data to change. The string is marked up in a way that allows for it to change it's color from a set of characters. The string can reset it's it's formatting to default by using a defined set of characters. This setup is very much like the ECMA-48 standard used on LINUX consoles for colors and other special effects. Where one string could be ^0Black^1Red^2Green^3Yellow^4Blue^5Purple^6Cyan^7White Producing the following HTML: <span style="color: #000">Black</span><span style="color: #F00">Red</span><span style="color: #0F0">Green</span><span style="color: #FF0">Yellow</span><span style="color: #00F">Blue</span><span style="color: #F0F">Purple</span><span style="color: #0FF">Cyan</span><span style="color: #FFF">White</span> Another string (^1Error^8: ^3User Error) could also produce: <span style="color: #F00">Error</span>: <span style="color: #FF0">User Error</span> You might of noticed the ^8 part of that string resets the color for that part of the string. What's the best way to go about parsing these kinds of strings?

    Read the article

  • PyLab - changing text color and background fill color of text box

    - by Mark
    Hey all, I'm using PyLab to make some graphs in Python. I want to make a text box that is colored magenta with black text, but cannot get the text to be black. text(x, y, 'Summary', backgroundcolor = 'm', color = 'k') This gives me a magenta background and then text that is almost just as pink. Any ideas what I'm doing wrong? Many thanks!

    Read the article

  • plot markers on google maps with json and jquery

    - by mark
    I am trying to plot the markers as defined in a json file om Google Maps but they don't show on the map. Can somebody help me with this problem? This is the Json file: http://sionvalais.com/gmap/markers/ This is the Javascritp function: function loadMarkers() { var bounds = map.getBounds(); var zoomLevel = map.getZoom(); $.post("/gmaps/markers/index.php", {zoom: zoomLevel, swLat: bounds.getSouthWest().lat(), swLon: bounds.getSouthWest().lng(), neLat: bounds.getNorthEast().lat(), neLon: bounds.getNorthEast().lng()}, function(data) { processMarkers(data, _smallMarkerSize); }, "json" ); } function processMarkers(webcams, markerSize) { var marker = null; var markersInView = new Array(); var idsInView = new Array(); // Loop through the new webcams for (var i = 0; i < webcams.length; i++) { var idx = markers.indexOf(webcams[i].id); if (idx == -1) { var info_html = "<table class='infowindow'>"; info_html += "<tr><td class='img'>"; info_html += "<img src='" + webcams[i].smallimg + "' /><td>"; info_html += "<td><p><b>" + webcams[i].loc + "</b>"; info_html += "<br /><a href='/webcam/" + webcams[i].url + "' target='_blank'>Show webcam</a></p></td></tr>"; info_html += "</table>"; marker = new WebcamMarker(new GLatLng(webcams[i].latitude, webcams[i].longitude), {image: "" + webcams[i].smallimg + "", height: markerSize, width: markerSize}); marker.myhtml = info_html; map.addOverlay(marker); markersInView[webcams[i].id] = marker; } else { markersInView[webcams[i].id] = markers[webcams[i].id]; } idsInView.push(webcams[i].id); } // Now remove the markers outside of the viewport for (var i = 0; i < webcamids.length; i++) { var idx = markersInView.indexOf(webcamids[i]); if (idx == -1) { marker = markers[webcamids[i]]; map.removeOverlay(marker); } } markers = markersInView; webcamids = idsInView; }

    Read the article

  • show/hide a link if certain jquery ui tab is selected.

    - by Mark
    When #my-text-link is clicked, i need to select tab 5 and when tab 5 is selected i need to hide #my-text-link. hope this makes sense, heres the code, and also what I have done so far, please feel free to show me a better way. Thanks in advance var $tabs = $('.tabbed').tabs(); // first tab selected $('#my-text-link').click(function() { // bind click event to link $tabs.tabs('select', 4); // switch to third tab $('#my-text-link').hide(); return false; }); <a href="#" id="my-text-link"></a> <ul> <li class="one"><a href="#tabs-1" title="Summary"></a></li> <li class="two"><a href="#tabs-2" title="Detailed Info"></a></li> <li class="three"><a href="#tabs-3" title="Images"></a></li> <li class="four"><a href="#tabs-4" title="Reviews"></a></li> <li class="five"><a href="#tabs-5" title="Dates &amp; Prices"></a></li> </ul> <div id="tabs-1"></div> <div id="tabs-2"></div> <div id="tabs-3"></div> <div id="tabs-4"></div> <div id="tabs-5"></div>

    Read the article

  • WPF: Restyling a window?

    - by mark smith
    Hi there, does anyone know if its possible to restyle a window in wpf. Or even better any tutorials or samples? Basically i would like to change the minimize and maximize buttons - oh and the close button to be slightly bigger.... I have expression blend.... Is this possible? I saw some samples in infragistics sample apps which have some great looking forms and as far as i can tell it doesn't use any custom wpf controls... Any ideas really appreciated

    Read the article

  • Highlighting in Solr 1.4 - requireFieldMatch

    - by Mark Redding
    I have an object Title : foo Summary : foo bar Body : this is a published story about a foo and a bar All three are set up as fields with stored=true. The user searches across my system for the word "foo" I would like to highlight foo in all three places. The user searches for the word foo in the title "title:foo" I only want to highlight foo within the title. When I added hl.requireFieldMatch=true and hl.usePhraseHighlighter=true as part of my query over to SOLR I am unable to get the highlighting in all three places when doing a generic non fielded search. Is there a way to get both scenarios to work? I had these two items turned off, but I am adding in some fielded portions of the query that the user does not see which only display Published items for instance. the problem is (foo AND status:published) is causing the word published in the body to highlight when the user only searched for the word "foo".

    Read the article

  • How often do you find javascript disabled on browsers?

    - by Mark Redman
    I have started using ajax/jQuery in our websites / application. There are many plugins that support degrading the javascript to browsers that dont have javascript enabled and techniques to support this. What are peoples thoughts on javascript support, we build applications rather than just websites and are looking to just support javascript enabled browsers as a pre-requisite assuming that most people or companies have javascript enabled. Do you find most people have javascript? do you monitor the percentage of javascript/non-javascript browsers (I guess this can be done with website stats) and what are the numbers regarding this?

    Read the article

  • jQuery Validate: Checked *or* Filled?

    - by Mark
    required( dependency-expression ) They give an example of required: "#other:checked" but I want my field to be required if the #other field is either :checked or :filled (I don't know whether it will be a checkbox, radio button, or textbox beforehand). How would I do this?

    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

  • Too many false positives when using FxCop.

    - by mark
    Dear ladies and sirs. We are using FxCop and it generates too many false positives to our liking. For instance, if a private method is invoked using reflection, then this method is reported as potentially unused - understandable and we suppress this warning explicitly using the SuppressMessage attribute. However, FxCop reports the same warning for the methods invoked from that method, which we already suppressed warnings about. This is stupid and generates too much noise. There are also false reports on member variables used in these methods. Also, there are problems with generic types (I even saw something about it in MS connect). Anyway, I am wondering if anyone knows whether Microsoft is going to upgrade FxCop, because it seems to be stuck in version 1.36 for a long time. BTW, I we do not use StyleCop, because it is way too picky and we just do not have the time to examine all the zillion messages in order to suppress them all. Besides, the StyleCop report seem to augment, rather than replace FxCop. Maybe anyone can suggest a good alternative to FxCop? We are using VS2008 pro. Thanks.

    Read the article

  • Use same project to create multiple applications on same device

    - by Mark.Prof
    I am deploying a reader application with it's document packaged in the asset folder. Any branding is done by dynamically generating xml and resources as appropriate. The application name itself is also generated. Since it is the tag's "package" property that needs to be unique, I nevertheless have a problem installing more than one instance of this app. I would like to dynamically edit the manifest package attribute's value to reflect the document and brand that I am building. But this causes build problems, specifically the location of R.java is no longer available to the component package under which the code resides. Originally, the component package is the same as the application manifest package. But precisely this manifest package name is the part that needs to be variable. How should I best proceed?

    Read the article

  • How fast can you make linear search?

    - by Mark Probst
    I'm looking to optimize this linear search: static int linear (const int *arr, int n, int key) { int i = 0; while (i < n) { if (arr [i] >= key) break; ++i; } return i; } The array is sorted and the function is supposed to return the index of the first element that is greater or equal to the key. They array is not large (below 200 elements) and will be prepared once for a large number of searches. Array elements after the n-th can if necessary be initialized to something appropriate, if that speeds up the search. No, binary search is not allowed, only linear search.

    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, 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

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