Search Results

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

Page 152/433 | < Previous Page | 148 149 150 151 152 153 154 155 156 157 158 159  | Next Page >

  • jquery selector help... thought I followed the example correctly...but can't get it to work..

    - by Ronedog
    I'm trying to do the following in jquery but can't make it work . I want to select all the DIV tags that have a custom attribute called NODE_ID that have a value of 49_3. then select the and change the src attribute to a different image. Here's the HTML: <div style="display: block;" id="71_7_sub_p_div" node_id="49_3"> <span> <img src="../images/maximize.png"> &nbsp;Greenfield Industrial Park </span> </div> Here's the script: <script type="text/javascript"> $(document).ready(function(){ $("div[node_id='49_3']:has(img)").attr("src","../images/folder_closed.png"); }); </script> Any ideas are appreciated. thanks.

    Read the article

  • Get group key from bridge table

    - by Mads Jensen
    I'm developing an ETL process, and need a bridge table for a one-to-many relationship between a fact table and a dimension table (MySQL database). There is a limited number of combinations (some thousands), so I want to re-use group keys from the bridge table to to limit the size. Any group of dimensions belonging to a fact row will consist of a number of dimension keys (1 to around 15), assigned to a unique group key, as below: group_key | dimension_key ----------------------- 1 | 1 1 | 3 1 | 4 2 | 1 2 | 2 2 | 3 3 | 1 3 | 4 How do I go about retrieving the unique group key for the dimensions 1,3,4 (ie. 1).

    Read the article

  • How do I best run a search on Date when it is not a :has_many association?

    - by Angela
    I have a number of activities that have a calculated scheduled date. The activities, for example, Email, have a email.days method which is the days from a Contact.start_date on which it should be sent. This means contact.start_date + email.days yields a date on which email is sent to contact. I would like to use link_to around the date, so I can see all the emails and associated contacts that are to be scheduled on that date. However, this "date" is not an attribute or an associate, so I'm not linking to a model's view. It's calculated. So: 1) What should the actual "format" of the date that gets passed in the URl be? What is the method to do the consistent conversion? 2) How do I (find) all instances, because this "date" is not an actual attribute, is it a calculated value which changes depending on the two associated models of Contact and Email. Thanks.

    Read the article

  • Sequence Generators in T-SQL

    - by PaoloFCantoni
    We have an Oracle application that uses a standard pattern to populate surrogate keys. We have a series of extrinsic rows (that have specific values for the surrogate keys) and other rows that have intrinsic values. We use the following Oracle trigger snippet to determine what to do with the Surrogate key on insert: 'IF :NEW.SurrogateKey IS NULL THEN SELECT SurrogateKey_SEQ.NEXTVAL INTO :NEW.SurrogateKey FROM DUAL; END IF;' If the supplied surrogate key is null then get a value from the nominated sequence, else pass the supplied surrogate key through to the row. I can't seem to find an easy way to do this is T-SQL. There are all sorts of approaches, but none of which use the notion of a sequence generator like Oracle and other SQL-92 compliant DBs do. Anybody know of a really efficient way to do this in SQL Server T-SQL? BTW we're using SQL Server 2008 if that's any help. TIA, Paolo

    Read the article

  • Issue using Session in MVC Actions with [authorice]

    - by Pablo Gonzalez
    Hi all, first of all sorry for my poor English! When I use the [Authorice` attribute i can't get Session data that i stored before. For example: public ViewResult Index() { // do some stuffs Session["Test"] = "Hi stackoverflow!"; } And then i try to get it in another action, but with the [Authorize] attibute [Authorize] public ViewResult Test() { // do some stuffs if(Session["Test"] == null) { //do some stuffs } } Session["Test"] is always null, but if i remove the attribute it's work, may anyone help me?, thanks a lot!!! P.S: I instance Session["Test"] in Session_Start

    Read the article

  • New Session is created between consecutive servlet request from an Applet and a managed bean??

    - by khue
    Hi, I want to pass parameters betweeen applet and jsf components So when a value of a input textbox changed, its binding backing bean makes connection to a servlet. The servlet create an attribute and save to HttpSession using (request.getSession(true)).setAttribute(name, value); Then at some event, applet will access another servlet. This servlet will try to retrieve the Attribute saved to Session previously. However, everytime, the attirbute returned is null as the new session is created instead. My question is: Is the session should be persist? ( I checked allowcookies, session timeout for weblogic) If yes, what might go wrong with my app? Thanks a lot for your help. Regards K.

    Read the article

  • Avoiding sorting in NSDictionary

    - by RVN
    I was using NSDictionary and i observed that the objects in the dictionary are sorted automatically with respect to the keys, so my question is how to avoid this sorting , any flag available to set it off, so i get the object in same order i entered. i know u may be thinking what difference it makes in dictionary since we retrieve the value with respect to key, but i am first getting allKeys from which i receive Array of keys , this order is what i need it to be in the order of how i entered just as in NSArray. give your comments if the question is not clear. Thanks

    Read the article

  • Is it possible to use array_shift() in PHP and get the key?

    - by alex
    I have a list of files in an array where the filename is the key and the value is the last modified date in seconds. They are sorted from oldest to newest. The files are glob()'d in, and then sorted this way using asort($fileNameToLastModified, SORT_NUMERIC); I use array_shift() to get the oldest file. Unfortunately, it seems to be giving me the value, and there doesn't seem to be a way to get the key. Would the only way to do that be something like this? $keys = array_keys($fileNameToLastModified); $oldest = array_shift($keys); array_shift($fileNameToLastModified); // to manually chop the first array member off too. Or is there a built in? Thanks

    Read the article

  • Is it possible to use array_shift() in PHP and get the key?

    - by alex
    I have a list of files in an array where the filename is the key and the value is the last modified date in seconds. They are sorted from oldest to newest. The files are glob()'d in, and then sorted this way using asort($fileNameToLastModified, SORT_NUMERIC); I use array_shift() to get the oldest file. Unfortunately, it seems to be giving me the value, and there doesn't seem to be a way to get the key. Would the only way to do that be something like this? $keys = array_keys($fileNameToLastModified); $oldest = array_shift($keys); array_shift($fileNameToLastModified); // to manually chop the first array member off too. Or is there a built in? Thanks

    Read the article

  • web2py error while using distinct in the queries

    - by Steve
    Hi, I am using web2py with GAE. While using some of the queries which has a distinct clause, GAE throws out an error.I have pasted the Traceback. Can someone please help me out with this. In FILE: /base/data/home/apps/panneersoda/1.341206242889687944/applications/init/controllers/default.py Traceback (most recent call last): File "/base/data/home/apps/panneersoda/1.341206242889687944/gluon/restricted.py", line 173, in restricted exec ccode in environment File "/base/data/home/apps/panneersoda/1.341206242889687944/applications/init/controllers/default.py:profileview", line 263, in <module> File "/base/data/home/apps/panneersoda/1.341206242889687944/gluon/globals.py", line 96, in <lambda> self._caller = lambda f: f() File "/base/data/home/apps/panneersoda/1.341206242889687944/applications/init/controllers/default.py:profileview", line 97, in profileview File "/base/data/home/apps/panneersoda/1.341206242889687944/gluon/contrib/gql.py", line 675, in select (items, tablename, fields) = self._select(*fields, **attributes) File "/base/data/home/apps/panneersoda/1.341206242889687944/gluon/contrib/gql.py", line 624, in _select raise SyntaxError, 'invalid select attribute: %s' % key SyntaxError: invalid select attribute: distinct Thanks

    Read the article

  • Nested partial output caching in asp.net mvc 3

    - by Anwar Chandra
    Hi All, I am using Razor view engine in ASP.Net MVC 3 RC 2 this is part of my view city.cshtml (drastically simplified for the sake of simple example) <!-- in city.cshtml --> <div class="list"> @foreach(var product in SQL.GetProducts(Model.City) ) { <div class="product"> <div>@product.Name</div> <div class="category"> @foreach(var category in SQL.GetCategories(product.ID) ) { <a href="@category.Url">@category.Name</a> » } </div> </div> } </div> I want to cache this part of my output using OutputCache attribute. so I created an action ProductList with OutputCache attribute enabled <!-- in city.cshtml --> <div class="list"> @Html.Action("ProductList", new { City = Model.City }) </div> and I created the view in ProductList.cshtml as below <!-- in ProductList.cshtml --> @foreach(var product in Model.Products ) { <div class="product"> <div>@product.Name</div> <div class="category"> @foreach(var category in SQL.GetCategories(product.ID) ) { <a href="@category.Url">@category.Name</a> » } </div> </div> } but I still need to cache the category path output on each product. so I created an action CategoryPath with OutputCache attribute enabled <!-- in ProductList.cshtml --> @foreach(var product in Model.Products ){ <div class="product"> <div>@product.Name</div> <div class="category"> @Html.Action("CategoryPath", new { ProductID = product.ID }) </div> </div> } but apparently this is not allowed. I got this error.. OutputCacheAttribute is not allowed on child actions which are children of an already cached child action. I believe they have a good reason why they need to disallow this. but I really want this kind of nested Output Caching Please, any idea for a workaround?

    Read the article

  • Catching constraint violations in JPA 2.0.

    - by Dennetik
    Consider the following entity class, used with, for example, EclipseLink 2.0.2 - where the link attribute is not the primary key, but unique nontheless. @Entity public class Profile { @Id private Long id; @Column(unique = true) private String link; // Some more attributes and getter and setter methods } When I insert records with a duplicate value for the link attribute, EclipseLink does not throw a EntityExistsException, but throws a DatabaseException, with the message explaining that the unique constraint was violated. This doesn't seem very usefull, as there would not be a simple, database independent, way to catch this exception. What would be the advised way to deal with this? A few things that I have considered are: Checking the error code on the DatabaseException - I fear that this error code, though, is the native error code for the database; Checking the existence of a Profile with the specific value for link beforehand - this obviously would result in an enormous amount of superfluous queries.

    Read the article

  • NHibernate filters don't work with Session.Get

    - by Khash
    I'm trying to implement a Soft-deletable repository. Usually this can be easily done with a Delete Event listener. To filter out the deleted entities, I can add a Where attribute to my class mapping. However, I also need to implement two more methods in the repository for this entity: Restore and Purge. Restore will "undelete" entities and Purge will hard-delete them. This means I can't use Where attribute (since it block out soft-deleted entities to any access) I tried using filters instead. I can create a filter and enable or disable it within session to achieve the same result. But the problem is filters don't have any effect on Session.Get method (they only affect ICriteria based access). Any ideas as to how solve this problem? Thanks

    Read the article

  • How to JSON serialize math vector type in F#?

    - by The_Ghost
    Hello! I'm trying to serialize "vector" (Microsoft.FSharp.Math) type. And I get that error: Exception Details: System.Runtime.Serialization.SerializationException: Type 'Microsoft.FSharp.Math.Instances+FloatNumerics@115' with data contract name 'Instances.FloatNumerics_x0040_115:http://schemas.datacontract.org/2004/07/Microsoft.FSharp.Math' is not expected. Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer. I have tried to put KnownType attribute and some other stuff, but nothing helps! Could someone know the answer? This is the code I use: // [< KnownType( typeof<vector> ) >] type MyType = vector let public writeTest = let aaa = vector [1.1;2.2] let serializer = new DataContractJsonSerializer( typeof<MyType> ) let writer = new StreamWriter( @"c:\test.txt" ) serializer.WriteObject(writer.BaseStream, aaa) writer.Close()

    Read the article

  • Insert multiple records from a XML string differing on one parameter in SQL SERVER 2008

    - by Rohit
    Below in a query which inserts records to SimpleDictationProfileMapping table after reading it from a XML string. Now this query inserts a single record in which DictationCaptureProfileID is @dictationCaptureProfileId . Now i want to insert multiple rows in which @dictationCaptureProfileId is different and other 2 values are same. What i want to achieve by this is in case parent changes all child values should also change. INSERT INTO SimpleDictationProfileMapping ( DictationCaptureProfileID, DictationProfileMappingAttributeID, DictationProfileMappingAttributeValue ) SELECT @dictationCaptureProfileId, row.value('@attrId','varchar(max)'), row.value('@value', 'varchar(max)') FROM @simpleDictationCaptureProfileMappings.nodes('/simpleMappingAtribute/attribute') AS d ( row ) ; I want INSERT INTO SimpleDictationProfileMapping ( DictationCaptureProfileID OR (SELECT DictationCaptureProfileID FROM DictationCaptureProfile WHERE SystemDictationCaptureProfileID = @systemDictationCaptureProfileID), DictationProfileMappingAttributeID, DictationProfileMappingAttributeValue ) SELECT @dictationCaptureProfileId , row.value('@attrId','varchar(max)'), row.value('@value', 'varchar(max)') FROM @simpleDictationCaptureProfileMappings.nodes ('/simpleMappingAtribute/attribute') AS d ( row ) ; Please tell how to achieve this.

    Read the article

  • ASP.NET ObjectDataSource, change CommandName property of FromView Button

    - by Tone
    I have an ObjectDataSource that I'm using with a FormView, and it works fine, but i want to change one small thing. On the FormView the button that fires the update has the CommandName attribute set to "Update," but I would like to change that attribute to something other than "Update" - when I do change that attribute the update no longer works. The reason I want to do this is I have multiple FormViews on the same page and need to have multiple update buttons. Below is my code: FormView: <asp:FormView ID="fvGeneralInfo" runat="server" DataSourceID="objInstructorDetails" CssClass="Gridview" OnItemCommand="fvGeneralInfo_ItemCommand" DefaultMode="Edit"> <EditItemTemplate> <table> .... <tr> <td style="text-align:right;"> <asp:Label runat="server" ID="lblGeneralInfoMessage" Text="General Info updated successfully" Visible="false" /> </td> <td> <asp:Button runat="server" ID="btnUpdateGeneralInfo" ValidationGroup="UpdateGeneralInfo" Text="Update" CommandName="Update" /> <asp:Button runat="server" ID="btnCancelGeneralInfo" Text="Cancel" CommandName="CancelGeneralInfo" /> </td> </tr> </table> </EditItemTemplate> </asp:FormView> ObjectDataSource: <asp:ObjectDataSource ID="objInstructorDetails" runat="server" TypeName="AIMLibrary.BLL.Instructor" SelectMethod="GetInstructorDetails" InsertMethod="InsertInstructor" UpdateMethod="UpdateInstructor" OnInserting="objInstructorDetails_OnInserting" OnUpdating="objInstructorDetails_OnUpdating" > <SelectParameters> <asp:QueryStringParameter Name="InstructorId" QueryStringField="InstructorId" /> </SelectParameters> <UpdateParameters> <asp:Parameter Name="instructorId" Type="Int32" /> <asp:Parameter Name="firstName" Type="String" DefaultValue="" /> <asp:Parameter Name="middleName" Type="String" DefaultValue="" /> <asp:Parameter Name="lastName" Type="String" DefaultValue="" /> <asp:Parameter Name="phone" Type="String" DefaultValue="" /> <asp:Parameter Name="email" Type="String" DefaultValue="" /> <asp:Parameter Name="addressLine1" Type="String" DefaultValue="" /> <asp:Parameter Name="addressLine2" Type="String" DefaultValue="" /> <asp:Parameter Name="city" Type="String" DefaultValue="" /> <asp:Parameter Name="state" Type="String" DefaultValue="" /> <asp:Parameter Name="zip" Type="String" DefaultValue="" /> <asp:Parameter Name="abcBoardNumber" Type="String" DefaultValue="" /> </UpdateParameters> </asp:ObjectDataSource>

    Read the article

  • hibernate formula with column

    - by coolguy
    I have a table with a column that will be encrypted by a trigger after the record is inserted. When I read the column, I need to apply a decrypt function in the hibernate domain class. While saving the object, the value of the column will be saved as such. While reading the column, apply a database function on the read data. @Formula and @Column annotation cannot be applied to an attribute in the entity class. How do I achieve this functionality without using one attribute for saving and another one with @Formula for reading it?

    Read the article

  • Why is the C# SerializedAttribute is sealed?

    - by ahmet alp balkan
    I was trying to create an attribute that implies [Serializable] but I noticed that this SerializableAttribute class is sealed. In Java it was possible to create an interface (say, MyInterface) that is inherited from Serializable interface and so all the subclasses of MyInterface would also be serializable, even its sub-sub classes would be so. Let's say I am creating an ORM and I want customers to annotate their entity classes as [DatabaseEntity] but in order to make sure that entities are serializable, I also need to ask them to attribute their classes with extra [Serializable] which does not look quite compact and neat. I am wondering why SerializableAttribute class is sealed and why has Inherited=false which implies that subclasses of serializable class will not be serializable unless it is explicitly stated. What motives are behind these design choices?

    Read the article

  • How to preserve struct member identifiers when compiling to LLVM IR with Clang?

    - by smokris
    Say I have the following C structure definition: struct stringStructure { char *stringVariable; }; For the above, Clang produces the following LLVM IR: %struct.stringStructure = type { i8* } ...which includes everything in my definition except the variable identifier stringVariable. I'd like to find some way to export the identifier into the generated LLVM IR, so that I can refer to it by name from my application (which uses the LLVM C++ API). I've tried adding the annotate attribute, as follows: char *stringVariable __attribute__((annotate("stringVariable"))); ...but the annotation doesn't seem to make it through (the structure is still just defined as type { i8* }). Any ideas?

    Read the article

  • Positioning a tooltip relative to another div in JQuery

    - by James P
    Here's my tooltips markup and CSS: <div class="tooltip">Click here to like it</div> .tooltip { position: absolute; display: none; background: url('images/tooltip.gif') no-repeat; width: 100%; height: 40px; font-size: 0.8em; line-height: 40px; padding: 0px 0px 0px 8px; } Now, I have a div on my page called #button_container. I would like to place this .tooltip div 150px to the right of that div via JQuery. I understand I need to set this tooltips top and left attributes, but not sure how. Idealy the tooltips top attribute should be the same as #button_container (although #button_container isn't positioned absolutely) and 150 less than #button_container's left attribute. I don't really know where to get started on this so any help would be very much appreciated. Thanks.

    Read the article

  • CakePHP 'Cake is NOT able to connect to the database'

    - by kand
    I've looked at this post about a similar issue: CakePHP: Can't access MySQL database and I've tried everything they mentioned in there including: Changing my database.php so that the 'port' attribute for both $default and $test are the location of my mysqld.sock file Changing the 'port' attribute to the actual integer that represents the port in my my.cnf mysql config Changing the mysql socket locations in php.ini to the location of my mysqld.sock file I'm using ubuntu 11.04, apache 2.2.17, mysql 5.1.54, and CakePHP 1.3.10. My install of mysql and apache don't seem to match any conventions, as in, all the config files are there, they are all just in really weird places--I'm not sure why that is, but I've tried reinstalling both programs multiple times with the same results... At any rate, I can log into mysql from the terminal and use it normally, and apache is working because I can see the CakePHP default homepage. I just can't get it to change the message 'Cake is NOT able to connect to the database'. SOLVED: Figured it out, had to change php.ini so that extension_dir pointed to the correct directory and had to add a line extension=mysql.so.

    Read the article

  • How to perform duplicate key validation using entlib (or DataAnnotations), MVC, and Repository pattern

    - by olivehour
    I have a set of ASP.NET 4 projects that culminate in an MVC (3 RC2) app. The solution uses Unity and EntLib Validation for cross-cutting dependency injection and validation. Both are working great for injecting repository and service layer implementations. However, I can't figure out how to do duplicate key validation. For example, when a user registers, we want to make sure they don't pick a UserID that someone else is already using. For this type of validation, the validating object must have a repository reference... or some other way to get an IQueryable / IEnumerable reference to check against other rows already in the DB. What I have is a UserMetadata class that has all of the property setters and getters for a user, along with all of the appropriate DataAnnotations and EntLib Validation attributes. There is also a UserEntity class implemented using EF4 POCO Entity Generator templates. The UserEntity depends on UserMetadata, because it has a MetadataTypeAttribute. I also have a UserViewModel class that has the same exact MetadataType attribute. This way, I can apply the same validation rules, via attributes, to both the entity and viewmodel. There are no concrete references to the Repository classes whatsoever. All repositories are injected using Unity. There is also a service layer that gets dependency injection. In the MVC project, service layer implementation classes are injected into the Controller classes (the controller classes only contain service layer interface references). Unity then injects the Repository implementations into the service layer classes (service classes also only contain interface references). I've experimented with the DataAnnotations CustomValidationAttribute in the metadata class. The problem with this is the validation method must be static, and the method cannot instantiate a repository implementation directly. My repository interface is IRepository, and I have only one single repository implementation class defined as EntityRepository for all domain objects. To instantiate a repository explicitly I would need to say new EntityRepository(), which would result in a circular dependency graph: UserMetadata [depends on] DuplicateUserIDValidator [depends on] UserEntity [depends on] UserMetadata. I've also tried creating a custom EntLib Validator along with a custom validation attribute. Here I don't have the same problem with a static method. I think I could get this to work if I could just figure out how to make Unity inject my EntityRepository into the validator class... which I can't. Right now, all of the validation code is in my Metadata class library, since that's where the custom validation attribute would go. Any ideas on how to perform validations that need to check against the current repository state? Can Unity be used to inject a dependency into a lower-layer class library?

    Read the article

  • CORE DATA objectId changes constantly

    - by mongeta
    Hello, I have some data that I export into an XML file and put in a remote FTP Server. I have to identified each object with a unique attribute, it doesn't matter wich is, but must be persistent always = it can never change. I don't want to create a unique attribute, sequence, serial, etc. I'm using the objectID but every time I use it a get a new reference. I know that before the object has been saved, it has a 'temporal id', but once it's saved, it gets the definitive. I'm not seeing this, never. When I export, just fetch all data and loop, and always I get a new reference: NSURL *objectID = [[personalDataObject objectID] URIRepresentation]; // some of id received for the SAME OBJECT (no changes made, saved, ...) // 61993296 // 62194624 thanks, r. edit I was using %d instead of %@, now the returned data is: x-coredata://F46F3300-8FED-4876-B0BF-E4D2A9D80913/DataEntered/p1 x-coredata://F46F3300-8FED-4876-B0BF-E4D2A9D80913/DataEntered/p2

    Read the article

< Previous Page | 148 149 150 151 152 153 154 155 156 157 158 159  | Next Page >