Search Results

Search found 21356 results on 855 pages for 'check digit'.

Page 44/855 | < Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >

  • Oracle - Trigger to check constraint before insert

    - by user1816507
    i would like to create a simple trigger to check a stored variable from a table. if the value of the variable is '1', then approve the insertion else if the value of the variable is '2', then prompt error message. CREATE OR REPLACE TRIGGER approval BEFORE INSERT ON VIP REFERENCING OLD AS MEMBER FOR EACH ROW DECLARE CONDITION_CHECK NUMBER; BEGIN SELECT CONDITION INTO CONDITION_CHECK FROM MEMBER; IF CONDITION_CHECK = '2' THEN RAISE_APPLICATION_ERROR (-20000, ' UPGRADE DENIED!'); END IF; END; But this trigger disable all the entries even when the condition value is '1'.

    Read the article

  • How to check if string contains a string in string array

    - by Abu Hamzah
    edit: the order might change as you can see in the below example, both string have same name but different order.... How would you go after checking to see if the both string array match? the below code returns true but in a reality its should return false since I have extra string array in the _check what i am trying to achieve is to check to see if both string array have same number of strings. string _exists = "Adults,Men,Women,Boys"; string _check = "Men,Women,Boys,Adults,fail"; if (_exists.All(s => _check.Contains(s))) //tried Equal { return true; } else { return false; }

    Read the article

  • How do I check for Existence of a Record in GAE

    - by VDev
    I am trying to create a simple view in Django & GAE, which will check if the user has a profile entity and prints a different message for each case. I have the program below, but somehow GAE always seem to return a object. My program is below import datetime from django.http import HttpResponse, HttpResponseRedirect from google.appengine.api import users from google.appengine.ext import db from models import Profile import logging #from accounts.views import profile # Create your views here. def login_view(request): user = users.get_current_user() profile = db.GqlQuery("SELECT * FROM Profile WHERE account = :1", users.get_current_user()) logging.info(profile) logging.info(user) if profile: return HttpResponse("Congratulations Your profile is already created.") else: return HttpResponse("Sorry Your profile is NOT created.") My model object is Profile defined as follows: class Profile(db.Model): first_name = db.StringProperty() last_name = db.StringProperty() gender = db.StringProperty(choices=set(["Male", "Female"])) account = db.UserProperty(required = True) friends = db.ListProperty(item_type=users.User) last_login = db.DateTimeProperty(required=True) Thanks for the help.

    Read the article

  • Check boxes for a has_many and belongs_to association.

    - by Thomas
    I have a has_many and belongs_to association. class Link < ActiveRecord::Base has_and_belongs_to_many :categories belongs_to :property end class Property < ActiveRecord::Base has_many :links end In the index and show I have <%= link.property.name %> and it will show the Property that I assigned to the link with the console just fine. I have a problem with figuring out how to show check boxes in the _form that assign a property to the link (a drop down would work as well). It seems everyone who has had this question before has ether a has_many :through or a HABTM relationship and I can't seem to adapt their answers.

    Read the article

  • Can Apache configuration check cookies?

    - by nickf
    My situation: We have a mobile version of our website, and want to start redirecting mobile users to it. The plan is to do this in Apache httpd.conf or .htaccess, using something like this: RewriteEngine On RewriteCond %{HTTP_USER_AGENT} (iPhone|Blackberry|...) RewriteRule (.*) mobile/$1 However we want there to be a way for users to override our default action of redirecting them. One way we thought to do it was to show a link on the mobile site directing back to the regular site, and store a cookie when they use that link. Could the Apache configuration file check a cookie before redirecting? Is there a better way?

    Read the article

  • Stop then restart submit() after ajax check

    - by jeerose
    I asked a question [here] recently and it's just not providing me with an answer. Here's what I want to do and you can see my first attempt at the link above: User submits form Stop default submit action check to see if a similar entry exists in database If it does, display a notice asking them if they want to submit anyway and give an option to let them submit anyway (enable default action and submit it). If it does not, enable the default action on the form and let it submit I'm at a loss. Any help is appreciated. Thanks gang.

    Read the article

  • Check if key exists in $_SESSION by building index string

    - by Kim
    I need to check if a key exists and return its value if it does. Key can be an array with subkeys or endkey with a value. $_SESSION['mainKey']['testkey'] = 'value'; var_dump(doesKeyExist('testkey')); function doesKeyExist($where) { $parts = explode('/',$where); $str = ''; for($i = 0,$len = count($parts);$i<$len;$i++) { $str .= '[\''. $parts[$i] .'\']'; } $keycheck = '$_SESSION[\'mainKey\']' . $str; if (isset(${$keycheck})) { return ${$keycheck}; } // isset($keycheck) = true, as its non-empty. actual content is not checked // isset(${$keycheck}) = false, but should be true. ${$var} forces a evaluate content // isset($_SESSION['mainKey']['testkey']) = true } What am I doing wrong ? Using PHP 5.3.3.

    Read the article

  • How to check if file exists in Apache

    - by Rick
    I've set this up successfully in IIS in the past, but i'm not sure how to do it in Apache. I want to check to see if a file exists, whether it be: /path/to/file.php /path/to/file.cfm /path/to/file.html /path/to/ If the file does not exist, I want to redirect to /404/, where I have a file that does all 404 related handling. Lastly, when doing this in IIS, it gave me a CGI.QUERY_STRING of something like: 404;http://example.com/prettyurl Can apache do the same? This is what i've tried to so far, to no success. (I'm probably way off here...) RewriteEngine on RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_URI} -f RewriteRule (.*)$ /404/ [R,L,NC] Thanks..

    Read the article

  • Check something before django server starts

    - by Vijay Shankar Kalyanaraman
    I am running my api behind a django server and say I have a one time token that is needed by the django application and used through out its existence until the process quits. To check if I can proceed and serve requests (using the django server) I need to validate this token against a database entry. Now, I can have a script that hits the db, then issues the run server command if the token is valid. But if the db used by the django applications change, I will have to change the script also to point to the same db. Is there a way I can pass this token into the runserver command as an additional parameter (along with hostname:port) and validate this before django serves any requests? How can I access this parameter that is sent into ./manage.py runserver. Thanks.

    Read the article

  • Check result of ASP.Net validator clientside

    - by Steffen
    I know the built-in ASP.Net validators come with a client-side framework, however I've been unable to find anything that lets me check a single validator for it's Valid state. I expect it to be possible though, so I hope someone in here knows how to do it :-) The validator in question is a RegularExpressionValidator, which I use to determine whether an e-mail address is valid or not. Here's some brief code: <script> function CheckForExistingEmail() { Page_ClientValidate(); // Ensure client validation if (revEmail.IsValid) // pseudo code! { // Perform server side lookup in DB for whether the e-mail exists. } } </script> <asp:TextBox runat="server" id="tbEmail" onblur="CheckForExistingEmail();" /> <asp:RegularExpressionValidator id="revEmail" runat="server" ControlToValidate="tbEmail" ErrorMessage="Not a valid e-mail address" ValidationExpression="([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})" />

    Read the article

  • check compiler with break point

    - by KareemSaad
    When I tried to focus on compiler in code i made break point on code if (!IsPostBack) { using (SqlConnection Con = Connection.GetConnection()) { if (Request.QueryString["Category_Id"] != null && DDlProductFamily.SelectedIndex < 0) { SqlCommand Com = new SqlCommand("SelectAllCtageories_Front", Con); Com.CommandType = CommandType.StoredProcedure; Com.Parameters.Add(Parameter.NewInt("@Category_Id", Request.QueryString["Category_Id"])); SqlDataAdapter DA = new SqlDataAdapter(Com); DA.Fill(dt); DataList1.DataSource = dt; DataList1.DataBind(); } but I cannot check condition although I had the value of query string List item

    Read the article

  • How to access the next element and check if it has a particular class

    - by NaN
    I need to call a function based on whether the second following td element has a certain class. Here is the HTML <tr id="939"> <td data-id="939">Test2</td> <td class="hold" data-id="939"></td> </tr> <tr id="938"> <td data-id="938">Test1</td> <td class="someotherclass" data-id="938"></td> </tr> Here is the JQuery function $('body').on('click', '#article td:first-child', function(e){ // I need to check the next td for the hold class if($(this).next().hasClass(".hold")){ // Call my function } }); How do I do this? I've tried using next and closest but that yields nothing.

    Read the article

  • Check constraint on table lookup

    - by bzamfir
    Hi, I have a table, department , with several bit fields to indicate department types One is Warehouse (when true, indicate the department is warehouse) And I have another table, ManagersForWarehouses with following structure: ID autoinc WarehouseID int (foreign key reference DepartmentID from departments) ManagerID int (foreign key reference EmployeeID from employees) StartDate EndDate To set new manager for warehouse, I insert in this table with EndDate null, and I have a trigger that sets EndDate for previous record for that warehouse = StartDate for new manager, so a single manager appears for a warehouse at a certain time. I want to add two check constraints as follows, but not sure how to do this do not allow to insert into ManagersForWarehouses if WarehouseID is not marked as warehouse Do not allow to uncheck Warehouse if there are records in ManagersForWarehouses Thanks

    Read the article

  • Javascript check all checkboxes in a table / asp.net

    - by SLC
    I have a table with rows in, and each row has a few <td> elements. The last element has a checkbox in. They are in a <div> which is set to runat="server". I have another checkbox on the page called "chkAll" that when clicked, I want to javascript check or uncheck all of the checkboxes in my table. I'm not very good at Javascript, so I am not sure what to do. I added a javascript onclick method, and put document.getelementbyid and put in the div.clientID, but I wasnt sure what to do from there. Any ideas?

    Read the article

  • bash check if value in list

    - by tkoomzaaskz
    I've got a script with a variable taken from command line parameters. I want to check if it's value is one of dev, beta or prod. I've got following code snippet: #!/usr/bin/env bash ENV_NAME=$1 echo "env name = $ENV_NAME" ENVIRONMENTS=('dev','beta','prod') if [[ $ENVIRONMENTS =~ $ENV_NAME ]]; then echo 'correct' exit else echo 'incorrect' exit fi When I run my script, it doesn't matter which parameters I pass: ./script.sh beta or ./script.sh or ./script.sh whatever, I always get correct echoed. What is wrong in my script?

    Read the article

  • Scheduled cron job to check for pending activity

    - by luckytaxi
    Using PHP ... This is for my personal use so I'm thinking maybe 3-4 emails a day. I'm at a point where I can send an email to a dedicated email address where my script parses the message and stores it into a DB. Now, I need to figure out the best way to check the records in the DB for any upcoming task. I feel like I'm missing something, maybe like a trigger field as to when a reminder should go out. However, that's not a concern to me at the moment since I'll just send an alert 15 mins prior to the due date. Question is, shoudl I run a cron job that queries the DB every minute? I take it the query will have to say something like "select all tasks that is due within 15 minutes."

    Read the article

  • check if lookup yields any valid rows for insertion before clearing table using ssis

    - by Chris
    SSIS ignoramus needing help! the situation: a temp table is populated from an excel file, which has been known to change formats at random times, that is owned by a different group. a lookup need to be performed on the temp table, tableA, to populate tableB with valid data. if the lookup results in 0 rows being returned, an email should be sent and the existing data in tableB should remain untouched. If the lookup results in a number of valid rows 0, tableB should have all rows deleted and the new records from the lookup on tableA inserted. question: what would be the best way to check if there are any valid rows and perform the appropriate action(s), depending on my results? Thanks!

    Read the article

  • How check user online status in web site?

    - by Milan Sanda Sri
    how can i get know when user online and offline. when one user log in to my site. i set a script to change database table field of that user, as a boolean to indicates users online states. but my problem is if he/she leaved my site without clicking the log-out button, then my script does not work and database show he/she as a online user. please give me any sugestion to fix this. i have no idea what to do! i check some answers on this topic, but most of says asnwer lie this -- if last activity time is less than now+15 minutes then user is online, offline otherwise. but i have seen some social networking sites shows that we have gone offline, just we close the browser. how they do that ?

    Read the article

  • How to check if people liked my Facebook FanPage

    - by user2372419
    There are many questions and answers about this. But nowadays Facebook changes their Privacy. Any Application that request for user_likes permission must be review by Facebook before using. I've tried many times to explain to Facebook review team about my app, but they did not accept, because my application (a web game using HTML5 and JavaScript) require people like my fan page before play. So my question is: Is there any to bypass Facebook privacy? I have a Like Box on the same page as the game screen (where i need to check Like), so any solution (like: analyze DOM elements, capture screen can pass through image recognition) will fine.

    Read the article

  • RewriteCond simply doesn't work, doesn't check properly if file exists

    - by ultranol
    Hey everybody. I've been trying to solve this for hours now but came up with nothing. Inside .htaccess, whenever somebody requests an image from a folder of my website, I'm trying to check if a file with the same name exists in another folder; if it does, return that file; if it doesn't, return the file originally requested. It seems so easy but it simply doesn't work. The .htaccess code is as follows: RewriteEngine On RewriteCond /images/blog/watermark/$1 -f RewriteRule ^(.*) /images/blog/watermark/$1 The "RewriteCond" always returns negative, so the image requested is always loaded as is. If I change it to, like, RewriteCond %{REQUEST_FILENAME} -f it always returns positive, so it gets the image from the folder I want - except when the image's not there, generating an error, which is exactly what I'm trying to prevent. What am I doing wrong? Thanks.

    Read the article

  • C# - Check which event changed / accessed a Property

    - by binil
    I have a class with property say private string fieldSelectedItem; public string FieldSelectedItem { get { return fieldSelectedItem; } set { fieldSelectedItem = value; } } it is accessed from many place. I came across a situation that the a property in class is accessed by some event. and also some event is changing the value. i tried debugging. is it possible to check which event/function has changed/accessed the property. is there any method to do so.

    Read the article

  • Check if NSString "000001XX"is a number with intValue

    - by Kenny
    Now I am trying to add a front end check on my app to detect if user input only number in the textfield. I use: - (IBAction)checkID:(UITextField *)sender { if ([sender.text isEqualToString:@""]) { sender.text = @"This information is required"; sender.backgroundColor =[UIColor redColor]; }else if (![sender.text intValue]) { sender.text = [sender.text stringByAppendingString:@" is not valid number"]; sender.backgroundColor =[UIColor redColor]; } NSLog(@"send.text is %@, intValue is %d",sender.text,[sender.text intValue]); } But I found it text begins with number and ends with string, its intValue is still the number. In my text, text is "00001aa", but the intValue is 1. Is there any other way to filter out this "00001aa" text? Thanks in advance.

    Read the article

  • Fastest way to check for value existance.

    - by Itay Moav
    I have a list of values I have to check my input against it for existence. What is the faster way? This is really out of curiosity on how the internals work, not any stuff about premature optimization etc... 1. $x=array('v'=>'','c'=>'','w'=>); .. .. array_key_exists($input,$x); 2. $x=array('v','c','w'); .. .. in_array($input,$x);

    Read the article

  • Check for new mails in Hotmail using OpenPop.NET

    - by deadlock
    I was advised to use OpenPop lib to fetch my mail from hotmail. But I could'nt find any better way to check for new mail except disconnecting and reconnecting again. And there, I found a problem, Hotmail doesn't allow more than 1 pop3 login each 15 minutes. I want to know if it's possible to get the new mail without disconnecting and reconnecting to their pop3 server. Here is my code: Timer checker = new Timer(); checker.Interval = 1000; checker.Tick += new EventHandler(delegate { Pop3Client client = new Pop3Client(); client.Connect("pop3.live.com", 995, true); client.Authenticate("[email protected]", "myPassword"); label1.Text = client.GetMessageCount().ToString(); client.Disconnect(); }); checker.Start();

    Read the article

  • Check and avoid if a char is being entered in a int

    - by John
    Hi.... This is a exremely stupid question but i need help with this.... I'm trying to make a small program that i made robust and needed some help with tht.... int num1; int num2 = 0; System.out.print("Enter number 1: "); num1 = kb.nextInt(); while(num2<num1) { System.out.print("Enter number 2: "); num2 = kb.nextInt(); } Number 2 has to be greater than number 1 Also i want the program to automatically check and ignore if the user enters a char instead of an int... Cause right now when a user enters lets say "r" instead of a number the program just exists....

    Read the article

< Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >