Search Results

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

Page 159/433 | < Previous Page | 155 156 157 158 159 160 161 162 163 164 165 166  | Next Page >

  • More intelligent Context Menus in Visual Studio 2008 Database Projects

    - by Mike C.
    I'm using a SQL Server 2008 Database Project, and I'm finding it's very cumbersome to add certain items. For example, if I right click on Tables = Keys and navigate to the Add item, I'd expect to see the different kinds of keys that I can add. Instead, I see the stock items that don't apply, and I'm forced to navigate the Add New Item screen to find Primary Key. Is there a way to make this more efficient? I have Resharper; can I leverage templates somehow (kind of a noob with these). Thanks!

    Read the article

  • jquery: .attr() fails for child element

    - by user984003
    I'm going crazy staring at this. I need to change the attribute of an element, something which I have done many times before. But it fails. Now I can't even get jquery to show me the attribute that it has. Does it have to do with what is returned by find()? var c = new_photo_div.find('[class = photo]')[0]; alert(c); alert(new_photo_div.attr('class')); alert(c.attr('class')); The first alert correctly identifies the element: Object HTMLImageElement The second alert correctly gives me the class of new_photo_div. The third alert fails. No alert. I think it should say: photo

    Read the article

  • Avoiding sub-type selection in view code

    - by John Donoghue
    Hi, I have some code where the model contains some classes like (vb.net pseudocode, but could be any OO language): Enum AttributeType Boolean Date String End Enum MustInherit Class Attibute Must Override Function Type As AttributeType End Class Class BooleanAttribute: Attribute Function Type As AttributeType Return AttributeType.Boolean End Function End Class And the view contains some code like: Select Case AttributeType Case Boolean //Display checkbox control Case Date //Display date picker control Case String //Display textbox control End Select I don't really like the code in the view, for the hopefully obvious reasons (what happens when I get a new attribute type etc). My question is, how should I replace it? I could easily add a method to the concrete classes, but that pollutes the model with UI stuff so that's a horrible idea. I could move the select into a factory, but that seems to be just hiding the problem. Can anybody advise a better approach?

    Read the article

  • Restructured Text - adding title attributes to links

    - by Ant
    Hi all, I am trying to use a jquery lightbox implementation on my website that is generated from Restructured Text. The lightbox takes the title of the link around the images as the caption of the image in the lightbox display. However, I can't seem to find a way in Restructured Text of providing a title attribute on a link - does anyone know of a way of doing so. My Images are defined like so: .. image:: image001.thumb.jpg :alt: Some alt text here :target: image001.jpg So I can add an alt attribute, but not a title. A possible alternative may be to use a target as the reference like so: .. image:: image001.thumb.jpg :alt: Some alt text here :target: image1_ .. _image1: image001.jpg In this latter case, I am not sure how to add attributes to the link defined at the bottom (if it is possible at all)

    Read the article

  • jQuery selector to target any CSS name (of multiple present) starting with a prefix?

    - by John K
    I'm considering one selection statement that would target one of many css class names in a single class attribute value based on a string prefix. For example, I want any detail- prefixed class names to get targeted from the following sample links. <a href="eg.html" class="detail-1 pinkify another"> <a href="eg.html" class="something detail-55 minded"> <a href="eg.html" class="swing narrow detail-Z"> <a href="eg.html" class="swing narrow detail-Z detail-88 detail-A"> It's reminiscent of how [class|="detail"] prefix selector works on a scalar attribute value, and also of .hasClass(className), but my question needs both concepts applied simultaneously. Note: The detail- prefix won't necessarily be the first class name of the bunch.

    Read the article

  • Why does this PNG file look so poorly when embedded as a resource in a Qt project?

    - by George Edison
    Here is the PNG file and what it looks like in a QWebView when accessed via http://sstatic.net/so/img/logo.png: When accessed via HTTP: <img src="http://sstatic.net/so/img/logo.png" width='250' height='61' /> When accessed via a resource: <img src="qrc:/images/logo.png" width='250' height='61' /> As you can see, the only modification was the src attribute of the image tag... why the drop in quality? Edit: The file is being shrunk via width: and height: in the style attribute, if that makes a difference. I updated the code.

    Read the article

  • MVC Helper Extension issue

    - by BeCool
    Hi, I need to implement a HtmlHelper extension in my MVC project simply just to output some string but ONLY in the DEBUG mode, not in REALEASE. My first attempt would be: [Conditional("DEBUG")] public static string TestStringForDebugOnly(this HtmlHelper helper, string testString) { return testString; } But obviously that would give a compile error: "The Conditional attribute is not valid because its return type is not void." So my understanding is once you set [Condition] attribute, it doesnt allow to return anything? why? What is other way to implement this kind of function? anyone help would be much appreciated. Thanks!

    Read the article

  • C# Reading multiple elements with same name using LINQ to XML

    - by hs2d
    Is there any better way doing this? My xml: <Template name="filename.txt"> <Property name="recordSeparator">\r\n</Property> <Property name="fieldCount">16</Property> </Template> Linq: var property = from template in xml.Descendants("Template") select new { recordDelim = template.Elements("Property").Where(prop => prop.Attribute("name").Value == "recordSeparator") .Select(f => new { f.Value }), fieldCount = template.Elements("Property").Where(prop => prop.Attribute("name").Value == "fieldCount") .Select(f => new { f.Value }) };

    Read the article

  • Visual Studio 2010 haunted keyboard

    - by Ryan
    It seems the haunted keyboard is back in VS2010 ... after working on a web application for a short while I find that some keys just don't work, or are behaving like certain keys are stuck. This is only in VS, and I am definitely not triggering any keyboard changes in VS or Windows (I have disabled that in Windows) and I have reset my environment settings several times. Aargh! This is so frustrating ... anyone else getting this problem? Is there are solution?

    Read the article

  • WeakHashMap iteration and garbage collection

    - by Shamik
    I am using a WeaekHashMap to implement a Cache. I am wondering if I am iterating over the keys of this map, and at the same time garbage collector is actively removing keys from this map, would I receive a ConcurrentModificationException ? I do not think so, because as far as I understand, concurrentmodificationexception happens because of bugs in the application code where the developer forgot to understand that the same map is shared/used by other threads and in this case, it should not happen. But wondering how would JVM handle this when WeakHashMap is not synchronized ?

    Read the article

  • aligning extern constants (gcc)

    - by ~buratinas
    I want to make some static constants globally visible. I'm pretty familiar how to do that in C++. The problem is that these constants need to be aligned to some exotic boundary. Do I have to specify the alignment in extern declaration? I'm using GCC4.5 in *.cpp file static const constant_t constant __attribute__((aligned(64))) = {blah,blah,blah}; in *.h file //Which one is correct? extern const constant_t constant; extern const constant_t constant __attribute__((aligned(64)));

    Read the article

  • copy an identity column into another table

    - by slake
    I have 2 tables that are related,both have identity columns for primary keys and i am using a vb form to insert data into them,My problem is that i cannot get the child table to get the primary key of the parent table and use this as its foreign key in my database. the data is inserted fine though no foreign key constraint is made.I am wondering if a trigger will do it and if so how. All my inserting of data is done in vb. The user wont insert any keys. all these are identity columns that are auto generated. If a trigger is my way out please illustrate with an example. If there is another way i can do this in VB itself then please advise and an example will be greatly appreciated Thanks in advance

    Read the article

  • writing structs and classes to disk

    - by Phenom
    The following function writes a struct to a file. int btwrite(short rrn, BTPAGE *page_ptr) { long addr; addr = (long) rrn * (long) PAGESIZE + HEADERSIZE; lseek(btfd, addr, 0); return (write(btfd, page_ptr, PAGESIZE)); } The following is the struct. typedef struct { short keycount; /* number of keys in page */ int key[MAXKEYS]; /* the actual keys */ int value[MAXKEYS]; /* the actual values */ short child[MAXKEYS+1]; /* ptrs to rrns of descendants */ } BTPAGE; What would happen if I changed the struct to a class, would it still work the same? If I added class functions, would the size it takes up on disk increase?

    Read the article

  • How can I map a String to a function in Java?

    - by Bears will eat you
    Currently, I have a bunch of Java classes that implement a Processor interface, meaning they all have a processRequest(String key) method. The idea is that each class has a few (say, <10) member Strings, and each of those maps to a method in that class via the processRequest method, like so: class FooProcessor implements Processor { String key1 = "abc"; String key2 = "def"; String key3 = "ghi"; // and so on... String processRequest(String key) { String toReturn = null; if (key1.equals(key)) toReturn = method1(); else if (key2.equals(key)) toReturn = method2(); else if (key3.equals(key)) toReturn = method3(); // and so on... return toReturn; } String method1() { // do stuff } String method2() { // do other stuff } String method3() { // do other other stuff } // and so on... } You get the idea. This was working fine for me, but now I need a runtime-accessible mapping from key to function; not every function actually returns a String (some return void) and I need to dynamically access the return type (using reflection) of each function in each class that there's a key for. I already have a manager that knows about all the keys, but not the mapping from key to function. My first instinct was to replace this mapping using if-else statements with a Map<String, Function>, like I could do in Javascript. But, Java doesn't support first-class functions so I'm out of luck there. I could probably dig up a third-party library that lets me work with first-class functions, but I haven't seen any yet, and I doubt that I need an entire new library. I also thought of putting these String keys into an array and using reflection to invoke the methods by name, but I see two downsides to this method: My keys would have to be named the same as the method - or be named in a particular, consistent way so that it's easy to map them to the method name. This seems WAY slower than the if-else statements I have right now. Efficiency is something of a concern because these methods will tend to get called pretty frequently, and I want to minimize unnecessary overhead. TL; DR: I'm looking for a clean, minimal-overhead way to map a String to some sort of a Function object that I can invoke and call (something like) getReturnType() on. I don't especially mind using a 3rd-party library if it really fits my needs. I also don't mind using reflection, though I would strongly prefer to avoid using reflection every single time I do a method lookup - maybe using some caching strategy that combines the Map with reflection. Thoughts on a good way to get what I want? Cheers!

    Read the article

  • autocomplete-like feature with a python dict

    - by tipu
    In PHP, I had this line matches = preg_grep('/^for/', array_keys($hash)); What it would do is it would grab the words: fork, form etc. that are in $hash. In Python, I have a dict with 400,000 words. It's keys are words I'd like to present in an auto-complete like feature (the values in this case are meaningless). How would I be able to return the keys from my dictionary that match the input? For example (as used earlier), if I have my_dic = t{"fork" : True, "form" : True, "fold" : True, "fame" : True} and I get some input "for", It'll return a list of "fork", "form", "fold"

    Read the article

  • How to disable listbox auto select item when pressing key

    - by tomfox66
    I have a listbox where I want to copy and paste items within that listbox. Copy and paste works fine but everytime I press "Crtl + C" the item starting with the letter C is automatically selected. Can this automatic selection be disabled or am I missing something here Here is the copy and paste method I implemented: private void listBox_Script_KeyDown(object sender, KeyEventArgs e) { if (e.Control == true && e.KeyCode == Keys.C) { int test = listBox_Script.SelectedIndex; Clipboard.SetDataObject(listBox_Script.Items[listBox_Script.SelectedIndex], true); return; } if (e.Control == true && e.KeyCode == Keys.V) { if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text)) { listBox_Script.Items.Insert(listBox_Script.SelectedIndex + 1, Clipboard.GetDataObject().GetData(DataFormats.Text).ToString()); return; } }

    Read the article

  • Localizing validation (error) messages in Grails

    - by John
    Hi, I try to localize error messages from the Domain classes. This is possible with the default error messages, e.g.: default.blank.message=Property [{0}] cannot be blank and localized attribute names, e.g.: customer.address.label=Customer address Where "Customer" is my domain class and address is its attribute. My problem is that I can't localize some attributes because I need specific error messages. E.g: has.to.be.a.number=Property [{0}] has to be a number contingent.size.label=Contingent size. But the message I get is "Property [size] has to be a number" instead of "Property [Contingent size] has to be a number". The messages I cant localize are following: - Property [{0}] has to be a number - Property [{0}] has to be a valid date // I can't use g:datePicker in this context

    Read the article

  • Super strange PHP error

    - by Industrial
    Hi everyone, When trying memcache:get, I'll get the following error message back: Message: Memcache::get() [memcache.get]: Server localhost (tcp 11211) failed with: Failed reading line from stream (0) I run a Windows 32bit test environment (XP) and here's how my code looks: function getMulti(array $keys) { $items = $this->memcache->get($keys); return $items; } My memcache servers are two local computers in the LAN that my dev. environment is connected to. Sure, I can turn the error logging off or just put an @ before the get function call, but that doesnt solve this issue. What can I do? Thanks a lot!

    Read the article

  • Printing contents of a dynamically created iframe from parent window

    - by certainlyakey
    I have a page with a list of links and a div which serves as a placeholder for the pages the links lead to. Everytime user clicks on a link an iframe is created in the div and its src attribute gets the value of the link href attribute - simple and clear, sort of external web pages gallery. What i do have a problem with is printing the contents of the iframe. To do this i use this code: function PrintIframe() { frames["name"].focus(); frames["name"].print(); } The issue seems to be that iframe is created dynamically by JQuery - when I insert an iframe right into the html code, the browser prints the external page all right. But with the same code injected by JavaScript nothing happens. I tried to use JQ 1.3 'live' event on "Print" link, no success. Is there a way to overcome this?

    Read the article

  • rails 3.1 partial_updates doesn't seem to work with password

    - by user1306769
    i have a user model with a password attribute, which gets saved as password_digest. What i want to do is have the edit user page and the edit password page separated, so that the admin doesn't need to input the password everytime he needs to change something else. For this i have made an extra action / view. My problem is that when i update the user info, i get password validation errors even though i have no password field in the form. Which leads me to the conclusion that partial_updates isn't working with the password attribute (as i have already tested in the console that it is enabled, and it is) Is this me doing something wrong, or should i approach this differently?

    Read the article

  • Handling orientation changes yourself

    - by synic
    From the documentation regarding the android:configChanges='orientation' attribute of the activity tag in the manifest: Note: Using this attribute should be avoided and used only as a last-resort. Please read Handling Runtime Changes for more information about how to properly handle a restart due to a configuration change. Why does it say this? In the case of threads and networking requests via a service API library, a request could be made with a reference to the original Activity, and then an orientation change could occur, leaving the thread pointing to the old Activity. While this can be fixed, it's tedious and ugly compared to just handling the configuration changes yourself. Why should it be avoided?

    Read the article

  • required element content

    - by Guarava Makanili
    I'm trying to create xsd for an element like this: <ElementType attr1="a" attr2 ="b">mandatory_string</ElementType> and I want to make the mandatory_string required. What should I add to this xsd: <xs:complexType name="ElementType"> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="attr1" type="StringLength1to2" use="required"/> <xs:attribute name="attr2" type="StringLength1to2" use="required"/> </xs:extension> </xs:simpleContent> </xs:complexType> Currently is optional. What's missing?

    Read the article

< Previous Page | 155 156 157 158 159 160 161 162 163 164 165 166  | Next Page >