Search Results

Search found 11318 results on 453 pages for 'josh close'.

Page 21/453 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • Mark text in HTML

    - by Alon
    Hi I have some plain text and html. I need to create a PHP method that will return the same html, but with <span class="marked"> before any instances of the text and </span> after it. Note, that it should support tags in the html (for example if the text is blabla so it should mark when it's bla<b>bla</b> or <a href="http://abc.com">bla</a>bla. It should be incase sensitive and support long text (with multilines etc) either. For example, if I call this function with the text "my name is josh" and the following html: <html> <head> <title>My Name Is Josh!!!</title> </head> <body> <h1>my name is <b>josh</b></h1> <div> <a href="http://www.names.com">my name</a> is josh </div> <u>my</u> <i>name</i> <b>is</b> <span style="font-family: Tahoma;">Josh</span>. </body> </html> ... it should return: <html> <head> <title><span class="marked">My Name Is Josh</span>!!!</title> </head> <body> <h1><span class="marked">my name is <b>josh</b></span></h1> <div> <span class="marked"><a href="http://www.names.com">my name</a> is josh</span> </div> <span class="marked"><u>my</u> <i>name</i> <b>is</b> <span style="font-family: Tahoma;">Josh</span></span>. </body> </html> Thanks.

    Read the article

  • Why isn't functional language syntax more close to human language?

    - by JohnDoDo
    I'm interested in functional programming and decided to get head to head with Haskell. My head hurts... but I'll eventually get it... I have one curiosity though, why is the syntax so cryptic (in lack of another word)? Is there a reason why it isn't more expressive, more close to human language? I understand that FP is good at modelling mathematical concepts and it borrowed some of it's concise means of expression, but still it's not math... it's a language.

    Read the article

  • JQuery UI Dialog - Ajax Update on success $(this).dialog('close');

    - by Dan
    Having issues referencing $(this) from within a the nested ajax 'success' function... I know this is a scope issue, but can't seem to find a clean way to close the dialog on a successful update. Thanks for any help. $("#dialog_support_option_form").dialog({ width: 400, height: 180, bgiframe: true, autoOpen: false, modal: true, buttons: { 'Save Support Option': function(){ $.ajax({ type: 'POST', url: "support_options/create_support_option.php", data: $(this).find('form').serialize(), success: function(data){ $("#list_support_options").html(data); $(this).dialog('close'); } }); }, 'Cancel': function(){ $(this).dialog('close'); } }, close: function(){ $(this).find('input').val(''); } });

    Read the article

  • How to close window in ie using link and onbeforeunload?

    - by Salil
    Hi All, I open a pop-up window using following code in main.html function openwindow(url) { window.open(url, "mywindow","location=1,status=1,scrollbars=1,resizable=no,width=650,height=650"); } Open In My child.html i used function closewindow() { self.close(); } function closeIt() { return "Your chat will be terminated. Are you sure?" } < a href="javascript:void(0)" onclick="closewindow();"Close Window< /a     When i click on close window it gize me alert message that i given on event onbeforeunload but it not close the window when i click on Ok.Also this happens only in I.E. & working fine in mozilla, netscape, safari. I checked it on IE6 & IE8 Any help is Appreciated. Regards, Salil Gaikwad

    Read the article

  • Jquery simplemodal close existing modal and open a new one?

    - by matthewsteiner
    Alright, so all modals already have an image at the top right to close them. How can I make additionally another anchor to do the same thing? I thought I could use the "closeClass" option which default to "simplemodal-close" and just add that class to an anchor, but it didn't have the desired effect. Is that what I'm supposed to do? Also, all modals will have a "contact us" link which should close it's own modal and open the contact modal. How can I wait until it is closed to open the next one? Ideas? $('a#ask').click(function(){ $.modal.close(function(){ }); $('#modal-contact').modal(); });

    Read the article

  • how to close a windows form in c# when that form transfer control to an other form?

    - by moon
    i have encountered a problem in my application i have two windows forms one that is loaded when my application is started and ask for a password and other is shown when click log in with correct password , problem is how can i close the first form that is log in form when user proceed to next from that is actual application, currently i hide the first form but the requirement is to close that form to prevent extra processing when i close that log in form my application is closed and when i close the actual application form that log in form remain open. my application is not fully closed, log in form is running in background how can in fix this....

    Read the article

  • what is the correct way to close a socket in python 2.6?

    - by davidshen84
    hi, i have a simple server/client. and i am using the netcat as the client to test the server. if i stop the server before the client exit, i will not be able to start the server again for a while and i go this error: " [Errno 98] Address already in use " but if i close the client first, then the server stops, i will not have this issue. my server socket works like this: try: s=socket s.bind(..) s.listen(1) conn,addr=s.accept() finally: conn.close() s.close() it feels to me that the server did not close the socket properly. but i do not know how to fix this.

    Read the article

  • Is there a keyboard shortcut to close windows from the Windows 7 taskbar window selector?

    - by Richard Szalay
    If, for example, Windows Explorer is in the first position of the taskbar and there are multiple explorer windows open, holding START and pressing 1 will cycle through the available windows and display an x on the top-right of the selected item that can be clicked to close the window. Is there a keyboard shortcut to close the selected window while still keeping the window list around (moving to the next item)?

    Read the article

  • How to get warning massage when clicking close(X) button of browser with tabs in Google Crome

    - by Shantanu
    How to get a warning massage if i accidently click the close button of the chrome browser which have multiple tabs opened at that time? I am a regular user of Crome and having this problem while using it. I normally open multiple tabs inside a single browser but sometimes i accidently click the close button of browser and as soon as the button is clicked crome does't give any warning issue about multiple active tabs and close the entire window. Is the end user like me is browsing on normal crome window then he can open the websites again by checking the web history but if he is browsing inside private browser then he can't do anything(this happens with me very regularly because i normally browse in private browser). On the other hand if you accidently click the close button in mozilla which have multiple tabs open it throws a warning massage to the user and asks for his wish.

    Read the article

  • How do you automatically close 3rd party applications when LiberKey is shut down?

    - by NoCatharsis
    Within LiberKey, I have added my own portable applications that are not included within the LiberKey library. When you go into the Properties menu for the app in the LiberKey UI, the Advanced tab has an option for Autoexecute. This dropdown menu seems to have no visible effect, at least on my current installation. I found that I could right click within the primary GUI and select "Add software group", add all 3rd party applications, then go to the Advanced tab within THAT Properties screen and select Autoexecute - "Always on startup". This solved the problem for starting the apps when LiberKey starts. However, now I'm having the same issue when closing out LiberKey. I have created a new 3rd party app that calls the same .exe, but sends the Parameter "/close". I then went to the Advanced tab and selected Autoexecute - "Always on shutdown". Seems pretty logical right? But the apps will not close on LiberKey shutdown. I cannot handle the app close-outs in the same way with a software group, as I did with the startup issue because the Autoexecute drop-down does not have an "Always on shutdown" option. Unfortunately, many of the Q&A forums on liberkey.com are in French and I took Spanish in high school. Otherwise I've not been able to find a workable answer. Any suggestions?

    Read the article

  • How to get desired FireFox last tab behavior?

    - by JustJeff
    All tabs should be the same; so if any of the have a 'close' button, they all should, including the last tab. I see no reason that a tab's close button should suddenly vanish simply b/c that tab has become the last one open. If I have N tabs open, and park the mouse over the left-most tab's close button, this vanishing close button trick means now I have to make a large mouse move to get to the app's close button. Unsat. Mouse moves = too many milliseconds wasted. Closing the last tab should NOT take me to my home page, or any other page whatsoever. I want the browser to close with the last tab. I do not expect or want "new tab" behavior when I click a Close button. Now, I've gone into about:config and played with browser.tabs.closeWindoWithLastTab, but this setting oversteps its purpose; while it does make the browser close, for some inexplicable reason, it also suppresses the last tab's close button! I have tried the "last tab close button" add-on, and while this does restore the close button, the add-on oversteps by taking the liberty of turning closeWindowWithLastTab off. Is there some way out of this pickle? Is it too hard to just code things to provide simple, orthogonal actions, so that everybody can config the UI to their liking, and not just to a few pre-fab configurations that the developers think everyone should like? Btw, FF 13.0.1 on ms windows

    Read the article

  • When can an FTP server close its passive connections?

    - by Don Kirkby
    Does the FTP protocol allow the server to close any of its passive connections while the client is still connected? Can it tell when the client is finished receiving and then close the connection? I'm including an FTP server in my application using the pyftpdlib Python project. I've got it to work in active and passive mode, but I'm a bit concerned about when it closes its passive connections. I've tried connecting to it with both FileZilla and the default ftp command in Ubuntu, and in both cases, I get a new passive port for every request. That is, if I sit in the root folder and type ls 10 times, I use up 10 ports. This means that I have to allocate a big block of passive ports for the FTP server to use so it won't run out. As soon as the client disconnects, the server releases all the passive connections associated with that client and those ports can be reused. However, a long-running connection could use up a lot of ports.

    Read the article

  • Focus previous window when I close one instead of one of the same application in Mac OS X?

    - by lilydjwg
    The situation is: I have one MacVim open for coding. Then I switch to iTerm to run git commit, which will open a new MacVim for editing the commit message per my setting. The problem is, when I finish writing the commit message and close the MacVim window, the previous iTerm window is not focused. The other MacVim window is focused instead. Is there any way I can change this behaviour? I just want the previous window get focused when I close a window.

    Read the article

  • How to close all tabs in Safari using AppleScript?

    - by Form
    I have made a very simple AppleScript to close all tabs in Safari. The problem is, it works, but not completely. Here's the code: tell application "Safari" repeat with aWindow in windows repeat with aTab in tabs of aWindow aTab close end repeat end repeat end tell I've also tried this script: tell application "Safari" repeat with i from 0 to the number of items in windows set aWindow to item i of windows repeat with j from 0 to the number of tabs in aWindow set aTab to item j of tabs of aWindow aTab close end repeat end repeat end tell ... but it does not work either. I tried that on my system (MacBook Pro jan 2008), as well as on a Mac Pro G5 under Tiger and the script fails on both, albeit with a much less descriptive error on Tiger. The problem is that only a couple of tabs are closed. Running the script a few times closes a few tab each time until none is left, but always fails with the same error after closing a few tabs. Under Leopard I get an out of bounds error. Since I am using fast enumeration (not using "repeat from 0 to number of items in windows") I don't see how I can get an out of bounds error with this... My goal is to use the Cocoa Scripting Bridge to close tabs in Safari from my Objective-C Cocoa application but the Scripting Bridge fails in the same manner. The non-deletable tabs show as NULL in the Xcode debugger, while the other tabs are valid objects from which I can get values back (such as their title). In fact I tried with the Scripting Bridge first then told myself why not try this directly in AppleScript and I was surprised to see the same results. I must have a glaring omission or something in there... (seems like a bug in Safari AppleScript support to me... :S) I've used repeat loops and Obj-C 2.0 fast enumeration to iterate through collections before with zero problems, so I really don't see what's wrong here. Anyone can help? Thanks in advance!

    Read the article

  • In Python, how to make sure database connection will always close before leaving a code block?

    - by Cawas
    I want to prevent database connection being open as much as possible, because this code will run on an intensive used server and people here already told me database connections should always be closed as soon as possible. def do_something_that_needs_database (): dbConnection = MySQLdb.connect(host=args['database_host'], user=args['database_user'], passwd=args['database_pass'], db=args['database_tabl'], cursorclass=MySQLdb.cursors.DictCursor) dbCursor = dbConnection.cursor() dbCursor.execute('SELECT COUNT(*) total FROM table') row = dbCursor.fetchone() if row['total'] == 0: print 'error: table have no records' dbCursor.execute('UPDATE table SET field="%s"', whatever_value) return None print 'table is ok' dbCursor.execute('UPDATE table SET field="%s"', another_value) # a lot more of workflow done here dbConnection.close() # even more stuff would come below I believe that leaves a database connection open when there is no row on the table, tho I'm still really not sure how it works. Anyway, maybe that is bad design in the sense that I could open and close a DB connection after each small block of execute. And sure, I could just add a close right before the return in that case... But how could I always properly close the DB without having to worry if I have that return, or a raise, or continue, or whatever in the middle? I'm thinking in something like a code block, similar to using try, like in the following suggestion, which obviously doesn't work: def do_something_that_needs_database (): dbConnection = MySQLdb.connect(host=args['database_host'], user=args['database_user'], passwd=args['database_pass'], db=args['database_tabl'], cursorclass=MySQLdb.cursors.DictCursor) try: dbCursor = dbConnection.cursor() dbCursor.execute('SELECT COUNT(*) total FROM table') row = dbCursor.fetchone() if row['total'] == 0: print 'error: table have no records' dbCursor.execute('UPDATE table SET field="%s"', whatever_value) return None print 'table is ok' dbCursor.execute('UPDATE table SET field="%s"', another_value) # again, that same lot of line codes done here except ExitingCodeBlock: closeDb(dbConnection) # still, that "even more stuff" from before would come below I don't think there is anything similar to ExitingCodeBlock for an exception, tho I know there is the try else, but I hope Python already have a similar feature... Or maybe someone can suggest me a paradigm move and tell me this is awful and highly advise me to never do that. Maybe this is just something to not worry about and let MySQLdb handle it, or is it?

    Read the article

  • Can one thread open a socket and other thread close it?

    - by Pkp
    I have some kernel threads in Linux kernel, inside my KLM. I have a server thread, that listens to the channel, Once it sees there is an incoming connection, it creates an accept socket, accepts the connection and spawns a child thread. It also passes the accepted socket to the child kernel thread as the (void *) argument. The code is working fine. I had a design question. Suppose now the threads have to be terminated, main and the child threads, what would be the best way to close the accept socket. I can see two ways, 1] The main thread waits for all the child threads to exit, each of the child threads close the accept sockets while exiting, the last child thread passes a signal to the main thread for it to exit . Here even though the main thread was the one that created the accept socket, the child threads close that socket, and they do this before the main thread exits. So is this acceptable? Any problems you guys forsee here? 2] Second is the main thread closes all the accept sockets it created before it exits. But there may be a possibility(corner case) that the main thread gets an exception and will have to close, so if it closes the accept sockets before exiting, the child threads using that socket will be in danger. Hence i am using the first case i mentioned.Let me know what you guys think?

    Read the article

  • Can I use MX records to deliver some addresses to Google Apps and some to my server?

    - by Josh
    I have whm installed on my VPS, which my domain MX records are pointing to: 0:mail.mydomain.com and whm/cpanel has mail forwarding rules which pipes certain @mydomain email addresses into my CRM software. But for certain email addresses I want to forward into Google Apps. For example, [email protected], [email protected] pipes into cPanel -- CRM (mail.mydomain.com) but [email protected] should be going to Google MX records. Is that possible? The reason why is I want to register for Google Apps such as analytics and other Google services under [email protected]. My initial thoughts were to add a subdomain such as [email protected] and point that subdomain's MX records to Google.. but I want to avoid this if possible.

    Read the article

  • What is JDBC's Connection.isClosed() good for, and why is Snaq DBPool misbehaving on close?

    - by Uri
    I have the following code in Java: if(!conn.isClosed()) { conn.close(); } Instead of working, I am awarded with: java.sql.SQLException: Connection already closed My connection object is a Snaq.db.CacheConnection I checked the JavaDocs for isClosed, and they state that: This method generally cannot be called to determine whether a connection to a database is valid or invalid. A typical client can determine that a connection is invalid by catching any exceptions that might be thrown when an operation is attempted. So my questions are: 1) What good is JDBC's isClosed() anyway? Since when do we use Exceptions in Java to check for validity? 2) What is the correct pattern to close a database? Should I just close and swallow exceptions? 3) Any idea why would SnaqDB be closing the connection? (My backend is a Postgres 8.3)

    Read the article

  • how come we need not close the handle returned by ShellExecute ?

    - by fred-hh
    On success, ShellExecute returns a handle. Do we need to close this handle, and if so, how ? According to examples published my Microsoft, we need not close this handle. But the doc of ShellExecute itself is mute on the subject. Can you confirm we indeed do not need to close this handle ? But then, how can a handle be valid and in no need of being closed ??? Which of the following statements is/are true: the handle is invalid and we can't do anything with it; the handle is never freed and there is a (Microsoft-sponsored) memory leak (until the caller program ends); the handle is automatically freed by the system at some time and never reused afterwards (- another kind of resource leak). Only on trying to use it can we know whether it still points to something. what else ?

    Read the article

  • Better way to kill a Form after the FormClosing event is overridden to hide rather than close?

    - by Paul Sasik
    I have a simple Windows Form that hosts property controls at runtime. To keep the window and its contents alive rather than killing it by handling the FormClosing event, cancel the event and simply hide the form. That's fine but at close of the application I need to actually close the window. I implemented the below but it feels kludgey. Is there a simpler, more clever way to handle this situation? (The form's controller calls KillForm explicitly after it receives a closing event from the main window.) Friend Class HostForm Private _hideInsteadOfClosing As Boolean = True Private Sub HostForm_FormClosing(ByVal sender As Object, ByVal e As FormClosingEventArgs) _ Handles Me.FormClosing If _hideInsteadOfClosing Then Me.Hide() e.Cancel = True End If End Sub Public Sub KillForm() _hideInsteadOfClosing = False Me.Close() End Sub End Class

    Read the article

  • Correct way to close database connection in event of exception.

    - by lowlyintern
    /I have some code of of the following form. Does this mean the connection is left open if there is an exception? Note, I am using a Microsoft SQL compact edition database./ try { SqlCeConnection conn = new SqlCeConnection(ConnectionString); conn.Open(); using (SqlCeCommand cmd = new SqlCeCommand("SELECT stuff FROM SomeTable", conn)) { // do some stuff } conn.Close(); } catch (Exception ex) { ExceptionManager.HandleException(ex); } /*Surely a better way would be to declare a connection object before the try, establish a connection inside the try block and close it in a finally block? */ SqlCeConnection conn = null; try { conn = new SqlCeConnection(ConnectionString); conn.Open(); using (SqlCeCommand cmd = new SqlCeCommand("SELECT stuff FROM SomeTable", conn)) { // do some stuff } } catch (Exception ex) { ExceptionManager.HandleException(ex); } finally { if( conn != null ) conn.Close(); }

    Read the article

  • How do you modify a modal popup from ASP codebehind instead of letting it close?

    - by user328422
    I'm using SimpleModal to create a popup on an ASP.net application. The OK button calls a server-side function - and based on the resulta of that function I'd like to modify the popup (make some things visible, etc.) instead of letting it close. If that's too difficult, I'd like to open the popup again without the user having to re-click on anything. I'm just not sure what the best way to do this is. Currently the OK button in the popup looks like this: <asp:ImageButton ID="submitInfoBtn" OnClick="btnSubmitInfo_Click" ImageUrl="css/assets/btn_ok.png" runat="server"/> and there is nothing defined that tells anything that the OK button should close the popup (the Cancel button has class="simplemodal-close", so I would expect it to do just that, but not the OK button) - anyone have any ideas on the best way through this? Thanks in advance!!

    Read the article

  • How to change security configutarion in IE8 for Intranet pages, such that Javascript can close a Win

    - by Martín Fixman
    I am developing a system that uses a little Internet page as a front-end for the whole program. Since I need to use ActiveX (sigh), the page must work on Internet Explorer. However, after some actions have been done the page needs to close itself. Using window.close() on Javascript it works, but before closing it prompts the user if it wants to close the Window. The ideal would be that it closes automatically. Is there any way to make IE8 (changing an option on the browser, not a code-only solution) not to prompt before closing the Window?

    Read the article

  • How can I close my software in a save way?

    - by Roman
    Up to now I used my application as a stand alone product. So, when user pressed "Stop" button I called System.exit(0); and it was fine. Now my application will be called (in a programmatic way) from another program. So, I afraid that System.exit(0); will kill not only my process but also the external software which started my program. So, what is the correct way to shutdown my application if a corresponding request from an external software is received? My application is an GUI application. So, I want to close the window but I also want to close all processes performed by my program. ADDED: To be more specific, I want to close all threads started by my program. My program does not start any OS process or any other program.

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >