instruction stringlengths 0 30k ⌀ |
|---|
If you do run a Linux server from home, install [ossec][1] on it for a nice lightweight IDS that works really well.
[EDIT]
As a side note, make sure that you do not run afoul of your ISP's Acceptable Use Policy *and* that they allow incoming connections on standard ports. The ISP I used to work for had it written... |
ISTR there's a debugger plug-in for Reflector.
Not used it myself, though I have used TestDriven.net to debug a 3rd-party assembly with the aid of Reflector:
http://weblogs.asp.net/nunitaddin/archive/2006/11/05/Debug-With-Reflector.aspx |
At first I thought you could use regular expressions, but as I've been reading the [MYSQL docs][1] it seems you can't. If I were you I would use another language (such as PHP) to generate a list of columns you want to get, store it as a string and then use that to generate the SQL.
[1]: http://dev.mysql.com/doc... |
It's important to follow security best practices wherever possible, but you don't want to make things unduly difficult for yourself or lose sleep worrying about keeping up with the latest exploits. In my experience, there are two key things that can help keep your personal server secure enough to throw up on the intern... |
The last parameter to Builder.node is "Array, List of other nodes to be appended as children" according to the [Wiki][1]. So when you pass it a string it is treated like text.
You could use:
var a = Builder.node('div').update("<a href='#'>foo</a>")
Where the link is text or:
var a = Builder.node('div'... |
The last parameter to Builder.node is "Array, List of other nodes to be appended as children" according to the [Wiki][1]. So when you pass it a string it is treated like text.
You could use:
var a = Builder.node('div').update("<a href='#'>foo</a>")
Where the link is text or:
var a = Builder.node('div'... |
I'd script it in a Stored Procedure, using Inserts to do the hard work. Your code will take the PKs from Table A (presumably via @@Scope_Identity) - I assume that the PK for Table A is an Identity field?
You could use temporary tables, cursors or you might prefer to use the CLR - it might lend itself to this kind of... |
Merge is not intrinsically better in DVCS, it is just that they would be practically very difficult to use if the branch/merge did not work correctly (svn arguably does not implement branching/merging correctly), because instead of making a checkout, you are making a new branch everytime you start working on a project ... |
MS Sql Server Express doesn't come with SSIS which is what you will need to import/export objects out of your database.
You can also manually script this process. One way is to use BCP (http://msdn.microsoft.com/en-us/library/ms162802.aspx) |
You can check the paths of the commited files to determine which project they belongs to. Just remember that a commit can modify several files at once, and each file could theoretically belong to a different project. |
I've been using jEdit since 2003ish. I use it on my Ubuntu 8.04 box at home, however it does have a few bugs: sometimes when you click on a button which opens a dialog, such as "Open File", the dialog will be completely blank.
This could be a Java thing, but it seems a strange issue.
Other than that, I'm quite ha... |
[JSON][1] is fairly compact, and supported by most frameworks. You can transfer data over HTTP using standard [REST][2] techniques.
There are JSON libraries for [Java][3], [Objective C][4], and [many other languages][5] (scroll down). You should have no problem finding framework support on the server side, because J... |
If you are willing to go the IPC route, make the normal communication between client and server bi-directional to let the server ask the clients to shut down. Or, failing that, have the clients poll. Or as the last resort, the clients should be instructed to exit when the make a request to server. You can let the libra... |
You could delay the procedure, but that might or might not help you. It depends on how the procedure works. Is it in a transaction, why a cursor (horribly inefficient in SQL Server), where is the slowdown, etc. Perhaps reworking the procedure would make more sense. |
Here is the slightly modified code - all credit given to Abe Heidebrecht, who previously posted it - that allows both horizontal and vertical scrolling. The only change is that the return value of MeasureOverride needs to be base.MeasureOverride(new Size(ret.width, h)).
// Original code : Abe Heidebrecht
pu... |
Here is an [article][1] about IL debugging. It says you can't do it and then talks about ways to do it. There is also some info in the comments about doing it also.
[1]: http://blogs.msdn.com/jmstall/archive/2004/10/03/237137.aspx |
Thanks for your answers so far. I've tried every suggestion (except one) to no avail.
The suggestion I haven't tried is to create a new project and add all my stuff to it, the thought of which really tests my will to live. ;) I may try this tomorrow if I can be bothered. Thanks again. |
While I agree with Thomas' answer (+1 ;)), I'd like to add the caveat that I'll assume the column that you *don't* want contains hardly any data. If it contains enormous amounts of text, xml or binary blobs, then take the time to select each column individually. Your performance will suffer otherwise. Cheers! |
I used COM interop to access [DirectShow's Media Detector](http://msdn.microsoft.com/en-us/library/ms785892(VS.85).aspx) functionality.
This does work pretty well, but it's a right pain in the backside. You need to know lots about COM, win32 interop, and so on.
You can also use [DirectShowNet](http://dire... |
There is really nothing very mysterious about VS projects nowadays - it's all text files, etc. SOMETHING must reference that class/dll, and that something must be part of your project.
Have you really grep'd or findstr'd the whole solution tree, *every single file*, for a reference to that exception?
|
For me, I feel like I've done a good job if my code validates. Seeing the green check box on the w3c pages just makes me slightly giddy. As for group b, They usually only care that it looks and works the same across browsers. They only place I've found that this is not true is the government sector. They require comple... |
[PyXML][1] works well. You didn't say what platform you're using, however if you're on Ubuntu you can get it with `sudo apt-get install python-xml`. I'm sure other Linux distros have it as well. In the worst case you may have to build it yourself. This package is no longer maintained but still builds fine and works... |
[PyXML][1] works well.
You didn't say what platform you're using, however if you're on Ubuntu you can get it with `sudo apt-get install python-xml`. I'm sure other Linux distros have it as well.
If you're on a Mac, xpath is already installed but not immediately accessible. You can set `PY_USE_XMLPLUS` in yo... |
SQL: Counting unique votes with a rolling votes-per-hour limit |
|sql|voting| |
Given a table of votes (users vote for a choice, and must supply an email address):
votes
--
id: int
choice: int
timestamp: timestamp
ip: varchar
email: varchar
What's the best way to count "unique" votes (a user being a unique combination of email + ip) given the constraint they... |
If you are currently familiar with VSS, but want something more featureful, you should probably have a look at Vi[sual Studio Team System][1]. It does require a server, but you can get a "Action Pack" from MS that includes all the licencies that you need for "Team Foundation Server Workgroup Edition" from the [Partner ... |
Website Monitoring Libraries |
|monitoring| |
There has been some talk of Website performance monitoring tools and services on stackoverflow, however, they seem fairly expensive for what they actually do. Are there any good opensource libraries for automating checking/monitoring the availability of a website? |
|polls|monitoring| |
Why is \r a newline for vim? |
|vim|behavior| |
From [this question][1]. You have to use \r when replacing text for a newline, like this
:%s/%/\r/g
But when replacing end of lines and newlines for a character, you can do it like:
:%s/\n/%/g
What section of the manual documents these behaviors, and what's the reasoning behind them?
[1]: ... |
If you pass a pointer in as output parameter, you might want to pass it as `Foo**` and set its value as `**ppFoo = pSomeOtherFoo`.
And from the algorithms-and-data-structures department, you can use that double indirection to update pointers, which can be faster than for instance swapping actual objects. |
If you pass a pointer in as output parameter, you might want to pass it as `Foo**` and set its value as `*ppFoo = pSomeOtherFoo`.
And from the algorithms-and-data-structures department, you can use that double indirection to update pointers, which can be faster than for instance swapping actual objects. |
If you insert the following into the 2nd line of your XML it directs Windows to open with Excel
<?mso-application progid="Excel.Sheet"?> |
Try to generate the change script from within Enterprise Manager to see how it is done there |
I prefer to use the following command :
:set fileformat=unix
You can also use `mac` or `dos` to respectively convert your file to macintosh or MS-DOS/MS-Windows file convention. And it does nothing if the file is already in the correct format.
For more information, see the vim help :
:help fileforma... |
My hack is as follows:
I am mainly a Java developer and I use Eclipse/RAD. The support for CVS is great and is very easy to work with.
For the C# work I do I tried to find a CVS plugin for Visual Studio but was unhappy with the one I found. In the end, I decided to use Eclipse to handle the versioning of my C# pr... |
`:set fileformat=unix` to convert from dos to unix. |
Google reader, create a group, add your feeds into the folder and then share that as an RSS feed.
:-)
Works while you're asleep! |
dos2unix is a commandline utility that will do this, or
:%s/^M//g
will if you use ctrl-v ctrl-m to input the ^M. Or you can:
:set ff=unix
and vim will do it for you. Docs on the 'fileformat' setting are <a href="http://www.vim.org/htmldoc/options.html#%27fileformat%27">here</a>
|
dos2unix is a commandline utility that will do this, or
> :%s/^M//g
will if you use ctrl-v ctrl-m to input the ^M. Or you can:
> :set ff=unix
and vim will do it for you. Docs on the 'fileformat' setting are <a href="http://www.vim.org/htmldoc/options.html#%27fileformat%27">here</a>, and the vim wik... |
In an ideal world, you could branch the view and merge back when you are happy with your revisions to avoid breaking the build. However, as you are using StarTeam, I would suggest making small incremental changes to the folder structure and accept that you will probably have a few breakages along the way. It will lik... |
#include <stdio.h>
int main()
{
system("echo HAI");
return 0;
} |
#include <stdlib.h>
int main()
{
system("echo HAI");
return 0;
} |
Here are some links that might be useful:
http://www.codeproject.com/KB/dotnet/cruisecontrol_continuous.aspx
http://devlicio.us/blogs/ziemowit_skowronski/archive/2007/03/10/continuous-integration-1-the-environment-and-the-first-build.aspx
http://code.google.com/p/ci-factory/
Cheers
John |
Before leveraging CruiseControl to it's fullest extent, you need to create an automated build script that can run msbuild or nant. After you get your project building in one step, then you can start integrating CruiseControl into the mix. Here are some resources to help get you started:
- [CruiseControl.net Wiki][... |
Before leveraging CruiseControl to it's fullest extent, you need to create an automated build script that can be run by msbuild or nant. After you get your project building in one step, then you can start integrating CruiseControl into the mix. Here are some resources to help get you started:
- [CruiseControl.net ... |
When to use IList and when to use List |
|c#|.net| |
I know that IList is the interface and List is the concrete type but I still don't know when to use each one. What I'm doing now is if I don't need the Sort or FindAll methods I use the interface. Am I right? Is there a better way to decide when to use the interface or the concrete type? |
LINQ's operators on the Enumerable class are implemented as iterators that are created with the yield statement. It allows you to chain operations like Select() and Where() without actually enumerating anything until you actually use the enumerator in a loop, typically by using the *foreach* statement. Also, since only... |
|java|https|url| |
|java|http|url| |
.Net 2.0: How to subscribe to a event publisher on a remote computer using transient subscriptions? |
|c#|.net|com| |
My problem is that I want to have a server application (on a remote computer) to publish certain events to several client computers. The server and client communicate using .Net-Remoting so currently I am using remoted .Net-Events to get the functionality. But there is one drawback: when the server (the event publisher... |
Well, looks like I answered my own question.
LogParser.exe" -i:IISW3C "SELECT COUNT(cs(User-Agent)) AS Client FROM *.log WHERE STRLEN(cs(User-Agent)) > 100
|
A little templates... :)
void DrawLine(HDC dc, int x0, int y0, int x0, int x1)
{
// anti-aliasing stuff
MoveToEx(dc, x0, y0, NULL);
LineTo(dc, x1, y1);
}
struct DrawBinderX
{
DrawBinderX(int y0, int y1) : y0_(y0), y1_(y1) {}
void operator()(HDC dc, in... |
Writing a file is a better solution IMO - its served by IIS kernel code, w/o the huge asp.net overhead and you can copy the file to CDNs later.
AFAIK dependency cashing is not very efficient with SQL Server 2000 (or 2008). |
Another alternative for converting your program into a binary is the free [PAR-Packer](http://search.cpan.org/dist/PAR-Packer/) tool on [CPAN](http://search.cpan.org). There are even filters for code obfuscation, though as others have said, that's possibly more trouble than it's worth. |
**CTRL+D** quits the shell. |
Variables declared inside the class definition, but not inside a method are class or static variables:
>>> class MyClass:
... i = 3
...
>>> MyClass.i
3
See [what the Python tutorial has to say on the subject of classes and class objects][1].
@[Steve Johnson](#68656) has already a... |
Variables declared inside the class definition, but not inside a method are class or static variables:
>>> class MyClass:
... i = 3
...
>>> MyClass.i
3
See [what the Python tutorial has to say on the subject of classes and class objects][1].
@[Steve Johnson](#68656) has already a... |
Variables declared inside the class definition, but not inside a method are class or static variables:
>>> class MyClass:
... i = 3
...
>>> MyClass.i
3
As @[Daniel](#69067) points out, this creates a class-level "i" variable, but this is distinct from any instance-level "i" variable... |
There are a whole pile of options here: <http://allrss.com/rssremixers.html>. |
The best place to start is the [Accessibility Kit for Sharepoint][1]. With this, you may reach single A standard, but in my experience, you will find it very tough to reach AA.
Microsoft didn't factor in accessibility in Sharepoint, and even 2007 suffers from a huge overdependence on table layout.
Good luck!
... |
VS have a bad integration inside the IDE for CVS/SVN. Those free one doesn't work well. I use Tortoise (outside VS) and it works fine. If you want something inside VS, you might check for not free plugin or to use TFS. |
How are you deploying the implementation? Is it as an Intranet, or, is it as a public facing website.
I think one of the first rules is to be extremely selective with the use of out of the box web parts. Many of the web-parts I looked at weren't compliant even on a basic level.
Andrew
|
For Native (C++) Device Development you will need:
<pre>
eMbedded Visual C++ 3.0 (CE 3.0)
eMbedded Visual C++ 4.0 (CE 4.x-5.0)
or
Visual Studio 2005 Standard or higher (CE 4.x-6.0)
or
Visual Studio 2008 Professional or higher (CE 4.2-)
</pre>
For Managed Device Development you will need:
<pre>
Visual Stu... |
Here's a method for Oracle. This example gets the 9th highest value. Simply replace the 9 with a bind variable containing the position you are looking for.
select created from (
select created from (
select created from user_objects
order by created desc
)
... |
[Yahoo Pipes][1] could be nice. Depends on how much "private" you want the resulting feed to be.
For 100% offline solution investigate [Atomisator][2]. It's a Python framework basically for doing offline what Yahoo Pipes does online.
[1]: http://pipes.yahoo.com/
[2]: http://tarekziade.wordpress.com/2008/08... |
How about <a href="http://www.kryogenix.org/code/browser/sorttable/">sorttable</a>? That would seem to fit your requirements nicely. |
How about <a href="http://www.kryogenix.org/code/browser/sorttable/">sorttable</a>? That would seem to fit your requirements nicely.
It's rather easy to use - load the sorttable Javascript file, then, for each table you want it to make sortable, apply class="sortable" to the <table> tag.
It will immediatel... |
I develop eclipse RCP applications. Normally to start an eclipse application an executable launcher is included. I include the java virtual machine inside the application folder in a /jre sub directory to ensure that the right java version will be used.
Then we package with Inno Setup for installation on the user'... |
To permanently delete monster files from a svn repository, there is no other solution than using svnadmin dump/load. ([SVN Book: dump command][1])
To prevent huge files from being committed, a hook script can be used. You could have, for example, a script that ran "pre-commit" whenever someone tried to commit to the... |
Try this:
<xsl:text><fo:inline font-style="bold">Bold text</fo:inline></xsl:text>
- [XSL-FO Tutoria: Inline Text
Formatting][1]
- [XSL-FO inline Object][2]
[1]: http://www.ecrion.com/Support/Resources/XSL-FOTutorial/Inline.xml.html
[2]: http://www.w3schools.com/xslfo/obj_inline.asp |
Try this:
<fo:inline font-style="bold"><xsl:text>Bold text</xsl:text></fo:inline>
- [XSL-FO Tutoria: Inline Text
Formatting][1]
- [XSL-FO inline Object][2]
[1]: http://www.ecrion.com/Support/Resources/XSL-FOTutorial/Inline.xml.html
[2]: http://www.w3schools.com/xslfo/obj_inline.asp |
I'd go with the "many" approach. It seems more intuitive to me and less prone to error. |
I would use the first option, or overload it in this case, seeing as you have 4 different parameter signatures. However, being specific helps with understanding the code 3 months from now. |
Is there a reason to use BufferedReader over InputStreamReader when reading all characters? |
|java|performance|http|io|buffer| |
I currently use the following function to do a simple HTTP GET.
public static String download(String url) throws java.io.IOException {
java.io.InputStream s = null;
java.io.InputStreamReader r = null;
//java.io.BufferedReader b = null;
StringBuilder content = new StringBuilder... |
Seems it can not be forward-declared in GCC!
Interesting discussion [here][1]
[1]: http://bytes.com/forum/thread62285.html |
Something like
select email, ip, count(choice)
from votes
group by email, ip, datepart(hour, timestamp)
If I understand correctly |
There are a lot of ways to do XSS (See [http://ha.ckers.org/xss.html][1]) and it's very hard to catch.
I personally delegate this to the current framework I'm using (Code Igniter for example). While not perfect, it might catch more than my hand made routines ever do.
[1]: http://ha.ckers.org/xss.html |
I do not like it because it makes debbuging a hassle. You cannot read the value of a variable or the like by just hovering over it with a mouse. |
<http://learn.perl.org/>
From the [Online Library](http://www.perl.org/books/library.html):
* [Beginning Perl](http://www.perl.org/books/beginning-perl/)
* [Impatient Perl](http://www.perl.org/books/impatient-perl/) |
If you want a full Life Cycle in one package then you probably want want to look at Visual Studio Team System. It does require a server, but you can get a "Action Pack" from MS that includes all the licencies that you need for "Team Foundation Server Workgroup Edition" from the Partner centre.
With this you will get... |
This debate happens in Javascipt a lot too.
Basically, that With syntax makes it very hard to tell at a glance which Left/Top/etc property/method you're calling on.You could have a local variable called Left, and a property (it's been a while since I've done delphi, sorry if the name is wrong) called Left, perhaps e... |
If you are concerned about XSS attacks, encoding your output strings to HTML is the solution. If you remember to encode every single output character to HTML format, there is no way to execute a successful XSS attack.
Read more:
[Sanitizing user data: How and where to do it][1]
[1]: http://www.diovo.com/2008... |
Set a UserControl Property to Not Show Up in VS Properties Window |
|c#|asp.net|visual-studio|attributes|properties| |
I have a UserControl in my Asp.net project that has a public property. I do not want this property to show up in the Visual Studio Property Window when a user highlights an instance of the UserControl in the IDE. What attribute (or other method) should I use to prevent it from showing up?
class MyControl : Syste... |
I don't think this is possible in the 2000 version, but might be in later versions.
If I remember right, we ended up making two versions of the report. |
@if os.path.exists(filename):
|
I solved this one by reverting to a previous state when it still worked.
Thanks for the suggestions, I'm sorry they didn't work in my situation.
Shall I delete this question now that it doesn't really have a clear use for someone else? |
This really depends a lot on how your use of the tables. If they are write heavy, then you may want to consider removing indexes, which will speed up the recovery time. If they are read heavy, you may want to consider using replication which will serialise all writes to your tables, minimising the recovery time for y... |