instruction
stringlengths
0
30k
alright well it looks like the autoevenwriteup property was already set to false before i even started. so i don't think that was it. I didn't see any other redirects happening anywhere... i guess the search continues.
Don't use a base class unless you know what it means, and that it applies in this case. If it applies, use it, otherwise, use interfaces. But note the answer about small interfaces. Public Inheritance is overused in OOD and expresses a lot more than most developers realize or are willing to live up to. See the [L...
There was a great discussion on this topic at DevTeach in Montreal. If you go to this URL: <a href="http://www.dotnetrocks.com/default.aspx?showNum=240" target="_new">http://www.dotnetrocks.com/default.aspx?showNum=240</a> you will be able to hear two experts in the field (Ted Neward and Oren Eini) discuss the pros an...
I have rewrote the original linq statement to where I now use a join instead of the Contains, but would still like to know if there is a way around this issue.
The more I look at it, and after running more tests, I'm thinking the bug may be in the Sql Server Query Visualizer plugin for Visual Studio, not actually in Linq to SQL itself. So it is not nearly as bad a situation as I thought - the query will return the right results, but you can't trust what the Visualizer is show...
<p>The issue stems from the fact that you can't deserialize an interface but need to instantiate a concrete class.</p> <p>The XmlInclude attribute can be used to tell the serializer what concrete classes implement the interface.</p> <p>There's a post about it, <a href="http://www.topxml.com/rbnews/XmlSerializer/re-75...
Just a minor point to add to this thread... there is no alt tag or title tag. The alt attribute is for images, but all other elements on a page can have a title attribute, which is the best choice for cross browser compatibility. <span title="Click here to edit the foo"> Edit </span>
How to build large/busy RSS feed
|rss|
I've been playing with RSS feeds this week, and for my next trick I want to build one for our internal application log. We have a centralized database table that our myriad batch and intranet apps use for posting log messages. I want to create an RSS feed off of this table, but I'm not sure how to handle the volume- ...
I think this would be extremly useful. Depending on the size of a project team members come and go. And a wiki is a good tool to keep the history and the "spirit" of a project available to new team members. I did that in many projects, and though the projects were already finished, all the informations are available. ...
The other classic integration would be your source code repository, e.g. svn, or cvs. [trac][1] is an existing product that does exactly this - it combines a wiki, custom bug tracker, and integrates nicely with svn. [1]: http://trac.edgewall.org/
Of course it's useful, there are already ready-made packages for this kind of project-overviews (like http://trac.edgewall.org/). If possible, I'd integrate any existing CI-engine into the wiki, so that you have a complete overview over the current progress and your project's health.
To wait 10 seconds between launching the applications, try launch-server-application Start-Sleep -s 10 launch-client-application.exe argument1 argument2 If you want to create a script and have the arguments passed in, use launch-server-application Start-Sleep -s 10 launch-client-app...
To wait 10 seconds between launching the applications, try launch-server-application serverparam1 serverparam2 ... Start-Sleep -s 10 launch-client-application clientparam1 clientparam2 clientparam3 ... If you want to create a script and have the arguments passed in, create a file called runlinkedapp...
I thought they had more or less sorted the desktop designer issues in 2005. Have you tried the usual culprits? * No abstract control types * No constructor arguments in any form * Initialisation moved to Form_Load as opposed to the Ctor * No controls in the same project as the usercontrol/form that they are put ...
Since ID is not sequential, I assume you have a unique index on ThingID and PriceDateTime so only one price can be the most recent for a given item. This query will get all of the items in the list IF they were priced today. If you remove the where clause for PriceDate you will get the latest price regardless of da...
Does PHP have an equivalent to this type of Python string substitution?
|php|python|string|
Python has this wonderful way of handling string substitutions using dictionaries >>> 'The %(site)s site %(adj)s because it %(adj)s' % {'site':'Stackoverflow', 'adj':'rocks'} 'The Stackoverflow site rocks because it rocks' I love this because you can specify a value once in the dictionary and then replac...
Python has this wonderful way of handling string substitutions using dictionaries >>> 'The %(site)s site %(adj)s because it %(adj)s' % {'site':'Stackoverflow', 'adj':'rocks'} 'The Stackoverflow site rocks because it rocks' I love this because you can specify a value once in the dictionary and then replac...
|python|php|string|
Python has this wonderful way of handling string substitutions using dictionaries >>> 'The %(site)s site %(adj)s because it %(adj)s' % {'site':'Stackoverflow', 'adj':'rocks'} 'The Stackoverflow site rocks because it rocks' I love this because you can specify a value once in the dictionary and then replac...
Python has this wonderful way of handling string substitutions using dictionaries >>> 'The %(site)s site %(adj)s because it %(adj)s' % {'site':'Stackoverflow', 'adj':'rocks'} 'The Stackoverflow site rocks because it rocks' I love this because you can specify a value once in the dictionary and then replac...
What is the C++ application using? You can always use the same thing or wrap the timer code from C++ into a C++/CLI class.
Try using the ["ant" task][1] instead of the "antcall" task, which runs the imported build directly instead of importing it into the current build file. It has a "dir" parameter: > the directory to use as a basedir > for the new Ant project. Defaults to > the current project's basedir, unless > inheritall has bee...
[Dictionary Class](http://msdn.microsoft.com/en-us/library/xfhwa508.aspx) is exactly what you want, correct. You can declare the field directly as Dictionary<string, string>, instead of IDictionary, but that's up to you.
There is a KeyValuePair<S,T> built-in type. As a matter of fact, this is what the IDictionary is giving you access to when you iterate in it. Also, this structure is hardly a tree, finding a more representative name might be a good exercise.
I like the versatility of jEdit (http://www.jedit.org), its got a lot of plugins, crossplatform and has also stuff like block selection which I use all the time. The downside is, because it is written in java, it is not the fastest one.
One possible thing you could do is use the Dictionary object straight out of the box and then just extend it with your own modifications: public class TokenTree : Dictionary<string, string> { public IDictionary<string, string> SubPairs; } This gives you the advantage of not having to enforc...
@[Jay Mooney](http://stackoverflow.com/users/733/jay-mooney): A generic Dictionary class in .NET is actually a hash table, just with fixed types. The code you've shown shouldn't convince anyone to use Hashtable instead of Dictionary, since both code pieces can be used for both types. For hashtable: foreach...
For a simple starting point to get your head around the "event-driven" nature basically all frameworks are created around look at [FLTK][1]. Here are some quick starting videos [Link][2] For professional use I'd recommend Qt, expensive but often worth it in commercial situations. [1]: http://www.fltk.org ...
Where to find resources on Refactoring?
|refactoring|
Besides Martin Fowler's seminal book "[Refactoring - Improving the design of existing code][1]" and Joshua Kerievsky's book "[Refactoring to Patterns][2]", are there any good resources on refactoring? [1]: http://www.amazon.com/Refactoring-Improving-Existing-Addison-Wesley-Technology/dp/0201485672/ref=pd_bbs_s...
|refactoring|
Refactoring is the process of improving the existing system design without changing its behavior. Besides Martin Fowler's seminal book "[Refactoring - Improving the design of existing code][1]" and Joshua Kerievsky's book "[Refactoring to Patterns][2]", are there any good resources on refactoring? [1]: http...
As others have said, things vary a lot, but here's a rough overview of the most commonly used naming conventions in various languages: <code>lowercase, lowercase_with_underscores</code>: Commonly used for local variables and function names (typical C syntax). <code>UPPERCASE, UPPERCASE_WITH_UNDERSCORES:</code>...
See *[Getting stack traces on Unix systems, automatically](http://stackoverflow.com/questions/18265/getting-stack-traces-on-unix-systems-automatically)* on Stack Overflow.
I'm about to deploy a mediumsized site powered by Django. I have a dedicated Ubuntu Server. I'm really confused over which serversoftware to use. So i thought to myself: why not ask stackoverflow. What i'm looking for is: - Easy to set up - Fast and easy on resources - Can serve mediafiles - Able to se...
I'm about to deploy a mediumsized site powered by Django. I have a dedicated Ubuntu Server. I'm really confused over which serversoftware to use. So i thought to myself: why not ask stackoverflow. What i'm looking for is: - Easy to set up - Fast and easy on resources - Can serve mediafiles - Able to se...
|django|hosting|python|apache|
I'm about to deploy a mediumsized site powered by Django. I have a dedicated Ubuntu Server. I'm really confused over which serversoftware to use. So i thought to myself: why not ask stackoverflow. What i'm looking for is: - Easy to set up - Fast and easy on resources - Can serve mediafiles - Able to se...
|python|apache|django|hosting|
|python|apache|django|hosting|
I'm about to deploy a mediumsized site powered by Django. I have a dedicated Ubuntu Server. I'm really confused over which serversoftware to use. So i thought to myself: why not ask stackoverflow. What i'm looking for is: - Easy to set up - Fast and easy on resources - Can serve mediafiles - Able to se...
I believe so. Since the function pointer uses the signature to identify itself, the base/derived behavior would rely on whatever object you called it on.
Are you trying to assign the value of an Identity field to a variable or something else before you have saved the record? For whatever reason, your app is trying to read the value of the identity field before the record has been saved, which is what generates that identity field. In other words, no value exists for...
You should use a base class if there really isn't any reason for other developers to desire using their own base class in addition to your type's members **and** you foresee versioning issues (see http://haacked.com/archive/2008/02/21/versioning-issues-with-abstract-base-classes-and-interfaces.aspx). If inheriting d...
How to check if a directory exists in a bash shell script
|linux|bash|shell|
What code can be used to check if a directory does or does not exist, within a bash shell script?
What command can be used to check if a directory does or does not exist, within a bash shell script?
I find the [double-bracket][1] version of `test` makes writing logic tests more natural: if [[ -d "${DIRECTORY}" && ! -L "${DIRECTORY}" ]] ; then echo "It's a bona-fide directory" fi And I see that the [double-bracket operator is often faster][2]. [1]: http://tldp.org/LDP/abs/html/testcon...
The answer, I'm afraid, is it depends. It depends on the kind of application and the kind of users you have. Without knowing what the system is and the scope of the changes in the version, it is difficult to offer an answer. That said, there are some rules of thumb. Firstly, avoid the big bang launch. Any launch...
When using host headers to host multiple websites on the same IP address in IIS, is there any way of accessing that website from a browser running on the local machine? This is normally required when a given web component only allows configuration from the local machine. It's also useful when things like ASP.Net's b...
I personally would store it in a session variable. I would avoid using a QueryString param or the like since they could try bouncing themselves back to a page they are not supposed to (possible security issue?). Chucking an object in the session cache also means you can later extend it if requried (such as adding re...
I personally would store the required redirection info in an object and handle globally. I would avoid using a QueryString param or the like since they could try bouncing themselves back to a page they are not supposed to (possible security issue?). You could then create a static method to handle the redirection object...
Watch out for packing issues. In the example you gave all fields are at the obvious offsets because everything is on 4 byte boundaries but this will not always be the case. Viual C++ backs on 4 byte boundaries by default.
Each panel control implements distinct layout logic performed in Measure() and Arrange(). Measure determines the size of the panel and each of its children. Arrange() determines the rectangle where each control renders. The last child of the DockPanel fills the remaining space. You can disable this behavior by set...
> so id like to be able to run the vm on > 768 mb or less if possible. That will depend on your data and the size of your database. But I usually like to give SQL server at least a GB
You can change the location the project compliers and saves the dcu/unit/exe to in Project/Options under the Directories/Conditionals is that what you are looking for? I bevile there is also some settings for the DBE in the Tools menu, but I dont have them install at the moment (or i cant find them)
On top of that, readability should probably be more highly preferred than performance in this case. Even if IIF was more efficient, it's just plain less readable to the target audience (I assume if you're working in Visual Basic, you want other programmers to be able to read your code easily, which is VB's biggest boo...
I've not used the Android Emulator but I have set the $http_proxy environment variable for perl and wget and a few cygwin tools on windows. That might work for you for android, but the slash in the domain name seems like a potential problem. I know I tried having my domain "GLOBAL" in there, but ended up taking it out...
It really depends on what else is going on on the machine. Get things running under a typical load and have a look at Task Manager to see what you need for everything else. Try that number to start with. For production machines, of course, it is best to give control of the machine to Sql Server (Processors -> Boos...
I do all my database creation as DDL and then wrap that DDL into a schema maintainence class. I may do various things to create the DDL in the first place but fundamentally I do all the schema maint in code. This also means that if one needs to do non DDL things that don't map well to SQL you can write procedural logic...
There are still a large number of people that run with Javascript turned off. Alternatively, I have had decent success with stopping form spam using CSS. Basically, include an input field and label that is hidden using CSS _(display: none;)_ and once submitted, check if anything has been entered in the field. ...
You have to walk the objects using reflection. Be careful as you do: - Just allocating an object has some overhead in the JVM. The amount varies by JVM so you might make this value a parameter. At least make it a constant (8 bytes?) and apply to anything allocated. - Just because `byte` is theoretically 1 by...
In the same vein, adding a dummy field and then using CSS to hide it is a good way to trick the bots. If the field is submitted, you know a non-human probably completed the form. Especially effective if you label/name the field something along the lines of **URL** or **website**.
I made a [blog entry][1] about this subject last year. Check it out. Bottom line is that there is almost no cost for a try block if no exception occurs. [1]: http://freachable.net/2007/11/10/TryAssertTryBlocksExpensiveCatchExceptionExAssumptionreset.aspx
I made a [blog entry][1] about this subject last year. Check it out. Bottom line is that there is almost no cost for a try block if no exception occurs - and on my laptop, an exception was about 36&mu;s. That might be less than you expected, but keep in mind that those results where on a shallow stack. Also, first exc...
Replace huge Case statement in Classic ASP
|classicasp|
I have a 200+ case statement in Classic ASP which is getting out of control. It sets 5 variables, based on which case is selected. Address, Phone, Name etc. Just sets the variables and nothing else in each case. Databases or files are not an option for this application. Coming from the Perl world I would use a ha...
|asp-classic|
I think what you are looking for is TypeName rather than TypeOf. If TypeName(foobar) = "CommandButton" Then DoSomething End If
I think what you are looking for is TypeName rather than TypeOf. If TypeName(foobar) = "CommandButton" Then DoSomething End If Edit: What do you mean Dynamic Objects? Do you mean objects created with CreateObject(""), cause that should still work.
I can't access your site at the moment, so I'm basing this on fairly limited information. But if the home page is static content, the views module might not be appropriate. It might be better to create a page (In the menu, go to: Create content > page), make a note of the page's url, and then change the default home pa...
When using storyboards to control an animation, make sure you set the second parameter to true in order to set the animation as controllable: public void Begin( FrameworkContentElement containingObject, **bool isControllable** )
This is a question on Object Oriented Design, not Java the language. It's generally good practice to hide data types within the class and expose only the methods that are part of the class API. If you expose internal data types, you can never change them in the future. If you hide them, your only obligation to the user...
asynchronously loading a BitmapImage in C# using WPF
|c#|wpf|
What's the best way to asynchronously load an BitmapImage in C# using WPF? It seems like many solution exist, but does a standard pattern or best practice exist? Thanks!
Have you looked at [SqlMetal][1]? It's officially supported, although not promoted too much. You can use it to build dbmls from the commandline - we've used it as part of a db's continous integration updates (make sure you have really good code separation if you do this though - partial classes are a saviour - as the ...
Use the **HorizontalAlignment** and **VerticalAlignment** layout properties. They control how an element uses the space it has inside its parent when more room is available than it required by the element. The width of a StackPanel, for example, will be as wide as the widest element it contains. So, all narrower ele...
The answer, I'm afraid, is it depends. It depends on the kind of application and the kind of users you have. Without knowing what the system is and the scope of the changes in the version, it is difficult to offer an answer. That said, there are some rules of thumb. Firstly, avoid the big bang launch. Any launch...
You might want to check out this article [Member Function Pointers and the Fastest Possible C++ Delegates][1] The short answer seems to be yes, in some cases. [1]: http://www.codeproject.com/KB/cpp/FastDelegate.aspx
It sounds like **incremental re-architecture** should be your agile buzz-phrase of choice. I've never done it on a web application, but I have been through some fairly radical client application changes that were done incrementally. If you invest a little bit of time up front to make sure that pieces of work are seq...
I need more space than responding as comments directly allows... > Thanks! Good answer! What would be the > difference, what would be better > solving this using SubVersion for > example?Richard Hallgren (15 hours > ago) The problems with VSS have nothing to do with this example (although the "Labeling" fea...
I think what you are looking for is TypeName rather than TypeOf. If TypeName(foobar) = "CommandButton" Then DoSomething End If Edit: What do you mean Dynamic Objects? Do you mean objects created with CreateObject(""), cause that should still work. Edit: Private Sub Command1_Click() ...
You have to measure it with a tool, or estimate it by hand, and it depends on the JVM you are using. There is some fixed overhead per object. It's JVM-specific, but I usually estimate 40 bytes. Then you have to look at the members of the class. Object references are 4 (8) bytes in a 32-bit (64-bit) JVM. Primitive ty...
Firstly "the size of an object" isn't a well-defined concept in Java. You could mean the object itself, with just its members, the Object and all objects it refers to (the reference graph). You could mean the size in memory or the size on disk. And the JVM is allowed to optimise things like Strings. So the only corr...
If you're using IIS6 and above, open up IIS and click on Web Service Extensions. It will list each framework installed. Granted, .NET 3.0 and 3.5 are both based on the 2.0 framework.
This should be done with a database, but since you said that is not an option, nothing you will write will be any less complex than a switch statement, since it's all required to live in your code (according to your terms of no db and no files). I mean, you could use an Excel Spreadsheet if the idea of a database is...
Everything you are doing is correct. Here's the things i would check. 1. Double check that the SMTP service in IIS is running right. 2. Make sure it's not getting flagged as spam. those are usually the biggest culprits whenever we have had issues w/ sending email. Also, just noticed you are doing MsgBox(ex.Me...
Implementing large system changes
|testing|deployment|architecture|database-design|
If you're familiar with the phrase "build one to throw away", well, we seem to have done that; we’re reaching the limits of version 1 of our online app. It's time to clean things up by: * Re-organizing code and UI * Unifying UI processes * Adding more functionality * Building for the future * Modifying our datab...
If you're familiar with the phrase "build one to throw away", well, we seem to have done that; we’re reaching the limits of version 1 of our online app. It's time to clean things up by: * Re-organizing code and UI * Unifying UI processes * Adding more functionality * Building for the future * Modifying our datab...
There is a JBoss-specific method that is slightly more user-friendly: [http://wiki.jboss.org/wiki/GenerateAThreadDumpWithTheJMXConsole][1] This is especially useful when you don't have direct access to the host machine (which "kill" would require). [1]: http://wiki.jboss.org/wiki/GenerateAThreadDumpWithThe...