Search Results

Search found 127 results on 6 pages for 'ambiguity'.

Page 3/6 | < Previous Page | 1 2 3 4 5 6  | Next Page >

  • what's the difference between Routed Events and Attached Events?

    - by vverma01
    I tried to find through various sources but still unable to understand difference between routed events and attached events in WPF. Most of the places of reference for attached event following example is used: <StackPanel Button.Click="StackPanel_Click"> <Button Content="Click Me!" Height="35" Width="150" Margin="5" /> </StackPanel> Explained as: stack panel do not contain Click event and hence Button.Click event is attached to Stack Panel. Where as msdn says: You can also name any event from any object that is accessible through the default namespace by using a typename.event partially qualified name; this syntax supports attaching handlers for routed events where the handler is intended to handle events routing from child elements, but the parent element does not also have that event in its members table. This syntax resembles an attached event syntax, but the event here is not a true attached event. Instead, you are referencing an event with a qualified name. According to MSDN information as pasted above, the above example of Buttons and StackPanel is actually a routed event example and not true attached event example. In case if above example is truly about usage of attached event (Button.Click="StackPanel_Click") then it's in contradiction to the information as provided at MSDN which says Another syntax usage that resembles typename.eventname attached event syntax but is not strictly speaking an attached event usage is when you attach handlers for routed events that are raised by child elements. You attach the handlers to a common parent, to take advantage of event routing, even though the common parent might not have the relevant routed event as a member. A similar question was raised in this Stack Overflow post, but unfortunately this question was closed before it could collect any response. Please help me to understand how attached events are different from routed events and also clarify the ambiguity as pointed above.

    Read the article

  • Why don't languages use explicit fall-through on switch statements?

    - by zzzzBov
    I was reading Why do we have to use break in switch?, and it led me to wonder why implicit fall-through is allowed in some languages (such as PHP and JavaScript), while there is no support (AFAIK) for explicit fall-through. It's not like a new keyword would need to be created, as continue would be perfectly appropriate, and would solve any issues of ambiguity for whether the author meant for a case to fall through. The currently supported form is: switch (s) { case 1: ... break; case 2: ... //ambiguous, was break forgotten? case 3: ... break; default: ... break; } Whereas it would make sense for it to be written as: switch (s) { case 1: ... break; case 2: ... continue; //unambiguous, the author was explicit case 3: ... break; default: ... break; } For purposes of this question lets ignore the issue of whether or not fall-throughs are a good coding style. Are there any languages that exist that allow fall-through and have made it explicit? Are there any historical reasons that switch allows for implicit fall-through instead of explicit?

    Read the article

  • The latest version of the EJB 3.2 spec available on java.net project

    - by Marina Vatkina
    If you are not following us on the users alias, here is a quick update. Just before JavaOne, I uploaded the latest version of the EJB 3.2 Core document to the ejb-spec.java.net downloads. If you want to see the detailed changes, download it If you are interested in the high-level list, or would like to know what to look for, this is the list of changes since the previous version (found on the same download page): Specified that the SessionContext object in a the singleton session bean is thread-safe Clarified that the EJB timers distribution and failover rules apply only to persistent timers Clarified that non-persistent timers returned by getTimers and getAllTimers methods are from the same JVM as the caller Fixed section numbering (left over after moving it to its own chapter) in Ch 17 Noted that only 3.0 and 3.1 deployment descriptors are required to be supported in EJB 3.2 Lite for prior versions of the applications Fixes for EJB_SPEC-61 (Ambiguity in EJB lite local view support) and EJB_SPEC-59 (Improve references to the component-defining annotations) JMS/MDB changes: added new standard activation properties and the unique identifier, and rearranged sections for easier navigation Fixed unresolved cross-refs Updated the rule: only local asynchronous session bean invocations are supported in EJB 3.2 Lite Synchronized permissions in the Table with the permissions listed for the EJB Components in the Java EE Platform Specification Table EE.6-2 Specified that during processing of the close() method, the embeddable container cancels all pending asynchronous invocations and non-persistent timers Updated most of the referenced documents to their latest versions Happy reading!

    Read the article

  • In a specification, should I describe what a product does (ideally) or what it should/must do?

    - by Arlaud Pierre
    I'm writting a German specification (I'm not German). Differences may appear for this process in different cultures, especially in the terminology, but usually here's the idea: The client writes his needs and wishes in a document, called a scope statement or requirements document. The supplier tries to understand the actual need of the client (which might be different to what was written and to what the client meant to say and to what the client thinks he needs, etc.) The supplier writes a specification for the product, which should fill the client's need. The specification needs to be precise enough for the product to be made (ambiguity problems occur). The client and the supplier can check whether they have understood each other, and discuss details of the product. The client agrees with the specification (or at least its current iteration) and the supplier is ready to start the work. (it may of course be expected of you to disagree with this process, but this is irrelevant to my problem): I'm now somewhere around the last two steps and I've been criticized because I wrote what the product must do, and not what it will do ideally. Usually along the lines of The product must be able to perform task A And I was expected to write The product performs task A This is a simple word play, but I feel saying what the product does, while the product isn't even on the way to be made yet, is wrong. I would tend to consider a specification as a contract of what the product is expected to do (what it must do and how it should do it), and not what it does. Said differently, I feel this is the specification and not the manual of the end product…… Should I say what the product must do or what it does?

    Read the article

  • Defend PHP; convince me it isn't horrible

    - by Jason L
    I made a tongue-in-cheek comment in another question thread calling PHP a terrible language and it got down-voted like crazy. Apparently there are lots of people here who love PHP. So I'm genuinely curious. What am I missing? What makes PHP a good language? Here are my reasons for disliking it: PHP has inconsistent naming of built-in and library functions. Predictable naming patterns are important in any design. PHP has inconsistent parameter ordering of built-in functions, eg array_map vs. array_filter which is annoying in the simple cases and raises all sorts of unexpected behaviour or worse. The PHP developers constantly deprecate built-in functions and lower-level functionality. A good example is when they deprecated pass-by-reference for functions. This created a nightmare for anyone doing, say, function callbacks. A lack of consideration in redesign. The above deprecation eliminated the ability to, in many cases, provide default keyword values for functions. They fixed this in PHP 5, but they deprecated the pass-by-reference in PHP 4! Poor execution of name spaces (formerly no name spaces at all). Now that name spaces exist, what do we use as the dereference character? Backslash! The character used universally for escaping, even in PHP! Overly-broad implicit type conversion leads to bugs. I have no problem with implicit conversions of, say, float to integer or back again. But PHP (last I checked) will happily attempt to magically convert an array to an integer. Poor recursion performance. Recursion is a fundamentally important tool for writing in any language; it can make complex algorithms far simpler. Poor support is inexcusable. Functions are case insensitive. I have no idea what they were thinking on this one. A programming language is a way to specify behavior to both a computer and a reader of the code without ambiguity. Case insensitivity introduces much ambiguity. PHP encourages (practically requires) a coupling of processing with presentation. Yes, you can write PHP that doesn't do so, but it's actually easier to write code in the incorrect (from a sound design perspective) manner. PHP performance is abysmal without caching. Does anyone sell a commercial caching product for PHP? Oh, look, the designers of PHP do. Worst of all, PHP convinces people that designing web applications is easy. And it does indeed make much of the effort involved much easier. But the fact is, designing a web application that is both secure and efficient is a very difficult task. By convincing so many to take up programming, PHP has taught an entire subgroup of programmers bad habits and bad design. It's given them access to capabilities that they lack the understanding to use safely. This has led to PHP's reputation as being insecure. (However, I will readily admit that PHP is no more or less secure than any other web programming language.) What is it that I'm missing about PHP? I'm seeing an organically-grown, poorly-managed mess of a language that's spawning poor programmers. So convince me otherwise!

    Read the article

  • Improving ANTLR DSL parse-error messages

    - by Dan Fabulich
    I'm working on a domain-specific language (DSL) for non-programmers. Non-programmers make a lot of grammar mistakes: they misspell keywords, they don't close parentheses, they don't terminate blocks, etc. I'm using ANTLR to generate my parser; it provides a nifty mechanism for handling RecognitionExceptions to improve error handling. But I'm finding it pretty hard to develop good error-handling code for my DSL. At this point, I'm considering ways to simplify the language to make it easier for me to provide users with high-quality error messages, but I'm not really sure how to go about this. I think I want to reduce the ambiguity of errors somehow, but I'm not sure how to implement that idea in a grammar. In what ways can I simplify my language to improve parse-error messages for my users? EDIT: Updated to clarify that I'm interested in ways to simplify my language, not just ANTLR error-handling tips in general. (Though, thanks for those!)

    Read the article

  • two different version of AjaxControlToolkit in same web application

    - by shailesh
    I have two different version of AjaxControlToolkit dll and I have added reference of both dll in my web application. I also set up control tagprefix in web.config. Now one of the page is using 1.0 version and I want to use 3.0 version in another page. I am getting following error. "The server tag 'ajaxToolkit:SliderExtender' is ambiguous. Please modify the associated registration that is causing ambiguity and pick a new tag prefix." Any idea where I am doing wrong?

    Read the article

  • java: decoding URI query string

    - by Jason S
    I need to decode a URI that contains a query string; expected input/output behavior is something like the following: abstract class URIParser { /** example input: * something?alias=pos&FirstName=Foo+A%26B%3DC&LastName=Bar */ URIParser(String input) { ... } /** should return "something" for the example input */ public String getPath(); /** should return a map * {alias: "pos", FirstName: "Foo+A&B=C", LastName: "Bar"} */ public Map<String,String> getQuery(); } I've tried using java.net.URI, but it seems to decode the query string so in the above example I'm left with "alias=pos&FirstName=Foo+A&B=C&LastName=Bar" so there is ambiguity whether a "&" is a query separator or is a character in a query component. edit: just tried URI.getRawQuery() and it doesn't do the encoding, so I can split the query string with a "&", but then what do I do? Any suggestions?

    Read the article

  • In what areas might the use of F# be more appropriate than C#?

    - by Peter McGrattan
    Over the last few years F# has evolved into one of Microsoft's fully supported languages employing many ideas incubated in OCaml, ML and Haskell. Over the last several years C# has extended it's general purpose features by introducing more and more functional language features: LINQ (list comprehension), Lamdas, Closures, Anonymous Delegates and more... Given C#'s adoption of these functional features and F#'s taxonomy as an impure functional language (it allows YOU to access framework libraries or change shared state when a function is called if you want to) there is a strong similarity between the two languages although each has it's own polar opposite primary emphasis. I'm interested in any successful models employing these two languages in your production polyglot programs and also the areas within production software (web apps, client apps, server apps) you have written in F# in the past year or so that you would previously have written in C#. EDIT: Edited based on feedback from close votes with the intent of reducing perceived ambiguity.

    Read the article

  • Web scraping with Python

    - by Jack
    I'm currently trying to scrape a website that has fairly poorly-formatted HTML (often missing closing tags, no use of classes or ids so it's incredibly difficult to go straight to the element you want, etc.). I've been using BeautifulSoup with some success so far but every once and a while (though quite rarely), I run into a page where BeautifulSoup creates the HTML tree a bit differently from (for example) Firefox or Webkit. While this is understandable as the formatting of the HTML leaves this ambiguous, if I were able to get the same parse tree as Firefox or Webkit produces I would be able to parse things much more easily. The problems are usually something like the site opens a <b> tag twice and when BeautifulSoup sees the second <b> tag, it immediately closes the first while Firefox and Webkit nest the <b> tags. Is there a web scraping library for Python (or even any other language (I'm getting desperate)) that can reproduce the parse tree generated by Firefox or WebKit (or at least get closer than BeautifulSoup in cases of ambiguity).

    Read the article

  • Web scraping with Python

    - by Jack
    I'm currently trying to scrape a website that has fairly poorly-formatted HTML (often missing closing tags, no use of classes or ids so it's incredibly difficult to go straight to the element you want, etc.). I've been using BeautifulSoup with some success so far but every once and a while (though quite rarely), I run into a page where BeautifulSoup creates the HTML tree a bit differently from (for example) Firefox or Webkit. While this is understandable as the formatting of the HTML leaves this ambiguous, if I were able to get the same parse tree as Firefox or Webkit produces I would be able to parse things much more easily. The problems are usually something like the site opens a <b> tag twice and when BeautifulSoup sees the second <b> tag, it immediately closes the first while Firefox and Webkit nest the <b> tags. Is there a web scraping library for Python (or even any other language (I'm getting desperate)) that can reproduce the parse tree generated by Firefox or WebKit (or at least get closer than BeautifulSoup in cases of ambiguity).

    Read the article

  • "The left hand side of an assignment must be a variable" due to extra parentheses

    - by polygenelubricants
    I know why the following code doesn't compile: public class Main { public static void main(String args[]) { main((null)); // this is fine! (main(null)); // this is NOT! } } What I'm wondering is why my compiler (javac 1.6.0_17, Windows version) is complaining "The left hand side of an assignment must be a variable". I'd expect something like "Don't put parentheses around a method invokation, dummy!", instead. So why is the compiler making a totally unhelpful complaint about something that is blatantly irrelevant? Is this the result of an ambiguity in the grammar? A bug in the compiler? If it's the former, could you design a language such that a compiler would never be so off-base about a syntax error like this?

    Read the article

  • How do you reconcile IDisposable and IoC?

    - by Mr. Putty
    I'm finally wrapping my head around IoC and DI in C#, and am struggling with some of the edges. I'm using the Unity container, but I think this question applies more broadly. Using an IoC container to dispense instances that implement IDisposable freaks me out! How are you supposed to know if you should Dispose()? The instance might have been created just for you (and therefor you should Dispose() it), or it could be an instance whose lifetime is managed elsewhere (and therefor you'd better not). Nothing in the code tells you, and in fact this could change based on configuration!!! This seems deadly to me. Can any IoC experts out there describe good ways to handle this ambiguity?

    Read the article

  • Odd compiler error on if-clause without braces

    - by DisgruntledGoat
    The following Java code is throwing a compiler error: if ( checkGameTitle(currGame) ) ArrayList<String> items = parseColumns( tRows.get(rowOffset+1), currGame, time, method ); checkGameTitle is a public static function, returning a boolean. The errors are all of the type "cannot find symbol" with the symbols being variable ArrayList, variable String and variable items. However, if I add {curly braces} then the code compiles with no errors. Why might this be? Is there some ambiguity on the if clause without them?

    Read the article

  • Ambiguous reference when getter/setter have different visibilities

    - by Warren Seine
    The following code raises an ambiguous reference to value at compile time: import flash.display.Sprite; public class Main extends Sprite { private var _value : Number = 0.; public function get value() : Number { return _value; } private function set value(v : Number) : void { _value = v; } public function Main() : void { value = 42.; } } I suspect some kind of bug in the compiler, though I didn't actually read the ECMA standard. Before someone asks those questions: Private setters do make sense. The ambiguity also exists with custom namespaces (which is the problem I'm facing).

    Read the article

  • The type already contains a definition for 'Zehut'

    - by iTayb
    The problem exists in my editme.aspx page. Error 1 The type 'editme' already contains a definition for 'Zehut' C:\Documents and Settings\Itay.ITAYB-5A14B8105\My Documents\Visual Studio 2008\WebSites\WebSite2\editme.aspx.cs 110 20 C:\...\WebSite2\ Error 3 Ambiguity between 'editme.Zehut' and 'editme.Zehut(object, System.Web.UI.WebControls.ServerValidateEventArgs)' C:\Documents and Settings\Itay.ITAYB-5A14B8105\My Documents\Visual Studio 2008\WebSites\WebSite2\editme.aspx.cs 44 13 C:\...\WebSite2\ I can't understand where there is a second Zehut method. This is the only zehut method in the whole file. Here is the code: http://pastebin.com/xzDcg1RB It happened just out of the blue. It worked fine for a month or so.

    Read the article

  • Simple number-to-number (or number-to-hex) encryption algorithm that minimizes # of characters

    - by Clay Nichols
    I need to encrypt a number and I and this encrypted value will be given to a customer ask a key so I want to minimize the number of digits and make them all printable. So I'd like the result to be either all number or all Hex characters. The current encryption method I'm using (for non numbers) converts the characters to hex (2 hex digits each). That doubles the number of characters. I also considered just treating the input as hex (so each pair of numbers is treated as a Hex pair, but then you have ambiguity between an input of 0123 and 123 (when decrypting that leading '0' is lost. Any suggestions?

    Read the article

  • Separating arguments to a function, in locales with comma as decimal marker

    - by Chris Pousset
    In locales, e.g. French, with comma as decimal indicator (where "5,2" means five and two-tenths), how do users separate function arguments from each other? For example, in many programming/scripting languages, I could specify MAX(1.5, X) in a EN-US locale. How do you avoid the ambiguity between the comma as decimal indicator, and as argument separator? In particular, I'm interested in how software that's perceived as user-friendly in the foreign locale does it. Obviously, it's a no-brainer to say, "thou shalt use decimal POINTs", but that's not particularly "friendly".

    Read the article

  • can these be made unambiguous

    - by R Samuel Klatchko
    I'm trying to create a set of overloaded templates for arrays/pointers where one template will be used when the compiler knows the size of the array and the other template will be used when it doesn't: template <typename T, size_t SZ> void moo(T (&arr)[SZ]) { ... } template <typename T> void moo(T *ptr) { ... } The problem is that when the compiler knows the size of the array, the overloads are ambiguous and the compile fails. Is there some way to resolve the ambiguity (perhaps via SFINAE) or is this just not possible.

    Read the article

  • MySql SELECT AS - Append all field names

    - by jeerose
    I'd like to do something like this: SELECT table.id AS prefix_id, table.name AS prefix_name ... and have the prefix added dynamically to all field names rather than selecting them all manually (ie SELECT table.* AS prefix_* or something) Hopefully I've described that accurately. Any thoughts? Edit To be clear, the reason I'm asking is to make sure that my query result contains every column from each table I call even if there are duplicate field names. For example, I might have a table with lots of fields which means I don't want to alias all the fields manually. Further if 3 tables have a field called name my result won't contain three name results; it will have one. I want to avoid ambiguity with my column names.

    Read the article

  • New programming jargon you coined?

    - by jdk
    What programming terms have you coined that have taken off in your own circles? (i.e. have heard others repeating it?) It might be within your own team, workplace or garnered greater popularity on the Internet. Define your programming term, word or phrase in bold followed by an explanation, citation and/or usage example so we can use it in appropriate context. This question serves in the spirit of communication among programmers through sharing of terminology with each other, to benefit us by its propagation within our own teams and environments. Please no repeats of common jargon already ingrained in the programming culture like: "kludge", "automagically", "cruft", etc. (unless you coined it). Stealing from the comments: A shared vocabulary is the basis of communication, not just among programmers, Note: This Programming question has been reworded/reorganized to phrase a real question and remove ambiguity, vagueness and rhetorical device. It is not difficult to know what is being asked & question can be reasonably answered (see answers below).

    Read the article

  • can these templates be made unambiguous

    - by R Samuel Klatchko
    I'm trying to create a set of overloaded templates for arrays/pointers where one template will be used when the compiler knows the size of the array and the other template will be used when it doesn't: template <typename T, size_t SZ> void moo(T (&arr)[SZ]) { ... } template <typename T> void moo(T *ptr) { ... } The problem is that when the compiler knows the size of the array, the overloads are ambiguous and the compile fails. Is there some way to resolve the ambiguity (perhaps via SFINAE) or is this just not possible.

    Read the article

  • Git. Remote HEAD is ambiguous.

    - by Siegfried
    I checked the relevant thread but still can't solve this problem. When I typed "git remote show origin", I got * remote origin Fetch URL: xxxx Push URL: xxxx HEAD branch (remote HEAD is ambiguous, may be one of the following): development master Remote branches: development tracked master tracked Local branches configured for 'git pull': development merges with remote development master merges with remote master Local ref configured for 'git push': master pushes to master (up to date) I also checked "git show-ref", and I got: 3f8f4292e31cb8fa5938dbdd406b2f357764205b refs/heads/development 3f8f4292e31cb8fa5938dbdd406b2f357764205b refs/heads/master 3f8f4292e31cb8fa5938dbdd406b2f357764205b refs/remotes/origin/development 3f8f4292e31cb8fa5938dbdd406b2f357764205b refs/remotes/origin/master Here is the list of all branches I have by executing "git branch -a" development * master remotes/origin/development remotes/origin/master And this is what is in the .git/config: [core] repositoryformatversion = 0 filemode = false bare = false logallrefupdates = true ignorecase = true hideDotFiles = dotGitOnly autocrlf = false [remote "origin"] fetch = +refs/heads/*:refs/remotes/origin/* url = xxxx push = refs/heads/master:refs/heads/master [branch "master"] remote = origin merge = refs/heads/master [branch "development"] remote = origin merge = refs/heads/development I and it seems that the remote development and master branch share the same node. How to solve this ambiguity problem? Thank you!

    Read the article

  • how to initialized array value's into another new array.

    - by kiran kumar
    I have array distanceListArray.. 5 km, 10 km, 15km, 20 km, 25 km. distanceListArray is of appDelegate.class distanceArray count is 5. Now i do have another array. which have list of events data ... eventListArray is of DistanceClass call eventListArray. for 5 km its displays 10 events, for 10 km its display 20 events. Now i need to load data for each section from distanceListArray of eventListArray Into another new array. All Arrays's are NSMutableArray. I hope this makes ambiguity. please help try to help me out.

    Read the article

  • What is your favourite JavaScript reference manual?

    - by daniel.sedlacek
    Hi, I come from strong typed unambiguous OOP background and I struggle to find JavaScript reference manual that would fit my needs. The ideal one should be: compendious and handy, I'm not looking for ECMA standart reference. type specific, even if JS is not strong typed function arguments and returns have a type. browser specific, no matter the standards every browser is different and this ambiguity is killing me. examples, they are always handy. off line, this would be fine but it's not a condition. What is your favourite one? Help me, Obi-Wan Kenobi; you're my only hope!

    Read the article

< Previous Page | 1 2 3 4 5 6  | Next Page >