Search Results

Search found 2896 results on 116 pages for 'comparison operators'.

Page 11/116 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • cmd.exe version comparison?

    - by Paul
    When using batch files or console applications on Windows servers the window in question can allow text to be hightlighted (marked) for copying and pasting. Doing this pauses the batch/application and it will only resume after the copy operation. Or this is what I thought to be true. Recently on a Windows 2003 R2 SP2 server I noted that whilst the scrolling was paused the operations were not. Does anyone know if my description in the 1st para is true for older windows is not true for Windows 2003 R2 SP2 when it changed a full version comparison table for cmd.exe across different OS' ? Thanks for reading (Windows 2000 tag as that was the OS I used most before 2003 R2)

    Read the article

  • efficient sort with custom comparison, but no callback function

    - by rob
    I have a need for an efficient sort that doesn't have a callback, but is as customizable as using qsort(). What I want is for it to work like an iterator, where it continuously calls into the sort API in a loop until it is done, doing the comparison in the loop rather than off in a callback function. This way the custom comparison is local to the calling function (and therefore has access to local variables, is potentially more efficient, etc). I have implemented this for an inefficient selection sort, but need it to be efficient, so prefer a quick sort derivative. Has anyone done anything like this? I tried to do it for quick sort, but trying to turn the algorithm inside out hurt my brain too much. Below is how it might look in use. // the array of data we are sorting MyData array[5000], *firstP, *secondP; // (assume data is filled in) Sorter sorter; // initialize sorter int result = sortInit (&sorter, array, 5000, (void **)&firstP, (void **)&secondP, sizeof(MyData)); // loop until complete while (sortIteration (&sorter, result) == 0) { // here's where we do the custom comparison...here we // just sort by member "value" but we could do anything result = firstP->value - secondP->value; }

    Read the article

  • Suggested GA operators for a TSP problem?

    - by Mark
    I'm building a genetic algorithm to tackle the traveling salesman problem. Unfortunately, I hit peaks that can sustain for over a thousand generations before mutating out of them and getting better results. What crossover and mutation operators generally do well in this case?

    Read the article

  • How to make ARGB transparency using bitwise operators.

    - by Smejda
    I need to make transparency, having 2 pixels: pixel1: {A, R, G, B} - foreground pixel pixel2: {A, R, G, B} - background pixel A,R,G,B are Byte values each color is represented by byte value now I'm calculating transparency as: newR = pixel2_R * alpha / 255 + pixel1_R * (255 - alpha) / 255 newG = pixel2_G * alpha / 255 + pixel1_G * (255 - alpha) / 255 newB = pixel2_B * alpha / 255 + pixel1_B * (255 - alpha) / 255 but it is too slow I need to do it with bitwise operators (AND,OR,XOR, NEGATION, BIT MOVE)

    Read the article

  • Containers of reference_wrappers (comparison operators required?)

    - by kloffy
    If you use stl containers together with reference_wrappers of POD types, the following code works just fine: int i = 3; std::vector< boost::reference_wrapper<int> > is; is.push_back(boost::ref(i)); std::cout << (std::find(is.begin(),is.end(),i)!=is.end()) << std::endl; However, if you use non-POD types such as (contrived example): struct Integer { int value; bool operator==(const Integer& rhs) const { return value==rhs.value; } bool operator!=(const Integer& rhs) const { return !(*this == rhs); } }; It doesn't suffice to declare those comparison operators, instead you have to declare: bool operator==(const boost::reference_wrapper<Integer>& lhs, const Integer& rhs) { return boost::unwrap_ref(lhs)==rhs; } And possibly also: bool operator==(const Integer& lhs, const boost::reference_wrapper<Integer>& rhs) { return lhs==boost::unwrap_ref(rhs); } In order to get the equivalent code to work: Integer j = { 0 }; std::vector< boost::reference_wrapper<Integer> > js; js.push_back(boost::ref(j)); std::cout << (std::find(js.begin(),js.end(),j)!=js.end()) << std::endl; Now, I'm wondering if this is really the way it's meant to be done, since it seems impractical. It just seems there should be a simpler solution, e.g. templates: template<class T> bool operator==(const boost::reference_wrapper<T>& lhs, const T& rhs) { return boost::unwrap_ref(lhs)==rhs; } template<class T> bool operator==(const T& lhs, const boost::reference_wrapper<T>& rhs) { return lhs==boost::unwrap_ref(rhs); } There's probably a good reason why reference_wrapper behaves the way it does (possibly to accomodate non-POD types without comparison operators?). Maybe there already is an elegant solution and I just haven't found it.

    Read the article

  • PL/SQL Logical Operators evaluate whole function

    - by Chris
    I know in C like languages logical operators are evaluated one at a time so: false && really_expensive_function() is doesn't result in the function being called (I can't remember the CS name for this). Does the same happen in PL/SQL or do I need to break the IF parts out to separate blocks?

    Read the article

  • How to pass operators as parameters

    - by Rodion Ingles
    I have to load an array of doubles from a file, multiply each element by a value in a table (different values for different elements), do some work on it, invert the multiplication (that is, divide) and then save the data back to file. Currently I implement the multiplication and division process in two separate methods. Now there is some extra work behind the scenes but apart from the specific statements where the multiplication/division occurs, the rest of the code is identical. As you can imagine, with this approach you have to be very careful making any changes. The surrounding code is not trivial, so its either a case of manually editing each method or copying changes from one method to the other and remembering to change the * and / operators. After too many close calls I am fed up of this and would like to make a common function which implements the common logic and two wrapper functions which pass which operator to use as a parameter. My initial approach was to use function pointers: MultiplyData(double data) { TransformData(data, &(operator *)); } DivideData(double data) { TransformData(data, &(operator /)); } TransformData(double data, double (*func)(double op1, double op2)) { /* Do stuff here... */ } However, I can't pass the operators as pointers (is this because it is an operator on a native type?), so I tried to use function objects. Initially I thought that multiplies and divides functors in <functional> would be ideal: MultiplyData(double data) { std::multiplies<double> multFunct; TransformData(data, &multFunct); } DivideData(double data) { std::divides<double> divFunct; TransformData(data, &divFunct); } TransformData(double data, std::binary_function<double, double, double> *funct) { /* Do stuff here... */ } As you can see I was trying to use a base class pointer to pass the functor polymorphically. The problem is that std::binary_function does not declare an operator() member for the child classes to implement. Is there something I am missing, or is the solution to implement my own functor heirarchy (which really seems more trouble than it is worth)?

    Read the article

  • Value Comparison with a multivalued column in SQL Database Table

    - by Rishabh Ohri
    Hi All, Suppose there is a table A which has a column AccessRights which is multivalued( Eg of values in it in this format STOLI,HELP,BRANCH(comma separated string) Now a stored procedure is written against this table to fetch records based on a AccessRight parameter sent to the SP. Let that parameter be @AccessRights, this is also a comma separated string which may have a value like STOLI,BRANCH,HELPLINE etc Now I want to compare individual values from the parameter @AccessRights with the column AccessRights. Current Approach is I split the Comma Separated string(@AccessRights) using a User Defined Function Split. And I get Individual values in a Table variable(Contains only one column "accessGroup"), the individual values are in a Table variable under the column name accessGroup and I use following code in the SP for comparison Where AccessRights like '%'+accessGroup+'%' Now if the user passes the parameter (HELP, OLI) instead of( HELP,STOLI) the SP will give the output. What should be done for comparison so that that subststring OLI does not give the output for STOLI

    Read the article

  • Windows Azure Table Storage LINQ Operators

    - by Ryan Elkins
    Currently Table Storage supports From, Where, Take, and First. Are there plans to support any of the other 29 operators? If we have to code for these ourselves, how much of a performance difference are we looking at to something similar via SQL and SQL Server? Do you see it being somewhat comparable or will it be far far slower if I need to do a Count or Sum or Group By over a gigantic dataset? I like the Azure platform and the idea of cloud based storage. I like Windows Azure for the amount of data it can store and the schema-less nature of table storage. SQL Azure just won't work due to the high cost to storage space.

    Read the article

  • using araxis merge for folder comparison on git branches (OSX)

    - by memo
    I know how to setup araxis merge to be my git diff / merge tool, so if I do git difftool it automatically launches araxis merge. However if I do git difftool upstream/master (to see all the differences between current branch and upstream/master), it launches the app one by one for every single file that is different. Is there a way of setting it up so I can get a folder comparison type view, and then go down and view each file diff as I choose? i.e. similar to this http://www.araxis.com/merge_mac/overview2.html The only way I've found to do this is to clone my repo into a new folder, switch to the branch there, and then do a normal araxis merge folder comparison.

    Read the article

  • 128bit hash comparison with SSE

    - by fokenrute
    Hi, In my current project, I have to compare 128bit values (actually md5 hashes) and I thought it would be possible to accelerate the comparison by using SSE instructions. My problem is that I can't manage to find good documentation on SSE instructions; I'm searching for a 128bit integer comparison instruction that let me know if one hash is larger, smaller or equal to another. Does such an instruction exists? PS: The targeted machines are x86_64 servers with SSE2 instructions; I'm also interested in a NEON instruction for the same job.

    Read the article

  • MySQL Query involving column names containing math operators

    - by devil_fingers
    I'm a MySQL scrub, and I have asked around and checked around the internet for what I'm sure will turn out to be something obvious, but I'm very frustrated with what I thought would be a very, very simple query not working. So here goes. Please be gentle. Basically, in a large database, some of the column names contain mathematical operators like "/" and "+." (Don't ask, it's not my database, I can't do anything about it). Here is the "essence" of my query (I took out the irrelevant stuff for the sake of this question): SELECT PlayerId, Season, WPA/LI AS WPALI FROM tht.stats_batting_master WHERE Season = "2010" AND teamid > 0 AND PA >= 502 GROUP BY playerid ORDER BY WPALI DESC When I run this, it returns "Unknown column 'LI' in 'field list'," I assume because it sees the "/" in WPA/LI as a division sign. Like I said, I'm sure this is easy enough to work around (it must be given how much this database is used), but I haven't' been able to figure out how. Thanks in advance for any help.

    Read the article

  • Class basic operators

    - by swan
    Hi, Is it necessary to have a copy constructor, destructor and operator= in a class that have only static data member, no pointer class myClass{ int dm; public: myClass(){ dm = 1; } ~myClass(){ } // Is this line usefull ? myClass(const myClass& myObj){ // and that operator? this->dm = myObj.dm; } myClass& operator=(const myClass& myObj){ // and that one? if(this != &myObj){ this->dm = myObj.dm; } return *this; } }; I read that the compiler build one for us, so it is better to not have one (when we add a data member we have to update the operators)

    Read the article

  • Is It Worth Using Bitwise Operators In Methods?

    - by user1626141
    I am very new to Java (and programming in general, my previous experience is with ActionScript 2.0 and some simple JavaScript), and I am working my way slowly and methodically through Java: A Beginner's Guide by Herbert Schildt. It is an incredible book. For one thing, I finally understand more-or-less what bitwise operators (which I first encountered in ActionScript 2.0) do, and that they are more efficient than other methods for certain sums. My question is, is it more efficient to use a method that uses, say, a shift right, to perform all your divisions/2 (or divisions/even) for you in a large program with many calculations (in this case, a sprawling RPG), or is it more efficient to simply use standard mathematical operations because the compiler will optimise it all for you? Or, am I asking the wrong question entirely?

    Read the article

  • Binary comparison operators on generic types

    - by Brian Triplett
    I have a generic class that takes a type T. Within this class I have a method were I need to compare a type T to another type T such as: public class MyClass<T> { public T MaxValue { // Implimentation for MaxValue } public T MyMethod(T argument) { if(argument > this.MaxValue) { // Then do something } } } The comparison operation inside of MyMethod fails with Compiler Error CS0019. Is it possible to add a constraint to T to make this work? I tried adding a where T: IComparable<T> to the class definition to no avail.

    Read the article

  • Which namespace does operator<< (stream) go to?

    - by aaa
    If I have have some overloaded ostream operators, defined for library local objects, is its okay for them to go to std namespace? If I do not declare them in std namespace, then I must use using ns:: operator <<. As a possible follow-up question, are there any operators which should go to standard or global namespace?

    Read the article

  • C++ overloading comparative operators for a MyString class

    - by Taylor Gang
    bool operator == (const MyString& left, const MyString& right) { if(left.value == right.value) return true; else return false; } bool operator != (const MyString& left, const MyString& right) { if(left == right) return false; else return true; } bool operator < (const MyString& left, const MyString& right) { if(strcmp(left.value, right.value) == -1) return true; else return false; } bool operator > (const MyString& left, const MyString& right) { if(strcmp(left.value, right.value) == 1) return true; else return false; } bool operator <= (const MyString& left, const MyString& right) { if(strcmp(left.value, right.value) == -1 || strcmp(left.value, right.value) == 0) return true; else return false; } bool operator >= (const MyString& left, const MyString& right) { if(strcmp(left.value, right.value) == 1 || strcmp(left.value, right.value) == 0) return true; else return false; } So these are my implemented comparison operators for my MyString class, they fail the test program that my professor gave me and could use some direction. Thanks in advance for any and all help I receive.

    Read the article

  • Why do programmers use or recommend Mac OS X?

    - by codingbear
    I've worked on both Mac and Windows for awhile. However, I'm still having a hard time understanding why programmers enthusiastically choose Mac OS X over Windows and Linux? I know that there are programmers who prefer Windows and Linux, but I'm asking the programmers who would just use Mac OS X and nothing else, because they think Mac OS X is the greatest fit for programmers. Some might argue that Mac OS X got the beautiful UI and is nix based, but Linux can do that. Although Windows is not nix based, you can pretty much develop on any platform or language, except Cocoa/Objective-C. Is it the softwares that offer only on Mac OS X? Does that really worth using Mac? Is it to develop iPhone apps? Is it because you need to buy new Windows every 2 years (less backwards compatible)? I understand why people, who are working in multimedia/entertainment industry, would use Mac OS X; however, I don't have strong merits of Mac OS X over Windows. If you develop daily on Mac and prefer Mac over anything else, can you give me a merit that Mac has over Windows/Linux? Maybe something you can do on Mac that cannot be done in Windows/Linux with the same level of ease? I'm not trying to do another Mac vs. Windows here. I tried to find things that I do on Mac that cannot be done on Windows with the same level of ease, but I couldn't. So, I'm asking for some help.

    Read the article

  • Adobe Photoshop Vs Lightroom Vs Aperture

    - by Aditi
    Adobe Photoshop is the standard choice for photographers, graphic artists and Web designers. Adobe Photoshop Lightroom  & Apple’s Aperture are also in the same league but the usage is vastly different. Although Photoshop is most popular & widely used by photographers, but in many ways it’s less relevant to photographers than ever before. As Lightroom & Aperture is aimed squarely at photographers for photo-processing. With this write up we are going to help you choose what is right for you and why. Adobe Photoshop Adobe Photoshop is the most liked tool for the detailed photo editing & designing work. Photoshop provides great features for rollover and Image slicing. Adobe Photoshop includes comprehensive optimization features for producing the highest quality Web graphics with the smallest possible file sizes. You can also create startling animations with it. Designers & Editors know how important precise masking is, PhotoShop lets you do that with various detailing tools. Art history brush, contact sheets, and history palette are some of the smart features, which add to its viability. Download Whether you’re producing printed pages or moving images, you can work more efficiently and produce better results because of its smooth integration across other adobe applications. Buy supporting layer effects, it allows you to quickly add drop shadows, inner and outer glows, bevels, and embossing to layers. It also provides Seamless Web Graphics Workflow. Photoshop is hands-down the BEST for editing. Photoshop Cons: • Slower, less precise editing features in Bridge • Processing lots of images requires actions and can be slower than exporting images from Lightroom • Much slower with editing and processing a large number of images Aperture Apple Aperture is aimed at the professional photographer who shoots predominantly raw files. It helps them to manage their workflow and perform their initial Raw conversion in a better way. Aperture provides adjustment tools such as Histogram to modify color and white balance, but most of the editing of photos is left for Photoshop. It gives users the option of seeing their photographs laid out like slides or negatives on a light table. It boasts of – stars, color-coding and easy techniques for filtering and picking images. Aperture has moved forward few steps than Photoshop, but most of the editing work has been left for Photoshop as it features seamless Photoshop integration. Aperture Pros: Aperture is a step up from the iPhoto software that comes with every Mac, and fairly easy to learn. Adjustments are made in a logical order from top to bottom of the menu. You can store the images in a library or any folder you choose. Aperture also works really well with direct Canon files. It is just $79 if you buy it through Apple’s App Store Moving forward, it will run on the iPad, and possibly the iPhone – Adobe products like Lightroom and Photoshop may never offer these options It is much nicer and simpler user interface. Lightroom Lightroom does a smashing job of basic fixing and editing. It is more advanced tool for photographers. They can use it to have a startling photography effect. Light room has many advanced features, which makes it one of the best tools for photographers and far ahead of the other two. They are Nondestructive editing. Nothing is actually changed in an image until the photo is exported. Better controls over organizing your photos. Lightroom helps to gather a group of photos to use in a slideshow. Lightroom has larger Compare and Survey views of images. Quickly customizable interface. Simple keystrokes allow you to perform different All Lightroom controls are kept available in panels right next to the photos. Always-available History palette, it doesn’t go when you close lightroom. You gain more colors to work with compared to Photoshop and with more precise control. Local control, or adjusting small parts of a photo without affecting anything else, has long been an important part of photography. In Lightroom 2, you can darken, lighten, and affect color and change sharpness and other aspects of specific areas in the photo simply by brushing your cursor across the areas. Photoshop has far more power in its Cloning and Healing Brush tools than Lightroom, but Lightroom offers simple cloning and healing that’s nondestructive. Lightroom supports the RAW formats of more cameras than Aperture. Lightroom provides the option of storing images outside the application in the file system. It costs less than photoshop. Download Why PhotoShop is advanced than Lightroom? There are countless image processing plug-ins on the market for doing specialized processing in Photoshop. For example, if your image needs sophisticated noise reduction, you can use the Noiseware plug-in with Photoshop to do a much better job or noise removal than Lightroom can do. Lightroom’s advantages over Aperture 3 Will always have better integration with Photoshop. Lightroom is backed by bigger and more active user community (So abundant availability for tutorials, etc.) Better noise reduction tool. Especially for photographers the Lens-distortion correction tool  is perfect Lightroom Cons: • Have to Import images to work on them • Slows down with over 10,000 images in the catalog • For processing just one or two images this is a slower workflow Photoshop Pros: • ACR has the same RAW processing controls as Lightroom • ACR Histogram is specialized to the chosen color space (Lightroom is locked into ProPhoto RGB color space with an sRGB tone curve) • Don’t have to Import images to open in Bridge or ACR • Ability to customize processing of RAW images with Photoshop Actions Pricing and Availability Get LightRoomGet PhotoShop Latest version Of Photoshop can be purchased from Adobe store and Adobe authorized reseller and it costs US$999. Latest version of Aperture can be bought for US$199 from Apple Online store or Mac App Store. You can buy latest version of LightRoom from Adobe Store or Adobe Authorized reseller for US$299. Related posts:Adobe Photoshop CS5 vs Photoshop CS5 extended Web based Alternatives to Photoshop 10 Free Alternatives for Adobe Photoshop Software

    Read the article

  • Why do programmers use or recommend Mac OS X? [closed]

    - by codingbear
    I've worked on both Mac and Windows for awhile. However, I'm still having a hard time understanding why programmers enthusiastically choose Mac OS X over Windows and Linux? I know that there are programmers who prefer Windows and Linux, but I'm asking the programmers who would just use Mac OS X and nothing else, because they think Mac OS X is the greatest fit for programmers. Some might argue that Mac OS X got the beautiful UI and is nix based, but Linux can do that. Although Windows is not nix based, you can pretty much develop on any platform or language, except Cocoa/Objective-C. Is it the softwares that offer only on Mac OS X? Does that really worth using Mac? Is it to develop iPhone apps? Is it because you need to buy new Windows every 2 years (less backwards compatible)? I understand why people, who are working in multimedia/entertainment industry, would use Mac OS X; however, I don't have strong merits of Mac OS X over Windows. If you develop daily on Mac and prefer Mac over anything else, can you give me a merit that Mac has over Windows/Linux? Maybe something you can do on Mac that cannot be done in Windows/Linux with the same level of ease? I'm not trying to do another Mac vs. Windows here. I tried to find things that I do on Mac that cannot be done on Windows with the same level of ease, but I couldn't. So, I'm asking for some help.

    Read the article

  • c++ write own xml parser vs using tinyxml

    - by AdityaGameProgrammer
    Hi , I am currently in a task to generate an XML file for an srt text file containing timestamps and corresponding text. To generate an exe file which accepts file name input and outputs the relevant XML file to be used as part of an automated script. Is it Advisable to use Tinyxml for this? Is this a very simple task that can be done with minimal programming? Is this one of those things which are very basic to c++ programmers? reason i am asking this is I have recently made a shift into c++ programming after over 3 years of action script development. Edit: your comments regarding this are very much appreciated what's the easiest way to generate xml in c++?

    Read the article

  • Scheme vs Common Lisp: war stories

    - by SuperElectric
    There are no shortage of vague "Scheme vs Common Lisp" questions on both StackOverflow and on this site, so I want to make this one more focused. The question is for people who have coded in both languages: While coding in Scheme, what specific elements of your Common Lisp coding experience did you miss most? Or, inversely, while coding in Common Lisp, what did you miss from coding in Scheme? I don't necessarily mean just language features. The following are all valid things to miss, as far as the question is concerned: Specific libraries. Specific features of development environments like SLIME, DrRacket, etc. Features of particular implementations, like Gambit's ability to write blocks of C code directly into your Scheme source. And of course, language features. Examples of the sort of answers I'm hoping for: "I was trying to implement X in Common Lisp, and if I had Scheme's first-class continuations, I totally would've just done Y, but instead I had to do Z, which was more of a pain." "Scripting the build process in my Scheme project got increasingly painful as my source tree grew and I linked in more and more C libraries. For my next project, I moved back to Common Lisp." "I have a large existing C++ codebase, and for me, being able to embed C++ calls directly in my Gambit Scheme code was totally worth any shortcomings that Scheme may have vs Common Lisp, even including lack of SWIG support." So, I'm hoping for war stories, rather than general sentiments like "Scheme is a simpler language" etc.

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >