Search Results

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

Page 88/433 | < Previous Page | 84 85 86 87 88 89 90 91 92 93 94 95  | Next Page >

  • How to set up precision attribute used by @Collumn annotation ???

    - by Arthur Ronald F D Garcia
    I often use java.lang.Integer as primary key. Here you can see some piece of code @Entity private class Person { private Integer id; @Id @Column(precision=8, nullable=false) public Integer getId() { } } I need to set up its precision attribute value equal to 8. But, when exporting The schema (Oracle), it does not work as expected. AnnotationConfiguration configuration = new AnnotationConfiguration(); configuration .addAnnotatedClass(Person.class) .setProperty(Environment.DIALECT, "org.hibernate.dialect.OracleDialect") .setProperty(Environment.DRIVER, "oracle.jdbc.driver.OracleDriver"); SchemaExport schema = new SchemaExport(configuration); schema.setOutputFile("schema.sql"); schema.create(true, false); schema.sql outputs create table Person (id number(10,0) not null) Always i get 10. Is There some workaround to get 8 instead of 10 ?

    Read the article

  • What Windows message is fired for mouse-up with modifier keys?

    - by Greg
    My WndProc isn't seeing mouse-up notifications when I click with a modifier key (shift or control) pressed. I see them without the modifier key, and I see mouse-down notifications with the modifier keys. I'm using the Windows Forms NativeWindow wrapper to get Windows messages from the WndProc() method. I've tried tracking the notifications I do get, and I the only clue I see is WM_CAPTURECHANGED. I've tried calling SetCapture when I receive the WM_LBUTTONDOWN message, but it doesn't help. Without modifier (skipping paint, timer and NCHITTEST messages): WM_LBUTTONDOWN WM_SETCURSOR WM_MOUSEMOVE WM_SETCURSOR WM_LBUTTONUP With modifier (skipping paint, timer and NCHITTEST messages): WM_KEYDOWN WM_PARENTNOTIFY WM_MOUSEACTIVATE WM_MOUSEACTIVATE WM_SETCURSOR WM_LBUTTONDOWN WM_SETCURSOR (repeats) WM_KEYDOWN (repeats) WM_KEYUP If I hold the mouse button down for a long time, I can usually get a WM_LBUTTONUP notification, but it should be possible to make it more responsive.. What am I missing? Thanks.

    Read the article

  • ASP MVC C#: Is it possible to pass dynamic values into an attribute?

    - by wh0emPah
    Okay I'm very new to C# and i'm trying to create a little website using ASP MVC2. I want to create my own authorization attribute. but i need to pass some values if this is possible. For example: [CustomAuthorize(GroupID = Method Parameter?] public ActionResult DoSomething(int GroupID) { return View(""); } I want to authorize the access to a page. but it depends on the value passed to the controller. So the authorization depends on the groupID. Is this possible to achieve this in any way?. Thanks in advance.

    Read the article

  • C# - Custom Attributes - Setting an attribute property to the type of the decorated class.

    - by cmaduro
    Is it possible to get the decorated class' type inside of the custom attribute's class? For example: [MetadataAttribute] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property, AllowMultiple = false)] public class ViewAttribute : ExportAttribute { public object TargetRegion { get; set; } public Type ViewModel { get; set; } public Type Module { get; set; } public ViewAttribute() : base(typeof(UserControl)) { Module = GetDecoratedClassType(); //I need this method } } In the following example GetDecoratedClassType() would return HomeView [View] HomeView MyHomeView { get; set; }

    Read the article

  • Stop invalid data in a attribute with foreign key constraint using triggers?

    - by Eternal Learner
    How to specify a trigger which checks if the data inserted into a tables foreign key attribute, actually exists in the references table. If it exist no action should be performed , else the trigger should delete the inserted tuple. Eg: Consider have 2 tables R(A int Primary Key) and S(B int Primary Key , A int Foreign Key References R(A) ) . I have written a trigger like this : Create Trigger DelS BEFORE INSERT ON S FOR EACH ROW BEGIN Delete FROM S where New.A <> ( Select * from R;) ); End; I am sure I am making a mistake while specifying the inner sub query within the Begin and end Blocks of the trigger. My question is how do I make such a trigger ?

    Read the article

  • How fast are App Engine db.get(keys) and A.all(keys_only=True).filter('b =', b).fetch(1000)?

    - by Liron Shapira
    A db.get() of 50 keys seems to take me 5-6 seconds. Is that normal? What is the time a function of? I also did a A.all(keys_only=True).filter('b =', b).fetch(1000) where A.b is a ReferenceProperty. I did 50 such round trips to the datastore, with different values of b, and the total time was only 3-4 seconds. How is this possible? db.get() is done in parallel, with only one trip to the datastore, and I would think that looking up an entity by key is a faster operation than fetch.

    Read the article

  • What is the role of name="..." attribute in input?

    - by metal-gear-solid
    In this form code what is the role of name="" attribute? name="s" and name="submit". Is it necessary to add? <form action="/index.php" method="get"> <fieldset> <legend>Search</legend> <label for="s"><span>Search WaSP</span> <input value="" name="s" id="s"></label> <input type="submit" value="Go!" name="submit" > </fieldset> </form>

    Read the article

  • Is there a standard .NET exception to throw when a class doesn't implement a required attribute?

    - by a typing monkey
    Suppose I want to throw a new exception when invoking a generic method with a type that doesn't have a required attribute. Is there a .NET exception that's appropriate for this situation, or, more likely, one that would be a suitable ancestor for a custom exception? For example: public static class ClassA { public static T DoSomething<T>(string p) { Type returnType = typeof(T); object[] typeAttributes = returnType.GetCustomAttributes(typeof(SerializableAttribute), true); if ((typeAttributes == null) || (typeAttributes.Length == 0)) { // Is there an exception type in the framework that I should use/inherit from here? throw new Exception("This class doesn't support blah blah blah"); // Maybe ArgumentException? That doesn't seem to fit right. } } } Thanks.

    Read the article

  • Why is new showat attribute required when using code generation?

    - by Patrick Karcher
    When I generate code using T4 templates in Visual Studio 2010, I get the following error for each of my asp controls when I try to compile: Control "ddState" is missing required attribute "showat". I have never gotten this error in previous versions of .NET. Further, I don't get this error when I manually construct my pages either by dragging/dropping, nor do I get it when I type out the control text myself. When I generate code, I have to manually add showat="client" to my tag for the compiler to be happy. It was my understanding that I never had to explicitly specify this tag. The following: <asp:dropdownlist id="ddState" runat="server" showat="client" /> solves the problem. Why do I have to add this to generated code but not other times? (It's a VS-2010 webforms project, using VB, in case that makes a difference.)

    Read the article

  • SvcUtil and /dconly generates XSD's for data types NOT marked with the DataContract attribute.

    - by Bellerephon
    Has anyone ever encountered a problem with Svcutil and the /dconly option where it generates metadata for EVERY data type in an Assembly, even if it is NOT marked with with the [DataContract()] attribute? It also appears to be generating metadata for types only referenced in the code, such as XmlDictionaryReaderQuotas even though these are not a part of the physical assembly that I generated metadata on. Some info: Using the .NET 4.0 version of SvcUtil. Does not matter if class is empty or not. No references are specified in the command line for SvcUtil. Command line: "C:\In Progress Work (Prospective)\Prospective Server\Prospective Server\Management\Prospective.Server.Server.NET40.Debug.AnyCPU.dll" /nologo /t:metadata /d:"C:\In Progress Work (Prospective)\Prospective Server\Prospective Server\Management" /dconly

    Read the article

  • PHP: How to overwrite values in one array with values from another without adding new keys to the ar

    - by Svish
    I have an array with default settings, and one array with user-specified settings. I want to merge these two arrays so that the default settings gets overwritten with the user-specified ones. I have tried to use array_merge, which does the overwriting like I want, but it also adds new settings if the user has specified settings that doesn't exist in the default ones. Is there a better function I can use for this than array_merge? Or is there a function I can use to filter the user-specified array so that it only contains keys that also exist in the default settings array? (PHP version 5.3.0) Example of what I want $default = array('a' => 1, 'b' => 2); $user = array('b' => 3, 'c' => 4); // Somehow merge $user into $default so we end up with this: Array ( [a] => 1 [b] => 3 )

    Read the article

  • Composite primary keys in N-M relation or not?

    - by BerggreenDK
    Lets say we have 3 tables (actually I have 2 at the moment, but this example might illustrate the thought better): [Person] ID: int, primary key Name: nvarchar(xx) [Group] ID: int, primary key Name: nvarchar(xx) [Role] ID: int, primary key Name: nvarchar(xx) [PersonGroupRole] Person_ID: int, PRIMARY COMPOSITE OR NOT? Group_ID: int, PRIMARY COMPOSITE OR NOT? Role_ID: int, PRIMARY COMPOSITE OR NOT? Should any of the 3 ID's in the relation PersonGroupRole be marked as PRIMARY key or should they all 3 be combined into one composite?? whats the real benefit of doing it or not? I can join anyways as far as I know, so Person JOIN PersonGroupRole JOIN Group gives me which persons are in which Groups etc. I will be using LINQ/C#/.NET on top of SQL-express and SQL-server, so if there is any reasons regarding language/SQL that might make the choice more clear, thats the platform I ask about. Looking forward to see what answers pops up, as I have thought of these primary keys/indexes many times when making combined ones.

    Read the article

  • How can I display a list of three different Models sortable by the same :attribute in rails?

    - by Angela
    I have a Campaign model which has_many Calls, Emails, and Letters. For now, these are each a separate Model with different controllers and actions (although I would like to start to think of ways to collapse them once the models and actions stabilize). They do share two attributes at least: :days and :title I would like a way to represent all the Calls, Emails, and Letters that belong_to a specific Campaign as a sortable collection (sortable by :days), in a way that outputs the model name and the path_to() for each. For example (I know the below is not correct, but it represents the kind of output/format I've been trying to do: @campaign_events.each do |campaign_event| <%= campaign_event.model_name %> <%= link_to campaign_event.title, #{model_name}_path(campaign_event) %> end Thanks so much. BTW, if this matters, I would then want to make the :days attribute editable_in_place.

    Read the article

  • Would my situation be an appropriate place to use the ' /i ' REGEX attribute?

    - by Solignis
    I am making a large catalogue of all of the possible OS names that can be supported by my particular version of VMWare. Originally I was writing them all as they stood in the VMX files but then I found a website that had them all listed, the problem is they are not properly cased to provide a "perfect" match, would this be the perfect time to use the regex attribute for case insensitivity? Also as a side question, would it be possibly extract the list of OSs from the website?. They look to be in a HTML formated chart. It would save me a lot of time having to type them all out.

    Read the article

  • How can I compare rows from 2 tables that have composite primary keys?

    - by cdeszaq
    Here's the scenario: I have 2 tables with data, one is the 2009 version and the other is the 2010 version. The primary key for each of the tables is a composite key. I know there is a different number of rows in each one and I need to find out the differences. Typically, in the "normal" primary key set-up, I would just look for primary key values NOT IN the list of primary keys from the other table. But I don't know how to do this with a composite primary key (or even if it's possible). So, how can I compare the rows from these two tables?

    Read the article

  • In a SQL XDL File, how do I read the waitresource attribute on process nodes which are deadlocking?

    - by skimania
    On SQL Server 2005, I'm getting a deadlock when updating two different keys in the same table. note from below that these two waitresources have the same beginning part, but different ending parts. waitresource="KEY: 6:72057594090487808 (d900ed5a6cc6)" and waitresource="KEY: 6:72057594090487808 (d900fb5261bb)" These two keys are locking, and I need to figure out why. The question: If the values in parenthesis are different, why are the first half of the key's the same? <deadlock-list> <deadlock victim="processffffffff8f5863e8"> <process-list> <process id="processaf02f8" taskpriority="0" logused="0" waitresource="KEY: 6:72057594090487808 (d900fb5261bb)" waittime="2281" ownerId="1370264705" transactionname="user_transaction" lasttranstarted="2010-06-17T00:35:25.483" XDES="0x69453a70" lockMode="U" schedulerid="3" kpid="7624" status="suspended" spid="339" sbid="0" ecid="0" priority="0" transcount="2" lastbatchstarted="2010-06-17T00:35:25.483" lastbatchcompleted="2010-06-17T00:35:25.483" clientapp=".Net SqlClient Data Provider" hostname="RISKBBG_VM" hostpid="5848" loginname="RiskOpt" isolationlevel="read committed (2)" xactid="1370264705" currentdb="6" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056"> <executionStack> <frame procname="MKP_RISKDB.dbo.MarketDataCurrentRtUpload" line="14" stmtstart="840" stmtend="1220" sqlhandle="0x03000600005f9d24c8878f00849d00000100000000000000"> UPDATE c WITH (ROWLOCK) SET LastUpdate = t.LastUpdate, Value = t.Value, Source = t.Source FROM MarketDataCurrent c INNER JOIN #TEMPTABLE2 t ON c.MDID = t.mdid; -- Insert new MDID </frame> <frame procname="adhoc" line="1" sqlhandle="0x010006004a58132228bf8d73000000000000000000000000"> MarketDataCurrentBlbgRtUpload </frame> </executionStack> <inputbuf> MarketDataCurrentBlbgRtUpload </inputbuf> </process> <process id="processffffffff8f5863e8" taskpriority="0" logused="0" waitresource="KEY: 6:72057594090487808 (d900ed5a6cc6)" waittime="2281" ownerId="1370264646" transactionname="user_transaction" lasttranstarted="2010-06-17T00:35:25.450" XDES="0x1cb72be8" lockMode="U" schedulerid="5" kpid="1880" status="suspended" spid="287" sbid="0" ecid="0" priority="0" transcount="2" lastbatchstarted="2010-06-17T00:35:25.450" lastbatchcompleted="2010-06-17T00:35:25.450" clientapp=".Net SqlClient Data Provider" hostname="RISKAPPS_VM" hostpid="1424" loginname="RiskOpt" isolationlevel="read committed (2)" xactid="1370264646" currentdb="6" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056"> <executionStack> <frame procname="MKP_RISKDB.dbo.MarketDataCurrent_BulkUpload" line="28" stmtstart="1062" stmtend="1720" sqlhandle="0x03000600a28e5e4ef4fd8e00849d00000100000000000000"> UPDATE c WITH (ROWLOCK) SET LastUpdate = getdate(), Value = t.Value, Source = @source FROM MarketDataCurrent c INNER JOIN #MDTUP t ON c.MDID = t.mdid WHERE c.lastUpdate &lt; @updateTime and c.mdid not in (select mdid from MarketData where BloombergTicker is not null and PriceSource like &apos;Live.%&apos;) and c.value &lt;&gt; t.value </frame> <frame procname="adhoc" line="1" stmtstart="88" sqlhandle="0x01000600c1653d0598706ca7000000000000000000000000"> exec MarketDataCurrent_BulkUpload @clearBefore, @source </frame> <frame procname="unknown" line="1" sqlhandle="0x000000000000000000000000000000000000000000000000"> unknown </frame> </executionStack> <inputbuf> (@clearBefore datetime,@source nvarchar(10))exec MarketDataCurrent_BulkUpload @clearBefore, @source </inputbuf> </process> </process-list> <resource-list> <keylock hobtid="72057594090487808" dbid="6" objectname="MKP_RISKDB.dbo.MarketDataCurrent" indexname="PK_MarketDataCurrent" id="lock64ac7940" mode="U" associatedObjectId="72057594090487808"> <owner-list> <owner id="processffffffff8f5863e8" mode="U"/> </owner-list> <waiter-list> <waiter id="processaf02f8" mode="U" requestType="wait"/> </waiter-list> </keylock> <keylock hobtid="72057594090487808" dbid="6" objectname="MKP_RISKDB.dbo.MarketDataCurrent" indexname="PK_MarketDataCurrent" id="lockffffffffb8d2dd40" mode="U" associatedObjectId="72057594090487808"> <owner-list> <owner id="processaf02f8" mode="U"/> </owner-list> <waiter-list> <waiter id="processffffffff8f5863e8" mode="U" requestType="wait"/> </waiter-list> </keylock> </resource-list> </deadlock> </deadlock-list>

    Read the article

  • how to find specific XML data by attribute name/value in flash AS2?

    - by CCrawler
    Given the following XML code: <set name="thumbsBooks"> <set name="pdf"> <thumb>Data I want to access</thumb> <thumb>Data I want to access</thumb> </set> <set name="printed"> <thumb>Data I don't want to access</thumb> <thumb>Data I don't want to access</thumb> </set> <set> I want to be able to get the data contained in the "thumb" tags using the "name" attribute value of the parent tag as a selector, something like you would do in jQuery: $('set[name="pdf"]').find('thumb'); Is there a method like this in Action Script 2 (can't use AS3)?

    Read the article

  • Best way to make an attribute always an array?

    - by Shadowfirebird
    I'm using my MOO project to teach myself Test Driven Design, and it's taking me interesting places. For example, I wrote a test that said an attribute on a particular object should always return an array, so -- t = Thing.new("test") p t.names #-> ["test"] t.names = nil p t.names #-> [] The code I have for this is okay, but it doesn't seem terribly ruby to me: class Thing def initialize(names) self.names = names end def names=(n) n = [] if n.nil? n = [n] unless n.instance_of?(Array) @names = n end attr_reader :names end Is there a more elegant, Ruby-ish way of doing this? (NB: if anyone wants to tell me why this is a dumb test to write, that would be interesting too...)

    Read the article

  • AS3: How to get all XML-Nodes with a special attribute? (With sourch)

    - by insnet
    Hi there The Challenge: i d like to collect all nodes with the attribute "id". The Problem: The code doenst work with nested nodes. <?xml version="1.0" encoding="utf-8"?><contentmap><fonts id="fonts"> fonts/Arial.swf swf/library_main.swf private function onXMLLoader(event : Event) : void { _xml = _loader.getXML(event.target.url.url); var searchTerms : XMLList = _xml.*.(hasOwnProperty('@id')); if (searchTerms.length() 0 ) { _NodeArray = new Array(); _parseNode(searchTerms); } private function _parseNode(xml : XMLList) : void { for each (var node: XML in xml) { if(!node.hasSimpleContent()) { _parseNode(node.children()); } else { var nodeObject : Object = new Object(); nodeObject['value'] = node.text(); for each(var a:XML in node.@*) { var name : String = String(a.name()); nodeObject[name] = a.toXMLString(); } _NodeArray.push(nodeObject); } } }

    Read the article

  • c# xml function to check whether a string is equal to a xml attribute, to add selected combobox item

    - by fuch
    i want to check the combobox.selecteditem.tostring() on combobox select in a given xml with several nodes, where each one has an attribute called "name" private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { try { textBox1.AppendText(nameAttributeCheck(comboBox1.SelectedItem.ToString())); } catch { } } private string nameAttributeCheck(string a) { XmlDocument doc = new XmlDocument(); doc.Load("armor.xml"); XmlElement root = doc.DocumentElement; XmlNodeList items = root.SelectNodes("/items"); String result = null; try { foreach (XmlNode item in items) { if (string.Equals(a, item.Attributes["name"].InnerText.ToString())) { result += item.Attributes["picture"].InnerText.ToString(); } } } catch { } return result; } each time i try it, nothing happens

    Read the article

  • How to $.extend 2 objects by adding numerical values together from keys with the same name?

    - by muudless
    I currently have 2 obj and using the jquery extend function, however it's overriding value from keys with the same name. How can I add the values together instead? obj1 = {"orange":2,"apple":1, "grape":1} obj2 = {"orange":5,"apple":1, "banana":1} mergedObj = $.extend({}, obj1, obj2); var printObj = typeof JSON != "undefined" ? JSON.stringify : function(obj) { var arr = []; $.each(obj, function(key, val) { var next = key + ": "; next += $.isPlainObject(val) ? printObj(val) : val; arr.push( next ); }); return "{ " + arr.join(", ") + " }"; }; console.log('all together: '+printObj(mergedObj) ); And I get obj1 = {"orange":5,"apple":1, "grape":1, "banana":1} What I need is obj1 = {"orange":7,"apple":2, "grape":1, "banana":1}

    Read the article

  • Setting an attribute property to the type of the decorated class.

    - by cmaduro
    Is it possible to get the decorated class' type inside of the custom attribute's class? For example: [MetadataAttribute] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property, AllowMultiple = false)] public class ViewAttribute : ExportAttribute { public object TargetRegion { get; set; } public Type ViewModel { get; set; } public Type Module { get; set; } public ViewAttribute() : base(typeof(UserControl)) { Module = GetDecoratedClassType(); //I need this method } } In the following example GetDecoratedClassType() would return HomeView [View] HomeView MyHomeView { get; set; }

    Read the article

  • How to get the value of an attribute from XML file in PHP?

    - by Matt
    Hi, Sorry if this seems like an easy question, but I've started pulling hair out on this... I have a XML file which looks like this... <VAR VarNum="90"> <option>1</option> </VAR> I'm trying to get the VarNum. So far I've been successful using the follow code to get the other information: $xml=simplexml_load_file($file); $option=$xml->option; I just can't get VarNum (the attribute value I think?) Thanks!

    Read the article

  • Basic OpenVPN setup not working

    - by WalterJ89
    I am attempting to connect 2 win7 (x64+ x32) computers (there will be 4 in total) using OpenVPN. Right now they are on the same network but the intention is to be able to access the client remotely regardless of its location. The Problem I am having is I am unable to ping or tracert between the two computers. They seem to be on different subnets even though I have the mask set to 255.255.255.0. The server ends up as 10.8.0.1 255.255.255.252 and the client 10.8.0.6 255.255.255.252. And a third ends up as 10.8.0.10. I don't know if this a Windows 7 problem or something I have wrong in my config. Its a very simple set up, I'm not connecting two LANs. this is the server config (removed all the extra lines because it was too ugly) port 1194 proto udp dev tun ca keys/ca.crt cert keys/server.crt key keys/server.key # This file should be kept secret dh keys/dh1024.pem server 10.8.0.0 255.255.255.0 ifconfig-pool-persist ipp.txt client-to-client duplicate-cn keepalive 10 120 comp-lzo persist-key persist-tun status openvpn-status.log verb 6 this is the client config client dev tun proto udp remote thisdomainis.random.com 1194 resolv-retry infinite nobind persist-key persist-tun ca keys/ca.crt cert keys/client.crt key keys/client.key ns-cert-type server comp-lzo verb 6 Is there anything I missed in this? keys are all correct and the vpn's connect fine, its just the subnet or route issue. Thank You EDIT it seems on the server the openvpn-status.log has the routes for the client SERVER OpenVPN CLIENT LIST Updated,Wed May 19 18:26:32 2010 Common Name,Real Address,Bytes Received,Bytes Sent,Connected Since client,192.168.10.102:50517,19157,20208,Wed May 19 17:38:25 2010 ROUTING TABLE Virtual Address,Common Name,Real Address,Last Ref 10.8.0.6,client,192.168.10.102:50517,Wed May 19 17:38:56 2010 GLOBAL STATS Max bcast/mcast queue length,0 END Also this is from the client.log file: Which seems to be correct C:\WINDOWS\system32\route.exe ADD 10.8.0.0 MASK 255.255.255.0 10.8.0.5 Another EDIT 'route print' on the server shows the route: Destination Mask Gateway Interface 10.8.0.0 255.255.255.0 10.8.0.2 10.8.0.1 the same on the client shows 10.8.0.0 255.255.255.0 10.8.0.5 10.8.0.6 So the routes are there.. what can the problem be? Is there anything wrong with my configs? Why would OpenVPN be having problems communicating?

    Read the article

  • How can I make Firefox ignore Next/Prev-Buttons on the Keyboard?

    - by ThiefMaster
    My ThinkPad notebook has "next page" and "previous page" buttons right next to the cursor keys. While writing code (sometimes in textareas on pages such as StackOverflow) accidentally hitting one of these keys is very annoying - either you navigate away or you get the "do you really want to navigate way" prompt. I never use those keys anyway so I wonder if there's an option in Firefox to ignore those keys. An option to remap them globally or simply disable them would (OS: Windows 7) be fine, too.

    Read the article

< Previous Page | 84 85 86 87 88 89 90 91 92 93 94 95  | Next Page >