Search Results

Search found 21001 results on 841 pages for 'spelling check'.

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

  • Regex to check if exact string exists

    - by Jayrox
    I am looking for a way to check if an exact string match exists in another string using Regex or any better method suggested. I understand that you tell regex to match a space or any other non-word character at the beginning or end of a string. However, I don't know exactly how to set it up. Search String: t String 1: Hello World, Nice to see you! t String 2: Hello World, Nice to see you! String 3: T Hello World, Nice to see you! I would like to use the search string and compare it to String 1, String 2 and String 3 and only get a positive match from String 1 and String 3 but not from String 2. Requirements: Search String may be at any character position in the Subject. There may or may not be a white-space character before or after it. I do not want it to match if it is part of another string; such as part of a word. For the sake of this question: I think I would do this using this pattern: /\bt\b/gi /\b{$search_string}\b/gi Does this look right? Can it be made better? Any situations where this pattern wouldn't work? Additional info: this will be used in PHP 5

    Read the article

  • Check if TIFF file is complete

    - by Davi
    I have a FileSystemWatcher monitoring a directory that receives TIF files from a scanning device. Its necessary to check if the scanning process is done and then read a multipage TIF file, otherwise, the FileSystemWatcher will raise the event before the file be fully scanned. I have something like: private void OnFileCreated(...) { while(IsFileLocked(path)) Thread.Sleep(time); // OK to read } This is what is happening: - Scanner creates the file - FileSystemWatcher detects the file, but its in use - Scanner reads the first page to the file - Scanner releases the file - My code leaves the while(FileInUse(path)) - My code reads the incomplete file (problem) - Scanner adds more pages to the file Let's say the scanner is scanning 100 pages, then, when "OK to read", the file will be incomplete (99 pages left). So, its necessary to know if the file is complete or not. Maybe waiting some time to see if the file is modified, but this time span can be up to hours, because the scanner can get idle scanning the same TIF. Other solution would be checking some flag in the TIF file that indicates that the file is not complete(I've looked for this but don't found anything).

    Read the article

  • using libcurl to check if a file exists on a SFTP site

    - by Snazzer
    I'm using C++ with libcurl to do SFTP/FTPS transfers. Before uploading a file, I need to check if the file exists without actually downloading it. If the file doesn't exist, I run into the following problems: //set up curlhandle for the public/private keys and whatever else first. curl_easy_setopt(CurlHandle, CURLOPT_URL, "sftp://user@pass:host/nonexistent-file"); curl_easy_setopt(CurlHandle, CURLOPT_NOBODY, 1); curl_easy_setopt(CurlHandle, CURLOPT_FILETIME, 1); int result = curl_easy_perform(CurlHandle); //result is CURLE_OK, not CURLE_REMOTE_FILE_NOT_FOUND //using curl_easy_getinfo to get the file time will return -1 for filetime, regardless //if the file is there or not. If I don't use CURLOPT_NOBODY, it works, I get CURLE_REMOTE_FILE_NOT_FOUND. However, if the file does exist, it gets downloaded, which wastes time for me, since I just want to know if it's there or not. Any other techniques/options I'm missing? Note that it should work for ftps as well. Edit: This error occurs with sftp. With FTPS/FTP I get CURLE_FTP_COULDNT_RETR_FILE, which I can work with.

    Read the article

  • Creating DOM elements on the fly - check if the data is not harmful

    - by user313353
    I already posted a question closely related to the this one. I watched the Mix10 video with P. Haacked and S. Hanselman. I am building an AJAX-powered site whose input forms are created on the fly. All the code to accomplish this is done within a script tag or a javascript file. For example the following DOM elements are created when the page loads and are wrapped into an existing div defined in a view: $('#myform').append('); $('#myform').append(''); When I click the submit button I need to get the values of the input form whose id is 'Name': $("#Name").val() and then I return a Json object: { Name: name }; For this kind of scenario there is no way to use Html.Encode() or AntiXss.HtmlEncode() on the client-side. The only way to check if the input is not harmful is done on the server-side (via a service layer). This seems a limitation. All is fine if and only if a view has a set of predefined inputs. When it is time to create them on the fly, the situation is different. Have you thought of that situation guys? Thanks for the attention you have put on this. Roland Brussels, Belgium

    Read the article

  • Most readable way to write simple conditional check

    - by JRL
    What would be the most readable/best way to write a multiple conditional check such as shown below? Two possibilities that I could think of (this is Java but the language really doesn't matter here): Option 1: boolean c1 = passwordField.getPassword().length > 0; boolean c2 = !stationIDTextField.getText().trim().isEmpty(); boolean c3 = !userNameTextField.getText().trim().isEmpty(); if (c1 && c2 && c3) { okButton.setEnabled(true); } Option 2: if (passwordField.getPassword().length > 0 && !stationIDTextField.getText().trim().isEmpty() && !userNameTextField.getText().trim().isEmpty() { okButton.setEnabled(true); } What I don't like about option 2 is that the line wraps and then indentation becomes a pain. What I don't like about option 1 is that it creates variables for nothing and requires looking at two places. So what do you think? Any other options?

    Read the article

  • Canvas Check before submission

    - by smokinguns
    I have a page where a user can draw on the canvas and save the image to a file on the server. The canvas has a default black background. Is there a way to check if the user has drawn anything on the canvas before submitting the data URL representation of the image of a canvas with the toDataURL() function? So if the user doesn't draw anything on the canvas(it will be a blank canvas with a black background), the image wont be created on the server. Should I loop through each and every pixel of the canvas to determine this? Here is what I'm doing currently: var currentPixels = context.getImageData(0, 0, 600, 400); for (var y = 0; y < currentPixels.height; y += 1) { for (var x = 0; x < currentPixels.width; x += 1) { for (var c = 0; c < 3; c += 1) { var i = (y*currentPixels.width + x)*4 + c; if(currentPixels.data[i]!=0) break; } } }

    Read the article

  • MySql Check if NOW() falls within a weekday/time range

    - by Niall
    I have a table as follows: CREATE TABLE `zonetimes` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `zone_id` int(10) unsigned NOT NULL, `active_from_day` tinyint(1) unsigned NOT NULL DEFAULT '2', `active_to_day` tinyint(1) unsigned NOT NULL DEFAULT '2', `active_from` time NOT NULL, `active_to` time NOT NULL PRIMARY KEY (`id`) ) ENGINE=MyISAM ; So, a user could add a time entry starting on a particular day and time and ending on a particular day and time, eg: Between Monday 08:00 and Friday 18:00 or Between Thursday 15:00 and Tuesday 15:00 (Note the crossover at the end of the week). I need to query this data and determine if a zone is currently active (NOW(), DAYOFWEEK() etc)... This is turning out to be quite tricky. If I didn't have overlaps, eg: from 'Wednesday 8pm to Tuesday 4am' or from 'Thursday 4pm to Tuesday 4pm' this would be easy with BETWEEN. Also, need to allow a user to add for the entire week, eg: Monday 8am - Monday 8am (This should be easy enough, eg: where (active_from_day=active_to_day AND active_from=active_to) OR .. Any ideas? Note: I found a similar question here Timespan - Check for weekday and time of day in mysql but it didn't get an answer. One of the suggestions was to store each day as a separate row. I would much rather store one time span for multiple days though.

    Read the article

  • php check box selection

    - by DAFFODIL
    I have a form in which data fro back end will be listed out in table.There will a chk box at beginning of each row. For eg,if there are 10 items and ,i need only two items,i ii chk in check box,when i press print it should be passed to print page. Mates thnx in advance. mysql_select_db("form1", $con); error_reporting(E_ALL ^ E_NOTICE); $nam=$_REQUEST['select1']; $row=mysql_query("select * from inv where name='$nam'"); while($row1=mysql_fetch_array($row)) { $Name=$row1['Name']; $Address =$row1['Address']; $City=$row1['City']; $Pincode=$row1['Pincode']; $No=$row1['No']; $Date=$row1['Date']; $DCNo=$row1['DCNo']; $DcDate=$row1['DcDate']; $YourOrderNo=$row1['YourOrderNo']; $OrderDate=$row1['OrderDate']; $VendorCode=$row1['VendorCode']; $SNo=$row1['SNo']; $descofgoods=$row1['descofgoods']; $Qty=$row1['Qty']; $Rate=$row1['Rate']; $Amount=$row1['Amount']; } ? Untitled Document function ram(id) { var q=document.getElementById('qty_'+id).value; var r=document.getElementById('rate_'+id).value; document.getElementById('amt_'+id).value=q*r; } function g() { form1.submit(); } Name select " Address City ' / Pincode ' No ' readonly="" / Date ' readonly="" / DCNo ' readonly="" / DcDate: ' / YourOrderNo ' readonly="" / OrderDate ' readonly="" / VendorCode ' readonly="" /   SNO DESCRIPTION QUANTITY RATE/UNIT AMOUNT ' readonly=""/ ' / "/ ' id="rate_" onclick="ram('')"; "/ "Print

    Read the article

  • please check my MYSQL query & give me advice?

    - by Suba
    select s.s_nric as NRIC,s.s_name as NAME,s.s_psle_eng as PSLE_ENG,s.s_psle_math as PSLE_MATHS,s.s_psle_aggr as PSLE_AGGR, (SELECT re.re_mark FROM si_results re WHERE re.re_code like 'FEEN%' AND re.re_year='2008' AND re.re_semester='2' AND re.re_nric=s.s_nric ) as English_2008, (SELECT re.re_mark FROM si_results re WHERE re.re_code like 'FEMA%' AND re.re_year='2008' AND re.re_semester='2' AND re.re_nric=s.s_nric ) Maths_2008, (SELECT re.re_mark FROM si_results re WHERE re.re_code like 'FEEN%' AND re.re_year='2009' AND re.re_semester='2' AND re.re_nric=s.s_nric ) as English_2009, (SELECT re.re_mark FROM si_results re WHERE re.re_code like 'FEMA%' AND re.re_year='2009' AND re.re_semester='2' AND re.re_nric=s.s_nric ) Maths_2009 ,isc.isc_g_gpa as ISC_GPA from si_student_data as s LEFT JOIN si_isc_gpa as isc ON isc.isc_g_nric=s.s_nric where 1=1 AND s.s_admission_year='2008' GROUP BY s.s_nric ORDER BY s.s_gender,s.s_name asc This is my query. please check my sub query this is my sub query (SELECT re.re_mark FROM si_results re WHERE re.re_code like 'FEEN%' AND re.re_year='2008' AND re.re_semester='2' AND re.re_nric=s.s_nric ) as English_2008, (SELECT re.re_mark FROM si_results re WHERE re.re_code like 'FEMA%' AND re.re_year='2008' AND re.re_semester='2' AND re.re_nric=s.s_nric ) Maths_2008, (SELECT re.re_mark FROM si_results re WHERE re.re_code like 'FEEN%' AND re.re_year='2009' AND re.re_semester='2' AND re.re_nric=s.s_nric ) as English_2009, (SELECT re.re_mark FROM si_results re WHERE re.re_code like 'FEMA%' AND re.re_year='2009' AND re.re_semester='2' AND re.re_nric=s.s_nric ) Maths_2009 When I execute my query, server take long time to execute. So how to make simple? please advice me. Thanks.

    Read the article

  • How to check a bool setting in my iphone app

    - by dusk
    I have a setting in Root.plist with Key = 'latestNews' of type PSToggleSwitchSpecifier and DefaultValue as a boolean that is checked. If I understand that correctly, it should = YES when I pull it in to my code. I'm trying to check that value and set an int var to pass it to my php script. What is happening is that my boolean is either nil or NO and then my int var = 0. What am I doing wrong? int latestFlag; NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults]; BOOL latestNews = [prefs boolForKey:@"latestNews"]; if (latestNews) latestFlag = 1; else latestFlag = 0; NSString *urlstr = [[NSString alloc] initWithFormat:@"http://www.mysite.com/folder/iphone-test.php?latest=%d", latestFlag]; NSURL *url = [[NSURL alloc] initWithString:urlstr]; //these are auto-released NSString *ans = [NSString stringWithContentsOfURL:url]; NSArray *listItems = [ans componentsSeparatedByString:@","]; self.listData = listItems; [urlstr release]; [url release];

    Read the article

  • How to check if an entityset is populated

    - by TheQ
    How can i check if an entityset of a linq-object is populated or not? Example code below. My model have two methods, one joins data, and the other does not: public static Member GetMemberWithSettings(Guid memberId) { using (DataContext db = new DataContext()) { DataLoadOptions dataLoadOptions = new DataLoadOptions(); dataLoadOptions.LoadWith<Member>(x => x.Settings); db.LoadOptions = dataLoadOptions; var query = from x in db.Members where x.MemberId == memberId select x; return query.FirstOrDefault(); } } public static Member GetMember(Guid memberId) { using (DataContext db = new DataContext()) { var query = from x in db.Members where x.MemberId == memberId select x; return query.FirstOrDefault(); } } Then my control have the following code: Member member1 = Member.GetMemberWithSettings(memberId); Member member2 = Member.GetMember(memberId); Debug.WriteLine(member1.Settings.Count); Debug.WriteLine(member2.Settings.Count); The last line will generate a "Cannot access a disposed object" exception. I know that i can get rid of that exception just by not disposing the datacontext, but then the last line will generate a new query to the database, and i don't want that. What i would like is something like: Debug.WriteLine((member1.Settings.IsPopulated()) ? member1.Settings.Count : -1); Debug.WriteLine((member2.Settings.IsPopulated()) ? member2.Settings.Count : -1); Is it possible?

    Read the article

  • Code refactoring c# question around several if statements performing the same check

    - by James Radford
    I have a method that has a load of if statements that seems a bit silly although I'm not sure how to improve the code. Here's an example. This logic was inside the view which is now in the controller which is far better but is there something I'm missing, maybe a design pattern that stops me having to check against panelCount < NumberOfPanelsToShow and handling the panelCount every condition? Maybe not, just feels ugly! Many thanks if (model.Train && panelCount < NumberOfPanelsToShow) { panelTypeList.Add(TheType.Train); panelCount++; } if (model.Car && panelCount < NumberOfPanelsToShow) { panelTypeList.Add(TheType.Car); panelCount++; } if (model.Hotel && panelCount < NumberOfPanelsToShow) { panelTypeList.Add(TheType.Hotel); panelCount++; } ...

    Read the article

  • Need a VB Script to check if service exist

    - by Shorabh Upadhyay
    I want to write a VBS script which will check if specific service is installed/exist or not locally. If it is not installed/exist, script will display message (any text) and disabled the network interface i.e. NIC. If service exist and running, NO Action. Just exit. If service exist but not running, same action, script will display message (any text) and disabled the network interface i.e. NIC. i have below given code which is displaying a message in case one service is stop but it is not - Checking if service exist or not Disabling the NIC strComputer = "." Set objWMIService = Getobject("winmgmts:"_ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colRunningServices = onjWMIService.ExecQuery _ ("select State from Win32_Service where Name = 'dhcp'") For Each objService in colRunningServices If objService.State <> "Running" Then errReturn = msgbox ("Stopped") End If Next Please help. Thanks in advance.

    Read the article

  • How to check Internet status in iPhone

    - by Radix
    Hello; I wanted to check whether internet is connected or not using either the SystemConfiguration or the CFNetwork i am not quite sure which one. Then i want to know that if the internet is connected then is it connected through wifi or not. I tried an example where i used the below code -(IBAction) shownetworkStatus { NSURL *url = [NSURL URLWithString:@"www.google.com"]; if (url!=NULL) { lbl.text = @"Connected"; } else { lbl.text = @"notConnected"; } } some say that its not valid as per apple and you have to use the SystemConfiguration Framework, Please let me know what needs to be done. Also i personally think that what i am doing in the above code is not proper as if one day google may also be down due to maintenance or some other factors. Also if you could provide me a link where i could display the name of the WIFI network then it would be really cool. I searched the internet then i got these Reachability.h code which again is a bouncer as i wana learn the concepts not copy paste them Thanks and Regards Radix

    Read the article

  • How to check user input for correct formatting

    - by Arcadian
    This is what i've come up with so far private void CheckFormatting() { StringReader objReaderf = new StringReader(txtInput.Text); List<String> formatTextList = new List<String>(); do { formatTextList.Add(objReaderf.ReadLine()); } while (objReaderf.Peek() != -1); objReaderf.Close(); for (int i = 0; i < formatTextList.Count; i++) { } } What it is designed to do is check that the user has entered their information in this format Gxx:xx:xx:xx JGxx where "x" can be any integer. As you can see the user inputs their data into a multi-line textbox. i then take that data and enter it into a list. the next part is where i'm stuck. i create a for loop to go through the list line by line, but i guess i will also need to go through each line character by character. How do i do this? or is there a faster way of doing it? thanks in advance

    Read the article

  • How to check if a child-object is populated

    - by TheQ
    How can i check if a child-object of a linq-object is populated or not? Example code below. My model have two methods, one joins data, and the other does not: public static Member GetMemberWithPhoto(Guid memberId) { using (DataContext db = new DataContext()) { DataLoadOptions dataLoadOptions = new DataLoadOptions(); dataLoadOptions.LoadWith<Member>(x => x.UserPhoto); db.LoadOptions = dataLoadOptions; var query = from x in db.Members where x.MemberId == memberId select x; return query.FirstOrDefault(); } } public static Member GetMember(Guid memberId) { using (DataContext db = new DataContext()) { var query = from x in db.Members where x.MemberId == memberId select x; return query.FirstOrDefault(); } } Then my control have the following code: Member member1 = Member.GetMemberWithPhoto(memberId); Member member2 = Member.GetMember(memberId); Debug.WriteLine(member1.UserPhoto.ToString()); Debug.WriteLine(member2.UserPhoto.ToString()); The last line will generate a "Cannot access a disposed object" exception. I know that i can get rid of that exception just by not disposing the datacontext, but then the last line will generate a new query to the database, and i don't want that. What i would like is something like: Debug.WriteLine((member1.UserPhoto.IsPopulated()) ? member1.UserPhoto.ToString() : "none"); Debug.WriteLine((member2.UserPhoto.IsPopulated()) ? member2.UserPhoto.ToString() : "none"); Is it possible?

    Read the article

  • check array against each other, to determine response

    - by Johnny
    So, I have an array that has 6 variables in it that I need to check against each other.. to determine what to return to the script calling the function.. All fields are of the datetime type from the database they are derived from. the fields: in1 out1 in2 out2 in3 out3 Array: Array( 'in1' => '2012-04-02 10:00:00), `out1` => '2012-04-02 14:00:00`, `in2` => '2012-04-02 14:30:00`, `out2` => '2012-04-02 18:00:00`, `in3` => NULL, `out3` => NULL ) the response: clocked_in or clocked_out What I need to figure out is, the best way to determine if the user is clocked in or clocked out by checking against this array.. so, if in1, out1 and in2 are not NULL then the user would be clocked in.. if in1 is not NULL but out1 is NULL then the user would be clocked out, etc.. Anyone have any ideas on the easiest way to achieve this without too many if statements? [WHAT WORKED] for ($i=1; $i <= 3; $i++) { if ($entities["in$i"] != NULL) { $ents = "clocked_in"; if ($entities["out$i"] != NULL) { $ents = "clocked_out"; } if ($entities["out3"] != NULL) { $ents = "day_done"; } } }

    Read the article

  • xslt check for alpha numeric character

    - by Newcoma
    I want to check if a string contains only alphanumeric characters OR '.' This is my code. But it only works if $value matches $allowed-characters exactly. I use xslt 1.0. <xsl:template name="GetLastSegment"> <xsl:param name="value" /> <xsl:param name="separator" select="'.'" /> <xsl:variable name="allowed-characters">ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.</xsl:variable> <xsl:choose> <xsl:when test="contains($value, $allowed-characters)"> <xsl:call-template name="GetLastSegment"> <xsl:with-param name="value" select="substring-after($value, $separator)" /> <xsl:with-param name="separator" select="$separator" /> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$value" /> </xsl:otherwise> </xsl:choose> </xsl:template>

    Read the article

  • Doing a virus check on a file from a build script

    - by the_mandrill
    I would like to be be able to invoke a virus check as the final stage of the build process (please don't question why a dev machine would get a virus, it's just a belt-and-braces approach to avoid the risk of getting sued by customers...). Also I'd like the option of having AV on a machine but switching the auto file system protection off (at least for the build directories). What I would like is a generic way of scanning a file using whatever AV system is in place. I'm assuming that there's an Windows API to do this, given that Windows detects the presence of an AV system, and browsers such as Firefox invoke a virus scan whenever a file is downloaded. So what's the API that they're using? There's the Microsoft AntiVirus API but that seems to be specific to Office documents. Does the approach involve using WMI? (and if you can detect the AV provider from there, how do you then invoke it to scan a file?) I know that I could write the script to manually call the AV scanner that I know to be installed, but as an intellectual exercise I'm more interested to know how apps like Firefox are doing this.

    Read the article

  • How to check the correct radio button.

    - by MrW
    I have a Table containing some information that I need. All these rows also contains a column with a radio button in it so that the user is suppose to be able to check one of the rows as default. When I'm bringing the data back from the DB and want to select the one that's currentlly the default one. <% foreach (var item in (IEnumerable<Locale>) ViewData["Locales"]) { %> <tr> <td> <%= Html.Encode(item.Language.Name) %> </td> <td> <input type="radio" id="defaultLocale" name="defaultLocele" value="on" checked="<%= item.Default == false ? "false" : "true" %>" /> </td> I've also tried to do this: <input type="radio" id="defaultLocale" name="defaultLocele" value="on" checked="<%=item.Default == false ? "" : "checked" %>" /> but nothing seems to do the right thing. I always end up with having the last row in checked, which it isn't for sure.

    Read the article

  • PHP: Check if 0?

    - by tarnfeld
    Hi, I am using a class which returns me the value of a particular row and cell of an excel spreadsheet. To build up an array of one column I am counting the rows and then looping through that number with a for() loop and then using the $array[] = $value to set the incrementing array object's value. This works great if none of the values in a cell are 0. The class returns me a number 0 so it's nothing to do with the class, I think it's the way I am looping through the rows and then assigning them to the array... I want to carry through the 0 value because I am creating graphs with the data afterwards, here is the code I have. // Get Rainfall $rainfall = array(); for($i=1;$i<=$count;$i++) { if($data->val($i,2) != 'Rainfall') // Check if not the column title { $rainfall[] = $data->val($i,2); } } For your info $data is the excel spreadsheet object and the method $data->val(row,col) is what returns me the value. In this case I am getting data from column 2. Screenshot of spreadsheet http://cl.ly/1Dmy Thanks! All help is very much appreciated!

    Read the article

  • Check if NSString exists in custom object in NSArray

    - by Paul Peelen
    I have an NSArray with Store objects. Each Store object has two NSString objects; StoreID and Name. I would like to check quickly if an ID exists in this NSArray with Store objects. Example: Store *s1 = [[Store alloc] init]; s1.name = @"Some Name"; s1.id = @"123ABC"; Store *s2 = [[Store alloc] init]; s2.name = @"Some Other Name"; s2.id = @"ABC123"; NSArray *array = [[NSArray alloc] initWithObjects:s1, s2, nil]; NSString *myIdOne = @"ABCDEF"; NSString *myIdTwo = @"123ABC"; BOOL myIdOneExists = ...? BOOL myIdTwoExists = ...? Its the ...? I need to figure out. I know I can do this using a for loop and break when found... but this seems to me like an nasty approach since the NSArray could contain thousands of objects,... theoretically. So I would like to know about a better solution.

    Read the article

  • How to check Isavailablity in ajax?

    - by udaya
    Hi This is what i have in my view page <td width=""><input type="text" name="txtUserName" id="txtUserName" /></td> <td><input type="button" name="CheckUsername" id="CheckUsername" value="Check Availablity" onclick="Check_User_Name();"/></td> Onclick of the button the Check_User_Name function in my ajax.js loads This is the Check_User_Name function function Check_User_Name(source) { var UserName = document.getElementById('txtUserName').value; if(window.ActiveXObject) User_Name = new ActiveXObject("Microsoft.XMLHTTP"); else if(window.XMLHttpRequest) User_Name = new XMLHttpRequest(); var URL = newURL+"ssit/system/application/views/ssitAjax.php"; URL = URL +"?CheckUsername="+UserName; User_Name.onreadystatechange = User_Name_Fun; User_Name.open("GET",URL,true); User_Name.send(null); } function User_Name_Fun() { document.getElementById('User_div').innerHTML=User_Name.responseText; } Then I can have the value in echo username then the $result has all the user name Hows can i checkIsavailablity of username from here if(($_GET['CheckUsername']!="") || (isset($_GET['CheckUsername']))) { echo $UserName = $_GET['CheckUsername'];//echo username $_SESSION['state'] = $State; $queryres = "SELECT dUser_name FROM tbl_login WHERE dIsDelete='0'"; $result = mysql_query($queryres,$cn) or die("Selection Query Failed !!!");

    Read the article

  • Sanity check on this idea for an Image Viewer in a web app

    - by Charlie Flowers
    I have an approach in mind for an image viewer in a web app, and want to get a sanity check and any thoughts you stackoverflowers might have. Here's the whirlwind nutshell summary: I'm working on an ASP.NET MVC application that will run in my company's retail stores. Even though it is a web application, we own the store machines and have control over them. We have a "windows agent" running on the store machine which we can talk to via http post (it is a WCF service, and our web app has permission to talk to it from the browser). One of the web pages needs to be an "image viewer" page with some common things like Rotate & Zoom. Now, there are some WebForms controls that offer Rotate and Zoom. However, they take up server resources and generate a good bit of traffic between the server and the browser. For example, the Rotate function would cause an ajax call to the server, which would then generate a new image written to a .NET Canvas object, which would then be written to a file on the server, which would then be returned from the ajax call and refreshed inside the browser. Normally, that's a pretty good way of doing things. But in our case, we have code running on the store machine that we can communicate with. This leads me to consider the following approach: When the user asks to view an image, we tell our "windows agent" to download it from our image server to the store machine. We then redirect our browser to our image viewer page, which will pull the image from the local file we just wrote to the store machine. When the user clicks "Rotate", we cause JavaScript code in the browser to call our "windows agent" software, asking it to perform the "Rotate" function. The "windows agent" does the rotation using the same kind of imaging control that would formerly have been used on the server, but it does so now on the store machine. Javascript in the browser then refreshes the image on the page to show the newly rotated image. Zoom and similar features would be implemented the same way. This seems to be much more efficient, scalable, and responsive for the end-users. However, I've never heard of anything like it being done, mostly because it's rare to have this combination of a web app plus a "windows agent" on the client machine. What do you think? Feasible? Reasonable? Any pitfalls I overlooked or improvements / suggestions you can see? Has anyone done anything like this who would like to offer the wisdom of experience? Thanks!

    Read the article

  • check only one checkbox in gridview using jquery

    - by Gurbax Singh Bhangal
    i have a grid view in which i have placed the checkbox in itemtemplate i want only the one checkbox is selected from Gridview to select that perticular row so that i can use that id to edit or delete the row aspx page code is <asp:TemplateField Visible="false"> <ItemTemplate> <asp:Label ID="lblId" runat="server" Text='<%#Eval("id") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField> <HeaderTemplate> Select </HeaderTemplate> <ItemTemplate> <asp:CheckBox ID="chkSelect" runat="server"/> </ItemTemplate> </asp:TemplateField> <asp:TemplateField> <HeaderTemplate> Branch Name </HeaderTemplate> <ItemTemplate> <asp:Label ID="lblBranch_Name" runat="server" Text='<%# Bind("Branch") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField> <HeaderTemplate> Address </HeaderTemplate> <ItemTemplate> <asp:Label ID="lblAddress" runat="server" Text='<%# Eval("Address") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField> <HeaderTemplate> City </HeaderTemplate> <ItemTemplate> <asp:Label ID="lblCity" runat="server" Text='<%# Bind("City") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> </Columns> and i want when i click on the checkbox which is at first of each row only one check box is selected from all the rows thanks

    Read the article

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