instruction stringlengths 0 30k ⌀ |
|---|
Yes, it does *just* save code. It's miles easier to read when you have loads of them. There quicker to write and easier to maintain. Saving code is always a good goal.
You can set different scopes:
Public string PropertyName { get; private set; }
So you don't lose any functionality. |
Yes, it does *just* save code. It's miles easier to read when you have loads of them. They're quicker to write and easier to maintain. Saving code is always a good goal.
You can set different scopes:
Public string PropertyName { get; private set; }
So you don't lose any functionality. |
I've used rsync scripts with good success for this type of work, 1000's of machines in our case. I believe there is an rsync server for windows, but I have not used it on anything other than Linux. |
The main difference between Date and Calendar is, that Date is just a value object with no methods to modify it. So it is designed for storing a date/time information somewhere. If you use a Calendar object, you could modify it after it is set to a persistent entity that performs some business logic with the date/time ... |
The short answer to your question is, "It doesn't." OpenID deliberately provides only a mechanism for having a centralized authentication site; it's up to you to decide which OpenID providers you personally consider acceptable. For example, Microsoft [recently decided to allow OpenID on its Healthvault site only from ... |
If you're working on Oracle, inside your stored procedure use the TRUNC function on the datetime. This will return ONLY the date portion. |
The 1337 set of comics from xkcd, starting with:
![The main thing I love is the thought of Stallman engaging RIAA agents in sword fights towards the end :)][1]
[1]: http://imgs.xkcd.com/comics/1337_part_1.png
|
We use ROBOCOPY in my organization to pass files around. It runs very seamlessly and I feel it worth a recommendation.
Additionally, you are not doing anything too crazy. If you are also proficient in perl, I am sure you could write a quick script that will fulfill your needs. |
Automatically creating a VMWare image |
|vmware|vmware-server| |
I want to be able to create a VMWare image, by specifying the components that should go into it, preferably in a script, and then get VMWare, or some third process, to build the machine from the specs.
So I want to be able to say eg.
OS - Windows 2003, Apps - Visual Studio etc, and then it builds the machine automa... |
In general I wouldn't care about Windows 2000 any more as even Microsoft has begun to stop support for it. For Windows XP [this article on MSDN][1] might help you.
[1]: http://msdn.microsoft.com/en-us/library/ms997636.aspx |
It is not possible. It would only be relevant if you were looking at listing files or pre-processor output.
A common technique in writing macros so that they are easier to read is to use the \ character to continue the macro onto a following line.
I (believe I) have seen compilers that include new lines in the e... |
Best way to store event times in (My)SQL database |
|mysql|time| |
I'm trying to decide on the best way to store event times in a MySQL database. These should be as flexible as possible and be able to represent "single events" (starts at a certain time, does not necessarily need an end time), "all day" and "multi day" events, repeating events, repeating all day events, possibly "3rd S... |
It very much depends on your requirements. For instance, <a href="http://lenya.apache.org/">Apache Lenya</a> is very complete, but that also makes it large and more complicated. If you don't require most of their functionality, you may be better of with a smaller cms. |
I guess, the WM_NCPAINT is sent always with the assumption that the border needs to be repainted as well!
|
Try this:
<xs:choise>
<xs:sequence>
<xs:element name="Elem1" />
<xs:element name="Elem2" minOccurs="0" />
<xs:element name="Elem3" minOccurs="0" />
</xs:sequence>
<xs:sequence>
<xs:element name="Elem2" />
<xs:element name="Elem3" minOccurs="0" />
... |
Try this:
<xs:choise>
<xs:sequence>
<xs:element name="Elem1" />
<xs:element name="Elem2" minOccurs="0" />
<xs:element name="Elem3" minOccurs="0" />
</xs:sequence>
<xs:sequence>
<xs:element name="Elem2" />
<xs:element name="Elem3" minOccurs="0" />
... |
The way of finding the right number of requests is load testing. That is, measuring changes in throughput under load when you vary the request number. Any significant change would require retesting. But I suspect most folks are going to baulk at that amount of work.
I think a good rule of thumb is about 8 threads ... |
The way of finding the right number of requests is load testing. That is, measuring changes in throughput under load when you vary the request number. Any significant change would require retesting. But I suspect most folks are going to baulk at that amount of work.
I think a good rule of thumb is about 8 threads ... |
The way of finding the right number of requests is load testing. That is, measuring changes in throughput under load when you vary the request number. Any significant change would require retesting. But I suspect most folks are going to baulk at that amount of work.
I think a good rule of thumb is about 8 threads ... |
This will open a second cmd.exe window. If you want it to go away, replace the /K with /C.
Obviously, replace new\_file\_loc with whatever your new file location will be.
@echo off
for /F %%i in ('dir /B /O:-D *.txt') do (
call :open "%%i"
exit /B 0
)
:open
start "wi... |
I don't understand std::tr1::unordered_map |
|c++|unordered-map| |
I need an associative container that makes me index a certain object through a string, but that also keeps the order of insertion, so I can look for a specific object by its name or just iterate on it and retrieve objects in the same order I inserted them.
I think this [hybrid of linked list and hash map][1] should ... |
|c++|tr1|unordered-map| |
I need an associative container that makes me index a certain object through a string, but that also keeps the order of insertion, so I can look for a specific object by its name or just iterate on it and retrieve objects in the same order I inserted them.
I think this [hybrid of linked list and hash map][1] should ... |
In your package explorer, pull down the menu and select "Filters ...". You can adjust what types of files are shown/hidden there.
Looking at my Red Hat Developer Studio (approximately Eclipse 3.2), I see that the top item in the list is ".* resources" and it is excluded by default. |
Well, Haml performance continues to improve with each release. Is it at an acceptable place at the current time? That's for you to decide (I'm inclined to say "Yes", but it's your choice based on your needs). If you like the templates and the readability they provide, then the performance drop (however negligible) shou... |
Comparing std::tr1::function<> objects |
|c++|function|tr1| |
I've been trying to implement a C#-like event system in C++ with the tr1 function templates used to store a function that handles the event.
I created a vector so that multiple listeners can be attached to this event, i.e.:
vector< function<void (int)> > listenerList;
I'd like to be able to remove a hand... |
I've been trying to implement a C#-like event system in C++ with the tr1 function templates used to store a function that handles the event.
I created a vector so that multiple listeners can be attached to this event, i.e.:
vector< function<void (int)> > listenerList;
I'd like to be able to remove a hand... |
One final one - in ruby you can use any character you want to delimit strings. Take the following code:
message = "My message"
contrived_example = "<div id=\"contrived\">#{message}</div>"
If you don't want to escape the double-quotes within the string, you can simply use a different delimiter:
co... |
The Algorithms book from Robert Sedgewick. A must-read for application developers.
Comes in many flavours (C, C++, Java)
http://www.cs.princeton.edu/~rs/
|
Consult http://msdn.microsoft.com/en-us/library/ms178606.aspx for specifics regarding configuring cache. |
If you have a key, they can monitor your usage and make sure that everything is copacetic -- you are below request limit, etc. They can separate their stats on regular vs API usage. If they are having response time issues, they can make response a bit slower to API users in order to keep the main website responding qu... |
I attach the documentation page from MS, and if you follow all the steps you should get it up and running in no time.
http://msdn.microsoft.com/en-us/library/bb203872(MSDN.9).aspx
To sum it up - you need to create and effect file (combined of the code above which is indeed correct for your purposes), , add it to ... |
I attach the documentation page from MS, and if you follow all the steps you should get it up and running in no time.
http://msdn.microsoft.com/en-us/library/bb203872(MSDN.9).aspx
To sum it up - you need to create and effect file (combined of the code above which is indeed correct for your purposes), , add it to ... |
I have considered what you are suggesting but have not had a client project yet to try it. The closest actually is a shopping list that you can find here...
http://www.scottcommonsense.com/toolbox.aspx
Click on Grocery Checklist to open the window. It does use ASPX, but only to manage the JS references placed on ... |
I have considered what you are suggesting but have not had a client project yet to try it. The closest actually is a shopping list that you can find here...
http://www.scottcommonsense.com/toolbox.aspx
Click on Grocery Checklist to open the window. It does use ASPX, but only to manage the JS references placed on ... |
|c++|boost|google-chrome|portability|robust| |
We are producing a portable code (win+macOs) and we are looking at how to make the code more rubust as it crashes every so often... (overflows or bad initializations usually) :-(
I was reading that Google Chrome uses a process for every tab so if something goes wrong then the program does not crash compleatelly, onl... |
The compilers can be used from command line (or makefiles) just like any other compilers. The main things you need to take care of are the INCLUDE and LIB environment variables, and PATH. If you're running from cmd.exe, you can just run this .bat to set the environment:
<blockquote><tt>C:\Program Files\Microsoft... |
The compilers can be used from command line (or makefiles) just like any other compilers. The main things you need to take care of are the INCLUDE and LIB environment variables, and PATH. If you're running from cmd.exe, you can just run this .bat to set the environment:
<blockquote><tt>C:\Program Files\Microsoft... |
IE control is actually ActiveX component - so it can be wrapped in .Net component. It is not real IE, it's mainly only its rendering engine (HTML+CSS+JS) plus web client (HTTP and some more protocols) Control itself has no menu, bookmarks etc. Chrome is full featured browser. So you should be asking for WebKit (renderi... |
If it's something where you populate the list once and then do many lookups (thousands or more) then you could create some kind of lookup dictionary that maps starts with/ends with values to their actual values. That would be a fast lookup, but would use much more memory. If you aren't doing that many lookups or know... |
I would do something like:
void GetsCalledALot(int* data1, int* data2, int count)
{
const size_t mvSize = memberVector.size();
memberVector.reserve(mvSize + count);
for (int i = 0; i < count; ++i) {
memberVector.push_back(MyType(data1[i], data2[i]));
}
}
You ne... |
Can I get calling instance from within method via reflection/diagnostics? |
|c#|.net|reflection| |
Is there any way via System.Reflection, System.Diagnostics or other to get a reference to the actual instance that is calling a static method without passing it in to the method itself.
For example, something along these lines
class A
{
public void DoSomething()
{
StaticClass.E... |
Is there any way via System.Reflection, System.Diagnostics or other to get a reference to the actual instance that is calling a static method without passing it in to the method itself.
For example, something along these lines
class A
{
public void DoSomething()
{
StaticClass.E... |
Modal dialogs in IE gets hidden behind IE if user clicks on IE pane |
|java|swing|internet-explorer|applet|modal-dialog| |
I have to write an applet that brings up a password dialog. The problem is that dialog is set to be always on top but when user clicks on IE window dialog gets hidden behind IE window nevertheless. And since dialog is modal and holds **all** IE threads IE pane does not refresh and dialog window is still painted on top ... |
I have to write an applet that brings up a password dialog. The problem is that dialog is set to be always on top but when user clicks on IE window dialog gets hidden behind IE window nevertheless. And since dialog is modal and holds **all** IE threads IE pane does not refresh and dialog window is still painted on top ... |
I use nxml-mode in GNU Emacs for editing xml, including very big files. And i use it for a long time - it quick, provide on-the-fly validation of xml , and provide completion functionality for tag & attributes names |
frameworks are not evil. even the java sdk is a framework.
what they propably fight is *framework proliferation*. you shouln't bring a framework to a project just for the kick of it, it should bring consistant value in a reasonable time. every framework requires a learning curve, but should reward you with increased... |
If you find yourself using "Close all but this" too often, you can also try Tools \ Options \ Environment \ Documents \ [x] Reuse current document window, if saved. Combined with ReSharper's Recent Edits (ctrl-, or ctrl-e depending on keymap) you can avoid having too much open documents all the time and still quickly n... |
I've been trying to implement a C#-like event system in C++ with the tr1 function templates used to store a function that handles the event.
I created a vector so that multiple listeners can be attached to this event, i.e.:
vector< function<void (int)> > listenerList;
I'd like to be able to remove a hand... |
In the package explorer, in the upper right corner of the view, there is a little down arrow. Tool tip will say view menu.
Click that, Select Filters. uncheck .* resources.
So Package Explorer -> View Menu -> Filters -> uncheck .* resources. |
Haml rocks. I haven't seen any recent performance numbers but it is pretty close to ERB these days. I think that it might be faster if you turn on ugly mode (which prevents the pretty indentation) We're doing 2.8 million pageviews a day with Haml.
There is a benchmarker checked into the Haml source tree:
[http://g... |
Haml rocks. I haven't seen any recent performance numbers but it is pretty close to erb these days. I think that it might be faster than erb if you turn on ugly mode (which prevents the pretty indentation) We're doing 2.8 million pageviews a day with Haml.
There is a benchmarker checked into the Haml source tree:
... |
[Yahoo! Maps Web Services - Geocoding API][1]
[1]: http://developer.yahoo.com/maps/rest/V1/geocode.html |
How to Sort a DataView with ICompare |
|dataview|icompare|.net| |
My DataView is acting funny and it is sorting things alphabetically and I need it to sort things numerically. I have looked all across the web for this one and found many ideas on how to sort it with ICompare, but nothing really solid.
So my questions are
1. How do I implement ICompare on a DataView (Looking f... |
|dataview|icomparable|.net| |
I agree with foxxtrot, you want to use the web.config and add in a appsetting or two to hold the values.
Then for the implementation on checking, yes, simply use an if to see if you need to do the action. I highly recommend centralizing your logging classes to prevent duplication of code. |
You could use a dependency injection container and have it load different logging and caching objects based on configuration. If you wanted to enable logging, you would specify an active Logging object/provider in config; if you wanted to then disable it, you could have the DI inject a "dummy" logging provider that di... |
I tried to recreate the problem you describe. Here is what I found.
- Could consistently recreate the
problem using Excel 2003 on Windows
XP when saving as an XML
spreadsheet.
- Could **not** reproduce the problem
using Excel 2003 on Windows XP when
saving as a standard xls
sprea... |
DataGridView : How to can I do multimine data entry in a usable way? |
|winforms|datagridview| |
With the DataGridView it is possible to display cells containing some long text. The grid just increases the row height to display all the text, taking care of word wrap and linefeeds.
Data entry is possible as well. Control+Return inserts a line feed.
But: if the cell only has one line of text initially, the row h... |
DataGridView : How to can I do multiline data entry in a usable way? |
It doesn't matter what the "to" type is, what is important is that you recognize that this message, in this context, is reporting that the utilsMemberFunc declaration was not found and due to objective-c's dynamic binding it is assuming it returns an objc_object* rather than the type that utilsMemberFunc was declared t... |
Here's a great SQL Server article:
http://www.sql-server-performance.com/tips/optimizing_indexes_general_p1.aspx
Although the mechanics won't work on Oracle, the tips are very apropos (minus the thing on clustered indexes, which don't quite work the same way in Oracle). |
How do you know what a good index is? |
|oracle-database|database|indexes| |
When working with tables in Oracle, how do you know when you are setting up a good index versus a bad index? |
|database|oracle-database|indexing| |
import sys
sys.exit()
details from the <a href="http://docs.python.org/lib/module-sys.html">sys module documentation</a>:
> exit([arg])
>
> Exit from Python. This is
>implemented by raising the SystemExit
> exception, so cleanup actions
> specified by finally clauses of try
> statements are hon... |
import sys
sys.exit()
details from the <a href="http://docs.python.org/lib/module-sys.html">sys module documentation</a>:
> exit([arg])
>
> Exit from Python. This is
>implemented by raising the SystemExit
> exception, so cleanup actions
> specified by finally clauses of try
> statements are hon... |
We don't have a formal policy in my team - mostly because there is just so much work to do that justifying it would be hard. Which is pretty ironic.
I've started doing some formal things in the guise of "Development Meetings" in order to at least inject the essence of this into the team. An example of this is a de... |
Findbugs saved me doing something silly twice today.
[http://findbugs.sourceforge.net/][1]
[1]: http://findbugs.sourceforge.net/ |
Any custom control (composite, not inherited) in winforms can be docked, because it's really just a panel underneath. Combine this with a tablelayout panel for the high-level layout of your form and you have all the pieces. But you still have to implement all the glue and supporting UI yourself. |
//proof code
class Test
{
public static void main(String args[])
{
System.out.println(Test.test());
}
public static int test()
{
try {
return 0;
}
catch (Exception e) {
return 1;
}
... |
//proof code
class Test
{
public static void main(String args[])
{
System.out.println(Test.test());
}
public static int test()
{
try {
return 0;
}
finally {
System.out.println("finally trumps return.");
... |
I had a similar issue with a localization component that I wrote. My component is designed to access localized messages with enum constants that index into a resource bundle, not a hard problem.
I found that I was copying and pasting the same "template" enum code all over the place. My solution to avoid the duplicat... |
I had a similar issue with a localization component that I wrote. My component is designed to access localized messages with enum constants that index into a resource bundle, not a hard problem.
I found that I was copying and pasting the same "template" enum code all over the place. My solution to avoid the duplicat... |
In the bug report that you linked to, they also mention a workaround.
It seems to come down to calling the methods in a specific order.
Have you tried that?
> A DESCRIPTION OF THE PROBLEM :
There appears to be an undocumented bad intereaction between
explicitely setting the UI and removing all file filters, even... |
Looking for C# HTML parser |
|c#|html|parsers| |
I would like to extract the structure of the HTML document - so the tags are more important than the content. Ideally, it would be able to cope reasonably with badly-formed HTML to some extent also.
Anyone know of a reliable and efficient parser? |
I'd also prefer [XStream][1] as it is really easy to use and to extend. You can quickly start if you're going with the default setup. If you need to customize the behavior it has a very clean API and a lot of extension points, so you have really fine grained control over the things you want to tweak without interfering... |
Another issue I encountered (which is defined, but definitely unexpected).
char is evil.
* signed or unsigned depending on what the compiler feels
* **not** mandated as 8 bits |
Actually GotFocus is the right evet (message really) that you are interested in, since no matter how you get to the control you’ll get this even eventually. The question is when do you call SelectAll().
Try this:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.... |
How to Naturally Sort a DataView with something like IComparable |