Search Results

Search found 4593 results on 184 pages for 'operator equal'.

Page 82/184 | < Previous Page | 78 79 80 81 82 83 84 85 86 87 88 89  | Next Page >

  • Reverse PInvoke and create a full unmanaged C# program

    - by Fire-Dragon-DoL
    I know this is a strange question but the idea is simple: I prefer C# syntax rather than C++: -Setters and getters directly inside a property -interfaces -foreach statement -possibility to declare an implicit cast operator other small things... What I really don't know is if is possible to import a c++ dll (expecially std libraries) in C# if I don't use any namespace (even System) The idea is just to write a program using everything that you will normally use in C++ (nothing from CLR so), even printf for example Thanks for any answer

    Read the article

  • union on the same table

    - by StupidDeveloper
    I have a table: ID | Id1 | Id2 1 | 100 | 12 2 | 196 | 140 3 | 196 | 141 4 | 150 | 140 5 | 150 | 199 I want to write a query that will give me a table containing records with the same ID2 and with id1 equal to 196 or 150. I thought about union: select * from table where itemId = 196 union select * from table where itemId = 150 but that doesn't cover the ID2 requirement. How should I do that?

    Read the article

  • Comparing file contents in F#

    - by Bartosz Milewski
    I wrote a quick and dirty function to compare file contents (BTW, I have already tested that they are of equal size): let eqFiles f1 f2 = let bytes1 = Seq.ofArray (File.ReadAllBytes f1) let bytes2 = Seq.ofArray (File.ReadAllBytes f2) let res = Seq.compareWith (fun x y -> (int x) - (int y)) bytes1 bytes2 res = 0 I'm not happy with reading the whole contents into an array. I'd rather have a lazy sequence of bytes, but I can't find the right API in F#.

    Read the article

  • Validate Boolean Query - java

    - by JavaUser
    hi, I need the java code snippet for the below logic: Following is a string and I need to validate the string based on the below condition : "100 or 200 and 345 not 550 " - Valid string "abc or 200 and 345 SAME ** 550 " - Not a Valid String 1 . the operands(eg 100,200 ..) should be positive numbers 2 . the operator should be and/or/not Thx

    Read the article

  • Mysql bulk delete problem

    - by Nadir
    Hello, Anybody can help me with this mysql query: delete from generic__campaings_included where dealer_id not in ('2,3,4') and campaing_id = '1' When i execute this query i didnt get normal result. Exceot 2 (dealer_id) all rows deleted. How can i use "not in" with "and" operator? PS. Sorry for my english)

    Read the article

  • In few words, what can be said about Mocking process in TDD

    - by Richard77
    Hello, I'd like to brush my brain to avoid confusions. In few words, what can be said about Mocking process in TDD What's the GREAT idea behind MOCKING? Mocking frameworks are meant to be used only to avoid accessing DB during tests or they can be used for something else? For new comers (like me), are all the frameworks equal or I need to choose one for this or that reason? Thanks for helping

    Read the article

  • Set focus to textbox

    - by Geetha
    Hi All, In my web page there is a textbox with width and height equal to 0. This textbox is used to get the scanned bar code value which should not be visible to the user. Needs: I want to set focus to the textbox, when i click anywhere in the form. I want to make the cursor invisible. Geetha.

    Read the article

  • Javascript help - compare two dates in Euro (dd/MMM/yyyy) format

    - by Kettenbach
    Hi All, I am trying to compare to textbox values on an aspx form. Both the values represent dates. The are formatted like "dd/MMM/yyyy". How can I compare them in javascript to see if they are not equal and which one is greater etc... Does javascript have a date constructor for strings like this? Any tips would be appreciated. Thanks for the help. Cheers, ~ck in San Diego

    Read the article

  • SQL View Creation

    - by george9170
    I have two tables Table FOO FooUniqueID| Year| Name| Worth| --------------------------- 1 2008 Bob 23.00 2 2009 Bob 40200 Table Bar BarUniqueID | Name | Value ----------------------- 1aBc Year 2009 I would like to create a view. That will select everything from FOO where the Year is equal select value from Bar where name = year without using a sub query. thank you

    Read the article

  • WinForms/Console application on Mono, how to know it runs as root

    - by Lex Li-MSFT
    As we can execute such executables in two ways, such as "sudo mono test.exe", and "mono test.exe". Now I want to know how to detect whether this application is running as root inside the application itself. I tried to check user name like below and see whether they equal to "root", Thread.CurrentPrincipal.Identity.Name Process.GetCurrentProcess().StartInfo.UserName AppDomain.CurrentDomain.ApplicationIdentity.FullName The first two are empty strings always, while the third throws NullReferenceException. Please advise if this is doable on Mono 2.6.

    Read the article

  • Defaults for null values

    - by OldFart
    Working on a Powershell script I had several places where I wanted A unless it was null, else B. Essentially the ?? operator in C#. I ended up writing the function shown below, but I can't help but think there is a built-in way to do this. Is there a better, built-in, way? function Get-ValueOrDefault() { foreach ($value in $args) { if ($value -ne $null) { return $value } } } I think this works better: function Get-ValueOrDefault() { $args | select -first 1 }

    Read the article

  • Seeking STL-aware c++filt

    - by Don Wakefield
    In my development environment, I'm compiling a code base using GNU C++ 3.4.6. Code is under development, and unfortunately crashes now and then. It's nice to be able to run the traceback through a demangler, and I use c++filt 3.4. The problem comes when functions have a number of STL parameters. Consider My_callback::operator()( Status&, std::set<std::string> const&, std::vector<My_parameter*> const&, My_attribute_set const&, std::vector<My_parameter_base*> const&, std::vector<My_parameter> const&, std::set<std::string> const& ) { // ... } When this function is in the traceback, the mangled output on my platform is: (_ZN30My_callbackclER11StatusRKSt3setISsSt4lessISsESaISsEERKSt6vectorIP13My_parameterSaISB_EERK17My_attribute_setRKS9_IP18My_parameter_baseSaISK_EERKS9_ISA_SaISA_EES8_+0x76a) [0x13ffdaa] c++filt kindly demangles it to (My_callback::operator()(Status&, std::set<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::vector<My_parameter*, std::allocator<My_parameter*> > const&, My_attribute_set const&, std::vector<My_parameter_base*, std::allocator<My_parameter_base*> > const&, std::vector<My_parameter, std::allocator<My_parameter> > const&, std::set<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)+0x76a) [0x13ffdaa] This is the same problem as compiler errors encountered when using templates. However, the STL is a fairly regular and recognizable package of templates. So what I'm hoping is that someone out there has created an enhanced version of c++filt which would dump something closer to the original function signature. Any hints?

    Read the article

  • Why does extend() engage in bizarre behaviour when passed the same list twice?

    - by intuited
    I'm pretty confused by one of the subtleties of the vimscript extend() function. If you use it to extend a list with another list, it does pretty much what you'd expect, which is to insert the second list into the first list at the index given by the third parameter: let list1 = [1,2,3,4,5,6] | echo extend(list1,[1,2,3,4,5,6],5) " [1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, 6] However if you give it the same list twice it starts tripping out a bit. let list1 = [1,2,3,4,5,6] | echo extend(list1,list1,0) " [1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6] let list1 = [1,2,3,4,5,6] | echo extend(list1,list1,1) " [1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6] let list1 = [1,2,3,4,5,6] | echo extend(list1,list1,2) " [1, 2, 1, 2, 1, 2, 1, 2, 3, 4, 5, 6] let list1 = [1,2,3,4,5,6] | echo extend(list1,list1,3) " [1, 2, 3, 1, 2, 3, 1, 2, 3, 4, 5, 6] let list1 = [1,2,3,4,5,6] | echo extend(list1,list1,4) " [1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 5, 6] let list1 = [1,2,3,4,5,6] | echo extend(list1,list1,5) " [1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 6] let list1 = [1,2,3,4,5,6] | echo extend(list1,list1,6) " [1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6] Extra-confusingly, this behaviour applies when the list is referenced with two different variables: let list1 = [1,2,3,4,5,6] | let list2 = list1 | echo extend(list1,list2,4) " [1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 5, 6] This is totally bizarre to me. I can't fathom a use for this functionality, and it seems like it would be really easy to invoke it by accident when you just wanted to insert one list into another and didn't realize that the variables were referencing the same array. The documentation says the following: If they are |Lists|: Append {expr2} to {expr1}. If {expr3} is given insert the items of {expr2} before item {expr3} in {expr1}. When {expr3} is zero insert before the first item. When {expr3} is equal to len({expr1}) then {expr2} is appended. Examples: :echo sort(extend(mylist, [7, 5])) :call extend(mylist, [2, 3], 1) When {expr1} is the same List as {expr2} then the number of items copied is equal to the original length of the List. E.g., when {expr3} is 1 you get N new copies of the first item (where N is the original length of the List). Does this make sense in a way that I'm not getting, or is it just an eccentricity?

    Read the article

  • Is Programming or web designing a site harder? [closed]

    - by ggfan
    Given that someone has almost an equal understanding of coding(java, php, etc) and web designing(css, xml, photoshop) and wants to create a functional site. Which generally would be more time-consuming. There is obviously lots of considerations...but in general Just curious, because i am learning everything from books and now putting coding and design into practice and the css is kicking my *.

    Read the article

  • problem with printf() function

    - by Syom
    i have the variable $a = 5; i want to show it in binary form, with length, equal 8, with writing * at white spaces, just like this, like this * * * * *101 here the script $number = 5; printf("%*8b", $number); it doesn't work with *, but if "0"-s it works printf("%08b", $number); //returns 00000101 why it doesn't work with *?

    Read the article

  • When should I use $ (and can it always be replaced with parentheses)?

    - by J Cooper
    From what I'm reading, $ is described as "applies a function to its arguments." However, it doesn't seem to work quite like (apply ...) in Lisp, because it's a binary operator, so really the only thing it looks like it does is help to avoid parentheses sometimes, like foo $ bar quux instead of foo (bar quux). Am I understanding it right? Is the latter form considered "bad style"?

    Read the article

  • Algorithm for finding symmetries of a tree

    - by Paxinum
    I have n sectors, enumerated 0 to n-1 counterclockwise. The boundaries between these sectors are infinite branches (n of them). The sectors live in the complex plane, and for n even, sector 0 and n/2 are bisected by the real axis, and the sectors are evenly spaced. These branches meet at certain points, called junctions. Each junction is adjacent to a subset of the sectors (at least 3 of them). Specifying the junctions, (in pre-fix order, lets say, starting from junction adjacent to sector 0 and 1), and the distance between the junctions, uniquely describes the tree. Now, given such a representation, how can I see if it is symmetric wrt the real axis? For example, n=6, the tree (0,1,5)(1,2,4,5)(2,3,4) have three junctions on the real line, so it is symmetric wrt the real axis. If the distances between (015) and (1245) is equal to distance from (1245) to (234), this is also symmetric wrt the imaginary axis. The tree (0,1,5)(1,2,5)(2,4,5)(2,3,4) have 4 junctions, and this is never symmetric wrt either imaginary or real axis, but it has 180 degrees rotation symmetry if the distance between the first two and the last two junctions in the representation are equal. Edit: This is actually for my research. I have posted the question at mathoverflow as well, but my days in competition programming tells me that this is more like an IOI task. Code in mathematica would be excellent, but java, python, or any other language readable by a human suffices. Here are some examples (pretend the double edges are single and we have a tree) http://www2.math.su.se/~per/files.php?file=contr_ex_1.pdf http://www2.math.su.se/~per/files.php?file=contr_ex_2.pdf http://www2.math.su.se/~per/files.php?file=contr_ex_5.pdf Example 1 is described as (0,1,4)(1,2,4)(2,3,4)(0,4,5) with distances (2,1,3). Example 2 is described as (0,1,4)(1,2,4)(2,3,4)(0,4,5) with distances (2,1,1). Example 5 is described as (0,1,4,5)(1,2,3,4) with distances (2). So, given the description/representation, I want to find some algorithm to decide if it is symmetric wrt real, imaginary, and rotation 180 degrees. The last example have 180 degree symmetry. (These symmetries corresponds to special kinds of potential in the Schroedinger equation, which has nice properties in quantum mechanics.)

    Read the article

  • determine if intersection of a set with conjunction of two other sets is empty

    - by koen
    For any three given sets A, B and C: is there a way to determine (programmatically) whether there is an element of A that is part of the conjunction of B and C? example: A: all numbers greater than 3 B: all numbers lesser than 7 C: all numbers that equal 5 In this case there is an element in set A, being the number 5, that fits. I'm implementing this as specifications, so this numerical range is just an example. A, B, C could be anything.

    Read the article

  • Database model for saving random boolean expressions

    - by zarko.susnjar
    I have expressions like this: (cat OR cats OR kitten OR kitty) AND (dog OR dogs) NOT (pigeon OR firefly) Anyone having idea how to make tables to save those? Before I got request for usage of brackets, I limited usage of operators to avoid ambiguous situations. So only ANDs and NOTs or only ORs and saved those in this manner: operators id | name 1 | AND 2 | OR 3 | NOT keywords id | keyword 1 | cat 2 | dog 3 | firefly expressions id | operator | keywordId 1 | 0 | 1 1 | 1 | 2 1 | 3 | 3 which was: cat AND dog NOT firefly But now, I'm really puzzled...

    Read the article

  • Subsonic how do I filter a loaded collection?

    - by Kamikaze
    Currently I am using Subsonic 2.1 and .NET 2.1 and I have an issue where I am attempting to filter a pre-loaded collection with 300+ items. I am using the following to attempt to preform the filter: orders = MasterOrders.Where("account", mbrAccount).Load(); The end results is setting orders equal to the entire MasterOrders collection and not the filtered results. Any suggestions?

    Read the article

  • Can't concatenate 2 arrays in PHP

    - by alex
    I've recently learned how to join 2 arrays using the + operator in PHP. But consider this code... $array = array('Item 1'); $array += array('Item 2'); var_dump($array); Output is array(1) { [0]= string(6) "Item 1" } Why does this not work? Skipping the shorthand and using $array = $array + array('Item 2') does not work either. Does it have something to do with the keys?

    Read the article

  • How to render an object tree with paging?

    - by erikzeta
    I’ll render an object graph on a page looking like this: Category 1 Module 1 Product 1 Product 2 Product 3 Module 2 Product 4 Category 2 ... The Category has an IList<Module and the Module contains an IList<Product Now I need to implement paging on this structure but the problem is that I can’t do Category.Skip(page * pageSize).Take(pageSize) because this will only work on the Category object not the whole object tree. In other words I like to render out when the sum of Categories, Modules and Products is equal to the PageSize /erik

    Read the article

< Previous Page | 78 79 80 81 82 83 84 85 86 87 88 89  | Next Page >