Search Results

Search found 2443 results on 98 pages for 'structural typing'.

Page 7/98 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • c# scope/typing/assignment question

    - by Shannow
    Hi there another quick question. I would like to create a variable object so that depending on the value of something, it gets cast as needed. e.g. var rule; switch (seqRuleObj.RuleType) { case SeqRuleObj.type.Pre : rule = new preConditionRuleType(); rule = (preConditionRuleType)seqRuleObj.Rule; break; case SeqRuleObj.type.Post : rule = new postConditionRuleType(); rule = (postConditionRuleType)seqRuleObj.Rule; break; case SeqRuleObj.type.Exit : rule = new exitConditionRuleType(); rule = (exitConditionRuleType)seqRuleObj.Rule; break; default : break; } String result; foreach (sequencingRuleTypeRuleConditionsRuleCondition cond in rule.ruleConditions.ruleCondition) { ....../ blah } so basically this will not work. c# will not allow me to create an new object in every case as the name is aleady defined. i can just paste the foreach loop into each case but that to me is such a waste, as the objects are exactly the same in all but name.

    Read the article

  • Static Typing and Writing a Simple Matrix Library

    - by duckworthd
    Aye it's been done a million times before, but damnit I want to do it again. I'm writing a simple Matrix Library for C++ with the intention of doing it right. I've come across something that's fairly obvious in mathematics, but not so obvious to a strongly typed system -- the fact that a 1x1 matrix is just a number. To avoid this, I started walking down the hairy path of matrices as a composition of vectors, but also stumbled upon the fact that two vectors multiplied together could either be a number or a dyad, depending on the orientation of the two. My question is, what is the right way to deal with this situation in a strongly typed language like C++ or Java?

    Read the article

  • Can jQuery add commas while user typing numbers?

    - by Matt
    How would I go about dynamically adding commas as a user is entering numbers? Is there a good number formatter that would help? I have to add these numbers later so I eventually have to remove the commas down the line. But the screen needs to show the commas for better readability.

    Read the article

  • scroll/search JList when user starts typing

    - by alex
    I would like to implement one of the fanciest features I every now and then. I would like to allow a user to click on a JList and if words are typed, do a query and advance the caret to the next match (prefix). Is there and example of such an implementation in Java somewhere? I'm thinking a combination of key listeners, getNextMatch() and setSelectValue().

    Read the article

  • Typing enter/return key in selenium

    - by Nathan
    Looking for a quick way to type an enter or return key in Selenium. Unfortunately the form I'm trying to test (not my own code so I can't modify) doesn't have a submit button. When working with it manually, I just type enter or return, and just need to know how to do that with the Selenium "type" command

    Read the article

  • how to userinput without typing to a batch file

    - by Blood hound
    I am trying to run a batch file which requires user input "y/n" to do further action , I want to call this batch file for automation , as during automation argument yes or no need to be passed without user intervention , any idea how to achieve it ? cmd /c setup.bat now if setup.bat is run " yes or no " need to be selected to get the desired result as now this setup.bat is called during automation, is there is anyway to pass "yes" parameter as an input to setup.bat

    Read the article

  • Typing Text effect not working

    - by Anthony Garand
    I'm writing a script to take an array of strings, split them by characters, and print them out to the screen. This is what I have and for some reason it is not doing anything. Any ideas? function autowrite() { var write_text=["Your Memories","Your Thoughts","Your Photos"]; var split_text = Array(); var i; var c; for(i=0; i < write_text.length; i++) { split_text[i] = write_text[i].split(""); for(c=0; i < split_text.length[i]; i++) { alert(split_text[i][c]); } } }

    Read the article

  • Getting the time interval between typing characters in a TextBox, in C#

    - by sama
    I have a form that has a TextBox and a Label and I want to get the time of the first character entered in the textbox. Then if the user enters more than ten charcaters, the time between the first charcter entered and the tenth charcter entered is displayed in the label. Can any one help me please? I'm using C# Here is the code but I cannot complete it and I have many things that need to be written but I don't know how to continue. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Threading; namespace n { public partial class Form1 : Form { int count=0; public Form1() { InitializeComponent(); } private void textBox1_TextChanged(object sender, EventArgs e) { DateTime t1 = new DateTime();// the time when entering the first charcter DateTime t2 = new DateTime(); t2 = System.DateTime.Now - t1; int index = textBox1.SelectionStart; Point p; p = textBox1.GetPositionFromCharIndex(index); Thread t = new Thread(counttext); t.Start(); label1.Text = "t2"; } private int counttext() { while (textBox1.Text.Length < 10) { count++; if (count == 10) return count; } } } }

    Read the article

  • cancel typing on form

    - by ntan
    Hi, i have a dialog box with 2 text inputs.Dialog has 2 buttons ok/cancel What i want is when open the dialog and input 1 has a value of "pets" and change it to "animals" when click ok holds the new value (animals) but when click the cancel return to old value (pets). Any help appreciated

    Read the article

  • Dynamic search result when typing

    - by Martin
    I'm using asp.net and want to filter a search result everytime the user enter letters in a textbox. For exmaple this website do exactly what I want: http://www.prisjakt.nu/ (try searching in the right top corner). I have tried just putting my textbox and the gridview with the search result in an updatepanel, it's working but it's really slow, can I make it faster and how? Is there any articles or something about this?

    Read the article

  • How can I practice with a full set of characters in KTouch?

    - by Josh
    I originally used KTouch to learn Qwerty touch typing, but found it too stressful on the hands. Hearing about Dvorak, I decided I'd switch to that (still using a Qwerty keyboard, but with the keys mapped differently). Since the keyboard is physically displaying a Qwerty layout, I cannot look at the keyboard for hints, making it very hard to type characters that I am unfamiliar with. Unfortunately, KTouch only covers letters, not punctuation and other symbols. Where can I find a lecture that covers all, or most of, the characters on a keyboard?

    Read the article

  • Is the switch to Dvorak worth it?

    - by Kevin Weil
    To those who were experienced ( 70 WPM, say) typists before the switch to Dvorak -- were you faster after switching? There are a couple good SO threads on Dvorak, but they are more on how to learn or reduction in typing pain than speed before/after. I know it will take me 1-2 months to feel comfortable, but I want to know if I should expect to be faster afterward. I am a programmer and type maybe 90-110 WPM on QWERTY. EDIT: I agree that coding is not typically IO-bound, and that a minimum typing speed is sufficient. This is half from curiosity, but it will be an undertaking to achieve QWERTY parity, so I want to know if I should at least expect some asymptotic improvement.

    Read the article

  • What tricks can be used to type and edit code faster?

    - by Thomas
    As Jeff Atwood noted, we are typists first, programmers second. Fast typing and editing may not be essential to be a good programmer, but it certainly helps. I noticed that I consciously and subconsciously use various tricks to get my intent across to the computer as fast as possible. What tricks can be used to type and edit code faster? I'm hoping to collect a nice list here that we can all learn from, so that we can be ever so slightly more productive. One trick per answer please! (This is not about typing speed in general. There are other questions about that. It's also not about general answers like "learn your editor's shortcut keys". Think of this topic as micro-optimizations for specific cases. See my own answers for examples of what I mean.)

    Read the article

  • Typewriter Sounds

    - by Mr. Typing Sounds
    Since I switched to Ubuntu 12.04 I'd only missed one thing. A program which could launch typewriter sounds while typing. For instance, in Windows I used this: http://www.colorpilot.com/soundpilot.html for a long time. I learned then that this writing program: http://gottcode.org/focuswriter/ had the sounds but only for the program itself. However, sometimes I'm writing an email, writing on the web or doing more complex writing tasks in LibreOffice - all places where these long missed typing sounds don't apply. Does any of you know of any plans in the community of the sound bit - typing sounds - as an independent program or applet to be fetched in the Ubuntu Software Center soon? The Rhythm Of Creative Writing would really be helped then! ;-)

    Read the article

  • Duck type testing with C# 4 for dynamic objects.

    - by Tracker1
    I'm wanting to have a simple duck typing example in C# using dynamic objects. It would seem to me, that a dynamic object should have HasValue/HasProperty/HasMethod methods with a single string parameter for the name of the value, property, or method you are looking for before trying to run against it. I'm trying to avoid try/catch blocks, and deeper reflection if possible. It just seems to be a common practice for duck typing in dynamic languages (JS, Ruby, Python etc.) that is to test for a property/method before trying to use it, then falling back to a default, or throwing a controlled exception. The example below is basically what I want to accomplish. If the methods described above don't exist, does anyone have premade extension methods for dynamic that will do this? Example: In JavaScript I can test for a method on an object fairly easily. //JavaScript function quack(duck) { if (duck && typeof duck.quack === "function") { return duck.quack(); } return null; //nothing to return, not a duck } How would I do the same in C#? //C# 4 dynamic Quack(dynamic duck) { //how do I test that the duck is not null, //and has a quack method? //if it doesn't quack, return null }

    Read the article

  • Are factors such as Intellisense support and strong typing enough to justify the use of an 'Anaemic Domain Model'?

    - by David Osborne
    It's easy to accept that objects should be used in all layers except a layer nominated as a data layer. However, it's just as easy to end-up with an 'anaemic domain model' that is just an object representation of data with no real functionality ( http://martinfowler.com/bliki/AnemicDomainModel.html ). However, using objects in this fashion brings the benefit of factors such as Intellisense support, strong typing, readability, discoverability, etc. Are these factors strong arguments for an otherwise, anaemic domain model?

    Read the article

  • How can I achieve strong typing with a component messaging system?

    - by Vaughan Hilts
    I'm looking at implementing a messaging system in my entity component system. I've deduced that I can use an event / queue for passing messages, but right now, I just use a generic object and cast out the data I want. I also considered using a dictionary. I see a lot of information on this, but they all involve a lot of casting and guessing. Is there any way to do this elegantly and keep strong typing on my messages?

    Read the article

  • Automatically closing braces in emacs?

    - by Dave Rigby
    Hi I've seen a plugin for Vim called AutoClose (discovered from this post) which automatically adds the closing brace when typing '(', '{' etc. For example; when I type the following ( | is the cursor): int main(| I would like the closing ) to be inserted automatically for me: int main(|) Does anyone know of a similar feature for emacs - Google has failed me this time!

    Read the article

  • How to type multiple characters on a mac with a single click?

    - by Yuval
    On a Windows machine, clicking and holding a keyboard key results in the key being types multiple times. For example, if I click and hold 'q' for a few seconds, I end up with the following: qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq Similarly, I can click and hold the Backspace key to delete multiple characters. On a Mac, it seems, clicking and holding a key for several seconds results in the key being types only once. To type it repeatedly, it is necessary to psychically click it multiple times. I'm unclear about whether that is a bug or a supposed-feature, but I am interested in replicating this functionality on a Mac. Any ideas? Thanks!

    Read the article

  • Replacing latex with unicode symbols

    - by Elazar Leibovich
    Often, during a conversation or an email, or at a forum, I would like to type some math, but I don't need full equation support. Unicode symbols should suffice. What I need is an easy way to type math related unicode symbols. Since I already know latex, it makes sense to use the latex symbol mnemonics to type the math symbols. What I currently did is to write an AutoHotKey script which automatically replaces \latexSymbol with the corresponding unicode symbol, using the "hotstrings" AutoHotKey feautres. However, the AutoHotKey hotstrings proved unstable for many strings. Having a couple of tens lines would cause AHK to fail recognizing the strings from time to time. Any other solution? (No, Alt+unicode number isn't convenient enough) Attached is my AHK script. The PutUni function is taken from here. ::\infty:: PutUni("e2889e") return ::\sum:: PutUni("e28891") return ::\int:: PutUni("e288ab") return ::\pm:: PutUni("c2b1") return ::\alpha:: PutUni("c991") return ::\beta:: PutUni("c992") return ::\phi:: PutUni("c9b8") return ::\delta:: PutUni("ceb4") return ::\pi:: PutUni("cf80") return ::\omega:: PutUni("cf89") return ::\in:: PutUni("e28888") return ::\notin:: PutUni("e28889") return ::\iff:: PutUni("e28794") return ::\leq:: PutUni("e289a4") return ::\geq:: PutUni("e289a5") return ::\sqrt:: PutUni("e2889a") return ::\neq:: PutUni("e289a0") return ::\subset:: PutUni("e28a82") return ::\nsubset:: PutUni("e28a84") return ::\nsubseteq:: PutUni("e28a88") return ::\subseteq:: PutUni("e28a86") return ::\prod:: PutUni("e2888f") return ::\N:: PutUni("e28495") return

    Read the article

  • Which keyboard has better ergomics?

    - by Absolute0
    When I was a kid I fell hard on my right wrist and since then I always get wrist pains when angling my wrist very high up (ie: when using a very high shaped mouse or doing push ups). So I have narrowed down my choices for a keyboard to the following 2: Microsoft Natural 4000: And the Razer Arctosa: The Razer is a slim type keyboard similar to a laptop feel and the hand-rest would help with keeping my hands straight with respect to my forearms. I am more inclined on getting the razer but am not sure if this will benefit my wrists in the long run. Any thoughts on this would be greatly appreciated. Thanks.

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >