Search Results

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

Page 61/433 | < Previous Page | 57 58 59 60 61 62 63 64 65 66 67 68  | Next Page >

  • How to remove a tab attribute in ASP .NET AJAX Toolkit using Regular Expression

    - by Nassign
    I have tried to remove the following tag generated by the AJAX Control toolkit. The scenario is our GUI team used the AJAX control toolkit to make the GUI but I need to move them to normal ASP .NET view tag using MultiView. I want to remove all the __designer: attributes Here is the code <asp:TextBox ID="a" runat="server" __designer:wfdid="w540" /> <asp:DropdownList ID="a" runat="server" __designer:wfdid="w541" /> ..... <asp:DropdownList ID="a" runat="server" __designer:wfdid="w786" /> I tried to use the regular expression find replace in Visual Studio using: Find: :__designer\:wfdid="w{([0-9]+)}" Replace with empty space Can any regular expression expert help?

    Read the article

  • NullPointerException when generating RSA keys with BouncyCastle

    - by Tom Brito
    public static void main(String[] args) throws Exception { RSAKeyPairGenerator rsaKeyPairGen = new RSAKeyPairGenerator(); AsymmetricCipherKeyPair keyPair = rsaKeyPairGen.generateKeyPair(); } the rsaKeyPairGen is not null, but the generateKeyPair() method is throwing NullPointerException. What may be wrong? Error message: java.lang.NullPointerException at org.bouncycastle.crypto.generators.RSAKeyPairGenerator.generateKeyPair(Unknown Source) at pkg.main(Main.java:154)

    Read the article

  • cakephp filter index pages according to foreign keys

    - by Marki
    Hi there, I'm pretty new to CakePHP and was missing a crucial feature not generated as scaffold: filtering. What do I have to do to provide dropdowns or multi-selects on the index pages for each field that is a (foreign) key, thereby allowing to filter the table ("OR" inside multi-select, "AND" between different multi-selects, if any)? From what my websearch has shown me there are many more people trying to accomplish the same thing, although I couldn't find anything that would work for me because either they have text fields and do wildcard filtering, or the plugins they propose only work for 1.2 whereas i now started with 1.3 etc. etc. Can someone alleviate the confusion and maybe present some working code or direct me to the definitive guide[tm] where this matter has been solved? Thx

    Read the article

  • XmlSerialize a custom collection with an Attribute

    - by roomaroo
    I've got a simple class that inherits from Collection and adds a couple of properties. I need to serialize this class to XML, but the XMLSerializer ignores my additional properties. I assume this is because of the special treatment that XMLSerializer gives ICollection and IEnumerable objects. What's the best way around this? Here's some sample code: using System.Collections.ObjectModel; using System.IO; using System.Xml.Serialization; namespace SerialiseCollection { class Program { static void Main(string[] args) { var c = new MyCollection(); c.Add("Hello"); c.Add("Goodbye"); var serializer = new XmlSerializer(typeof(MyCollection)); using (var writer = new StreamWriter("test.xml")) serializer.Serialize(writer, c); } } [XmlRoot("MyCollection")] public class MyCollection : Collection<string> { [XmlAttribute()] public string MyAttribute { get; set; } public MyCollection() { this.MyAttribute = "SerializeThis"; } } } This outputs the following XML (note MyAttribute is missing in the MyCollection element): <?xml version="1.0" encoding="utf-8"?> <MyCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <string>Hello</string> <string>Goodbye</string> </MyCollection> What I want is <MyCollection MyAttribute="SerializeThis" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <string>Hello</string> <string>Goodbye</string> </MyCollection> Any ideas? The simpler the better. Thanks.

    Read the article

  • Remove certain keys from a dictionary in python

    - by Margaret
    I'm trying to construct a dictionary that contains a series of sets: {Field1:{Value1, Value2, Value3}, Field2{Value4}} The trouble is, I then wish to delete any fields from the dictionary that only have one value in the set. I have been writing code like this: for field in FieldSet: if len(FieldSet[field]) == 1: del(FieldSet[field]) But receive the error "RuntimeError: dictionary changed size during execution". (Not surprising, since that's what I'm doing.) It's not the be-all and end-all if I have to knock together some sort of workaround, but is it possible to do this?

    Read the article

  • .NET C# how to loop through some lable to set their attribute

    - by sydney wynn
    How do I do this in a loop. protected void ddlTool_SelectedIndexChanged(object sender, EventArgs e) { lblTool1.Visible = false; txtTool1.Visible = false; lblTool2.Visible = false; txtTool2.Visible = false; lblTool3.Visible = false; txtTool3.Visible = false; lblTool4.Visible = false; txtTool4.Visible = false; lblTool5.Visible = false; if (ddlTool.SelectedValue == "1") { lblTool1.Visible = true; txtTool1.Visible = true; } if (ddlTool.SelectedValue == "2") { lblTool1.Visible = true; txtTool1.Visible = true; lblTool2.Visible = true; txtTool2.Visible = true; } if (ddlTool.SelectedValue == "3") { lblTool1.Visible = true; txtTool1.Visible = true; lblTool2.Visible = true; txtTool2.Visible = true; lblTool3.Visible = true; txtTool3.Visible = true; } if (ddlTool.SelectedValue == "4") { lblTool1.Visible = true; txtTool1.Visible = true; lblTool2.Visible = true; txtTool2.Visible = true; lblTool3.Visible = true; txtTool3.Visible = true; lblTool4.Visible = true; txtTool4.Visible = true; }

    Read the article

  • Selecting an element based on text and attribute of its sibling, using Xpath

    - by Adam Asham
    Looking at the document, the goal is to select the second cell from the second row, in the first table. I've created the following expression: //row/td[2]/text()[td[@class="identifier"]/span[text()="identifier"]] but it does not return any rows. Unfortunately I do not see what's wrong. To me, it looks alright. The expression should: select the text in the second cell in any row where the text of a span equals to "identifier" and the span is located in cell with a "identifier" class I'd appreciate it if you could point out what I'm doing wrong. Sample XML document: <?xml version="1.0"?> <html> <table class="first"> <tr> <td>row 1, cell 1</td> <td>row 1, cell 2</td> </tr> <tr> <td class="identifier"> <span>identifier</span> </td> <td> foo <span>ignore</span> bar </td> </tr> <tr> <td>row 3, cell 1</td> <td>row 3, cell 2</td> </tr> </table> <table class="second"> <tr> <td>row 1, cell 1</td> <td>row 1, cell 2</td> </tr> <tr> <td class="identifier"> <span>not an identifier</span> </td> <td> not a target </td> </tr> <tr> <td>row 3, cell 1</td> <td>row 3, cell 2</td> </tr> </table> </html>

    Read the article

  • jQuery Set Child CSS Attribute Problem

    - by Jascha
    I have a child element of a div named "bob" that's class is '.divTitle' <div id="bob"> <div class="divTitle"> <a href="#"> <h1>Title</h1> </a> </div> </div> I am trying to set the background color of "divTitle" to red but for the life of me can't get this to work. Right now I am trying two things... $('#bob').children('.divTitle')[0].css('background-color', '#0f0'); // assuming children is returning an array... and $('#bob').children('.divTitle').css('background-color', '#0f0'); neither with any success... can anyone tell me what I am missing here? Do I have to go deeper than ".children"?

    Read the article

  • NHibernate, legacy database, foreign keys that aren't

    - by Joe
    The project I'm working on has a legacy database with lots of information in it that's used to alter application behavior. Basically I'm stuck with something that I have to be super careful about changing. Onto my problem. In this database is a table and in this table is a column. This column contains integers and most of the pre-existing data have a value of zero for this column. The problem is that this column is in fact a foreign key reference to another entity, it was just never defined as such in the database schema. Now in my new code I defined my Fluent-NHibernate mapping to treat this column as a Reference so that I don't have to deal with entity id's directly in my code. This works fine until I come across an entity that has a value of 0 in this column. NHibernate thinks that a value of 0 is a valid reference. When my code tries to use that referenced object I get an ObjectNotFoundException as obviously there is no object in my database with an id of 0. How can I, either through mapping or some kind of convention (I'm using Fluent-nhibernate), get NHibernate to treat id's that are 0 the same as if it was NULL?

    Read the article

  • ASP MVC 2: Regular expression attribute working on clientside but not on serverside

    - by wh0emPah
    [Required(ErrorMessage = "Date is required")] [RegularExpression(@"^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/((1[6-9]|[2-9]\d)\d{2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((1[6-9]|[2-9]\d)\d{2}))|((0[1-9]|1\d|2[0-8])\/02\/((1[6-9]|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$", ErrorMessage="Date is not valid must be like (dd/mm/jjjj)")] public DateTime Startdate{ get; set;} The client-side validation works perfectly. So it seems that JavaScript can successfully understand my regular expression. But when I do a postback, and the modelstate.Isvalid() gets called. My date isn't valid anymore. So I'm guessing that when .NET performs the matching with the regEx it doesn't match. My question: Why does this regular expression match on the client side but not on the server side?

    Read the article

  • How to get XML element/attribute name in SQL Server 2005

    - by OG Dude
    Hi, I have a simple procedure in SQL Server 2005 which takes some XML as input. The element attributes correspond to field names in tables. I'd like to be able to determine <elementName>, <attribNameX> dynamically as to avoid having to hardcode them into the procedure. How can I do this? The XML looks like this: <ROOT> <elementName attribName1 = "xxx" attribName2 = "yyy"/> <elementName attribName1 = "aaa" attribName2 = "bbb"/> ... </ROOT> The stored procedure like this: CREATE PROC dbo.myProc ( @XMLInput varchar(1000) ) AS BEGIN SET NOCOUNT ON DECLARE @XMLDocHandle int EXEC sp_xml_preparedocument @XMLDocHandle OUTPUT, @XMLInput SELECT someTable.someCol FROM dbo.someTable JOIN OPENXML (@XMLDocHandle, '/ROOT/elementName',1) WITH (attrib1Name int, attrib2Name int) AS XMLData ON someTable.attribName1 = XMLData.attribName1 AND someTable.attribName2 = XMLData.attribName2 EXEC sp_xml_removedocument @XMLDocHandle END GO The question has been asked here before but maybe there is a cleaner solution. Additionally, I'd like to pass the tablename as a parameter as well - I read some stuff arguing that this is bad style - so what would be a good solution for having a dynamic tablename? Thanks a lot in advance, /David

    Read the article

  • Css attribute selector for input type="button" not working on IE7

    - by Cesar Lopez
    Hi all, I am working on a big form and it contains a lot of buttons all over the form, therefore I am trying to get working input[type="button"] in my main css file so it would catch all buttons with out having to add a class to every single one, for some reason this is not working on IE7, after checking on the web it says that IE7 should be supporting this. Also it has to be type="button" and not type="submit" as not all buttons will submit the form. Could anybody give a hint what am I doing wrong? input[type="button"]{ text-align:center; } I have also tried input[type=button] Any help would be very much apreciated.

    Read the article

  • How to find attribute value

    - by Pramodh
    Hi, I need to find an inner text of an element inside an XmlDocument and return it's Xpath. for example, searching for "ThisText" inside : <xml> <xml2 val="ThisText"></xml2> </xml> should return the Xpath of xml2 what's the most efficient way of doing this in c#?

    Read the article

  • Numeric operations over SHA-1 generated keys in C#

    - by webdreamer
    I'm trying to implement a Chord distributed hash table. I want to use SHA-1 as the hash function to generate node ids and map values to the DHT. However, I'll need to use numerical operations on the SHA-1 generated key, such as a modulo, for example. I wonder in which type of variable should I put the array of bytes I get, and how can I convert from one to another.

    Read the article

  • Create attribute in XML

    - by user560411
    Hello. I have the following php code that adds data into XML and works correctly. However, in my second step I will create a form that deletes some of the elements. The problem is that I want to add an ID number and then the PHP file will search for it and delete entire node. My question is how can i add an ID into CD for this to work ? For example ( <cd id="xxxx"> ) Also, any ideas or examples of a code that deletes CD having the ID would be appreciate. insert.php ( my index file with the form ) <h1>Playlist</h1> <form action="insert2.php" method="post"> <fieldset> <label for="TITLE">TITLE:</label><input type="text" id="title" name="title" /><br /> <label for="title">BAND:</label> <input type="text" id="band" name="band"/><br /> <label for="path">YEAR:</label> <input type="text" id="year" name="year" /> <br /> <input type="submit" /> </fieldset> </form> <h2>Current entries:</h2> <p>TITLE - BAND - YEAR</p> <?php $doc = new DOMDocument(); $doc->load( 'insert.xml' ); $CATEGORIES = $doc->getElementsByTagName( "CD" ); foreach( $CATEGORIES as $CD ) { $TITLES = $CD->getElementsByTagName( "TITLE" ); $TITLE = $TITLES->item(0)->nodeValue; $BANDS= $CD->getElementsByTagName( "BAND" ); $BAND= $BANDS->item(0)->nodeValue; $YEARS = $CD->getElementsByTagName( "YEAR" ); $YEAR = $YEARS->item(0)->nodeValue; echo "<b>$TITLE - $BAND - $YEAR\n</b><br>"; } ?> inser2.php ( the main code ) <?php $CD = array( 'TITLE' => $_POST['title'], 'BAND' => $_POST['band'], 'YEAR' => $_POST['year'], ); $doc = new DOMDocument(); $doc->load( 'insert.xml' ); $doc->formatOutput = true; $r = $doc->getElementsByTagName("CATEGORIES")->item(0); $b = $doc->createElement("CD"); $TITLE = $doc->createElement("TITLE"); $TITLE->appendChild( $doc->createTextNode( $CD["TITLE"] ) ); $b->appendChild( $TITLE ); $BAND = $doc->createElement("BAND"); $BAND->appendChild( $doc->createTextNode( $CD["BAND"] ) ); $b->appendChild( $BAND ); $YEAR = $doc->createElement("YEAR"); $YEAR->appendChild( $doc->createTextNode( $CD["YEAR"] ) ); $b->appendChild( $YEAR ); $r->appendChild( $b ); $doc->save("insert.xml"); ?> the XML file <?xml version="1.0" encoding="utf-8"?> <MY_CD> <CATEGORIES> <CD> <TITLE>NEVER MIND THE BOLLOCKS</TITLE> <BAND>SEX PISTOLS</BAND> <YEAR>1977</YEAR> </CD> <CD> <TITLE>NEVERMIND</TITLE> <BAND>NIRVANA</BAND> <YEAR>1991</YEAR> </CD> </CATEGORIES> </MY_CD>

    Read the article

  • jQuery attribute question

    - by Nick Simone
    I'm trying to select a series of divs one at a time. I'm sure theres a better way to do this, but I gave them all unique rels and I'm using the rels to select them one at a time. I want to move them over the width of the div, then animate it dropping down the screen. What I have is: $(document).ready(function(){ var totalbricks = 7; var index = 2; $(".brick").animate({top:"600px"}); while(index < totalbricks) { var postion = 45*index; $(".brick[rel='+index+']").css('left', postion+'px'); $(".brick[rel='+index+']").animate({top:"600px"}); index++; } }); All the divs are in a container div. Jquery docs say, 'Variables can be used using the following syntax: [name='" +MyVar+ "']' What am I doing wrong? Here is the HTML that is being used by the jQuery <body> <div id="container"> <div id="canvas"> <div class="brick" rel="1"> </div> <div class="brick" rel="2"> </div> <div class="brick" rel="3"> </div> <div class="brick" rel="4"> </div> <div class="brick" rel="5"> </div> <div class="brick" rel="6"> </div> <div class="brick" rel="7"> </div> </div> </div> </body>

    Read the article

  • JSF + PrimeFaces: `update` attribute does not update component

    - by Harry Pham
    Here is my layout <div id="mainPanel"> <div id="padding"> <h:outputText id="text" value="Personal Feed" rendered="#{Profile.renderComment}"/> </div> <div id="right"> <h:form> <p:commandButton value="Update" actionListener="#{bean.toggleComment}" update="text" /> </h:form> </div> </div> When I click the link Update, which suppose to toggle the renderComment boolean on and off, but it does not toggle the display of the text Personal Feed. Now if I put a form around the h:outputText, and instead update the form instead, then it work. Why is that?

    Read the article

  • Strange results - I obtain same value for all keys

    - by Pietro Luciani
    I have a problem with mapreduce. Giving as input a list of song ("Songname"#"UserID"#"boolean") i must have as result a song list in which is specified how many time different useres listen them... so a output ("Songname","timelistening"). I used hashtable to allow only one couple . With short files it works well but when I put as input a list about 1000000 of records it returns me the same value (20) for all records. This is my mapper: public static class CanzoniMapper extends Mapper<Object, Text, Text, IntWritable>{ private IntWritable userID = new IntWritable(0); private Text song = new Text(); public void map(Object key, Text value, Context context) throws IOException, InterruptedException { /*StringTokenizer itr = new StringTokenizer(value.toString()); while (itr.hasMoreTokens()) { word.set(itr.nextToken()); context.write(word, one); }*/ String[] caratteri = value.toString().split("#"); if(caratteri[2].equals("1")){ song.set(caratteri[0]); userID.set(Integer.parseInt(caratteri[1])); context.write(song,userID); } } } This is my reducer: public static class CanzoniReducer extends Reducer<Text,IntWritable,Text,IntWritable> { private IntWritable result = new IntWritable(); public void reduce(Text key, Iterable<IntWritable> values, Context context) throws IOException, InterruptedException { Hashtable<IntWritable,Text> doppioni = new Hashtable<IntWritable,Text>(); for (IntWritable val : values) { doppioni.put(val,key); } result.set(doppioni.size()); //doppioni.clear(); context.write(key,result); } } and main: Configuration conf = new Configuration(); Job job = new Job(conf, "word count"); job.setJarByClass(Canzoni.class); job.setMapperClass(CanzoniMapper.class); //job.setCombinerClass(CanzoniReducer.class); //job.setNumReduceTasks(2); job.setReducerClass(CanzoniReducer.class); job.setOutputKeyClass(Text.class); job.setOutputValueClass(IntWritable.class); FileInputFormat.addInputPath(job, new Path(args[0])); FileOutputFormat.setOutputPath(job, new Path(args[1])); System.exit(job.waitForCompletion(true) ? 0 : 1); Any idea???

    Read the article

  • NullPointerException when generating RSA keys with boucycastle

    - by Tom Brito
    public static void main(String[] args) throws Exception { RSAKeyPairGenerator rsaKeyPairGen = new RSAKeyPairGenerator(); AsymmetricCipherKeyPair keyPair = rsaKeyPairGen.generateKeyPair(); } the rsaKeyPairGen is not null, but the generateKeyPair() method is throwing NullPointerException. What may be wrong? Error message: java.lang.NullPointerException at org.bouncycastle.crypto.generators.RSAKeyPairGenerator.generateKeyPair(Unknown Source) at pkg.main(Main.java:154)

    Read the article

  • Setting Mnemonics and Hot Keys for a JOptionPane Dialog

    - by Daniel Bingham
    Is it possible to assign hotkeys and mnemonics to the buttons in a JOptionPane Dialog? I'd like to be able, in a JOptionPane generated message dialog with the options Yes, No and Cancel, press Y to hit the Yes button, N to hit the No button and escape to activate the escape button. Similarly in a dialog with Okay and Cancel buttons I'd like to be able to activate them with enter and escape. I've attempted passing JButtons into the JOptionPane's button Object array with the Mnemonics set already. The mnemonics work and the buttons show up correctly in the dialogs, however, they do not act properly when they are activated. Most noticeably they do not dispose of the dialog. What is the correct way to add hotkeys and Mnemonics to a JOptionPane Dialog's buttons? As always, my apologies ahead of time if this is a duplicate - I searched both Google and Stackoverflow and found nothing.

    Read the article

< Previous Page | 57 58 59 60 61 62 63 64 65 66 67 68  | Next Page >