instruction
stringlengths
0
30k
By "scrum meeting", are you referring to the daily "stand up" meeting? If so, I believe those are usually timeboxed at about 15-20 minutes. So divide that time equally among everyone, and once someone uses up all their time, they can't talk. It might be harsh, but I believe that's how it's supposed to go down.
How to write a download progress indicator in Python?
|python|
I am writing a little application to download files over http (as, for example, described [here][1]). I also want to include a little download progress indicator showing the percentage of the download progress. Here is what I came up with: <pre> sys.stdout.write(rem_file + "...") urllib.urlretrieve...
|python|http|
I am writing a little application to download files over http (as, for example, described [here][1]). I also want to include a little download progress indicator showing the percentage of the download progress. Here is what I came up with: <pre> sys.stdout.write(rem_file + "...") urllib.urlretrieve...
|python|https|
|python|http|
Response.StatusCode and Internet Explorer - Display custom message?
|asp.net|http|internet-explorer-7|
I am implementing a HttpRequestValidationException in my Application_Error Handler, and if possible, I want to display a custom message. Now, I'm thinking about the StatusCode. In my current example, it sends a 200, which I think should not be done. I would like to send the (IMHO) more appropriate 400 Bad Request in...
When should you use standard html tags/inputs and when yould you use the asp.net controls?
|asp.net|c#|webforms|html|visual-studio|
I began my journey writing websites using other technologies besides asp.net. Half the time I could use the webforms controls and the standard html inputs interchangeably. When this is the case what is the lure of the webforms controls?
|c#|asp.net|visual-studio|html|webforms|
I began my journey writing websites using other technologies besides asp.net. As I put together each page Its clear that half the time I could use the webforms controls and the standard html tags just as easily. When this is the case what is the lure of the webforms controls?
When should you use standard html tags/inputs and when should you use the asp.net controls?
As I put together each asp.net page Its clear that most of the time I could use the standard html tags just as easily as the webforms controls. When this is the case what is the lure of the webforms controls?
In short, maybe. AppDomains are purely a managed concept. When an AppDomain is instantiated it doesn't map in new copies of the underlying DLLs, it can reuse the code already in memory (for example, you wouldn't expect it to load up new copies of all the System.* assemblies, right?) Within the managed world all s...
If it's a **non** production environment use dump tran <db_name> with no_log; Once this has completed shrink the log file to free up disk space. Finally switch database recovery mode to simple.
As Abe noted, this code is creating an anonymous function. This: <pre><code> xmpp.OnLogin += delegate(object o) { xmpp.Send( new Message(new Jid(JID_RECEIVER), MessageType.chat, "Hello, how are you?")); }; </code></pre> would have been accomplished as follows in older versions of ...
A software token is a second factor, but it probably isn't as good choice a choice as a RSA fob. If the user's computer is compromised the attacker could silently copy the software token without leaving any trace it's been stolen (unlike a RSA fob where they'd have to take the fob itself, so the user has a chance to n...
In JavaScript, dates can be transformed to the number of milliseconds since the epoc by calling the `getTime()` method or just using the date in a numeric expression. So to get the difference, just subtract the two dates. To create a new date based on the difference, just pass the number of milliseconds in the co...
Is object mocking used extensively?
|unit-testing|mocking|
I am curious about how many of you folks incorporate mocking of objects (frameworks like JMock, NMock, RhinoMocks hand in hand with unit testing frameworks) into your daily development process. What are your experiences? You see, I develop on top of a GIS (geographic information systems) platform, in which most of w...
I use Zabbix extensively in production, which comes with a stack of useful defaults. Some examples of the sorts of things we've configured it to monitor: * Network usage * CPU usage (% user,system,nice times) * Load averages (1m, 5m, 15m) * RAM usage (real, swap, shm) * Disc throughput * Active connectio...
Second way is better because it can be used outside the main(), so when you refactor it's one less thing to think about. Also I don't like the "magic" that puts the args in the method parameter for the first way.
[EMS SQL Manager for MySQL][1] has query constructor. Can't recall about joins, but they should be supported. [1]: http://www.sqlmanager.net/products/mysql/manager
I would make the feed a **static file** (you can easily serve thousands of these), **regenerated periodically**. Then you have a much broader choice, because it doesn't have to run below second, it can run even minutes. And users still get **perfect download speed** and reasonable update speed.
Personally I hold passwords in configuration files which are then distributed independently of the application, and can be changed to the specific machine/environment. In shell scripts you can source these within the main script. However, in Perl there are a variety of approaches. You may wish to investigate [Getopt...
I manually attach handlers when I manually create controls (for example, dynamically creating a TextBox for each database record). I manually detach handlers when they are handling things I'm not quite ready to handle yet (possibly because I'm using the wrong events? :) )
The public static final solution mentioned above has one additional benefit the author didn't mention--as I understand it, the compiler will recognize it at compile time and compile out any code that is within an if statement that refers to that final variable. So I think that's the exact solution you were looking f...
How to make clipboard ring appear in VS2008 toolbox?
|visual-studio|
It seems as if making the clipboard ring appear in the VS2008 toolbox is pretty elusive. Does anyone know how to turn this on ? Ctrl-Shift-V works fine, but I'd like to see what on the ring.
This was a common issue in UNIX many years ago, and was resolved by separating the user identity components (username, UID, shell, full name, etc.) from the authentication components (password hash, password hash salt). The identity components can be globally readable (and in fact must be, if UIDs are to be mapped to ...
How do I document a module in Python?
|python|documentation|module|
That's it. If you want to document a function or a class, you put a string just after the definition. For instance: def foo(): """This function does nothing.""" pass But what about a module? How can I document what a *file.py* does?
|python|documentation|python-module|
This is a valid bad practice, as you must think twice if the variable is a string or an int. What if the variable would be called myInt? myInt = myInt + 23; it is more readable and understandable in this form? myInt = mInt + "23"; or even: myInt = string.Format("{0}{1}", myInt, 23); We ...
If you drag text to the toolbox doesn't it appear?
-- i use something like this, with concepts and some code stolen from asktom. -- suggestions for improvements are welcome WITH sess AS ( SELECT * FROM V$SESSION WHERE USERNAME = USER ORDER BY SID ) SELECT si.SID, si.LOCKWAIT, si.OSUSER, si.PROGRAM, si.LOGO...
|asp.net|https|internet-explorer-7|
|asp.net|http|internet-explorer-7|
The square brackets [ ] are used to initialize arrays. The documentation for initializer case of [ ] is in ri Array::[] The curly brackets { } are used to initialize hashes. The documentation for initializer case of { } is in ri Hash::[] The square brackets are also commonly used as a method in ...
How do you make an etag that matches Apache?
|apache|etag|
I want to make an etag that matches what Apache produces. How does apache create it's etags?
|http|apache|etag|
|apache|https|etag|
|apache|http|etag|
The first is probably the best in Java, considering it is typesafe (unlike the other). Additionally, for "normal" types, the second solution seems to only provide cumbersome usage for the user. However, since you are using Object as the type for SSN (which has a semantic meaning beyond Object), you probably won't get a...
The solution is as follows. Use Python module [zipfile][1] to create zip archive, but as the file specify [StringIO][2] object (ZipFile constructor requires file-like object). Add files you want to compress. Then in your Django application return the content of StringIO object in `HttpResponse` with mimetype set to ...
The solution is as follows. Use Python module [zipfile](http://docs.python.org/lib/module-zipfile.html) to create zip archive, but as the file specify [StringIO](http://docs.python.org/lib/module-StringIO.html) object (ZipFile constructor requires file-like object). Add files you want to compress. Then in your Djang...
[ASCIIEncoding.GetBytes][1] [1]: http://msdn.microsoft.com/en-us/library/system.text.asciiencoding.getbytes.aspx
[UTF8Encoding.GetBytes][1] [1]: http://msdn.microsoft.com/en-us/library/system.text.utf8encoding.getbytes.aspx
How can I sort by multiple conditions with different orders?
|ruby|sorting|
I'd really like to handle this without monkey-patching but I haven't been able to find another option yet. I have an array (in Ruby) that I need to sort by multiple conditions. I know how to use the sort method and I've used the trick on sorting using an array of options to sort by multiple conditions. However, in...
I'd really like to handle this without monkey-patching but I haven't been able to find another option yet. I have an array (in Ruby) that I need to sort by multiple conditions. I know how to use the sort method and I've used the trick on sorting using an array of options to sort by multiple conditions. However, in...
How much data can/should you store in a users session object?
|asp.net|session|
We have several wizard style form applications on our website where we capture information from the user on each page and then submit to a backend process using a web service. Unfortunately we can't submit the information in chunks during each form submission so we have to store it the users session until the end of...
|asp.net|session|
We have several wizard style form applications on our website where we capture information from the user on each page and then submit to a backend process using a web service. Unfortunately we can't submit the information in chunks during each form submission so we have to store it the users session until the end of...
I think you'd need to start off with initial (fixed) widths for both sidebar columns and then, when the page loads, use javascript to get the window width and calculate the new width of the sidebars. sidebar width = (window width - center column width) / 2 You could then reapply the javascript if the window is re...
You can use Enterprise Manager to create your script. Right click on the table in EM and select Design. Uncheck the Allow Nulls column for the Text field. Instead of hitting the regular save icon (the floppy), click an icon that looks like a golden scroll with a tiny floppy or just do Table Designer > Generate Change S...
for low level entertainment i would suggest **Michael Abrash's** i) -Zen of Code Optimization- and ii) -Graphics Programming Black Book- even if you dont do any graphics programming.
What are the best methods to ensure our SharePoint implementation is accessible?
|sharepoint|accessibility|
Are there any blogs, guides, checklists, or controls we should be using to ensure our SharePoint implementation is accessible? Preferrably to the W3C double A standard, or as close to that as we can get.
Are there any blogs, guides, checklists, or controls we should be using to ensure our SharePoint implementation is accessible? Preferrably to the W3C double A standard, or as close to that as we can get. We're implementing an extranet solution.
Be wary of people telling you to denormalize for performance reasons! This is only true if you have a very primitive database engine. The point of normalization is (basically) to reduce redundancy. If your database are not normalized, the redundant pieces of data may get out of sync, leading to data corruption. A n...
Can you use Expression to convert the flash content to XAML? I believe that there are tools in there or off to the side that do this.
The key difference is that Const is the C equivalent of #DEFINE. The number literally gets substituted a-la precompiler. Readonly is actually treated as a variable. This distinction is especially relevant when you have Project A depending on a Public constant from Project B. Suppose the public constant changes....
The HTML Agility Pack For .net programers is awesome. It turns webpages in XML docs that can be queried with XPath. HtmlDocument doc = new HtmlDocument(); doc.Load("file.htm"); foreach(HtmlNode link in doc.DocumentElement.SelectNodes("//a@href") { HtmlAttribute att = link"href"; att.V...
This will do it. :-) int count_digits(int n, int d) { int count = 0; while(n*10/=10) if (n%10==d) count++ return count; }
Going to give Altova MapForce a try. http://www.altova.com/downloadtrialmapforce3.html
Going to give Altova MapForce and Stylus Studio® a try. http://www.altova.com/downloadtrialmapforce3.html http://www.stylusstudio.com/xml_product_index.html
Tool recommendation for converting VB to C#
|c#|vb.net|visual-studio-2008|
We have a project with over 500,000 lines of VB.NET that we need to convert to C#. Any recommendations, based on experience, for tools to use? We are using Visual Studio 2008 and we're targeting 3.5 .
Take a look at the Parser in the PHP Fit port. The code is clean and was originally designed for loading the dirty HTML saved by Word. It's configured to pull tables out, but can easily be adapated. You can see the source here: http://gerd.exit0.net/pat/PHPFIT/PHPFIT-0.1.0/Parser.phps The unit test will show y...
It depends on your needs. How complex is the state machine? Where do you want the state machine to live (e.g. model vs. database)? WWF provides an event based state machine, which is good enough if your state machine is embedded in the model. Personally I've implemented an e-commerce framework and other workflow bas...
I would start with the [LabVIEW wiki][1]. Specifically, [LabVIEW Tutorial][2]. There are lots of online references and links to LabVIEW reference books. Welcome to the world of LabVIEW! [1]: http://wiki.lavag.org/Home [2]: http://wiki.lavag.org/LabVIEW_tutorial
OCSP command-line test tool?
|java|python|windows|command-line|ocsp|
Does anybody know of a tool to test OCSP responses? Preferably, something that can be used from a Windows Command-line and/or can be included (easily) in a Java/python program
Map of Enums and dependency injection in Spring 2.5
|java|spring|enums|maps|
Let's assume we've got the following Java code: public class Maintainer { private Map<Enum, List<Listener>> map; public Maintainer() { this.map = new java.util.ConcurrentHashMap<Enum, List<Listener>>(); } public void addListener( Listener listener, Enum eventType ) ...
I prefer the VB syntax in this case because here, you need to prefix the members inside the with block with a `.` to avoid ambiguities: With obj .Left = 10 .Submit() End With But really, there's nothing wrong with `with` in general.
One annoyance with using with is that the debugger can't handle it. So it makes debugging more difficult. A bigger problem is that it is less easy to read the code. Especially if the with statement is a bit longer. procedure TMyForm.ButtonClick(...) begin with OtherForm do begin Left := 1...
-- i use something like this, with concepts and some code stolen from asktom. <BR> -- suggestions for improvements are welcome <BR> <BLOCKQUOTE> WITH <BR> sess AS<BR> (<BR> SELECT *<BR> FROM V$SESSION<BR> WHERE USERNAME = USER <BR> ORDER BY SID<BR> )<BR> SELECT si.SID,<BR> si.LOCKWA...
It's the `background-image` on the body showing through. Quick fix (edit style.css or add elsewhere): #page-container { background-color: white; }
How do I make an HTML table the same width as its containing div tag?
|html|css|
I have a table inside a div. I want the table to occupy the entire width of the div tag. In the CSS, I've set the width of the table to 100%. Unfortunately, when the div has some margin on it, the table ends up wider than the div it's in. I need to support IE6 and IE7 (as this is an internal app), although I'd ...