Search Results

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

Page 51/841 | < Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >

  • C check if file exists, including on PATH

    - by Gary
    Hi, Given a filename in C, I want to determine whether this file exists and has execute permission on it. All I've got currently is: if( access( filename, X_OK) != 0 ) { But this wont search the PATH for files and will also match directories (which I don't want). Could anyone please help?

    Read the article

  • how to check session upon start in masterpage or in global.asax

    - by user572276
    i am new in asp.net form authentication and sessions i would like to know how to save session in masterpage or in global.asax and how to clear session how to better handle session timeout by redirecting to a page this is my web.config session settings <sessionState mode="InProc" cookieless="false" timeout="1"></sessionState> code in my masterpage if (Request.Url.AbsolutePath.EndsWith("SessionExpired.aspx", StringComparison.InvariantCultureIgnoreCase)) { HtmlMeta meta = new HtmlMeta(); meta.HttpEquiv = "Refresh"; meta.Content = "7; URL=./Login.aspx"; Page.Header.Controls.Add(meta); } else HttpContext.Current.Response.AppendHeader("Refresh", Convert.ToString((Session.Timeout * 60)) + "; Url=./Public/SessionExpired.aspx");

    Read the article

  • Check if the path input is URL or Local File

    - by Ahmed
    Hi All, I'm working in xmldataprovider and we have configuration value "source" this value may be local file or url like c:\data\test.xml --absolute data\test.xml --relative or url http:\mysite\test.xml how I can determine all this cases in code I'm working c#

    Read the article

  • Newbie PHP coding problem: header function (maybe, I need someone to check my code)

    - by Haskella
    Hi, consider the following PHP code: <?php $searchsport = $_REQUEST['sport']; $sportarray = array( "Football" => "Fb01", "Cricket" => "ck32", "Tennis" => "Tn43", ); header("Location: ".$sportarray[$searchsport].".html"); //directs user to the corresponding page they searched if ($searchsport == NULL) { header("Location: youtypednothing.html"); //directs user to a page I've set up to warn them if they've entered nothing } else { header("Location: sportdoesnotexist.html"); //if sport isn't in my root, a warning will appear } ?> I think the code comments are self-explanatory, basically when I type Tennis on my form.html it will send data to this php file and process and direct me to Tn43.html which is my tennis page. Unfortunately, it doesn't work and I really want to know why... (I know I've made some huge silly mistake). PS: Is header the right function to use when doing some redirecting?

    Read the article

  • how to prevent checkbox check when clicking on link inside label

    - by dalbaeb
    Hello, I have a link inside a label. The problem is, when user clicks 'back' after having read the terms, the checkbox is unchecked, because when they clicked on the link they also unchecked the box at the same time, since the link is inside a label. <input type="checkbox" id="terms" name="terms" checked="checked" /> <label for="terms">I agree to be bound by the <a href="/terms">Terms</a></label> How can I prevent the checkbox from being checked when link is clicked? Tried doing event.preventDefault() on label click, but that doesn't prevent checkbox from being checked/unchecked. I could just take out the link from inside a label (which means more CSS styling). But now I'm curious whether the above is possible.

    Read the article

  • jquery to check when a someone starts typing in to a field

    - by Drew
    $('a#next').click(function() { var tags = $('input[name=tags]'); if(tags.val()==''){ tags.addClass('hightlight'); return false; }else{ tags.removeClass('hightlight'); $('#formcont').fadeIn('slow'); $('#next').hide('slow'); return false; } }); I would like the above code to fire the fadeIn as soon as somebody starts typing into the tags input. Can somebody tell me the correct way to do this or point me in the right direction? Thanks in advance EDIT here is the code to do it: $('input#tags').keypress(function() { $('#formcont').fadeIn('slow'); $('#next').hide('slow'); }); The only problem I've found is that my cursor no longer shows up in the text box. What am I doing wrong?

    Read the article

  • After Trigger execute before constraint check in oracle

    - by satakare
    Hi, I have After Insert/Update trigger on Table T1 which get the referential data for Col1 from T2 and does some work and insert it into another table. The col1 is FK to Table T2. When user insert the incorrect or non existing value into the Col1 and if trigger is disabled I am getting constraint error that is fine. But when trigger is enabled and user insert the wrong value in Col1 trigger is getting fired and shows the 'no data found' error message. Actually I am expecting the table to throw constraint error, but trigger is throwing it. Please let me know your comments about this trigger behaviour.

    Read the article

  • Return only the new database items since last check in Rails

    - by Smith
    I'm fairly new to Ruby, and currently trying to implement an AJAX style commenting system. When the user views a topic, all the current comments on that topic will be displayed. The user can post a comment on the page of a topic and it should automatically display without having to refresh the page, along with any new comments that have been posted since the last comment currently displayed to the user. The comments should also automatically refresh at a specified frequency. I currently have the following code: views/idea/view.html.erb <%= periodically_call_remote(:update => "div_chat", :frequency => 1, :position => "top", :url => {:controller => "comment", :action => :test_view, :idea_id => @idea.id } ) %> <div id="div_chat"> </div> views/comment/test_view.html.erb <% @comments.each do |c| %><div id="comment"> <%= c.comment %> </div> <% end %> controllers/comment_controller.rb class CommentController < ApplicationController before_filter :start_defs def add_comment @comment = Comment.new params[:comment] if @comment.save flash[:notice] = "Successfully commented." else flash[:notice] = "UnSuccessfully commented." end end def test_render @comments = Comment.find_all_by_idea_id(params[:idea_id], :order => "created_at DESC", :conditions => ["created_at > ?", @latest_time] ) @latest = Comment.find(:first, :order => "created_at DESC") @latest_time = @latest.created_at end def start_defs @latest = Comment.find(:first, :order => "created_at ASC") @latest_time = @latest.created_at end end The problem is that every time periodically_call_remote makes a call, it returns the entire list of comments for that topic. From what I can tell, the @latest_time gets constantly reset to the earliest created_at, rather than staying updated to the latest created_at after the comments have been retrieved. I'm also not sure how I should directly refresh the comments when a comment is posted. Is it possible to force a call to periodically_call_remote on a successful save?

    Read the article

  • What is wrong with this null check for data reader

    - by Phil
    c.Open() r = x.ExecuteReader If Not r("filename").IsDbnull Then imagepath = "<img src='images/'" & getimage(r("filename")) & " border='0' align='absmiddle'" End If c.Close() r.Close() I have also tried; If r("filename") Is DBNull.Value Then imagepath = String.Empty Else imagepath = "<img src='images/'" & getimage(r("filename")) & " border='0' align='absmiddle'" End If c.Close() r.Close() The error is: Invalid attempt to read when no data is present. The idea of my code is to build an img src string only when data is available. Help greatly appreciated. Thanks

    Read the article

  • Broadcast receiver, check status, turning off connection with F8

    - by yoann
    I am using eclipse with android sdk 3.2 I have some problems to make my broadcast receiver working when the connection is lost. first I have checked the type of network to make sure I understand well : ConnectivityManager manager = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE); boolean is3g = manager.getNetworkInfo( ConnectivityManager.TYPE_MOBILE) .isConnectedOrConnecting(); boolean isWifi = manager.getNetworkInfo( ConnectivityManager.TYPE_WIFI) .isConnectedOrConnecting(); NetworkInfo info = manager.getActiveNetworkInfo(); if (info != null) Toast.makeText(getApplicationContext(), info.getTypeName(), Toast.LENGTH_LONG).show(); else Toast.makeText(getApplicationContext(), "Pas de connexion", Toast.LENGTH_LONG).show(); if (!is3g) Log.i("Network Listener", "DISCONNECTED"); else Log.i("Network Listener", "CONNECTED"); == this is a mobile network, I'm connected Then I press F8 or I make : telnet localhost 5554 gsm data off to stop the connection Here is my dynamic broadcast receiver in an activity : public class ActivityA extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.query); this.registerReceiver(this.networkStateReceiver, new IntentFilter( ConnectivityManager.CONNECTIVITY_ACTION)); } BroadcastReceiver networkStateReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { ConnectivityManager connMgr = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = connMgr.getActiveNetworkInfo(); //i have tried several things : State networkState = networkInfo.getState(); // if (networkState.compareTo(State.DISCONNECTED) == 0) ... if (networkInfo != null && networkInfo.isConnected()) { Toast.makeText(getApplicationContext(), "CONNECTED", Toast.LENGTH_LONG).show(); Log.i("Network Listener", "Connected"); } else { Toast.makeText(getApplicationContext(), "DISCONNECTED", Toast.LENGTH_LONG).show(); Log.i("Network Listener", "Network Type Changed"); Intent offline = new Intent(AccountInfoActivity.this, OfflineWorkService.class); startService(offline); } }; My manifest : <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> The problem is : when the activityA is launched, my broadcast receive something and it displays "Connected"(Log) and my toast. When I turn off the connection manually, nothing happend. My service is not started, log message are not displayed, only toast messages work ... And even better, when I turn on the connection again (by pressing F8), I test again the type of connection, Toast messages are shown but this time Log messages don't work. Problems happend when I press F8. Anyway, I think I miss something with broadcast receivers, it's not totally clear. Please help me.

    Read the article

  • XPath: How to check multiple attributes across similar nodes

    - by Justin
    Hi, If I have some xml like: <root> <customers> <customer firstname="Joe" lastname="Bloggs" description="Member of the Bloggs family"/> <customer firstname="Joe" lastname="Soap" description="Member of the Soap family"/> <customer firstname="Fred" lastname="Bloggs" description="Member of the Bloggs family"/> <customer firstname="Jane" lastname="Bloggs" description="Is a member of the Bloggs family"/> </customers> </root> How do I get, in pure XPath - not XSLT - an xpath expression that detects rows where lastname is the same, but has a different description? So it would pull the last node above? Thanks a mill if you can help, been scratching at it for ages, and I can't find it by searching (apologies if it is) Cheers, J

    Read the article

  • Rails: Check output of path helper from console

    - by Thor Thurn
    Rails defines a bunch of magic with named routes that make helpers for your routes. Sometimes, especially with nested routes, it can get a little confusing to keep track of what URL you'll get for a given route helper method call. Is it possible to, using the Ruby console, see what link a given helper function will generate? For example, given a named helper like post_path(post) I want to see what URL is generated.

    Read the article

  • Check user language selection in NSIS MUI2

    - by wls
    I have multiple language packs in my NSIS installer, using the MUI2 interface. Now I try to select the language pack, which is installed by the "Typical" installation type according to the user's chosen setup language. My problem is, that I can't figure out, how to get the user's language selection. I already tried to access the variables $LANGUAGE and $mui.LangDLL.RegistryLanguage, as well as trying to compare a defined language string to a specific translation string, but without success.

    Read the article

  • Check whether server is up in AppleScript

    - by Mark Szymanski
    I have an intranet server running on a Windows XP computer and the internet connection on it has been known to be pretty unreliable (surprise, surprise) so I was wondering if there was a way to use an AppleScript to poll it every hour or so to see if it is up and running and if it isn't, execute something, like send myself an email. Thanks in advance!

    Read the article

  • android: Check if a View is bringed to front

    - by user329692
    Hi Guys! I made a custom component which simple extends a WebView This component is used into activities that are loaded from a tabhost. This component creates a timertask too. I'd like to execute the task only if the activity that contains the component is visible. Ex: public class MyWebView extends WebView { public MyWebView(Context context, AttributeSet as) { super(context,as); /** More code **/ TimerTask ttask = new TimerTask() { @Override public void run() { if (iamvisible) doStuff(); } }; timer = new Timer(); timer.schedule(ttask, refreshInterval * 1000, refreshInterval * 1000); } } How can I set the iamvisible variable? I tried overriding onWindowFocusChanged and onWindowVisibilityChanged but with no luck Regards in advance

    Read the article

  • Ruby BigDecimal sanity check (floating point newb)

    - by Andy
    Hello, Hoping to get some feedback from someone more experienced here. I haven't dealt with the dreaded floating-point calculation before... Is my understanding correct that with Ruby BigDecimal types (even with varying precision and scale lengths) should calculate accurately or should I anticipate floating point shenanigans? All my values within a Rails application are BigDecimal type and I'm seeing some errors (they do have different decimal lengths), hoping it's just my methods and not my object types... Thanks!

    Read the article

  • Check whether Excel file is Password protected

    - by Torben Klein
    I am trying to open an Excel (xlsm) file via VBA. It may or may not be protected with a (known) password. I am using this code: On Error Resume Next Workbooks.Open filename, Password:=user_entered_pw opened = (Err.Number=0) On Error Goto 0 Now, this works fine if the workbook has a password. But if it is unprotected, it can NOT be opened. Apparently this is a bug in XL2007 if there is also workbook structure protection active. (http://vbaadventures.blogspot.com/2009/01/possible-error-in-excel-2007.html). On old XL2003, supplying a password would open both unprotected and password protected file. I tried: Workbooks.Open filename, Password:=user_entered_pw If (Err.Number <> 0) Then workbooks.open filename This works for unprotected and protected file. However if the user enters a wrong password it runs into the second line and pops up the "enter password" prompt, which I do not want. How to get around this?

    Read the article

  • anyone know of a custom membership provider implementation that check password strength against in-b

    - by ronaldwidha
    I've got an Asp.net MVC app and before being able to go live, the IT have requested for us to comply with their password policy. The flexibility of AspnetSqlMembershipProvider doesn’t quite satisfy the requirement. The password strength and length rules are as follows: one lowercase one Uppercase one number and or special character 8 characters in length so far, aspnetsqlmembershipprovider is good... Not allowed to use: Dictionary words Names, real or fictional Plain language phrases Dates Telephone numbers Car registration numbers User IDs Postal codes Organization name Only the first 4 criteria are satisfied by the aspnetsqlmembershipprovider. Do you know of any third party products that offers this functionality (preferably in the form of a custom membership provider)?

    Read the article

  • How to check for case sensitive in hibernate criteria

    - by dhiraj
    0 vote down star I have used hibernate to fetch the login information from the mysql database. But the problem is that say for example the user name is 'dhiraj' in the database, now the login is successful by entering the user name, but it is also allowing to enter by taking the user name in uppercase also, e.g., 'DHIRAJ'. I want to restrict it to as it in the database. Can you tell me how to achieve that in hibernate?

    Read the article

  • Best way to check for NULL value in MySql query

    - by PHP-Prabhu
    Can any one please let me know the best way to use IF statement in mysql query to show if the "email" field is NULL then it should show as "no email"... Postcode Telephone Email ---------------------------------------------------------- BS20 0QN 1275373088 no email BS20 0QN 1275373088 no email PO9 4HG 023 92474208 [email protected] SO43 7DS 07801 715200 [email protected] ----------------------------------------------------------

    Read the article

  • How can I check if Zend_Form_Elements has no decorators set

    - by jiewmeng
    I find that even if I just declare an element like $this->addElement('textarea', 'txt1'); I find that it already has decorators set Zend_Debug::dump($this->getElement('txt1')->getDecorators()); http://pastebin.com/7Y24g62w I want to test that I didn't set decorators using setDecorators() or using something like $this->addElement('textarea', 'txt1', array( 'decorators' => array(...) )); If I didn't set any decorators then apply default decorators, how can I do that. I want to apply default decorators per element basis, not using Zend_Form#setDisableLoadDefaultDecoraotrs()

    Read the article

  • how to check an ANTLR token is only used once or less in the parser

    - by Simon Kenyon Shepard
    In Antlr, if I have a rule for example: someRule : TOKENA TOKENB; it would accept : "tokena tokenb" if I would like TOKENA to be optional, I can say, someRule : TOKENA* TOKENB; then I can have : "tokena tokenb" or "tokenb" or "tokena tokena tokenb" but this also means it can be repeated more that once. Is there anyway I can say this token can be there 1 or less times but not more than one? so it would accept: "tokena tokenb" or "tokenb" BUT NOT "tokena tokena tokenb"? Many thanks

    Read the article

< Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >