reliability

CA2000 passing object reference to base constructor in C#

喜欢而已 提交于 2019-11-30 23:45:12
问题 I receive a warning when I run some code through Visual Studio's Code Analysis utility which I'm not sure how to resolve. Perhaps someone here has come across a similar issue, resolved it, and is willing to share their insight. I'm programming a custom-painted cell used in a DataGridView control. The code resembles: public class DataGridViewMyCustomColumn : DataGridViewColumn { public DataGridViewMyCustomColumn() : base(new DataGridViewMyCustomCell()) { } It generates the following warning:

What to use ? time() function or $_SERVER['REQUEST_TIME'] ? Which is better?

大兔子大兔子 提交于 2019-11-29 09:22:37
Which one among these two time functions is better? I have a form on my website which is submitted by thousands of users every microsecond or less , thus , thousands of requests at the same time on my server. So I want to use the one which does not uses any sleep while execution. Also , how unique is $_SERVER['REQUEST_TIME'] and time() ? Do both change every microsecond? Will $_SERVER['REQUEST_TIME'] change every time I submit the form? Like , the time() function will change at every time difference. I need to give a unique url to the user for verification in which am appending the unique

Android timer that works when device is sleeping

半城伤御伤魂 提交于 2019-11-29 08:36:02
问题 I'm writing a sports app that needs to track the elapsed time of quarter/half/period. Elapsed time needs to be accurate to the second. The game clock needs to continue to run even if the user explicitly places the device in sleep mode by pressing the power button. My first attempt at this involved using Handler.postDelayed() to trigger the clock ticks every 200ms and WindowManager.LayoutParms.FLAG_KEEP_SCREEN_ON to ensure that the "clock" wasn't stopped by a screen timeout. But I soon learned

How do I address sudden loss of connection to SQL Azure in my Azure role?

百般思念 提交于 2019-11-29 02:35:00
问题 My Azure role grabs stuff to process from a database - it holds an instance of System.Data.SqlClient.SqlConnection and periodically creates an SqlCommand instance and executes an SQL query. Now once in a while (usually once in several days) running a query will trigger an SqlException exception The service has encountered an error processing your request. Please try again. Error code 40143. A severe error occurred on the current command. The results, if any, should be discarded. Which I've

Erlang's 99.9999999% (nine nines) reliability

拟墨画扇 提交于 2019-11-28 14:47:02
问题 Erlang was reported to have been used in production systems for over 20 years with an uptime percentage of 99.9999999%. I did the math as the following: 20*365.25*24*60*60*(1 - 0.999999999) == 0.631 s That means the system only has less than one second of downtime during the period of 20 years. I am not trying to challenge the validity of this, I am just curious about how we can shut down a system (on purpose or by accident) for only 0.631 second. Could anyone who are familiar with large

Facebook Graph API - get ID for a URL?

橙三吉。 提交于 2019-11-27 20:07:41
This seems like a pretty obvious, basic thing to expect from the Graph API , but I'm having serious difficulty with it. All I want to do is get the ID for any particular URL. They have a method for this: https://graph.facebook.com/?ids=http://www.imdb.com/title/tt0117500/ And that works great. But if I try another URL, say for my blog, https://graph.facebook.com/?ids=http://dusda.vox.com it doesn't give me back a numerical ID like all of the examples do. Instead, this: {"http:\/\/dusda.vox.com":{"id":"http:\/\/dusda.vox.com"}} If I try to use that "id", I get jack (probably because the query

Facebook Graph API - get ID for a URL?

我是研究僧i 提交于 2019-11-26 20:10:31
问题 This seems like a pretty obvious, basic thing to expect from the Graph API, but I'm having serious difficulty with it. All I want to do is get the ID for any particular URL. They have a method for this: https://graph.facebook.com/?ids=http://www.imdb.com/title/tt0117500/ And that works great. But if I try another URL, say for my blog, https://graph.facebook.com/?ids=http://dusda.vox.com it doesn't give me back a numerical ID like all of the examples do. Instead, this: {"http:\/\/dusda.vox.com