Search Results

Search found 10804 results on 433 pages for 'attribute keys'.

Page 216/433 | < Previous Page | 212 213 214 215 216 217 218 219 220 221 222 223  | Next Page >

  • Error message when running a Sinatra application on Windows Vista.

    - by Adam Siddhi
    I was following a video tutorial by Adam Keys about how to make a URL shortener app in Sinatra. The code that is giving me problems is located here http://pastie.org/958644 So when I ran it I got this error: shortener.rb:12: syntax error, unexpected $undefined, expecting $end @@ home I typed it exactly as Adam said but this keeps happening. What could the issue be? By the way, I am running ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32] on Windows Vista. Thanks, Adam

    Read the article

  • Java: getInputMap(WHEN_IN_FOCUSED_WINDOW) from within JInternalFrame

    - by gerardlouw
    I have a component inside a JInternalFrame which needs to perform actions when keys are pressed within the JInternalFrame's parenting window. Using InputMap/ActionMap would be ideal, but the getInputMap(WHEN_IN_FOCUSED_WINDOW) of the component returns an InputMap that treats the JInternalFrame as the "focused window", rather than its parenting window. Any solutions or ideas?

    Read the article

  • Ninject with Object Initializers and LINQ

    - by Alexander Kahoun
    I'm new to Ninject so what I'm trying may not even be possible but I wanted to ask. I free-handed the below so there may be typos. Let's say I have an interface: public interface IPerson { string FirstName { get; set; } string LastName { get; set;} string GetFullName(); } And a concrete: public class Person : IPerson { public string FirstName { get; set; } public string LastName { get; set; } public string GetFullName() { return String.Concat(FirstName, " ", LastName); } } What I'm used to doing is something like this when I'm retrieving data from arrays or xml: public IEnumerable<IPerson> GetPeople(string xml) { XElement persons = XElement.Parse(xml); IEnumerable<IPerson> people = ( from person in persons.Descendants("person") select new Person { FirstName = person.Attribute("FName").Value, LastName = person.Attribute("LName").Value }).ToList(); return people; } I don't want to tightly couple the concrete to the interface in this manner. I haven't been able to find any information in regards to using Ninject with LINQ to Objects or with object initializers. I may be looking in the wrong places, but I've been searching for a day now with no luck at all. I was contemplating putting the kernel into an singleton instance and seeing if that would work, but I'm not sure that it will plus I've heard that passing your kernel around is a bad thing. I'm trying to implement this in a class library currently. If this is not possible, does anyone have any examples or suggestions as to what the best practice is in this case? Thanks in advance for the help. EDIT: Based on some of the answers I feel I should clarify. Yes, the example above appears short lived but it was simply an example of one piece that I was trying to do. Let's give a bigger picture. Say instead of XML I am gathering all my data through a 3rd party web service and I'm creating an interface for it, the data could be a defined object in the wsdl or it could sometimes be an xml string. IPerson could be used for both the Person object and a User object. I will be doing this inside of a separate class library, because it needs to be portable and will be used in other projects, and handing it to an MVC3 Web Application and the objects will be used in javascript as well. I appreciate all the input so far.

    Read the article

  • How to Disable F11 key

    - by Subhen
    Hi, I want to disable the F11 key in my silverlight application , because I dont want user to sqwitch to full screen mode. Or if is there a way I can write my code for f11 key event , I tried with key down event , but not working for f10 and f11 and set of other keys . Thanks, Subhen

    Read the article

  • XmlDocument filter nodes by datetime string

    - by Eatdoku
    Trying to apply filter / attribute comparison in the Xmldocument. Obviously , the following code snippet wouldn't work because the expression can't be converted using number() function. (according to the answer of my other question). I'm wondering if there is a way to do the DateTime string comparison in XmlDoc. XmlNodeList test = x2PathDoc.SelectNodes("//Config /Entity [@TargetDateTime> '2010-12-19T03:25:00-08:00']");

    Read the article

  • RegEx Advanced : Positive lookbehind

    - by mpneuried
    This is my test-string: <img rel="{objectid:498,newobject:1,fileid:338}" width="80" height="60" align="left" src="../../../../files/jpg1/Desert1.jpg" alt="" /> I want to get each of the JSON formed Elements inbetween the rel attribute. It's working for the first element (objectid). Here is my ReqEx, which works fine: (?<=(rel="\{objectid:))\d+(?=[,|\}]) But i want to do somthing like this, which doesn't work: (?<=(rel="\{.*objectid:))\d+(?=[,|\}]) So i can parse every element of the search string. I'm using Java-ReqEx

    Read the article

  • GNU Smalltalk text interface hard to use

    - by None
    I built GNU Smalltalk from source on my Mac because I couldn't get it working using fink and I found VMs like Squeak hard to understand. When I run the gst command it works fine, but unlike command line interfaces such the Python and Lua ones, it is hard to use because when I use the left or right arrow keys, I want the cursor to move left or right, but instead it inserts text like "^[[D". I understand why it does this but is there any way to fix it so it is more usable?

    Read the article

  • Php, mysql selection

    - by cosy
    I have this table ATTRIBUTE id name um 12 capacity MB;GB;TB And this table2 : id id_attribute id_product name value um 1 12 40 hdd maxtor 30 GB 2 12 41 hdd maxtor 40 GB 3 12 42 hdd y 1 TB How can i select from table2 in this order : 30GB 40GB 1TB? Thanks a lot!

    Read the article

  • Fluent Nhibernate Order-By on Collection

    - by madcapnmckay
    Hi, If I have a collection mapped in Fluent NHibernate and I want to apply an order to that collection how do I do that? Eg: HasMany(x => x.PastDates) .AsBag().Cascade .SaveUpdate() .KeyColumnNames.Add("EventId") .Where(e => e.DateFrom < DateTime.Now.Date) .Inverse(); I'm looking for the equivalent of the order-by attribute in HBM files. Thanks

    Read the article

  • finding max in python as per some custom criterion

    - by MK
    Hi, I can do max(s) to find the max of a sequence. But suppose I want to compute max according to my own function , something like so - currmax = 0 def mymax(s) : for i in s : #assume arity() attribute is present currmax = i.arity() if i.arity() > currmax else currmax Is there a clean pythonic way of doing this? Thanks!

    Read the article

  • Javascript link SEO

    - by vetri
    I have a page where in a photo and description link is there, i want replace the hard coded link with a javascript,which will add them,as i dont want the search engine to scroll the links.I dont wanna use "nofollow" attribute.How to code it in js.

    Read the article

  • Extending the User model with custom fields in Django

    - by Gaurav
    I am trying to extend the User model so that I can add my own custom fields but I keep getting an error stating: 'NoneType' object has no attribute '_default_manager' whenever I try to use user.get_profile() to add values to the custom field i.e. whenever I use it like so: user = User.objects.create_user(username, email, password) user.first_name = fname user.last_name = lname user.save() uinfo = user.get_profile() uinfo.timezone = "Asia/Pune" uinfo.save() I have already followed the steps given at http://stackoverflow.com/questions/44109/extending-the-user-model-with-custom-fields-in-django/965883#965883 with no luck.

    Read the article

  • Does a HashMap retain the order of its elements on the next read if it is constructed as a LinkedHas

    - by javanix
    Suppose I have a Java method that returns a HashMap object. Because a LinkedHashMap is a subclass of HashMap, I can return a LinkedHashMap from this method just fine. On the next "read" action (no adding/removing/modifying of K/V pairs), would iterating over the keys of the resulting method (which returns a HashMap) go in the same order as the originating LinkedHashMap, even though the HashMap lacks the key links?

    Read the article

  • Autocomplete problem with scrollbar

    - by Geetha
    Hi All, I am using autocomplete with scrollbar for my textbox. Autocomplete for touch screen. I can scroll up and down using the mouse wheel but i want to Use the mouse button to scroll up or down by dragging the scroll bar. if i use mouse button it moves the focus away from the text box field. Autocomplete is working only when using the keyboard not with the user defined keys. Geetha

    Read the article

  • HTTPS intercept

    - by Adrian
    I don't know much about SSL, but I've read something and I was wondering if it's possible to intercept the communication between client and server (for example, a company can monitor employees data transfer?). I thought it was a difficult task, but it looks like that it is very simple. When a client requests a https connection the router can be instructed to intercept the key exchange and send to the server and the client it's own public keys (further it can encode/decode the hole traffic). Is it true, or I'm misunderstanding something?

    Read the article

  • Using JavaScript's split to chop up a string and put it in two arrays

    - by Pieter
    I can use JavaScript's split to put a comma-separated list of items in an array: var mystring = "a,b,c,d,e"; var myarray = mystring.split(","); What I have in mind is a little more complicated. I have this dictionary-esque string: myvalue=0;othervalue=1;anothervalue=0; How do I split this so that the keys end up in one array and the values end up in another array?

    Read the article

  • DataGridView Cell Validating only when 'Enter' is pressed

    - by Eldad
    Hi, I want to validate and commit the value entered in the DataGridViewCell ONLY when the user presses the 'Enter' key. If the users presses any other key or mouse button (Arrow keys, Pressing a different cell using the mouse...), I want the behavior to be similar to the 'ESC' key: Move the focus to the new cell and revert the edited cell value to its previous value.

    Read the article

  • WinForms: How to prevent textbox from opening alt menu?

    - by Digiku
    I have this textbox I use to capture keyboard shortcuts for a preferences config. I use a low-level keyboard hook to capture keys and also prevent them from taking action, e.g. the Windows key, but the Alt key still comes through and makes my textbox lose focus. How can I block the Alt key, so the focus is kept unaltered at my textbox?

    Read the article

  • Access <script> tag from codebehind

    - by Hoque
    I was trying to access existing within Head tag. What I was doing to achieve that, foreach (Control ctrl in Header.Controls) { Response.Write(lc.GetType() + "<br/>"); } It gives me the reference of "title", "meta" and "literal" control. How can I get the control and get the "src" attribute of that tag.

    Read the article

  • UNIQUE Constraints in SQL (SQL Server)

    - by rockbala
    Why are UNIQUE Constraints needed in database ? Can you provide any examples ? Primary Key is UNIQUE by default... Understandable as they are referred in other tables as Foreign keys... relation is needed to connect them for rdbms platform... but why would one refer to other columns as UNIQUE, what is benefit of doing so ?)

    Read the article

  • How to access core data objects from Javascript?

    - by Eli
    How can I gain access to Core Data objects from Javascript/WebKit on Mac OS X? I've made custom subclasses of NSManagedObject for each of my tables, with accessors defined using @property/@dynamic for each attribute, but neither isSelectorExcludedFromWebScript: or isKeyExcludedFromWebScript: is called for any of them, so Javascript just stops when I try to access any of the attributes. It returns 'undefined' if I access it as a property (eg business.name ) and javascript execution stops if I access it as a function (eg business.name() ).

    Read the article

  • Using Oracle Sequence in SQL Loader?

    - by Sujee
    Hi, I am using SEQUENCE keyword in SQL Loader control file to generate primary keys. But for a special scenario I would like to use Oracle sequence in the control file. The Oracle documentation for SQL Loader doesn't mentioned anything about it. does SQL Loader support it?

    Read the article

< Previous Page | 212 213 214 215 216 217 218 219 220 221 222 223  | Next Page >