instruction stringlengths 0 30k ⌀ |
|---|
There is no clear answer to your question. It depends entirely how your data is organized.
Something to keep in mind:
Quadtrees work best for data that is mostly two dimensional like map-rendering in navigation systems. In this case it's faster than octrees because it adapts better to the geometry and keeps the n... |
For the text to appear on a single line you would have to use display="inline"
Moreover, you should really use lists to achieve this effect
<ul class="headers">
<li>Title</li>
<li>Subject</li>
<li>Summary</li>
<li>Date</li>
</ul>
The style would look like this:
.headers{... |
The important thing is to get something written down rather than worry about the format.
|
- I find the following folder hierarchy useful. Create code and tests as the subfolders of ProjectFolder. Create 2 solutions code\Project.sln and tests\Tests.sln. Now for every class library or executable created, e.g. Customers.dll have a corresponding test dll. So code\Customers\Customers.csproj will have tests\Cus... |
Suggestion: if you need to use an external DLL to be copied along with your code, add a reference to the DLL, and in its properties pane on Visual Studio make sure that Copy Local is set to True. That might accomplish what you're trying to do. |
You cannot; the runlevels are hardcoded into the utilities. But why do you need to? Runlevel 4 is essentially unused. And while it's not the best idea, you could repurpose either runlevel 3 or runlevel 5 depending on if you always/never use X.
Note that some *nix systems have support for more than 6 runlevels, but L... |
Add it to the project's primary output. |
Yes, just use Windows Python Extension, as stated [here][1].
import win32evtlogutil
win32evtlogutil.ReportEvent(ApplicationName, EventID, EventCategory,
EventType, Inserts, Data, SID)
[1]: http://www.ravenbrook.com/project/p4dti/master/design/win32-eventlog/ "Windows eventlog in python" |
IIS 6.0 Is Stubbornly Remembering Authentication Settings |
|asp.net|http|authentication|iis-6|401| |
I have an .asmx in a folder in my application and I keep getting a 401 trying to access it.
I have double and triple checked the setting including the directory security settings. It allows anonymous. I turned off Windows Authentication.
If I delete the application and the folder its in, then redeploy it under ... |
As with web browser usage statistics, it depends entirely on the audience.
I have access to a bit of data on this subject and it seems that text-only email use is very low (for non-technical audiences, at least). <0.1% up to ~6% depending on demographic.
It's not *that* much effort to do both (especially if you c... |
I'm not sure exactly what you mean by 'lightweight,' but here are a few popular IDEs for linux:
[Ajuta](http://anjuta.sourceforge.net/) for Gtk/Gnome
[KDevelop](http://www.kdevelop.org/) or [Quanta](http://quanta.kdewebdev.org/) for KDE
[CodeBlocks](http://www.codeblocks.org/) runs on Windows/Mac/Linux and is ... |
I'm not sure exactly what you mean by 'lightweight,' but here are a few popular IDEs for linux:
[Anjuta](http://anjuta.sourceforge.net/) for Gtk/Gnome
[KDevelop](http://www.kdevelop.org/) or [Quanta](http://quanta.kdewebdev.org/) for KDE
[CodeBlocks](http://www.codeblocks.org/) runs on Windows/Mac/Linux and is... |
FYI, strcmp() and stricmp() are vulnerable to buffer overflow, since they just process until they hit a null terminator. It's safer to use _strncmp() and [_strnicmp()][1].
[1]: http://msdn.microsoft.com/en-us/library/chd90w8e(VS.80).aspx |
Creating a development environment for SharePoint. |
|sharepoint| |
I haven't touched sharepoint in years. If I want to setup a development environment to get up to speed, what options do I have? I don't have an MSDN license, is there anyway I can get up and running for free? (for development only) |
Apart from syntax not that much any more. They both compile to exactly the same IL, so you can compile something as VB and reflect it into C#.
Most of the apparent differences are syntactic sugar. For instance VB appears to support dynamic types, but really they're just as static as C#'s - the VB compiler figures th... |
The Strategy pattern is maybe one you want to look at. The strategy being the file parsing algorithm.
Then you want a separate strategy for database insertion. |
Is there any kind of non text interface to MySQL? |
|mysql|api| |
I have a MySQL query that returns a result with a single column of integers. Is there any way to get the MySQL C API to transfer this as actually integers rather than as ASCII text? For that matter is there a way to get MySQL to do /any/ of the API stuff as other than ASCII text. I'm thinking this would save a bit of t... |
You could possibly use a LINQ query to do this:
int[] s = { 1, 2, 3, 3, 4};
int[] q = s.Distinct().ToArray();
|
The Initialize function is faulty. It should look more like this:
private static void Initialize()
{
if(s_initialized)
return;
lock(s_lock)
{
if(s_Initialized)
return;
s_Initialized = true;
}
}
Without the ... |
My suggestion would be something like your first one. When the first user (Bob) opens the document, he acquires a lock so that other users can only read the current document. If the user saves the document while he is using it, he keeps the lock. Only when he exits the document, it is unlocked and other people can edit... |
We're looking at Drools/Guvnor, possibly integrated with jBPM (as in this [presentation][1]), to add a workflow engine to our Spring/JEE app, but we're still in the very early phases of trying it out.
[1]: http://www.firstpartners.net/blog/technology/java/2008/06/05/jboss-business-rules-and-jbpm-workflow-presentat... |
What you're asking is whether accessing a field in a method multiple times atomic -- to which the answer is no.
In the example above, the initialise routine is faulty as it may result in multiple initialision. You would need to check the s_Initialized flag inside the lock as well as outside, to prevent a race condi... |
Perhaps [Interlocked][1] gives a clue. And otherwise [this one][2] i pretty good.
I would have guessed that their not atomic.
[1]: http://msdn.microsoft.com/en-us/library/system.threading.interlocked(VS.85).aspx
[2]: http://msdn.microsoft.com/sv-se/magazine/cc188793(en-us).aspx |
There is no clear answer to your question. It depends entirely how your data is organized.
Something to keep in mind:
Quadtrees work best for data that is mostly two dimensional like map-rendering in navigation systems. In this case it's faster than octrees because it adapts better to the geometry and keeps the n... |
How do I undo "svn switch" on a subdirectory? |
|svn| |
Not for the first time, I've accidentally done "svn switch" from somewhere below the root of my project. This switches that subdirectory only, but how do I undo this?
If I try switching the subdirectory back to the original branch I get:
"svn: Directory 'subdir\_svn' containing working copy admin area is miss... |
Not for the first time, I've accidentally done "svn switch" from somewhere below the root of my project. This switches that subdirectory only, but how do I undo this?
If I try switching the subdirectory back to the original branch I get:
"svn: Directory 'subdir\_svn' containing working copy admin area is miss... |
MSDN tells us:
> The #define directive cannot be used
> to declare constant values as is
> typically done in C and C++. Constants
> in C# are best defined as static
> members of a class or struct. If you
> have several such constants, consider
> creating a separate "Constants" class
> to hold them.
You can... |
Using a for loop you can eliminate the need for the messy **idx-1** checking code:
/* Approach #3*/
int i;
int value;
for (i = 0; i < MAX; ++i)
{
printf("Enter elements, -1 to finish:\n");
scanf("%d", &value);
if (value == -1) break;
arr[i] = value;
}
|
What is the relative path for?
Are you talking about a physical directory path or a url path? |
What is the relative path for?
Are you talking about a physical directory path or a url path?
Edit:
I needed to do something similar for one of my projects. I needed to locate a config file that was stored in a certain folder. While the web.config file itself does not provide anything special for this, you ... |
I agree with pointernil. The only issue is that your estimates are incorrect. Which is no big drama, unless you've just blown out a 3 million dollar project of course :-)
If it happens once, its a learning experience. If it happens again and the result is better, then you've got another learning experience under you... |
If there's a legitimate reason to not use a table then you could give each div a width and then float it. i.e.
div.title {
width: 150 px;
float: left;
}
|
There are two methods you can use to access your I/O mapped device from an RTP.
**I/O Subsystem** (preferred)
You essentially create a small device driver. This driver can be integrated into the I/O Subsystem of VxWorks. Once integrated, the driver is available to the RTP by simply using standard I/O operations... |
Getting ssh to execute a command in the background on target machine |
|bash|ssh|background|csh| |
This is a follow-on question to the [How do you use ssh in a shell script?][1] question. If I want to execute a command on the remote machine that runs in the background on that machine, how do I get the ssh command to return? When I try to just include the ampersand (&) at the end of the command it just hangs. ... |
Generating database tables from object definitions |
|database|orm|code-generation| |
I know that there are a few (automatic) ways to create a data access layer to manipulate an existing database (LINQ to SQL, Hibernate, etc...). But I'm getting kind of tired (and I believe that there should be a better way of doing things) of stuff like:
1. Creating/altering tables on Vision
2. Using Visio's "Upd... |
A couple of solutions I can think of:
1. The [SubSonic Project ][1] has a pretty nice implementation of `BindlingList<T>` which is open source. Although this might require using the entire SubSonic binary to use their implementation.
2. I enjoy using the classes from the [Power Collections][2] project. It is fair... |
First, you need to make sure you've set up password-less (public key login). There are at least two flavors of ssh with slightly different configuration file formats. Check the **ssh** manpage on your system or consult you local sysadmin.
To run **ssh** in batch mode (such as within a shell script), you need to pa... |
First, you need to make sure you've set up password-less (public key login). There are at least two flavors of ssh with slightly different configuration file formats. Check the **ssh** manpage on your system, consult you local sysadmin or head over to <http://stackoverflow.com/questions/7260/how-do-i-setup-public-key... |
as Dan said: it depends on the used technology.
For PHP server side browser detection i recommend Harald Hope's Browser detection:
[http://techpatterns.com/downloads/php_browser_detection.php][1]
[1]: http://techpatterns.com/downloads/php_browser_detection.php
Published under GPL. |
Thats nasty, but simple:
Check if the data types for all fields in the O/R-Designer match the data types in your SQL table.
**Double check for nullable!**
One of the fields in your O/R-Designer is nullable while the field in SQL is not (or vice versa). LINQ notices this problem while creating the update query, a... |
Thats nasty, but simple:
Check if the data types for all fields in the O/R-Designer match the data types in your SQL table.
**Double check for nullable!** A column should be either nullable in both the O/R-Designer and SQL, or not nullable in both.
One of the fields in your O/R-Designer is nullable while the fie... |
Thats nasty, but simple:
Check if the data types for all fields in the O/R-Designer match the data types in your SQL table.
**Double check for nullable!** A column should be either nullable in both the O/R-Designer and SQL, or not nullable in both.
For example, a NVARCHAR column "title" is marked as NULLable in ... |
Thats nasty, but simple:
Check if the data types for all fields in the O/R-Designer match the data types in your SQL table.
**Double check for nullable!** A column should be either nullable in both the O/R-Designer and SQL, or not nullable in both.
For example, a NVARCHAR column "title" is marked as NULLable in ... |
How do I access my memory mapped I/O Device (FPGA) from a RTP in VxWorks? |
|vxworks| |
When using VxWorks, we are trying to access a memory mapped I/O device from a Real-Time Process.
Since RTPs have memory protection, how can I access my I/O device from one?
Note: I have the answer, I will be posting it shortly, feel free to answer as yours might be better than mine but please don't be offended by... |
When using VxWorks, we are trying to access a memory mapped I/O device from a Real-Time Process.
Since RTPs have memory protection, how can I access my I/O device from one? |
Use a [Breadth-first search (BFS)][1] as opposed to a [Depth-first search][2]. Find the first node with no children.
Using a depth-first search you might get lucky on some input trees, but using the BFS method is much faster in general.
[1]: http://en.wikipedia.org/wiki/Breadth-first_search
[2]: http://e... |
Use a [Breadth-first search (BFS)][1] as opposed to a [Depth-first search (DFS)][2]. Find the first node with no children.
Using a DFS you might get lucky on some input trees, but using the BFS method is much faster in general.
To find the root to leaf path, you could follow the first found childless node all t... |
Use a [Breadth-first search (BFS)][1] as opposed to a [Depth-first search (DFS)][2]. Find the first node with no children.
Using a DFS you might get lucky on some input trees, but using the BFS method is much faster in general.
To find the root to leaf path, you could follow the first found childless node all t... |
Use a [Breadth-first search (BFS)][1] as opposed to a [Depth-first search (DFS)][2]. Find the first node with no children.
Using a DFS you might get lucky on some input trees, but using the BFS method is much faster in general.
To find the root to leaf path, you could follow the first found childless node all t... |
<pre>
*:noh* *:nohlsearch*
:noh[lsearch] Stop the highlighting for the 'hlsearch' option. It
is automatically turned back on when using a search
command, or setting the 'hlsearch' option.
This command doesn't work in an autocommand, because
the highlighting state is saved and restored when
ex... |
Well there wasn't any language integrated mechanism syntax for it, but you can achieve interfaces in C++ with pure virtual functions.
class IFoo
{
public:
void Bar() =0;
void Bar2() =0;
};
class Concrete : public IFoo
{
public:
void Bar() { ... }
vo... |
Well there wasn't any language integrated mechanism syntax for it, but you can achieve interfaces in C++ with pure virtual classes.
class IFoo
{
public:
void Bar() =0;
void Bar2() =0;
};
class Concrete : public IFoo
{
public:
void Bar() { ... }
void... |
I agree. Especially if you have to continue hitting that letter to get to the next option. |
Interfaces existed in C++ if you did COM programming, which is where the IPrefix convention originates. |
Interfaces existed in C++ if you did COM programming, which is where the IPrefix convention originates.
Although C++ itself didn't natively support interfaces, COM/C++ used type libraries generated from Interface Definition Language which has the only purpose of defining interfaces, and used the **interface** keywo... |
Interfaces existed in C++ if you did COM programming, which is where the IPrefix convention originates.
Although C++ itself didn't natively support interfaces, COM/C++ used type libraries generated from Interface Definition Language which has the only purpose of defining interfaces, and used the **interface** keywo... |
Interfaces existed in C++ if you did COM programming, which is where the IPrefix convention originates.
Although C++ itself didn't natively support interfaces, COM/C++ used type libraries generated from Interface Definition Language which has the only purpose of defining interfaces, and used the **interface** keywo... |
I put my test cases next the the source in a file with the same name but a .phpt extension. The deployment script simply filters out *.phpt when they push to production. |
One other thing you need to check is where your input comes from. You can use the referrer string (most of the time) to check that it's from your own page, but putting in a hidden random number or something in your form and then checking it (with a session set variable maybe) also helps knowing that the input is coming... |
You could always use the pre-build event to run the C preprocessor on the .cs file and the post build event to undo the pre-build step. The preprocessor is just a text-substitution system, so this is possible:
// version header file
#define Version "1.01"
// C# code
#include "version.h"
// ... |
can you access a Delphi DBIV database without it creating lock files? |
|database|delphi| |
I'm trying to read data from a Delphi DBIV database, every time I access the database it creates a Paradox.lck and a Pdoxusrs.lck file. I'm using only a TQuery Object to do this (nothing else). can I access a Delphi DBIV database without it creating these lock files?
Thanks
Stew. |
Since I just posted this in a (now-deleted question) and it's still in my paste buffer, I'll just repost.
Note: this is a server-side PHP solution
I currently use the following code for this. It is not nearly an exhausting solution, but it should be easy to implement more browsers. I didn't know about [user-agents... |
1. I don't see what you're trying to show with your sample.
2. The way I explain it to people is "A structure *holds* stuff. A class *does* something with it". |
Use a [Breadth-first search (BFS)][1] as opposed to a [Depth-first search (DFS)][2]. Find the first node with no children.
Using a DFS you might get lucky on some input trees, but using the BFS method is much faster in general.
To find the root to leaf path, you could follow the first found childless node all t... |
**General description:**
Use a [Breadth-first search (BFS)][1] as opposed to a [Depth-first search (DFS)][2]. Find the first node with no children.
Using a DFS you might get lucky on some input trees (but there is no way to know you got lucky so you still need to search the whole tree), but using the BFS method... |
Whats the best way to pass html embed code via rss feed to a rss parser in php? |
|php|validation| |
for sqlite, check out the firefox extension. |
for sqlite, check out the firefox extension. It offers a serviceable GUI. |
You may be looking for an [Object Database][1].
[1]: http://en.wikipedia.org/wiki/Object_database |
What makes a language Object-Oriented? |
|oop|language-agnostic|programming-languages| |
Since debate without meaningful terms is [meaningless](http://stackoverflow.com/questions/24270/whats-the-point-of-oop), I figured I would point at the elephant in the room and ask: What exactly makes a language "object-oriented"? I'm not looking for a textbook answer here, but one based on your experiences with OO lan... |
|language-agnostic|oop|programming-languages|glossary| |
I believe this is the problem that the [Microsofy Entity Framework][1] is trying to address. Whilst not specifically designed to "Compile (the database changes are done auto-magically)" it does address the issue of handling changes to the domain model without a huge dependance on the underlying data model.
[1]: ... |
A Match is a part of a string that matches the regular expression, and there could therefore be multiple matches within a string.
Inside a Match you can define groups, either anonymous or named, to make it easier to split up a match. A simple example is to create a regex to search for URLs, and then use groups insid... |
A Match is a part of a string that matches the regular expression, and there could therefore be multiple matches within a string.
Inside a Match you can define groups, either anonymous or named, to make it easier to split up a match. A simple example is to create a regex to search for URLs, and then use groups insid... |
On the server you're pretty much limited to the UserAgent string the browser provides (which is fraught with problems, have a read about the [UserAgent string's history](http://www.webaim.org/blog/user-agent-string-history/)).
On the client (ie in Javascript), you have more options. But the best option is to not act... |
You could probably do it by writing your own HTTP Handler (a .NET component that implements the System.Web.IHttpHandler interface).
There's a good primer article here:
[link text][1]
[1]: http://www.15seconds.com/issue/020417.htm |
You can achieve what you want in just a few steps:
1. Create a MSBuild Task - http://msdn.microsoft.com/en-us/library/t9883dzc.aspx
2. Update the project file to include a call to the task created prior to build
The task receives a parameter with the location of the header .h file you referred. It then extract... |
Dan. IE executes the script with no issue. I am facing the problem in Firefox. The popularTags element exists in the HTML document that calls the function.
<pre>
<div id="popularTags" style="line-height:18px"></div>
<script language="javascript" type="text/javascript">
function ShowPopularTags()
{
... |
You can write simple C++/C utility that include this .h file and dynamically create file that can be used in C#.
This utility can be run as a part of C# project as a pre-build stage.
This way you are always sync with the original file. |
That may be the other way around than what you want, but do you know about [RDNZL](http://www.weitz.de/rdnzl/)? It's a foerign-function interface (FFI) that lets you call .NET libraries from your Lisp code.
They are most probably much less mature than any Common Lisp or Scheme implementation, but there are Lisp dial... |
Im trying to put an html embed code for a flash video into the rss feed, which will then be parser by a parser (magpie) on my other site. How should I encode the embed code on one side, and then decode it on the other so I can insert clean html into the DB on the receiving server? |