w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Logging not working when running pyramid app under uWSGI in emperor mode
Figured it out and might as well leave it here for posterity since there seems to be precious little content on the web about emperor mode. I added "paste-logger = %p" to the uwsgi section of my INI file, and logging appears to work now. Full uwsgi section for context: [uwsgi] socket = /tmp/uwsgi.sock master = true processes = 8 threads = 4 harakiri = 60 harakiri-verbose = true limit-post = 52428800 post-buffering = 8192 listen = 256 max-requests = 1000 buffer-size = 32768 no-orphans = true logto = /var/log/uwsgi/my_app.log log-slow = 1000 virtualenv = /usr/local/python/my_app paste = config:%p paste-logger = %p

Categories : Python

battle with two combobox events in wpf
Hi user1358072 I think you should set SelectedIndex="0" of combobox2 in xaml code. It is working on my side . If you want to handle event for both combo box create event handler for both. and set SelectedIndex="0" for both. I think it will useful for You

Categories : C#

Loosing the battle - Datediff working but I want to apply a condition
Try SELECT [faxdate],DAY(DATEDIFF(CAST(SUBSTRING(RPT.FaxDate, 1, 4) + '-' + SUBSTRING(RPT.FaxDate, 5, 2) + '-' + SUBSTRING(RPT.FaxDate, 7, 2) AS DATE), getdate())) AS vDiff instead of using where, use having like below HAVING vDiff > 60

Categories : Misc

Who wins in battle between "don't mock 3rd party" and "ensure close() called"?
Yes, you should write 2 tests. Or you can create a proxy to your library that forwards every method, but counting the number of times that close has been called. I used the word proxy instead of mock for a reason. You are not replacing it (as mock objects usually do). You are just adding a transparent layer. The reason why you "don't mock 3rd party libraries" is that you need to test them (especially when you update them or could want to update them). One alternative is to trust the provider. Another is to create a complete test. And a third one (yes, the one promoted by "don't mock 3rd party libraries") is to test them only in those aspects that your software effectively uses them. A proxy mock doesn't change this.

Categories : Python

© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.