instruction stringlengths 0 30k ⌀ |
|---|
I think the basic idea is good.
The nice thing about building all the tables first and then building all the constraints, is that the tables can be created in any order. When I've done this I had one file per table, which I put in a directory called "Tables" and then a script which executed all the files in that ... |
It simplifies the interface that any one client will use and removes dependencies that they might otherwise develop on parts of the interface that they don't need. |
Imagine you have data in columns in a text file. With `M-x delete-rectangle` you can delete a single column of data. |
If you have data in columns in a text file with `M-x delete-rectangle` or `M-x kill-rectangle` you can delete a single column of data. Similarly, `M-x yank-rectangle` will past in a column of text.
For example, take the following text:
1. alligator alphorn
2. baboon bugle
3. crocodile c... |
If you have data in columns in a text file with `M-x delete-rectangle` or `M-x kill-rectangle` you can delete a single column of data. Similarly, `M-x yank-rectangle` will paste in a column of text.
For example, take the following text:
1. alligator alphorn
2. baboon bugle
3. crocodile ... |
The short answer is: you can't do it.
From T-SQL there is no way to access multiple results of a nested stored procedure call, without changing the stored procedure as others have suggested.
The be complete, if the procedure was returning a single result, you could insert it into a temp table or table variable wi... |
An other very good documentation tool is [sphinx][1]. It will be used for the upcoming python 2.6 [documentation][2] and is used by [django][3] and a lot of other python projects.
From the sphinx website:
* **Output formats**: HTML (including Windows HTML Help) and LaTeX, for printable PDF versions
* **Extensi... |
|.net|windows|process-management| |
I am developing console application in .Net and I want to change a behavior a little based on information that application was started from cmd.exe or from explorer.exe. Is it possible? |
Is it possible to determine which process starts my .Net application? |
As it's easy to measure it yourself, why don't do that? (Using `gcc` and `time` from cygwin)
/* test1.c */
int main()
{
int result = 0;
int times = 1000000000;
while (--times)
result = result * 3;
return result;
}
machine:~$ gcc -O2 test1.c -... |
I have had success using [Visual Build Pro][1].
[1]: http://www.kinook.com/VisBuildPro/ |
Adding a link in the IDE would only help during development. I think lomaxx has the right idea: System.Configuration.ConfigurationManager.OpenExeConfiguration. |
There are many tools that specifically handle this:
* [Cruise Control](http://cruisecontrol.sourceforge.net/)
* [Hudson](https://hudson.dev.java.net/)
* [Continuum](http://continuum.apache.org/)
The tools have out of the box support for the most common build types. They all also support some sort of "run this ... |
So you are asking how to handle working on multiple "tasks" at once, right? Except branching.
You can have multiple checkouts of the source on the local machine, suffixing the directory name with the name of the ticket you are working on. Just make sure to make changes in the right directory, depending on the task..... |
Once you, have 2 separate objects in memory and you have references to both of them the only way to merge them is to change all references to point to one of the objects, which might be impossible. However there's something you can do not to arrive in this situation you can use a **SD.LLBLGen.Pro.ORMSupportClasses.Cont... |
Why don't you try [The Grinder 3][1] to load test your server, it comes with all this and more prebuilt, and it supports python as a scripting language
[1]: http://grinder.sourceforge.net |
This was discussed on the subversion users mailing list a while ago. [This][1] post in particular has some useful ideas.
[1]: http://svn.haxx.se/users/archive-2008-07/0779.shtml |
|c#|xna|camera| |
I haven't programmed games for about 10 years (My last experience was DJGPP + Allegro), but I thought I'd check out XNA over the weekend to see how it was shaping up.
I am fairly impressed, however as I continue to piece together a game engine, I have a (probably) basic question.
How much should you rely on C#'s ... |
- [xmldiff][1] from Logilab
- [diffxml][2]
- A commercial one include in [XMLSpy][3]
[1]: http://www.logilab.org/859
[2]: http://diffxml.sourceforge.net/
[3]: http://www.altova.com/products/xmlspy/xml_differencing.html |
print date('Y');
For more information, check date() function documentation: http://www.php.net/date |
You can do this via ToolTips - check out [CToolTipCtrl][1].
If you want flicker free tracking ToolTips then you will need to derive your own classes from CToolTipCtrl that use the [trackActivate][2] messages.
[1]: http://msdn.microsoft.com/en-us/library/6b4cb3a5(VS.80).aspx
[2]: http://msdn.microsoft.com/e... |
How do I use PHP to get the current year? |
|php4|php5| |
I want to put a copyright notice in the footer of a web site, but I think it's incredibly tacky for the year to be out-of-date. How would I make the year update automatically with PHP4 and PHP5? |
|php| |
Can I write a plug in for Microsoft SQL Enterprise Manager which changes the query window background |
|sql-server| |
... if the query window points to a production database? |
It throws an error because _nextId is ReadOnly. Remove that.
**Edit:**
As you say, ReadOnly variables can be changed in a constructor, but not if they are Shared. Those can only be changed in shared constructors. Example:
Shared Sub New()
_nextId = 0
End Sub
|
If using C# and .NET 3.5, with the addition of MS SQL Server then LINQ to SQL is definitely the way to go. If you are using anything other than that combination, I'd recommend an ORM route, such as [nHibernate](http://sourceforge.net/projects/nhibernate) or [Subsonic](http://subsonicproject.com/). |
Where should crossplatform apps keep its data? |
|crossplatform|xp|vista|linux| |
I'm building an application that is targeting Windows, Mac and Linux soon. I was wondering where should I keep application data such as settings, etc.
Application's installation folder is the easiest choice, but I think that might be a problem with new Vista security model. Besides, users might want different settin... |
Where should cross-platform apps keep their data? |
|cross-platform| |
|cross-platform| |
There is a documented API for getting info on file positions on disk since Windows 2000. Look for DeviceIoControl function with FSCTL_GET_RETRIEVAL_POINTERS control code on MSDN:
<a href="http://msdn.microsoft.com/en-us/library/aa364572(VS.85).aspx">http://msdn.microsoft.com/en-us/library/aa364572(VS.85).aspx</a>
... |
Using an external "windows"-keyboard under Mac OS X |
|macos|keyboard|ergonomics| |
I use a MacBook, but I've got a usual keyboard attached to it.
The problem is that the keys don't exactly map 1-to-1. One thing is the APPLE and ALT keys. They map to WIN and ALT, but they are usually physically inverted, so if you want to use them with the same layout you have to invert them in the OS.
The Functio... |
I use a MacBook, but I've got a usual keyboard attached to it.
The problem is that the keys don't exactly map 1-to-1. One thing is the APPLE and ALT keys. They map to WIN and ALT, but they are usually physically inverted, so if you want to use them with the same layout you have to invert them in the OS.
The Functio... |
This means that the OO software should be built upon, but not changed intrinsically. This is good because it ensures reliable, predictable performance from the base classes. |
I think the proper way is to check the Request.IsSecureConnection property and redirect or throw if it's false
|
Try using the System.Web.HttpContext.Current.Request.IsSecureConnection to validate whether they are connecting securely, and then perform whatever denies you would like after that (returning an error message, or whatever your business need is). |
or setProjection(Projections.id())
|
I'm not a security expert but I have a feeling that if plain text were more secure, hashing wouldnt exist in the first place. |
If you must do it programmatically, a way I've done it in the past is to inspect the url and look for "https" in it. Redirect if you don't see that. Request.IsSecureConnection should be the correct way, however. You may have to add additional logic to handle a loopback address. |
If you must do it programmatically, a way I've done it in the past is to inspect the url and look for "https" in it. Redirect if you don't see that. Request.IsSecureConnection should be the preferred method, however. You may have to add additional logic to handle a loopback address. |
It's the answer to the fragile base class problem, which says that seemingly innocent modifications to base classes may have unintended consequences to inheritors that depended on the previous behavior. So you have to be careful to encapsulate what you don't want relied upon so that the derived classes will obey the c... |
There is absolutely no excuse to keeping plain text passwords on the web app. Use a standard hashing algorithm (SHA-1 or MD5) with a salt value, so that rainbow attacks are impossible. |
You could use output variables for passing back messages, but that relies on the proc executing without errors.
create procedure usp_LoggableProc
@log varchar(max) OUTPUT
as
-- T-SQL statement here ...
select @log = @log + 'X is foo'
And then in your ADO code some... |
You could use output variables for passing back messages, but that relies on the proc executing without errors.
create procedure usp_LoggableProc
@log varchar(max) OUTPUT
as
-- T-SQL statement here ...
select @log = @log + 'X is foo'
And then in your ADO code some... |
CC.NET is very powerful. Used it and was really happy about it. Even the status icon in the systray. It's a small detail, but it gives you a good overview of the project's "health". You immediately feel motivated to fix the tests when you see it red.
Now we use a self-baked series of scripts. Since we write Python, ... |
Is WindowsFormsHost fit for purpose (.net WPF hosting WinForms)? |
|.net|winforms|wpf| |
A GUI driven application needs to host some prebuilt WinForms based components.
These components provide high performance interactive views using a mixture of GDI+ and DirectX.
The views handle control input and display custom graphical renderings.
The components are tested in a WinForms harness by the supplier.
... |
It doesn't matter. Modern processors can execute an integer MUL instruction in one clock cycle or less, unlike older processers which needed to perform a series of shifts and adds internally in order to perform the MUL, thereby using multiple cycles. I would bet that
MUL EAX,3
executes faster than
MOV ... |
In general I agree with Peter but for creating and deleting of test data I wouldn't use SQL directly. I prefer to use some CRUD API that is used in product to create data as similar to production as possible... |
Hope this helps you.
[http://www.codeproject.com/KB/system/commandlineweb.aspx][1]
[1]: http://www.codeproject.com/KB/system/commandlineweb.aspx |
Has anyone used a third party product like: [Always Up][1]?
Seems to do what I need. It's the capability to keep running through login / logout cycles I need. And the capability to ignore that it's a GUI app and run it anyway.
They must be linking into the exe manually and calling WinMain or something.
[1]: ... |
I hosted WPF controls in WinForms and vice versa without problems. Though, I would test such scenarios extensively 'cause it's hard to predict how complex control will behave. |
Can you do "builds" with PHP scripts or an interpreted language? |
|build-process|continuous-integration|interpreted-language| |
Correct me if I'm wrong, but a "build" is a "compile", and not every language compiles. Continuous Integration involves building components to see if they continue to work beyond unit tests, which I might be oversimplifying. But if your project involves a language that does not compile, how do you perform nightly build... |
Setting java locale settings |
|java|locale| |
When I use the default java locale on my linux machine it comes out with the US locale settings, where do I change this so that it comes out with the correct locale? |
Winform DataGridView font size . . |
|c#|winforms|datagridview| |
How do i change font size on the datagridview? |
You have to do it through Parameters. Add a parameter for each piece of data you would like to display, then set the parameter to Hidden. Then set the default value to "From Query" and set the Dataset and Value field to the appropriate values. |
How about:
NameValueCollection variables = HttpContext.Current.Request.ServerVariables;
string protocol = (variables["SERVER _ PORT _ SECURE"] == "1") ? "https://" : "http://";
string domain = variables["SERVER _ NAME"];
string port = variables["SERVER _ PORT"];
(Remove the spaces around the underscores in the... |
Binary logs are probably the correct way to do incremental backups, but if you don't trust binary file formats for permanent storage here is an ASCII way to do incremental backups.
mysqldump is not a bad format, the main problem is that it outputs stuff a table as one big line. The following trivial sed will split i... |
You can't "forward", in the strict sense. Just call sendRedirect() on the HttpServletResponse object in your Action class's execute() method. and, then 'return null'.
alternately, either call setModule on the ActionForward object (that you are going to return) or set the path to an absolute URI |
I find onEventName() the easiest naming scheme for event callbacks, but how to indicate which events an object can broadcast I've not found any solution. An extended UML class diagram that would allow for customized containers (besides the attribute and method contrainers) could be an alternative, if some tool would su... |
While in general I would stay away from non-semantic tags like `b` and `i`, `strong` and `em` are not direct replacements for `b` and `i`.
I would use `b` or `i` when it's only presentation you're going for, and what you're marking up has no semantic meaning. For example, a logo like stackoverflow could be marked up... |
While in general I would stay away from non-semantic tags like `b` and `i`, `strong` and `em` are not direct replacements for `b` and `i`.
I would use `b` or `i` when it's only presentation you're going for, and what you're marking up has no semantic meaning. For example, a logo like stackoverflow could be marked up... |
<xsl:template match="*[.//z]">
<xsl:copy-of select="@*"/>
<xsl:attribute name="class">
<xsl:value-of select="'Burb'"/>
</xsl:attribute>
</xsl:template>
Will add the attribute only to elements with a descendent element of 'z'. |
Does the parent need to stay at a fixed height?
<div style="position : relative; width : 200px; background-color : #e0e0ff; overflow : hidden;">
<div style="float: left; clear: left; background-color: #80ff80;">
header
</div>
<div style="float: left; clear: left; background-color: #8080ff; o... |
How to detect true Windows version |
|windows|winapi| |
I know I can call the GetVersionEx Win32 API function to retrieve Windows version. In most cases returned value reflects the version of my Windows, but sometimes that is not so.
If a user runs my application under the compatibility layer, then GetVersionEx won't be reporting the real version but the version enforced... |
@[Sébastien Rocca-Serra][1]
Now we're getting somewhere concrete. The sort of join you're trying to do isn't really possible through the Criteria API, but a sub-query should accomplish the same thing. First you create a `DetachedCriteria` for the bonus table, then use the `IN` operator for `someValue`.
Detach... |
@[Sébastien Rocca-Serra][1]
Now we're getting somewhere concrete. The sort of join you're trying to do isn't really possible through the Criteria API, but a sub-query should accomplish the same thing. First you create a `DetachedCriteria` for the bonus table, then use the `IN` operator for `someValue`.
Detach... |
The principle means that it should easy to add new functionality without having to change existing, stable, and tested functionality, saving both time and money.
Often, polymorhism, for instance using interfaces, is a good tool for achieving this. |
I don't understand how your other developer things 'more passwords could match the hash'.
There is argument to a 'hash attack would be faster', but only if you're not salting the passwords as they're hashed. Normally, hashing functions allow you to provide a salt which makes the use of known hash table a waste of ti... |
Your best bet is to install a signal handler for whatever signal is crashing your program (SIGSEGV, etc.).
Then, in the signal handler, inspect /proc/self/fd, and save the contents to a file. Here is a sample of what you might see:
Anderson cxc # ls -l /proc/8247/fd
total 0
lrwx------ 1 root root ... |
In theory, yes. Passwords can be longer (more information) than a hash, so there is a possibility of hash collisions. However, most attacks are dictionary-based, and the probability of collisions is infinitely smaller than a successful direct match. |
> more passwords could match the hash and a dictionary/hash attack would be faster.
Yes and no. Use a modern hashing algorithm, like an SHA variant, and that argument gets very, very week. Do you really need to be worried if that brute force attack is going to take only 352 years instead of 467 years? (Anecdotal ... |
Many profilers (for example oprofile - but thats linux only) let you set the frequency that they collect data. See if your profiler supports this, and if not try a different one that does. |
From [Wikipedia][1]
> Some computer systems store user
> passwords, against which to compare
> user log on attempts, as cleartext. If
> an attacker gains access to such an
> internal password store, all passwords
> and so all user accounts will be
> compromised. If some users employ the
> same password for ac... |
The term here is **translation unit** and you really want to (if possible) have one class per translation unit ie, one class implementation per .cpp file, with a corresponding .h file of the same name.
It's usually more efficient (from a compile/link) standpoint to do things this way, especially if you're doing thin... |
In addition to simply being "clearer", separating classes into separate files makes it easier for multiple developers not to step on each others toes. There will be less merging when it comes time to commit changes to your version control tool. |
How about writing a cursor to loop through the contents, attempting the cast for each entry?
When an error occurs, output the primary key or other identifying details for the problem record.
I can't think of a set-based way to do this. |
How about writing a cursor to loop through the contents, attempting the cast for each entry?
When an error occurs, output the primary key or other identifying details for the problem record.
I can't think of a set-based way to do this.
**Edit** - ah yes, I forgot about ISDATE(). Definitely a better approach th... |
The seminal resource for this are chapters 28-30 of [SQL for Smarties][1].
(I've recommended this book so much I figure Celko owes me royalties by now!)
[1]: http://www.amazon.com/Joe-Celkos-SQL-Smarties-Programming/dp/1558605762 |
You can also check out the section on dates on [ruby-doc.org][1]. I'm still learning Ruby but it sounds like you could use either the [Civil or Commerical Date][2] to go back before 1970.
[1]: http://ruby-doc.org/stdlib/libdoc/date/rdoc/index.html
[2]: http://ruby-doc.org/stdlib/libdoc/date/rdoc/index.html |
In ASP.NET what are the differant ways to inline code in the .aspx? |