instruction stringlengths 0 30k ⌀ |
|---|
Whenever the data changes "significantly".
If a table goes from 1 row to 200 rows, that's a significant change. When a table goes from 100,000 rows to 150,000 rows, that's not a terribly significant change. When a table goes from 1000 rows all with identical values in commonly-queried column X to 1000 rows with ne... |
**Round Robin Scheduling**
If you are a host in a party of 100 guests, round-robin scheduling would mean that you spend 1 minute (a fixed amount) per guest. You go through each guest one-by-one, and after 100 minutes, you would have spent 1 minute with each guest. More on [Wikipedia][1].
There are many other type... |
In the `search` method of the `ProfileResource` class, always return a collection of objects (usually an Array), even if it contains only one object. |
Redgate SQL Doc. the generated documentation included cross-referenced dependency information. For example, for each table, it lists views, stored procedures, triggers etc that reference that table. |
I like ExtJS a lot. It's a great library for developing complex interfaces with javascript. |
Round robin is a simple scheduling algorithm where time is divided evenly among jobs without priority.
For example - if you have 5 processes running - each process will be allowed to run for 1/5 a unit of time before another process is allowed to run. Round robin is typically easy to implement in an OS. |
You would be looking for [Boost::For_each][1] - they have done all the work for you already!
If you _really_ want to create a loop that does what you are looking for, perhaps (pseudocode - note the , operator)
for(itr_type itr = begin, value_type val = itr->second;
itr != end;
++itr, val =... |
You would be looking for [Boost::For_each][1] - they have done all the work for you already!
If you _really_ want to create a loop that does what you are looking for, perhaps (pseudocode - note the , operator)
for(itr_type itr = begin, value_type val = itr->second;
itr != end;
++itr, val =... |
This kind of thing is much easier using a library like [HttpClient][1]. There's even a [post XML code example][2]:
PostMethod post = new PostMethod(url);
RequestEntity entity = new FileRequestEntity(inputFile, "text/xml; charset=ISO-8859-1");
post.setRequestEntity(entity);
HttpClient httpclient = ... |
Pointers already seem to be addressed (no pun intended) in other answers.
Classes are fundamental to OO. I had tremendous trouble wrenching my head into OO - like, ten years of failed attempts. The book that finally helped me was Craig Larman's "Applying UML and Patterns". I know it sounds as if it's about something... |
Setting up password-less publickey authentication with ssh would allow you to scp your files to any of your servers very quickly (or be automated by a shell script).
Here's a simple tutorial: http://rcsg-gsir.imsb-dsgi.nrc-cnrc.gc.ca/documents/internet/node31.html |
Take a look at Snitz Forums (www.snitz.com) - they are currently in ASP but the port to ASP.NET is almost complete. Both code bases are available for you to look at so you may get an idea of how it has been done there to help you. |
How can I tell how many SQL Connections I have open in a windows service? |
|.net|sql-server|ado.net|sqlconnection| |
I'm seeing some errors that would indicate a "connection leak". That is, connections that were not closed properly and the pool is running out. So, how do I go about instrumenting this to see exactly how many are open at a given time? |
If you want to detect a custom object:
// craete a custom object
function MyObject(){
}
// load new object if set
if(!(object instanceof MyObject)){
object = new MyObject();
} |
If you want to detect a custom object:
// craete a custom object
function MyObject(){
}
// check if it's the right kind of object
if(!(object instanceof MyObject)){
object = new MyObject();
} |
There is a bug in Visual Studio and Expression Blend that causes this problem. What you need to do is make sure that the Validation rule is in a separately project/assembly that you can reference. This should resolve the problem.
However, you will have to add back the namespace in order for it to work. |
Don't forget the colours!
For some reason Delphi 7 in Twilight does not render Droid Sans Mono well, but in Visual Studio with an orange on black theme it is excellent. Deja Vu Sans Mono is the best all rounder. I use it almost everywhere. Consolas would be excellent apart from its ugly Q glyph.
One other thing ... |
For a standard secure way you need :
- an authentication server
- an authentication filter on each site that need SSO
The mechanism is a little bit complex, it involves http redirects and secure authentication tickets. You will find detailled explanation on the [CAS website][1] (a popular java SSO server).<b... |
I can tell you that [Apple's Mobile Safari](http://www.apple.com/iphone/features/safari.html) on the iPhone renders Stack Overflow *perfectly*, which I find rather amazing.
This is a site for programmers, not average users, so we accepted a lot of JavaScript dependencies.
I do wish more mobile devices had browser... |
[Enscript][1] looks like what you are asking for :
1. spit HTML (or PS, or RTF) from ascii files
2. It includes features for `pretty-printing' (language-sensitive code highlighting) in several programming languages.
[1]: http://www.gnu.org/software/enscript/ |
You could also take a look at OpenId. This is the same mechanism used for logging into stackoverflow and features a "global" single sign-on.
I believe there are php libraries available to integrate with it.
You could also take a look at [this question][1].
[1]: http://stackoverflow.com/questions/44509/sing... |
Which (third-party) debug visualizers for Visual Studio 2005/2008 do you use? |
|c#|visual-studio|visualizers| |
I guess this topic is often overseen, but is rather useful when debugging your code. Just today I have stumbled across this simple yet effective visualizer that visualizes images (it's on a german blog, but I guess the code content is self-explanatory):
[link text][1]
I would like to know which debug visualizers ... |
As well as the standard case of calling a virtual function from the constructor or destructor of an object with pure virtual functions you can also get a pure virtual function call (on MSVC at least) if you call a virtual function after the object has been destroyed. Obviously this is a pretty bad thing to try and do b... |
This [Javascript Cheat Sheet][1] has a complete list of of event handlers. Nearly all of them can be used on any html element except for one or two.
If you want to use a lightweight javascript library, [DOMAssistant][2] is very lightweight and allows you to add events to elements very easily. Like so:
$("#nav... |
I haven't done this before, but I found [this site][1] on the web giving an explanation.
[1]: http://i-proving.ca/space/RCP+and+Java+Web+Start |
Courier New for me as well, it's well spaced. |
I think the most reliable method is the simply added the **favicon.ico** file to the root of your website.
I don't think there is any need for a meta tag unless you want to manually override the default favicon, but I was unable to find any research to support my argument. |
If you set error reporting to E_ALL, it warns in the error log about undefined variables complete with filename and line number (assuming you are logging to a file). However, it will warn only if when it comes across an undefined variable, so I think you will have to test each code path. Running php from the command li... |
I would recommend also watching some screencasts - they are generally created in context of a specific technology not a language, though if there's Python code displayed, that'll do :). The point is - they're created by some good programmers and watching how good programmers program is a good thing. You and your brothe... |
Quirksmode has a nice [event-compatibility table][1] and an [introduction][2].
[1]: http://quirksmode.org/dom/events/index.html
[2]: http://quirksmode.org/js/introevents.html |
The most robust answer (i.e. that captures the intent of what you're trying to do while causing the fewest bugs) would be:
Object.size = function(obj) {
var size = 0, key;
for (key in obj) {
if (obj.hasOwnProperty(key)) size++;
}
return size;
};
// Get... |
>>@palmsey: In fairness to the OP, the javascript docs actually explicitly refer to using variables of type Object in this manner as "associative arrays".
And in fairness to @palmsey he was quite correct, they aren't associative arrays, they're definitely objects :) - doing the job of an associative array. But as re... |
You would be looking for [Boost::For_each][1] - they have done all the work for you already!
If you do want to roll your own, you can declare a block anywhere in C++, which resolves your scope issue with your intermediate storage of itr->second
...
// Valid C++ code (which does nothing useful)
{
... |
You can put this JavaScript in the page that can perform this task for you:
function forItems(a, f) {
for (var i = 0; i < a.length; i++) f(a.item(i))
}
function classExists(className) {
var pattern = new RegExp('\\.' + className + '\\b'), found = false
try {
fo... |
Have you considered using the [LockFile::Simple module](http://search.cpan.org/perldoc?LockFile::Simple)? It does most of the work for you already.
In my past experience, I have found it very easy to use and sturdy. |
class Base
{
...
virtual void Clone() = 0;
};
is correct.
If you want some default behaviour for Clone, try:
class Base
{
...
virtual void Clone()
{
...
doClone();
...
};
...
private:
virtual void doClone()... |
It depends.
The web server on the other end will be set to a certain port, usually 80 and will only accept requests on that specific port. Something along the chain will need to be talking to port 80 to the website.
If you control the website, then you can change the port, or get it to accept requests on multipl... |
Minimum: make sure it is running :)
However, some other stuff would be very useful. For example, the CPU load, RAM usage and (in multiuser systems) which user is running what. Also, for applications that access network, a list of network connections for each app. And (if you have access to client computer(s)) it wou... |
I've used [Automated Build Studio][1] before for a similar task. It gives you a lot of flexibility in what you can do.
[1]: http://www.automatedqa.com/products/abs/index.asp |
What we do is to put it in a separate directory on the server (you could use something like /config, /opt/config, /root/config, /home/username/config, or anything you want). When our servlets start up, they read the XML file, get a few things out of it (most importantly DB connection information), and that's it.
I a... |
If the subdirectories and OK and it's the subdirectories that are large, you could try a non-recursive fresh checkout. |
I think this may help;
> Some of the patterns disappear -- that
> is, they are supported directly by
> language features, some patterns are
> simpler or have a different focus, and
> some are essentially unchanged.
[AIM-2002-005] Gregory T. Sullivan, [Advanced Programming Language Features for Executable Des... |
I think the module you're looking for is FindBin:
#!/usr/bin/perl
use FindBin;
$0 = "stealth";
print "The actual path to this is: $FindBin::Bin/$FindBin::Script\n";
|
I'd recommend taking a look at [Blueprint][1] and [960 Grid System][2].
Besides doing resets and including CSS fixes for Internet Explorer, they'll both give you an easy to work with design grid that will take care of a lot of the tedious tweaking when building CSS-based layouts.
[1]: http://www.blueprintcss... |
I took the code from the first link provided in the question ( http://www.codeproject.com/KB/dotnet/AppBar.aspx ) and modified it to do two things:
1. Work with WPF
1. Be "standalone" - if you put this single file in your project, you can call AppBarFunctions.SetAppBar(...) without any further modification to t... |
We have something similar implemented in our system. We store the specific loggers in a HashMap and initialize appenders for each of them as needed.
Here's an example:
public class JobLogger {
private static Hashtable<String, Logger> m_loggers = new Hashtable<String, Logger>();
private static String m_fi... |
Conforming to a strict doctype will take care of many of the differences as well. Also, I generally add a <div> tag to encase everything within the body, because I've noticed a difference in how firefox vs ie handle the body tag as a top level element. |
Absolutely pointless. But, if the user's want it, and it doesn't take too long, it may be worthwhile. Users are silly sometimes, and if it makes them happy... |
I also think that foreign keys are a necessity in most databases. The only drawback (besides the performance hit that comes with having enforced consistence) is that having a foreign key allows people to write code that assumes there is a functional foreign key. That should never be allowed.
For example, I've seen... |
interface type method parameter implementation c# |
|asp.net| |
Is it possible to do like this
interface IDBBase {
DataTable getDataTableSql(DataTable curTable,IDbCommand cmd);
.
.
.
}
class DBBase:IDBBase {
public DataTable getDataTableSql(DataTable curTable, SqlCommand cmd)
{
....
.
.
.
}
|
Is it possible to do like this
interface IDBBase {
DataTable getDataTableSql(DataTable curTable,IDbCommand cmd);
...
}
class DBBase : IDBBase {
public DataTable getDataTableSql(DataTable curTable, SqlCommand cmd) {
...
}
... |
|c#|asp.net| |
[Intel® VTune™ Performance Analyzer][1] for quick sampling
[1]: http://www.intel.com/cd/software/products/asmo-na/eng/219898.htm |
How can I perform a Google search on different Google datacentres? |
|seo| |
I would like to get up-to-date information on Google's index of a website, and it seems
that results vary depending on which datacentre happens to process your search query. |
Well, you can use sockets, obviously, and using sockets you can create a seperate, dedicated server app, which you can't do with Live (as far as I know). You could also try SteamWorks; I haven't heard of anyone trying that, however. |
I doubt it.
http://msdn.microsoft.com/en-us/library/ms190273(SQL.90).aspx
The approach recommended by Microsoft is as follows (taken from the url above)
UPDATE MyTable SET NullCol = N'some_value' WHERE NullCol IS NULL
ALTER TABLE MyTable ALTER COLUMN NullCOl NVARCHAR(20) NOT NULL
|
You can get the drivers from the [IBM site][1]. You will need to have IBM ID and password to login (which you can obtain [here][2]).
[1]: https://www14.software.ibm.com/webapp/iwm/web/preLogin.do?lang=en_US&source=swg-idsjs11
[2]: https://www.ibm.com/account/profile/us/en?page=reg |
You can get the drivers from the [IBM site][1]. You will need to have IBM ID and password to login (which you can obtain [here][2]). Zip file is about 7 MBs, in contains DB2 9.5 JDBC and SQLJ drivers.
[1]: https://www14.software.ibm.com/webapp/iwm/web/preLogin.do?lang=en_US&source=swg-idsjs11
[2]: https://www.i... |
You can get the drivers from the [IBM site][1]. You will need to have IBM ID and password to login (which you can obtain [here][2]). Zip file is about 7 MBs, in contains DB2 9.5 JDBC (type 2/4) and SQLJ drivers. Type 4 drivers are in db2jcc4.jar.
However, you won't be able to connect to mainframes with this driver if ... |
As was mentioned by previous responses, [Resharper][1] works well for this as well as a variety of other cases such as ways to make code cleaner and generate certain things for you. The best way to really figure out all the advantages of Resharper is to download the trial, print out a [Keymap Cheatsheet][2] and stick i... |
Yup. I did that too. Took out IMEX=1, took out Extended Properties, etc. I managed to break it on the dev and test servers. :) I put those back in one at a time until it was fixed on dev and test again but still no workie on prod. |
We were just discussing some of the aspects of C++ and OO at lunch, someone (a great engineer actually) was saying that unless you have a really strong programming background before you learn C++, it will literally ruin you.
I highly recommend learning another language first, then shifting to C++ when you need it. ... |
Check [here][1].
[] matches a range of characters.
I think you want something like this:
SELECT [Phone]
FROM [Table]
WHERE
(
[Phone] LIKE '%[A-Z]%'
OR [Phone] LIKE '%[a-z]%'
OR [Phone] = 'N/A'
OR [Phone] LIKE '0'
)
[1]: http://doc.ddart.net/mssql... |
There is no support for scheduling in WebSphere.
If you are on unix you can use crontab to schedule a request to a page of your websphere application. I suppose on windows there is also a possibility to schedule a request to a page. In my crontab I schedule a request to a webpage each day at 8:45
45 8 * * * GET h... |
You need a macros for resource identifiers in Visual Studio as the resource compiler only understands them (i.e., it doesn't work with const or enum). |
Make a backup of the folder that has the missing .svn
Then delete the folder
If it is the root of the checkout, you will have to re-checkout
If it is not the root, just run an update from a directory above.
Then move the backup folder on top of it. (Ideally do not move back the .svn folders)
Continue wor... |
One of the central points of The Mythical Man Month was that the hard part of software development is figuring out what to say, not how to say it.
The way I've interpreted this recently is that the most value you get out of the first draft is the requirements you've gathered and preserved in the form of tests. If y... |
- Whether the application is running.
- Unusual cpu/memory/network usage.
- Report any unhandled exceptions.
- Status of various modules (if applicable).
- Status of external components (databases, webservices, fileservers, etc.)
- Number of pending background tasks (if applicable).
- Maybe track usage of the app... |
To clarify earlier answers, the HTTP protocol is 'registered' with port 80, and HTTP over SSL (aka HTTPS) is registered with port 443.
Well known port numbers are [documented by IANA][1].
If you mean "bypass logging software" on the web server, no. It will see the traffic coming from you through the proxy syste... |
The answer is 'it depends'. Why do you need to monitor? How large is your operations staff? Do you need reporting? What is the application environment? Who cares if the application fails? Who cares if an exception happens? Are any of the errors recoverable? I could ask questions like these for a long time. |
It looks like you're using 1.0 as the aspect when you call gluPerspective(). You should use width/height. For example, if your viewport is 640x480, you would use 1.33333 as the aspect argument. |
In the Solution Explorer view, click the "Show All Files" icon. This will put "+" symbol next to each of your files. Click the + and it will expand to show the .CS file which holds the ASMX's code. At this point, double click that file instead. |
I use, and really like, role_requirement:
http://code.google.com/p/rolerequirement/ |
It also depends on what you care about for your application. For n-tier apps GUIDs/UUIDs are simpler to implement and are easier to port between difference databases. To produce Integer keys some database support a sequence object natively and some require custom construction of a sequence table.
Integer keys prob... |
You could look into using Solr. http://lucene.apache.org/solr
Solr is a sort of generic search application that uses Lucene and supports highlighting. It's possible that the highlighting in Solr is usable as an API outside of Solr. You could also look at how Solr does it for inspiration. |
Build your app with debug symbols, then either add an exception handler or configure Dr Watson to generate crash dumps (run drwtsn32.exe /i to install it as the debugger, without the /i to pop the config dialog). When your app crashes, you can inspect where it went wrong in windbg or visual studio by seeing a callstack... |
How to stream a pdf as binary to the browser using .NET 2.0 |
|.net| |
I'm looking for a way to stream a pdf from my server to the browser using .NET 2.0 (in binary).
Edit: I'm trying to grab an existing pdf from a server path and push that up as binary to the browser. |
[Here is a link][1] to a Visio Stencil and Template for UML 2.0.
[1]: http://softwarestencils.com/uml/index.html |
Definitely useful, at least from the user's point of view. By manually resending the email, they *know* that it has been sent and can check their spam folder immediately to catch the mail. Otherwise, they might not know about the mail and it will dissapear from their spam before they can catch it. |
It can be useful. The users may have deleted it by accident. It may have been a transient error in the recipient's mail server. Spam filters aren't the only cause of lost mail.
|
write the binary to the output stream. Response.OutputStream. then just add the header Content-Disposition header. |
Useful - any number of factors can change between the first and the second sending. |
You can just setup a handler or a page that set's the correct response type and output the pdf to the response output buffer. |
At some point, you have to ship something. Assuming you're going through some sort of a formal test process, as long as the product continues to change, testing is never going to be able to sign off on a working product.
It helps to come up with a timeline describing what features will be released and when. That way... |
Object Oriented Update Approach |
|oop|update|strategy| |
<p>I've been tasked with maintaining an application originally written in VB6. It has since been imported into VB .Net and to say the least the code is anything but Object Oriented. The code is riddled with classes which contain nothing more than Public Shared attributes(variables) and methods(functions), the result of... |
Wrap your connection class.
Set a limit on how many connections you make.
Return an unused connection.
Intercept close to free the connection.
|
Wrap your connection class.
Set a limit on how many connections you make.
Return an unused connection.
Intercept close to free the connection.
Update:
http://www.modpython.org/FAQ/faqw.py?file=faq03.003.htp&req=edit
<quote>
I put something like this in dbpool.py (snippet from http://www.sqlalchemy.org/docs/p... |
Should there be a maximum length? This is a curious topic in IT in that, longer passwords are typically harder to remember, and therefore more likely to get written down (a BIG no-no for obvious reasons). Longer passwords also tend to get forgotten more, which while not necessarily a security risk, can lead to adminis... |