length

What is the maximum length of an array in .NET on 64-bit Windows

I heard from someone that the maximum array size in .NET is 4 GB? Just wondering if that is true. You wouldn't dream of doing this on 32-bit .NET but on a 64-bit system with 12 GB of RAM, maybe, just maybe you might want to do this. :-) ...

Why JPA, Hibernate and jTDS always uses varchar(8000) for String columns?

I'm using JPA (Hibernate) and jTDS as my jdbc driver. Whenever the datatype of my entity columns are String, the created prepared statement uses varchar(8000) as its parameter. I've already tried to use @Column(length=50) in my mappings for example, but it seems to be ignored. If I set sendStringParametersAsUnicode in jTDS connection, i...

Maximum value of long number?

I'm trying to declare a long value in Java, which unfortunately does not work. This is my code. It results in the following error message: "The literal 4294967296 of type int is out of range". long bytes = 4294967296; I need this value to make a file filter that filters out files that are bigger than 4294967296 bytes (4GB). The other...

How long can a webpage be?

Bit of a bizarre question, but does anyone know the actual limit to the length of a webpage, and why it is the limit? As an experiment, I'm using HTML and CSS to make a site that represents a journey to a scale of 1:1. I have a ul list of markers along the way that I have separated with large margins in the css. However, the longest mar...

Calculating pixel length of an image

Hello, May I know what are the ways to calculate the length of 1 pixel in centimeters? The images that I have are 640x480. I would like to compare 2 pixels at different places on the image and find the difference in distance. Thus I would need to find out what's the length of the pixel in centimeters. Thank you. ...

Array length with pointers

How in C++ get array length with pointers only ? I know that tab name is pointer to first element, but what next ? ...

Run length encoding

What is the best we can do with run length encoding. http://en.wikipedia.org/wiki/Run-length_encoding Page suggests the time complexity is O(m*n) where m is the number of time the number repeats .. Is the a more efficient algorithm to do RLE ?? ...

dot length in java - finding its definition

In which class is the length field defined in Java (e.g. for array length)? Will I be able to see it defined say in Object class? EDIT : Why was this field so designed(any thing related with security or memory efficiency)? ...

Should Javascript's "for in" construct iterate the length property?

I'm making a bookmarklet, but I've encountered some wierd behaviour in IE8. The code causing the problem is this: var els = document.getElementById("my_id").getElementsByTagName("*"); for(var i in els) { alert(i+","+els[i]) } The first thing that is alerted is "length, n". This isn't the case in chrome: just in IE8. Interestingly...

Javascript array length incorrect on array of objects

Could someone explain this (strange) behavior? Why is the length in the first example 3 and not 2, and most importantly, why is the length in the second example 0? As long as the keys are numerical, length works. When they are not, length is 0. How can I get the correct length from the second example? Thank you. a = []; a["1"] = {"strin...

Chaining functions in jQuery. I cannot find an explanation anywhere.

Hello there, I have no idea how to do this. My markup: <table> <tr> <td id="colLeft"> Lorem ipsum dolor<br/> Lorem ipsum dolor<br/> Lorem ipsum dolor<br/> Lorem ipsum dolor<br/> Lorem ipsum dolor<br/> Lorem ipsum dolor. </td> <td id="co...

JavaScript: count minimal length of characters in text, ignoring special codes inside

I want to ignore counting the length of characters in the text if there are special codes inside in textarea. I mean not to count the special codes characters in the text. I use special codes to define inputing smileys in the text. I want to count only the length of the text ignoring special code. Here is my approximate code I tried to ...

Counting string length in javascript and Ruby on Rails

I've got a text area on a web site that should be limited in length. I'm allowing users to enter 255 characters, and am enforcing that limit with a Rails validation: validates_length_of :body, :maximum => 255 At the same time, I added a javascript char counter like you see on Twitter, to give feedback to the user on how many characte...

Python Expand Tabs Length Calculation

I'm confused by how the length of a string is calculated when expandtabs is used. I thought expandtabs replaces tabs with the appropriate number of spaces (with the default number of spaces per tab being 8). However, when I ran the commands using strings of varying lengths and varying numbers of tabs, the length calculation was different...

is there a length limit on g++ variable names?

see title and some filler text to deal with the requirement of minimum body text i hope you're happy now arbitrary limits ...

Javascript field value lenght

Hi guys, I'm doing something like this: alert(document.getElementById('cardNumber').value); And it alerts cardNumber value. But I need in it's lenght: alert(document.getElementById('cardNumber').value.lenght); undefined Why? ...

jquery - check length of input field?

The code below is intended to enable the submit button once the user clicks in the textarea field. It works, but I'm trying to also make it so that it's only enabled if there's at least one character in the field. I tried wrapping it in: if($(this).val().length > 1) { } But, that didn't seem to work... Any ideas? $("#fbss").f...

How to use length indicator in a C++ program

I want to make a program in C++ that reads a file where each field will have a number before it that indicates how long it is. The problem is I read every record in object of a class; how do I make the attributes of the class dynamic? For example if the field is "john" it will read it in a 4 char array. I don't want to make an array o...

what is the wrong with this code"length indicator implementation" ?

Hello, this is an implementation of length indicator field but it hang and i think stuck at a loop and don't show any thing. // readx22.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "iostream" #include "fstream" #include "stdio.h" using namespace std; class Student { public: string id; ...

Capturing the length scrolled up or down silverlight

I have a Usercontrol which has small image. Clicking on the image gives a popup. When the page is little bit scrolled up or down and then clicked on the image The position of popup is changed. Can I find the length of scroll so that i will be able to add or subtract it from popup's position? ...