w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
JasperReports: "Invalid field mapping" / "line 1:1: unexpected token: [Measures]" error XML-A datasource (Olap)
try: SELECT NON EMPTY ({ [Measures].[Full price] , [Measures].[Promo price] }) ON COLUMNS, NON EMPTY ({ [Items].[Items Hierarchy].[Repo].Members , [Items].[Items Hierarchy].[Family].Members }) ON ROWS FROM [MY CUBE]

Categories : Java

Count length of one input field and print it in another with Gravity Forms and Javascript
Add an eventListener to the first input. In this case, whenever the user presses and releases a key, the length of the input will be displayed in the second input. <form> <input name="input_10" id="input_1_10" type="text" value="" class="small" tabindex="1"> <input name="input_2" id="input_1_2" type="text" value="" class="medium" tabindex="2"> </form> <script> var bank = document.getElementById("input_1_10"); var countNum = document.getElementById("input_1_2"); bank.addEventListener("keyup", function(e) { countNum.value = bank.value.length; }); </script>

Categories : Javascript

Merge validation summary in single line(All required validation in single line,All invalid field validation in single line etc)
You could try @Html.ValidationSummary().ToString().Replace(" ", "").Replace(" ", "").Replace(" ", "") I'm not sure how validationsummary spits out its linebreaks, however, so you can probably find out and cut that down.

Categories : Asp Net Mvc

In-Field Labels Don't Line Up With Input Text
I fixed the issue by tweaking one of the CSS rules: input[type='text'], label { padding: 5px; margin: 0; font-size: 1em; line-height: 30px; height: 30px; color: #fff; display: block; } The trick is to set the container height to be the same as the line-height. You can see the effect at: http://jsfiddle.net/audetwebdesign/d8Apy/7/ Why this works??? My guess is that browsers compute the height of the anonymous line boxes differently between input and label elements. At least in FireFox, setting the line-height seems to do the trick. I don't recall ever reading anything in the CSS3 spec related to these details. Note - Cross-Browser Effects I tested this in a few browsers and I discovered that if you set both height and line-height and use box-sizing, you

Categories : CSS

How do I create a single line text input field for OSX?
This is from Eclipse SWT, should be easy to translate from Java to Objective C: NSTextField widget = new NSTextField ().alloc (); widget.init (); NSCell cell = widget.cell(); cell.setWraps(false); cell.setScrollable(true);

Categories : Osx

Jquery. Script changes value in input field. Than based on value in the input field need to execute if statement
you are adding your if condition separately, you need to add it inside your change event, like: $(".exchange_rate_changed_test1").on("change", function () { $('#is_exchange_rate_changed_test1').val(1).change(); if ($("#is_exchange_rate_changed_test1").val() > 0) { alert("Test"); } });

Categories : Javascript

HTML5/JS/jQuery: On invalid input, mark a different (arbitrary) element as invalid
Try the below code. You are getting that error because jQuery returns an array of selected objects and since setCustomValidity is supported by native input elements and not jquery objects, you are seeing that error. $('#newpassword1, #newpassword2').each(function() { this.setCustomValidity(errorMessage) });

Categories : Javascript

Can't get access of phpmyadmin from command line
Just wondering if you are confusing phpMyAdmin with MySQL? phpMyAdmin is just a web based interface to MySQL. If the database isn't visible in phpMyAdmin it probably isn't created. You can either create the database in phpMyAdmin or at a MySQL prompt. Once the database is created have another look at this page in the tutorial http://framework.zend.com/manual/2.0/en/user-guide/database-and-models.html it has the sql scripts you can run in either phpMyAdmin or a MySQL prompt to create the tables. Once the database and tables are created edit config/autoload/global.php and config/autoload/local.php (again instructions included in the tutorial link above) B.T.W. to access the MySQL prompt with MAMP type the following in your terminal; /Applications/MAMP/Library/bin/mysql --host=loca

Categories : PHP

Mysql inserts blank field from php script, but not in phpmyadmin?
firs thing first $_POST('name'); is nothing $_POST['name']; is right. Now answer to your question use following query. $sql = "INSERT INTO `Prototype`.`Version` (`version_name`, `version_status`, `created_date`, `created_by`) VALUES ('A', 'A', CURRENT_TIMESTAMP, NULL)"; I have also checked it on my own table made from structure provided by you. it's query is given below. CREATE TABLE `proto` (  `version_id` int(3) NOT NULL AUTO_INCREMENT,  `version_name` varchar(45) NOT NULL,  `version_status` varchar(45) NOT NULL,  `created_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,  `created_by` varchar(45) DEFAULT NULL,  PRIMARY KEY (`version_id`)) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 Below code is for you to submit it via php. $options = ar

Categories : PHP

How to stream input line by line in UNIX, perform commands on each line, and immediately return output?
You can use echo "${#line}" to know the length of a string. Reading the file with a while read... will do the rest: $ cat file hello my name is fedor qui $ while read line; do echo "${#line}"; done < file 5 7 8 3 0 In a nicer format: while read line do echo "${#line}" done < file

Categories : Shell

mysql phpmyadmin User Input COMPARE database
I would use a different approach and do the search in your SQL-query. SQL is better (and performs better) on that kind of searches. You won't need a while loop for this query: SELECT * FROM users WHERE username = '<input username here>' OR email = '<input email here>' If you get a result, it means that either the username or the e-mailaddress is already registered. Use an if-statement to check whether or not it's the username or the e-mailaddress. Please, don't use mysql_* functions in new code. They are no longer maintained and are officially deprecated. See the red box? Learn about prepared statements instead, and use PDO or MySQLi - this article will help you decide which. If you choose PDO, here is a good tutorial. EDIT: The full PHP-code would be something like

Categories : PHP

ACCESS DENIED to mysql DB with PHP but can login with phpmyadmin and on the command line
The user you're going to use with your scripting should have both the "@localhost" and "'@%'" - Have a peek at the man. http://dev.mysql.com/doc/refman/5.1/en/adding-users.html This gave me a headache once.

Categories : PHP

deleting line from a file if one of the id in the line is invalid
This is a crude code which will write lines with only valid ids to a new file: f_write = open('results.txt', 'wb') with open('list.txt','r') as f : for line in f : #delete the whole line if any invalid gerrit is presnet gerrit_list = line.strip().split(' ') ifvalid = True for gerrit in gerrit_list: try: # check if invalid gerrit is present invalid_gerrit.index(gerrit) ifvalid = False break except: pass if ifvalid: f_write.write(line) f_write.close()

Categories : Python

linq count error: DbExpressionBinding requires an input expression with a collection ResultType. Parameter name: input
you should use 'by new' after 'group'. I hope this will help you. var entries = from entry in _db.Entries group entry by new { entry.Name } into groupedByName select new { groupedByName.Key.Name, NumberOfComments = groupedByName.Count(x => x.Name != null) };

Categories : Linq

setting date range of one field depending on input of another field jquery datepicker
Working JS FIDDLE you need to pass in selectedDate to your event handler, and then convert it to a date object, and then add the 4 days and the seven days. also, your better off using the custom event handlers built specifically for the datepicker to handle events for it, onClose rather than a default one you'll have to build out code for. here is the code from the fiddle: $('#apply').datepicker({ showOtherMonths: true, selectOtherMonths: true, minDate: 0, maxDate: "2m", onSelect: function(selectedDate){ console.log(selectedDate); $('#last').prop('disabled', false); $('#last').datepicker({ minDate: (function(){ var min = new Date(selectedDate); var newmin = new Date(); newmin.setD

Categories : Jquery

"Column invalid..." using COUNT function in SQL Server
Include UserActivity.userFK in the group by clause, because you don't use this column in an aggregate function : SELECT UserActivity.userFK, COUNT(*) AS ctActions FROM UserActivity WHERE [action] = 'login' GROUP BY UserActivity.userFK

Categories : SQL

how do you make a text input field open different links based on user input
Pseudocode: function parmatch(input): if input matches /^bbb$/ open 'http://example1.com/{input}' return if input matches /zzz/ open 'http://example2.com/something-predefined{input}' return if input matches /xxx/ open 'http://example3.com/something-predefined{input}' return MDN's article on regular expressions in JavaScript

Categories : Javascript

loop into input array field and change input fields using jquery
Try this: var all_inputs = $("input[name^=Item\[fields\]]"); for (i = 0; i < all_inputs.length; i++) { if (i % 3 == '0') { var val = all_inputs.eq(i).val(); //get the new value for each group of 3 } all_inputs.eq(i).val(val); //assign the value to inputs in this group of 3 } Demo here

Categories : Jquery

Hide input field and make them 3 separate input fields with jQuery and put the value in the one
Try this $(document).ready(function(e){ $('#profiel_rekeningnummer').parent().append('<input name="field1" id="field1" class="field"/><input name="field2" id="field2" class="field"/><input name="field3" id="field3" class="field"/>'); $('.field').blur(function(e){ $('#profiel_rekeningnummer').val($('#field1').val()+$('#field2').val()+$('#field3').val()); alert($('#profiel_rekeningnummer').val()); }); }); EXAMPLE

Categories : Jquery

How to read the input(line by line) from a multiline Tkinter Textbox in Python?
From the document, the get method on tkinter.text will just return the string, including the new line . You can not treat the tkinter.text as file, but you can use other ways. Read them all and split them into a list. Loop the list then. def retrieve_input(): text = self.txt.get('1.0', END).splitlines() for line in text: ... Using io.StringIO to emulate a file, but in this case it will not strip the newline. def retrieve_input(): text = io.StringIO(self.txt.get('1.0', END)) for line in text: line = line.rstrip() ...

Categories : Python

How do I increase height of an input field so that placeholder text fully appears in input box HTML5
maybe something like this? http://jsfiddle.net/nXWfM/ .place { height:30px; } .place[placeholder] { font-size:22px; } just set the height of input

Categories : HTML

Convert "m/d/y" date from a form text input field to a mysql datetime "friendly" input?
strtotime() is smart, but it's not psychic or a genius, and when it screws up, it screws up bigtime. Don't use it, especially with ambiguous formats like m/d/y. There's no guarantee it won't be treated as as d/m/y. Use date_create_from_format() instead, which lets you explicitly specify the input format. This is far more reliable, since you'll be in control over how the d and m portions are handled: $ts = date_create_from_format('m/d/Y', '08/06/2013'); $start_date = $ts->format('Y-m-d H:i:s');

Categories : PHP

Reading input files by line using read command in shell scripting skips last line
DONE=false until $DONE do read line || DONE=true echo $line done < blah.txt How to use `while read` (Bash) to read the last line in a file if there’s no newline at the end of the file?

Categories : Bash

fill in field in cucumber not able to access the input field
I think you have two problems in your Cucumber step: There is an extra space in the regex, which is why Cucumber does not find the step. The value being passed to fill_in is incorrect - it should be the name, id or label text. Try the following: When /^I update the input field with a github url$/ do visit '/github/index' fill_in "GithubRepo", :with => "http://github.com/name1/name2" end Noting that the following changes were made: The space was removed at the end of the regex (ie between url and $). fill_in was changed to use the field's name.

Categories : Ruby On Rails

How to pipe input to python line by line from linux program?
I do not quite understand why you want to use commandline arguments instead of simply reading from standard input. Python has a simple idiom for iterating over lines at stdin: import sys for line in sys.stdin: sys.stdout.write(line) My usage example: $ echo -e "first line second line" | python python_iterate_stdin.py first line second line Your usage example: $ echo "days go by and still" | python python_iterate_stdin.py days go by and still

Categories : Python

MySQL CSV importing error: Invalid column count
The records contained <pre> texts in coding-related articles, so I had to remove [CR] and [LF] chars (they were interpreted as new lines => new record), plus I had to replace ; in html entities with something else, so now column count matches and the import was successful. Converting back the replace text to ; everything works now.

Categories : Mysql

Make Label + Input move to next line together if input overflows
Siddiqui has the right idea. You can use the <wbr> tag to indicate where you want the line breaks to appear. Example: http://jsfiddle.net/VNenK/ More info on wbr: http://www.quirksmode.org/oddsandends/wbr.html

Categories : HTML

Problems with getting data from multi-line input in the from ./{base} < input.txt
Why not just simply read the inputs as integers ? //test.c #include<stdio.h> #include<stdlib.h> int main(int argc, char *argv[]){ int n; int i; int *arr; /*Considering first value as number of elements */ /*Else you can declare an array of fixed size */ fscanf(stdin,"%d",&n); arr = malloc(sizeof(int)*n); for(i=0;i<n;i++) fscanf(stdin,"%d",&arr[i]); for(i=0;i<n;i++) printf("%d ",arr[i]); free(arr); return 0; } Now use : ./test < input.txt Assumed input.txt : 6 <- no. of elements (n) 54 37 100 123 1 54

Categories : C

ZF1: Add input type as class to tag wrapping input field
Just override render method: class My_Form extends Zend_Form { public function loadDefaultDecorators($disableLoadDefaultDecorators = false) { //Set the decorators we need: $this->setElementDecorators(array( 'ViewHelper', 'Errors', array('Description', array('tag' => 'p', 'class' => 'description', 'escape' => false)), array('decorator' => array('Div' => 'HtmlTag'), 'options' => array('tag' => 'div', 'class' => 'element')), array('Label', array('escape' => false)), array('decorator' => array('Li' => 'HtmlTag'), 'options' => array('tag' => 'li')), )); } public function render(Zend_View_Interface $view = null) {

Categories : PHP

Is it possible to efficiently count the number of line segments that overlap a single point P on a number line?
If you sort the list by starting value, and then again (for the same starting value) by length, you end up with the roots of an efficient algorithm. sort the list by starting value for the same starting value, sort by length (longest first) Then, when you need the number of line segments that overlap a given point P: for a given value p find the points in the list with starting value <= p (binary search - fast) for each starting value, start with the longest length if it spans the point of interest, increment counter if not, go to the next smaller start value keep going until you have reached the smallest starting value It's not perfect, but a lot better than searching through 10M points (although the initial sort will take some time, obviously. But you only need to do it once).

Categories : C#

phpMyAdmin Accepts NULL in the NOT NULL field
You must not have SQL_MODE set to strict on your installation. Issue SET SQL_MODE='STRICT_ALL_TABLES' or add SQL_MODE='STRICT_ALL_TABLES' under [mysqld] into your my.cnf To find my.cnf, look in the MySQL config file C:xamppmysqlinmy.ini. At the top of that file are some comments: # You can copy this file to # C:/xampp/mysql/bin/my.cnf to set global options, # mysql-data-dir/my.cnf to set server-specific options (in this # installation this directory is C:/xampp/mysql/data) or # ~/.my.cnf to set user-specific options. There it tells you where to find your my.cnf file. Restart your mysql if necessary.

Categories : Mysql

Set input as invalid
In the HTMLInputElement interface, there is no such property as valid or invalid. You can use the setCustomValidity(error) method with native form validation. As for your script: $(document).ready(function() { $('input[name=pass2]').keyup(function () { 'use strict'; if ($('input[name=pass]').val() === $(this).val()) { $('#pass_hint').html('match'); $(this)[0].setCustomValidity(''); } else { $('#pass_hint').html('mismatch'); $(this)[0].setCustomValidity('Passwords must match'); } }); }); View the jsFiddle in an HTML5 complaint browser.

Categories : Jquery

Make another field invalid while validating
To trigger the validation method from one field in another field I had to manually set the value of the other field. You can do that inside of a ng-change: ng-change="addEditForm.inputPassword2.$setViewValue(addEditForm.inputPassword2.$viewValue)" When you do that it should trigger the validation in both password fields. You could also access the fields inside of your directive like so: scope.addEditForm.inputPassword1 So you could get rid of the jQuery access inside of your directive. Here is the HTML-partial that worked for password validation on both fields: <div class="control-group"> <label class="control-label" for="inputPassword1">Password</label> <div class="controls"> <input id="inputPassword1" name="inputPassword1" type="passwo

Categories : Javascript

invalid line type: must be length 2, 4, 6 or 8
You can fix it by reading ?par: Line types can either be specified by giving an index into a small built-in table of line types (1 = solid, 2 = dashed, etc, see lty above) or directly as the lengths of on/off stretches of line. This is done with a string of an even number (up to eight) of characters, namely non-zero (hexadecimal) digits which give the lengths in consecutive positions in the string. For example, the string "33" specifies three units on followed by three off and "3313" specifies three units on followed by three off followed by one on and finally three off. The ‘units’ here are (on most devices) proportional to lwd, and with lwd = 1 are in pixels or points or 1/96 inch. So, passing a character to lty doesn't mean what you thought. You probably just

Categories : R

How should a SQL CLR UDT handle invalid input?
Throwing an ArgumentException seems to be the correct way - see Coding User-Defined Types, and specifically the Parse Validation Example: [SqlMethod(OnNullCall = false)] public static Point Parse(SqlString s) { if (s.IsNull) return Null; // Parse input string to separate out points. Point pt = new Point(); string[] xy = s.Value.Split(",".ToCharArray()); pt.X = Int32.Parse(xy[0]); pt.Y = Int32.Parse(xy[1]); // Call ValidatePoint to enforce validation // for string conversions. if (!pt.ValidatePoint()) throw new ArgumentException("Invalid XY coordinate values."); return pt; }

Categories : Sql Server

Checking for invalid input
You're displaying the message for every line that does not contain the ID. What you must do is display it if no line contains the ID. And you'll know that only when you have found the ID (which means that the ID exists), or when you have read all the lines without finding it (which means that the ID doesn't exist) So, you should use a boolean variable idFound initialized to false, and loop until it has become true, or the end of the reader has been met. Then after the loop, you can tell if the ID has been found by examining the value of this boolean variable, and display the message if it's still false. I won't provide code, because you should be able to figure that out by yourself. EDIT: your updated code has two bugs: if (s.split(",")[1].contains(infoToRemove)) { continue; }

Categories : Java

Set invalid input to initial value
Keep a Hidden Field which will be filled with the initial value. Suppose you have value "4321" to be shown in the text box. Just load that value Into the textbox as well as in hidden field. Now on Change of this value when you are making an AJAX request, So if the value is correct just update the hidden field with the correct value else just replace the value in the textbox with the value in the hidden field. Hope this helps... Sample Code: <input type="text" id="textbox" value="1234"/> <input type="hidden" id="hidden" value="1234"/> $('#textbox').change(function(){ if(parseInt($('#textbox').val())) { $('#hidden').val($('#textbox').val()); //Make AJAX request } else { $('#textbox').val($('#hidden').val());

Categories : Jquery

Selected tab allowed to change even though field invalid
I fixed this issue by doing the following: tabCtrl.CausesValidation = false; tabPage1.CausesValidation = false; tabPage2.CausesValidation = false; userCtrl.CausesValidation = false; I really don't care if the tabs are switched as long as the user can't leave the form without it validating. So, this solution allows for switching tabs but still allows for normal validation. I also redid my OnValidatingTextBox code so that the tab would be selected before focus is given to the field in error: private void OnValidatingUserControlPanel(object sender, CancelEventArgs args) { if (IsTextBoxInvalid()) { args.Cancel = true; MessageBox.Show("Invalid data in text box!!!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); this.GiveFocusToControlIfTabPage(this.Parent); this

Categories : C#

Invalid Program when converting field from int to int64
A detail found in the remarks section of http://msdn.microsoft.com/en-us/library/system.reflection.emit.opcodes.ldc_i4.aspx led me to: defaultConstructorIL.Emit(OpCodes.Ldarg_0); defaultConstructorIL.Emit(OpCodes.Ldc_I4_0, 0); defaultConstructorIL.Emit(OpCodes.Conv_I8); defaultConstructorIL.Emit(OpCodes.Stfld, version); Which worked.

Categories : Dotnet

invalid context 0x0 for drawing line graph
What you are asking is easily accomplish by enumerating through the array of CGPoint values. Also make sure to override the drawRect: method and add your drawing code there. See the example below for how to use CGPoint Values in a Mutable Array to construct a line in the graphics context. - (void)drawRect:(CGRect)rect { NSMutableArray *pointArray = [[NSMutableArray alloc] initWithObjects: [NSValue valueWithCGPoint:CGPointMake(10, 10)], [NSValue valueWithCGPoint:CGPointMake(10, 10)], [NSValue valueWithCGPoint:CGPointMake(12, 16)], [NSValue valueWithCGPoint:CGPointMake(20, 22)], [NSValue valueWithCGPoint:CGPointMake(40, 100)], nil]; // Drawing code CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetStrokeColorWithColor(context, [UIColor bl

Categories : Objective C



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.