instruction stringlengths 0 30k ⌀ |
|---|
dannyp and others, <tt>no-cache</tt> does not stop caches from storing sensitive resources. It merely means that a cache cannot serve a resource it has stored without revalidating it first. If you wish to prevent sensitive resources from being cached, you need to use the <tt>no-store</tt> directive. |
Try adding [linum.el][1] to your emacs dir / .emacs file.
[1]: http://www.emacswiki.org/cgi-bin/wiki/LineNumbers |
I made a little test with your problem (I'm not sure if I understood it correctly), and these properties shows up in the designer correctly, and all enums are shown appropriately. If this isn't what you're looking for, then please explain yourself further.
Don't get hang up on the _Ugly part thrown in there. I just... |
This is very similar to a question I asked about [how to get changes on a branch in git](http://stackoverflow.com/questions/53569/how-to-get-the-changes-on-a-branch-in-git). Note that the behaviour of git diff vs. git log is inconsistently different when using two dots vs. three dots. But, for your application you can ... |
The minimum permissions necessary for the script to function. |
Floating the select boxes changes their display properties to "block". If you have no reason to float them, simply remove the "float: left" declaration, and add "text-align: center" to #makes and #models. |
Install [Unix Utils][1]
touch temp
find . -newer temp -exec touch {} ;
rm temp
Make sure to use the full path when calling find or it will probably use Windows' find.exe instead. This is untested in the Windows shell -- you might need to modify the syntax a bit.
[1]: http://unxutils.sourcefor... |
There are two ways I know of to do this:
- Use the backspace escape character ('\b') to erase your line
- Use the `curses` package, if your programming language of choice has bindings for it.
And a Google revealed [ANSI Escape Codes][1], which appear to be a good way.
[1]: http://en.wikipedia.org/wiki... |
There are two ways I know of to do this:
- Use the backspace escape character ('\b') to erase your line
- Use the `curses` package, if your programming language of choice has bindings for it.
And a Google revealed [ANSI Escape Codes][1], which appear to be a good way. For reference, here is a function in C++... |
I would recommend using a virtual machine where you can mess with the clock to your heart's content and it won't affect your development machine. Two free ones are [Virtual PC](http://www.microsoft.com/Windows/products/winfamily/virtualpc/default.mspx) from Microsoft and [VirtualBox](http://www.virtualbox.org/) from Su... |
Create a transparent window the size of the whole screen, mark it always-on-top, calculate the regions of your other application windows, and make the non-window regions of the top window grey.
I suppose you could just position your own application windows on top of the transparent grey one, with it being above all ... |
Indexes may be a good place to start. The low hanging fruit can be knocked down with the SQL Server Index Tuning Wizard. |
Here's what I did* based on Brian's links
First create a dialog resource with the properties:
- border **FALSE**
- 3D look **FALSE**
- client edge **FALSE**
- Popup style
- static edge **FALSE**
- Transparent **TRUE**
- Title bar **FALSE**
and you should end up with a dialog window with n... |
Here's what I did* based on Brian's links
First create a dialog resource with the properties:
- border **FALSE**
- 3D look **FALSE**
- client edge **FALSE**
- Popup style
- static edge **FALSE**
- Transparent **TRUE**
- Title bar **FALSE**
and you should end up with a dialog window with n... |
The iPhone uses Objective C, the Blackberry Java SE with RIM functionality and Android another custom version of Java. I could possibly see how you could combine the latter two but there is no functionality (without jailbreaking) of running Java applications on an iPhone.
The best bet I've seen so far is something l... |
**FORMATETC** is a type of application clipboard, for lack of a better term. In order to pull off some of the visual tricks of draging around the tree node, it has to be copied into this clipboard with its source description. The source control loads its info into the FORMATETC clipboard and sends it to the target ob... |
This query should identify columns that are potential problems...
SELECT * FROM [source].INFORMATION_SCHEMA.COLUMNS src
INNER JOIN [dest].INFORMATION_SCHEMA.COLUMNS dst ON dst.COLUMN_NAME = src.COLUMN_NAME
WHERE dst.CHARACTER_MAXIMUM_LENGTH < src.CHARACTER_MAXIMUM_LENGTH |
Many ways to do it. I guess the key is to do it in the most efficient way possible (without looping the string). I would do it as a char array which can be reversed easily (using C#).
string mystring = "abracadabra";
char[] str = mystring.ToCharArray();
Array.Reverse(str);
string revstring =... |
When embedding SWFs from unknown sources, it is also best practice to throw a mask on the Loader so that the loaded SWF can't take over more screen real estate than expected.
Pseudo-code to do so:
var maskSpr : Sprite = new Sprite();<br/>
maskSpr.graphics.beginFill();<br/>
maskSpr.graphics.drawRect(0,0,safeWidt... |
I also used SQLite as a desktop database. It's lightning quick and doesn't need a seperate process or any prior installation. All you need is a library to access the data as part of your code. |
Add to rc.local a check to see if an IP has been obtained. If no setup an 'at' job in the near future to attempt again. Continue scheduling 'at' jobs until an IP is obtained. |
Wrap only the repeater you want to rebind with an update panel of its own. The only viewstate transferred when doing this is the portion inside the update panel. You may have to play around with the triggers and update mode of the panels to get everything to play nicely.
Another option is instead of using repeat... |
Disk Activity in Applescript |
|macos|io|applescript| |
How can I poll disk activity in Applescript? Check to see if disk X is being read, written, or idle every N seconds and do something. |
'^M' character at end of lines |
|newline|os-dependent| |
When I run a particular SQL script in Unix environments, I'm am seeing a '^M' character at the end of each line of the SQL script as it is echoed to the command-line. I don't know on which OS the SQL script was originally created.
What is causing this and how do I fix it? |
You can create a view, which adds the "constant" column, and use it as a replication source. |
Try using dos2unix to strip off the ^M. |
No. In C# (and all other .NET languages) the String is a first-class data type. It is not simply an array of characters. You can convert back and forth between them, but they do not behave the same. There are a number of string manipulation methods (like "Substring()" and "StartsWith") that are available to the String ... |
It requires the format provider in order to determine the particular date and time symbols and strings (such as names of the days of the week in a particular language). You can use a null, in which case the CultureInfo object that corresponds to the current culture is used.
If you don't want to have to specify it ea... |
Since VC6 most of the focus of Visual Studio has been on C# and .NET, as well as other features, so some C++ old-timers see VC6 as the good old days. Things have improved in Visual Studio for C++ developers since those days, but not nearly as dramatically as for .NET users.
One way that VS2008 is significantly bett... |
Todd Bleeker at Mindsharp showed me a piece of code he wrote that can use Ajax on Sharepoint 2.0. It was pretty cool. I believe the company used it on their sharepoint site managment software if you want to take a look. (you used to be able to request a 30 day trial). I bet how to do it is on their yahoo group (I c... |
I think @Erlend's use of `HTMLDocument` is the **best** way to go. However, I have also had good luck using this simple library:
[SgmlReader](http://code.msdn.microsoft.com/SgmlReader) |
We created a batch file to do this for us. Would prefer actual support in subversion though... |
Tnilsson, great solution ( because I've done it the exact same way :P ).
I don't see any other way to do it in linear time. Does anybody ? Because the recruiting manager told me, that this solution was not strong enough.
Are we missing some super complex, do everything in one return line, solution ? |
If you want to save the stack trace into a String you can do this;
String exception = "";
for (StackTraceElement element : e.getStackTrace())
exception += element.toString() + "\n";
Where e is, obviously, an exception.
Besides, it sounds very weird to autogenerate an own Exception just to find... |
As you have guessed, the baseAddresses element is completely ignored when hosting in IIS. The service's base address is determined by the web site & virtual directory into which your wcf service is placed.
Even when self-hosting, baseAddresses is not required. It is merely a convenience that avoids you having to en... |
Weird.. The code you pasted is almost verbatim to this: [http://www.quirksmode.org/js/cookies.html][1] which works fine..
I know you are using Ajax, but have you tried quickly **knocking it to server side code to see if that works**? This may help in figuring if it is a problem with the JS or something else (e.g mys... |
**Second problem.**
public static void shuffle (int[] array)
{
Random rng = new Random(); // i.e., java.util.Random.
int n = array.length; // The number of items left to shuffle (loop invariant).
while (n > 1)
{
int ... |
I like Maximillian's answer.. to expand a little, my person projects are developed to solve something I'm working on already. So when I get tired of repeat work I'll prototype a solution. and then use it. If Its similar enough to one of my earlier projects I'll borrow as much code as I can and try to improve the level... |
I think you may be using the wrong command for looking at the list of files that you have open.
Try doing an :ls to see the list of files that you have open and you'll see:
1 %a "./checkin.pl" line 1
2 # "./grabakamailogs.pl" line 1
3 "./grabwmlogs.pl" line 0... |
I think you may be using the wrong command for looking at the list of files that you have open.
Try doing an :ls to see the list of files that you have open and you'll see:
1 %a "./checkin.pl" line 1
2 # "./grabakamailogs.pl" line 1
3 "./grabwmlogs.pl" line ... |
It's not entirely clear from your question what layout you're trying to achieve, but judging by that fact that you have applied "float:left" to the select elements, it looks like you want the select elements to appear side by side. If this is the case, you can achieve this by doing the following:
- To centrally al... |
I also used SQLite as a desktop database. It's lightning quick and doesn't need a seperate process or any prior installation. All you need is a library to access the data as part of your code.
In light of your clarification I'd evaluate both OracleXE and Oracle 10g Lite before the others. Stick with the same tech, S... |
Using a good data structure usually helps impress the professor:
Push half the chars onto a stack (Length / 2).<br />
Pop and compare each char until the first unmatch.<br />
If the stack has zero elements: palindrome.<br />
*in the case of a string with an odd Length, throw out the middle char. |
Here's my solution, without using a strrev. Written in C#, but it will work in any language that has a string length function.
private static bool Pal(string s) {
for (int i = 0; i < s.Length; i++) {
if (s[i] != s[s.Length - 1 - i]) {
return false;
}
}
return true;
}
|
In Visual Studio (2005 at least - what I'm using right now), each reference that you have associated to a project has a property called "Copy Local", this can be set to true/false. When true it will copy the dll's for you into the current configuration directory. |
If source control is too technical they can use [Subversion with WebDav](http://svnbook.red-bean.com/en/1.2/svn.webdav.autoversioning.html).
The less technical people will just save files normally from whatever application they use, without worrying/thinking about source control. They get the benefit of auto-versio... |
If source control is too technical they can use [Subversion with WebDav](http://svnbook.red-bean.com/en/1.2/svn.webdav.autoversioning.html).
The less technical people will just save files normally from whatever application they use, without worrying/thinking about source control. They get the benefit of auto-versio... |
If source control is too technical they can use [Subversion with WebDav](http://svnbook.red-bean.com/en/1.2/svn.webdav.autoversioning.html).
The less technical people will just save files normally from whatever application they use, without worrying/thinking about source control. They get the benefit of auto-versio... |
Where does RegexBuddy store its working data between uses? |
|regexbuddy| |
Ok, so I'm an idiot.
So I was working on a regex that took way to long to craft. After perfecting it, I upgraded my work machine with a blazing fast hard drive and realized that I never saved the regex anywhere and simply used RegexBuddy's autosave to store it. Dumb dumb dumb.
I sent a copy of the regex to ... |
And going further up the abstraction tree, what are you using this for?
You could either initialize those values in each class as appropriate or create a specific class containing all the default values and attributes, like:
class Configuration {
private var $configValues = array( 'cool' => 'Defaul... |
And going further up the abstraction tree, what are you using this for?
You could either initialize those values in each class as appropriate or create a specific class containing all the default values and attributes, like:
class Configuration {
private var $configValues = array( 'cool' => 'Defaul... |
try this [post][1]? I dont know but might be what you are looing for.
[1]: http://blog.maartenballiauw.be/post/2008/01/11/Preview-Word-files-(docx)-in-HTML-using-ASPNET-OpenXML-and-LINQ-to-XML.aspx |
The other answers are correct; it's not possible, but you could write this yourself. However, in case you're unsure how to actually implement something like this, here's a complete and working implementation that subclasses dict which I've just written and tested. (Note that the order of values passed to the construct... |
How to check if a value exists in SQL table |
|php|sql|mysql| |
I've got a table of URL's and I don't want any duplicate URL's. How do I check to see if a given URL is already in the table using PHP/MySQL? |
You could do this query:
SELECT url FROM urls WHERE url = 'http://asdf.com' LIMIT 1
Then check if [mysql\_num\_rows()][1] == 1 to see if it exists.
[1]: http://php.net/mysql_num_rows |
i don't know the syntax for MySQL, but all you need to do is wrap your INSERT with IF statement that will query the table and see if the record with given url EXISTS, if it exists - don't insert a new record.
if MSSQL you can do this:
IF NOT EXISTS (SELECT 1 FROM YOURTABLE WHERE URL = 'URL')
INSERT INTO ... |
Strip HTML in SSRS (VB.NET) |
|vb.net|reporting-services| |
my DataSet returns a field with HTML, e.g.
<b>blah blah </b><i> blah </i>.
how do i strip all the HTML tags? has to be done with inline VB.NET
Changing the data in the table is not an option.
thank you |
my DataSet returns a field with HTML, e.g.
<b>blah blah </b><i> blah </i>.
how do i strip all the HTML tags? has to be done with <b>inline</b> VB.NET
Changing the data in the table is not an option.
thank you |
my <b>SSRS DataSet</b> returns a field with HTML, e.g.
<b>blah blah </b><i> blah </i>.
how do i strip all the HTML tags? has to be done with <b>inline</b> VB.NET
Changing the data in the table is not an option.
thank you |
It's caused by the DOS/Windows line-ending characters. Like Andy Whitfield said, the Unix command dos2unix will help fix the problem. If you want more information, you can read the man pages for that command. |
I found the answer after searching around. Here's what I have done:
1. Create a new project in XCode. I think I used the view-based app.
2. Drag a WebView object onto your interface and resize.
3. Inside of your WebViewController.m (or similarly named file, depending on the name of your view), in the viewDidLo... |
Generally, it's better to keep presentation (HTML) separate from logic ("back-end" code). Your code is decoupled and easier to maintain this way. |
I'm actually dealing with exactly this kind of stuff for my company's video game. The most useful info I've found are at these two links:
[Paul Bourke][1]'s page at UWA, with his 1989 paper on Delaunay and a series of implementation links.
A [great explanation of the psudocode and a visual][2] of doing Delaunay ... |
C pointers in C# |
|c#|c|pointers| |
Is this function declaration in C#:
void foo(string mystring)
the same as this one in C:
void foo(char *)
i.e. In C#, does the called function receive a pointer behind the scenes? |
You could use wget (a command line tool) to recursively query each page and save them to html files. It would update all necessary links in the resulting html to reference .html files instead of .aspx. This way, you can code all your site as if you were using server-generated pages (easier to test), and then convert it... |
There's no native way to store file permissions in SVN.
Both [asvn][1] and [the patch][2] from that blog post seem to be up (and hosted on the official SVN repository), and that's a good thing, but I don't think they will have such metadata handling in the core version any time soon.
SVN has had the ability to ha... |
SVN does have the capability of storing metadata ([properties][1]) along with a file. The properties are basically just key/value pairs, however there are some special keys like the 'svn:executable', if this property exists for a file, Subversion will set the filesystem's executable bit for that file when checking the... |
Although it can clearly be done in SQL Server 2005, I think that it's of sufficient 'non-database-ness' that some kind of precompiled, high-level language routine makese sense.
I've written DLLs for Interbase/Firebird, and T-SQL sprocs for SQL Server, but never a CLR routine. It will be an interesting exercise! |
You can, of course, use "catch (...) { /* code here */ }", but it really Depends On What You Want To Do. In C++ you have deterministic destructors (none of that finalisation rubbish), so if you want to mop up, the correct thing to do is to use RAII.
For example. instead of:
void myfunc()
{
void* h = get_ha... |
You can, of course, use "catch (...) { /* code here */ }", but it really Depends On What You Want To Do. In C++ you have deterministic destructors (none of that finalisation rubbish), so if you want to mop up, the correct thing to do is to use RAII.
For example. instead of:
void myfunc()
{
void* h = get_ha... |
I've used a union like this to pass around matrices in the past:
union matrix {
double dflat[16];
double dmatr[4][4];
};
Then pass a pointer in to your setter and copy the data into the matrix in your class.
There are ways of handling this otherwise (that are more generic), but this ... |
After having verified that my code <i>did</i> work from the command line, I found that it was no longer working! I went looking into my .net code to see if anything made sense.
Here is what I had:
<pre>
static public int Execute(string sCMD, string sParams, string sComment,
... |
If you want to return, you need a type.
Instead of var, declare using IEnumerable<> and return that variable. Iterating through it actually executes the query. |
Word 2007 has an API that you can use to convert to HTML. Here's a post that talks about it <http://msdn.microsoft.com/en-us/magazine/cc163526.aspx>. You can find documentation around the API, but I remember that there is a convert to HTML function in the API. |
Is it your intent to test the view which generates the deltas, or to test that your code correctly adds, deletes and updates in response to the view?
If you want to test the view, you could use a tool like DBUnit to populate your feed and data tables with various data whose delta you've manually calculated. Then, f... |
You might feel better after reading about [Data Transfer Objects][1]. Some people [plain don't like them][2], but if it feels like a good fit to you, it probably is.
[1]: http://en.wikipedia.org/wiki/Data_Transfer_Object
[2]: http://anirudhvyas.com/root/2008/04/19/abuses-of-dto-pattern-in-java-world/ |
@Espo
No, the users will not have access to the original datasource, that's why I'm considering creating a small access database with the data subset required for the report |
Accessing a web service in a Flash CS3 AS3 project. |
|web-services|flash|actionscript-3| |
Since CS3 doesn't have a web service component, as previous versions had, is there a good, feature-complete, AS3-only (no Flex dependencies) library for accessing web services with AS3? |
Java solution:
public class QuickTest {
public static void main(String[] args) {
check("AmanaplanacanalPanama".toLowerCase());
check("Hello World".toLowerCase());
}
public static void check(String aString) {
System.out.print(aString + ": ");
char[] chars... |
Do you have to keep the data "offline"?
What I usually do i these cases where you have quite a bit of data, is to use an existing sql-server already on the network. If it is to be used at the office, the users will by online anyway.
Just remember to create a dedicated user with restriced access on the sql-server... |
Do you have to keep the data "offline"?
What I usually do i these cases where you have quite a bit of data, is to use an existing sql-server already on the network. If it is to be used at the office, the users will by online anyway.
Just remember to create a dedicated user with restriced access on the sql-server... |
To add to @[Brad](http://stackoverflow.com/questions/56224/creating-objects-driven-by-the-database-to-populate-a-treeview-very-slow-c#56264), only populate the tree as needed. That means hooking into the expand event of the tree nodes. This is similar to how Windows Explorer functions when dealing with network shares.
... |
Visual Studio 2008 does not support the 2005 business intelligence projects, so if you have not done so already don't uninstall 2005 Business Intelligence! You can continue to maintain those projects independently in VS2005.
SQL Server 2008 Business Intelligence will integrate with VS2008 so you will require that an... |
I would recommend against building a pure Silverlight site.
Silverlight suffers from the same issues as Flash does: Unintuitive Bookmarking, issues with printing, accessibility issues, not working back buttons and so on.
Also, you would require your users to have Silverlight installed or at least to have the abil... |
How to convert a string to a date in sybase |
|sybase| |