Search Results

Search found 3339 results on 134 pages for 'hash collision'.

Page 37/134 | < Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >

  • What's the big deal with brute force on hashes like MD5

    - by Jan Kuboschek
    I just spent some time reading http://stackoverflow.com/questions/2768248/is-md5-really-that-bad (I highly recommend!). In it, it talks about hash collisions. Maybe I'm missing something here, but can't you just encrypt your password using, say, MD5 and then, say, SHA-1 (or any other, doesn't matter.) Wouldn't this increase the processing power required to brute-force the hash and reduce the possibility of collision?

    Read the article

  • Hashing (hidding) strings in Python

    - by Lucas
    What I need is to hash a string. It doesn't really have to be secure because its just going to be a hidden pharse in the text file (simply it doesn't have to be recognizable for a human-eye). It should not be just a random string because when user will be typing the string I would like to hash it and compare it with already hashed one (in the text file). What would be the best for this purpose? Can it be done with the own class?

    Read the article

  • Rails - Why is HAML showing the full hash?

    - by Mr. Demetrius Michael
    View: !!! %html %head %title= full_title(yield(:title)) =stylesheet_link_tag "application", media: "all" =javascript_include_tag "application" =csrf_meta_tags =render 'layouts/shim' %body =render 'layouts/header' .container =flash.each do |key, value| %div{class: "alert alert-#{key}"} #{value} Controller def create @user = User.new(params[:user]) if @user.save flash[:success] = "This is Correct" redirect_to @user else flash[:wrong] = "no" render 'new' end end Regardless of the flash (:success or :wrong or otherwise) it always compiles the entire hash as html (below) Output: <!DOCTYPE html> .... <div class='container'> <div class='alert alert-wrong'>no</div> {:wrong=&gt;&quot;no&quot;} </div> </body> </html> I have no idea why {:wrong=&gt;&quot;no&quot;} is being displayed. I've been staring at this terminal for hours. What's interesting is that the hash is being outputted with the container id, but not in the alert class. It feels like an indentation problem, but I went through several permutations with no success.

    Read the article

  • HREF link that targets nothing, does not want to use hash or void(0)

    - by Mattis
    I have a link that I want to be able to click to trigger a piece of jQuery code. Currently I have <a href="#" id="foo">Link</a> and $('#foo').click(function(){ // Do stuff }); which works well. But, I have always hated using hash in this way. The page flickers and the hash is added to the page url. One alternative is to use <a href="javascript:void(0);" id="foo">Link</a> but I also dislike seeing that piece of code in the browser status bar. It looks tacky. What I'd rather have is an explanatory javascript placeholder that does nothing, like <a href="javascript:zoom();" id="foo">Link</a> which actually works, but throws an ReferenceError in the javascript console since there are no such function. What's the minimum definition of a function that does nothing? Are there any other alternatives? Should I just skip the link and use something like <span id="foo" style="cursor:pointer;cursor:hand;">Link</span> instead?

    Read the article

  • Prevent hash navigation url

    - by Koningh
    I have the following problem: I'm using a slider (coda) to let people navigate trough some 'pages'. The slider uses hash links to navigate to the next page/slide. If a user is at page one (#page1), there is a link which will lead the user to page 2 (#page2) and so on. At the top of the slider the numbers of the pages appear as a link, but only when the page is visited. So if there are six pages and the user navigates from the first to the second and then the third one, there are only three links at the top of the slider (to page one, two and three). The problem is that a user can navigate to page five (or any page actually) without first visiting the pages previous to page five by just using the hash URL and typing the whole link in their address bar. For example if I would type www.mydomain.com/slider/index.php#page5 the slider automatically navigates to the fifth slide/page of the slider and thereby skipping the first four. I want to allow users to navigate to #page5 only if they have visited the first four (So by clicking trough the slides). This means that if they would go to #page5 directly by typing the URL in the address bar, I would like them to be send to the first page (#page1). Does anyone have any idea on solving this?

    Read the article

  • Perl help dereferencing a reference to an array of hash references, containing record set data

    - by user1724150
    I'm using the a Amazon Perl module that returns a reference to an array of hash references as $record_sets, containing record set data and I'm having a hard time dereferencing it. I can print the data using data dumper but I need to be able to manipulate the data. Below is the documentation provided for the module Thanks In Advance: #list_resource_record_sets #Lists resource record sets for a hosted zone. #Called in scalar context: $record_sets = $r53->list_resource_record_sets(zone_id => '123ZONEID'); #Returns: A reference to an array of hash references, containing record set data. Example: $record_sets = [ { name => 'example.com.', type => 'MX' ttl => 86400, records => [ '10 mail.example.com' ] }, { name => 'example.com.', type => 'NS', ttl => 172800, records => [ 'ns-001.awsdns-01.net.', 'ns-002.awsdns-02.net.', 'ns-003.awsdns-03.net.', 'ns-004.awsdns-04.net.' ]

    Read the article

  • Storing large json strings to database + hash

    - by Guy
    I need to store quiete large JSON data strings to the database. I am using gzip to compress the string and therefore BLOB MySQL data type to store it. However, only 5% of all the requests contain unique data and only unique data ought to be stored to the database. My approach is as follows. array_multisort data (array [a, b, c] is virtually the same as [a, c, b]). json_encode data (json_encode is faster than serialize; we need string array representation for the step 3). sha1 data (slower than md5, though less possible the collisions). Check if the hash exists in the database. 5.1 yes – do not insert the data. 5.2. no – gzip the data and store it along the hash. Is there anything about this (apart from storing JSON data to the database in the first place) that sounds fishy or should be done a different way? p.s. We are talking about a database with roughly 1kk unique records being created every month.

    Read the article

  • hash tables and 2d vectors

    - by Sunil
    I want to push a 2d vector into a hash table row by row and later search for a row (vector) in the hash table and want to be able to find it. I want to do something like #include <iostream> #include <set> #include <vector> using namespace std; int main(){ std::set < vector<int> > myset; vector< vector<int> > v; int k = 0; for ( int i = 0; i < 5; i++ ) { v.push_back ( vector<int>() ); for ( int j = 0; j < 5; j++ ) v[i].push_back ( k++ ); } for ( int i = 0; i < 5; i++ ) { std::copy(v[i].begin(),v[i].end(),std::inserter(myset)); // This is not correct but what is the right way ? // and also here, I want to search for a particular vector if it exists in the table. for ex. the second row of vector v. } return 0; } I'm not sure how to insert and look up a vector in a set. So if nybody could guide me, it will be helpful. Thanks

    Read the article

  • Unity - Mecanim & Rigidbody on Third Person Controller - Gravity bug?

    - by Celtc
    I'm working on a third person controller which uses physX to interact with the other objects (using the Rigidbody component) and Mecanim to animate the character. All the animations used are baked to Y, and the movement on this axis is controlled by the gravity applied by the rigidbody component. The configuration of the falling animation: And the character components configuration: Since the falling animation doesn't have root motion on XZ, I move the character on XZ by code. Like this: // On the Ground if (IsGrounded()) { GroundedMovementMgm(); // Stores the velocity velocityPreFalling = rigidbody.velocity; } // Mid-Air else { // Continue the pre falling velocity rigidbody.velocity = new Vector3(velocityPreFalling.x, rigidbody.velocity.y, velocityPreFalling.z); } The problem is that when the chracter starts falling and hit against a wall in mid air, it gets stuck to the wall. Here are some pics which explains the problems: Hope someone can help me. Thanks and sory for my bad english! PD.: I was asked for the IsGrounded() function, so I'm adding it: void OnCollisionEnter(Collision collision) { if (!grounded) TrackGrounded(collision); } void OnCollisionStay(Collision collision) { TrackGrounded(collision); } void OnCollisionExit() { grounded = false; } public bool IsGrounded() { return grounded; } private void TrackGrounded(Collision collision) { var maxHeight = capCollider.bounds.min.y + capCollider.radius * .9f; foreach (var contact in collision.contacts) { if (contact.point.y < maxHeight && Vector3.Angle(contact.normal, Vector3.up) < maxSlopeAngle) { grounded = true; break; } } } I'll also add a LINK to download the project if someone wants it.

    Read the article

  • algorithim for simple colision detection in Java

    - by Bob Twinkles
    I'm not very experienced with Java, just started a couple weeks ago, but I have a simple applet that has two user controlled balls, drawn through java.awt and I need a way to detect a collision with between them. I have an algorithm for detecting collision with the walls: while (true){ if (xPositon > (300 - radius)){ xSpeed = -xSpeed; } else if (xPositon < radius){ xSpeed = -xSpeed; } else if (yPositon > (300 - radius)) { ySpeed = -ySpeed; } else if (yPositon < radius){ ySpeed = -ySpeed; } xPositon += xSpeed; yPositon += ySpeed; and for the second ball if (xPositon2 > (300 - radius)){ xSpeed2 = -xSpeed2; } else if (xPositon2 < radius){ xSpeed2 = -xSpeed2; } else if (yPositon2 > (300 - radius)) { ySpeed2 = -ySpeed2; } else if (yPositon2 < radius){ ySpeed2 = -ySpeed2; } xPositon2 += xSpeed2; yPositon2 += ySpeed2; the applet is 300 pixels by 300 pixels radius stores the radius of the circles xPositon and xPositon2 store the x cordanents for the two balls yPositon and yPositon store the y cordanents for the two balls xSpeed and xSpeed2 store the x velocities for the two balls ySpeed and ySpeed2 store the y velocities for the two balls I've only taken algebra 1 so please no advanced math or physics.

    Read the article

  • NetLogo 4.1 - implementation of a motorway ( Problem creating collision of cars )

    - by user206019
    Hi there, I am trying to create a simulation of motorway and the behaviour of the drivers in NetLogo. I have some questions that I m struggling to solve. Here is my code: globals [ selected-car ;; the currently selected car average-speed ;; average speed of all the cars look-ahead ] turtles-own [ speed ;; the current speed of the car speed-limit ;; the maximum speed of the car (different for all cars) lane ;; the current lane of the car target-lane ;; the desired lane of the car change? ;; true if the car wants to change lanes patience ;; the driver's current patience max-patience ;; the driver's maximum patience ] to setup ca import-drawing "my_road3.png" set-default-shape turtles "car" crt number_of_cars [ setup-cars ] end to setup-cars set color blue set size .9 set lane (random 3) set target-lane (lane + 1) setxy round random-xcor (lane + 1) set heading 90 set speed 0.1 + random 9.9 set speed-limit (((random 11) / 10) + 1) set change? false set max-patience ((random 50) + 10) set patience (max-patience - (random 10)) ;; make sure no two cars are on the same patch loop [ ifelse any? other turtles-here [ fd 1 ] [ stop ] ;if count turtles-here > 1 ; fd 0.1 ;if ; ;ifelse (any? turtles-on neighbors) or (count turtles-here > 1) ;[ ; ifelse (count turtles-here = 1) ; [ if any? turtles-on neighbors ; [ ; if distance min-one-of turtles-on neighbors [distance myself] > 0.9 ; [stop] ; ] ; ] ; [ fd 0.1 ] ;] ;[ stop ] ] end to go drive end to drive ;; first determine average speed of the cars set average-speed ((sum [speed] of turtles) / number_of_cars) ;set-current-plot "Car Speeds" ;set-current-plot-pen "average" ;plot average-speed ;set-current-plot-pen "max" ;plot (max [speed] of turtles) ;set-current-plot-pen "min" ;plot (abs (min [speed] of turtles) ) ;set-current-plot-pen "selected-car" ;plot ([speed] of selected-car) ask turtles [ ifelse (any? turtles-at 1 0) [ set speed ([speed] of (one-of (turtles-at 1 0))) decelerate ] [ ifelse (look-ahead = 2) [ ifelse (any? turtles-at 2 0) [ set speed ([speed] of (one-of turtles-at 2 0)) decelerate ] [ accelerate if count turtles-at 0 1 = 0 and ycor < 2.5 [lt 90 fd 1 rt 90] ] ] [accelerate if count turtles-at 0 1 = 0 and ycor < 2.5 [lt 90 fd 1 rt 90] ] ] if (speed < 0.01) [ set speed 0.01 ] if (speed > speed-limit) [ set speed speed-limit ] ifelse (change? = false) [ signal ] [ change-lanes ] ;; Control for making sure no one crashes. ifelse (any? turtles-at 1 0) and (xcor != min-pxcor - .5) [ set speed [speed] of (one-of turtles-at 1 0) ] [ ifelse ((any? turtles-at 2 0) and (speed > 1.0)) [ set speed ([speed] of (one-of turtles-at 2 0)) fd 1 ] [jump speed] ] ] tick end ;; increase speed of cars to accelerate ;; turtle procedure set speed (speed + (speed-up / 1000)) end ;; reduce speed of cars to decelerate ;; turtle procedure set speed (speed - (slow-down / 1000)) end to signal ifelse (any? turtles-at 1 0) [ if ([speed] of (one-of (turtles-at 1 0))) < (speed) [ set change? true ] ] [ set change? false ] end ;; undergoes search algorithms to change-lanes ;; turtle procedure show ycor ifelse (patience <= 0) [ ifelse (max-patience <= 1) [ set max-patience (random 10) + 1 ] [ set max-patience (max-patience - (random 5)) ] set patience max-patience ifelse (target-lane = 0) [ set target-lane 1 set lane 0 ] [ set target-lane 0 set lane 1 ] ] [ set patience (patience - 1) ] ifelse (target-lane = lane) [ ifelse (target-lane = 0) [ set target-lane 1 set change? false ] [ set target-lane 0 set change? false ] ] [ ifelse (target-lane = 1) [ ifelse (pycor = 2) [ set lane 1 set change? false ] [ ifelse (not any? turtles-at 0 1) [ set ycor (ycor + 1) ] [ ifelse (not any? turtles-at 1 0) [ set xcor (xcor + 1) ] [ decelerate if (speed <= 0) [ set speed 0.1 ] ] ] ] ] [ ifelse (pycor = -2) [ set lane 0 set change? false ] [ ifelse (not any? turtles-at 0 -1) [ set ycor (ycor - 1) ] [ ifelse (not any? turtles-at 1 0) [ set xcor (xcor + 1) ] [ decelerate if (speed <= 0) [ set speed 0.1 ] ] ] ] ] ] end I know its a bit messy because I am using code from other models from the library. I want to know how to create the collision of the cars. I can't think of any idea. As you notice my agent has almost the same size as the patch (I set it to 0.9 so that you can distinguish the space between 2 cars when they are set next to each other and I round the coordinates so that they are set to the centre of the patch). In my accelerate procedure I set my agent to turn left, move 1, turn right in a loop. I want to know if there's a command that lets me make the agent jump from one lane to the other (to the patch next to it on its left) without making it turn and move. And last, if you notice the code i created the car checks the patch that is next to it on the lane on its left and the patch in front of it and the back of it. So if the 3 patches on its left are empty then it can change lane. The fuzzy part is that when i run the setup and I press Go sometimes (not always) the car goes out of the 3 basic lanes. To understand this I have 7 lanes. The middle one which I don't use which is lane 0. Then there are 3 lanes on top of lane 0 and 3 below it. So the code I am using refers to the upper 3 lanes where I set the cars but for some reason some of the cars change lane and go to lane -3 then -2 and so forth. If someone can give me a tip I would really appreciate it. Thank you in advance. Tip: if you want to try this code in netlogo keep in mind that on interface tab I have 2 buttons one setup and one go as well as 3 sliders with names: number_of_cars , speed-up , slow-down.

    Read the article

  • Is hashing of just "username + password" as safe as salted hashing

    - by randomA
    I want to hash "user + password". EDIT: prehashing "user" would be an improvement, so my question is also for hashing "hash(user) + password". If cross-site same user is a problem then the hashing changed to hashing "hash(serviceName + user) + password" From what I read about salted hash, using "user + password" as input to hash function will help us avoid problem with reverse hash table hacking. The same thing can be said about rainbow table. Any reason why this is not as good as salted hashing?

    Read the article

  • Cacti is ignoring hash marks in interface aliases

    - by Matt Simmons
    I'm attempting to set up Cacti to monitor a router's interfaces, and I'm having trouble getting the graph templates to show the information that I'd like. Our interface configuration looks like this: interface GigabitEthernet3/6 description WalljackNumber # Server info no ip address no shutdown switchport switchport access vlan 116 switchport mode access ip dhcp snooping trust spanning-tree portfast The "Server Info" string is really just the machine name, and a short relevant description, such as "PolarSprings vmnic2". The important part appears to be that it follows the hashmark. When I run snmpwalk, I get the proper output: IF-MIB::ifAlias.230 = STRING: WalljackNumber # Server info But in Cacti, when I go into the graph templates and set the title to this: |host_description| - Traffic - |query_ifName| (|query_ifAlias|) All that shows up in the graph is: switchname - Traffic - Gi3/6 (WalljackNumber #) Which strikes me as a little weird. What I suppose MAY be happening is that somewhere in the cacti stream, it's interpreting # as being a comment and stripping everything after, but I'm not sure. I was hoping someone could tell me that this was a known documented behavior, or that I could change it in a setting that I wasn't aware of. The alternative answer is to change the delimiter from # to something else, but I've got over a thousand lit switchports on an old college infrastructure, and I'm not sure what else might be relying on them.

    Read the article

  • linux: accessing thousands of files in hash of directories

    - by 130490868091234
    I would like to know what is the most efficient way of concurrently accessing thousands of files of a similar size in a modern Linux cluster of computers. I am carrying an indexing operation in each of these files, so the 4 index files, about 5-10x smaller than the data file, are produced next to the file to index. Right now I am using a hierarchy of directories from ./00/00/00 to ./99/99/99 and I place 1 file at the end of each directory, like ./00/00/00/file000000.ext to ./00/00/00/file999999.ext. It seems to work better than having thousands of files in the same directory but I would like to know if there is a better way of laying out the files to improve access.

    Read the article

  • Hashing the state of a complex object in .NET

    - by Jan
    Some background information: I am working on a C#/WPF application, which basically is about creating, editing, saving and loading some data model. The data model contains of a hierarchy of various objects. There is a "root" object of class A, which has a list of objects of class B, which each has a list of objects of class C, etc. Around 30 classes involved in total. Now my problem is that I want to prompt the user with the usual "you have unsaved changes, save?" dialog, if he tries to exit the program. But how do I know if the data in current loaded model is actually changed? There is of course ways to solve this, like e.g. reloading the model from file and compare against the one in memory value by value or make every UI control set a flag indicating the model has been changed. Now instead, I want to create a hash value based on the model state on load and generate a new value when the user tries to exit, and compare those two. Now the question: So inspired of that, I was wondering if there exist some way to generate a hash value from the (value)state of some arbitrary complex object? Preferably in a generic way, e.g. no need to apply attributes to each involved class/field. One idea could be to use some of .NET's serialization functionality (assuming it will work out-of-the-box in this case) and apply a hash function to the content of the resulting file. However, I guess there exist some more suitable approach. Thanks in advance.

    Read the article

  • How would you implement a hashtable in language x?

    - by mk
    The point of this question is to collect a list of examples of hashtable implementations using arrays in different languages. It would also be nice if someone could throw in a pretty detailed overview of how they work, and what is happening with each example. Edit: Why not just use the built in hash functions in your specific language? Because we should know how hash tables work and be able to implement them. This may not seem like a super important topic, but knowing how one of the most used data structures works seems pretty important to me. If this is to become the wikipedia of programming, then these are some of the types of questions that I will come here for. I'm not looking for a CS book to be written here. I could go pull Intro to Algorithms off the shelf and read up on the chapter on hash tables and get that type of info. More specifically what I am looking for are code examples. Not only for me in particular, but also for others who would maybe one day be searching for similar info and stumble across this page. To be more specific: If you had to implement them, and could not use built-in functions, how would you do it? You don't need to put the code here. Put it in pastebin and just link it.

    Read the article

  • Generating an identifier for objects so that they can be added to a hashtable I have created

    - by dukenukem
    I have a hashtable base class and I am creating different type of hashtable by deriving from it. I only allow it to accept objects that implement my IHashable interface.For example - class LinearProbingHashTable<T> : HashTableBase<T> where T: IHashable { ... ... ... } interface IHashable { /** * Every IHashable implementation should provide an indentfying value for use in generating a hash key. */ int getIdentifier(); } class Car : IHashable { public String Make { get; set; } public String Model { get; set; } public String Color { get; set; } public int Year { get; set; } public int getIdentifier() { /// ??? } } Can anyone suggest a good method for generating an identifier for the car that can be used by the hash function to place it in the hash table? I am actually really looking for a general purpose solution to generating an id for any given class. I would like to have a base class for all classes, HashableObject, that implements IHashable and its getIdentifier method. So then I could just derive from HashableObject which would automatically provide an identifier for any instances. Which means I wouldn't have to write a different getIdentifier method for every object I add to the hashtable. public class HashableObject : IHashable { public int getIdentifier() { // Looking for code here that would generate an id for any object... } } public class Dog : HashableObject { // Dont need to implement getIdentifier because the parent class does it for me }

    Read the article

  • How to use Zend Framework Form Hash (token) with AJAX

    - by nvoyageur
    I have included Zend_Form_Element_Hash into a form multiplecheckbox form. I have jQuery set to fire off an AJAX request when a checkbox is clicked, I pass the token with this AJAX request. The first AJAX request works great, but the subsequent ones fail. I suspect it may be once the token has been validated it is then removed from the session (hop = 1). What would be your plan of attack for securing a form with Zend Framework Hash yet using AJAX to complete some of these requests?

    Read the article

  • how to hash a password?

    - by 5YrsLaterDBA
    My next task will be encrypt password. I am working at the database access layer and my co-work has this comment, implement SHA512 hash, on an empty method which I will implement it. any recommendation about this? thanks

    Read the article

  • Hash inside YAML file?

    - by yuval
    I want to include a hash and list inside a YAML file that I'm parsing with the following command: APP_CONFIG = YAML.load_file("#{RAILS_ROOT}/config/config.yml") My YAML file looks like this: feeds: [{:url => 'http://www.google.com', :label => 'default'}] But this doesn't seem to work. How would I go about achieving such a thing? Thanks, Yuval

    Read the article

  • Fuzzy match two hash tables?

    - by alex
    Hi, I'm looking for ideas on how to best match two hash tables containing string key/value pairs. Here's the actual problem I'm facing: I have structured data coming in which is imported into the database. I need to UPDATE records which are already in the DB, however, it's possible that ANY value in the source can change, therefore I don't have a reliable ID. I'm thinking of fuzzy matching two rows, source and DB and make an "educated" guess if it should be updated and inserted. Any ideas would be greatly appreciated.

    Read the article

  • How does a hash table work?

    - by Arec Barrwin
    I'm looking for an explanation of how a hashtable works - in plain English for a simpleton like me! For example I know it takes the key, calculates the hash (how?) and then performs some kind of modulo to work out where it lies in the array that the value is stored, but that's where my knowledge stops. Could anyone clarify the process. Edit: I'm not looking specifically about how hashcodes are calculated, but a general overview of how a hashtable works.

    Read the article

  • Msql Partitioning - Key vs Hash vs List vs Range

    - by Imran Omar Bukhsh
    I went through some of the documentation of mysql but cannot understand the difference in the following ways of partitioning : Key vs Hash vs List vs Range.Can someone explain in pure english? Also we have the following table: How do we partition by forum_id? CREATE TABLE IF NOT EXISTS `posts_content` ( `id` int(11) NOT NULL AUTO_INCREMENT, `post_id` int(11) NOT NULL, `forum_id` int(11) NOT NULL, `content` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=79850 ; Thanking you

    Read the article

  • Sort Hash Tables Glibc - qsort

    - by Mike
    I'm trying to sort a GLibc hash table by id that looks something like: key - id { "Red", 2, "BLue", 4, "Yellow", 5, "Orange", 8 } I'm just not sure how to approach this because GLibc does not have a sort method. I was thinking to use qsort or GCompareFunc Any ideas will be appreciate it!

    Read the article

< Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >