values

Checks nulls using LINQ

Hi all, I have this code. How can I check null values for SingleOrDefault method ?? public static List<ETY.Rol> GetRolesByApplicationAndCompany(this UsuarioContext usuario, int company, int app) { List<ETY.Company> lCompanies= usuario.Companies; var roles = lCompanies. SingleOrDefault(e ...

List of countries in a combobox

I want to populate the contents of a combobox with country names/flags reading from a database table. I want the first item to represent no selection. (The user may not know the country info during first insert) Should I include an item for this in db. Or should I add an item representing the no-select to the array in the code. Which app...

Equivalent in Java of EnumMap for use with enum type values?

I'm looking for a class like EnumMap, except for enum type values (ie. EnumValueMap<K,V extends Enum<V>>). http://java.sun.com/javase/6/docs/api/java/util/EnumMap.html Edit If I was mapping, say, a few million Objects to 10 enum types, I imagined it would at least be possible to create a more memory-efficient implementation than just ...

paasing values between wx.frame wxpython

I have one frame where one TextCtrl and a button. I would like to enter a value in that TextCTrl and to be displayed in another frame TextCTrl and use that value for computation in that new frame as well. Any idea would be appreciated. ...

Django: list_filter and foreign key fields

Django doesn't support getting foreign key values from list_display or list_filter (e.g foo__bar). I know you can create a module method as a workaround for list_display, but how would I go about to do the same for list_filter? Thanks. ...

if($ext == ('zip' || 'png')) { echo "Is it possible ?" }

Hi all :) I'm currently writing sort of a download manager and I was asking myself if that was possible: if($ext == ('zip' || 'png')) { echo "Is it possible ?" } It returns true everytime, so I guess it's not possible. But do you have an idea about how I could easily do this ? I mean, not with plenty of "if" or "switch"... Thanks an...

Remove null values from javascript array

Hi, I am having a javascript array. addresses = new Array(document.client.cli_Build.value, document.client.cli_Address.value, document.client.cli_City.value, document.client.cli_State.value, document.client.cli_Postcode.value, document.client.cli_Country.value); document.client.cli_PostalAddress.value = address...

How to retain values of form fields after a page loads?

Is there a way to retain values of textfield/textbox when a user submits a form? i only want to retain values with errors or values I specify. For example i am posting to 10 blogs and 1-9 gets posted succesfully so I only want to retain the value from 10 when a page load after form submission. Can I do that? how? ...

Storing multiple values in a single cell in MySQL

I'm storing multiple numbers in a MySQL cell by using a delimiter (eg "1,5,10") and the TEXT datatype. How do I perform lookups like this? SELECT * FROM MyTable WHERE MultiVals CONTAINS "5" And lastly, is this the preferred approach to store such values? I'm using this like a linker table, to link certain rows to multiple other rows ...

T4 template mandatory config values

i am planning to use T4 template to generate the config files. i have a main.tt file with basic settings. there are different .tt file for each environment which include the main.tt one thing which i want to achieve is how do i make sure that each environment specific .tt files override the main.tt variables. i need to do this since i wa...

Count and group non-empty values in MySQL

I need to count the non-empty (by which I mean a string containing at least 1 character) rows grouped by a particular ID. Eg. my data might look like this: form_id mapping 1 'value_1' 1 '' 1 'value_2' 2 '' 2 NULL 3 'value_3' and I want to count the non-empty values for each form, so I ...

How can I save form input to a database, I'm having trouble sending the values to my controller.

Here's my RegisterController: public function saveforminformationAction(){ $request = $this->getRequest(); if($request->isPost()){ //I NEED HELP WITH THE getFormValues() METHOD. $formResults = $this->getFormValues(); $db = $this->_getParam('db'); $data = array( ...

Maximum values in wherein clause of mysql

Hi friends, Do anyone knows about how many values I can give in a where in clause? I get 25000 values in a where in clause and mysql is unable to execute. Any thoughts? Awaiting for your thoughts ...

PHP MYSQL Add up number of entries in single table and display in HTML

I have a table called activities which contains a number of activities for projects (for example 6 activities are related to one project). On projects page, you can see the projects, and I have one column which needs to display the number of activities associated with the project. So basically, I need a query or PHP calculation that can...

Pass value from another page to MainPage.xaml in Silverlight when using Navigation?

I have a Page in Silverlight which is Navigated from the MainPage.xaml, called OpenPage.xaml, I then want to pass a value back to the MainPage.xaml - this OpenPage.xaml is called using this: NavigationService.Navigate(new Uri("/OpenPage.xaml", UriKind.Relative)); From the mainpage - this is not a child of the MainPage as the RootVisua...

PHP form values after POST in dropdown

I have a form with 'selected' values pulled from the database. Now I want the user to edit the values. When the data is send I want to show the new values. When I submit my form I always get the 'green' value? What am I doing wrong here? <?php // pulled from db $color = "blue"; // update if (isset($_POST['Submit'])) { echo "write ...

XStream parse attributes and values at the same time

Hi, I have the following XML <search ver="3.0"> <loc id="ARBA0009" type="1">Buenos Aires, Argentina</loc> <loc id="BRXX1283" type="1">Buenos Aires, Brazil</loc> <loc id="ARDF0127" type="1">Aeroparque Buenos Aires, Argentina</loc> <loc id="MXJO0669" type="1">Concepcion De Buenos Aires, Mexico</loc> <loc id="MXPA1785" ...

jquery dynamic select doesn't submit values

EDIT AGAIN ... I'm just a dummy and figured it out! EDIT: So, it looks like if I highlight everything in the target select box and click "Add selected", it submits... How do I correct that behavior in the code below so that you don't have to click the "Add selected" button to get it to work? I have a form that includes three select box...

Ajaxrequest with Wicket but multiple possilbe model values

Hi, I'm new to wicket and stuck with the following problem: I have a table with 5 rows. Each row contains 7 cells. Each cell has a unique value. Once a cell is clicked, its unqiue value should be posted to the server. I would like to register only one ajaxfallbacklink (or similar) on the table and adjust the value of the model to the u...

passing values between 2 different c++ files in same project

noob question right here. How do you pass values between 2 different cpp files in the same project? Do you make objects? if yes, how does the other cpp file see it? some enlightment pls.. EDIT: some clarifications. I'm trying to interface direct input with a program (of which I have the plugins sdk). I'm trying to interface a joystick w...