Search Results

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

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

  • Alter multiple tables' columns length

    - by gdoron
    So, we just found out that 254 tables in our Oracle DBMS have one column named "Foo" with the wrong length- Number(10) instead of Number(3). That foo column is a part from the PK of the tables. Those tables have other tables with forigen keys to it. What I did is: backed-up the table with a temp table. Disabled the forigen keys to the table. Disabled the PK with the foo column. Nulled the foo column for all the rows. Restored all the above But now we found out it's not just couple of tables but 254 tables. Is there an easy way, (or at least easier than this) to alter the columns length? P.S. I have DBA permissions.

    Read the article

  • Retrieving xml value into a string

    - by DelvinK
    Hello, In the following XML structure how do i retrieve the name value and put this into a string? (i am using a XPathNavigator in my method) <testsystem> <test> <name>one</name> </test> </testsystem> I was able to get a attribute with a syntax alike this: (but when changing the xml struture it no longer holds a attribute value) string name = nav.GetAttribute("name", "") But have no luck getting the value with a nav as of yet. The purpose is to be able to use it for the following object so i can put name into it. test t = new test() { Name = name, Questions= new List<Questions>() }; Best regards.

    Read the article

  • drupal adding onchange event to node form

    - by Arun
    hi i need to know how to add attribute onchange to a custom content_type field? For ex my content_type has 2 fields phone (name:field_phone[0][value], id:edit-field-phone-0-value),email (name:field_email[0][value], id:edit-field-email-0-value). i'm unable to add attribute as follows. function knpevents_form_event_node_form_alter(&$form, &$form_state) { $form['title']['#attributes'] = array('onchange' => "return titlevalidate(0)");//fine $form['field_evt_org[0][value]']['#attributes']= array('onchange' => "return organiservalidate(0)"); //error $form['field_evt_org[0][value]']['#attributes']= array('onchange' => "return organiservalidate(0)"); //error } how to add it

    Read the article

  • Opening all external links in Phongap's ChildBrowser using jQuery Mobile

    - by Adam
    I'm using jQuery Mobile & Phonegap, and have the following code to open all external links in a certain div with the ChildBrowser: $('.someDIV a').live('click', function() { var thisUrl = $(this).attr('href'); PhoneGap.exec("ChildBrowserCommand.showWebPage", thisUrl); return false; }); For some reason, while the page loads in the childbrowser, it also loads in the background, as if there's no "return false". I've found a workaround by giving the link's href attribute a value of "#", and using the title for the url like this: And updating the jQuery code accordingly, but this is a problem where my links are dynamically generated, and I can't have the url in the title attribute. Any ideas how to solve this?

    Read the article

  • Why is Dictionary.First() so slow?

    - by Rotsor
    Not a real question because I already found out the answer, but still interesting thing. I always thought that hash table is the fastest associative container if you hash properly. However, the following code is terribly slow. It executes only about 1 million iterations and takes more than 2 minutes of time on a Core 2 CPU. The code does the following: it maintains the collection todo of items it needs to process. At each iteration it takes an item from this collection (doesn't matter which item), deletes it, processes it if it wasn't processed (possibly adding more items to process), and repeats this until there are no items to process. The culprit seems to be the Dictionary.Keys.First() operation. The question is why is it slow? Stopwatch watch = new Stopwatch(); watch.Start(); HashSet<int> processed = new HashSet<int>(); Dictionary<int, int> todo = new Dictionary<int, int>(); todo.Add(1, 1); int iterations = 0; int limit = 500000; while (todo.Count > 0) { iterations++; var key = todo.Keys.First(); var value = todo[key]; todo.Remove(key); if (!processed.Contains(key)) { processed.Add(key); // process item here if (key < limit) { todo[key + 13] = value + 1; todo[key + 7] = value + 1; } // doesn't matter much how } } Console.WriteLine("Iterations: {0}; Time: {1}.", iterations, watch.Elapsed); This results in: Iterations: 923007; Time: 00:02:09.8414388. Simply changing Dictionary to SortedDictionary yields: Iterations: 499976; Time: 00:00:00.4451514. 300 times faster while having only 2 times less iterations. The same happens in java. Used HashMap instead of Dictionary and keySet().iterator().next() instead of Keys.First().

    Read the article

  • Visual Studio 2010 Not Recognizing Unit Test

    - by jmease
    In an existing solution I added a new Test Project. In my Test Project .cs file I have a class decorated with the [TestClass] attribute and a method decorated with the [TestMethod] attribute. I have verified that in Configuration Manager the build check box is checked for the Test Project (as my google search has revealed was the problem for others with this issue). I have set Test Project as my start up project for the solution. When I try to start the test I get "Can not start test project because the project does not contain any tests". I am really new to unit testing. What am I missing?

    Read the article

  • How to send KeyEvents trough an input method service to a Dialog, or a Spinner menu?

    - by shutdown11
    I'm trying to implement an input method service that receives intents sent by a remote client, and in response to those sends an appropriate KeyEvent. I'm using in the input method service this method private void keyDownUp(int keyEventCode) { getCurrentInputConnection().sendKeyEvent( new KeyEvent(KeyEvent.ACTION_DOWN, keyEventCode)); getCurrentInputConnection().sendKeyEvent( new KeyEvent(KeyEvent.ACTION_UP, keyEventCode)); } to send KeyEvents as in the Simple Sofykeyboard Sample, and it works in the home, in Activities... but it doesn't works when a Dialog or the menu of a Spinner is in foreground. The events is sent to the parent activity behind the Dialog. Is there any way to send keys and control the device like using the hardware keys from an input method?

    Read the article

  • function to efficiently check a change of value in a nested hashmap

    - by zcaudate
    the motivation is for checking what has changed in a deeply nest map, kind of like a reverse of update-in. This is a simple example: (def p1 {:a {:a1 :1 :a2 :2} :b {:b1 :1 :b2 :2}}) (def p2 (update-in p1 [:a :a1] (constantly :updated)) ;; => {:a {:a1 :updated :a2 :2} ;; :b {:b1 :1 :b2 :2}} (what-changed? p1 p2) ;; => {:keys [:a :a1] :value :updated) (what-changed? p2 p1) ;; => {:keys [:a :a1] :value :2) I'm hoping that because clojure maps are persistent data-structures, there may be a smart algorithm to figure this out by looking at the underlying structure as opposed to walking through the nested maps and comparing the difference.

    Read the article

  • Dynamically creating/inserting into an associative array in PHP

    - by emil.mp
    I'm trying to build an associative array in PHP dynamically, and not quite getting my strategy right. Basically, I want to insert a value at a certain depth in the array structure, for instance: $array['first']['second']['third'] = $val; Now, the thing is, I'm not sure if that depth is available, and if it isn't, I want to create the keys (and arrays) for each level, and finally insert the value at the correct level. Since I'm doing this quite a lot in my code, I grew tired of doing a whole bunch of "array_key_exists", so I wanted to do a function that builds the array for me, given a list of the level keys. Any help on a good strategy for this is appreciated. I'm sure there is a pretty simple way, I'm just not getting it...

    Read the article

  • [C#] Creating standalone, console (shell) for domain-specific operations

    - by mr.b
    Say that I have a system service, and I want to offer a low-level maintenance access to it. For that purpose, I'd like to create a standalone, console application that somehow connects to server process and lets user type in commands, allow it to use auto-completion and auto-suggestion on single/double TAB press (just like linux bash shell, mysql cli, cmd.exe, and countless others), allow command line editing capabilities (history, cursor keys to move around text..), etc. Now, it's not that much of a problem to create something like that by rolling my own from scratch, handling user input, scanning pressed keys, and doing correct actions. But, why reinvent the wheel? Is there some library/framework that helps with this kind of problems, just like readline library that offers improved command-line editing capabilities under linux? Of course, this new "shell" would respond only to valid, domain-specific commands, and would suggest valid arguments, options, switches... Any ideas? Thanks!

    Read the article

  • Should I use a huge composite primary key or just a unique id?

    - by Jack
    I have been trying to do web scraping of a particular site and storing the results in a database. My original assumptions about the data allowed a schema where I could use fairly reasonable composite primary keys (usually containing only 2 or 3 fields) but as time went on, I realized that my original assumptions about the data were wrong and my primary keys were not as unique as I thought they were, so I have slowly been expanding them to contain more and more fields. In fact, I have recently come to believe that their database has no constraints whatsoever. Just today, I have finally expanded my a primary key for one of my tables to contain every field in that table and I thought now would be a good time to ask: is it better to add an auto-incrementing column that is just a unique id or just leave a composite primary key on the entire table?

    Read the article

  • How can I strip line breaks from my XML with XSLT?

    - by Eric
    I have this XSLT: <xsl:strip-space elements="*" /> <xsl:template match="math"> <img class="math"> <xsl:attribute name="src">http://latex.codecogs.com/gif.latex?<xsl:value-of select="text()" /></xsl:attribute> </img> </xsl:template> Which is being applied to this XML (notice the line break): <math>\text{average} = \alpha \times \text{data} + (1-\alpha) \times \text{average}</math> Unfortunately, the transform creates this: <img class="math" src="http://latex.codecogs.com/gif.latex?\text{average} = \alpha \times \text{data} + (1-\alpha) \times&#10;&#9;&#9;&#9;&#9;&#9;\text{average}" /> Notice the whitespace character literals. Although it works, it's awfully messy. How can I prevent this?

    Read the article

  • Get name and value from the input tag

    - by DroidIn.net
    Before you say "oh no, not again" here I'm stating my case. I'm parsing part of HTML output and the only thing I'm interested in is name and value attributes of each <input/ tag. HTML is actually HTML fragment, may not be well-formed. I don't have DOM or HTML parser and I don't try to parse nested elements anyway. The problem is that I don't know the order or number of attributes so it could be <input name="foo" value="boo"/> or <input type="hidden" name=foo> or <input id=blah value='boo' src="image.png" name="foo" type="img"/>. Is there a single regular expression that would get me values of name and value attribute in predictable order? I wouldn't have asked the question if I could assume that name attribute always precedes value but unfortunately this is not the case

    Read the article

  • Need recommendation for object serialization library in c++

    - by michael
    Hi, I am looking for recommendation for object serialization/deserialization library in c++? Which one are the most advanced and open-sourced? Can it handle Any class that users defined? Object hierarchy (parent and child classes)? A Tree of objects? Class A has an attribute of Class B which has an attribute of Class C? STL containers? Class A has a vector of Class B? A cyclic of objects? Class A has a pointer pointing to B which has a pointer to A? I find boost serialization library. I am not sure what is its limitation from http://www.boost.org/doc/libs/1_42_0/libs/serialization/doc/tutorial.html

    Read the article

  • problme with javascript map/object

    - by akshay
    I am using javascript map to store keys and values.Later on I check if specified key is present in map or not, but it sometimes gives correct result but sometimes it dont.I tried to print the map using console.log(mapname), it shows all keys, but i i try to check if some specified key is presnt sometimes it gives wrong answer. Am using following code: //following code is called n times in loop with different/same vales of x myMap : new Object(); var key = x ; //populated dynamically actually myMap[key] ="dummyval"; if(myIdMap[document.getElementById("abc").value.trim()]!=null) alert('present' ); else alert('not present'); What can be the possible problem?

    Read the article

  • ASP.NET MVC2 - Trim white space from form submits before server-side validation?

    - by David Lively
    If I add a validation attribute: public class ProductDownloadListModel { //xxxxx-xxxxx-xxxxx [Required] [StringLength(17)] public string PSN { get; set; } public DateTime PsnExpirationDate { get; set; } public DataTable Downloads { get; set; } } and the user enters a 17-character string but includes white space on the end, I get a validation error because the string is greater than that specified by the [StringLength(17)] attribute. How can I prevent this? I'd prefer not to have to have javaScript trim the string before submits.

    Read the article

  • Runtime Error in asp.net?(online )

    - by Surya sasidhar
    hi, I develop a web application it is working fine in local. When i upload the site in online through CuteFTP it is showing the error like this... Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. Details: To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off". Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's configuration tag to point to a custom error page URL. please help me i place the but even though it is not working it is giving same error. Thank you

    Read the article

  • How to select the previous element of a given class

    - by JCN
    I have an UL list : <ul> <li data-sel='foo'></li> <li></li> <li data-sel='foo'></li> <li class='selected'></li> <li data-sel='foo'></li> </ul> I can access the first previous element of li.selected who do not have attribute data-sel=foo by using :not selector var element = $('.selected').prev("li:not([data-sel='foo'])"); But how can i access the first previous element of li.selected who have attribute data-sel=foo ?

    Read the article

  • Is this a good approach to execute a list of operations on a data structure in Python?

    - by Sridhar Iyer
    I have a dictionary of data, the key is the file name and the value is another dictionary of its attribute values. Now I'd like to pass this data structure to various functions, each of which runs some test on the attribute and returns True/False. One approach would be to call each function one by one explicitly from the main code. However I can do something like this: #MYmodule.py class Mymodule: def MYfunc1(self): ... def MYfunc2(self): ... #main.py import Mymodule ... #fill the data structure ... #Now call all the functions in Mymodule one by one for funcs in dir(Mymodule): if funcs[:2]=='MY': result=Mymodule.__dict__.get(funcs)(dataStructure) The advantage of this approach is that implementation of main class needn't change when I add more logic/tests to MYmodule. Is this a good way to solve the problem at hand? Are there better alternatives to this solution?

    Read the article

  • Having trouble applying style to SVG using JavaScript upon object creation

    - by Jack Roscoe
    Hi, I have a function which creates an SVG text object using JavaScript. As soon as the object is created, I want it to have the style attribute which in CSS would be text-anchor: left. Currently, it doesn't work. I have tried many variations, and I also read that when using styles in JavaScript you must remove any '-' dashes and format the attribute name in camel casing (is this true?). Can anybody spot my mistake? Here's my code: RenderTextBox:function() { this.textBox = paper.text(this.x, this.y, this.htmlTextBox); this.textBox.style.textAnchor="left"; }

    Read the article

  • how does [<Literal>] differ from other constants in F#

    - by Mitzh
    I am a bit confused by the Literal keyword and why it is necessary in F#. Reading the docs, it sounds to me that [<Literal>] is used to define a constant, however I am a bit confused how this constant differs from all other constants in F#.. Values that are intended to be constants can be marked with the Literal attribute. This attribute has the effect of causing a value to be compiled as a constant. When I think of a constant, I think of something which is immutable.... let x = "a" + "b" //this is a immutable value, its value is constant [<Literal>] let y = "a" + "b" //this is also a immutable value, but why is this a special constant? Is it because the 'normal' F# values are evaluated lazily and the [<Literal>] is not evaluated lazily..? is that what they mean with 'compiled as constant'..? or is there something else to it?

    Read the article

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