Search Results

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

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

  • How secure are GUIDs in terms of predictability?

    - by ssg
    We're using .NET's Guid.NewGuid() to generate activation codes and API keys currently. I wonder if that poses a security problem since their algorithm is open. .NET Guid uses Win32 CoCreateGuid and I don't know it's internals (possibly MAC address + timestamp?). Can someone derive a second GUID out of the first one, or can he hit it with some smart guesses or is the randomness good enough so search space becomes too big? Generating random keys have the problem of collision, they need a double check before adding to a database. That's why we stuck with GUIDs but I'm unsure about their security for these purposes. Here are the 4 consecutive UUIDGEN outputs: c44dc549-5d92-4330-b451-b29a87848993 d56d4c8d-bfba-4b95-8332-e86d7f204c1c 63cdf958-9d5a-4b63-ae65-74e4237888ea 6fd09369-0fbd-456d-9c06-27fef4c8eca5 Here are 4 of them by Guid.NewGuid(): 0652b193-64c6-4c5e-ad06-9990e1ee3791 374b6313-34a0-4c28-b336-bb2ecd879d0f 3c5a345f-3865-4420-a62c-1cdfd2defed9 5b09d7dc-8546-4ccf-9c85-de0bf4f43bf0

    Read the article

  • How to highlight text automatically inside an UIAlertView text field

    - by user333624
    Hello everyone I have an UIAlertView with a textfield that shows a default value and two buttons, one to cancel and the other one to confirm. What I am trying to do is that when the alert view is popped up the default value is highlighted so the user can override the whole value faster than manually erasing it. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Title" message:@"" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Continue",nil]; [alerta addTextFieldWithValue:@"87893" label:@"value"]; UITextField *textField = [alert textField]; campoTexto.highlighted = YES; campoTexto.keyboardType = UIKeyboardTypeNumbersAndPunctuation; [alertt show]; [alert release]; } for some reason there is a highlighted attribute for the textfield but it doesn't seem to work and there is no trail of that attribute in the Class documentation.

    Read the article

  • How does this Perl grep work to determine the union of several hashes?

    - by titaniumdecoy
    I don't understand the last line of this function from Programming Perl 3e. Here's how you might write a function that does a kind of set intersection by returning a list of keys occurring in all the hashes passed to it: @common = inter( \%foo, \%bar, \%joe ); sub inter { my %seen; for my $href (@_) { while (my $k = each %$href) { $seen{$k}++; } } return grep { $seen{$_} == @_ } keys %seen; } I understand that %seen is a hash which maps each key to the number of times it was encountered in any of the hashes provided to the function.

    Read the article

  • Java library to partially export a database while respecting referential integrity constraints

    - by Mwanji Ezana
    My production database is several GB's uncompressed and it's getting to be a pain to download and run locally when trying to reproduce a bug or test a feature with real data. I would like to be able to select the specific records that interest me, then have the library figure out what other records are necessary to produce a dataset that respects the databases integrity constraints and finally print it out as a list of insert statements or dump that I can restore. For example: given Author, Blog and Comment tables when I select comments posted after a certain date I should get inserts for the Blog records the comments have foreign keys to and the Author records those Blogs have foreign keys to.

    Read the article

  • Selenium RC: How to click buttons that use onclick window.location?

    - by Andrew
    I have a button (outside of a form) that redirects to another page using the onclick attribute that calls window.location to redirect the user to another page. This time I can't change the HTML. I am using Safari 4 for testing. How can I click a button that uses the onclick attribute and window.location to redirect using Safari 4 and Selenium RC PHPUnit Extension? Here's my HTML: <input type="button" onclick="window.location='/registrations/new'" value="Start a new registration" id="create"> Update: Alternatively, I'm thinking about doing something where I assert that a location is specified in the window.location='', store that location, and call the open() command using that location. Not sure if this is an acceptable approach to testing this.

    Read the article

  • Making an ANT Macro more reusable

    - by 1ndivisible
    I have a simple macro (simplified version below). At the moment it assumes that there will be a single value for a single argument, however there might be multiple values for that argument. How can I pass in 0+ values for that argument so that the macro is usable in situations where I need to pass in 0+ values for that argument, not just a single value <macrodef name="test"> <attribute name="target.dir" /> <attribute name="arg.value" /> <sequential> <java jar="${some.jar}" dir="@{target.dir}" fork="true" failonerror="true"> <arg value="-someargname=@{arg.value}"/> </java> </sequential> </macrodef>

    Read the article

  • Is there a way to allow a property of a user control to be modified only during design time?

    - by Dan
    I've looked into the DesignOnly attribute, but that doesn't seem to accomplish what I want*. Basically, I'm looking for some way to indicate that some property of a user control (let's say Text) can be modified during design time -- i.e., from the Windows Forms designer in VS (or presumably from any GUI designer that can be used to modify a Windows Forms GUI) -- but not during run time. Once the application is running, the property should effectively be readonly. Is this possible? * When I add the DesignOnly attribute to a property, the value I select for that property from design mode doesn't seem to stick; the property just ends up being whatever I have it set to by default in code.

    Read the article

  • SQL? "Show me all the Activities that can be performed by User X."

    - by Casey Fulton
    I'm at my wits end. I've searched like crazy, read plenty of database textbooks and God knows how many online guides, blogs and forums. Can someone put me out of my misery? PseudoSchema Diagram (Warning: although pretty, not in a format even remotely approaching ER diagrams! Primary keys are bold, foreign keys are italics.) Given the above set of tables relating Users to Groups to Privileges, and then a set of Activities that can each require a Privilege to perform, how do you find out this: Show me all the Activities that can be performed by User X. That is: User X is a member of groups G and F; groups G and F correlate to privileges P, Q, R and S; show me all the activities that require privileges either P, Q, R or S. How do you do this?

    Read the article

  • Non-string role names in ASP.NET MVC?

    - by MikeWyatt
    ASP.NET MVC has good support for role-based security, but the usage of strings as role names is maddening, simply because they cannot be strongly-typed as enumerations. For example, I have an "Admin" role in my app. The "Admin" string will now exist in the Authorize attribute of my action, in my master page (for hiding a tab), in my database (for defining the roles available to each user), and any other place in my code or view files where I need to perform special logic for admin or non-admin users. Is there a better solution, short of writing my own authorization attribute and filter, that would perhaps deal with a collection of enumeration values?

    Read the article

  • Struts Tiles application

    - by rav83
    Am trying a tiles application.Below is my code tiles-defs.xml </tiles-definitions> <definition name="${YOUR_DEFINITION_HERE}"> </definition> <definition name="commonPage" path="/jsps/template.jsp"> <put name="header" value="/jsps/header.jsp" /> <put name="menu" value="/jsps/menu.jsp" /> <put name="body" value="/jsps/homebody.jsp" /> <put name="footer" value="/jsps/footer.jsp" /> </definition> <definition name="aboutUsPage" extends="commonPage"> <put name="body" value="/jsps/aboutUsBody.jsp" /> </definition> </tiles-definitions> struts-config.xml <action path="/aboutus" type="java.com.mbest.core.action.AboutUsAction" parameter="method"> <forward name="success" path="aboutUsPage"/> <forward name="failure" path="aboutUsPage"/> </action> </action-mappings> template.jsp <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %> <html> <head><title></title></head> <body> <table border="1" cellspacing="0" cellpadding="0" style="width: 98%; height: 100%"> <tr> <td colspan="2"> <tiles:insert attribute="header"/> </td> </tr> <tr style="height: 500px"> <td valign="top" style="width: 200px"> <tiles:insert attribute="menu"/> </td> <td valign="baseline" align="left"> <tiles:insert attribute="body"/> </tr> <tr> <td colspan="2"> <tiles:insert attribute="footer"/> </td> </tr> </table> </body> </html> homebody.jsp <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> <%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> <%@taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %> <html> <head> <title></title> <style type="text/css"> <%@include file="../css/helper.css"%> <%@include file="../css/dropdown.css" %> <%@include file="../css/default.ultimate.css" %> </style> </head> <body> <div id="header"> <ul id="nav" class="dropdown dropdown-horizontal"> <li><span class="dir"><html:link page="/aboutus.do?method=aboutUsPage" >About Us</html:link></span></li> <li><span class="dir"><a href="./">Products</a></span></li> <li><span class="dir"><a href="./">Infrastructure</a></span></li> <li><span class="dir"><a href="./">Pharmaceutical Formulations</a></span></li> <li><span class="dir"><a href="./">Contact Us</a></span></li> </ul> </div> </body> </html> AboutUsAction.java package java.com.mindbest.core.action; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.actions.DispatchAction; public class AboutUsAction extends DispatchAction { public ActionForward aboutUsPage(ActionMapping mapping,ActionForm form, HttpServletRequest request,HttpServletResponse response)throws Exception { return mapping.findForward("success"); } } aboutUsBody.jsp hello In my above code if i try to access the app using (domainname)/example/aboutus.do its giving 500 error.Can anyone help me figure this out?

    Read the article

  • jQuery resetting value of form input when hidden

    - by RyanP13
    Hi, I am trying to clear the value attribute of an 'Other' form input when it is hidden from the user like so: // hide 'Other' inputs to start $('.jOther').hide(); // event listener on all select drop downs with class of jTitle $("select.jTitle").change(function(){ //set the select value var $titleVal = $(this).val(); if($titleVal != 'Other') { $(this).parent().find('.jOther').hide(); $(this).parent().find('input.jOther').attr("value", ""); } else { $(this).parent().find('.jOther').show(); } // Sets a cookie with named after the title field's ID attribute var $titleId = $(this).attr('id'); $.cookies.set('cpqb' + $titleId, $titleVal); }); It doesn't seem to be working and i have tried the following to no avail as well: $(this).parent().find('input.jOther').val(""); I have managed to alter other attributes in this way, such as the name, maxlength etc. Any ideas?

    Read the article

  • How do I create multiple submit buttons for the same form in Rails?

    - by Angela
    I need to have multiple submit buttons. I have a form which creates an instance of Contact_Call. One button creates it as normal. The other button creates it but needs to have a different :attribute value from the default, and it also needs to set the attribute on a different, but related model used in the controller. How do I do that? I can't change the route, so is there a way to send a different variable that gets picked up by [:params]? And if I do then, what do I do in the controller, set up a case statement?

    Read the article

  • Python json memory bloat

    - by Anoop
    import json import time from itertools import count def keygen(size): for i in count(1): s = str(i) yield '0' * (size - len(s)) + str(s) def jsontest(num): keys = keygen(20) kvjson = json.dumps(dict((keys.next(), '0' * 200) for i in range(num))) kvpairs = json.loads(kvjson) del kvpairs # Not required. Just to check if it makes any difference print 'load completed' jsontest(500000) while 1: time.sleep(1) Linux top indicates that the python process holds ~450Mb of RAM after completion of 'jsontest' function. If the call to 'json.loads' is omitted then this issue is not observed. A gc.collect after this function execution does releases the memory. Looks like the memory is not held in any caches or python's internal memory allocator as explicit call to gc.collect is releasing memory. Is this happening because the threshold for garbage collection (700, 10, 10) was never reached ? I did put some code after jsontest to simulate threshold. But it didn't help.

    Read the article

  • my first shader in WebGL

    - by Diego
    Hello, I am writing my first shader in WebGL. I was wondering if the GLSL language has any way to evaluate if an attribute or a uniform is null. According to the specs it does not support to do something like if (attributeX) { dothis(); } else{ dothat(): } And I think it would be a waste to write a bool attribute for each of these cases would be a waste. Another question: what happen during rendering when you don't pass along the uniforms or attribs to the shader? Thanks!

    Read the article

  • How do I get javascript-generated image maps to work with internet explorer?

    - by schwerwolf
    I'm using javascript to generate a high resolution grid for an image that I generated on a web server. The high-resolution grid is composed of a 'map' element with hundreds of 'area' child elements. Each 'area' element has onmouseover attribute that causes the display of a popup box. After assigning the map to the img (via the usemap attribute), Internet explorer ignores the 'onmouseover' attribute of the area elements that I added via javascript. The behavior is not caused by syntactical variations between IE and other browsers. A static map behaves correctly. Only the elements that I add dynamically to an existing image map fail to fire their corresponding mouse-over events. How can I get IE to fire the mouse-over event for the added 'area' elements? function generate_image_map ( img ) { var tile_width = 8; var tile_height = 10; var plotarea_left = 40; var plotarea_top = 45; var column_count = 100; var row_count = 120; var img_id = YAHOO.util.Dom.getAttribute(img, "id"); var img_map_id = YAHOO.util.Dom.getAttribute(img, "usemap"); var original_map = YAHOO.util.Selector.query(img_map_id)[0]; var area_nodes = YAHOO.util.Selector.query("area", original_map); var last_node = area_nodes[area_nodes.length - 1]; for (var y = 0; y < row_count; y++) { var top = Math.round(plotarea_top + (y * tile_height)); var bottom = Math.round(plotarea_top + (y * tile_height) + tile_height); for (var x = 0; x < column_count; x++) { var left = Math.round(plotarea_left + (x * tile_width)); var right = Math.round(plotarea_left + (x * tile_width) + tile_width); var area = document.createElement("area"); YAHOO.util.Dom.setAttribute(area, "shape", "rect"); YAHOO.util.Dom.setAttribute(area, "onmouseover", "alert('This does not appear in IE')" ); var coords = [ left, top, right, bottom ]; YAHOO.util.Dom.setAttribute(area, "coords", coords.join(",")); YAHOO.util.Dom.insertBefore(area, last_node); } } }

    Read the article

  • Android Animate Rotate

    - by oriharel
    I did some digging in Android code, and saw the use of in the indeterminate progress bar. after trying to create my own drawable with this tag: <animated-rotate xmlns:android="http://schemas.android.com/apk/res/android" android:drawable="@drawable/spinner_pia" android:pivotX="50%" android:pivotY="50%" android:framesCount="12" android:frameDuration="100" /> I get an error: "No resource identifier found for attribute 'frameDuration' in package 'android'" - which means that frameDuration is a private attribute. Is there a way to use this "animate-rotate" feature? My task is to replace the system's default indeterminate progress bar. I'd like to do it with as little code as possible (just change few attributes if possible). Using the ProgressBar view, setting: android:indeterminateOnly="true" android:indeterminateBehavior="cycle" android:indeterminateDuration="3500" android:indeterminateDrawable="@drawable/pia_sivuvator" and point "@drawable/pia_sivuvator" to that object would've make my task as elegant as they come but I'm stuck on those private attributes. help?

    Read the article

  • Confusing Perl code

    - by titaniumdecoy
    I don't understand the last line of this function from Programming Perl 3e. Here's how you might write a function that does a kind of set intersection by returning a list of keys occurring in all the hashes passed to it: @common = inter( \%foo, \%bar, \%joe ); sub inter { my %seen; for my $href (@_) { while (my $k = each %$href) { $seen{$k}++; } } return grep { $seen{$_} == @_ } keys %seen; } I understand that %seen is a hash which maps each key to the number of times it was encountered in any of the hashes provided to the function.

    Read the article

  • is it possible if callback in array_filter receive parameter ?

    - by justjoe
    i got this multiple array name $files[], who consist keys and values as below : [0] = Array ( [name] = index1.php [path] = http://localhost/php/gettingstarted/ [number] = 1 ) [1] = Array ( [name] = index10.php [path] = http://localhost/php/gettingstarted/ [number] = 2 ) [2] = Array ( [name] = index11.php [path] = http://localhost/php/gettingstarted/ [number] = 3 ) and i use this code to create new array consist of 'name' keys only. but it failed array_filter($files, "is_inarr_key('name')"); function is_inarr_key($array, $key) { //TODO : remove every array except those who got the same $key } and i got this error array_filter() [function.array-filter]: The second argument, 'is_inarr_key('name')', should be a valid callback in C:\xampp\htdocs\php\gettingstarted\index.php on line 15 so the queastion : 1. is it possible to make call-back function on array_filter has ability to receive parameter ? What is general rule of thumb on how to use callback in anyPHP built-in function ?

    Read the article

  • A balanced binary search tree which is also a heap

    - by saeedn
    I'm looking for a data structure where each element in it has two keys. With one of them the structure is a BST and looking at the other one, data structure is a heap. With a little search, I found a structure called Treap. It uses the heap property with a random distribution on heap keys to make the BST balanced! What I want is a Balanced BST, which can be also a heap. The BST in Treap could be unbalanced if I insert elements with heap Key in the order of my choice. Is there such a data structure?

    Read the article

  • MSSQL: Primary Key Schema Largely Guid but Sometimes Integer Types...

    - by Code Sherpa
    OK, this may be a silly question but... I have inherited a project and am tasked with going over the primary key relationships. The project largely uses Guids. I say "largely" because there are examples where tables use integral types to reflect enumerations. For example, dbo.MessageFolder has MessageFolderId of type int to reflect public emum MessageFolderTypes { inbox = 1, sent = 2, trash = 3, etc... } This happens a lot. There are tables with primary keys of type int which is unavoidable because of their reliance on enumerations and tables with primary keys of type Guid which reflect the primary key choice on the part of the previous programmer. Should I care that the PK schema is spotty like this? It doesn't feel right but does it really matter? If this could create a problem, how do I get around it (I really can't move all PKs to type int without serious legwork and I have never heard of enumerations that have guid values)? Thanks.

    Read the article

  • Approach for altering Primary Key from GUID to BigInt in SQL Server related tables

    - by Tom
    I have two tables with 10-20 million rows that have GUID primary keys and at leat 12 tables related via foreign key. The base tables have 10-20 indexes each. We are moving from GUID to BigInt primary keys. I'm wondering if anyone has any suggestions on an approach. Right now this is the approach I'm pondering: Drop all indexes and fkeys on all the tables involved. Add 'NewPrimaryKey' column to each table Make the key identity on the two base tables Script the data change "update table x, set NewPrimaryKey = y where OldPrimaryKey = z Rename the original primarykey to 'oldprimarykey' Rename the 'NewPrimaryKey' column 'PrimaryKey' Script back all the indexes and fkeys Does this seem like a good approach? Does anyone know of a tool or script that would help with this? TD: Edited per additional information. See this blog post that addresses an approach when the GUID is the Primary: http://www.sqlmag.com/blogs/sql-server-questions-answered/sql-server-questions-answered/tabid/1977/entryid/12749/Default.aspx

    Read the article

  • unknown column in where clause

    - by ranzy
    $result = mysql_query("SELECT * FROM Volunteers WHERE Volunteers.eventID = " . $var); $sql = mysql_query("SELECT * FROM Members WHERE Members.pid = " . $temp); I am also doing or die(mysql_error()) at the end of both statements if that matter. My problem is that the first statement executes perfectly but in that table I store an attribute called pid. So the second statement is supposed to take that and return the row where it equals that pid so I can get the name. I get an error that says unknown column in 'a2' in 'where clause' where a2 the pid attribute returned from the first statement. Thanks for any help!

    Read the article

  • Using a password to generate two distinct hashes without reducing password security

    - by Nevins
    Hi there, I'm in the process of designing a web application that will require the storage of GPG keys in an encrypted format in a database. I'm planning on storing the user's password in a bCrypt hash in the database. What I would like to be able to do is to use that bCrypt to authenticate the user then use the combination of the stored bCrypt hash and another hash of the password to encrypt and decrypt the GPG keys. My question is whether I can do this without reducing the security of the password? I was thinking I may be able to use something like an HMAC-SHA256 of a static string using the password and a salt as the secret key. Is there a better way to do this that I haven't thought of? Thanks

    Read the article

  • How to tell which thread(s) are producing all the garbage?

    - by Brad Hein
    I have an app with about 15 threads. Most do mundane tasks and sleep most of their lives. Others collect information and cache it in hashmaps. The hashmaps grow to a moderate size and level out. The number of keys and size of value remains constant, but the contents of the values changes (at 33 keys per second average). When I start my app, I notice the garbage collection interval goes from minutes to once per second, and the amount of garbage is 700k+ each time. In fact as I was writing this, it caused my phone to reboot with an error "Referencetable Overflow". Here's my question: Are there any tricks to identifying which threads are producing the garbage, or even finding out more about what garbage they are producing?

    Read the article

  • WCF DataContract GetCustomDataToExport

    - by JeffN825
    I'm trying to get the default behavior for a client referencing my WCF WSDL to set IsReference to true on the imported DataContracts. It looks like I should be able to use an IDataContractSurrogate with GetCustomDataToExport to accomplish this...which specifcally means adding the following to the generated ComplexType in the xsd associated with the WSDL: <xs:attribute ref="ser:Id" /> <xs:attribute ref="ser:Ref" /> There is, of course no usable documentation I can find from MS about how to use this method. The MSDN page says it should return an object...but does not indicate at all what type of object this should be....how useless... Before I go reflector'ing for this, does anyone out there know how to use this method? Thanks.

    Read the article

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