Search Results

Search found 29841 results on 1194 pages for 'random number generator'.

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

  • Not having address/phone number in WHOIS database?

    - by HighCommander4
    When I sign up for an account with a domain name registrar like 10dollar.ca, it asks for my address and phone number. Will these show up when someone does a WHOIS lookup on my domain name? I noticed that when you do a WHOIS lookup on some websites (e.g. http://www.chrismanieri.ca), no address/phone number comes up. I want mine to be like that, too (don't want my address/phone number exposed to the public).

    Read the article

  • regexp to match string with (comma-separated) number at start and to split into number and rest?

    - by mix
    Given a string such as: 23,234,456 first second third How can I split string this into two parts, where part 1 contains the number at the beginning and part 2 contains the rest---but only if the string STARTS with a number, and the number can be comma-separated or not? In other words, I want two results: 23,234,456 and first second third. If there's a number in that string that isn't part of the first number then it should be in the second result. My best stab at this so far, to grab the number at the beginning, is something like this: ^[0-9]+(,[0-9]{3})* Which seems to grab a comma-separated or non-comma-separated number that starts the line. However, when I run this in the Javascript console I get not only the full number, but also a match on just the last 3 digits with their preceeding ,. (e.g. 23,234,456 and ,456). As for getting the rest into another var I'm having trouble. I tried working with \b, etc., but I think I must be missing something fundamental about grabbing the rest of the line. I'm doing this in Javascript in case it matters. More examples of what to match and what not to match. 2 one two three should return 2 and one two three 2345 one two three should return 2345 and one two three 2 one 2 three should return 2 and one 2 three 2,234 one two 3,000 should return 2,234 and one two 3,000 The space between parts 1 and two could be included in the beginning of part 2.

    Read the article

  • SQL Server 2005 transactional replication break before a configured number of retries

    - by ti2
    We have a SQL Server 2000 Standard database with some tables being replicated (continuous transactional replication) to dozens of SQL Server 2005 Express and MSDE computers. The step 2 of the replication agent job (Run agent) is configured by default to retry every 1 minute for 10 times if some problem ocurr. Because the client machines get shut down at night (they are POS machines), we changed the number of retries to 5760 (4 days), so replication would not be broken at night and would not need to be restarted manually. But the problem is that every other day we have at least one machine with broken replication, with this error: The process could not connect to Subscriber 'POS986'. NOTE: The step was retried the requested number of times (5760) without succeeding. The step failed. It seems that SQL Server is not respecting the number of retries or the interval between retries as we configured. PS: I have restarted the replication job after changing the number of retries from 10 to 5760.

    Read the article

  • Distinct rand() sequences yielding the same results in an expression

    - by suszterpatt
    Ok, this is a really weird one. I have an MPI program, where each process has to generate random numbers in a fixed range (the range is read from file). What happens is that even though I seed each process with a different value, and the numbers generated by rand() are different in each process, the expression to generate the random numbers still yields the same sequence between them. Here's all relevant code: // 'rank' will be unique for each process int rank; MPI_Comm_rank(MPI_COMM_WORLD, &rank); // seed the RNG with a different value for each process srand(time(NULL) + rank); // print some random numbers to see if we get a unique sequence in each process // 'log' is a uniquely named file, each process has its own log << rand() << " " << rand() << " " << rand() << std::endl; // do boring deterministic stuff while (true) { // waitTimeMin and waitTimeMax are integers, Max is always greater than Min waitSecs = waitTimeMin + rand() % (waitTimeMax - waitTimeMin); log << "waiting " << waitSecs << " seconds" << std::endl; sleep(waitSecs); // do more boring deterministic stuff } Here's the output of each process, with 3 processes generating numbers in the range [1,9]. process 1: 15190 28284 3149 waiting 6 seconds waiting 8 seconds waiting 9 seconds waiting 4 seconds process 2: 286 6264 3153 waiting 6 seconds waiting 8 seconds waiting 9 seconds waiting 4 seconds process 3: 18151 17013 3156 waiting 6 seconds waiting 8 seconds waiting 9 seconds waiting 4 seconds So while rand() clearly generates different numbers, the expression to calculate waitSecs still evaluates to the same sequence on all processes. What's even weirder: if I run the program with the same parameteres again, only the first 3 random numbers will change, the rest of the "random" sequence will be exactly the same in each run! Changing the range of numbers will obviously produce a different result from this one, but the same parameters always yield the same sequence, between processes and between executions: except for the first 3 numbers. Just what the hell is going on here?

    Read the article

  • Randomised objects are assigning themselves to more than one array location

    - by Thaddeus Aid
    this.size = 9; this.populationSize = 10; Random rand = new Random(); Integer[][] easy1 = new Integer[size][size]; easy1 = this.initializeEasy1(easy1); this.sudokuArray = new Sudoku[this.populationSize]; for (int i = 0; i < this.sudokuArray.length; i++){ long seed = rand.nextLong(); System.out.println("" + seed); this.sudokuArray[i] = new Sudoku(easy1, this.size, seed); } I am building an evolutionary sudoku solver and I am having a problem where the last Sudoku object is overwriting all the other objects in the array. Where in the code did I mess up? /edit here is the constructor of the class public Sudoku(Integer[][] givensGrid, int s, long seed){ this.size = s; this.givens = givensGrid; this.grid = this.givens.clone(); Random rand = new Random(seed); System.out.println("Random " + rand.nextInt()); // step though each row of the grid for (int i = 0; i < size; i++){ ArrayList<Integer> numbers = new ArrayList<Integer>(); numbers = this.makeNumbers(numbers); // step through each column to find the givens and remove from numbers for (int j = 0; j < size; j++){ if (this.grid[i][j] != 0){ numbers.remove(this.grid[i][j]); } } // go back through the row and assign the numbers randomly for (int j = 0; j < size; j++){ if (this.grid[i][j] == 0){ int r = rand.nextInt(numbers.size()); this.grid[i][j] = numbers.get(r); numbers.remove(r); } } } System.out.println("============="); System.out.println(this.toString()); }

    Read the article

  • Random servers in Citrix servers suddenly bluescreens (mostly 0x0000008e and 0x0000007e)

    - by Rasmus Rask
    I'm responsible for a Citrix Presentation Server 4.5 farm. Starting Friday 30. November, my servers started to crash randomly. So far we've experienced 80 crashes, so it's obviously becoming an increasingly big problem for us. I have 12+ years experience with IT, so I know the difference between 0 and 1, but I have a hard time cracking this. We've rolled back any recent changes I can think of for different groups of servers, but all groups still seem to crash. I don't have the skills to interpret the memory dumps to find the culprit. Has anyone encountered the same or a similar problem? - might be a generic Windows issue Other than executing "analyze -v" in WinDbg, how do I work my way through the memory dumps to see what actually triggered the BSOD? Any suggested steps in getting to the bottom of this? Any help is greatly appreciated. I can also provide links to kernel memory dumps or WinDbg output if necessary. Thanks! Problem description The majority of the STOP errors we encounter are: 0x0000008e KERNEL_MODE_EXCEPTION_NOT_HANDLED (50%) 0x0000007e SYSTEM_THREAD_EXCEPTION_NOT_HANDLED (26%) 0x00000050 PAGE_FAULT_IN_NONPAGED_AREA (21%) We also see a few 0x0000000a IRQL_NOT_LESS_OR_EQUAL (3%). For both 0x0000008e and 0x0000007e bug checks, the exception code is 0xc0000005 (Access Violation). When opening dump files in WinDbg, most details are exactly the same, for all the 0x0000008e and 0x0000007e bug checks respectively: 0x0000008e Exception address: 0x808bc9e3 Trap frame: [varies] FAILURE_BUCKET_ID: 0x8E_nt!HvpGetCellMapped+97 Probably Caused by (IMAGE_NAME): ntkrpamp.exe 0x0000007e Exception address: 0x808369b6 Exception record address: 0xf70d3be0 Context record address: 0xf70d38dc FAILURE_BUCKET_ID: 0x7E_nt!MmPurgeSection+14 Probably Caused by: memory_corruption About 30% of the crashes happens between 17:00 and 19:00, which leads me to believe this tend to happen more often during logoffs. But then again, only ~15% occurs between 15:00 and 17:00. Summary of farm Citrix Presentation Server 4.5 R06 on Windows Server 2003 R2 SP2 All high priority patches, at least as of October installed Virtualized using VMWare ESX/vSphere 4.1 on HP Proliant BL460c G6 blade servers About 53 Presentation Servers in production, divided into three silos - only one of which, the largest, is affected 2 vCPU's (5 GHz reserved), 8 GB RAM (all reserved) for each Presentation Server Plenty of free disk space Very few printer drivers - automated deletion of non-approved drivers every night ~1.000 peak concurrent users, which is reached at around 10:30 (on weekdays) Number of sessions steadily decline between 15:00 and 19:00 to ~230

    Read the article

  • How should I unit test a code-generator?

    - by jkp
    This is a difficult and open-ended question I know, but I thought I'd throw it to the floor and see if anyone had any interesting suggestions. I have developed a code-generator that takes our python interface to our C++ code (generated via SWIG) and generates code needed to expose this as WebServices. When I developed this code I did it using TDD, but I've found my tests to be brittle as hell. Because each test essentially wanted to verify that for a given bit of input code (which happens to be a C++ header) I'd get a given bit of outputted code I wrote a small engine that reads test definitions from XML input files and generates test cases from these expectations. The problem is I dread going in to modify the code at all. That and the fact that the unit tests themselves are a: complex, and b: brittle. So I'm trying to think of alternative approaches to this problem, and it strikes me I'm perhaps tackling it the wrong way. Maybe I need to focus more on the outcome, IE: does the code I generate actually run and do what I want it to, rather than, does the code look the way I want it to. Has anyone got any experiences of something similar to this they would care to share?

    Read the article

  • AS3 Random repeat x seconds function

    - by Lilk
    Hi, I have the following function: function update(e:Event):void { var val:Number = Math.random() * 120; rgb.r.x = rgb.r.y = val; rgb.b.x = rgb.b.y = -val; } And im looping it with: stage.addEventListener(Event.ENTER_FRAME, update); But what I need to do would be something like: Random number between 1 and 20 If the number is > 10 Call function Update and keep caling it for 20 seconds else do nothing for 10 seconds Repeat this block of code forever Can someone help me write this please?

    Read the article

  • Configuring JPA Primary key sequence generators

    - by pachunoori.vinay.kumar(at)oracle.com
    This article describes the JPA feature of generating and assigning the unique sequence numbers to JPA entity .This article provides information on jpa sequence generator annotations and its usage. UseCase Description Adding a new Employee to the organization using Employee form should assign unique employee Id. Following description provides the detailed steps to implement the generation of unique employee numbers using JPA generators feature Steps to configure JPA Generators 1.Generate Employee Entity using "Entities from Table Wizard". View image2.Create a Database Connection and select the table "Employee" for which entity will be generated and Finish the wizards with default selections. View image 3.Select the offline database sources-Schema-create a Sequence object or you can copy to offline db from online database connection. View image 4.Open the persistence.xml in application navigator and select the Entity "Employee" in structure view and select the tab "Generators" in flat editor. 5.In the Sequence Generator section,enter name of sequence "InvSeq" and select the sequence from drop down list created in step3. View image 6.Expand the Employees in structure view and select EmployeeId and select the "Primary Key Generation" tab.7.In the Generated value section,select the "Use Generated value" check box ,select the strategy as "Sequence" and select the Generator as "InvSeq" defined step 4. View image   Following annotations gets added for the JPA generator configured in JDeveloper for an entity To use a specific named sequence object (whether it is generated by schema generation or already exists in the database) you must define a sequence generator using a @SequenceGenerator annotation. Provide a unique label as the name for the sequence generator and refer the name in the @GeneratedValue annotation along with generation strategy  For  example,see the below Employee Entity sample code configured for sequence generation. EMPLOYEE_ID is the primary key and is configured for auto generation of sequence numbers. EMPLOYEE_SEQ is the sequence object exist in database.This sequence is configured for generating the sequence numbers and assign the value as primary key to Employee_id column in Employee table. @SequenceGenerator(name="InvSeq", sequenceName = "EMPLOYEE_SEQ")   @Entity public class Employee implements Serializable {    @Id    @Column(name="EMPLOYEE_ID", nullable = false)    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator="InvSeq")   private Long employeeId; }   @SequenceGenerator @GeneratedValue @SequenceGenerator - will define the sequence generator based on a  database sequence object Usage: @SequenceGenerator(name="SequenceGenerator", sequenceName = "EMPLOYEE_SEQ") @GeneratedValue - Will define the generation strategy and refers the sequence generator  Usage:     @GeneratedValue(strategy = GenerationType.SEQUENCE, generator="name of the Sequence generator defined in @SequenceGenerator")

    Read the article

  • [MySQL/PHP] Avoid using RAND()

    - by Andrew Ellis
    So... I have never had a need to do a random SELECT on a MySQL DB until this project I'm working on. After researching it seems the general populous says that using RAND() is a bad idea. I found an article that explains how to do another type of random select. Basically, if I want to select 5 random elements, I should do the following (I'm using the Kohana framework here)? If not, what is a better solution? Thanks, Andrew <?php final class Offers extends Model { /** * Loads a random set of offers. * * @param integer $limit * @return array */ public function random_offers($limit = 5) { // Find the highest offer_id $sql = ' SELECT MAX(offer_id) AS max_offer_id FROM offers '; $max_offer_id = DB::query(Database::SELECT, $sql) ->execute($this->_db) ->get('max_offer_id'); // Check to make sure we're not trying to load more offers // than there really is... if ($max_offer_id < $limit) { $limit = $max_offer_id; } $used = array(); $ids = ''; for ($i = 0; $i < $limit; ) { $rand = mt_rand(1, $max_offer_id); if (!isset($used[$rand])) { // Flag the ID as used $used[$rand] = TRUE; // Set the ID if ($i > 0) $ids .= ','; $ids .= $rand; ++$i; } } $sql = ' SELECT offer_id, offer_name FROM offers WHERE offer_id IN(:ids) '; $offers = DB::query(Database::SELECT, $sql) ->param(':ids', $ids) ->as_object(); ->execute($this->_db); return $offers; } }

    Read the article

  • Getting a "for each" loop in Java to run in different order everytime

    - by R Stokes
    Hi, Basically my problem is that I'm trying to write a method that finds a random path in a graph of strings, which takes as it's parameters a start string, an integer length and a Vector of strings that will store the path. I'm attempting to do this by first adding the starting string to our blank vector, recursing through its neighbors until the vector's length (not including the start node) is the same as the integer length specified in the parameters. I've provided my code so far here: public Vector<String> findRandomPathFrom(String n, int len, Vector<String> randomPath){ randomPath.add(n); if (randomPath.size() == len + 1) return randomPath; for (String m : this.neighbours(n)){ if (!randomPath.contains(m) && findRandomPathFrom(m, len, randomPath) != null) return randomPath; } path.setSize(path.size() - 1); return null; } It seems to be working fine, returning a path with exactly the number of strings specified after the given start string. However, for any given starting string it generates the EXACT same path everytime, which kind of defeats the purpose of it being a random path generator. I'm guessing this problem is related to my "for each" loop, which loops through all the neighbouring strings of your current string. It seems to just be going with the first string in the neighbours vector every single time. Can anyone help me fix this problem so that it will choose a random neighbour instead of going in order? tl;dr - Any way of getting a "for each" loop in java to process a collection in a random order as oppoosed to start-to-finsih? Thanks in advance

    Read the article

  • Simple POST random number issue in PHP

    - by MrEnder
    Ok I am trying to make something to ask you random multiplication questions. Now it asks the questions fine. Generates the random questions fine. But when it reloads the page the random numbers are different... how can I fix this? <?php $rndnum1 = rand(1, 12); $rndnum2 = rand(1, 12); echo "<h3>". $rndnum1 . " x "; echo $rndnum2 . "</h3>"; if($_SERVER["REQUEST_METHOD"] == "GET") { $answer=0; } else if($_SERVER["REQUEST_METHOD"] == "POST") { $answer=trim($_POST["answerInput"]); $check=$rndnum1*$rndnum2; if($answer==$check) { echo "Correct!"; } else { echo "Wrong!"; } } ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" > <table> <tr> <td> First Name:&nbsp; </td> <td> <input type="text" name="answerInput" value="<?php echo $answer; ?>" size="20"/> </td> <td> <?php echo $answerError; ?> </td> </tr> <tr> <td class="signupTd" colspan="2"> <input type="submit" name="submit" value="Submit"/> </td> </tr> </table> </form>

    Read the article

  • Random value from Flags enum

    - by Chris Porter
    Say I have a function that accepts an enum decorated with the Flags attribute. If the value of the enum is a combination of more than one of the enum elements how can I extract one of those elements at random? I have the following but it seems there must be a better way. [Flags] enum Colours { Blue = 1, Red = 2, Green = 4 } public static void Main() { var options = Colours.Blue | Colours.Red | Colours.Green; var opts = options.ToString().Split(','); var rand = new Random(); var selected = opts[rand.Next(opts.Length)].Trim(); var myEnum = Enum.Parse(typeof(Colours), selected); Console.WriteLine(myEnum); Console.ReadLine(); }

    Read the article

  • Stable random color algorithm

    - by Olmo
    Here we have an interesting real-world algorithm requirement involving colors. 1) Nice random colors: In ordeeing to draw a beautifull chart (i.e: pie chart) we need to pick a random set of Colors that: a) are different enought b) Play nicely Doesnt Look hard. For example u fix bright and saturation and divide hue in steps of 360/Num_sectors 2) Stable: given Pie1 with sectors with labes ('A','B','C') and Pie2 with sector with labels ('B','C','D'), will be nice if color('B',pie1)= color('B',pie2) and the same for 'C' and so on, so people don't get crazy when seeing similar updated charts, even if some sectors appear some dissapeared or the number of sectors changed. The label is the only stable thing. 3) hard-coded colors: the algorithm allows hardcoded label-color relationships as an input but stills doing a good work (1 & 2) for the rest of free labels. I think this algorithm, even if it looks quite ad-hoc, will be usefull in more then one situation. Any ideas?

    Read the article

  • mysql random generated value

    - by bbutle01
    I need to generate a random alpha/numeric to give to users that they come to the site to enter. I dont' know much about random numbers and such, I know there are seeding issues and such, but I'm not sure what they are. So, I used this: select substrING(md5(concat_ws('-',md5(username_usr), MD5(zip_usr), MD5(id_usr), MD5(created_usr))),-12) from users_usr Is this safe? I used concat_ws because sometimes zip is null, but the others never are. And yes, I know this is kinda short, but 1. They have to enter the last 4 of their social, 2. It's 1 time use, 3. There's no private data displayed back in the application and 4. I may use captcha, but since there's no private data, thats probably overkill. THanks

    Read the article

  • random products instead of related products in magento

    - by abnab
    BElow is the function that selects related product of a single product. I wanted it to work in such a way that if there are no related products other random products will be added to the array. Random could be other products of the same category and if there is no procut in the same category we could fetch from other categories. protected function _prepareData() { $product = Mage::registry('product'); /* @var $product Mage_Catalog_Model_Product */ $this->_itemCollection = $product->getRelatedProductCollection() ->addAttributeToSelect('required_options') ->addAttributeToSort('position', Varien_Db_Select::SQL_ASC) ->addStoreFilter() ; if (Mage::helper('catalog')->isModuleEnabled('Mage_Checkout')) { Mage::getResourceSingleton('checkout/cart')->addExcludeProductFilter($this->_itemCollection, Mage::getSingleton('checkout/session')->getQuoteId() ); $this->_addProductAttributesAndPrices($this->_itemCollection); } // Mage::getSingleton('catalog/product_status')->addSaleableFilterToCollection($this->_itemCollection); Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($this->_itemCollection); $this->_itemCollection->load(); foreach ($this->_itemCollection as $product) { $product->setDoNotUseCategoryId(true); } return $this; } Thanks Abnab

    Read the article

  • select random value from each type

    - by Joseph Mastey
    I have two tables, rating: +-----------+-----------+-------------+----------+ | rating_id | entity_id | rating_code | position | +-----------+-----------+-------------+----------+ | 1 | 1 | Quality | 0 | | 2 | 1 | Value | 0 | | 3 | 1 | Price | 0 | +-----------+-----------+-------------+----------+ And rating_option +-----------+-----------+------+-------+----------+ | option_id | rating_id | code | value | position | +-----------+-----------+------+-------+----------+ | 1 | 1 | 1 | 1 | 1 | | 2 | 1 | 2 | 2 | 2 | | 3 | 1 | 3 | 3 | 3 | | 4 | 1 | 4 | 4 | 4 | | 5 | 1 | 5 | 5 | 5 | | 6 | 2 | 1 | 1 | 1 | | 7 | 2 | 2 | 2 | 2 | | 8 | 2 | 3 | 3 | 3 | | 9 | 2 | 4 | 4 | 4 | | 10 | 2 | 5 | 5 | 5 | | 11 | 3 | 1 | 1 | 1 | | 12 | 3 | 2 | 2 | 2 | | 13 | 3 | 3 | 3 | 3 | | 14 | 3 | 4 | 4 | 4 | | 15 | 3 | 5 | 5 | 5 | +-----------+-----------+------+-------+----------+ I need a SQL query (not application level, must stay in the database) which will select a set of ratings randomly. A sample result would look like this, but would pick a random value for each rating_id on subsequent calls: +-----------+-----------+------+-------+----------+ | option_id | rating_id | code | value | position | +-----------+-----------+------+-------+----------+ | 1 | 1 | 1 | 1 | 1 | | 8 | 2 | 3 | 3 | 3 | | 15 | 3 | 5 | 5 | 5 | +-----------+-----------+------+-------+----------+ I'm totally stuck on the random part, and grouping by rating_id has been a crap shoot so far. Any MySQL ninjas want to take a stab? Thanks, Joe

    Read the article

  • Random access gzip stream

    - by jkff
    I'd like to be able to do random access into a gzipped file. I can afford to do some preprocessing on it (say, build some kind of index), provided that the result of the preprocessing is much smaller than the file itself. Any advice? My thoughts were: Hack on an existing gzip implementation and serialize its decompressor state every, say, 1 megabyte of compressed data. Then to do random access, deserialize the decompressor state and read from the megabyte boundary. This seems hard, especially since I'm working with Java and I couldn't find a pure-java gzip implementation :( Re-compress the file in chunks of 1Mb and do same as above. This has the disadvantage of doubling the required disk space. Write a simple parser of the gzip format that doesn't do any decompressing and only detects and indexes block boundaries (if there even are any blocks: I haven't yet read the gzip format description)

    Read the article

  • total number of magic square from 9 numbers

    - by Peeyush
    9 numbers need to be arranged in a magic number square. A magic number square is a square of numbers that is arranged such that every row and column has the same sum.(condition for diagonal has been relaxed) For example: 1 2 3 3 2 1 2 2 2 How do we calculate total number of distinct magic square from 9 numbers. Two magic number squares are distinct if they differ in value at one or more positions. For example, there is only one magic number square that can be made of 9 instances of the same number. e.g. for these 9 numbers { 4, 4, 4, 4, 4, 4, 4, 4, 4 }, answer should be 1. Also the complexity should be optimal. Do we need to iterate through all the permutations , discarding if a[0]+a[1]+a[2] %3!=0 such combinations ? moreover how do we remove duplicate magic square?

    Read the article

  • Random directions, with no repeat.. (Bad Description)

    - by Neurofluxation
    Hey there, So I'm knocking together a random pattern generation thing. My code so far: int permutes = 100; int y = 31; int x = 63; while (permutes > 0) { int rndTurn = random(1, 4); if (rndTurn == 1) { y = y - 1; } //go up if (rndTurn == 2) { y = y + 1; } //go down if (rndTurn == 3) { x = x - 1; } //go right if (rndTurn == 4) { x = x + 1; } //go left setP(x, y, 1); delay(250); } My question is, how would I go about getting the code to not go back on itself? e.g. The code says "Go Left" but the next loop through it says "Go Right", how can I stop this? NOTE: setP turns a specific pixel on. Cheers peoples!

    Read the article

  • Using Geo APIs to pick a random town from anywhere in the world

    - by Dan Forys
    Hi all, I'm trying to use Yahoo's excellent GeoPlanet API: http://developer.yahoo.com/geo/geoplanet/guide/api-reference.html I would like to pick a random town from anywhere in the world but can't see an easy way to do it. I have tried querying by country and asking for children of type 'town', but can't seem to do that directly. Can anyone think of a way to pluck out a random town WOEID without having to query the country, then the admin regions, then the admin 2, then the admin 3 etc. I have also experimented using YQL, but don't have enough of an understanding about the available APIs.

    Read the article

  • My AES encryption/decryption functions don't work with random ivecs

    - by Brendan Long
    I was bored and wrote a wrapper around openSSL to do AES encryption with less work. If I do it like this: http://pastebin.com/V1eqz4jp (ivec = 0) Everything works fine, but the default ivec is all 0's, which has some security problems. Since I'm passing the data back as a string anyway, I figured, why not generate a random ivec and stick it to the front, the take it back off when I decrypt the string? For some reason it doesn't work though. With random ivec: http://pastebin.com/MkDBFcn6 Well actually, it almost works. It seems to decrypt the middle of the string, but not the beginning or end: String is: 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF Encrypting.. ???l%%1u???B! ?????`pN)?????[l????{?Q???2?/?H??y"?=Z?Cu????l%%1u???B! Decrypting.. String is: ?%???G*?5J?0??0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF!-e????V?5 I honestly have no idea what's going wrong. Maybe some stupid mistake, or maybe I'm missing something about AES?

    Read the article

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