instruction stringlengths 0 30k ⌀ |
|---|
|sql-server|restore| |
I have a SQL Server 2005 database that could only be restored using
Restore Database The_DB_Name
From Disk = 'C:\etc\etc'
With Continue_After_Error
I am told the source database was fine. The restore reports
Warning: A column nullability inconsistency was detected in the metadata of index "IDX\_C... |
I have a SQL Server 2005 database that could only be restored using
Restore Database The_DB_Name
From Disk = 'C:\etc\etc'
With Continue_After_Error
I am told the source database was fine. The restore reports
Warning: A column nullability inconsistency was detected in the metadata of index "IDX\_C... |
I have a SQL Server 2005 database that could only be restored using
Restore Database The_DB_Name
From Disk = 'C:\etc\etc'
With Continue_After_Error
I am told the source database was fine. The restore reports
> Warning: A column nullability
> inconsistency was detected in the
> metadata of index... |
Would you be transferring the whole content of the database from one server to another or just some data from a couple of tables?
For both options SSIS would do the job especially if you are planning to to the transfer on a regular basis.
If you simply want to copy some data from 1 or 2 tables and prefer to do i... |
Would you be transferring the whole content of the database from one server to another or just some data from a couple of tables?
For both options SSIS would do the job especially if you are planning to to the transfer on a regular basis.
If you simply want to copy some data from 1 or 2 tables and prefer to do i... |
Would you be transferring the whole content of the database from one server to another or just some data from a couple of tables?
For both options SSIS would do the job especially if you are planning to to the transfer on a regular basis.
If you simply want to copy some data from 1 or 2 tables and prefer to do i... |
I highly doubt it.
There are a lot of questionable ways of freeing memory, for example you can use `delete` on your `char` array (rather than `delete[]`) and it will likely work fine. I [blogged][1] in detail about this (apologies for the self-link, but it's easier than rewriting it all).
The compiler is not so m... |
Both SQL Server and Oracle (and I believe also others DBs) support encryption of data at the database level. If you want to encrypt something why don't simply abstract the access to the data that could be encrypted on the database server side and left the user choose if use the encrypted data (in this case the SQL comm... |
|debugging| |
Is it possible to get gdb or use some other tools to create a core dump of a running process and it's symbol table? It would be great if there's a way to do this without terminating the process.
If this is possible, what commands would you use? (I'm trying to do this on a Linux box) |
I keep backups of all of my code for as long as possible. The important things are backed up on my web server and external hdd. You can always delete things later, but if you think you might find a use for it, why not keep it? |
I don't think there is really anything that is going to do this. If you could setup a local Oracle database, then most likely you could as oracle has various means of keeping two databases "in sync", provided they are both Oracle.
If you must use mysql, then likely you are going to just have to write something to sy... |
I don't think there is really anything that is going to do this. If you could setup a local Oracle database, then most likely you could as oracle has various means of keeping two databases "in sync", provided they are both Oracle.
If you must use mysql, then likely you are going to just have to write something to sy... |
JavaScript to scroll long page to DIV |
|javascript|html| |
I have a link on a long HTML page. When I click it, I wish a DIV on another part of the page to be visible in the window by scrolling into view.
A bit like EnsureVisible in other languages.
I've checked out scrollTop and scrollTo but they seem like red herrings.
Can anyone help? |
Source control, keep it offsite and keep it for life! You'll never have to worry about it. |
Why not a named anchor? |
If I use it, it gets stuck in a Bazaar repository and uploaded to Launchpad. If it's a little side project that pitters out, I usually move it to a `junk/` subdirectory.
> I'll use it again. I imagine something I end up programming will need a B-Tree, or is that just delusional?
Something you write will need a B-... |
Run the original application with ADplus -crash -pn appnename.exe
When the memory issue pops-up you will get a nice big dump.
You can analyze the dump to figure what memory location was corrupted.
If you are lucky the overwrite memory is a unique string you can figure out where it came from. If you are not lucky, ... |
Run the original application with ADplus -crash -pn appnename.exe
When the memory issue pops-up you will get a nice big dump.
You can analyze the dump to figure what memory location was corrupted.
If you are lucky the overwrite memory is a unique string you can figure out where it came from. If you are not lucky, ... |
I use [SyntaxHighligher][1] on [my blog][2].
[1]: http://code.google.com/p/syntaxhighlighter/wiki/Usage
[2]: http://bradwilson.typepad.com |
Just run it through a tool like: http://www.gnu.org/software/src-highlite/ |
You could connect over a secure socket connection, or hash the password locally before sending it to the database (or better, both) - Ideally, the only time the password should exist in plain text form is prior to hashing. If you can do all of that on the client side, more the better. |
To avoid duplicates on imports:
1 - If there's not already a primary key on the table, put one on FLDA and FLDB (together). If there's already a primary key that's not FLDA and FLDB (together), place an index on the table on these two fields, unique yes, ignore nulls no.
2 - You can import from the spreadsheet t... |
Best way to access table instances when using SQLAlchemy's declarative syntax. |
|update|insert|sqlalchemy|declarative| |
all the docs for sql alchemy give INSERT and UPDATE examples using the local table instance (i.e. tablename.update()... )
doing this seems difficult with the declarative syntax, I need to reference Base.metadata.tables["tablename"] for get the table reference.
Am I sposed to do this another way? Is there a diff... |
Short answer: it's hard.
There was some really good work in the DEC SRC Modula-3 and larch stuff from the late 1980's.
e.g.
- [Thread synchronization: A formal specification][1] (1991)
by A D Birrell, J V Guttag, J J Horning, R Levin
System Programming with Modula-3, chapter 5
- [Extended static chec... |
I can think of 2 reasons:
1) the old "box model" of IE is really flaky, so when you have an element with the style { width: 300px; padding: 30px; margin: 20px;} it's outline might not actually match up to the expected 400px (300 px size, plus 2 30px padding, plus 2 20 px margin. I think its actual width would be 34... |
This makes for a much larger net plus in lines of code, but a tangible gain in readability:
using (StreamWrapper wrapper = new StreamWrapper("c:\file.txt", FileMode.Open))
{
// do stuff using wrapper.Reader
}
Where StreamWrapper is defined here:
private class StreamWrapper : IDisposa... |
No, it's undefined behaviour. As you say, you can usually get away with it, but it's good practice to get into the habit of matching delete[] with new[] for the cases where you can't. |
No, it's undefined behaviour - a compiler could plausibly do something different, and as the C++ FAQ entry that [thudbang](http://stackoverflow.com/questions/70880/deleting-a-buffer-through-a-different-type-of-pointer#70905) linked to says, `operator delete[]` might be overloaded to do something different to `operator... |
Here's another Ruby answer, this one uses lambdas:
(a=lambda{a.call}).call
|
Use script/console, and call code in a model or a controller that does something like the following:
require 'RMagick'
include Magick
img = ImageList.new('myfile.jpg')
img.crop(0,0,10,10) # or whatever
img.write('mycroppedfile.jpg')
|
You can use the system call, read [manpage for system(3)][1]
[1]: http://www.linuxmanpages.com/man3/system.3.php |
You can always set the column width to 0 (zero) if you don't find a better way.
|
Packaging up Tomcat |
|java|web-applications|tomcat| |
In my job we have to deploy an application on various environments. It's a standard WAR file which needs a bit of configuration, deployed on Tomcat 6.
Is there any way of creating a 'deployment package' with Tomcat so that you just extract it and it sets up Tomcat as well as your application? I'm not sure that creat... |
In my job we have to deploy an application on various environments. It's a standard WAR file which needs a bit of configuration, deployed on Tomcat 6.
Is there any way of creating a 'deployment package' with Tomcat so that you just extract it and it sets up Tomcat as well as your application? I'm not sure that creat... |
Exclude certain pages from using a HTTPModule |
|.net|asp.net| |
Is there a good way to exclude certain pages from using a HTTP module?
I have an application that uses a custom HTTP module to validate a session. The HTTPModule is set up like this in web config:
<system.web>
<!-- ... -->
<httpModules>
<add name="SessionValidationModule"
ty... |
How do I expose data in a JSON format through a web service using Java? |
|java|web-services|json| |
Is there an easy way to return data to web service clients in JSON using java? I'm fine with servlets, spring, etc. |
Another cheap way to get a 2nd thread is to wrap it in a delegate. |
I could be wrong here, but I think this just means that someone could use the Command object to do bad things. I.e. it's not to be trusted if someone else is scripting it.
See [safe for scripting][1] in this article. Every instance that talks about this phrase online, references it as if you are marking an ActiveX... |
Silly me.
Had to close the tags.
Instead of <tag1> I had to change it to <tag1 /> or <tag1></tag1>
Now all works! |
Silly me.
Had to close the tags.
Instead of`<tag1>`</code> I had to change it to `<tag1 />` or `<tag1></tag1>`
Now all works! |
+1 for attachment_fu
I use attachment_fu in one of my apps and MUST store files in the DB (for annoying reasons which are outside the scope of this convo).
The (one?) tricky thing dealing w/BLOB's I've found is that you need a separate code path to send the data to the user -- you can't simply in-line a path on t... |
+1 for attachment_fu
I use attachment_fu in one of my apps and MUST store files in the DB (for annoying reasons which are outside the scope of this convo).
The (one?) tricky thing dealing w/BLOB's I've found is that you need a separate code path to send the data to the user -- you can't simply in-line a path on t... |
I don't know if this would work, but how about if you created a new table which contained all the possible dates (that might be the problem with this idea, if the range of dates is going to change unpredictably...) and then do a left join on the two tables? I guess it's a crazy solution if there are a vast number of po... |
I wouldn't discard C++. In fact, I would consider adding Boost to your C++ library, which makes the language much more usable. Your example would become:
BOOST_FOREACH( Thingy& t, lostOfThingys ) {
// do something with 't'
}
Boost has tons of tools that help make C++ a better language. |
How do i pass an object to a JSP tag |
|jsp-tags|jsp| |
I have a JSP page that contains a scriplet where i instantiate an object. I would like to pass that object into the JSP tag without using any cache.
For example i would like to accomplish this:
<%@ taglib prefix="wf" uri="JspCustomTag" %>
<%
Object myObject = new Object();
%>
... |
|jsp|jsp-tags|expression-language| |
Personally, I would disable magic_quotes. In PHP5+ it is disabled by default and it is better to code as if it is not there at all as it does not escape everything and it will be removed from PHP6.
Next, depending on what type of user data you are filtering will dictate what to do next e.g. if it is just text e.g. a... |
The closest you are going to get is using a Dictionary (as mentioned by Pacifika)
Dim objDictionary
Set objDictionary = CreateObject("Scripting.Dictionary")
objDictionary.CompareMode = vbTextCompare 'makes the keys case insensitive'
objDictionary.Add "Name", "Scott"
objDictionary.Add "Age", "... |
Your performance deteriorates when using recursion because calling a method, in any language, implies a lot of preparation: the calling code posts a return address, call parameters, some other context information such as processor registers might be saved somewhere, and at return time the called method posts a return v... |
I would strongly recommend getting someone experienced in JSF to lead your first project in JSF even if this means paying a contractor for 3 months.
The JSF approach is very different to JSP. The way you approach and solve problems is very different.
<h2> Libraries </h2>
Consider the following libraries:
<ul>
<l... |
How to use the "is" operator in System.Type variables? |
|c#| |
here is what a I'm doing:
object ReturnMatch(System.Type type)
{
foreach(object obj in myObjects)
{
if (obj == type)
{
return obj;
}
}
}
However, if obj is a subclass of `type`, it will not mat... |
Need a wiki where I can export to Word |
|wiki|requirements|word| |
I'm looking for a wiki that I can use to track requirements for a project, but we would like to be able to export the wiki (with formatting) to Microsoft Word. Does anyone know of a wiki that does this? |
|wiki|ms-word|requirements| |
Agreed, never send the password the user chose in plaintext. However, short of using public key cryptography, if you email them a password, it's going to be in cleartext. One thing I've seen often happen is that when the user forgets the password and requests it being sent to them, the system generates a new password a... |
alias -- ddt='ls -trFld'
dt () { ddt --color "$@" | tail -n 30; }
Gives you the most recent files in the current directory. I use it all the time... |
Check out the [Nant reference][1]. The fileset patterns are:
'\*' matches zero or more characters, e.g. \*.cs
'?' matches one character, e.g. ?.cs
And '\*\*' matches a directory tree e.g. src/\*\*/\*.cs will find all cs files in any sub-directory of src.
[1]: http://nant.sourceforge.net/release/latest/h... |
How about storing the addresses as text (allowing newlines). The postal code will have to be extracted from the address with a regex (selected based on a country dropdown), and should be stored in a separate column.
This doesn't deal with the "as descriptive as possible" requirement, but in general, enforcing more ... |
In a client-server application: How to send to the DB the user's application password? |
|java|oracle-database|passwords| |
I have an Java desktop application wich connects directly with the DB (an Oracle). The application has multiple user accounts. What is the correct method to send the user's password (not DB password) over the network? I don't want to send it in plain text |
|java|oracle-database|security|passwords| |
I have some code I wrote a while ago: [text2num](http://git.hewgill.com/gitweb?p=text2num.git;a=blob;f=text2num.py;h=f6d22be806298c1335233f42a441304e7ba2a55a;hb=b651139797b950a33431585d75ea28fcbab852a4). This does some of what you want, except it does not handle ordinal numbers. I haven't actually used this code for an... |
Do NOT use a path relative to .exe path. That will get you into trouble with Windows XP in limited access mode, as well as with Windows Vista.
Do you need one database for all users?
Use a path relative to All Users\Application Data directory.
Do you need separate databases per user?
Use a path relative to us... |
For the situation that you describe, I would recommend Direct3D.
The primary reason to use Direct3D instead of OpenGL is that often video card vendors only do a good job on the OpenGL drivers for their "high end" cards.
The low end game type cards tend to get poor and generally buggy drivers, causing problems on ... |
I would suggest linq. It scales well on our site and is simple enough to use. |
<a href="#myAnchorALongWayDownThePage">Click here to scroll</a>
<A name='myAnchorALongWayDownThePage"></a>
No fancy scrolling but it should take you there.
|
Answer posted [here][1] - same solution to your problem.
Edit: the JQuery answer is very nice if you want a smooth scroll - I hadn't seen that in action before.
[1]: http://stackoverflow.com/questions/66964/how-do-i-create-a-link-to-a-footnote-in-html |
My two standard books are "Object-Oriented Programming in C++", Third Edition, by Robert LaFore, published by The Waite Group, and "C++ from the Ground Up" by Herbert Shildt, published by Osborne McGraw-Hill. |
They are fundamentally very different beasts so there is no least resistance path between. However I recommend you to read <http://www.phpcompiler.org/doc/virtualinheritance.html> beforehand in case you ever need a non-trivial inheritance. It can save you a few headaches. |
It is my understanding that in Direct3D you must handle all resource allocation and management yourself, whereas the OpenGL specification leaves this to the driver/implementation rather than the application.
This allows Direct3D developers to use the best allocation and management methods suitable to the application... |
Are you using stored procs? If so you should watch out for parameter sniffing. In certain situations this can make for some very long running queries. Some reading:
http://blogs.msdn.com/queryoptteam/archive/2006/03/31/565991.aspx
http://blogs.msdn.com/khen1234/archive/2005/06/02/424228.aspx |
How about the [JQuery ScrollTo - see this sample code][1]
[1]: http://demos.flesler.com/jquery/scrollTo/ |
I think the way you describe in the question is the only way you can do it in sourceSafe.
I usually name the copied directory "V1.0" (or whatever is appropriate) and keep them all in a folder that is the main project name. |
I would call getNextEntry() on the ZipInputStream until it is at the entry you want (use ZipEntry.getName() etc.). Calling getNextEntry() will advance the "cursor" to the beginning of the entry that it returns. Then, use ZipEntry.getSize() to determine how many bytes you should read using zipInputStream.read(). |
You could try [Graphviz][1]. It *runs on Linux*, Windows and Mac OS X and it will generate an image (PNG, PS, etc) of the graph. But you will have to transform your foaf data into its own custom language, which is easy to learn.
[1]: http://www.graphviz.org |
you would go at it exactly the same way as you would a text file. writing your data byte by byte, encoded in such a way that when you read the file you know what you are reading.
for a spreadsheet application you could even use a text format (OOXML, OpenDocument) to store presentation and content information.
Or ... |
The best answer is "in multiple places". If were concerned about keeping my source code for as long as possible I would do:
1) Backup to some optical media on a regular basis, say burn it to DVD once a month and archive it offsite.
2) Back it up to multiple hard drives on my local machines
3) Back it up to... |
The best answer is "in multiple places". If I were concerned about keeping my source code for as long as possible I would do:
1) Backup to some optical media on a regular basis, say burn it to DVD once a month and archive it offsite.
2) Back it up to multiple hard drives on my local machines
3) Back it up ... |
In XP there is a DOS command called shutdown. If you type `shutdown /?` from a command prompt you will see the options available. Using this you can create a Batch file. |
If you're using Java, you could use [JGraph][1].
[1]: http://www.jgraph.com/ |
Try DShutdown.exe. It's flexible and can do all these things. |
You have to know the binary file format for the file you are trying to create. Consider [Joel's post on this topic](http://www.joelonsoftware.com/items/2008/02/19.html): the 97-2003 File Format is a 349 page spec.
Nearly all the time, to do something like that, you use an API, to avoid the grunt work. Be careful... |