length

java creating byte array whose size is represented by a long

Hi all, I'm trying to create a byte array whose size is of type long. For example, think of it as: long x = _________; byte[] b = new byte[x]; Apparently you can only specify an int for the size of a byte array. Before anyone asks why I would need a byte array so large, I'll say I need to encapsulate data of message formats that I ...

Browser limitation with maximum Page length

We are managing html contents from datasource and directly write on the web pages using asp.net C#. Here we are facing the problem : On the page complete contents are not displaying but while we check the Page source and copy/paste it into a static html page all contents will be displayed. Is there any limitation of browser related to ...

String length between pointers

Hi, I ran into a little problem and need some help: If I have an allocated buffer of chars and I have a start and end points that are somewhere inside this buffer and I want the length between these two point, how can I find it? i.e char * buf; //malloc of 100 chars char * start; // some point in buff char * end; // some point after s...

iPhone Text Field

Hello, I have run into an issue that I have yet to be able to solve. Hopefully someone can help. I have an app that I am using to do simple calculations, some of the results are larger than the UItextField. Does anyone know how to limit the output to say 10 characters like say a calculator would using exponents. This is the code I am...

How long should functions/methods should be in average?

Hi there... We've all read excessively long methods or functions, where your eyes end up bleeding when you reach the return statement. We've also seen those one-liner functions that seem pointless... I just wanted to ask: which do you think is the best average length for a function/method? Having into account that every language has it...

MPMoviePlayerController movie length

Hi everyone, The question is - how to get the movie length from MPMoviePlayerController object? I need this to create a progress bar. I have the method [myPlayer currentTime] to move progress bar while movie is playing. And the [myPlayer setCurrentTime: doubleVal] to rewind the movie. But I can't use all this without information about ...

How to count the number of characters in a file once the starting point has been figured out?

I want to count the number of characters after I have figured out the starting point. __DATA__ 1-thisthestartingpoint COUNTTHENUMBEROFCHARACTERSPRESENTINTHISLINEBEFORETHENEXTSTARTINGPOINT COUNTTHENUMBEROFCHARACTERSPRESENTINTHISLINEBEFORETHENEXTSTARTINGPOINT COUNTTHENUMBEROFCHARACTERSPRESENTINTHISLINEBEFORETHENEXTSTARTINGPOINT 2-nextsta...

What size to pick for a (n)varchar column?

In a slightly heated discussion on TDWTF a question arose about the size of varchar columns in a DB. For example, take a field that contains the name of a person (just name, no surname). It's quite easy to see that it will not be very long. Most people have names with less than 10 characters, and few are those above 20. If you would mak...

Latex command line line length

When running latex, the command-line output it cut after 80 characters: LaTeX Warning: Reference `fig:assign-by-x' on page 76 undefined on input line 2 41. Any idea how I can stop this? Version is: pdfTeX using libpoppler 3.141592-1.40.3-2.2 (Web2C 7.5.6) kpathsea version 3.5.6 on Ubuntu Linux 9.04, bash shell. ...

Longest pathname string in Mac OS X HFS+

I'm trying to find a definitive answer (e.g. Apple developer documentation) for the maximum length of a complete path string on Mac OS X. I've seen various non-authoritative sites that state that it is unbounded, 4096 characters, or 1024 characters, but haven't been able to find an answer on Apple's web site. ...

How long should SQL email fields be?

Hi I recognize that an email address can basically be indefinitely long so any size I impose on my varchar email address field is going to be arbitrary. However, I was wondering what the "standard" is? How long do you guys make it? (same question for Name field...) Thanks, Mala update: Apparently the max length for an email address is...

Way to get number of digits in an int?

Is there a neater way for getting the length of an int as this? int length = String.valueOf(1000).length(); ...

jQuery vs. prototypeJS; size children

I currently work on a magento webshop, which loads PrototypeJS as framework. However i need jQuery at some point to do some custom stuff. jQuery is loaded after prototype and runs in noConflict mode. Now, here's my demo HTML: <div id="someID"> <div>child</div> <div>child</div> <div>child</div> </div> An external JS file is loaded a...

Rijndael Decryption error - Length of the data to decrypt is invalid

I am able to encrypt a zip file using rijndeal but when i decrypt I get an error that says "Length of the data to decrypt is invalid" Im getting the byte array to decrypt from a file. Here is how i get the byte array. Dim FStream As FileStream = File.OpenRead("<Filepath>") EncData = New Byte(FStream.Length) {} FStream.Read(EncData, 0, ...

Sizeof in C++ and how to calculate pointer length?

Can someone explain the following code snippet for me? // Bind base object so we can compute offsets // currently only implemented for indexes. template<class DataObj> void BindAsBase(DataObj &rowbuf) { // Attempting to assign working_type first guarantees exception safety. working_type = DTL_TYPEID_NAME (rowbuf); working_ad...

How to efficiently get rest of a Tcl list starting from an index?

I would like to get all elements following a particular index of a list. This could be written as: set foo {0 1 2 3 4 5 6 <...> n} puts [lrange $foo 1 [llength $foo]] However, it seems like a waste to compute the length of the list. It would be nice if the last argument to lrange was optional and omitting it meant to continue until ...

Using PHP filter functions like filter_var_array() is there a way to check if length of an input string is less than some value

I have been toying with PHP filter library. I liked it but I am unable to perform a simple filter function. I essentially want to invalidate those values in my input array that are strings and which are longer than certain value. Is there a way to do this like, $data = array('input_string_array' => array('aaa', 'abaa', 'abaca')); $args...

Length of an Array in Objective C

I haven't found answer in any of the questions asked. I am passing an Integer Array to a function.Now I want to traverse through the array.But as things worked in C,C++ by simple using arrayname.length which gave the number of elements in array. What is the way to find that? [NSArrayObject length] works for NSArray type but I want it for...

United States Banking Institution Account Number Regular Expression?

I have been tasked to "verify" the length of a U.S. Banking Institution ACCOUNT NUMBER for a web app I'm developing. I cannot find anything through SOF, Google, Fed reserve etc that outlines an account number standard length that we have in the United States. For the record I believe this is futile. If someone could point me to any offi...

How to find the length of an LPCSTR

I'm trying to convert an LPCSTR to an integer using atoi(), and to verify that the conversion occurred successfully I want to count the number of digits in the integer it produced and the original LPCSTR (it should contain nothing but integers) I'm having a hard time finding a good way to calculate the length of the LPCSTR. So far the ...