instruction stringlengths 0 30k ⌀ |
|---|
|language-agnostic|http|etag|web-server|header| |
|language-agnostic|http|web-server|etag|header| |
|language-agnostic|http|webserver|header|etag| |
|language-agnostic|https|webserver|header|etag| |
|language-agnostic|http|webserver|header|etag| |
You can imagine a set of JS tools that will allow the user to define what kind of transformation he wants to do, but the final work of transformation MUST be done on a server side. JS on the client side is unable to create a file, for security reason. |
How to know when to send a 304 Not Modified response |
|http|statuscodes|304|notmodified|language-agnostic| |
I'm writing a resource handling method where I control access to various files, and I'd like to be able to make use of the browser's cache. My question is two-fold:
1. Which are the definitive HTTP headers that I need to check in order to know for sure whether I should send a 304 response, and what am I looking ... |
|language-agnostic|http|etag|304|if-modified-since|statuscodes| |
HTTP: How to know when to send a 304 Not Modified response |
|language-agnostic|http|etag|304|if-modified-since| |
|language-agnostic|https|etag|304|if-modified-since| |
|language-agnostic|http| |
|language-agnostic|https| |
|visual-studio|vb.net|macros| |
|visual-studio|automation|macros| |
Myeah, I just installed the 4.3pre15(latest) and it does look a bit better.
Super feature is the automatic XML DTD creation you can get from one of the plugins.
Now THAT is awsome, especially for big files |
You got it. Solution b won't scale up so solution a is key, as far as performance are of concern. By the same time, why should you constrain GetProductDetails() method to grab every data in a single request (hence the SQL view approach) ? Why not have this method perform 3 requests and say goodbye to your messy logic :... |
In the case above I would probably just have a single static load method especially if all or most of the properties are normally needed:
Public static function Load(Id as integer) as Product
Product.Load(Id)
If say the color property is rarly used and fairly expensive to load then you may want to stil... |
Yes you do. If you use the publish command in Visual Studios, it will include all the assemblies you need in the folder you selected to publish your site.
If a .dll has changed and you need to update your site, you can just publish again or copy the .dll. |
It can work with CSS
Put them in the markup as the next button first, then the previous button next.
Then use CSS to position them to appear the way you want
|
Is there a custom FxCop rule that will detect unused PUBLIC methods? |
|fxcop|code-analysis|.net| |
I just tried FxCop. It does detect unused private methods, but not unused public. Is there a custom rule that I can download, plug-in that will detect unused public methods? |
|.net|code-analysis|fxcop| |
I just tried FxCop. It does detect unused private methods, but not unused public. Is there a custom rule that I can download, plug-in that will detect public methods that aren't called from within the same assembly? |
The answer is to show the file's history using context menu->Team->Show history, then choose two revisions and context menu for the selection->compare with each other.
|
Go for Option b) it makes your attributes independent from the Presentation of the Data (e.g. a table)
I think you would benefit from learning more about the [MVC-Architecture][1]. It stands for <b>M</b>odel (Your Data -> Product), <b>V</b>iew (the Presentation -> Table) and <b>C</b>ontroller (a new Class that will ... |
Not with the builtin VNC server. [Vine Server][1] allows you to change the bit depth that clients connect at though.
[1]: http://sourceforge.net/projects/osxvnc/ |
Wait until you have to debug a wierd and wondeful problem in a live environment where all you can do is get to the command line. You might not end up liking VI, but it will save you a lot of time and you'll learn loads of tricks to step through massive (log) files. |
Many have suggested that you must give FULL permissions to users, but this is not true. You need only give them MODIFY permissions -- you can deny them DELETE permission, which is a good idea, as it prohibits the users from "accidentally" deleting your data file.
It is true that for a user with DELETE permissions, t... |
If you need to redistribute QuickTime, see [QuickTime Licensing][1] for details. You're not allowed to redistribute any of the QuickTime libraries without a written agreement with Apple. Many CD-replication companies will actually request proof of this agreement before printing large numbers of CDs.
I would definite... |
Definitely [graphviz][1]. The image on the wikipedia link you are pointing at was made in graphviz. From its description page the graph description file looked like this:
graph untitled {
graph[bgcolor="transparent"];
node [fontname="Bitstream Vera Sans", fontsize="22.00", shape=circle, style="... |
Perhaps it is related to the fact that the passed parameters are NULL,
check how your query is build perhaps it behaves in different way then expected when you pass NULL.
Does you proc returns expected results when you call:
SET FMTONLY OFF exec [cpExportRecordType_ListByExportAgentID] null, null
? |
Perhaps it is related to the fact that the passed parameters are NULL,
check how your query is build perhaps it behaves in different way then expected when you pass NULL.
Does you proc returns expected results when you call:
SET FMTONLY OFF exec [cpExportRecordType_ListByExportAgentID] null, null
?
Other po... |
As suggested, a png background could work, or even just an absolutely positioned png that sizes to fit the page, but you are asking in a comment about what would be a good tool to create one -- if you want to go with free, try <a href="http://www.gimp.org/">GIMP</a>. Create a canvas with a transparent background, add ... |
This sounds very similar to <a href="http://braid-game.com">Braid</a>. You really don't want parallel processing for this - parallel programming is <b>hard</b>, and for something like this, performance should not be an issue.
Since the game state vector will grow very quickly (probably on the order of several kilob... |
1 gotcha: when you use "p" to put the line, it puts it *after* the line your cursor is on, so if you want to add the line after the line you're yanking, don't move the cursor down a line before putting the new line. |
SSL encrypts the entire communications path from the client to the server and back, so yes - the headers will be encrypted.
By the way, if you develop networked applications and care about data security, the least you should do is read a book like Practical Cryptography, by Niels Ferguson and Bruce Schneier, and pro... |
In general, I think JSPs should not have data logic. They should get all the data they need to display from the Controller and all their logic should be about HOW the data is displayed, not WHAT is displayed. This is usually a lot simpler and a lot less code/XML than adding a custom tag.
And if there isn't any re-us... |
Edit: As with some of the posts made while I was writing this, I often use using for tidying ADO.NET connections. |
Thanks to the comments below, I will clean this post up a bit (I shouldn't have used the words 'garbage collection' at the time, apologies): <br />
When you use using, it will call the Dispose() method on the object at the end of the using's scope. So you can have quite a bit of great cleanup code in your Dispose() m... |
You could use [Perceptual Image Diff][1]
[1]: http://pdiff.sourceforge.net/ |
You could use [Perceptual Image Diff][1]
It's a command line utility that compares two images using a perceptual metric. That is, it uses a computational model of the human visual system to determine if two images are visually different, so minor changes in pixels are ignored. Plus, it drastically reduces the number... |
@quamrana:
There must be something beyond the /Wall option to enable warning 4365:
C:\Temp>cl /Wall /c foo.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.21022.08 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
foo.c
foo.c(6) : warning C4018: '<' ... |
@quamrana:
There must be something beyond the /Wall option to enable warning 4365:
C:\Temp>cl /Wall /c foo.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.21022.08 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
foo.c
foo.c(6) : warning C4018: '<' ... |
My number one suggestion: learn to type fast, without needing to look at the keyboard.
If you can't touch type and are always hunting-and-pecking for the colon or the hjkl or :%s/foo/bar, forget about it. Typing *can* be faster than using the mouse, but if that's not the case for you, vi's not going to work.
But ... |
1. As a general rule, a simple way to generate a hashcode for a class is to XOR all the data fields that can participate in generating the hash code (being careful to check for null as pointed out by others). This also meets the (artificial?) requirement that the hashcodes for UserInfo("AA", "BB") and UserInfo("BB", "... |
where can I find vim-enhanced resources? |
|linux|vim|editor|vi| |
I recently installed vim-enhanced , but I can't find any article/tutorial related to it.All I could find is a page that briefly describes it's new features , along with several RPM's to download .
What exactly does it have to offer to scripting languages that regular vi/vim can't ?
Thanks |
Eruby is an external executable, while erb is a library within Ruby. You would use the former if you wanted independent processing of your template files (e.g. quick-and-dirty PHP replacement), and the latter if you needed to process them within the context of some other Ruby script. It is more common to use ERB simp... |
In MS SQL you can use LIKE which has some "pattern matching" in it. I would guess Oracle has something similar. Its not Regex, but has some of the matching capabilities. (Note: its not particularly fast).. Fulltext searching could also be an option (again MS SQL) (probably a much faster way in the context of a good ... |
How to run a script as root on Mac OS X? |
|macos|terminal| |
What should I type on the Mac OS X terminal to run a script as root? |
sudo ./*scriptname* |
The way I understand things, Samba created [tdb][1] to allow "multiple concurrent _writers_" for any particular database file. So if your workload has multiple writers your performance may be bad. On the other hand, if your workload has lots of readers, then the question is how well your operating system handles mult... |
I used C# and Linq to do something similar to get log entries filtered on user input (see [http://stackoverflow.com/questions/11194/conditional-linq-queries][1]):
IQueryable<Log> matches = m_Locator.Logs;
// Users filter
if (usersFilter)
matches = matches.Where(l => l.UserName == comboBo... |
I used C# and Linq to do something similar to get log entries filtered on user input (see [http://stackoverflow.com/questions/11194/conditional-linq-queries][1]):
IQueryable<Log> matches = m_Locator.Logs;
// Users filter
if (usersFilter)
matches = matches.Where(l => l.UserName == comboBo... |
- You could use Apache POIFS, which
seems to be a little more mature,
but that would appear to duplicate the efforts of POI-HSMF.
- You could use POI-HSMF and contribute changes to get the
features you need working. That's
often how FOSS projects like that expand.
- You
could use c... |
Note that each module initializes itself only once during the life of an app, no matter how many times you import it. So if you compile your expressions at the module's global scope you should be fine. |
Note that each module initializes itself only once during the life of an app, no matter how many times you import it. So if you compile your expressions at the module's global scope (ie. not in a function) you should be fine. |
Have you tried to use Jython with the Python win32 extensions (http://www.jython.org/Project/ + http://python.net/crew/mhammond/win32/)?
If this is for a "personal" or "internal" project Jython with Python may be a very good choice. If you are building a "shrink wrapped" software package this may not be the best opti... |
I hate that I'm answering my own question, but I did find a potential solution that's not documented well and in typical SAP fashion uses deprecated methods. So it might be a slightly less dirty hack than what Eric suggested. I found it through an unrelated SDN forum post.
Basically, you dive into the request obje... |
yy (copy the line)
or
dd (delete the line)
then
p (paste the copied or deleted text **after** the current line)
or
P (paste the copied or deleted text **before** the current line)
|
The datastructure you are after is called a Ternary Search Tree.
There's a great JavaWorld example at www.javaworld.com/javaworld/jw-02-2001/jw-0216-ternary.html |
.NET Introspection VS Reflection |
|.net|reflection|introspection| |
What is the difference between Introspection and Reflection in .NET |
The only way that I know of to do this is to build a ClickOnce application in .NET 2.0+
If the user of your application has the correct pre-requsits installed then the application can just be "launched".
Check out:
- [Microsoft Family.Show][1]
[1]: http://www.vertigo.com/familyshow.aspx |
YP or Yp or yyp
|
You can't do this.
If you want to output to the debugger's output window, call OutputDebugString.
I found [this implementation][1] of a 'teestream' which allows one output to go to multiple streams. You could implement a stream that sends data to OutputDebugString.
[1]:http://www.flipcode.com/archives/Message_... |
A delegate is always just basically a function pointer. A lambda can turn into a delegate, but it can also turn into a LINQ expression tree. For instance,
Func<int, int> f = x => x + 1;
Expression<Func<int, int>> exprTree = x => x + 1;
The first line produces a delegate, while the second produces an ex... |
Use operator new and delete:
struct STRUCT
{
void *operator new (size_t)
{
return new char [sizeof(STRUCT) + nPaddingSize];
}
void operator delete (void *memory)
{
delete [] reinterpret_cast <char *> (memory);
}
};
void main()
{
... |
Suppressing multiple violations with a single **SuppressMessage** attribute is officially not supported. Apparently, this is by design.
I agree, it might be annoying at times, but I can't say I disagree with the decision, since the attribute is their way to force you to say, "Yes, I know what I am doing", which shou... |
You can use an Ajax request, but be sure to make it a synchronous request rather than an asychronous one. Alternatively, simply save state whenever the user makes a change, this also protects the data if the user's browser crashes. |
You might try [LWPx::ParanoidAgent][1], a subclass of LWP::UserAgent which is more cautious about how it interacts with remote webservers.
Among other things, it allows you to specify a global timeout. It was developed by Brad Fitzpatrick as part of the LiveJournal project.
[1]: http://search.cpan.org/~bradfitz/LW... |
I suppose we could ask the [same top rated question](http://stackoverflow.com/questions/1711/) every couple of weeks and upmod all those who mention [code complete](http://cc2e.com/) or [The Pragmatic Programmer](http://www.pragprog.com/titles/tpp/the-pragmatic-programmer).
Not that there is anythng wrong with it :... |
You could use a Stopwatch in the BeginRequest and the PreSendRequestContent as mentioned in the other two answers, or you could just use the request's Timestamp in the PreSendRequestContent.
For example, on [SingingEels][1], I added this to the bottom of my Master Page (yes, it's a hack) : `<%=DateTime.Now.Subtract(... |
I found a few answers to my own question. Basically, I needed to understand how to mock out the user from `restful_authentication` so that the autogenerated rspec controller tests could pass even though I had added `before_filter: login_required`.
Here are a few of my just found resources:
[RSpec: It Should Beha... |
Make you any session cookies (or all cookies) you use HttpOnly. Most browsers will hide the cookie value from JavaScript in that case. User could still manually copy cookies, but this helps prevent direct script access. StackOverflow had this problem durning beta.
This isn't a solution, just another brick in the wa... |
Nick is right, but there is no need to assemble the args piecewise:
directory = '/Volumes/Omg a space/'
system('/bin/ls', directory) |
static inner interface in Java - why? |
|java|static|interface| |
I have just found a static inner interface in our code-base.
class Foo {
public static interface Bar {
/* snip */
}
/* snip */
}
I have never seen this before. The original developer is out of reach. Therefore I have to ask SO:
What are the semantics behind a st... |
Why would a static inner interface be used in Java? |
|java|interface|static| |
From within Visual Studio in the properties of the report, on the 'References' tab add the details for the assembly that contains the managed code. This code can be called from expressions within reports using the instance name that is specified.
This assembly can either be stored in the GAC or the PrivateAssemblies... |
The .NET Framework's internal string type is UTF-16. All database access will convert to UTF-16 so that you can view the data appropriately: the database, or the OLE DB provider, will convert to UTF-16.
The XML writer classes (you *are* using XmlDocument or XmlWriter, right?) will then convert to UTF-8 on the output... |
You shouldn't need to change the default memory fill for the windows DEBUG runtime and you should use some thing like boost::shared_ptr for pointers any way.
That said. If you really want to you can.
You can **change** the **default fill** for the windows **DEBUG runtime** by using an allocator hook like this. Th... |
The "correct" way is pretty vague. The best (fastest / easiest / most elegant) to sort an array would be to just use the built-in shuffle() function. |
Application Level Replication Technologies |
|replication|soa| |
I am building out a solution that will be deployed in multiple data centers in multiple regions around the world, with each data center having a replicated copy of data actively updated in each region. I will have a combination of multiple databases and file systems in each data center, the state of which must be kept ... |
How to sort by Lucene.Net field and ignore common stop words such as 'a' and 'the'? |
|lucene|lucene.net| |
I've found how to sort query results by a given field in a Lucene.Net index instead of by score; all it takes is a field that is indexed but not tokenized. However, what I haven't been able to figure out is how to sort that field while ignoring stop words such as "a" and "the", so that the following book titles, for ex... |
What is the best implementation of an exception mechanism ? |