instruction stringlengths 0 30k ⌀ |
|---|
For me it depends. When I'm learning a new technology stack or API I'll typically break out Reflector, and my usage of it goes up.
For instance I recently started working with the Commerce Server 2007 API. I found much of the documentation around the Profile System incomplete or lacking in sufficient detail for my... |
For me it depends. When I'm learning a new technology stack or API I'll typically break out Reflector, and my usage of it goes up.
For instance I recently started working with the Commerce Server 2007 API. I found much of the documentation around the Profile System incomplete or lacking in sufficient detail for my... |
Yes, but EJB were stupidly complex for most use cases. Very clever, but real overkill in most cases. Hence the lightweight approach taken now-a-days.
Justin |
Is there memset() that accepts integers larger than char? |
|c| |
Is there a version of memset() which sets a value that is larger than 1 byte (char)? For example, let's say we have a memset32() function, so using it we can do the following:
int32_t array[10];
memset32(array, 0xDEADBEEF, sizeof(array));
This will set the value 0xDEADBEEF in all the elements of array. C... |
Subversion: Moving Directories with History |
|subversion|svn| |
I have a SVN structure like this:
/Projects
/Project1
/Project2
/someFolder
/Project3
/Project4
Now, i would like to move all the projects into the /Projects folder, which means I want to move Projects 3 and 4 from /someFolder into the /projects folder.
The caveat: ... |
|svn| |
Can be a bit more specific? I cant get your question- by template you means render :view, the layout? or only when called with render :template? |
Can be a bit more specific? I cant get your question- by template you means render :view, the layout? or only when called with render :template?
Rendering a page? render :action=>:new is a page too... Can you be a bit more specific on which you want to capture and which you want to exclude?
Saw the accepted answe... |
I have been wanting more info on ddwrt as well. The most information I have been able to find is from Serge van den Oever that was later turned into the MSDN article referenced in the previous answer.
http://weblogs.asp.net/soever/archive/2005/01/03/345535.aspx
As he noted in his blog post, this article contains... |
The fact that it is adding two records to the table looks like you are missing an [inverse attribute][1]. Since both the person and the group are being changed, NHibernate is persisting the relation twice (once for each object). The inverse attribute is specifically for avoiding this.
I'm not sure about how to add i... |
At the application layer (using a Berkeley socket style API) you just watch the clock, and read or write data at the rate you want to limit at.
If you only read 10kbps on average, but the source is sending more than that, then eventually all the buffers between it and you will fill up. TCP/IP allows for this, and th... |
The best way is to find a version of the Markdown library ported to whatever language you are using (you did not specify in your question).
Voting down because this is a completely pointless question along the lines of "what do I use to brush paint onto a wall?" |
The best way is to find a version of the Markdown library ported to whatever language you are using (you did not specify in your question).
Voting down because this is a completely pointless question along the lines of "what do I use to brush paint onto a wall?"
----------
Now that you have clarified that yo... |
The best way is to find a version of the Markdown library ported to whatever language you are using (you did not specify in your question).
----------
Now that you have clarified that you only want STRONG and EM to be processed, and that you are using C#, I recommend you take a look at [Markdown.NET][1] to see ho... |
Create custom code snippet in Visual Studio 2008 |
|visual-studio-2008|code-snippets| |
Like the title says, how do you create custom code snippets in Visual Studio 2008? |
Pragma No-Cache on the page hosting the silverlight application will prevent the the browser from caching the xap, instead it will read it by streaming from the web server. That will make it harder for peeps to get the xap. Obfuscation will make it harder still.
|
Pragma No-Cache on the page hosting the silverlight application will prevent the the browser from caching the xap, instead it will read it by streaming from the web server. That will make it harder for peeps to get the xap. Obfuscation will make it harder still.
Also make sure the app is hosted in https, have auth... |
If you want it to be accurate, you need a library made to deal with big numbers. Java has BigInt that will always be accurate no matter how many digits you want to take it to, and provides math operations on them. All the source code is included, you could transfer it, but this really isn't the kind of thing C++ is b... |
+1 on the answers provided by Joe and Steve.. I would also mention that it is important to set up your ignore lists or SVN Props so that you don't check in user files, resharper setting.
Also make sure you include everything that may be needed for the build, such as build scripts, 3rd party assemblies, external tool... |
I would encourage you to check out <a href="http://www.linqpad.net/">LinqPad</a> as a learning tool. It's a standalone application that lets you play with Linq queries without worrying about getting it to run on a server. |
How do I use timezones with a datetime object in python? |
|python|datetime|timezone| |
How do I properly represent a different timezone in my timezone? The below example only works because I know that EDT is one hour ahead of me, so I can uncomment the subtraction of myTimeZone()
import datetime, re
from datetime import tzinfo
class myTimeZone(tzinfo):
"""docstring for myTime... |
First of all check this:
http://technet.microsoft.com/en-us/library/ms180175(SQL.90).aspx
You will see that CI specifies case-insensitive and CS specifies case-sensitive. |
GWT is a wonderful framework with lots of potential. Keep in mind that it's still quite new, though. There are some unresolved bugs that can really annoy you, and they usually require ugly workarounds to get past. The community is great but you'll probably end up with a few problems sooner or later that Google can't an... |
Check out the Windows Presentation Foundation ([WPF](http://en.wikipedia.org/wiki/Windows_Presentation_Foundation)). It uses XML ([XAML](http://en.wikipedia.org/wiki/Extensible_Application_Markup_Language)) to define the interface and it is therefore quite easy to create an interface which would be easy to use with the... |
Within Forms you can refer to the parameters p1 an p2 as follows:
- :PARAMETER.p1
- :PARAMETER.p2
e.g.
if :PARAMETER.p1 = 'something' then
do_something;
end if;
|
What is the fastest way (in theory at least) to sort a heap? |
|sorting|heap| |
A heap is a list where the following applies:
l[i] <= l[2*i] && l[i] <= [2*i+1]
for `0 <= i < len(list)`
I'm looking for in-place sorting. |
This is pseudocode. You'll need 400MB (for ints) or 800MB (for bigints) temporary file (you can compress it with zlib if it is a problem). It will need about 100 scans of a table for vacuums. But it will not bloat a table more than 1% (at most 1000000 dead rows at any time). You can also trade less scans for more table... |
From [here][1]:
a || (b && c)
This is the default precedence.
[1]: http://www.difranco.net/cop2220/op-prec.htm
|
One thing that should be noted is that virtual function call cost can vary from one platform to another. On consoles they may be more noticeable, as usually vtable call means a cache miss and can screw branch prediction. |
|clickonce| |
Some may disagree but I think experience is key to being an expert in any language. I know plenty of people who've past the certification test but couldn't apply their knowledge to anything practical in the real world.
So I think overall being an expert is a product of having enough knowledge on a given subject (C) ... |
All fonts don't have data for all the glyphs that can be expressed in unicode. You'll have to locate a suitable font which has the subset you want. |
All fonts don't have data for all the glyphs that can be expressed in unicode. You´ll have to locate a suitable font which has the subset you want.
edit: Just to clarify, there *are* fonts which cover the full unicode range, but the one you´re using now isn´t one of them. |
Since it sounds like you don't have properly versioned resources, have you tried changing the REINSTALLMODE property?
IIRC, in the default value of 'omus', it's the 'o' flag that's only allowing you to install if you have an older version. You may try changing this from 'o' to 'e'. Be warned that this will overwri... |
Backwards compatibility is a big one. With C, it was assumed that you were paying enough attention to the size of your datatypes that if an over/underflow occurred, that that was what you wanted. Then with C++, C# and Java, very little changed with how the "built-in" data types worked. |
Even though mathematical sets do contain unique items, you can run into the problem of duplicate items in 'sets' in the real world of programming. See [this thread][1] on Lisp unions for an example.
[1]: http://groups.google.com/group/comp.lang.lisp/browse_thread/thread/49b04522abaf7f7b/7948ffb8a3acf0f5?lnk=gst... |
Mastery of pointers.
|
To someone less skilled than you, you're an expert.
To someone more skilled than you, you're a newbie. |
PHP/JS - Create thumbnails on the fly or store as files |
|javascript|php|image|image-manipulation|thumbnails| |
For an image hosting web application:
For my stored images, is it feasible to create thumbnails on the fly using PHP (or whatever), or should I save 1 or more different sized thumbnails to disk and just load those? Please explain your reasoning.
Any help is appreciated, thanks. |
Disappearing checkbox label in ASP.Net 3.5 DetailsView control |
|asp.net|webforms|checkbox|detailsview| |
I have a web form with a button and a DetailsView control on it. In the button's click event I change the DetailsView control to insert mode so I can add records:
DetailsView1.ChangeMode(DetailsViewMode.Insert)
Everything works fine, except for a checkbox in the DetailsView. When the DetailsView goes into insert ... |
I came across the following [post][1] that recommends to not do this. In my case though I am looking to keep it simple, but thought I would post this per [jop's][2] recommendation in case someone else wanted to do this.
[1]: http://kore-nordmann.de/blog/do_NOT_parse_using_regexp.html
[2]: http://stackoverflo... |
Have you tried the gvim OLE package? I have used it with previous versions of Visual Studio and it worked okay.
http://www.vim.org/download.php#pc -- gvim##ole.zip
A GUI version with OLE support. This offers a few extra features, such as integration with Visual Developer Studio. But it uses quite a bit more mem... |
dllexport/dllimport works, place it before your class name in the header file and you're good to go.
Typically you want to use dllexport in the dll, and dllimport in the exe (but you can just use dllexport everywhere and it works, doing it 'right' makes it tinily faster to load).
Obviously that is for link-time c... |
Are you forced into the synchronous solution you are using now, or is an asynchronous solution an option as well? I recall Firefox has had it's share of problems with synchronous calls in the past, and I don't know how much of that is still carried with it. I have seen situations where the entire Firefox interface woul... |
Why does Rails cache view files when hosted on VM and codebase on Samba share |
I have the following setup:
- Code on my local machine (OS X) shared as a Samba share
- A Ubuntu VM running within Parallels, mounts the share
Running Rails (either via Mongrel, WEBrick or passenger) in development mode, if I make changes to my views they don't update without me having to kick the server. I'... |
I have the following setup:
- Code on my local machine (OS X) shared as a Samba share
- A Ubuntu VM running within Parallels, mounts the share
Running Rails 2.1 (either via Mongrel, WEBrick or passenger) in development mode, if I make changes to my views they don't update without me having to kick the server... |
I have the following setup:
- Code on my local machine (OS X) shared as a Samba share
- A Ubuntu VM running within Parallels, mounts the share
Running Rails 2.1 (either via Mongrel, WEBrick or passenger) in development mode, if I make changes to my views they don't update without me having to kick the server... |
If you're not bothered about the overhead of creating a temp array, you could do it like this:
ArrayList list = new ArrayList(new string[] {"foo", "bar"}); |
I assume you're not using C# 3.0, which has collection initializers. If you're not bothered about the overhead of creating a temp array, you could do it like this in 1.1/2.0:
ArrayList list = new ArrayList(new string[] {"foo", "bar"}); |
I assume you're not using C# 3.0, which has collection initializers. If you're not bothered about the overhead of creating a temp array, you could do it like this in 1.1/2.0:
ArrayList list = new ArrayList(new object[] { 1, 2, 3, "string1", "string2"}); |
@Dean
> There are only two buttons in the dialog box: "Save File" and "Cancel". The "Open with" option is not there at all.
> But I think I know what you mean. Sometimes, the "Open with" option is grayed out and only becomes available a moment later. Unfortunately that's not the case here.
If _Open With_ is no... |
I use the Spring Framework to manage my singletons. It doesn't enforce the "singleton-ness" of the class (which you can't really do anyway if there are multiple class loaders involved) but provides a really easy way to build and configure different factories for creating different types of objects. |
probably should read Scott Guthries series of articles on LINQ:
Here are links to the various 8 parts. you will need framework 3.5 if I am not mistaken to make this work.
The series with detailed step by step instructions starts here: [Part 1][1]
[1]: http://weblogs.asp.net/scottgu/archive/2007/05/19/using-l... |
You could use uints:
uint alwaysPositive = (uint)(largeValue1 + largeValue2) / 2; |
http://msdn.microsoft.com/en-us/vbasic/bb973770.aspx |
You actually only need .net 3.5 on the development machine. If you have 2.0 SP1 on the server, and you set all the .net references in your project of version 3.5.0.0 to "copy local", you can run a 3.5 executable on a 2.0 machine.
![makeitlooklikethis][1]
As a side note, you may have to delete the yourexecutab... |
@mathieu, thanks so much for your code. I modified it somewhat in order to compile:
public class IntArrayConverter : System.ComponentModel.TypeConverter
{
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, Type sourceType)
{
return sourceType == type... |
The Python standard library doesn't contain timezone information, because unfortunately timezone data changes a lot faster than Python. You need a third-party module for this; the usual choice is [pytz][1]
[1]: http://pytz.sourceforge.net |
VxWorks' pipe mechanism is **not** stream based (unlike unix named pipes).
It is a layer on top of the vxWorks message Queue facility. As such, it has the same limitations as a message queue: when reading from the pipe, you are really reading the entire message. If your receive buffer does not have enough space to ... |
You need to add the following:
extern "C"
{
...
}
to avoid function mangling.
you might consider writing two simple C functions:
SomeClass CreateObjectInstace()
{
return new SomeClass();
}
void ReleaseObject(SomeClass someClass)
{
delete someClass;
... |
I normally declare an interface base class, use this declaration in my application, then use LoadLibrary, GetProcAddress to get the factory function. The factor always returns pointer of the interface type.
|
I normally declare an interface base class, use this declaration in my application, then use LoadLibrary, GetProcAddress to get the factory function. The factor always returns pointer of the interface type.
Here is a practical example, [exporting an MFC document/view from a DLL][1], dynamically loaded
[1]: ht... |
Found the solution at http://www.codeproject.com/KB/DLL/XDllPt4.aspx
Thanks for your efforts guys & girls |
Check out [this question][1]. Basically, there are two ways. You can mark the class using _dllexport and then link with the import library, and the DLL will be loaded automatically. Or if you want to load the DLL dynamically yourself, you can use the factory function idea that @titanae suggested
[1]: http://stac... |
In need for a site, which explains how to use PHPUnit |
|php|unit-testing|framework|zend|phpunit| |
I am searching for a tutorial (optimaly with Zend Framework) on how to use PHPUnit.
I have found a couple on google but have not quiet understood it yet. |
recommended for Windows Programmer, [Programming Windows][1]
[1]: http://www.amazon.com/Programming-Windows%C2%AE-Fifth-Microsoft/dp/157231995X/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1221998864&sr=8-1 |
It is a good agile practice to think just like that. There is also something called Test-Driven-Development, that helps you get software without bugs (almost), but also have that side effect that NOTHING is implemented that you don't use.
A example is you're own collection class. If you only are needing a Add method... |
You can make a desktop application using XML and javascript (and/or VBS) using the Windows Script host.
The trick is to save your XML file with a `.hta` extension. [See this reference][1].
[1]: http://msdn.microsoft.com/en-us/library/ms536496.aspx |
Thanks. I read this as there not being any easy formula. :-(
(My app is an HTML5 validator. Sometimes it is clearly waiting on external servers. However, it's hard to pinpoint when it's actually CPU-bound either on its own or through the garbage collector.) |
How to retrieve all keys (or values) from a std::map? |
|c++|map| |
This is one of the possible ways I come out:
struct RetrieveKey
{
template <typename T>
typename T::first_type operator()(T keyValuePair) const
{
return keyValuePair.first;
}
};
map<int, int> m;
vector<int> keys;
// Retrieve all keys
... |
|c++|stl| |
Try ***complete -r cd*** to remove the special programmatic completion function that many Linux distributions install for the `cd` command. The function adds searching a list of of directories specified in the CDPATH variable to tab completions for `cd`, but at the expense of breaking the default completion behavior.
... |
Well, you can run 'svn info' to determine the current revision number, and you could probably extract that pretty easily with a regex, like "Revision: ([0-9]+)". |
What you want is [Minify][1]. I just wrote a [walkthrough][2] for setting it up.
[1]: http://code.google.com/p/minify/
[2]: http://mrclay.org/index.php/2008/09/19/minify-21-on-mrclayorg/ |
Feedback on using Google App Engine? |
|python|django|google-app-engine| |
Looking to do a very small, quick 'n dirty side project. I like the fact that the Google App Engine is running on Python with Django built right in - gives me an excuse to try that platform... but my question is this:
Has anyone made use of the app engine for anything other than a toy problem? I see some good exampl... |
The short answer is that it's not possible to construct a single regex to satisfy your problem. Ruby 1.8 does not have lookaround assertions (the (?<! stuff in your example regex) which is why your regex doesn't work. This leaves you with two options.
1) Use more than one regex to do it.
def is_first_rar(... |
Do some research to see if your language has some kind of automated fuzz testing framework. If it does, just hook that into your test :)
You can also look into mutation testing ([Jester](http://jester.sourceforge.net/) for Java, [Heckle](http://glu.ttono.us/articles/2006/12/19/tormenting-your-tests-with-heckle) for ... |
You can also look into mutation testing ([Jester](http://jester.sourceforge.net/) for Java, [Heckle](http://glu.ttono.us/articles/2006/12/19/tormenting-your-tests-with-heckle) for Ruby) |
This is what you get when C++ meets Reflection:

Whatever you choose, it'll probably have horrible macros, hard to debug code or weird build steps. I've seen one system automatically ... |