instruction stringlengths 0 30k ⌀ |
|---|
How do you make vim unhighlight what you searched for? |
|vim|highlighting|search| |
I search for "nurple" in a file. I found it, great. But now, every occurrence of "nurple" is rendered in sick black on yellow. Forever.
Forever, that is, until I search for something I know won't be found, such as "asdhfalsdflajdflakjdf" simply so it clears the previous search highlighting.
Can't I just hit a ... |
Yes, it would move errors which are currently found at compile time to being found at runtime. While this is not considered to be a huge drawback by some, those people are using Python, Ruby or Perl and not Java ;-). |
i see your binding on the TextBox is set to a path of 'Text' - is that a field on whatever the datacontext of this textbox is? is the textbox actually getting a value put into it? also, if you put a breakpoint in your validation method, is that ever getting fired?
you may want to lookup how to log failures in bindin... |
I currently use MondoMouse and even with its quirks I couldn't use my mac without it. They have a free trial and I would recommend it to everyone.
[MondoMouse][1]
[1]: http://www.atomicbird.com/mondomouse |
ASP.NET MVC is still in "Preview" form, and as such I wouldn't consider it until it matures. You can roll-your-own MVP pattern pretty easily without much plumbing.
On the Ajax front, I'd say try to find libraries (commercial or otherwise) that do what you're looking for. The basics (Grids, trees, autocomplete te... |
just use this:
mkdir -p $(OBJDIR)
|
Using the standard JDK, you will want to use java.text.SimpleDateFormat
Date myDate = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd:HH-mm-ss");
String myDateString = sdf.format(myDate);
However, if you have the option to use the Apache Commons Lang package, you can use org.apac... |
I would recommend using Ant (cross platform) for the "scripting" side (since it can practically talk to any db out there via jdbc) and Subversion for the source repository.
Ant will alow you to "back up" your db to local files, before making changes.
1. backup existing db schema to file via Ant
2. version control to... |
I agree with Torlack.
Bad initialization or overflows are signs of poor quality code.
Google did it that way because sometimes, there was no way to control the code that was executed in a page (because of faulty plugins, etc.). So if you're using low quality plug ins (it happens), perhaps the Google solution will... |
py2exe - generate single executable file |
|python|py2exe| |
I thought I heard that [py2exe][1] was able to do this, but I never figured it out. Has anyone successfully done this? Can I see your setup.py file, and what command line options you used?
Basically I'm thinking of it giving me a single executable file that does something like unzips itself to maybe /temp and runs... |
|python|packaging|py2exe| |
On linux, at least, you could use lseek64 instead of fseek. |
We use Nant for our project. Nant is a dot net port of ant for java. It has tasks to checkout from VSS, compile and deploy.
<ul>
<li><a href="http://nant.sf.net">Nant</a></li>
<li><a href="http://nantcontrib.sourceforge.net/release/latest/help/tasks/vsscheckout.html">VSS checkout task</a></li>
<li><a href="http:... |
Eh, figured out one way to do it:
ExecTaskControl foo = (ExecTaskControl)LoadControl("tasks\\ExecTaskControl.ascx");
It seems silly to have a file depedancy like that, but maybe thats how UserControls must be done.
|
[@John][1]: The value of arrayList[5] comes out to be 'undefined'.
Yes, there should never be a dangling comma in declarations. Actually, I was just going through someone else's long long javascript code which somehow was not working correctly in different browers. Turned out that the dangling comma was the culprit ... |
Depends on what you want to do, and how you use it. If you just want to execute a command remotely and safely on another machine, just use
ssh user@host command
for example
ssh user@host ls
In order to do this safely you need to either ask the user for the password during runtime, or set up keys on ... |
From the [Open Web Application Security Project][1]:
1. The [OWASP Top Ten][2] vulnerabilities (pdf)
1. For a more painfully exhaustive list: [Category:Vulnerability][3]
The top ten are:
1. Cross-site scripting (XSS)
1. Injection flaws (SQL injection, script injection)
1. Malicious file execution
1. Insecu... |
Use NameValueDeserializer from <http://www.codeplex.com/MVCContrib> instead of UpdateFrom. |
What is the difference between a group and match in .NET's RegEx? |
|.net|regex| |
What is the difference between a group and match in .NET's RegEx? |
You need to put your SSH public key into the ~/.ssh/authorized_keys file on the remote host. Then you'll be able to SSH to that host password-less.
Alternatively you can use ssh-agent. I would recommend against storing the password in the script. |
throw new ISaidDoNotUseException(); |
This is actually not that hard to do in PostgreSQL because it has the "DISTINCT ON" clause in its SELECT syntax (DISTINCT ON isn't standard SQL).
SELECT DISTINCT ON (codename) codename, content, createtime
FROM metatable
WHERE codeid = 15
ORDER BY createtime DESC, codename;
That will limit the ... |
This is actually not that hard to do in PostgreSQL because it has the <a href="http://www.postgresql.org/docs/8.3/static/sql-select.html#SQL-DISTINCT">"DISTINCT ON"</a> clause in its SELECT syntax (DISTINCT ON isn't standard SQL).
SELECT DISTINCT ON (code) code, content, createtime
FROM metatable
WHERE... |
Can you perform a checksum on your original file, and the uploaded file and see if there is any immediate differences?
If there are then you can look at performing a diff, to determine the exact part(s) of the file that are missing changed.
Things that pop to mind is beginning or end of stream, or endianness. |
DSL is basically creating your own small sublanguage to solve a specific domain problem. This is solved using method chaining. Languages where dots and parentheses are optional help make these expression seem more natural. It can also be similar to a builder pattern.
DSL aren't languages themselves, but rather a patte... |
DSL is basically creating your own small sublanguage to solve a specific domain problem. This is solved using method chaining. Languages where dots and parentheses are optional help make these expression seem more natural. It can also be similar to a builder pattern.
DSL aren't languages themselves, but rather a patte... |
As Nick suggested, you will indeed be able to render your user controls, but obviously the page-cycle, pagestate and postback from traditional ASP Webforms won't work anymore, thus making your controls most likely useless.
I think you'll have to rewrite most of your complex controls to port your website to MVC, whil... |
I think the best way to make CheckBox looks really different is not to use checkbox control at all. Better use your own images for checked/unchecked state on-top of hyperlink or image element. Cheers. |
Zero deadlocks is basically an incredibly costly problem in the general case because you must know all the tables/obj that you're going to read and modify for every running transaction (this includes SELECTs). The general philosophy is called **ordered strict two-phase locking** (not to be confused with two-phase commi... |
Zero deadlocks is basically an incredibly costly problem in the general case because you must know all the tables/obj that you're going to read and modify for every running transaction (this includes SELECTs). The general philosophy is called **ordered strict two-phase locking** (not to be confused with two-phase commi... |
Conflicting desires in Database Design, with fields of two similar functions |
|database-design|database|database-relations|normalizing| |
Okay, so I'm making a table right now for "Box Items".
Now, a Box Item, depending on what it's being used for/the status of the item, may end up being related to a "Shipping" box or a "Returns" box.
A Box Item may be defective:if it is, a flag will be set in the Box Item's row (IsDefective), and the Box Item will... |
|database|database-design|normalizing|database-relations| |
Okay, so I'm making a table right now for "Box Items".
Now, a Box Item, depending on what it's being used for/the status of the item, may end up being related to a "Shipping" box or a "Returns" box.
A Box Item may be defective:if it is, a flag will be set in the Box Item's row (IsDefective), and the Box Item will... |
See [Kill All Active Connections To A Database][1]
[1]: http://wiki.lessthandot.com/index.php/Kill_All_Active_Connections_To_A_Database |
Script to accomplish this, replace 'DB_NAME' with the database to kill all connections to:
USE master
GO
SET NOCOUNT ON
DECLARE @DBName varchar(50)
DECLARE @spidstr varchar(8000)
DECLARE @ConnKilled smallint
SET @ConnKilled=0
SET @spidstr = ''
Set @DBName = '... |
@Michal
For whatever reason, your example only works when the where @recnum uses a less than operator. I think when the where filters out a row, the rownum doesn't get incremented, and it can't match anything else.
If the original table has an auto incremented id column, and rows were inserted in chronological o... |
@Michal
For whatever reason, your example only works when the where @recnum uses a less than operator. I think when the where filters out a row, the rownum doesn't get incremented, and it can't match anything else.
If the original table has an auto incremented id column, and rows were inserted in chronological o... |
[@Michal](http://stackoverflow.com/questions/3682/sql-distribution-of-table-in-time#3691)
For whatever reason, your example only works when the where @recnum uses a less than operator. I think when the where filters out a row, the rownum doesn't get incremented, and it can't match anything else.
If the original ... |
Using SQL Management Studio Express:
In the Object Explorer tree drill down under Management to "Activity Monitor". Opening the Activity Monitor, you can view all process info. You should be able to find the locks for the database you're interested in and kill those locks, which will also kill the connection.
You... |
Try this:
ALTER DATABASE [DATABASE_NAME]
SET SINGLE_USER
WITH ROLLBACK IMMEDIATE |
What are the most important functional differences between C# and VB.NET? |
don't forget the 29th February...
SELECT c.name
FROM cust c
WHERE (
MONTH(c.birthdate) = MONTH(@suppliedDate)
AND DAY(c.birthdate) = DAY(@suppliedDate)
) OR (
MONTH(c.birthdate) = 2 AND DAY(c.birthdate) = 29
AND MONTH(@suppliedDate) = 3 AND DAY(@suppliedDate) = ... |
don't forget the 29th February...
SELECT c.name
FROM cust c
WHERE (
MONTH(c.birthdate) = MONTH(@suppliedDate)
AND DAY(c.birthdate) = DAY(@suppliedDate)
) OR (
MONTH(c.birthdate) = 2 AND DAY(c.birthdate) = 29
AND MONTH(@suppliedDate) = 3 AND DAY(@suppliedDate) = ... |
(stolen from the glibc manual)
`int fgetpos64 (FILE *stream, fpos64_t *position)`
This function is similar to fgetpos but the file position is returned in a variable of type `fpos64_t` to which position points.
If the sources are compiled with `_FILE_OFFSET_BITS == 64` on a 32 bits machine this function is ava... |
If you really, really need to do this, then the closest option would be
Refactor --> Extract interface. |
There is also the object literal approach to the prototype:
var Vector = function(){};
Vector.prototype = {
init:function(x,y,z) {
this.x = x;
this.y = y;
this.z = z;
},
length:function() {
return Math.sqrt(x * x + ...);
}
};
var v1 =... |
I think you should put more research into whether you want the resulting application to be SWT or Swing-based. Which IDE to use should be the least important factor.
I'm personally an Eclipse user, but I heard very good things about Matisse, so I would probably consider it if I had to build a Swing UI. BTW, if you b... |
There is a setting in the web.config that controls the max number of items that can be returned by a query:
<setting name="Query.MaxItems" value="100" />
By default, it's set to 100 so I'm not quite sure why your query is only returning 50, perhaps someone else changed the setting?
Also, be wary of a perfo... |
To all you people saying "USE THE IDE~!~~", you're missing the point. Code isn't always read in the IDE. Maybe he wants it to be printed out? Or emailed? That's the problem with not implementing language features because you can get the IDE to do it: Code isn't always read (or even written) in an IDE.
That said, you... |
I am currently leading the effort to evaluate TFS at my company against the Rational Suite which is what we currently use. So far TFS 2008 is pwning clearcase + clearquest. The dev environment integration is where it really shines. |
As Nick suggested, you will indeed be able to render your user controls, but obviously the page-cycle, pagestate and postback from traditional ASP Webforms won't work anymore, thus making your controls most likely useless.
I think you'll have to rewrite most of your complex controls to port your website to MVC, whil... |
With a tuple it will always be a hassle to add or change fields. You're right that a dictionary will be much better.
If you want something with slightly friendlier syntax you might want to take a look at the answers [this question][1] about a simple 'struct-like' object. That way you can pass around an object, say ... |
With a tuple it will always be a hassle to add or change fields. You're right that a dictionary will be much better.
If you want something with slightly friendlier syntax you might want to take a look at the answers [this question][1] about a simple 'struct-like' object. That way you can pass around an object, say ... |
I can't really speak technically about MVC vs "traditional" as I have only used the traditional model so far. From what I have read though, I don't think one is vastly superior to the other. I think once you "get it", you can be very productive in both.
Practically though, I would take into consideration that most... |
I agree with Nick: MVC is much closer to the *real* web paradigm and by using it you'll be confronted with how your website really works. WebForms astracts most of these things away from you and, coming from a PHP background, I found it really anti-intuitive.
I suggest you directly jump to MVC and skip WebForms. As ... |
Have you considered using the Spring framework for this? That way, your beans don't get any extra cruft, and spring handles the configuration setup for you. |
DSL are basic compilers for custom languages. A good 'free and open' tool to develop them is available at [ANTLR][1]. Recently, I've been looking at this DSL for a [state machine language][2] use on a new project . I agree with Tim Howland above, that they can be a good way to let someone else customize your applicatio... |
This is actually not that hard to do in PostgreSQL because it has the <a href="http://www.postgresql.org/docs/8.3/static/sql-select.html#SQL-DISTINCT">"DISTINCT ON"</a> clause in its SELECT syntax (DISTINCT ON isn't standard SQL).
SELECT DISTINCT ON (code) code, content, createtime
FROM metatable
WHERE... |
I think the only fool proof way would be to extend the Visual Studio (through VSIP) and subscribe to the correct event (maybe in the EnvDTE.BuildEvents) class, and check your code for usage of the constructor, and cancel the build if you detect it. |
VB6 uses & to concatenate strings rather than +, and you'll want to make sure the file name is encased in quotes in case of spaces. Try it like this:
Shell "p4 open """ & ActiveDocument.FullName & """"
|
The easiest way is using a certificate for the user that runs the script.
A more complex one implies adding to stdin the password when the shell command asks for it. Expect, perl libraries, show to the user the prompt asking the password (if is interactive, at least), there are a lot of choices. |
MapReduce is a method to process vast sums of data in parallel without requiring the developer to write any other code other than the mapper and reduce functions.
The **map** function takes data in and churns out a result. which is held in a barrier. This function can run in parallel with a large number of the same ... |
MapReduce is a method to process vast sums of data in parallel without requiring the developer to write any other code other than the mapper and reduce functions.
The **map** function takes data in and churns out a result. which is held in a barrier. This function can run in parallel with a large number of the same ... |
How are you generating tests from specifications? |
|testing|automated-tests|specifications|faults| |
I came across a printed article by Bertrand Meyer where he states that tests can be generated from specifications. My development team does nothing like this, but it sounds like a good technique to consider. How are you generating tests from specifications? How would you describe the success your having in discovering ... |
|c#|vb.net|comparison| |
Certainly there's the difference in general syntax, but what other critical distinctions exist? There are *some* differences, right? |
I've always used:
<pre><code>
ALTER DATABASE DB_NAME SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
SP_RENAMEDB 'DB_NAME','DB_NAME_NEW'
Go
ALTER DATABASE DB_NAME_NEW SET MULTI_USER -- set back to multi user
GO
</code></pre>
|
Any large program that is well written will use design patterns, even if they aren't named or recognized as such. That's what design patterns are, designs that repeatedly and *naturally* occur. If you're interfacing with an ugly API, you'll likely find yourself implementing a `Facade` to clean it up. If you've got m... |
Any large program that is well written will use design patterns, even if they aren't named or recognized as such. That's what design patterns are, designs that repeatedly and *naturally* occur. If you're interfacing with an ugly API, you'll likely find yourself implementing a `Facade` to clean it up. If you've got m... |
Yes, Factory, Chain of Responsibility, Command, Proxy, Visitor, and Observer, among others, are in use in a codebase I work with daily. As far as MVC goes, this site seems to use it quite well, and the devs could say enough good things in the [latest podcast][1].
[1]: http://itc.conversationsnetwork.org/shows/d... |
Yes, Factory, Chain of Responsibility, Command, Proxy, Visitor, and Observer, among others, are in use in a codebase I work with daily. As far as MVC goes, this site seems to use it quite well, and the devs couldn't say enough good things in the [latest podcast][1].
[1]: http://itc.conversationsnetwork.org/show... |
This topic has had a lot of face time since .Net 2.0 was released. See this [Wikipedia][1] article for a readable summary.
[1]: http://en.wikipedia.org/wiki/Comparison_of_C_sharp_and_Visual_Basic_.NET |
I found the information based on Kevin Kenny's answer, but I figured I'd post it here for others.
A WSDL document defines services as collections of network endpoints, or ports. In WSDL, the abstract definition of endpoints and messages is separated from their concrete network deployment or data format bindings. Thi... |
Simple. When I use it, it's a modern dynamic language, when you use it, it's just a scripting language!
|
Simple. When I use it, it's a modern dynamic language, when you use it, it's merely a scripting language!
|
Graphical DIFF programs for linux |
|linux|diff|suse|graphical| |
I really like Araxis Merge for a graphical DIFF program for the PC. I have no idea
what's available for linux, though. We're running SUSE linix on our z800 mainframe.
I'd be most grateful if I could get a few pointers to what programs everyone else likes.
Thanks, Scott |
http://www.microsoft.com/technet/archive/itsolutions/intranet/plan/webvss.mspx
yes you can deploy via ftp or network share using the "web deploy" feature in the VSS explorer. |
[Managing Web Content Using MS Visual SourceSafe][1]
yes you can deploy via ftp or network share using the "web deploy" feature in the VSS explorer.
[1]: http://www.microsoft.com/technet/archive/itsolutions/intranet/plan/webvss.mspx |
If you have enough design control over your app, restrict your updates / inserts to specific stored procedures and remove update / insert privileges from the database roles used by the app (only explicitly allow updates through those stored procedures).
Isolate your database connections to a specific class in your a... |
I know of two graphical diff programs: [Meld](http://meld.sourceforge.net/) and [KDiff3](http://kdiff3.sourceforge.net/). I haven't used KDiff3, but Meld works well for me.
It seems that both are in the standard package repositories for openSUSE 11.0 |
This code works for me in Linux:
int64_t bigFileSize(const char *path)
{
struct stat64 S;
if(-1 == stat64(path, &S))
{
printf("Error!\r\n");
return -1;
}
return S.st_size;
}
|
[Meld](http://meld.sourceforge.net/) and [KDiff](http://kdiff3.sourceforge.net/) are two of the most popular. |
There isn't a binary conversion specifier in glibc normally.
It is possible to add custom conversion types to the printf() family of functions in glibc. See <A HREF="http://www.gnu.org/software/libc/manual/html_node/Customizing-Printf.html"> register_printf_function</A> for details. You could add a custom %b convers... |
You're looking for a "Setup Project" which should be under the "Other Project Types" -> "Setup and Deployment" category in the "New Project" dialog. |
The manual explains how to checkout code:
[http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-checkout.html][1]
[1]: http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-checkout.html |
Create a folder where you want to keep the code, and right click on it. Choose SVN Checkout... and type http://wittytwitter.googlecode.com/svn/trunk into the URL of repository field.
You can also run
svn checkout http://wittytwitter.googlecode.com/svn/trunk
from the command line in the folder you want to ... |
If you're on Intel hardware, here's how to read the CPU real-time instruction counter. It will tell you the number of CPU cycles executed since the processor was booted. This is probably the finest-grained counter you can get for performance measurement.
Note that this is the number of CPU cycles. On linux you ca... |
**High Resolution, Low Overhead Timing for Intel Processors**
If you're on Intel hardware, here's how to read the CPU real-time instruction counter. It will tell you the number of CPU cycles executed since the processor was booted. This is probably the finest-grained counter you can get for performance measurement... |