Search Results

Search found 37415 results on 1497 pages for 'attribute id'.

Page 28/1497 | < Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >

  • Display user name in reference to user id in django template

    - by Ed
    I expect this is an easy question. For some reason, I don't have a solution yet. I have an object set from django reversion: version_list. Each object in the set has a user id attached to it. How do I grab the user names that correspond to the user ID's? To try to be clearer, if each object in version_list has a name, date, and user id, how can I join the version_list set with the user table to figure out what user id goes with which name? This is done in the view, or the template?

    Read the article

  • Session ID Rotation - does it enhance security?

    - by dound
    (I think) I understand why session IDs should be rotated when the user logs in - this is one important step to prevent session fixation. However, is there any advantage to randomly/periodically rotating session IDs? This seems to only provide a false sense of security in my opinion. Assuming session IDs are not vulnerable to brute-force guessing and you only transmit the session ID in a cookie (not as part of URLs), then an attacker will have to access your cookie (most likely by snooping on your traffic) to get your session ID. Thus if the attacker gets one session ID, they'll probably be able to sniff the rotated session ID too - and thus randomly rotating has not enhanced security.

    Read the article

  • ASP.MVC 2 RTM + ModelState Error at Id property

    - by Zote
    I have this classes: public class GroupMetadata { [HiddenInput(DisplayValue = false)] public int Id { get; set; } [Required] public string Name { get; set; } } [MetadataType(typeof(GrupoMetadata))] public partial class Group { public virtual int Id { get; set; } public virtual string Name { get; set; } } And this action: [HttpPost] public ActionResult Edit(Group group) { if (ModelState.IsValid) { // Logic to save return RedirectToAction("Index"); } return View(group); } That's my view: <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Group>" %> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <% using (Html.BeginForm()) {%> <fieldset> <%= Html.EditorForModel() %> <p> <input type="submit" value="Save" /> </p> </fieldset> <% } %> <div> <%=Html.ActionLink("Back", "Index") %> </div> </asp:Content> But ModelState is always invalid! As I can see, for MVC validation 0 is invalid, but for me is valid. How can I fix it since, I didn't put any kind of validation in Id property? UPDATE: I don't know how or why, but renaming Id, in my case to PK, solves this problem. Do you know if this an issue in my logic/configuration or is an bug or expected behavior? Thank you

    Read the article

  • ID + Slug name in URL in Rails (like in StackOverflow)

    - by Vitaly
    Hey, I'm trying to achieve URLs like this in Rails: http://localhost/posts/1234/post-slug-name with both ID and slug name instead of either http://localhost/posts/1234 or http://localhost/posts/post-slug-name (right now I have just slug name in URL, so this part is over). How can I do this? UPD I found an article on this: http://augustl.heroku.com/blog/styling-rails-urls, instead of /id/slug it suggests to use /id-slug which works perfectly for me, so I'll go with this.

    Read the article

  • RadCombox Client Side Input ID Server Side

    - by francisf
    Hi All, Question 1 : RadComboBox i need to find the ID of the Input element at the Server side . The telerik provides a way to find the ID of the input element() client side. But i nned to find the ID at the server side . Question 2 : I have a radcombobox to a radgrid and am attaching a client event on itemdatabound for ex discCombo.OnClientLoad = "LoaderDisc" I need to find a way to an argument to this method say an id of another control ?.How do i pass my arguments to the combobox client event ? Thanks, Francis P.

    Read the article

  • XML child node attribute value

    - by c0mrade
    I'm trying to read xml file, ex : <entry> <title>FEED TITLE</title> <id>5467sdad98787ad3149878sasda</id> <tempi type="application/xml"> <conento xmlns="http://mydomainname.com/xsd/radiofeed.xsd" madeIn="USA" /> </tempi> </entry> Here is the code I have so far : public void parseXML(String xml) { try { InputStream inputStream = new ByteArrayInputStream(xml.getBytes()); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse(inputStream); doc.getDocumentElement().normalize(); System.out.println("Root element " + doc.getDocumentElement().getNodeName()); NodeList nodeLst = doc.getElementsByTagName("entry"); System.out.println("Information of all entries"); for (int s = 0; s < nodeLst.getLength(); s++) { Node fstNode = nodeLst.item(s); if (fstNode.getNodeType() == Node.ELEMENT_NODE) { Element fstElmnt = (Element) fstNode; NodeList title = fstElmnt.getElementsByTagName("title").item(0).getChildNodes(); System.out.println("Title : " + ((Node) title.item(0)).getNodeValue()); NodeList id = fstElmnt.getElementsByTagName("id").item(0).getChildNodes(); System.out.println("Id: " + ((Node) update.item(0)).getNodeValue()); NodeList contento= fstElmnt.getElementsByTagName("tempi").item(0).getChildNodes(); System.out.println("Contento : " + ((Node) content.item(0)).getFirstChild().getAttributes()); // with this line above I'm having problems, I get null pointer exception } } } catch (Exception e) { e.printStackTrace(); } } How can I read/get, contento tag attributes? I'm using org.w3c.dom lib.

    Read the article

  • Hibernate sequence should only generate when ID is <=0

    - by Tim Leys
    Hi all, I'm using the folowing sequence in my code. (I got the sequence and @Id @SequenceGenerator(name = "S912_PRO_SEQ", sequenceName = "S912_PRO_SEQ", allocationSize = 1) @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "S912_PRO_SEQ") @Column(name = "PRO_ID", unique = true, nullable = false, precision = 9, scale = 0) public int getId() { return this.id; } And using the following sequence / triggers in my DB. CREATE SEQUENCE S912_PRO_SEQ nomaxvalue minvalue 20; CREATE OR REPLACE TRIGGER S912_PRO_B_I_TRG BEFORE INSERT ON S912_project REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW ENABLE begin IF :NEW.pro_ID IS NULL THEN select S912_PRO_SEQ.nextval into :new.pro_ID from dual; END IF; end; I was wondering if there is a way to let hibernate generate a sequence ONLY if the ID is <=0 (not set) or if the ID already exists. I know for most cases my trigger would fix the situation. But I do not want to rely completely on it. I hope someone can help me out :p

    Read the article

  • automatic id generation which is a primary key

    - by abhi
    in vb.net while entering a new entry i want to assign a record a unique id like in case of numeric i do this way Dim ItemID As Integer KAYAReqConn.Open() SQLCmd = New SqlCommand("SELECT ISNULL(MAX(ItemID),0) AS ItemID from MstItem", ReqConn) Dim dr As SqlDataReader dr = SQLCmd.ExecuteReader If dr.HasRows Then dr.Read() ItemID = dr("ItemID") + 1 End If dr.Close() in this case m using itemid as a unique id and the format is 1,2,3... and m finding out the max and assigning to a new record but how to assign if the previous id is of the a00001,a00002,a00003,a00004...so on. how i do i produce a unique id in this case

    Read the article

  • Enter ID instead of name on submit (form)

    - by Derek
    In my activities table, I have a user ID and a project ID. When a user (of admin level) creates an activity they select from a drop down menu a project. Here is the select query to draw up appropriate values: $sql = "SELECT usersprojects_tb.projectid, projects.projectname FROM projects INNER JOIN usersprojects on projects.projectid = usersprojects.projectid WHERE usersprojects.userid = '".$_SESSION['SESS_USERID']."'"; And for the tag with the dropdown menu, I have this: <?php echo $row['projectname']?> I have tried submitting the form with 'projectid' here instead and the project ID is stored successfully in my activies table. However, the user needs to see the project names (IDs arent exactly user-friendly!) And with 'projectname' as displayed, they can select the names of the available projects (to associate an activity with) but the project ID is not stored, how I link this up, so that when the project name is sent, the ID for this project is stored properly in my activities table. I'm also having the exact same problem with the users drop down. As the admin user selects a user from the drop down to assign the task to. I exactly what I want, but I think I may be using the wrong syntax! Any help is much appreciated. Thanks.

    Read the article

  • Problems using an id from a model inside a custom sql query in Rails

    - by Thiago
    Hi there, I want to do a model class which associates to itself on Rails. Basically, a user has friends, which are also users. I typed the following inside a User model class: has_many :friends, :class_name => "User", :foreign_key => :user_id, :finder_sql => %{SELECT users.* FROM users INNER JOIN friends ON (users.id = friends.user_id OR users.id = friends.friend_id) WHERE users.id <> #{id}} But the funny fact is that it seems that this finder_sql is called twice whenever I type User.first.friends on irb. Why?

    Read the article

  • Sharepoint List redirect with new id

    - by TheRealQuagmire
    I have a list within Sharepoint, using a custom new form i have added a custom list form control ("New item form" for the list) and changed the SaveButton to a standard input HTML button, and added an 'onclick' event that is as follows: onclick="javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={NewFormWizard2.aspx?id=}')}" this works as in saves the data and redirects to the NewFormWizard2.aspx?id= page. the question is how do i get the ID of the created item to be passed to the redirected page? thus once the form is completed it would redirect to NewFormWizard2.aspx?id=23 Thanks in advanced.

    Read the article

  • PHP javascript link id

    - by Jordan Pagaduan
    <?php //connect to database .... //select query .... if(isset($_GET["link"])==false){ echo "sample 1"; }else{ echo "sample 2" ; } ?> <script type="javascript"> function Link(id) { location.href='linktest.php&link='+id; } </script> <html> <input type="button" value="link test" onclick="javascript: Link<?php $row['id']; ?>"> </html> (assumed question) How do I force the onclick event to contain the value of $row['id']?

    Read the article

  • Reuse classes in an id based css

    - by C. Ross
    I have a id based CSS file where I noticed I'm mostly repeating myself. What I'd like to do is specify that an item with an id follows a certain class + some other rules. For example: I'd like id id1 to have all the properties of class LinkButton applied as well as the value back-color: green. Is there a way to do this in the css file? Is there a better way to do what I'm looking at?

    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

  • Need a SQL statement focus on combination of tables but entries always with uinque ID

    - by Registered User KC
    Hi All, I need SQL code to solve the tables combination problem, described on below: Table old data: name version status lastupdate ID A 0.1 on 6/8/2010 1 B 0.1 on 6/8/2010 2 C 0.1 on 6/8/2010 3 D 0.1 on 6/8/2010 4 E 0.1 on 6/8/2010 5 F 0.1 on 6/8/2010 6 G 0.1 on 6/8/2010 7 Table new data: name version status lastupdate ID A 0.1 on 6/18/2010 #B entry deleted C 0.3 on 6/18/2010 #version_updated C1 0.1 on 6/18/2010 D 0.1 on 6/18/2010 E 0.1 off 6/18/2010 #status_updated F 0.1 on 6/18/2010 G 0.1 on 6/18/2010 H 0.1 on 6/18/2010 #new_added H1 0.1 on 6/18/2010 #new_added the difference of new data and old date: B entry deleted C entry version updated E entry status updated C1/H/H1 entry new added What I want is always keeping the ID - name mapping relationship in old data table no matter how data changed later, a.k.a the name always has a unique ID number bind with it. If entry has update, then update the data, if entry is new added, insert to the table then give a new assigned unique ID. However, I can only use SQL with simple select or update statement then it may too hard for me to write such code, then I hope someone with expertise can give direction, no details needed on the different of SQL variant, a standard sql code as sample is enough. Thanks in advance! Rgs KC

    Read the article

  • SQL Reset Identity ID in already populated table

    - by rockinthesixstring
    hey all. I have a table in my DB that has about a thousand records in it. I would like to reset the identity column so that all of the ID's are sequential again. I was looking at this but I'm ASSuming that it only works on an empty table Current Table ID | Name 1 Joe 2 Phil 5 Jan 88 Rob Desired Table ID | Name 1 Joe 2 Phil 3 Jan 4 Rob Thanks in advance

    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

  • How to query AD to get name email from lan id

    - by Kumar
    I have some code in asp.net ( kindly given by someone else ) to query AD to get user name and email etc. using System.DirectoryServices; using System.DirectoryServices.ActiveDirectory; using ActiveDs; DirectorySearcher search = new DirectorySearcher(new DirectoryEntry(), string.Format("(samaccountname={0})", id)); if (search == null) return id; if (search.FindOne() == null) return id; DirectoryEntry usr = search.FindOne().GetDirectoryEntry(); IADsUser oUsr = (IADsUser)usr.NativeObject; return string.Format("{0} {1}", usr.Properties["givenname"].Value, usr.Properties["sn"].Value); However this requires impersonation with an id that's required to be changed every 2 weeks and then updated in the web.config which is often forgotten Is there any non impersonation code to achieve the same result ? UPDATE - it's a config tool and it looks up name, email id etc. I like the service a/c idea Q - How is it possible to run ( impersonate ) just the AD code with a "service" a/c ? any samples/code ? how do you impersona

    Read the article

  • Referring to an object's ID in a jQuery append statement

    - by Summer
    I have this element: <div class="isthisyou" id="unique_identifier"></div> I want to use jQuery to insert a link into the div: $('isthisyou').append('<a href="auth/create_account/'+this.id+'">Is this you?</a>'); Right now this.id is returning undefined instead of unique_identifier. What am I doing wrong? Thanks!

    Read the article

< Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >