Is there any existing Python library that can validate data in Excel format? Or what kind of keyword should I use to search such an open source project? Thanks.
Hi all,
On a Salesforce.com opportunity I have a number of custom fields that are potential options that the end client will eventually select.
Option 1 (Desc Field) Option 1 (Value)
Option 2 (Desc Field) Option 2 (Value)
Option 3 (Desc Field) Option 3 (Value)
At a future point the user will ultimately choose one of the options as the preferred option. What I want is then the value for the chosen option to be stored in another field without the user having to enter it again. A “nice to have” would also be that all 3 option descriptions, values and selected value are locked once this is done.
Any ideas?
May websites, including professional ones usually have a "W3C Markup Validator" and "W3C CSS Validator." Why do you put them there? Is it just pride or is it justified? If it is more than pride, what justifies them?
I have an input field in a form. Upon pushing submit, I want to validate to make sure the user entered non-latin characters only, so any foreign language characters, like Chinese among many others. Or at the very least test to make sure it does not contain any latin characters.
Could I use a regular expression for this? What would be the best approach for this?
I am validating in both javaScript and in PHP. What solutions can I use to check for foreign characters in the input field in both programming languages?
What is the best way for converting phone numbers into international format (E.164) using Java?
Given a 'phone number' and a country id (let's say an ISO country code), I would like to convert it into a standard E.164 international format phone number.
I am sure I can do it by hand quite easily - but I would not be sure it would work correctly in all situations.
Which Java framework/library/utility would you recommend to accomplish this?
P.S. The 'phone number' could be anything identifiable by the general public - such as
* (510) 786-0404
* 1-800-GOT-MILK
* +44-(0)800-7310658
that last one is my favourite - it is how some people write their number in the UK and means that you should either use the +44 or you should use the 0.
The E.164 format number should be all numeric, and use the full international country code (e.g.+44)
I have a projects resource that has many tasks. I want to ensure that every task has a project_id by adding validates_presence_of :project_id to the tasks model.
However, when creating a new project with tasks, the project_id won't be available until the record saves, therefore I can't use validates_presence_of :project_id.
So my question is, how do I validate presence of project_id in the task model? I want to ensure every task has a parent.
...
class Project < ActiveRecord::Base
has_many :tasks, :dependent => :destroy
accepts_nested_attributes_for :tasks, :allow_destroy => true
...
class Task < ActiveRecord::Base
belongs_to :project
validates_presence_of :project_id
Hi,
Why does the Javascript function call isNaN(123.) return false? Is this a universally acceptable number or will it cause errors downstream?
I'm validating whether a value is a valid decimal using isNaN along with split. Are there cross-browser issues with isNaN? Should I use a bespoke implementation?
Thanks.
I have a form that has several conditional form elements. For example If x is selected in dropdown a, show/hide textfield a etc..
Is there a plugin for it or do I have to write those conditions manually?
Thanks for your help!
I just need to validate 2 strings in javascript.
One of them must contain only 0 or more open parenthesis ( .
The other must contain only 0 or more close parenthesis ) .
This means only those characters are allowed in each value.
After spending a lot of time trying to understand the regex, I can't find a way to achieve this. With the escape characters I make a mess of the regex function.
This is what I thought:
/\(*/
Could anyone help me?
For example, you send an unsubscribe message to a legitimate company or a spam, they reply that they will remove you and it may take up to 72 hours to take effect. I find it hard to believe anything that simple could take more than 3/4 of a second to take effect system wide.
Another example would be when you call the visa activation line, there is a "delay" of several minutes while they try to sell you some kind of insurance. Usually just as you get the point across that you don't want it they will tell you your card has been activated and let you go.
Are these delays real?
heres my code -
function Validate_URL(url) {
var iurl = url.value;
var v = new RegExp();
v.compile("/^(((ht|f){1}(tp:[/][/]){1})|((www.){1}))[-a-zA-Z0-9@:%_+.~#?&//=]+$/;");
if (!v.test(iurl.value)) {
url.style.backgroundColor = 'yellow';
}
return true;
}
no matter what i put in url, say http://www.abc.com/newpage.html, it returns false. how come?
I dynamically add some elements to a form so I know I need to re-parse the form.
Even if I have old invalid elements they don't get identified in numberOfInvalids
It always comes back = 0 even though the invalid fields are highlighted on the page.
var form = $("#form");
//Form Savingform.submit(function (e) {
e.preventDefault();
form.removeData("validator");
form.removeData("unobtrusiveValidation");
$.validator.unobtrusive.parse(form);
var val = form.validate();
if (val.numberOfInvalids() == 0) {
$.blockUI({ fadeIn: 1000 });
AjaxRequest({
data: $(this).serializeArray(),
success: function (data, status, xhr) { alert('sucess save or submit, use "'); },
complete: function () { $.unblockUI(); }
});
}
});
I have asp:RegularExpressionValidator with ValidationExpression="\d+{1,4}(?:[.,]\d{1,4})?" but it doesn't' work, parser throws ArgumentException:
parsing "\d+{1,4}(?:[.,]\d{1,4})?" -
Nested quantifier {.
Where is my mistake? I want to allow strings like xxxx,xxxx - from 1 to 4 digits and decimal digits are not required, e.g.: 1000, 99,99, 0,2498, etc.
I am a beginner in jQuery and I was wondering how to validate the form before submission specifically for check boxes.
I am creating a simple check list form where my user would tick a check box if he finished that step. What I am planning to do is that, the script would prevent the form submission if there is an "unticked" checkbox and highlight it with a color.
Here's my code :
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>checkbox</title>
<style>
.error {
background-color:#F00;
}
.valid {
background-color:#0F0;
}
</style>
<script type="application/javascript" src="http://code.jquery.com/jquery-1.8.2.min.js"> </script>
<script type="application/javascript">
function validateAll() {
$(".tick").change(function(){
if ($('.tick:checked').length == $('.tick').length) {
$('#container').removeClass();
$('#container').addClass('error');
} else {
$('#container').removeClass();
$('#container').addClass('valid');
}
});
}
</script>
</head>
<body>
<div id="container"><input class="tick" id="option1" type="checkbox"></div>
<div id="container"><input class="tick" id="option1" type="checkbox"></div>
<input id="button" type="button" onClick="validateAll();" value="check">
</body>
</html>
So what I am trying to do here is when the user clicks the button, the script will highlight all the unchecked check box with red and highlight all checked with green.
However, my script is not functioning. What is wrong with my script? Any suggestions on a more efficient way to do this?
If I have a pointer, like char* foo, is there any way to determine if foo points to a valid location in memory? (So, foo is not NULL, and delete has not yet been called on it.)
So I need to get value false or true if string contains not only letters of all european and east alphabets and " "(space) and "-" minus. How to do such thing with some $a string?
My web page content is populated by a plain text that is retrieved from a CDATA format - plain text data.
This is the site http://checksite.apsx to get information.
For more information, visit http://moresites.com/FAQ/index.html or search the site.
Now, my goal is to convert this plain text to a valid hyperlinks.
I've used a javascript code that does the conversion - /((http|https|ftp):\/\/[^ ]+)/g;
, but sometimes if there are multiple words, it captures an invalid URL.
My question: Is there a way to strictly capture any string that starts with "http" AND ends with ".html" or "aspx" will be converted into a valid hyperlink?
it should look like this -
This is the site http://checksite.apsx to get information.
For more information, visit http://moresites.com/FAQ/index.html or search the site.
Recently a lot of browser-based training sites have been spawned. These include tryruby.org, codeacademy.org, codeschool.org and the Udacity site uses something seemingly similar. They allow the user to type code in say Ruby or Python, this is then sent to the server and the output posted back to the browser.
Are there libraries available for in-browser code validation?
How would you approach this?
Suggestions?
Hi! I'm doing my VERY first project using python/django/eclipse/pydev following this guide
http://docs.djangoproject.com/en/dev/intro/tutorial01/
My only addition is the use of Eclipse/pydev.
I'm getting many errors related to "Unresolved imports". I can remove the errors using "remove error markers" and my site runs perfect (I can browse it) but I want to get rid definitively of this problem since errors appear again after I removed them.
Any ideas?
In many django projects, in the docs directory I can see *.rst files :
What is the best way to browse them (without using a text editor of course) ?
Is that possible to generate HTML ?
Alias /media/ /home/matt/repos/hello/media
<Directory /home/matt/repos/hello/media>
Options -Indexes
Order deny,allow
Allow from all
</Directory>
WSGIScriptAlias / /home/matt/repos/hello/wsgi/django.wsgi
/media is my directory. When I go to mydomain.com/media/, it says 403 Forbidden. And, the rest of my site doesn't work because all static files are 404s. Why?
Edit: hello is my project folder
Is there a wysiwyg editor for the web, like tinymce or wmd, which can produce restructured text? I'm looking for something which can be integrated with django.
I would like to use rst instead of markdown because I need to convert the content entered to pdf and do some layout specific things which make rst look like a better choice.
I'm developing a website using the Django framework, and I need to retrieve Jabber (okay, Google Talk) statuses for a user. Most of the Jabber python libraries seem like an incredible amount of overkill (and overhead) for a simple task. Is there any simple way to do this?
I know very little about XMPP/Jabber, though of course I'm willing to learn. Do you need to be an authenticated and "friended" user to retrieve another user's status?