instruction stringlengths 0 30k ⌀ |
|---|
I am currently creating a master ddl for our database. Historically we have used backup/restore to version our database, and not maintained any ddl scripts. The schema is quite large.
My current thinking:
* Break script into parts (possibly in separate scripts):
1. table creation
2. add indexes
3. add tri... |
|sql|mssql|schema|ddl| |
I am currently creating a master ddl for our database. Historically we have used backup/restore to version our database, and not maintained any ddl scripts. The schema is quite large.
My current thinking:
* Break script into parts (possibly in separate scripts):
1. table creation
2. add indexes
3. add tri... |
Deleting rows in joined tables using ADO |
|ado|dao| |
Now I have seen this question in [another forum][1] but it didn't had an acceptable answer.
Suppose I have two tables, the Groups table and the Elements table. The tables have no defined relationships. The Elements table has an IdGroup field that refers to the IdGroup (PK) field of the Groups table.
I use the fol... |
Assuming a network transport, a TCP/IP based one, Packets are sent in response to ACK/NACK packets going the other way.
By limiting the rate of packets acknowledging receipt of the incoming packets, you will in turn reduce the rate at which new packets are sent.
It can be a bit imprecise, so its possibly optim... |
Under the hood, Joomla runs on mostly an OO architecture, whereas Drupal is almost entirely procedural with OO paradigms. Joomla has no form builder (that I am aware of), so you are forced to hand-code entire blocks of html for the form, whereas, with Drupal, you create forms as structured arrays. In Joomla, creating a... |
You can use [sp_settriggerorder][1] to define the order of each trigger on a table.
However, I would argue that you'd be much better off having a single trigger that does multiple things. This is _particularly_ so if the order is important, since that importance will not be very obvious if you have multiple triggers... |
|encryption|language-agnostic|security|key-management| |
Suppose that a group wants to encrypt some information, then share the encryption key among the group members in a way that requires the consensus of the group to decrypt the information. I'm interested in a variety of scenarios where the breadth of consensus ranges from unanimity to an absolute majority. A useful tech... |
Where can I learn about proven methods for sharing cryptographic keys? |
|language-agnostic|security|encryption|key-management| |
Use the FileSystemWatcher object. Here is some code to do what you are looking for.
<pre>
// Declares the FileSystemWatcher object
FileSystemWatcher watcher = new FileSystemWatcher();
// We have to specify the path which has to monitor
watcher.Path = @"\\somefilepath";
... |
Use the FileSystemWatcher object. Here is some code to do what you are looking for.
<pre>
// Declares the FileSystemWatcher object
FileSystemWatcher watcher = new FileSystemWatcher();
// We have to specify the path which has to monitor
watcher.Path = @"\\somefilepath";
//... |
* Eclipse with:
* Subclipse
* JBoss Tools
* Ant
* Junit
* Ultraedit (for column editing)
* JAD
* Jarbrowser
* SQLYog (for MySQL), TOAD (for Oracle), Management Studio (for SQL Server)
Eclipse has already a lot to offer, thanks to the countless plugins (which support other languages and envi... |
[JavaScript Closures For Dummies][1] is the article that finally got me to understand closures. The explanation posted there is much better than anything I could write here.
[1]: http://blog.morrisjohns.com/javascript_closures_for_dummies |
There's also a project called [Java Database Migrations][1].
[1]: http://blog.carbonfive.com/2008/09/java/java-database-migrations |
There's also a project called [Java Database Migrations][1]. To get the code check out the [Google Code page for the project][2].
[1]: http://blog.carbonfive.com/2008/09/java/java-database-migrations
[2]: http://code.google.com/p/c5-db-migration/ |
I have got a secret weapon : [shell-fu.][1]
[1]: http://www.shell-fu.org/
There are thousand of smart tips, cool tricks and efficient recipes that most of the time fit on a single line.
One that I love (but I cheat a bit since I use the fact that Python is installed on most Unix system now) :
alias... |
Closures are hard to explain because they are used to make some behaviour work that everybody intuitively expects to work anyway. I find the best way to explain them (and the way that *I* learned what they do) is to imagine the situation without them:
var bind = function(x) {
return function(y) { return... |
I think this should do what you want:
<table width="100%" padding="5">
<tr>
<td>
One, two, three ... One, two, three ... One, two, three ... One, two, three ... One, two, three ... One, two, three ... One, two, three ... One, two, three ... One, two, three ...
</td>
</tr>
... |
I think this should do what you want:
<table width="100%" cellpadding="5">
<tr>
<td>
One, two, three ... One, two, three ... One, two, three ... One, two, three ... One, two, three ... One, two, three ... One, two, three ... One, two, three ... One, two, three ...
</td>
</tr... |
|dynamic|operator|creation| |
Dynamically created operators |
|c++|wxwidgets|dynamic|operator| |
I created a program using dev-cpp and wxwidgets which solves a puzzle.<br>
The user must fill the operations blocks and the results blocks, and the program will solve it.<br>
Im solving it using bruteforce, i generate all non repeated 9 length number combinations using a recursive algorithm. It does it pretty fast.<b... |
I believe this might be a VS related authorization problem not a particular WCFS problem.<br/>
Try this fix:
[http://developerspoint.wordpress.com/2008/06/25/how-to-deal-with-project-creation-failed-problem-of-visual-studio-2008/][1]
[1]: http://developerspoint.wordpress.com/2008/06/25/how-to-deal-with-project... |
That code fragment doesn't say much - if the code is server-side why don't you change e.g. the class of the HTML element there? |
You can point an RSS Viewer web part at the laconi.ca public stream RSS feed and use this XSLT to ensure attractive output:
<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" version="1.0" exclude-result-prefixes="xsl ddwrt msxsl rssaggwrt"
xmlns:ddwrt="http://schemas.microsoft.com/WebP... |
You can point an RSS Viewer web part at the laconi.ca public stream RSS feed and use this XSLT to ensure attractive output.
**Result screen shot:**
![Screenshot of Laconica update stream in SharePoint Team Site][1]
**XSL transform:**
<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" version="1.... |
You should set your colors in CSS, and then change the CSS class programatically. For example:
(CSS)
div.Error {
color:red;
}
(ASP.NET/VB)
<div class='<%=Iif(HasError, "Error", "")%>'> .... </div>
|
Take a close look at [cSounds][1]. There are Python bindings allow you to do pretty flexible digital synthesis. There are some pretty complete packages available, too.
See [http://www.csounds.com/node/188][2] for a package.
See [http://www.csounds.com/journal/issue6/pythonOpcodes.html][3] for information on P... |
Best javascript framework for drawing/showing images? |
|javascript-toolkit| |
What's the best javascript framework for drawing (lines, curves whatnot) on images? |
|security|ssl|https| |
If you don't wont to pollute your source code (after all this warning presents only with Microsoft compiler) add <code>_CRT_SECURE_NO_WARNINGS</code> symbol to your project settings via "Project"->"Properties"->"Configuration properties"->"C/C++"->"Preprocessor"->"Preprocessor definitions".
Also you can define it ju... |
I have used 1 in the past and it worked well. |
**Database** : Sql Compact Edition
**Drawback** : Stored procedures are not supported.
Regardless of this limitation, this DB has its' uses especially as a client cache for application that can be smart client or distributed to mobile platforms. |
Where possible make the external dependencies part of your build system.
For instance check the installer in to your version control system and have a step that checks it out and runs it in silent mode (many installers support a mode with no user action sometimes using the commandline /s).
This way if you need to s... |
**Database** Microsoft SQL Server 2005
**Defect** Badly implemented UI
**Description**
SQL Server management studio does not offer a great user experience:
- Tabbing behaviour is weird: you are always looking for the right tab
- Keeps on crashing on 64-bit versions
- Missing some features of preceding ... |
This seems to work:
`
select
so.name as [proc],
so2.name as [table],
sd.is_updated
from sysobjects so
inner join sys.sql_dependencies sd on so.id = sd.object_id
inner join sysobjects so2 on sd.referenced_major_id = so2.id
where so.xtype = 'p' -- procedure
and is_updated = 1 -- proc upda... |
select
so.name,
sc.text
from
sysobjects so inner join syscomments sc on so.id = sc.id
where
sc.text like '%INSERT INTO xyz%'
or text like '%UPDATE xyz%'
This will give you a list of all stored procedure contents with INSERT or UPDATE in them for a particular table (yo... |
select
so.name,
sc.text
from
sysobjects so inner join syscomments sc on so.id = sc.id
where
sc.text like '%INSERT INTO xyz%'
or sc.text like '%UPDATE xyz%'
This will give you a list of all stored procedure contents with INSERT or UPDATE in them for a particular table ... |
@Staale
There is a better way:
job = dict(zip(keys, values))
|
You might want to check out [CPAN](http://www.cpan.org/). It does for Perl scripts exactly what it sounds like your utility will do for your app. |
Maintain the correct version for a COM dll referenced in a .NET project |
|com|.net|c++| |
I want to reference a COM DLL in a .NET project, but I also want to make sure that the interop DLL created will have the correct version (so that patches will know when the DLL must be changed).
If I use TlbImp I can specify the required version with the */asmversion* flag but when I add it directly from VisualStudi... |
|.net|c++|com| |
I want to reference a COM DLL in a .NET project, but I also want to make sure that the interop DLL created will have the correct version (so that patches will know when the DLL must be changed).
If I use TlbImp I can specify the required version with the */asmversion* flag but when I add it directly from VisualStudi... |
What do you expect from such a tool? I don't know of any tool that can arbitrarily test any piece of software. |
Make sure you are changing the correct my.ini file. On Windows this is read from many locations. The order is:
1. WINDIR\my.ini, WINDIR\my.cnf
2. C:\my.ini, C:\my.cnf
3. INSTALLDIR\my.ini, INSTALLDIR\my.cnf
4. defaults-extra-file
Type `mysql --help` in the command prompt to see the actual order on your com... |
No. Even more, generic types are erased to their upper bound by the compiler, so you cannot create a new instance of a generic type T at runtime.
The best way to do metaprogamming in Java is to circumvent the type erasure and hand in the `Class<T>` object of your type T. Still, this is only a hack. |
PHP mail() command does not support authentication. Your options:
1) PHPMailer
Download: http://sourceforge.net/projects/phpmailer
Tutorial: http://phpmailer.codeworxtech.com/index.php?pg=tutorial#2
2) PEAR
Download: http://pear.php.net/package/Mail
Tutorial: http://email.about.com/od/emailprogramming... |
PHP mail() command does not support authentication. Your options:
1) PHPMailer
Download: http://sourceforge.net/projects/phpmailer
Tutorial: http://phpmailer.codeworxtech.com/index.php?pg=tutorial#2
2) PEAR
Download: http://pear.php.net/package/Mail
Tutorial: http://email.about.com/od/emailprogramming... |
The answer to your specific question is no. You can't have two states or otherwise use pack two different ways in the same parent.
However, what I think you want to accomplish is simple. Use the built-in features of the canvas to create an image item that is part of the canvas, then pack things into the canvas as i... |
have you checked the startup parameters? maybe the shell script or batch file that you use to start up the server disable the engine on the command line.. IIRC command line flags trumps the .ini settings. |
Do what the verb implies. GetXXX implies that something is being returned to the caller, while LoadXXX doesn't necessarily return something as it may be just loading something into memory.
For an API, use GetXXX to be clear to the caller that something will be returned. |
One quick hack would be to combine the two arrays with bit shifts. Make an array of longs such that the most significant 32 bits is the number and the least significant 32 is the color. Use a sorting method and then unpack. |
learning drupal fast track: how to create a stackoverflow clone? |
|drupal| |
I've started figuring out drupal, and so far most of the results are just ugly.
May be I need to learn it in something similar to a real-life project.
I thought — to reproduce this site's functionality might be a good learning project. But I need help. :)
Without assuming this site is based on drupal (it most like... |
Like ravenspoint pointed out, everyone expects variables to be local to the block they are defined in. `try` introduces a block and so does `catch`.
If you want variables local to both `try` and `catch`, try enclosing both in a block:
// here is some code
{
string s;
try
{
... |
Java: Best Place to Begin Learning Basic Networking |
|java|networking| |
I am trying to write a simple networked chat program in Java. I have almost no networking experience. I was wondering what resources I should begin looking at (beside here of course).
Sticking with the core Java API would be best for now. |
You can use [sp_settriggerorder][1] to define the order of each trigger on a table.
However, I would argue that you'd be much better off having a single trigger that does multiple things. This is _particularly_ so if the order is important, since that importance will not be very obvious if you have multiple triggers... |
Part of the reason they are not in the same scope is because at any point of the try block, you can have thrown the exception. If they were in the same scope, its a disaster in waiting, because depending on where the exception was thrown, it could be even more ambiguous.
At least when its declared outside of the tr... |
How can I automate the process of deploying an InfoPath Form to SharePoint Server 2007? |
|sharepoint|deployment|infopath|stsadm| |
It is a real pain to deploy my InfoPath 2007 Forms from the designer into our development environment's SharePoint server. All of our forms require "full trust" since they include business logic written in C#. Here are the manual steps:
1) Run the "Publish Form" wizard in InfoPath, specifying the target site to pu... |
There are three basic ways of running external commands:
system $cmd; # using system()
$output = `$cmd`; # using backticks (``)
open (PIPE, "cmd |"); # using open()
With system(), both STDOUT and STDERR will go the same place as the script's STDOUT and STDERR, unless the system() command redirects the... |
Generally, you can do it directly
document.getElementById("myDiv").style.color = "red";
There's a reference [here][1].
[1]: http://w3schools.com/htmldom/dom_obj_style.asp |
I'm not sure if the tool is as critical as the process. I've seen teams be very successful using something as simple as index cards and white boards to manage fairly large projects. One thing that I would recommend in prioritization is make sure you have a comprehensive list of these items together. This way you can... |
I think you have to get them all into one place so that the can be prioritised. Having to collate several different sources makes this virtually impossible. Once you have that then someone/a group have to rank each bug, requested feature and desired development.
Things you could prioritise by are:
- Value added t... |
You should fix all the bugs first and only then think about adding new functions to it. |
It looks like you are writing ASP, or maybe JSP. I'm not too familiar with either language, but the principles are the same no matter what language you are working in.
If you are working with a limited number of colours, then the usual option is to create a number of classes and write rule-sets for them in your styl... |
It looks like you are writing ASP, or maybe JSP. I'm not too familiar with either language, but the principles are the same no matter what language you are working in.
If you are working with a limited number of colours, then the usual option is to create a number of classes and write rule-sets for them in your styl... |
cassini runs locally. I'll get a link..
Edit: Here's the link to the [Cassini][1] Web Server
[1]: http://www.asp.net/Downloads/archived/cassini/ |
[UltiDev Cassini Web Server](http://en.wikipedia.org/wiki/UltiDev_Cassini_Web_Server) |
Thanks, that led me on the right track.
It seems that the label overwrite is a "feature" and not a bug. It's working as designed
sixletter's link above explains it, and below are two more with info about it.
http://msdn.microsoft.com/en-us/library/ms181439(VS.80).aspx
http://msdn.microsoft.com/en-us/library/ms... |
Best method for storing this pointer for use in WndProc |
|winapi|windows|c++|oop|wndproc| |
I'm interested to know the best / common way of storing a this pointer for use in the WndProc. I know of several approaches, but each as I understand it have their own drawbacks. My questions are:
What different ways are there of producing this kind of code:
CWindow::WndProc(UINT msg, WPARAM wParam, LPARAM)
... |
I'm interested to know the best / common way of storing a this pointer for use in the WndProc. I know of several approaches, but each as I understand it have their own drawbacks. My questions are:
What different ways are there of producing this kind of code:
CWindow::WndProc(UINT msg, WPARAM wParam, LPARAM)
... |
|c++|windows|winapi|oop|wndproc| |
I'm interested to know the best / common way of storing a this pointer for use in the WndProc. I know of several approaches, but each as I understand it have their own drawbacks. My questions are:
What different ways are there of producing this kind of code:
CWindow::WndProc(UINT msg, WPARAM wParam, LPARAM)
... |
To avoid saying everything Mark Ingram already said a little tip for using namespaces:
Avoid the "using namespace" directive in header files - this opens the namespace for all parts of the program which import this header file. In implementation files (*.cpp) this is normally no big problem - altough I prefer to us... |
To avoid saying everything Mark Ingram already said a little tip for using namespaces:
Avoid the "using namespace" directive in header files - this opens the namespace for all parts of the program which import this header file. In implementation files (*.cpp) this is normally no big problem - altough I prefer to us... |
To avoid saying everything Mark Ingram already said a little tip for using namespaces:
Avoid the "using namespace" directive in header files - this opens the namespace for all parts of the program which import this header file. In implementation files (*.cpp) this is normally no big problem - altough I prefer to us... |
If you are only incrementing a number, there is a special class (Interlocked) for just that...
http://msdn.microsoft.com/en-us/library/system.threading.interlocked.increment.aspx
> Interlocked.Increment Method
> Increments a specified variable and stores the result, as an atomic operation.
System.Thre... |
I'm not a database guy, but I imagine doing the inserts in one shot would be faster because the updates require a lookup whereas the inserts do not. |
Value checking. See if only valid dates are exempted, number fields except the full range, ect. |
The Guid refers to the Guid for the TypeLib not the DLL directly. The version numbers refer to the TypeLib's version not the DLLs.
The version number will come from your idl file, and I believe it only supports a major and minor version and not a build version. Is this version changing when you modify the typelib... |
Java and SQLite |
Try this:
in the .aspx file put thees lines
<div id="myDiv" runat="server">
Some text
</div>
then you can use for example
myDiv.Style["color"] = "red"; |
Not sure that this is really what you're looking for but..
Any Object Oriented language such as C++ or C# will allow you to create an "Operator" base class and then to derive from this base class a "PlusOperator" or "MinusOperator" etc'. this is the standard way to avoid such case statements.
However I am not s... |
You can represent the numbers and operators as objects, so the parsing is done only once in the beginning of the solving. |