instruction stringlengths 0 30k ⌀ |
|---|
I agree with Unkwntech.
You should try to make the website compatible to both IE and Firefox |
My (very poor) solution was to get stats from w3schools and base my decisions on that. While those numbers aren't really terrible, they are skewed because viewers of that site are more likely to be upgrade-conscious. Also, it doesn't give a breakdown of any browser versions except FF. |
You could also look at ASP.NET output caching, which can be applied fairly granularly to different portions of your page:
[http://msdn.microsoft.com/en-us/library/xsbfdd8c(VS.71).aspx][1]
[1]: http://msdn.microsoft.com/en-us/library/xsbfdd8c(VS.71).aspx |
I found that the following:
DateFormat dbFormatter = new SimpleDateFormat("EEEE, MMMM dd, yyyy hh:mm aa zzzz");
dbFormatter.setTimeZone(TimeZone.getTimeZone("America/Chicago"));
Date scheduledDate = dbFormatter.parse("Friday, September 26, 2008 8:30 PM Eastern Daylight Time");
... |
I found that the following:
DateFormat dbFormatter = new SimpleDateFormat("EEEE, MMMM dd, yyyy hh:mm aa zzzz");
dbFormatter.setTimeZone(TimeZone.getTimeZone("America/Chicago"));
Date scheduledDate = dbFormatter.parse("Friday, September 26, 2008 8:30 PM Eastern Daylight Time");
... |
Actually , you can modify the String class . If you edit the String.java file located in src.zip , and then rebuild the rt.jar , the String class will have more methods added by you . The downside is that that code will only work on your computer , or if you provide your String.class , and place it in the classpath bef... |
i'd recommend oracle SQLdeveloper. it has all the functionality you need for developing and maintanice |
There is no way to make that warning into an error. In Delphi 2009 you can make treat all warnings as errors.
PS: It is an error in Delphi for .Net |
I definitely agree with everyone else that you should separate the tests from your production code. If you insist on not, however, you should define a conditional comiplation constant called TEST, and wrap all of your unit test classes with a
#if TEST
#endif
first to ensure that the test code does not ... |
Doesn't VirtualPC have a fake-write/snapshot mode? That way it should not write to your original disk at all unless you say so at the end of the session.
If it doesn't, you might seriously want to consider VMWare or VirtualBox as these do have this feature and it's REALLY useful for things like this.
Edit: it loo... |
I use maven, and check in just the pom & source.
After checking out a project, I run mvn eclipse:eclipse
I tell svn to ignore the generated .project, etc. |
As Mario says, the root should be the folder where the HTML should be kept. I'm assuming here that you are trying to design and edit a web page locally?
You can actually keep the file wherever you like. Although clearly it would be best to put it in the folder you're using for your other dev files. The simplest way... |
As far as local, static html goes, unless you specify it, most browsers will take the location of the html file you are viewing as the root. So any css put in there can just be referenced by it's name only.
The lazy way to get the correct reference for your css file is to open it in your browser. Then just grab the... |
I agree with all the "reset" suggestions and the "grid" framework suggestions, but I did want to add a bit of advice: The goal of _identical in every browser_ is, in practical terms, unachievable because you cannot control the client. Case in point: fonts.
You declare your font styles in CSS but some Linux machine... |
I agree with all the "reset" suggestions and the "grid" framework suggestions, but I did want to add a bit of advice: The goal of _identical in every browser_ is, in practical terms, unachievable because you cannot control the client. Case in point: fonts.
You declare your font styles in CSS but some Linux machine... |
I think the only problem with max concurrent in IIS is it might block page requests rather than just download requests.
I'd say write an HTTP Handler which actually does the download and can then decide (based on IP or Cookie) if a download is allowed to be sent back to the browser. Pretty straight forward code I'd ... |
The [thickbox plugin][1] for [jQuery][2] will do what you want.
[1]: http://jquery.com/demo/thickbox/
[2]: http://www.jquery.com |
[ack](http://petdance.com/ack/) works well on Windows (if you've got Perl). I find it better than grep for many uses. |
Using both 1.1 and 2.0 frameworks on Windows 2003 x64 |
|asp.net|iis|windows-server-2003| |
So, much to my annoyance I discover (after lots of research), that when running 1.1 and 2.0 dot.net frameworks on a 64bit 2003 install, it removes the asp.net tab from the IIS properties. I've tried the registry hacks, I've tried registering 32bit versions of both frameworks, and no luck. My only work around is runni... |
Yes. If you can get the window handle (maybe using FindWindow()), you can post any message to it as long as the WPARAM & LPARAM aren't pointers. |
Yes. If you can get the window handle (maybe using FindWindow()), you can send/post any message to it as long as the WPARAM & LPARAM aren't pointers.
|
CRUD-ish methods should be part of the Repository...ish. But I think you should ask why you have a bunch of CRUD methods. What do they _really_ do? What are they _really_ for? If you actually call out the data access patterns your application uses I think it makes the repository a lot more useful and keeps you from hav... |
If this was SQL Server, you'd use the Unpivot commands, but looking at the tag you assigned it's for access - am I right?
Although there is a [pivoting command in access](http://www.blueclaw-db.com/accessquerysql/pivot_query.htm), there is no reverse statement.
Looks like it can be done with a complex join. Chec... |
These add-ons have historically introduced lots of weird bugs to track down. These bugs can cause inconsistent behaviour which can't be diagnosed easily because it depends on the state of the cache.
So I'd say:
1. Don't use any of the above. Buy more tin instead, it's a more reliable (i.e. error-free) way of incr... |
I forgot about the GNOME tech of "apport", but I don't know much about using it. It is used to generate stacktraces and other diagnostics for processing and can automatically file bugs. It's certainly worth checking in to. |
All of these answers are great, but fundamentally, the solution to XSS will be to stop generating HTML documents by string manipulation.
Filtering input is always a good idea for any application.
Escaping your output using htmlentities() and friends should work as long as it's used properly, but this is the HTML ... |
Three of Garlik's ([www.garlik.com][1]) services, DataPatrol, QDOS and a FOAF viewer all use RDF and SPARQL extensively.
DataPatrol in particular and has tens of thousands of users in the UK. The dataset size is around ten billion RDF triples.
[1]: http://www.garlik.com/ |
grep -L -Z -r 'Subject: \[SPAM\]' . | xargs -0 -I{} mv {} DIR
The -Z means output with zeros (\0) after the filenames (so spaces are not used as delimeters).
xargs -0
means interpret \0 to be delimeters.
Then
-I{} mv {} DIR
means replace {} with the filenames, so you get mv filenames DIR. |
I've found xmlstarlet to be pretty good at this sort of thing.
http://xmlstar.sourceforge.net/
Should be available in most distro repositories, too. An introductory tutorial is here:
http://www.ibm.com/developerworks/library/x-starlet.html |
If the model class is sufficiently intelligent, it should recognize the standard Python ways of doing this.
Try:
getattr(p, s)
setattr(p, s, new_value)
There is also hasattr available. |
Another good option is to use [IPython][1], which is an interactive environment with a lot of extra features, including automatic pretty printing, tab-completion of methods, easy shell access, and a lot more. It's also very easy to install.
[IPython tutorial][2]
[1]: http://ipython.scipy.org/moin/
[2]: ... |
You can get your priority, but probably not that way.
Most mail clients honor `subject=` and `body=` in the query string of a `mailto:` link. Some mail clients treat multiple `body=` attributes as different lines; others only use the last `body`. Getting to your point, though: **I don't think most clients will let ... |
check this:
http://today.java.net/pub/a/today/2004/08/12/groovyxml.html?page=2 |
The code below works well when performing actions within Excel (XP or later).
For actions that take place outside Excel, for example connecting to a database and retrieving data the best this offers is the opportunity to show dialogs before and after the action (e.g. _"Getting data"_, _"Got data"_)
Create a for... |
I would check your web.config file, there may be references there that are causing the error since they are missing. |
By default the *Qt::WindowContextHelpButtonHint* flag is added to dialogs.
You can control this with the *WindowFlags* parameter to the dialog constructor.
For instance you can specify only the *TitleHint* and *SystemMenu* flags by doing:
QDialog *d = new QDialog(0, Qt::WindowSystemMenuHint | Qt::WindowTit... |
The [datediff function][1] can display the elapsed minutes. The if statement for the 12/31/9999 check I'll leave as an excercise for the reader ;-)
[1]: http://msdn.microsoft.com/en-us/library/ms189794.aspx |
Use [differencing/undo disks][1]. This means when you shut down your VPC you'll be asked if you want to save changes, simply answer no and you'll be back to where you started.
[1]: http://www.petri.co.il/virtual_creating_differencing_disks_with.htm |
VPC has a so called undo disk. you create sg similar like "restore point" and in vpc you can roll back to that version. ideal for testing setups. |
Sound like you need to use differencing virtual hard disks rather than creating a new copy every time.
Instructions [here][1]
[1]: http://dotnet.org.za/matt/pages/2413.aspx |
Easy way to export a SQL table without access to the server or phpMyADMIN |
|php|mysql|export| |
I need a way to easily export and then import data in a MySQL table from a remote server to my home server. I don't have direct access to the server, and no utilities such as phpMyAdmin are installed. I do, however, have the ability to put PHP scripts on the server.
How do I get at the data?
*I ask this question ... |
You question is more related to style than technicalities. I think that this book
http://www.amazon.com/Framework-Design-Guidelines-Conventions-Development/dp/0321246756
has great discussion around your question and lots of others. |
As long as your tests are in a seperate project, the tests can reference the codebase, but the codebase never has to reference the tests. I have to ask, what's confusing about maintaining two projects? You can keep them in the same solution for organization.
The complicated part, of course, is when the business has... |
FWIW we're using Jersey as its packed full of features (e.g. WADL, implicit views, XML/JSON/Atom support) has a large and vibrant developer community behind it and has great [spring integration](http://www.javakaffee.de/blog/2008/04/21/jersey-spring-integration-mostly-complete/).
If you use JBoss/SEAM you might fin... |
problem 1) try myBrowser.navigate("about:blank") before destroying the window.
|
EASTL is a possibility, but still not perfect. Paul Pedriana of Electronic Arts did an investigation of various STL implementations with respect to performance in game applications the summary of which is found here:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2271.html
Some of these adjustments to ar... |
[Baregrep][1] ([Baretail][2] is good too)
[1]: http://www.baremetalsoft.com/baregrep/
[2]: http://www.baremetalsoft.com/baretail/ |
Provided the windows are from the same security domain, and you have a reference to the other window, yes.
Javascript's open() method returns a reference to the window created (or existing window if it reuses an existing one). Each window created in such a way gets a property applied to it "window.opener" pointing t... |
Different versions of C++ libraries |
|c++|windows|windows-vista|windows-xp| |
After compiling a simple C++ project using Visual Studio 2008 on vista, everything runs fine on the original vista machine and other vista computers. However, moving it over to an XP box results in an error message: "The application failed to start because the application configuration is incorrect".
What do I have ... |
get contacts from email account |
|email|extract| |
a lot of websites like twitter, facebook and others let the users enter their email id and pwd and 'extract' the contacts based on that.
Anyone know how this is done? |
Turning this on its head, consider you want to design a new language and you want it to run in a managed runtime with a JIT and GC. Then consider that you could:
(a) write you own managed runtime (VM) and tackle all sorts of technically difficult issues that will doubtless lead to many bugs, bad performance, proper... |
I don't really get what you are asking.
Firstly is just the opposite of what you say. The dictionary has indexed access (is a hash table) while de List hasn't.
If you already have the data in a dictionary then all keys are unique, there can be no duplicates.
I susspect you have the data stored in another data ... |
Singelton: How should it be used |
|c++|design-patterns|implementation| |
|c++|design-patterns|implementation| |
|c++|design-patterns|implementation|singleton| |
Singleton: How should it be used |
|c++|design-patterns|singleton|implementation| |
So I have read the thread [Singletons: good design or a crutch?](http://stackoverflow.com/questions/11831/singletons-good-design-or-a-crutch#11914)<br>
And the argument still rages.
I see Singletons as a Design Pattern (good and bad).<br><br>
The problem with Singleton is not the Pattern but rather the users (sorr... |
First time working with UpdatePanels in .NET.
I have an updatepanel with a trigger pointed to an event on a FormView control. The UpdatePanel holds a ListView with related data from a separate database.
When the UpdatePanel refreshes, it needs values from the FormView control so that on the server it can use the... |
I think you have to call CoInitializeEx before you create any of the common controls.
The LoadLibrary is not needed. If you link with the correct .lib file the exe-loader will take care of such details for you. |
Since IWorkspaceRoot is an IContainer, can't you just use `workspaceRoot.findMember(String name)` and cast the resulting IResource to IFile? |
Using MFC, RichEdit controls just work.
Loading with InitCommonControlsEx() - ICC_USEREX_CLASSES doesn't load RichEdit AFAIK, you don't need it as it only does the 'standard' common controls, which don't include richedit. Apparently you only need to call this to enable 'visual styles' in Windows, not to get RichEdit... |
Instead of creating a new instance of an object every time you get a message, why don't you reuse objects that have already been used? This way you won't be fighting against the garbage collector and your heap memory won't be getting fragmented.**
For each message type, you can create a pool to hold the instances th... |
gethostbyaddr and similar calls. See <a href="http://perldoc.perl.org/functions/gethostbyaddr.html">http://perldoc.perl.org/functions/gethostbyaddr.html</a> |
The short answer is: most of the time time.clock() will be better.
However, if you're timing some hardware (for example some algorithm you put in the GPU), then time.clock() will get rid of this time and time.time() is the only solution left.
Note: whatever the method used, the timing will depend on factors you can... |
I kind of like to use DeviceIOControl as it gives me the possibility to eject any kind of removable drive (such as USB and flash-disks as well as CD trays). Da codez to properly eject a disk using DeviceIOControl is (just add proper error-handling):
bool ejectDisk(TCHAR driveLetter)
{
TCHAR tmp[10];
... |
You can use CSS to modify the look of this component. For the Ajax auto-complete component in 1.3 the element you want to override is div.wicket-aa, so for example you might do:
div.wicket-aa {
background-color:white;
border:1px solid #CCCCCC;
color:black;
}
div.wicket-aa ul... |
What is an easy way to create a MessageBox with custom button text in Managed C++? |
|c++| |
I would like to keep the overhead at a minimum. Right now I have:
// Launch a Message Box with advice to the user
DialogResult result = MessageBox::Show("This may take awhile, do you wish to continue?", "Warning", MessageBoxButtons::YesNo, MessageBoxIcon::Exclamation);
// The test will only b... |
There's no point in attempting to convince your employer to port from PHP to Python, especially not for an existing system, which is what I think you implied in your question.
The reason for this is that you already have a (presumably) working system, with an existing investment of time and effort (and experience). ... |
Unfortunately, I don't think that there is a way to do this. Your best bet would pro ably be to give up in emums altogether and use conventional class extension and static members. Otherwise, get used to duplicating that code. Sorry. |
Simple:
1. Generate a key for each user
2. Deny access for each request without this key
|
Agreed. The only thing exposed to webdav is a list item's attachment (or a library's documents). Even if you bring up a file's properties in explorer, there's no options for list data.
If you're working with Office 2007 documents, you can create a <a href="http://msdn.microsoft.com/en-us/library/ms550037.aspx">docum... |
Your condition is checking the existence of the "sFN" property in the "self" object. Anything that isn't null, undefined, 0, and "" will evaluate to true.
As others have said, you can use typeof, or instanceof to see if it's actually a function.
Looking at your linked example, you should read up on the differen... |
See also [this topic][1]
[1]: http://stackoverflow.com/questions/69830/which-browsers-your-applications-officially-supports |
If you purely build to standards, some browser won't render correctly since no browser supports all standards. You have to pick a few browsers and test your site in those.
Don't try to be too bleeding edge. If you must use some cutting edge CSS, then you have to expect it not to work 100% of the time. |
Be careful. The enumeration will return properties not just of the object being enumerated, but also properties it inherits from the prototype of other objects.
var myObject = {foo: 'bar'};
for (var name in myObject) {
alert(name);
}
// results in a single alert of 'foo'
Object.p... |
Use a `for..in` loop to enumerate an object's properties, but be careful. The enumeration will return properties not just of the object being enumerated, but also from the prototypes of any parent objects.
var myObject = {foo: 'bar'};
for (var name in myObject) {
alert(name);
}
// resul... |
Use a `for..in` loop to enumerate an object's properties, but be careful. The enumeration will return properties not just of the object being enumerated, but also from the prototypes of any parent objects.
var myObject = {foo: 'bar'};
for (var name in myObject) {
alert(name);
}
// resul... |
LINQ to SQL: How to write a 'Like' select? |
|linq-to-sql| |
I've got the following SQL:
select * from transaction_log where stoptime like '%2008%'
How do I write this in LINQ to SQL syntax? |
It's no longer there, but a lot of the things it controlled have been moved into the registry, what exactly are you trying to do? |
**Edit: Nevermind my comment. I thought you're talking about C++. I have no idea if my post is relevant in the C# world..**
A hash-table could be a tad faster. Binary trees (that's what used in the dictionary) tend to be relative slow because of the way the memory gets accessed. This is especially true if your tree ... |
relational operator expression order |
|c#|operator| |
This is probably a silly question, but curiosity has gotten the better of me. I've been seeing code lately that seems to "reverse" the order of expressions for relational operators e.g.:
if (0 == someVariable)
As opposed to what I normally see/write:
if (someVariable == 0)
To me, the second method s... |
I use the TreeNode.Tag property to store small "controller" objects that makes up the logic. E.g.:
class TreeNodeController {
Entity data;
virtual bool IsReadOnly { get; }
virtual bool CanDrop(TreeNodeController source, DragDropEffects effect);
virtual bool CanDrop(DataInfoObje... |
As with all performance questions, the answer will depend on your particular configuration (in particular the XSLT processor you're using) and the kind of processing that you're doing.
`<xsl:apply-templates>` takes a sequence of nodes and goes through them one by one. For each, it locates the template with the highe... |
TileBrush for SIlverlight 2? |