Search Results

Search found 8367 results on 335 pages for 'temporal difference'.

Page 90/335 | < Previous Page | 86 87 88 89 90 91 92 93 94 95 96 97  | Next Page >

  • Why does Color.IsNamedColor not work when I create a color using Color.FromArgb()?

    - by Jon B
    In my app I allow the user to build a color, and then show him the name or value of the color later on. If the user picks red (full red, not red-ish), I want to show him "red". If he picks some strange color, then the hex value would be just fine. Here's sample code that demonstrates the problem: static string GetName(int r, int g, int b) { Color c = Color.FromArgb(r, g, b); // Note that specifying a = 255 doesn't make a difference if (c.IsNamedColor) { return c.Name; } else { // return hex value } } Even with very obvious colors like red IsNamedColor never returns true. Looking at the ARGB values for my color and Color.Red, I see no difference. However, calling Color.Red.GetHashCode() returns a different hash code than Color.FromArgb(255, 0, 0).GetHashCode(). How can I create a color using user specified RGB values and have the Name property come out right?

    Read the article

  • Validating a Postscript without trying to print it?

    - by Epaga
    Saving data to Postscript in my app results in a Postscript file which I can view without issues in GhostView, but when I try to print it, the printer isn't able to print it because it seems to be invalid. Is there a way to validate / find errors in Postscript files without actually sending it to a printer? Preferred would be some kind of Java API/library, but a program which does the same would be fine as well. Edit #1 : no I don't know why it's invalid, nor even necessarily if it's invalid, but would like to be able to validate it outside of ghostview, or figure out what's going on when it can't print. Answer : Well using the ps2ps trick I was able to see the output that Postscript does and there check the difference. The difference was that I am not allowed to have a decimal number for the width or height of images in the Postscript, but rather only integers. So I still didn't find a way to validate, but this way was good enough for my problem. Thanks.

    Read the article

  • Class variable defined at @implementation rather than @interface?

    - by bitcruncher
    Hello. I'm new to Objective-C, but I am curious about something that I haven't really seen addressed anywhere else. Could anyone tell me what is the difference between a private variable that is declared at the @interface block versus a variable that is declared within the @implementation block outside of the class methods, i.e: @interface Someclass : NSObject { NSString *forExample; } @end vs. @implementation Someclass NSString *anotherExample; -(void)methodsAndSuch {} @end It seems both variables ( forExample, anotherExample ) are equally accessible throughout the class and I can't really find a difference in their behaviour. Is the second form also called an instance variable?

    Read the article

  • Is it appropriate to set a value to a "const char *" in the header file

    - by sud
    I have seen people using 2 methods to declare and define char * Medhod-1: The header file has the below const char* COUNTRY_NAME_USA = "USA"; Medhod-2: The header file has the below declaration const char* COUNTRY_NAME_USA; The cpp file has the below defintion : const char* COUNTRY_NAME_USA = "USA"; Is method-2 wrong in some way ? What is the difference between the two ? I understand the difference between "const char * const var" , and "const char * var". If in the above methods if a "const char * const var" is declared and defined in the header as in method 1 will it make sense ?

    Read the article

  • Speeding up inner joins between a large table and a small table

    - by Zaid
    This may be a silly question, but it may shed some light on how joins work internally. Let's say I have a large table L and a small table S (100K rows vs. 100 rows). Would there be any difference in terms of speed between the following two options?: OPTION 1: OPTION 2: --------- --------- SELECT * SELECT * FROM L INNER JOIN S FROM S INNER JOIN L ON L.id = S.id; ON L.id = S.id; Notice that the only difference is the order in which the tables are joined. I realize performance may vary between different SQL languages. If so, how would MySQL compare to Access?

    Read the article

  • How to implement RFC 3393 (Ipdv packet delay varation) in C?

    - by sagar
    Hello , I am building an Ethernet Application in which i will be sending packets from one side and receiving it on the other side. I want to calculate delay in packets at the receiver side as in RFC 3393. So I have to put a timestamps in the packet at the sender side and then take the timestamps at the receiver side as soon as i receive the packet . Subtracting the values i will get the difference in timestamps and then subtracting this value with subsequent difference i will get One way ipdv delay . Both the clocks are not synchronized . So any help is greatly appreciated. Thank you.

    Read the article

  • Is ReaderWriterLockSlim.EnterUpgradeableReadLock() essentially the same as Monitor.Enter()?

    - by Neil Barnwell
    So I have a situation where I may have many, many reads and only the occasional write to a resource shared between multiple threads. A long time ago I read about ReaderWriterLock, and have read about ReaderWriterGate which attempts to mitigate the issue where many writes coming in trump reads and hurt performance. However, now I've become aware of ReaderWriterLockSlim... From the docs, I believe that there can only be one thread in "upgradeable mode" at any one time. In a situation where the only access I'm using is EnterUpgradeableReadLock() (which is appropriate for my scenario) then is there much difference to just sticking with lock(){}? Here's the excerpt: A thread that tries to enter upgradeable mode blocks if there is already a thread in upgradeable mode, if there are threads waiting to enter write mode, or if there is a single thread in write mode. Or, does the recursion policy make any difference to this?

    Read the article

  • link with static library vs individual object files

    - by dododo
    For a reason i want to unpack a static lib (libx.a) into individual object files (a.o b.o c.o), and specify these object files (a.o b.o c.o) in the linker input list instead of libx.a, with other linker options remaining the same. However, i have noticed the above change has resulted in quite some difference in the output executable. Basically, (a.o b.o c.o) method will result in larger output size. So what's the difference between the two methods (libx.a and individual object files)? And is there a way to work around? The GNU binutil (for and ar ld) version i'm using is 2.16.1 Thanks.

    Read the article

  • SharePoint: Make a list field hidden programmatically

    - by vitule
    I'm trying to hide the "Title" field in a list. This doesn't seem to work: SPList myList; ... SPField titleField = myList.Fields.GetField("Title"); //titleField.PushChangesToLists = true; <-- doesn't seem to make a difference titleField.ShowInEditForm = false; titleField.ShowInDisplayForm = false; titleField.ShowInNewForm = false; titleField.Update(); //myList.Update(); <-- make no difference What am I doing wrong?

    Read the article

  • jquery $(window).width() and $(window).height() return different values when viewport has not been r

    - by Manca Weeks
    I am writing a site using jquery that repeatedly repeatedly calls $(window).width() and $(window).height() to position and size elements based on the viewport size... In troubleshooting I discovered that I am getting slightly different viewport size reports in repeated calls to the above jquery functions when the viewport is not resized... Wondering if there is any special case anyone knows of when this happens, or if this is just the way it is. The difference in sizes reported are 20px or less, it appears. It happens in Safari 4.0.4, Firefox 3.6.2 and Chrome 5.0.342.7 beta on Mac OS X 10.6.2... I didn't test other browsers yet because it doesn't appear to be specific to the browser. I was also unable to figure out what the difference depends upon - if it isn't the viewport size, could there be another factor that makes the results differ? Any insight would be appreciated... Thanks MAnca

    Read the article

  • Doing arithmetic with up to two decimal places in Python?

    - by user248237
    I have two floats in Python that I'd like to subtract, i.e. v1 = float(value1) v2 = float(value2) diff = v1 - v2 I want "diff" to be computed up to two decimal places, that is compute it using %.2f of v1 and %.2f of v2. How can I do this? I know how to print v1 and v2 up to two decimals, but not how to do arithmetic like that. The particular issue I am trying to avoid is this. Suppose that: v1 = 0.982769777778 v2 = 0.985980444444 diff = v1 - v2 and then I print to file the following: myfile.write("%.2f\t%.2f\t%.2f\n" %(v1, v2, diff)) then I will get the output: 0.98 0.99 0.00, suggesting that there's no difference between v1 and v2, even though the printed result suggests there's a 0.01 difference. How can I get around this? thanks.

    Read the article

  • Sharing code between sqlite-net and servicestack ormlite?

    - by lanks
    I am using sqlite-net to store data on my MonoDroid mobile application. I am wanting to sync this data with a server side service as well. Would it be possible to share the code for my Entity objects between sqlite-net and Servicestacks ormlite? The main difference between the two that I can see is declaring the "using namespace" statements at the top of the class for the object. Is it possible to detect the platform and set the using statements based on the platform? The other difference would be referencing the different dlls for servicestack so I suppose on the mobile app it would not compile if there are references to the servicestack namespaces... What would a good approach be to achieve sharing of this code?

    Read the article

< Previous Page | 86 87 88 89 90 91 92 93 94 95 96 97  | Next Page >