Search Results

Search found 8013 results on 321 pages for 'clean urls'.

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

  • How to properly clean up Excel interop objects in C#

    - by HAdes
    I'm using the Excel interop in C# (ApplicationClass) and have placed the following code in my finally clause: while (System.Runtime.InteropServices.Marshal.ReleaseComObject(excelSheet) != 0) { } excelSheet = null; GC.Collect(); GC.WaitForPendingFinalizers(); Although, this kind of works the Excel.exe process is still in the background even after I close Excel. It is only released once my application is manually closed. Anyone realize what I am doing wrong, or has an alternative to ensure interop objects are properly disposed of. Thanks.

    Read the article

  • COM Object Clean Up

    - by Reggie McCray
    What is the difference between the two lines of code below: CComPtr< IInterface > m_interface; IInterface* m_interface; I know that CComPtr help eliminate memory leaks, but I am getting inconsistent results. When declaring the pointer with CComPtr< IInterface > m_interface; and using the interface in my C# code there are no errors, however using the Interface in VC++ I get an unhandled exception error, even if I comment out the instance creation of IInterface. I am pretty sure the problem is in here somewhere: STDMETHODIMP CSomeClass::get_IClass(IClass** var) { return m_class_var->QueryInterface(var); } STDMETHODIMP CSomeClass::putref_IClass(IClass* var) { m_class_var = var; return S_OK; } When I declare the interface pointer with: IInterface* m_interface; I get a RPC_E_SERVERFAULT error when testing the Interface in C# and have to explicitly call GC.Collect() to avoid the error being thrown after instantiation of a few objects. When testing the Interface in VC++ the error is consistent however when it occurs is different. If I comment out the instance creation of IInterface the code runs fine, however when I try to create an instance I get same error as before, just a vague unhandled exception error. What am I doing wrong here?

    Read the article

  • Clean separation of UI with Caliburn MVVM

    - by sylvie
    Looking into various MVVM frameworks for SL. In the Caliburn documentation I saw a code in a controller that calls MessageBox. Is this right or is this just for intro? Is there something like MessageBox service in Caliburn like in Chinch MVVM?

    Read the article

  • Can this be considered Clean Code / Best Practice?

    - by MRFerocius
    Guys, How are you doing today? I have the following question because I will follow this strategy for all my helpers (to deal with the DB entities) Is this considered a good practice or is it going to be unmaintainable later? public class HelperArea : AbstractHelper { event OperationPerformed<Area> OnAreaInserting; event OperationPerformed<Area> OnAreaInserted; event OperationPerformed<Area> OnExceptionOccured; public void Insert(Area element) { try { if (OnAreaInserting != null) OnAreaInserting(element); DBase.Context.Areas.InsertOnSubmit(new AtlasWFM_Mapping.Mapping.Area { areaDescripcion = element.Description, areaNegocioID = element.BusinessID, areaGUID = Guid.NewGuid(), areaEstado = element.Status, }); DBase.Context.SubmitChanges(); if (OnAreaInserted != null) OnAreaInserted(element); } catch (Exception ex) { LogManager.ChangeStrategy(LogginStrategies.EVENT_VIEWER); LogManager.LogError(new LogInformation { logErrorType = ErrorType.CRITICAL, logException = ex, logMensaje = "Error inserting Area" }); if (OnExceptionOccured != null) OnExceptionOccured(elemento); } } I want to know if it is a good way to handle the event on the Exception to let subscribers know that there has been an exception inserting that Area. And the way to log the Exception, is is OK to do it this way? Any suggestion to make it better?

    Read the article

  • Clean and accesible Other option (Check box and text box)

    - by Svish
    When I have a set of either check boxes or radio buttons I often need to have an Other choice. This check box or radio button is very often accompanied by a text box where the user is supposed to fill out what this Other is. How do you usually handle this set up? What kind of markup do you use? What do you require in your validation? Do you use java script for anything? For example: How do you make the form accessible? Do you use and how do you use the label tag, for example. Do you connect the check box and text box in any way with some javascript? For example, do you activate the text box when the check box is checked? Do you check or uncheck the check box automatically if the text box is filled out or cleared? Do you let validation fail with error messages if the check box is checked but the text box is not filled out, or if the text box is filled out but the check box is not checked? Or do you just consider it not filled out and not checked? Very unsure how to best deal with this issue, so any advice and examples are most welcome c",)

    Read the article

  • WCF Self-hosted service, client clean-up on service stop

    - by Sentax
    Hi everyone, I'm curious to know how I would go about setting up my service to stop cleanly on the server the service will be installed on. For example when I have many clients connecting and doing operations every minute and I want to shut-down the service for maintenance, how can I do this in the "OnStop" event of the service to then let the main service host to deny any new client connections and let the current connections finish before it actually shuts down its services to the client, this will ensure data isn't corrupted on the server as the server shuts down. Right now I'm not setup as a singleton because I need scalability in the service. So I would have to somehow get my service host to do this independently of knowing how many instances are created of the service class. I hope I explain myself good enough, if not, let me know, I'll try to explain better. Thanks, Scott

    Read the article

  • Clean stop of Python bottle webserver when started from subprocess

    - by luc
    Hello all, I would like to embed the great Bottle web framework into a small application (1st target is Windows OS). This app starts the bottle webserver thanks to the subprocess module. import subprocess p = subprocess.Popen('python websrv.py') The bottle app is quite simple @route("/") def index(): return template('index') run(reloader=True) It starts the default webserver into a Windows console. All seems Ok except the fact that I must press Ctrl-C to close the bottle webserver. I would like that the master app terminates the webserver when it shutdowns. I can't find a way to do that (p.terminate() doesn't work in this case unfortunately) Any idea? Thanks in advance

    Read the article

  • Scrambling URLS for dynamic data

    - by ggonsalv
    What is the best method to obfuscate the urls created in Dynamic Data? eg \Products\List.aspx?ProductId=2 could become \Products\List.aspx?x=UHJvZHVjdElkPTI= where "ProductId=2" is base 64 encoded to prevent casual snooping on \Products\List.aspx?ProductId=3 \Products\List.aspx?ProductId=4 etc...? I will probably have to inherit from an existing object and override some function The question is which object and what function GetActionPath of the Metamodel object seems interesting, but how does the DynamicRoute "{table}/{Action}.aspx" play in into it... Right now on Asp.net 1.1 site I use an custom implementation of the following code. http://www.mvps.org/emorcillo/en/code/aspnet/qse.shtml It is HTTPModule that uses regular expression to rewrite all the querystrings and also with reflection changes the Querystring collection with decoded values. So where is the hook to affect the change.

    Read the article

  • ASP.NET MVC - creating and handling with URLs with Greater Than and Less Than characters

    - by pcampbell
    Consider a link to a page for a user's profile. A page is creating that URL like this: //Model.Name has value "<bad guy>" Html.ActionLink("foo, "ViewUser", new { id=5, title=Url.Encode(Model.Name) }) The actual outcome was http://mysite/Users/5/%253cbad%2guy%253e When navigating to that URL, the server generates a HTTP Error 400 - Bad Request. Question: Given that the Model.Name may contain Unicode characters, or characters otherwise illegal in URLs, what's the best way to strip out illegal characters, or otherwise encode them? The problem surfaces when testing out 'interesting' user inputs with < and >, but anything could come from the user, and therefore be put in a URL by way of Model.Name.

    Read the article

  • Clean Web.Config file in Asp.NET 4.0?

    - by Braveyard
    Okay, I am wondering having clear web.config file could be good but you know some shared web hosting companies don't allow us to touch things like machine.config and etc. So If a lot of things have been moved onto machine.config, then will we be allowed to change things like we used to through web.config file.

    Read the article

  • CSS for https urls

    - by Vincent
    Hello, looking for some help with images referenced within the stylesheet. I have no problems with these from non secure locations within the site but only from https. The stylesheet loads fine and displays everything correctly except for the images. example: body { margin: 0; padding: 0; background: url(/img/background_tile.gif) top left repeat-x; text-align: center; background-color: #fff; } All my css files and other image paths inside the code use relative urls to images. How can I make sure they all work fine without hard coding my image paths with https or http? I want the code to work fine with http and https. Thanks

    Read the article

  • Personalization in ASP.Net MVC -- friendly URLs, and skinning

    - by larryq
    Hi everyone, I haven't delved into custom generation of friendly URLs in ASP.Net MVC, and was wondering if anyone had suggestions. For example, if John Smith were to create an account on www.example.com, I'd like for his homepage to read www.example.com/JohnSmith -- along with the option for him to choose his URL. The ideal is for this to happen with no intervention on my part in the route maps. Also, does anyone have guidelines on good ways to go to customize an MVC site based on URL? Again, using example.com I'd like for John to choose a color theme and logo for his homepage, then apply it accordingly. Thanks for your tips and suggestions.

    Read the article

  • Android View.onDraw() always has a clean Canvas

    - by CaseyB
    I am trying to draw an animation. To do so I have extended View and overridden the onDraw() method. What I would expect is that each time onDraw() is called the canvas would be in teh state that I left it in and I could choose to clear it or just draw over parts of it (This is how it worked when I used a SurfaceView) but each time the canvas comes back already cleared. Is there a way that I can not have it cleared? Or maybe save the previous state into a Bitmap so I can just draw that Bitmap and then draw over top of it?

    Read the article

  • Programmatically clean Word generated HTML while preserving styles?

    - by GeReV
    In my current company, we have this decade old... let's call it a "Hello World" application. While wanting to create a newer version of it, we also want to preserve older entries. These older entries contain hideous Word generated HTML which was never filtered before. If and when we move to a newer system, I'd generally prefer to have that HTML cleaned and filtered in order to have the site comply with HTML standards as much as possible. However, just cleaning that code like Jeff Atwood described in his blog or in any other way I know of would also ruin the style and formatting. Now, that just might cause our users to revolt and then all hell will break loose... Not a very good idea. Question is -- can Word's HTML be cleaned while preserving basic formatting? (e.g: coloring, italicized, bold text and so on) Preferably using publicly available code or library, such as HTML Tidy, examples in C# would be much appreciated. Thanks!

    Read the article

  • Jquery Cluetip - clean up between ajax loaded content

    - by ted776
    Hi, I'm using the jquery cluetip plugin and trying to figure out how to remove any open cluetip dialogs once i load new content via ajax. I am either stuck with the dialog boxes still showing on top of new content, or the ways i've tried to fix this actually remove all future cluetip dialogs from showing at all. Here's my code, thanks for any help. On dom ready i instantiate cluetip as below. //activate cluetip $('a.jTip').cluetip({ attribute: 'href', cluetipClass: 'jtip', arrows: true, activation: 'click', ajaxCache: false, dropShadow: true, sticky: true, mouseOutClose: false, closePosition: 'title' }); When i'm loading new content, I have the following code. The problem i have is that $('.cluetip-jtip').empty() prevents dialog boxes from opening on any of the new content loaded in, while the destroy function doesn't remove any open dialog boxes, but just destroys the current object. $('.next a').live("click", function(){ var toLoad = $(this).attr('href'); var $data = $('#main_body #content'); $.validationEngine.closePrompt('body'); //close any validation messages $data.fadeOut('fast', function(){ $data.load(toLoad, function(){ $data.animate({ opacity: 'show' }, 'fast'); //reinitialise datepicker and toolip $(".date").date_input(); //JT_init(); $('.hidden').hide(); //scroll to top of form $("html,body").animate({ "scrollTop": $('#content').offset().top + "px" }); //remove existing instance //$('a.jTip').cluetip('destroy'); //remove any opened popups $('.cluetip-jtip').empty(); //reinitialise cluetip $('a.jTip').cluetip({ attribute: 'href', cluetipClass: 'jtip', arrows: true, activation: 'click', ajaxCache: false, dropShadow: true, sticky: true, mouseOutClose: false, closePosition: 'title' }); }); }); return false; });

    Read the article

  • Restrict the page to be browsed in the other browser with the same urls

    - by subash
    how to restrict the page to be browsed in the other browser with the same urls with out logging asp.net & c#.net. i followed the following steps for example: i am logging in to a page developed in asp.net & c#.net. i am viewing a page.Let it be admin page. i am copying the url of the admin page. i am opening another browser window and pasting the url. i was able to see the same admin page in the other browser. the question is how to restrict the opening of admin page in other browser,if they try to open admin page in another browser while user is currently viewing the admin page then it should be redirected to the login page? how could this be accomplished? is there any thing could be done with "login" control tool of the .net frame work?

    Read the article

  • Clean URLs mod_rewrite & wildcard subdomains

    - by Søren Zet
    I got this url http://domain.com/blogs/directory-param with this rule RewriteBase /blogs/directory/ RewriteRule ^/blogs/directory-([A-Za-z0-9-]+)$ /blogs/directory/index.php?cat=$1 [L] so I get /blogs/directory/index.php?cat=param now my problem is the following: I use wildcards subdomains so every *.domain.com is mapped to domain.com/blogs/ for example soeren.domain.com is mapped to domain.com/blogs and so on... My problem now is I want a rule for soeren.domain.com/directory-param which points to domain.com/blogs/directory?index.php?cat=param Do you have any ideas?

    Read the article

  • How to clean sys.conversation_endpoints

    - by Manjoor
    I have a table, a trigger on the table implemented using service broker. More than Half million records are inserted daily into the table. The asynchronous SP is used to check sveral condition by using inserted data and update other tables. It was running fine for last 1 month and the SP was get executed withing 2-3 seconds of insertion of record. But now it take more than 90 minute. At present sys.conversation_endpoints have too much records. (Note that all the table are truncated daily as I do not need those records day after) Other database activities are normal (average 60% CPU Utilization). Now where i need to look?? I can re-create database without any problem but i don't think it is a good way to resolve the problem

    Read the article

  • standard way to perform a clean shutdown with Boost.Asio

    - by Timothy003
    I'm writing a cross-platform server program in C++ using Boost.Asio. Following the HTTP Server example on this page, I'd like to handle a user termination request without using implementation-specific APIs. I've initially attempted to use the standard C signal library, but have been unable to find a design pattern suitable for Asio. The Windows example's design seems to resemble the signal library closest, but there's a race condition where the console ctrl handler could be called after the server object has been destroyed. I'm trying to avoid race conditions that cause undefined behavior as specified by the C++ standard. Is there a standard (correct) way to stop the server? So far: #include <csignal> #include <functional> #include <boost/asio.hpp> using std::signal; using boost::asio::io_service; extern "C" { static void handle_signal(int); } namespace { std::function<void ()> sighandler; } void handle_signal(int) { sighandler(); } int main() { io_service s; sighandler = std::bind(&io_service::stop, &s); auto res = signal(SIGINT, &handle_signal); // race condition? SIGINT raised before I could set ignore back if (res == SIG_IGN) signal(SIGINT, SIG_IGN); res = signal(SIGTERM, &handle_signal); // race condition? SIGTERM raised before I could set ignore back if (res == SIG_IGN) signal(SIGTERM, SIG_IGN); s.run(); // reset signals signal(SIGTERM, SIG_DFL); signal(SIGINT, SIG_DFL); // is it defined whether handle_signal can still be in execution at this // point? sighandler = nullptr; }

    Read the article

  • delphi tidhttp get procedure not working on some urls

    - by davy yabut
    Hi guys, I am encountering a problem in delphi Tidhttp component wherein the GET procedure cant fetch a specific url but on other urls it is working. Example this code cant fetch the error_url but if you change the error_url to any valid url its working: procedure TForm1.Button1Click(Sender: TObject); var Response : TStringStream; error_url: string; begin error_url := 'http://www.chefscatalog.com/international/home.aspx'; //error url Response := TStringStream.Create; try IdHTTP1.Get(error_url, Response); Memo1.Text := Response.DataString; finally FreeAndNil(Response); end; end; By the way idHTTP1 redirect property is set here to true so redirection is not the problem. you can download the source code (which is indytest.zip) of this project in this link http://www.yourfilelink.com/get.php?fid=534933 Please help me guys. Thanks in advance :)

    Read the article

  • JDOM Parser and Namespace how to get clean Content

    - by senzacionale
    MY xml: <?xml version="1.0"?> <company xmlns="http://www.xx.com/xx"> <staff> <firstname>yong</firstname> <lastname>mook kim</lastname> <nickname>mkyong</nickname> <salary>100000</salary> </staff> <staff> <firstname>low</firstname> <lastname>yin fong</lastname> <nickname>fong fong</nickname> <salary>200000</salary> </staff> </company> Reader in = new StringReader(message); Document document = (Document)saxBuilder.build(in); Element rootNode = document.getRootElement(); List<?> list = rootNode.getChildren("staff", Namespace.getNamespace("xmlns="http://www.infonova.com/MediationFeed"")); XMLOutputter outp = new XMLOutputter(); outp.setFormat(Format.getCompactFormat()); for (int ii = 0; ii < list.size(); ii++) { Element node = (Element)list.get(ii); StringWriter sw = new StringWriter(); outp.output(node.getContent(), sw); StringBuffer sb = sw.getBuffer(); String xml = sb.toString(); } but my xml object looks like this <firstname xmlns="http://www.xx.com/xx">yong</firstname> <lastname xmlns="http://www.xx.com/xx">mook kim</lastname> <nickname xmlns="http://www.xx.com/xx">mkyong</nickname> <salary xmlns="http://www.xx.com/xx">100000</salary> every elemnt has namespace. why this? i don't want namespace... I want the same output as is in xml example like <firstname>yong</firstname> <lastname>mook kim</lastname> <nickname>mkyong</nickname> <salary>100000</salary>

    Read the article

  • Clean way to perform commands in the Emacs minibuffer

    - by Christopher Monsanto
    Consider the following example: I want to read a file using ido from the minibuffer, but merge in all of the directories I use often. I can't just execute (ido-find-file) (ido-merge-work-directories) Because the second sexp will only execute after the user is finished selecting the file. The question then is: what is the best/cleanest way to execute commands in the minibuffer's command loop? The only way I know to do this is to bind my desired command to a key sequence, and add that sequence to unread-command-events so the key runs once we enter the minibuffer command loop: (setq unread-command-events (append (listify-key-sequence (kbd "M-s")) unread-command-events)) ; std key-binding for ido-merge-work-directories (ido-find-file) But that is very hacky, and I would like to know if there is a better solution. Thanks!

    Read the article

  • IIS7 301 Redirect from a List of URLs

    - by corymathews
    Recent changes are forcing me to add a bunch of 301 redirects. Seems that IIS7 is my best bet as compared to redirects within the files. I have found how to add them 1 by 1 but this requires the page/folder to exist (which most don't anymore(and creating them seems to defeat the point of the redirect)) and does not work on dynamic urls. I also cannot go to every page and add the redirects at the page level because some older pages are in php which is no longer supported on the new server. There is also no obvious pattern to the changes so each one must be made on its own. samples of the redirects page.htm - /page/ /folder/folder/ - /folder/folder.cfm /folder/folder/ - /folder/ /page.php?id=1 - page.htm

    Read the article

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