empty

XamlReader.Parse throws exception on empty String

In our app, we need to save properties of objects to the same database table regardless of the type of object, in the form of propertyName, propertyValue, propertyType. We decided to use XamlWriter to save all of the given object's properties. We then use XamlReader to load up the XAML that was created, and turn it back into the value ...

Django DecimalField returns "None" instead of empty value

Is there a way to force django to display nothing instead of "None" for a Decimal Field that's been left blank? In my template, I show a list of all the values for a particular field. Each value is hyperlinked to a page that displays the results of a query filtered on that value. But because there are some entries with null value, m...

Jquery validations on form with no fields

I have a table (in a form) populated with radio buttons (with a button for each value in a collection). If the collection is empty, nothing shows up in the table (which is fine). (I'm using Struts2) My trouble comes when validating that the user has selected one of these radio buttons when the submit button is clicked. I'm using JQUE...

How to detect if a node contains significant information?

I need to find out how to detect if a node contains significant information. The following example shows what is not considered "significant" information by me: <node> <node1>&nbsp;</node1> </br></br> &nbsp; <node1> &nbsp; <node2></br>&nbsp;</node2> </br></br> </node1> <!-- and so on...

How can I filter using the current value of a text box in a jQuery selector?

I have a validation script that checks for data-* attributes to determine which fields are required. If an element has the 'data-required-if' attribute (which has a jQuery selector as it's value), it checks to see if any elements are found that match that selector. If any are found, the field is required. It does something similar to the...

PDO empy result from SELECT when using AND

Hello, I've come upon a rather interesting thing, which I can't seem to figure out myself. Everytime when executing a SQL statement which contains a '... AND ...' the result is empty. Example: echo('I have a user: ' . $email . $wachtwoord . '<br>'); $dbh = new PDO($dsn, $user, $password); $sql = 'SELECT * FROM user WHERE email = :em...

Apache redirect when users home directory is completely empty.

I work for an ISP and I have a server with thousands of users 10MB of free storage. They get this free storage with every e-mail account they have with us. An example of a users storage address: http://users.example.com/~username/ One problem I can see is scanning the server for user names to see what accounts are available, basically g...

Is it possible to create a git a new, empty remote branch without pushing?

Most examples of creating remote branches involve pushing from a local branch Is there a way of creating an empty remote branch without pushing? Is it also possible to create a local empty branch,check it out then link it to the new also empty remote branch without pushing? ...

Is there a better way to declare an empty, typed matrix in MATLAB?

Is there a way to "declare" a variable with a particular user-defined type in MATLAB? zeros() only works for built-in numeric types. The only solution I've come up with involves using repmat() to duplicate a dummy object zero times: arr = repmat(myClass(), [1 0]) Without declaring variables this way, any code which does "arr(end+1) = ...

NSIS Check Textbox empty not working

I'm trying to display a page in NSIS to obtain two different values. I want both to be not empty. The page actually displays altough I can't get my page leave function to check properly for empty fields. Function CCInstallOpts ReserveFile "cc_installopt.ini" !insertmacro MUI_INSTALLOPTIONS_EXTRACT "cc_installopt.ini" !insertmacro ...

ASP.NET Chart control with empty data

Hi everyone, I'm using an ASP.NET Chart control, and it takes the data from a database. Sometimes, this data is empty, and I can't find any way to show some text or similar instead of a blank screen. There is no attribute that allows me to do that. Besides, I think that because of the empty data, I get an exception every time I try to...

Replace empty cells with logical 0's before cell2mat in MATLAB

I've got a cell array of empty cells and ones that I want to convert to a logical array, where the empty cells are zeros. When I use cell2mat, the empty cells are ignored, and I end up with a matrix of solely 1's, with no reference to the previous index they held. Is there a way to perform this operation without using loops? Example cod...

How do I get the last non-empty line of a file using tail in Bash?

How do I get the last non-empty line using tail under Bash shell? For example, my_file.txt looks like this: hello hola bonjour (empty line) (empty line) Obviously, if I do tail -n 1 my_file.txt I will get an empty line. In my case I want to get bonjour. How do I do that? ...

Using php's magic function inside another function does not work

I want to use magic function __set() and __get() for storing SQL data inside a php5 class and I get some strange issue using them inside a function: Works: if (!isset($this->sPrimaryKey) || !isset($this->sTable)) return false; $id = $this->{$this->sPrimaryKey}; if (empty($id)) return false; echo 'yaay!'; Does not work: if (!isset(...

AutoCompleteTextView not displaying result even when the ArrayAdapter is updated

I'm trying to get an AutoCompleteTextView(ACTV) to display results I'm a getting from a network resource. I have set the completion-treshold to 2 and I can see that the request is fired when I enter to characters. The result I am getting is the correct one. Lets say I write "ca", and I get the result "car" as an autocompletion. I have a...

Select fields containing at least one non-space alphanumeric character

(Sorry I know this is an old chestnut; I have found similar answers here but not an exact answer) I frequently hand type this kind of query from a console so I am always looking for easier to type solutions SELECT * FROM tbl_loyalty_card WHERE CUSTOMER_ID REGEXP "[0-9A-Z]"; -- exact but tedious to type or SELECT * FROM tbl_l...

Check if an object is defined in html

In HTML, I have an object tag as follows: <OBJECT ID="objectid" CLASSID="some-class-id" CODEBASE="some-codebase"> I have written a function in JavaScript to access this object. I checked the null value as follows: if(objectid==null){-----} i want to check if the object is undefined or is empty. Do we have any functions to check s...

XSL check param length and make a choice

I need to check if a param has got a value in it and if it has then do this line otherwise do this line. I've got it working whereas I don't get errors but it's not taking the right branch The branch that is wrong is in the volunteer_role template <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="htt...

Enumerable.Empty<T>() equivalent for IQueryable

When a method returns IEnumerable<T> and I do not have anything to return, we can use Enumerable.Empty<T>(). Is there an equivalent to the above for a method returning IQueryable<T> ...

Varchar2 and Oracle quick question

Hi guys I'm using varchar2 for a product name field, but when I query the database from the run SQL command line it shows too many empty spaces, how can I fix this without changing the datatype here is the link to the ss http://img203.imageshack.us/img203/20/varchar.jpg ...