handlers

RotatingFileHandler throws an exception when delay parameter is set

别来无恙 提交于 2019-12-07 16:02:04
问题 When I run the following code under Python 2.6 import logging from logging.handlers import RotatingFileHandler rfh = RotatingFileHandler("testing.log", delay=True) logging.getLogger().addHandler(rfh) logging.warning("Boo!") then the last line throws AttributeError: RotatingFileHandler instance has no attribute 'level' . So I add the line rfh.setLevel(logging.DEBUG) before the call to addHandler , and then the last line throws AttributeError: RotatingFileHandler instance has no attribute

Custom Http Handler in MVC 3 Application

旧街凉风 提交于 2019-12-07 11:26:49
问题 I'm using an Http Handler to localize javascript files used in my application: see: Localize text in JavaScript files in ASP.NET I want to use the handler provided so I did the following: 1) Ignored routes using this code in Global.asax - I have added the routes.IgnoreRoute("{resource}.js.axd/{*pathInfo}"); line of code to the RegisterRoutes method so it looks like this: public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes

How to pass progress value from thread to activity?

一个人想着一个人 提交于 2019-12-06 02:21:20
问题 I am having a design issue sending progress bar value from class called from a Thread in Activity class to update the GUI, as the following [The code snippet don't compile it's for explaining only]: Class A : Extend Activity { new Thread(new Runnable() { public void run() { B objB = new B(); objB.DownloadFile(); } }).start(); } Class B { public void DownloadFile() { ... some work [preparing SOAP request] while(response.read()) { //send calculated progress to Class A to update the progress

RotatingFileHandler throws an exception when delay parameter is set

好久不见. 提交于 2019-12-06 01:41:00
When I run the following code under Python 2.6 import logging from logging.handlers import RotatingFileHandler rfh = RotatingFileHandler("testing.log", delay=True) logging.getLogger().addHandler(rfh) logging.warning("Boo!") then the last line throws AttributeError: RotatingFileHandler instance has no attribute 'level' . So I add the line rfh.setLevel(logging.DEBUG) before the call to addHandler , and then the last line throws AttributeError: RotatingFileHandler instance has no attribute 'filters' . So if I manually set filters to be an empty list, then it complains about not having the

Data disappearing after ItemUpdate in Sharepoint with Office 2007 documents

拟墨画扇 提交于 2019-12-05 22:47:09
I have a simple event handler with a ItemAdding event that changes a column value that I need in the ItemUpdated method. After uploading a word 2007 document (*.docx, *.pptx or xlsx) the value of the column is changed, but when I protect the document the value of the column disappears in the ItemUpdated method. This only happens for office 2007 documents, other files don't clear the value. The event handler runs in a document library in MOSS 2007. Thanks We have the same issue. It appears that the properties from the list are added to the office 2007 doc, but only with the default values for

In C#, how can you easily change the name of an event handler?

淺唱寂寞╮ 提交于 2019-12-05 18:15:32
In VS2008, if I double click on the event handler VS creates a default event handler with a default name, e.g. combobox1_SelectedIndexChanged. Say, for example, i now rename combobox1 to cbStatus. It still has the same event handler, so i now change that to cbStatus_SelectedIndexChanged. Is there a way, where VS can change the initial combobox1_SelectedIndexChange to cbStatus_SelectedIndexChange rather than generate a new cbStatus event handler in addition to the old event handler? Because every time i have to cut and paste the code to the new event handler and then delete the old one. In

Custom Http Handler in MVC 3 Application

若如初见. 提交于 2019-12-05 16:21:58
I'm using an Http Handler to localize javascript files used in my application: see: Localize text in JavaScript files in ASP.NET I want to use the handler provided so I did the following: 1) Ignored routes using this code in Global.asax - I have added the routes.IgnoreRoute("{resource}.js.axd/{*pathInfo}"); line of code to the RegisterRoutes method so it looks like this: public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.IgnoreRoute("{resource}.js.axd/{*pathInfo}"); routes.MapRoute( "Default", // Route name "{controller}/{action

Meaning of path attribute on handlers in web.config

别来无恙 提交于 2019-12-05 04:06:28
I'm looking at IIS7.5 configuration (system.webServer/handlers). Do you know what is the diference between \*. and \* in the path argument for handlers? Could you use file.* (to match file.txt and file.xml) or abc.a?c (to match abc.abc and abc.asc) ? Can the path argument make reference to the "folder"? like \*\f4\*.txt ? Given a http request like GET \f1\f2.f3\f4\a.b.c?arg1.arg2.arg3=3&arg4.txt=1.4 what is the part the path argument tries to match? The * and *. paths aren't really "wildcard" mappings in the sense of matching some pattern in your URL. The * handler handles requests for all

Update Android UI from a thread in another class

99封情书 提交于 2019-12-03 20:20:50
I've seen a few questions on here asking similar questions, but I've not yet seen a suitable answer. Many people have asked how to update the UI from a thread, but they're almost always in the same class as the UI. What I'm trying to do is update the UI from a thread which has been created in another class. I've seen all of the suggestions, such as async, handlers, runnable, etc... but I've having real trouble implementing them in separate classes. I'm trying to keep my UI class minimal and only deal with interactions with the GUI, such as when a user presses a button. Now, I've created a new

call an eventhandler with arguments

做~自己de王妃 提交于 2019-12-03 16:34:30
问题 Visual Studio 2008, C# 3.0. I have a method below which calls an event handler. I would like to pass the two arguments received by the method to the event handler. I would like to do something like this: wc.DownloadDataCompleted += wc.DownloadedDataCompleted(strtitle, placeid); Is this even possible, if yes, how would I go about doing it ? Code Snippet: public void downloadphoto(string struri,string strtitle,string placeid) { using (WebClient wc = new WebClient()) { wc.DownloadDataCompleted +