length

PHP: test line length for wrapping

How can I test if a chunk exceeds the image size and wrap that text to the next line. Not sure if I am even doing this correctly with my if statement. $text="Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem http://somelongurl.com/then-we-make-it-super-long-with-some-more/ Lorem Ipsum Lorem Ipsum Lorem Ipsum"; $string_chunks = explode(' ', $te...

What should be the standard PHP code file lenth in LOC ?

I do PHP coding a lot in my company and personal work. Usually my files get bigger, sometimes more than 2000-3000 lines long. Then, they get difficult to manage. My Question: What should be (is) the standard length of a PHP code file in terms of lines-of-code. At what length do you guys split it up? Note: No Object Oriented programming...

Set minimum and exact length in bytes of column values in SQL Server

How can one set the column value length to a minimum and/or exact length using MS SQL Management Studio? ...

Mac web sharing: default directory listing name length

I'm sharing a folder over the web using Mac's Web Sharing. Some file names are long and they are concatenated. How do I change the default directory name listing length on a Mac? ...

What is the maximum length of a Windows XP drive label?

Hi, Question is pretty much self-explanatory. I'm working with naming USB drives if that matters. Thanks. ...

PHP shortest/longest string in array

I have an array like this $data = array( "163", "630", "43", "924", "4", "54" ); How can I select the smallest and largest values from it according to string length NOT number value. (for this example it is 1 (smallest) and 3 (largest). ...

list(y) behavior is "wrong" on first call

I have an iterator with a __len__ method defined. Questions: If you call list(y) and y has a __len__ method defined, then __len__ is called.    1) Why? In my output, you will see that the len(list(y)) is 0 on the first try. If you look at the list output, you will see that on the first call, I receive an empty list, and on the seco...

Set Toast Appear Length

Is there anyway I can tell a Toast Notification to show up only for a specified amount of time. Generally shorter then a regular toast message. ...

Python: Sum string lengths

Is there a more idiomatic way to sum strings in Python than by using a loop? length = 0 for string in strings: length += len(string) I tried sum(), but it only works for integers: >>> sum('abc', 'de') Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: sum() can't sum strings [use ''.join(seq) inst...

MSSQL: LENGTH() inside of REPLICATE()

Hello everyone I have a MSSQL table with the columns "Lvl" and "Title". I need to insert a "-" in front of the title for every character in the Lvl field. As an example: If Lvl = 111 the title shoud become "--- My Title". I can only edit the following SQL-String. There is no possibility to create other functions or likewise. SELECT ...

jQuery count that includes all chars including ENTER, etc?

I know that usually you want to strip these out, but I need the true char count and I can't find out how to get it... Thanks for the help ...

Finding length of items from a list

Hi everyone, I have two list in a python list1=['12aa','2a','c2'] list2=['2ac','c2a','1ac'] First- Finding combinations of each two item from list1. Second- Finding combinations of each two item from list2. Third- Finding combinations of each two items from list1 and list2 Fourth- Calculating each combinations total length Advic...

PHP - sort hash array by key length

I've found a few answers to sorting by value, but not key. What I'd like to do is a reverse sort, so with: $nametocode['reallylongname']='12'; $nametocode['shortname']='10'; $nametocode['mediumname']='11'; I'd like them to be in this order reallylongname mediumname shortname mediumname shortname Many thanks ...

how to get length of integers in PHP ?

hello everyone, I want to get the length of integer values for validation in PHP. Example: Mobile numbers should be only 10 integer values. It should not be more than 10 or less than 10 and also it should not be included of alphabetic characters. How can i validate this. Sorry for my poor English. Thanks In Advance ...

Java 2D Arrays Question

If I have a 2D array, arr[][], and let say I do this: arr[0]=10; What does this do? I only assigned 10 in the first dimension, but I didnt mention the second dimension. What happens in this case? Edit: Ok what about this: public static int[][] mystery(int[][] srcA, int[][] srcB) { 2 int width= srcA.length, height = srcA[0].length;...

how to filter Excel data, by text length?

Hi. In Excel 2007 , i want to filter rows by one of my columns text length, eg. hide the rows with text lengths less or greater than 12 characters. what should i do? Thanks. ...

jquery, IE7 and iteration

I have an array of classes and IDs and am trying to iterate through and append to those elements. The code below works in all browsers apart from IE7 and below. IE7 and below throw an exception telling me that 'length' is null or undefined. Been wrestling with it for a while now. Any ideas? Code is here: http://gist.github.com/651456 ...