Search Results

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

Page 210/433 | < Previous Page | 206 207 208 209 210 211 212 213 214 215 216 217  | Next Page >

  • Deserializing classes from XML generated using XSD.exe

    - by heap
    I have classes generated (using xsd.exe) from an .xsd that I can serialize just fine, but when I try and deserialize it, I get the error: {"<XMLLanguages xmlns='http://tempuri.org/XMLLanguages.xsd'> was not expected."} I've searched for a couple of hours and found most peoples problems lie in not declaring namespaces in their xsd/xml, not defining namespaces in their classes, etc, but I can't find a solution for my problem. Here are code snippets for the relevant classes. <?xml version="1.0" encoding="utf-8"?> <xs:schema id="SetupData" targetNamespace="http://tempuri.org/XMLLanguages.xsd" elementFormDefault="qualified" xmlns="http://tempuri.org/XMLLanguages.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" > <xs:element name="XMLLanguages"> <xs:complexType> <xs:sequence> <xs:element name="Tier" minOccurs="1" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="L" minOccurs="1" maxOccurs="unbounded" type="Language"/> </xs:sequence> <xs:attribute name="TierID" type="xs:int"/> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:complexType name="Language"> <xs:sequence> <xs:element name="LangID" type="xs:int"/> <xs:element name="Tier" type="xs:int"/> <xs:element name ="Name" type="xs:string"/> </xs:sequence> <xs:attribute name ="PassRate" type="xs:int"/> </xs:complexType> </xs:schema> And the class: /// <remarks/> [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://tempuri.org/XMLLanguages.xsd")] [System.Xml.Serialization.XmlRootAttribute(Namespace = "http://tempuri.org/XMLLanguages.xsd", IsNullable = false)] public partial class XMLLanguages { private List<XMLLanguagesTier> tierField; /// <remarks/> [System.Xml.Serialization.XmlElementAttribute("Tier")] public List<XMLLanguagesTier> Tiers { get { return this.tierField; } set { this.tierField = value; } } } And a the line in XML causing the error: <XMLLanguages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/XMLLanguages.xsd">

    Read the article

  • A python random function acts differently when assigned to a list or called directly...

    - by Dror Hilman
    I have a python function that randomize a dictionary representing a position specific scoring matrix. for example: mat = { 'A' : [ 0.53, 0.66, 0.67, 0.05, 0.01, 0.86, 0.03, 0.97, 0.33, 0.41, 0.26 ] 'C' : [ 0.14, 0.04, 0.13, 0.92, 0.99, 0.04, 0.94, 0.00, 0.07, 0.23, 0.35 ] 'T' : [ 0.25, 0.07, 0.01, 0.01, 0.00, 0.04, 0.00, 0.03, 0.06, 0.12, 0.14 ] 'G' : [ 0.08, 0.23, 0.20, 0.02, 0.00, 0.06, 0.04, 0.00, 0.54, 0.24, 0.25 ] } The scambling function: def scramble_matrix(matrix, iterations): mat_len = len(matrix["A"]) pos1 = pos2 = 0 for count in range(iterations): pos1,pos2 = random.sample(range(mat_len), 2) #suffle the matrix: for nuc in matrix.keys(): matrix[nuc][pos1],matrix[nuc][pos2] = matrix[nuc][pos2],matrix[nuc][pos1] return matrix def print_matrix(matrix): for nuc in matrix.keys(): print nuc+"[", for count in matrix[nuc]: print "%.2f"%count, print "]" now to the problem... When I try to scramble a matrix directly, It's works fine: print_matrix(mat) print "" print_matrix(scramble_matrix(mat,10)) gives: A[ 0.53 0.66 0.67 0.05 0.01 0.86 0.03 0.97 0.33 0.41 0.26 ] C[ 0.14 0.04 0.13 0.92 0.99 0.04 0.94 0.00 0.07 0.23 0.35 ] T[ 0.25 0.07 0.01 0.01 0.00 0.04 0.00 0.03 0.06 0.12 0.14 ] G[ 0.08 0.23 0.20 0.02 0.00 0.06 0.04 0.00 0.54 0.24 0.25 ] A[ 0.41 0.97 0.03 0.86 0.53 0.66 0.33.05 0.67 0.26 0.01 ] C[ 0.23 0.00 0.94 0.04 0.14 0.04 0.07 0.92 0.13 0.35 0.99 ] T[ 0.12 0.03 0.00 0.04 0.25 0.07 0.06 0.01 0.01 0.14 0.00 ] G[ 0.24 0.00 0.04 0.06 0.08 0.23 0.54 0.02 0.20 0.25 0.00 ] but when I try to assign this scrambling to a list , it does not work!!! ... print_matrix(mat) s=[] for x in range(3): s.append(scramble_matrix(mat,10)) for matrix in s: print "" print_matrix(matrix) result: A[ 0.53 0.66 0.67 0.05 0.01 0.86 0.03 0.97 0.33 0.41 0.26 ] C[ 0.14 0.04 0.13 0.92 0.99 0.04 0.94 0.00 0.07 0.23 0.35 ] T[ 0.25 0.07 0.01 0.01 0.00 0.04 0.00 0.03 0.06 0.12 0.14 ] G[ 0.08 0.23 0.20 0.02 0.00 0.06 0.04 0.00 0.54 0.24 0.25 ] A[ 0.01 0.66 0.97 0.67 0.03 0.05 0.33 0.53 0.26 0.41 0.86 ] C[ 0.99 0.04 0.00 0.13 0.94 0.92 0.07 0.14 0.35 0.23 0.04 ] T[ 0.00 0.07 0.03 0.01 0.00 0.01 0.06 0.25 0.14 0.12 0.04 ] G[ 0.00 0.23 0.00 0.20 0.04 0.02 0.54 0.08 0.25 0.24 0.06 ] A[ 0.01 0.66 0.97 0.67 0.03 0.05 0.33 0.53 0.26 0.41 0.86 ] C[ 0.99 0.04 0.00 0.13 0.94 0.92 0.07 0.14 0.35 0.23 0.04 ] T[ 0.00 0.07 0.03 0.01 0.00 0.01 0.06 0.25 0.14 0.12 0.04 ] G[ 0.00 0.23 0.00 0.20 0.04 0.02 0.54 0.08 0.25 0.24 0.06 ] A[ 0.01 0.66 0.97 0.67 0.03 0.05 0.33 0.53 0.26 0.41 0.86 ] C[ 0.99 0.04 0.00 0.13 0.94 0.92 0.07 0.14 0.35 0.23 0.04 ] T[ 0.00 0.07 0.03 0.01 0.00 0.01 0.06 0.25 0.14 0.12 0.04 ] G[ 0.00 0.23 0.00 0.20 0.04 0.02 0.54 0.08 0.25 0.24 0.06 ] What is the problem??? Why the scrambling do not work after the first time, and all the list filled with the same matrix?!

    Read the article

  • Mapping a ER model to Rails

    - by Thiago
    Hi there, I want to map the following ER schema to rails: I have an entity called "user" which has a self relationship called "has friend", which has an attribute called "status". In code, I would like to run: User.friends and it should return me an array of users, containing the users that I'm friend of. It shouldn't matter in which side of the relationship I am (i.e. whether I'm the friender or the friendee). Any thoughts?

    Read the article

  • B- trees, B+ trees difference

    - by dta
    In a B- tree you can store both keys and data in the internal/leaf nodes. But in a B+ tree you have to store the data in the leaf nodes only. Is there any advantage of doing the above in a B+ tree? Why not use B- trees instead of B+ trees everywhere? As intuitively they seem much faster. I mean why do you need to replicate the key(data) in a B+ tree?

    Read the article

  • sharepoint full text query with attributes missing isn't returning the results I expected

    - by Jason Hocker
    If I am doing a search in sharepoint, some of the results I'm expecting are not being returned. I believe its because in active directory these entries may not have all the fields. So a name that doesn't have the givenName attribute set in active directory is not being returned from this query. Is there a way I can get this to work like I expected? "select LastName, FirstName, PreferredName, AccountName from scope() where \"scope\"='People' AND (LastName like '%" + search + "%' OR FirstName like '%" + search + "%' OR PreferredName like '%" + search + "%')";

    Read the article

  • How to add my program to the OS X system menu bar?

    - by Joe
    I have created a volume controller for iTunes but I would like this app to place an icon on the OS X system menu bar and have my slider controller drop down. I created this because I have to switch to iTunes to change the volume of the music because I am using the digital-out audio and the keyboard keys do not work in digital-out mode. Any guidance would be greatly appreciated.

    Read the article

  • Move application to second monitor in MFC

    - by Anu
    Hi, I m developing applcaiton in VS2008 VC++.net I want to move the application to secondary monitor.Not by clicking and dragging using mouse. Is there any function like MoveToMonitor by pressing the button or any shortcut keys. Then it should move to secondary monitor.

    Read the article

  • Why don't my scrollbars work properly when programmatically hiding rows in silverlight Datagrid?

    - by Luke Vilnis
    I have a Silverlight datagrid with custom code that allows for +/- buttons on the lefthand side and can display a table with a tree structure. The +/- buttons are bound to a IsExpanded property on my ViewModelRows, as I call them. The visibility of rows is bound to an IsVisible property on the ViewModelRows which is determined based on whether or not all of the parent rows are expanded. Straightforward enough. This code works fine in that if I scroll up and down the grid with PageUp/PageDown or the arrow keys, all the right rows are hidden and everything has the right structure and I can play with the +/- buttons to my hearts content. However, the vertical scroll bar on the right hand side, although it starts off the correct size and it scrolls through the rows smoothly, when I collapse rows and then re-expand them, doesn't go back to its correct size. The scrollbar can still usually be moved around to scroll through the whole collection, but because it is too big, once the bar moves to the bottom, there are still more rows to go through and it sort of jerkily shoots all the way down to the bottom or sometimes fails to scroll at all. This is pretty hard to describe so I included a screenshot with the black lines drawn on to show the difference in scrollbar length even though the two grids have the same number of rows expanded. I think this might be a bug related to the way the Datagrid does virtualization of rows. It seems to me like it isn't properly keeping track of how tall each row is supposed to be when expansion states change. Is there a way to programmatically "poke" (read hack) it to recalculate its scrollbar size on LoadingRow or something ugly like that? I'd include a code sample but there's 2 c# files and 1 xaml file so I wanted to see if anyone else has heard of this sort of issue before I try to make it reproducible in a self-contained way. Once again, scrolling with the arrow keys works fine so I'm pretty sure the underlying logic and binding is working, there's just some issue with the row height not being calculated properly. Since I'm a new user, it won't let me use image tags so here's the link to a picture of the problem: http://img210.imageshack.us/img210/8760/messedupscrollbars.png

    Read the article

  • why aren't interfaces [Serializable]?

    - by Zac Harlan
    I would think that adding that attribute to an interface would be helpful make sure you don't create classes that use the interface and forget to make them serializable. This could be a very fundamental question but wanted to ask the experts. Thanks in advance. Zac

    Read the article

  • How to make an application like google transliteration desktop application in c#

    - by Thunder
    I would like to make a application that accepts the entry from keyboard modify it and send it to the active window (may be application like word, excel,notepad windows screens ) etc. It the feature is just like google's transliteration application for windows . I would like to do it in c# . I think this involves hooking in the keyboard and sending keys (like sendkey in vb) to the current window.

    Read the article

  • NHibernate Query

    - by Nathan Roe
    Is it possible to get NHibernate to generate a query similar to the following with HQL or Criteria API? select * from ( select row_number() over ( partition by Column1 order by Column2 ) as RowNumber, T.* from MyTable T ) where RowNumber = 1 I can get it to execute the inner select using the formula attribute, but I can't figure out a way to write a HQL or Criteria query that lets me wrap the inner select in the outer one.

    Read the article

  • Choosing the default value of an Enum type without having to change values

    - by frou
    In C#, is it possible to decorate an Enum type with an attribute or do something else to specify what the default value should be, without having the change the values? The numbers required might be set in stone for whatever reason, and it'd be handy to still have control over the default. enum Orientation { None = -1, North = 0, East = 1, South = 2, West = 3 } Orientation o; // Is 'North' by default.

    Read the article

  • Reference data using @ModelAttribute

    - by Eqbal
    I am trying to populate couple of select lists on a form and I am using @ModelAttribute to annotate the get method for these lists. I am getting an exception when I try to access the resource: java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'command' available as request attribute

    Read the article

  • Objective C: CoreData and aggregation

    - by Ralf
    Given a CoreData-Entity with an date (days) and an ammount called Transaction. Is it with CoreData possible (and how) to aggregate/group the 'table' (with all Transactions) by Date and calculate the sum of the day in a second column/attribute? (the SQL-Solution would be SELECT date, sum(ammount) FROM transaction GROUP BY date)

    Read the article

  • Winforms ComboBox does not expand when clicked, any ideas?

    - by peter p
    Hi everybody, A ComboBox within a Form (modal dialog) does not open when clicked, however an item can be selected by using the up/down arrow keys. After clicking on another window and the back on the dialog, the ComboBox works as expected, i.e. expands on click. Weird... any ideas what could be causing this behavior? Thanks a lot in advance, Peter

    Read the article

  • Multiple key binding in WPF

    - by nihi_l_ist
    How can i execute some command on, lets say, Ctrl+Shift+E? As i saw we can write the following: KeyBinding kb = new KeyBinding(TestCommand, Key.E, ModifierKeys.Control); this.InputBindings.Add(kb); But how can i add more ModifierKeys or Keys?

    Read the article

  • As-You-Type-Searching with Core Data / NSFetchedResultsController

    - by Snej
    I implemented an as-you-type-searching (text search on single attribute) by fetching with performFetch: after each given character by the user. The performFetch: is running in a background thread to avoid keyboard freezes. But while typing many useless fetches are started. A NSOperationQueue might be an option, but I wonder if there are other approaches for this quite usual search behavior. What's best practice to notice when fetching is done and the table view is updated with the previous fetch to start a new fetch?

    Read the article

  • Convert HTML DOM into a multidimensional array

    - by dclowd9901
    Where keys are represented by element type and values are represented by #foo and .bar (spaced and ready for explode()). Is it possible, or does something exist for it? I know that this question might incite some wrath, and I'm hoping nobody links to that post about parsing HTML, but I'm hoping it's not impossible. Thanks for the help. Addendum: Ideally, PHP would be used, since it's the only scripting language I know.

    Read the article

  • Simple way to encode a string according to a password?

    - by RexE
    Does Python have a built-in, simple way of encoding/decoding strings using a password? Something like this: >>> encode('John Doe', password = 'mypass') 'sjkl28cn2sx0' >>> decode('sjkl28cn2sx0', password = 'mypass') 'John Doe' I would like to use these encrypted strings as URL parameters. My goal is obfuscation, not strong security. I realize I could use a database table to store keys and values, but am trying to be minimalist.

    Read the article

< Previous Page | 206 207 208 209 210 211 212 213 214 215 216 217  | Next Page >