Search Results

Search found 9058 results on 363 pages for 'length'.

Page 20/363 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • What is the difference between Sprint and Iteration in SCRUM and length of each Sprint?

    - by kurozakura
    1.Is there a difference between Sprint and an Iteration or one can have Iterations within a Sprint or Sprint is just the terminology used instead of Iteration in SCRUM? It will be helpful if someone can throw some light on this. 2.Suppose there are 4 sprints and you have decided the first sprint will go up to 10days is it required that other 3 sprints should have the same length of the 1st decided sprint's length??.

    Read the article

  • foreach: how to iterate this

    - by ilnur777
    object(stdClass)[1] public 'inbox' => array 0 => object(stdClass)[2] public 'from' => string '55512351' (length=8) public 'date' => string '29/03/2010' (length=10) public 'time' => string '21:24:10' (length=8) public 'utcOffsetSeconds' => int 3600 public 'recipients' => array 0 => object(stdClass)[3] public 'address' => string '55512351' (length=8) public 'name' => string '55512351' (length=8) public 'deliveryStatus' => string 'notRequested' (length=12) public 'body' => string 'This is message text.' (length=21) 1 => object(stdClass)[4] public 'from' => string '55512351' (length=8) public 'date' => string '29/03/2010' (length=10) public 'time' => string '21:24:12' (length=8) public 'utcOffsetSeconds' => int 3600 public 'recipients' => array 0 => object(stdClass)[5] public 'address' => string '55512351' (length=8) public 'name' => string '55512351' (length=8) public 'deliveryStatus' => string 'notRequested' (length=12) public 'body' => string 'This is message text.' (length=21) .... .... I have this foreach, but it does not iterate address, name, deliveryStatus! Could you show how to get this data? foreach ($data->inbox as $note) { echo '<p>'; echo 'From : ' . htmlspecialchars($note->from) . '<br />'; echo 'Date : ' . htmlspecialchars($note->date) . '<br />'; echo 'Time : ' . htmlspecialchars($note->time) . '<br />'; echo 'Body : ' . htmlspecialchars($note->body) . '<br />'; }

    Read the article

  • HttpServerUtility.UrlTokenDecode fails "sometimes" (Invalid length for a Base-64 char array.)

    - by Josef
    We have an IHttpHandler for stylesheets and add a <link/> tag to the page like this: HtmlGenericControl link = new HtmlGenericControl("link"); link.Attributes.Add("rel", "stylesheet"); link.Attributes.Add("href", "stylesheet.axd?d=" + HttpServerUtility.UrlTokenEncode(token)); head.Controls.Add(link); In the stylesheet.axd handler, we UrlTokenDecode the d query string parameter like this: var token = HttpServerUtility.UrlTokenDecode(Request.QueryString["d"]); This works most of the time but every now and then we find one of the following two exceptions in our log: [FormatException: Invalid character in a Base-64 string.] System.Convert.FromBase64CharArray(Char[] inArray, Int32 offset, Int32 length) System.Web.HttpServerUtility.UrlTokenDecode(String input) ... [FormatException: Invalid length for a Base-64 char array.] System.Convert.FromBase64CharArray(Char[] inArray, Int32 offset, Int32 length) System.Web.HttpServerUtility.UrlTokenDecode(String input) System.Web.HttpServerUtilityWrapper.UrlTokenDecode(String input) ... Any ideas what would cause this phenomenon? Remarks: the resulting URL is < 1500, so below any known URL limits (e.g. IE: 2083) seems to be independent of user agent (we have these exceptions for IE6,7,8, FF & Chrome) our (unconfirmed) suspicions include AntiVirus products, HTTP proxies, browser addons found this remotely related question, but it's about a viewstate issue

    Read the article

  • Why is function's length information of other shared lib in ELF?

    - by minastaros
    Our project (C++, Linux, gcc, PowerPC) consists of several shared libraries. When releasing a new version of the package, only those libs should change whose source code was actually affected. With "change" I mean absolute binary identity (the checksum over the file is compared. Different checksum - different version according to the policy). (I should mention that the whole project is always built at once, no matter if any code has changed or not per library). Usually this can by achieved by hiding private parts of the included Header files and not changing the public ones. However, there was a case where just a delete was added to the destructor of a class TableManager (in the TableManager.cpp file!) of library libTableManager.so, and yet the binary/checksum of library libB.so (which uses class TableManager ) has changed. TableManager.h: class TableManager { public: TableManager(); ~TableManager(); private: int* myPtr; } TableManager.cpp: TableManager::~TableManager() { doSomeCleanup(); delete myPtr; // this delete has been added } By inspecting libB.so with readelf --all libB.so, looking at the .dynsym section, it turned out that the length of all functions, even the dynamically used ones from other libraries, are stored in libB! It looks like this (length is the 668 in the 3rd column): 527: 00000000 668 FUNC GLOBAL DEFAULT UND _ZN12TableManagerD1Ev So my questions are: Why is the length of a function actually stored in the client lib? Wouldn't a start address be sufficient? Can this be suppressed somehow when compiling/linking of libB.so (kind of "stripping")? We would really like to reduce this degree of dependency...

    Read the article

  • "java.lang.ArrayIndexOutOfBoundsException" with System.arraycopy()

    - by Noona
    These few lines of code are giving me a "java.lang.ArrayIndexOutOfBoundsException" exception, could someone please take a look and point out why (the exception is caused in the second arraycopy() call): byte [] newContentBytes = EntityUtils.toByteArray((serverResponse.getEntity())); newContent = new String(newContentBytes); System.out.println( newContent); byte [] headerBytes = headers.getBytes(); byte[] res = new byte[newContentBytes.length + headerBytes.length]; //headerBytes. System.arraycopy(headerBytes, 0, res, 0, headerBytes.length); System.out.println( "length: " + newContentBytes.length); System.arraycopy(newContentBytes, 0, res, newContentBytes.length , newContentBytes.length); The problem is in allocating res size, for example if I write new byte[newContentBytes.length + headerBytes.length+ 2000] instead the exception doesn't occur, so what should the accurate size be?

    Read the article

  • JAVA image transfer problem

    - by user579098
    Hi, I have a school assignment, to send a jpg image,split it into groups of 100 bytes, corrupt it, use a CRC check to locate the errors and re-transmit until it eventually is built back into its original form. It's practically ready, however when I check out the new images, they appear with errors.. I would really appreciate if someone could look at my code below and maybe locate this logical mistake as I can't understand what the problem is because everything looks ok :S For the file with all the data needed including photos and error patterns one could download it from this link:http://rapidshare.com/#!download|932tl2|443122762|Data.zip|739 Thanks in advance, Stefan p.s dont forget to change the paths in the code for the image and error files package networks; import java.io.*; // for file reader import java.util.zip.CRC32; // CRC32 IEEE (Ethernet) public class Main { /** * Reads a whole file into an array of bytes. * @param file The file in question. * @return Array of bytes containing file data. * @throws IOException Message contains why it failed. */ public static byte[] readFileArray(File file) throws IOException { InputStream is = new FileInputStream(file); byte[] data=new byte[(int)file.length()]; is.read(data); is.close(); return data; } /** * Writes (or overwrites if exists) a file with data from an array of bytes. * @param file The file in question. * @param data Array of bytes containing the new file data. * @throws IOException Message contains why it failed. */ public static void writeFileArray(File file, byte[] data) throws IOException { OutputStream os = new FileOutputStream(file,false); os.write(data); os.close(); } /** * Converts a long value to an array of bytes. * @param data The target variable. * @return Byte array conversion of data. * @see http://www.daniweb.com/code/snippet216874.html */ public static byte[] toByta(long data) { return new byte[] { (byte)((data >> 56) & 0xff), (byte)((data >> 48) & 0xff), (byte)((data >> 40) & 0xff), (byte)((data >> 32) & 0xff), (byte)((data >> 24) & 0xff), (byte)((data >> 16) & 0xff), (byte)((data >> 8) & 0xff), (byte)((data >> 0) & 0xff), }; } /** * Converts a an array of bytes to long value. * @param data The target variable. * @return Long value conversion of data. * @see http://www.daniweb.com/code/snippet216874.html */ public static long toLong(byte[] data) { if (data == null || data.length != 8) return 0x0; return (long)( // (Below) convert to longs before shift because digits // are lost with ints beyond the 32-bit limit (long)(0xff & data[0]) << 56 | (long)(0xff & data[1]) << 48 | (long)(0xff & data[2]) << 40 | (long)(0xff & data[3]) << 32 | (long)(0xff & data[4]) << 24 | (long)(0xff & data[5]) << 16 | (long)(0xff & data[6]) << 8 | (long)(0xff & data[7]) << 0 ); } public static byte[] nextNoise(){ byte[] result=new byte[100]; // copy a frame's worth of data (or remaining data if it is less than frame length) int read=Math.min(err_data.length-err_pstn, 100); System.arraycopy(err_data, err_pstn, result, 0, read); // if read data is less than frame length, reset position and add remaining data if(read<100){ err_pstn=100-read; System.arraycopy(err_data, 0, result, read, err_pstn); }else // otherwise, increase position err_pstn+=100; // return noise segment return result; } /** * Given some original data, it is purposefully corrupted according to a * second data array (which is read from a file). In pseudocode: * corrupt = original xor corruptor * @param data The original data. * @return The new (corrupted) data. */ public static byte[] corruptData(byte[] data){ // get the next noise sequence byte[] noise = nextNoise(); // finally, xor data with noise and return result for(int i=0; i<100; i++)data[i]^=noise[i]; return data; } /** * Given an array of data, a packet is created. In pseudocode: * frame = corrupt(data) + crc(data) * @param data The original frame data. * @return The resulting frame data. */ public static byte[] buildFrame(byte[] data){ // pack = [data]+crc32([data]) byte[] hash = new byte[8]; // calculate crc32 of data and copy it to byte array CRC32 crc = new CRC32(); crc.update(data); hash=toByta(crc.getValue()); // create a byte array holding the final packet byte[] pack = new byte[data.length+hash.length]; // create the corrupted data byte[] crpt = new byte[data.length]; crpt = corruptData(data); // copy corrupted data into pack System.arraycopy(crpt, 0, pack, 0, crpt.length); // copy hash into pack System.arraycopy(hash, 0, pack, data.length, hash.length); // return pack return pack; } /** * Verifies frame contents. * @param frame The frame data (data+crc32). * @return True if frame is valid, false otherwise. */ public static boolean verifyFrame(byte[] frame){ // allocate hash and data variables byte[] hash=new byte[8]; byte[] data=new byte[frame.length-hash.length]; // read frame into hash and data variables System.arraycopy(frame, frame.length-hash.length, hash, 0, hash.length); System.arraycopy(frame, 0, data, 0, frame.length-hash.length); // get crc32 of data CRC32 crc = new CRC32(); crc.update(data); // compare crc32 of data with crc32 of frame return crc.getValue()==toLong(hash); } /** * Transfers a file through a channel in frames and reconstructs it into a new file. * @param jpg_file File name of target file to transfer. * @param err_file The channel noise file used to simulate corruption. * @param out_file The name of the newly-created file. * @throws IOException */ public static void transferFile(String jpg_file, String err_file, String out_file) throws IOException { // read file data into global variables jpg_data = readFileArray(new File(jpg_file)); err_data = readFileArray(new File(err_file)); err_pstn = 0; // variable that will hold the final (transfered) data byte[] out_data = new byte[jpg_data.length]; // holds the current frame data byte[] frame_orig = new byte[100]; byte[] frame_sent = new byte[100]; // send file in chunks (frames) of 100 bytes for(int i=0; i<Math.ceil(jpg_data.length/100); i++){ // copy jpg data into frame and init first-time switch System.arraycopy(jpg_data, i*100, frame_orig, 0, 100); boolean not_first=false; System.out.print("Packet #"+i+": "); // repeat getting same frame until frame crc matches with frame content do { if(not_first)System.out.print("F"); frame_sent=buildFrame(frame_orig); not_first=true; }while(!verifyFrame(frame_sent)); // usually, you'd constrain this by time to prevent infinite loops (in // case the channel is so wacked up it doesn't get a single packet right) // copy frame to image file System.out.println("S"); System.arraycopy(frame_sent, 0, out_data, i*100, 100); } System.out.println("\nDone."); writeFileArray(new File(out_file),out_data); } // global variables for file data and pointer public static byte[] jpg_data; public static byte[] err_data; public static int err_pstn=0; public static void main(String[] args) throws IOException { // list of jpg files String[] jpg_file={ "C:\\Users\\Stefan\\Desktop\\Data\\Images\\photo1.jpg", "C:\\Users\\Stefan\\Desktop\\Data\\Images\\photo2.jpg", "C:\\Users\\Stefan\\Desktop\\Data\\Images\\photo3.jpg", "C:\\Users\\Stefan\\Desktop\\Data\\Images\\photo4.jpg" }; // list of error patterns String[] err_file={ "C:\\Users\\Stefan\\Desktop\\Data\\Error Pattern\\Error Pattern 1.DAT", "C:\\Users\\Stefan\\Desktop\\Data\\Error Pattern\\Error Pattern 2.DAT", "C:\\Users\\Stefan\\Desktop\\Data\\Error Pattern\\Error Pattern 3.DAT", "C:\\Users\\Stefan\\Desktop\\Data\\Error Pattern\\Error Pattern 4.DAT" }; // loop through all jpg/channel combinations and run tests for(int x=0; x<jpg_file.length; x++){ for(int y=0; y<err_file.length; y++){ System.out.println("Transfering photo"+(x+1)+".jpg using Pattern "+(y+1)+"..."); transferFile(jpg_file[x],err_file[y],jpg_file[x].replace("photo","CH#"+y+"_photo")); } } } }

    Read the article

  • ArgumentOutOfRangeException when reading bytes from stream

    - by user345194
    I'm trying to read the response stream from an HttpWebResponse object. I know the length of the stream (_response.ContentLength) however I keep getting the following exception: Specified argument was out of the range of valid values. Parameter name: size While debugging, I noticed that at the time of the error, the values were as such: length = 15032 //the length of the stream as defined by _response.ContentLength bytesToRead = 7680 //the number of bytes in the stream that still need to be read bytesRead = 7680 //the number of bytes that have been read (offset) body.length = 15032 //the size of the byte[] the stream is being copied to The peculiar thing is that the bytesToRead and bytesRead variables are ALWAYS 7680, regardless of the size of the stream (contained in the length variable). Any ideas? Code: int length = (int)_response.ContentLength; byte[] body = null; if (length 0) { int bytesToRead = length; int bytesRead = 0; try { body = new byte[length]; using (Stream stream = _response.GetResponseStream()) { while (bytesToRead > 0) { // Read may return anything from 0 to length. int n = stream.Read(body, bytesRead, length); // The end of the file is reached. if (n == 0) break; bytesRead += n; bytesToRead -= n; } stream.Close(); } } catch (Exception exception) { throw; } } else { body = new byte[0]; } _responseBody = body;

    Read the article

  • Video editing: Proper length of VOB movie not identified.

    - by Roy Rico
    I copied a VOB from a camcorder disc. The content is about an hour long, but in Premiere, GOM Media Player or VLC only recognizes the clip is 12 or 3 seconds long. I tried renaming the file to MPG from VOB with no luck. Is there anything that can fix this solution? Update: Thanks for the suggestions. The VOB files in question are the specific videos I'm looking for. The files are complete copies (same size), and play in all the video players to full length. They just have a end time of 3 (or 12) seconds, so the playback slider goes to 12, and stops, and the video continues to play.

    Read the article

  • How can I truncate an NSString to a set length?

    - by nevan
    I searched, but surprisingly couldn't find an answer. I have a long NSString that I want to shorten. I want the maximum length to be around 20 characters. I read somewhere that the best solution is to use substringWithRange. Is this the best way to truncate a string? NSRange stringRange = {0,20}; NSString *myString = @"This is a string, it's a very long string, it's a very long string indeed"; NSString *shortString = [myString substringWithRange:stringRange]; It seems a little delicate (crashes if the string is shorter than the maximum length). I'm also not sure if it's Unicode-safe. Is there a better way to do it? Does anyone have a nice category for this?

    Read the article

  • How to find length of JSON using JSON.parse?

    - by Amol
    I have a Json like this {"0":{"parent_id":1649,"id":"1803","last_update_on":"2010-12-24 07:01:49","message":"dhb;lxd","created_by_id":"21","created_by_name":"Amol Deshpande"}}. So ideally i should get length as 1 considering i have only 1 value on 0th location. what if i have a JSON like this {"0":{"parent_id":1649,"id":"1803","last_update_on":"2010-12-24 07:01:49","message":"dhb;lxd","created_by_id":"21","created_by_name":"Amol Deshpande"},"1":{"parent_id":1649,"id":"1804","last_update_on":"2010-12-24 07:02:49","message":"amol","created_by_id":"21","created_by_name":"Amol Deshpande"}} I am getting the value as undefined if i do alert(response.length); where response is my JSON as mentioned above Any suggestions?

    Read the article

  • What is the length of time to send a list of 200,000 integers from a client's browser to an internet

    - by indiehacker
    Over the connections that most people in the USA have in their homes, what is the approximate length of time to send a list of 200,000 integers from a client's browser to an internet sever (say Google app engine)? Does it change much if the data is sent from an iPhone? How does the length of time increase as the size of the integer list increases (say with a list of a million integers) ? Context: I wasn't sure if I should write code to do some simple computations and sorting of such lists for the browser in javascript or for the server in python, so I wanted to explore this issue of how long it takes to send the output data from a browser to a server over the web in order to help me decide where (client's browser or app engine server) is the best place for such computations to be processed.

    Read the article

  • How do I maximize a function in Mathematica which takes in a variable length list as input?

    - by Mike
    I have a time-series like function which gives an output based on a list of real numbers(i.e. you can run the function on a list of 1,2,3,... real numbers). The issue I'm encountering is how to maximize the function for a given list length(subject to a set of constraints). I could fix the function to a fixed number of real numbers(i.e. f [x_Real, y_Real] instead of f[x_List]) and treat x and y as the first two elements of the list, and call Maximize on the function, but this is not really elegant. I want to be able to easily change the number of elements in the list. What is the best way to optimize a function like I described, which takes a list as an argument, for a fixed list length?

    Read the article

  • help me with xor encryption in c#

    - by x86shadow
    I wrote this code in c# to encrypt a text with a key : using System; using System.Linq; using System.Collections.Generic; using System.Text; namespace ENCRYPT { class XORENC { private static int Bin2Dec(string num) { int _num = 0; for (int i = 0; i < num.Length; i++) { _num += (int)Math.Pow(2, num.Length - i - 1) * int.Parse(num[i].ToString()); } return _num; } private static string Dec2Bin(int num) { if (num < 2) return num.ToString(); return Dec2Bin(num / 2) + (num % 2).ToString(); } public static string StrXor(string str, string key) { string _str = ""; string _key = ""; string _dec = ""; string _temp = ""; for (int i = 0; i < str.Length; i++) { _temp = Dec2Bin(str[i]); for (int j = 0; j < 8 - _temp.Length + 1; j++) { _temp = '0' + _temp; } _str += _temp; } for (int i = 0; i < key.Length; i++) { _temp = Dec2Bin(key[i]); for (int j = 0; j < 8 - _temp.Length + 1; j++) { _temp = '0' + _temp; } _key += _temp; } while (_key.Length < _str.Length) { _key += _key; } if (_key.Length > _str.Length) _key = _key.Substring(0, _str.Length); for (int i = 0; i < _str.Length; i++) { if (_str[i] == _key[i]) { _dec += '0'; } else { _dec += '1'; } } _str = ""; for (int i = 0; i < _dec.Length; i = i + 8) { char _chr = (char)0; _chr = (char)Bin2Dec(_dec.Substring(i, 8)); _str += _chr; } return _str; } } } the problem is that I always get error when I want to decrypt an encryted text with this code. see the example below for more info : string enc_text = ENCRYPT.XORENC("abc","a"); //enc_text = " ??" string dec_text = ENCRYPT.XORENC(enc_text,"a"); //ERROR any one can help ?

    Read the article

  • How to implement square root and exponentiation on arbitrary length numbers?

    - by tomp
    I'm working on new data type for arbitrary length numbers (only non-negative integers) and I got stuck at implementing square root and exponentiation functions (only for natural exponents). Please help. I store the arbitrary length number as a string, so all operations are made char by char. Please don't include advices to use different (existing) library or other way to store the number than string. It's meant to be a programming exercise, not a real-world application, so optimization and performance are not so necessary. If you include code in your answer, I would prefer it to be in either pseudo-code or in C++. The important thing is the algorithm, not the implementation itself. Thanks for the help.

    Read the article

  • How to count the length (number of lines) of a csv file in Rails?

    - by Mathias
    Hello, I have a form (Rails) which allows me to load a .csv file using the file_field. In the view: <% form_for(:upcsv, :html => {:multipart => true}) do |f| %> <table> <tr> <td><%= f.label("File:") %></td> <td><%= f.file_field(:filename) %></td> </tr> </table> <%= f.submit("Submit") %> <% end %> Clicking Submit redirects me to another page (create.html.erb). The file was loaded fine, and I was able to read the contents just fine in this second page. I am trying to show the number of lines in the .csv file in this second page. My controller (semi-pseudocode): class UpcsvController < ApplicationController def index end def create file = params[:upcsv][:filename] ... #params[:upcsv][:file_length] = file.length # Show number of lines in the file #params[:upcsv][:file_length] = file.size ... end end Both file.length and file.size returns '91' when my file only contains 7 lines. From the Rails documentation that I read, once the Submit button is clicked, Rails creates a temp file of the uploaded file, and the params[:upcsv][:filename] contains the contents of the temp/uploaded file and not the path to the file. And I don't know how to extract the number of lines in my original file. What is the correct way to get the number of lines in the file? My create.html.erb: <table> <tr> <td>File length:</td> <td><%= params[:upcsv][:file_length] %></td> </tr> </table> I'm really new at Rails (just started last week), so please bear with my stupid questions. Thank you!

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >