instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>I have an Exchange 2007 configured with ActiveSync and RPC over HTTP.</p>
<p>Here are the things that work:</p>
<ul>
<li>Outlook inside the network.</li>
<li>Mobile devices.</li>
<li>Outlook Web Access.</li>
</ul>
<p>Only thing that doesn't work is:</p>
<ul>
<li>Outlook outside of the network. </li>
</ul>
<p>Wh... | <p>Okay, found it!</p>
<p><a href="http://support.microsoft.com/kb/927612" rel="nofollow noreferrer">http://support.microsoft.com/kb/927612</a></p>
| <p>I <strong>think</strong> it's intended behavior. Outside the network, you're no longer on the domain, so the connection requires you to authenticate when you open outlook in order to connect to the right mail store.</p>
| 49,230 |
<p>Does anyone have any suggestions for a good approach to finding all the CPAN dependencies that might have arisen in a bespoke development project. As tends to be the case your local development environment rarely matches your live one and as you build more and more projects you tend to build up a local library of in... | <p>I've had this problem myself. <a href="http://search.cpan.org/perldoc?Devel::Modlist" rel="nofollow noreferrer">Devel::Modlist</a> (as suggested by <a href="https://stackoverflow.com/questions/240704/how-can-i-determine-cpan-dependencies-before-i-deploy-a-perl-project#240723">this answer</a>) takes a dynamic approa... | <p>Here is a quickie bash function (using the excellent <a href="http://petdance.com/ack/" rel="nofollow noreferrer">ack</a>):</p>
<pre><code># find-perl-module-use <directory> (lib/ by default)
function find-perl-module-use() {
dir=${1:-lib}
ack '^\s*use\s+.*;\s*$' $dir | awk '{ print $2 }' | sed 's/();... | 29,792 |
<p>What mainstream frameworks, patterns, and tools would you choose to develop two projects in parallel, one in C#, one in Java, in order to minimize the total effort. (Disregard the obvious cases of interchangeable or equivalent tools, like SCC, Unit Testing, etc. Also assume generic broad RDBMS support.)</p>
<p>"Mai... | <p>That's tough. While there are some good libraries available ported to both platforms, when it comes to frameworks, there doesn't seem to be much commonality. </p>
<p>The drift I've gotten here on SO is that there isn't much deviation from the company line in the .NET world. It would be as if everyone in Java used o... | <p>Why would you want to develop for Java and C# in parallel?</p>
<p>You could just use Java and J#. The only problem is, that J# is stuck at Java 1.4 level, so you have two choices:</p>
<ul>
<li>don't use this fancy stuff like enums, generics, for-each</li>
<li>use a tool like retroweaver to convert 1.5 back to 1.4<... | 44,028 |
<p>This is a problem I'm sure is easy to fix, but I've been banging my head on it all day.</p>
<p>I'm developing a new web site for a client. The web site resides at (this is an example) website.com. I have a PHP form script to email visitors' requests to requests@website.com.</p>
<p>When I coded this on a staging ... | <p>I think the problem is that sendmail (your process) is talking to the local sendmail daemon. The local sendmail daemon thinks that because it is website.com, it should know how to deliver the email. Unfortunately, the actual address in the to field does not exist on the web server and thus it dumps it in the "cat... | <p>Edit the tsm.cf file (in /etc/mail/ or similar) to include </p>
<pre><code>FEATURE(relay_entire_domain)
</code></pre>
<p>between the DOMAIN() and MAILER() lines. Since you're editing the file, you may want to also improve security with </p>
<pre><code>define(`confPRIVACY_FLAGS',``noexpn,novrfy'')
</code></pre>
... | 41,761 |
<p>Ok, so here's the lowdown. I want to setup a Version Control system and associated processes for my agency and want to learn from the mistakes of others before I leap into it.</p>
<p>I'm looking at deploying subversion from a remotely hosted service (assembla - which will also help with offiste code backups!).</p>
... | <p>While far from perfect, you might consider <a href="http://svnbook.red-bean.com/en/1.1/svn-book.html#svn-ch-8-sect-4" rel="nofollow noreferrer">WebDAV</a></p>
<p>See <a href="http://svnbook.red-bean.com/en/1.1/svn-book.html#svn-ap-c" rel="nofollow noreferrer">Appendix C, WebDAV and Autoversioning</a></p>
<p>Your F... | <p>PhotoShop CS and above has Version Cue which is its own inbuilt system for Version Control. I've not tried it with PhotoShop itself but have used it with limited success with GoLive.</p>
<p>Perhaps your designers would be happier to use that as it's already built into a tool their familiar with?</p>
<p>Also, your ... | 32,857 |
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="https://stackoverflow.com/questions/86582/singleton-how-should-it-be-used">Singleton: How should it be used</a> </p>
</blockquote>
<p>Following on from Ewan Makepeace 's excellent earlier question about the Singleton pattern, I thought I would as... | <p>An alternative approach would be to create an instance of your class that loads up the icons and then you pass a reference to this instance to each and every control that needs to access the resources. That way in the future you could have more than one icon loader and pass them around as needed. More flexible for t... | <p>I have actually never used a singleton, but haven't used design patterns much. I think that they ae very valuable when other patterns call for them like the Factory and Gateway patterns. However, they almost never are good all by themselves.</p>
<p>You might want to consider the <a href="http://jeremyjarrell.com/... | 16,714 |
<p>I am building authentication into a client-server application, and some of the feedback I've received is that I should leave the hash calculation to the server (it was initially implemented to have the client receive the hash, calculate a hash from the client's entered password, and compare them). That seems to mak... | <p>If you explain your application in more detail, I might find that I'm off base here, but for now I'll make some assumptions about your use case and threat model.</p>
<p>My understanding is that you have some sensitive information that you want to synchronize between a mobile device with intermittent connectivity an... | <p>I guess it may depend on your problem domain, but for a secure application, authorization cannot be done client side because of the lack of trust. In the simple case you stated where the hash computation and comparison is done client side, all that someone would have to do to get access is hook a debugger up, step ... | 27,091 |
<p>On Windows I can do <code>CreateProcess(..., CREATE_NEW_CONSOLE, ...)</code> and my child process (which is console app, not GUI) will be launched in a new window. What is the easiest way to emulate this on Mac OS?</p>
| <p><strong><code>open -a Terminal.app $(which program)</code></strong> gets a new terminal running the specified program (assuming you're using bash).</p>
<p>You can use <strong><code>execve()</code></strong> (possible after a <strong><code>fork()</code></strong>) to acheive the same thing in compiled code without kno... | <p>Marc Liyanage does this neatly with "term", osascript tell application "Terminal":<br>
<a href="http://www.entropy.ch/blog/Mac+OS+X/2005/02/28/Terminal_tricks_8220_term_8221_and_8220_clone_8221.html" rel="nofollow noreferrer">http://www.entropy.ch/blog/Mac+OS+X/2005/02/28/Terminal_tricks_8220_term_8221_and_8220_clon... | 43,162 |
<p>Where can I test HTML 5 functionality today - is there any test build of any rendering engines which would allow testing, or is it to early? I'm aware that much of the spec hasn't been finalised, but some has, and it would be good to try it out!</p>
| <p>Ones that are built using a recent webkit build, and Presto.</p>
<p>Safari 3.1 for webkit<br>
Opera for Presto.</p>
<p>I'm pretty sure firefox will start supporting html5 partially in 3.1</p>
<p>All support is extremely partial. Check <a href="http://en.wikipedia.org/wiki/Comparison_of_layout_engines_(HTML_5)" re... | <p>Opera also has some support.</p>
<p>Generally however, it is too early to test out. You'll probably have to wait a year or 2 before any browser will have enough realistic support to test against.</p>
<p><strong>EDIT</strong>
Wikipedia has a good article on <a href="http://en.wikipedia.org/wiki/Comparison_of_layout... | 18,152 |
<p>I have a custom renderer in a <code>JTable</code> to display <code>JCheckbox</code>es for <code>boolean</code>s. However, this causes a slight issue because when the user clicks in the table cell, but not in the checkbox, the checkbox is still checked.</p>
<p>Is there a way I can return the bounds of the actual <c... | <p>Changing the state of the checkbox is the responsibility of the Editor, not the Renderer. If you use <a href="http://java.sun.com/javase/6/docs/api/javax/swing/DefaultCellEditor.html" rel="nofollow noreferrer"><code>DefaultCellEditor</code></a>, you don't need to write your own code.</p>
<p>I may be wrong but I th... | <p>I actually just did similar thing this afternoon.</p>
<p>Here's my trick, for <code>JTree</code>. My checkbox is on the right most or the row.</p>
<pre><code>public void mouseClicked(MouseEvent e) {
int x = e.getX();
int y = e.getY();
int row = getRowForLocation(x, y);
Rectangle rect = getRowBounds(row);
Rectang... | 43,342 |
<p>If I have a string "12 23 34 56"</p>
<p>What's the easiest way to change it to "\x12 \x23 \x34 \x56"?</p>
| <pre><code>string s = "12 23 34 45";
stringstream str(s), out;
int val;
while(str >> val)
out << "\\x" << val << " "; // note: this puts an extra space at the very end also
// you could hack that away if you want
// here's your new string
string modified... | <p>You can do this like so:</p>
<pre><code>foreach( character in source string)
{
if
character is ' ', write ' \x' to destination string
else
write character to destination string.
}
</code></pre>
<p>I suggest using std::string but this can be done easily by first checking the string to count how many w... | 36,833 |
<p>I need to set the height of every textbox on my form, some of which are nested within other controls. I thought I could do something like this:</p>
<pre><code>private static IEnumerator<TextBox> FindTextBoxes(Control rootControl)
{
foreach (Control control in rootControl.Controls)
{
if (contr... | <p>As the compiler is telling you, you need to change your return type to IEnumerable. That is how the yield return syntax works.</p>
| <p>If you are given an enumerator, and need to use it in a for-each loop, you could use the following to wrap it:</p>
<pre>
static public class enumerationHelper
{
public class enumeratorHolder<T>
{
private T theEnumerator;
public T GetEnumerator() { return theEnumerator; }
public... | 2,548 |
<ol>
<li>You have multiple network adapters.</li>
<li>Bind a UDP socket to an local port, without specifying an address.</li>
<li>Receive packets on one of the adapters.</li>
</ol>
<p>How do you get the local ip address of the adapter which received the packet?</p>
<p>The question is, "What is the ip address from the... | <p>You could enumerate all the network adapters, get their IP addresses and compare the part covered by the subnet mask with the sender's address.</p>
<p>Like:</p>
<pre><code>IPAddress FindLocalIPAddressOfIncomingPacket( senderAddr )
{
foreach( adapter in EnumAllNetworkAdapters() )
{
adapterSubnet = a... | <pre>
ssize_t
recvfrom(int socket, void *restrict buffer, size_t length, int flags,
struct sockaddr *restrict address, socklen_t *restrict address_len);
ssize_t
recvmsg(int socket, struct msghdr *message, int flags);
[..]
If address is not a null pointer and the socket is not connection-o... | 4,975 |
<p>I have subclassed <a href="https://docs.oracle.com/javase/9/docs/api/java/awt/Frame.html" rel="nofollow noreferrer"><code>java.awt.Frame</code></a> and have overridden the <a href="https://docs.oracle.com/javase/9/docs/api/java/awt/Window.html#paint-java.awt.Graphics-" rel="nofollow noreferrer"><code>paint()</code><... | <p>For C++ only, you can make the parameter a reference</p>
<pre><code>func()
{
Object* pNext;
func1(pNext);
}
func1(Object*& pNext)
{
pNext = Segement->GetFirstPara(0);
}
</code></pre>
<p>What is going on here is the difference between passing parameters by value and passing by reference. C alway... | <p>It should be</p>
<pre><code>
func()
{
Object *pNext;
func1(&pNext);
}
void func1(Object **pNext)
{
*pNext = Segment->GetFirstPara(0);
}
</code></pre>
| 23,513 |
<p>I need to implement an OpenID Provider in .Net and wondered....Is there's any OpenSource code already written and available?</p>
| <p>I just found <a href="http://code.google.com/p/dotnetopenid/" rel="nofollow noreferrer">http://code.google.com/p/dotnetopenid/</a></p>
<p>Apologies for not search properly first.....</p>
<p>I don't seem to be able to delete this question (strange)</p>
<p>Instead, as penance, this question and answer will be marke... | <p>BTW - There is ExtremeSwank which is on Google Code too. I'd check it out also, looks like it is further along at this time.</p>
<p>I have a blog entry I'm working up that should be published, at least starting on, tomorrow. Working up a WCF OpenID Provider Implementation. <a href="http://www.adronbhall.name" re... | 31,206 |
<p><strong>Is there a better way of binding a list of base class to a UI other than downcasting e.g:</strong></p>
<pre><code>static void Main(string[] args) {
List<Animal> list = new List<Animal>();
Pig p = new Pig(5);
Dog d = new Dog("/images/dog1.jpg");
list.Add(p);
list.Add(d... | <p>When faced with this type of problem, I follow the <a href="http://en.wikipedia.org/wiki/Visitor_pattern" rel="nofollow noreferrer">visitor pattern</a>.</p>
<pre><code>interface IVisitor
{
void DoPigStuff(Piggy p);
void DoDogStuff(Doggy d);
}
class GuiVisitor : IVisitor
{
void DoPigStuff(Piggy p)
{
lab... | <p>You're not taking full advantage of your base class. If you had a virtual function in your Animal class that Dog & Pig override, you wouldn't need to cast anything.</p>
| 17,713 |
<p>I want to watch a folder tree on a network server for changes. The files all have a specific extension. There are about 200 folders in the tree and about 1200 files with the extension I am watching.</p>
<p>I can't write a service to run on the server (off-limits!) so the solution has to be local to the client. Time... | <p>From a server load point of view, using the <a href="https://learn.microsoft.com/en-us/dotnet/api/system.io.filesystemwatcher" rel="noreferrer">IO.FileSystemWatcher</a> for remote change notifications in the scenario you describe is probably the most efficient method possible. It uses the <a href="http://msdn.micros... | <p>I wouldn't think there's any sort of active state or communication between the computer with the FSW and the computer whose location is being monitored. In other words, the FSW isn't pinging the networked OS to check on the file.</p>
<p>One would imagine that a message or event is <i>only</i> raised/sent to the net... | 18,299 |
<p>I can do this:</p>
<pre><code>Dim fso As New FileSystemObject
</code></pre>
<p>or I can do this:</p>
<pre><code>Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
</code></pre>
<p>How do I know what string to use for CreateObject? For example, how would I know to use the "Scripting." part of ... | <p>It is the <a href="http://www.vbaccelerator.com/progid.htm" rel="noreferrer">ProgID</a> of the component which is registered in Windows registry under HKCR key:</p>
<pre class="lang-none prettyprint-override"><code>HKEY_CLASSES_ROOT\Scripting.FileSystemObject
</code></pre>
<p>ProgID's are human readable identifier... | <p>I would start by searching for FileSystemObject in the MSDN library at <a href="http://msdn.microsoft.com/library" rel="nofollow noreferrer">http://msdn.microsoft.com/library</a></p>
<p>The site is chock full of documentation, including the details of how to call CreateObject.</p>
| 44,908 |
<p>Is there any way to have something that looks just like a file on a Windows file share, but is really a resource served up over HTTP?</p>
<p>For context, I'm working with an old app that can only deal with files on a Windows file share, I want to create a simple HTTP-based service to serve the content of the files d... | <p>WebDAV (basically) takes an existing directory, and shares it over HTTP - which sounds like the opposite of what you want. </p>
<p>You need something that speaks SMB/CIFS on one end, and your own code on the other. The easiest way to do that is with a userspace file system.</p>
<p>To that end, here's a couple of l... | <p>This won't answer your question in any meaningful way, but maybe it will get you pointed in the right direction. Look into serving the "file(s)" via WebDAV--SharePoint uses this and its files can be accessed exactly as you want, as a file share where the transport mechanism is HTTP. Unfortunately I can't give any ... | 4,405 |
<p>There are lots of additional control "packs" (libraries) that you can enable in VB6 via Project>Components.</p>
<p>I'm trying to find good replacements for the Sheridan SScommand and SSframe controls. But I also want to find additional controls like a Tabbed dialog.</p>
<p>I'm not sure which of the ones in the lis... | <p>If you maintaining a VB6 (or VB.NET) application over the long term I strongly recommend that you minimize the use of 3rd party controls. Third Party controls are great for something one-off "right now". However for long term maintenance they are a pain to deal with as the fortunes of the 3rd party vendor cause supp... | <p>I would avoid the Sheridan SS controls from threed32.ocx. They are not <a href="http://msdn.microsoft.com/en-us/vbrun/ms788708.aspx" rel="nofollow noreferrer">supported on Vista</a>. I agree in general it's best to minimze your dependency on third-party controls as they are unlikely to still be supported by the cont... | 47,588 |
<p>I have an object that I'm passing in a method call. Say I'm using a language that only allows you to pass objects by reference, like Java or PHP. If the method makes changes to the object, it will affect the caller. I don't want this to happen. So it seems like I need to make a copy of the object.</p>
<p>My questio... | <p>Generally, the <strong>caller should make the copy if it is concerned about changes</strong>. If the caller doesn't care, <strong>the method should make the copy if it needs to do something that it knows shouldn't persist</strong>.</p>
| <p>Depends, is there any reason that the method could be called in the future where you want the change to be seen by the caller? If so then the caller should make the copy. Otherwise the callee should make it. I would say that the second case is probably more common.</p>
| 22,156 |
<p>Does anyone know of a tool to take a T-SQL query and convert it into a LINQtoSQL query?</p>
| <p>I'm sorry that I don't know of any tools to do this. If your problem is that you just don't know Linq well enough, you may want to consider this <a href="http://www.linqpad.net" rel="nofollow noreferrer">tool</a>. It will help you learn Linq and it's free (but not open source).</p>
| <p>Because of the way LINQ handles joins, that is a non-trivial problem. I actually tried in the past, but I just couldn't get the semantics right.</p>
<p>(Maybe I will try again using OSLO and MGrammar. Having a decent replacement for LEX and YACC will go a long way.)</p>
| 30,559 |
<p>So, following a tutorial I found on MSDN I've created what you might call an "engine" using DirectX and C#. I haven't seen a lot of this sort of thing (Personally, that is) done in C# and the majority seem to favour C/C++ so I'm curious as to whether using C# will come back to bite me, or whether I should just go ah... | <p>Well Peter, the main reason is C++ is platform agnostic, while C# isn't in the true sense, despite Mono (I don't think you can run Mono C# on most cellphones, the Nintendo DS or the Playstation3, for example).</p>
<p>Anyways most of these engines support DirectX and OpenGL, and/or software renderers, thus they are ... | <p>There are a few studios using c# for games. </p>
<p>You can also have a look at XNA, there is also a port of quake3 engine flying around the internet ported to c#. </p>
<p>So it should be ok. </p>
| 36,816 |
<p>I have a .net assembly that has a COM+ ServicedCopmonent in it and at the moment I install it into the GAC to get everything working. This means that I need to have every assembly that it references in the GAC as well.</p>
<p>During development it is quite painful to make changes to thes assemblies, re-install the... | <p>No, you don't have to install it in the GAC. You can use regsvcs (<a href="http://msdn.microsoft.com/en-us/library/04za0hca.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/04za0hca.aspx</a>) with /appdir parameter to specify explicitly where the app is located.</p>
| <p>No, they need to be registered in the Registry using the regsvcs tool. It needs to be a strongly named assembly though.</p>
| 18,911 |
<p>What is domain logic? The Wikipedia page for domain logic redirects to business logic. Are they the same thing, and, if not, how do they differ?</p>
| <p>The domain is what you are modelling.</p>
<p>If you are modelling a business problem, they are the same thing.</p>
<p>If you are modelling something else, physics for instance, there is probably no business logic in your system, but the physics parts are still domain logic.</p>
| <p>My domain is pharmaceutical. It deals in compartments, doses, differential equations, and statistics. If you want to call that my "business", then I guess it's "business logic".</p>
| 47,095 |
<p>I am doing profiling of a C code in Microsoft VS 2005 on a Intel Core-2Duo platform.
I measure the time(secs:millisecs) counsumed by my function. But i have some doubts about the accuracy of this measurement as the operating system will not continuously run my application, but instead schedule others apps/services ... | <p>@Kogus: Even if i run outside debugger(standalone app. from a command prompt) it still could be preempted by OS and cause a incorrect measurement of the time consumed by my app.</p>
<p>Is'nt it?</p>
<p>-AD</p>
| <p><strong>Suggestion</strong></p>
<p>Try run on multi CPU systems. </p>
| 7,511 |
<p>I am using SQL Server Reporting Services 2008 (though this seems to be an issue for me in 2005 also). I have a report that has one page per customer (i.e. paged on customerId). The odd thing I'm seeing is that the first report (i.e. first page of the report) has a bit of extra white space at the top than the other... | <p>There are a couple of different causes for extra space at the top of the HTML render of a page in any version of Reporting Services. There are a couple of tricks to working around this depending upon the cause of the problem:</p>
<ol>
<li><p>Move the title from the Header to the Body of the report. If the title i... | <p>I'm using Reporting Services / SSRS 2008. I have a table (tablix) with column headers and a subreport in the last row. How do I get rid of the extra space on the first page? It looks ugly when exported to Excel. I've tried moving the table immediately below the report header and it does not work. It seems to enforce... | 36,749 |
<p>I have access to an Oracle server that has some databases that I would like to access. However, the machine that I have access from has none of the oracle client software. Is there any alternative to oracle's client software the provides the functionality of something like MySQL's mysql or Postgres' psql? I'd like t... | <p>If you download the <strong>free</strong> <a href="http://www.oracle.com/technology/tech/oci/instantclient/index.html" rel="noreferrer">Oracle Instant Client</a> you'd be able to use any JDBC or ODBC Database tool such as <a href="http://www.download.com/DbVisualizer/3000-10255_4-10202406.html" rel="noreferrer">DbVi... | <p>SQLPal (<a href="http://www.sqlpal.com/" rel="nofollow noreferrer">http://www.sqlpal.com/</a>) is a lightweight SqlPlus like application for Windows that does not require the oracle client.</p>
| 24,394 |
<p>My C++ framework has Buttons. A Button derives from Control. So a function accepting a Control can take a Button as its argument. So far so good.</p>
<p>I also have List<code><</code>T>. However, List<code><</code>Button> doesn't derive from List<code><</code>Control>, which means a function accepting a li... | <p>I hate to tell you but if you're using a list of instances to Control instead of pointers to Control, your buttons will be garbage anyway (Google "object slicing"). If they're lists of pointers, then either make the <code>list<button*></code> into <code>list<control*></code> as others have suggested, or... | <p>Generally, the C++ way to write algorithms that perform on a list, sequence, ... is to provide iterators as arguments.</p>
<pre><code>template < class iterator >
doSomething(iterator beg, iterator end);
</code></pre>
<p>This solves the List< Button* > is not derived from List< Control* >. (using a temp... | 40,694 |
<p>I can read the <em>MySQL</em> documentation and it's pretty clear. But, how does one decide which character set to use? On what data does collation have an effect?</p>
<p>I'm asking for an explanation of the two and how to choose them.</p>
| <p>From MySQL <a href="http://dev.mysql.com/doc/refman/5.0/en/charset-general.html" rel="noreferrer">docs</a>: </p>
<blockquote>
<p>A <strong>character set</strong> is a set of symbols
and encodings. A <strong>collation</strong> is a set of
rules for comparing characters in a
character set. Let's make the
di... | <p>I suggest to use <code>utf8mb4_unicode_ci</code>, which is based on the Unicode standard for sorting and comparison, which sorts accurately in a very wide range of languages.</p>
| 44,353 |
<p>I had the idea of a search engine that would index web items like other search engines do now but would only store the file's title, url and a hash of the contents.</p>
<p>This way it would be easy to find items on the web if you already had them and didn't know where they came from or wanted to know all the places... | <p>Check out <a href="http://en.wikipedia.org/wiki/Locality_sensitive_hashing" rel="nofollow noreferrer">the wikipedia page on locality sensitive hashing</a>. There's also <a href="http://www.mit.edu/~andoni/LSH/" rel="nofollow noreferrer">a good page hosted by a research on MIT</a>.</p>
<p>In general, there are seve... | <p>It's not a bad idea. Sometimes I find myself stumbled upon some file trying to figure out where it comes from :) But how are you going to track item's sources? Content can be obtained by various means - web browser, download manager, simply by copying from network share.</p>
| 7,373 |
<p>I'm trying to understand a particular Perl code from <a href="http://sourceforge.net/projects/vcake" rel="nofollow noreferrer">vcake</a>. Usually I find my way around in Perl but the following statement baffles me. I suspect that this is simply an error but I'm not completely sure. The statement is:</p>
<pre><code>... | <p><code>my $numReads</code> means: Create a new local variable within the context of the <code>foreach</code> loop. Its initial value is <code>undef</code>, which in numerical context is treated as <code>0</code>.
So the code reads:</p>
<pre><code>if ((...) and (0 >= ($coverage)) ) {
}
</code></pre>
<p>which mean... | <p>One might also note that unless $set is a reference to %set, or some other hash that mimics the structure of %set, then the line</p>
<pre><code>foreach my $seq (keys %set)
</code></pre>
<p>Does not match the condition</p>
<pre><code>defined $set->{$seq}
</code></pre>
<p>Since $set->{$seq} dereferences a hash ... | 42,938 |
<p>I'm learning WPF, and seem to have found something a little odd, which I can't find the reason to anywhere I've searched.</p>
<p>I have a window with one checkbox on it called "chkTest". I have it set to be true by default.</p>
<p>The following code is what I don't understand. Basically I'm trying to set the "ch... | <p>Bah... I think I know what to do now. I should be making my own control rather than modifying a Button. This would have been obvious to me had I been working in WinForms, but for some reason all this Xaml is making me stupid.</p>
| <p>I delaled with creating UserControl with multiple 'content slots' <a href="https://stackoverflow.com/questions/1029955/wpf-template-or-usercontrol-with-2-or-more-contentpresenters-to-present-conte">here</a> - it's better than deriving from HeaderedControl as you aren't limited in the number of slots.</p>
<p>Sample ... | 47,515 |
<p>I was reading this thread/post: <a href="https://stackoverflow.com/questions/262298/windows-c-ui-technology">https://stackoverflow.com/questions/262298/windows-c-ui-technology</a></p>
<p>and am also wondering about a non .NET UI framework. Specifically - prior to .NET having support for serial ports (I can't belie... | <p>The basic architecture of MFC hasn't really changed in the new version. If you weren't happy with the threading support previously then it's safe to say that you still won't be. I'd agree with what DavidK said - this is an inherent issue that all frameworks have to deal with. The main reason that MFC doesn't provide... | <p>use .NET gui and thread, main application code in MFC dll.</p>
<p>call it through c# delegate</p>
| 33,387 |
<p>What tools do you use for Automated Builds / Automated Deployments? Why?</p>
<p>What tools do you recommend?</p>
| <p><a href="http://hudson-ci.org/" rel="noreferrer">Hudson</a> for automated builds. I chose it because it was the easiest to setup and demo. A system that's too complex and isn't slick-looking won't impress management enough to get them on-board for automated builds. Especially in a project that has a lot of inertia.<... | <p><a href="http://ant.apache.org/" rel="nofollow noreferrer">ANT</a> for both build and deployment/installs. </p>
<p>Makes a great cross-platform installer.</p>
| 12,474 |
<p>Since generics were introduced, Class is parametrized, so that List.class produces Class<List>. This is clear.</p>
<p>What I am not able to figure out is how to get a instance of Class of type which is parametrized itself, i.e. Class<List<String>>. Like in this snippet:</p>
<pre><code>public class GenTest... | <p>The Class class is a run-time representation of a type. Since parametrized types undergo type erasure at runtime, the class object for Class would be the same as for Class<List<Integer>> and Class<List<String>>.</p>
<p>The reason you cannot instantiate them using the .class notation is that this is a sp... | <p>The only thing you can do is instantiate <code>List<String></code> <em>directly</em> and call its <code>getClass()</code>:</p>
<pre><code>instantiate(new List<String>() { ... }.getClass());
</code></pre>
<p>For types with multiple abstract methods like <code>List</code>, this is quite awkward. But unfo... | 9,711 |
<p>The <a href="https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2012/c5kehkcz(v=vs.110)" rel="noreferrer">MSDN documentation</a> says that</p>
<pre><code>public class SomeObject
{
public void SomeOperation()
{
lock(this)
{
//Access instance variables
}
}
}
</code><... | <p>It is bad form to use <code>this</code> in lock statements because it is generally out of your control who else might be locking on that object.</p>
<p>In order to properly plan parallel operations, special care should be taken to consider possible deadlock situations, and having an unknown number of lock entry poi... | <p>There will be a problem if the instance can be accessed publicly because there could be other requests that might be using the same object instance. It's better to use private/static variable.</p>
| 31,303 |
<p>You do <code>AssignProcessToJobObject</code> and it fails with "access denied" but only when you are running in the debugger. Why is this?</p>
| <p>This one puzzled me for for about 30 minutes.</p>
<p>First off, you probably need a UAC manifest embedded in your app (<a href="https://stackoverflow.com/questions/53208/how-do-i-automatically-destroy-child-processes-in-windows#53214">as suggested here</a>). Something like this:</p>
<pre><code><?xml version="1.... | <p>This seems to bite me quite often, and while good, 1800INFORMATION's post doesn't seem to include a number of reasons and fixes that seem helpful, so it seem worthwhile to post a summary of why I've seen this happen.</p>
<ol>
<li>When trying to solve this for yourself, note than this problem
can occur for different... | 11,508 |
<p>I'm wondering about the downsides of each servers in respect to a production environment. Did anyone have big problems with one of the features? Performance, etc. I also quickly took a look at the new Glassfish, does it match up the simple servlet containers (it seems to have a good management interface at least)?</... | <p>I love Jetty for its low maintenance cost. It's just unpack and it's ready to roll. Tomcat is a bit high maintenance, requires more configuration and it's heavier. Besides, Jetty's continuations are very cool.</p>
<p>EDIT: In 2013, there are reports that Tomcat has gotten easier. See comments. I haven't verified th... | <p>I like how Jetty can be embedded in an application so that it doesn't need to run in a web container (Hudson and Nexus are two apps that can run in this mode). Can Tomcat do this?</p>
| 38,920 |
<p>FindBugs has found a potential bug in my code. But it is not a bug.</p>
<p>Is it possible to mark this occurrence as 'not a bug' AND have it removed from the bug list?</p>
<p>I have documented quite clearly why for each case it is not a bug.</p>
<p>For example. A class implements the comparable interface. it has ... | <p>Instead of using filters, you can also use the <a href="http://findbugs.sourceforge.net/api/edu/umd/cs/findbugs/annotations/SuppressWarnings.html" rel="noreferrer" title="SuppressWarnings">SuppressWarnings</a> annotation. You must use the annotation out of the findbugs package, meaning you either need an import or u... | <p>on another hand - if you are using such automated code review tool that highlights potential problems according to widely known recommendations, maybe you should adhere to it's recommendations? think of people who will be maintaining code after you. </p>
<p>what if the code changes after time?</p>
| 31,023 |
<p>How would I format the standard RSS pubDate string as something closer to ASP.NET's DateTime?</p>
<p>So, from this:</p>
<p>Wed, 29 Oct 2008 14:14:48 +0000</p>
<p>to this:</p>
<p>10/29/2008 2:14 PM</p>
| <p>I have an implementation of the RSS 822 DateTime format as a an answer to the question "<a href="https://stackoverflow.com/questions/284775/how-do-i-parse-and-convert-datetimes-to-the-rfc-822-date-time-format">How do I parse and convert DateTime’s to the RFC-822 date-time format</a> that should solve your problem.</... | <p>Getting it into a DateTime will work with this, I think:</p>
<pre><code>string d = "Wed, 29 Oct 2008 14:14:48 +0000";
string RFC822 = "ddd, dd MMM yyyy HH:mm:ss zzz";
DateTime dt = DateTime.ParseExact( d, RFC822,
DateTimeFormatInfo.InvariantInfo,
... | 33,408 |
<p>So we all need to deploy our applications to real iPhones for testing purposes. I'm sure you much like me have found a group of sucke^H^H^H^H^H testers to help you out with this process. Whenever you want to send a build out to a new person this requires adding the new device id to your ad hoc provision. This par... | <p>I've done this as follows, with good success:</p>
<ul>
<li>Send out call for beta testers.</li>
<li>Respond to each with "in order to beta test, I need your UDID. You can send it to my by following these instructions..."
<ul>
<li>Folks incapable of sending UDID are told "thank you for your time, but beta is no l... | <p>I haven't been able to do this without changing the .xcodeproj file, but that's probably because I've had terrible luck getting things to work without going through the whole "build clean, deselect the provisioning profile, reselect the provisioning profile" process. </p>
| 37,647 |
<p>Is it necessary or advantageous to write custom connection pooling code when developing applications in .NET with an SQL Server database? I know that ADO.NET gives you the option to enable/disable connection pooling -- does that mean that it's built into the framework and I don't need to worry about it? Why do peo... | <p>The connection pooling built-in to ADO.Net is robust and mature. I would recommend against attempting to write your own version.</p>
| <p>Well, it is going to go away as the answer to all these questions will be LINQ. Incidentally, we have never needed custom connection pooling for any of our applications, so I am not sure what all the noise is about.</p>
| 2,969 |
<p>anyone have any experience using this?
if so, is it worth while?</p>
| <p>I just used jdb for the first time yesterday and am really pleased with the results. You see, I program in Eclipse on my laptop, then deploy to a VM to make sure the whole shebang still works. Very occasionaly, I'll have to work on something that gets executed standalone, as a commandline. These things sometimes ... | <p>JDB is incredibly difficult to use. Placing System.outs or using an IDE debugger will produce better results. And for the more interesting features (e.g. tracking threads, heap size, etc.), you can get the information graphically with the <a href="http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html" r... | 11,349 |
<p>How do I update my subversion repository so it can accept updates to the log message field? I've got a Windows installation and I changed the pre-revprop-change.tmpl file name to a batch file, but now when I try to update a the log message property my tortoise svn just hangs and the property isn't updated. Am I doin... | <p>Looking at the screenshot it appears that Visual Studio is currently debugging in Run mode - you need to break execution of the process before it makes sense to look at things like the call stack, etc...</p>
<p>To break execution of the process you either need to hit a breakpoint, or you can break execution of the ... | <p>I guess you are already in the Debug mode. The "Run" button is disabled. Just go to Debug -> windows -> Disassembly to view disassembly.</p>
| 47,103 |
<p>Both of these appservers are at least in part OSGI based. One (Glassfish) is obviously Java EE while the other isn't. Now I'm at the stage of choosing a platform for a new project and the natural choice is Glassfish v3 Prelude. This does raise the issue of perhaps we should be using S2AP instead.</p>
<p>The ques... | <p>Java EE app servers have distributed transaction managers. If that is at all important, then may want to see if SpringSource dm includes such.</p>
<p>It is possible to do XA TX with Spring-Framework, is just that you're left on your own to locate a suitable XA manager and integrate it.</p>
<p>Course XA TX have ver... | <p>I haven't used SpringSource dm server, but I believe it is better to wait a while before trying it in production. The reason has to do with it being rather new technology. Also, the way the licensing scheme works with SpingSource (GPL) doesn't help much, as it practically means that you will be relying only on Sprin... | 49,943 |
<p><strong>First, a little background:</strong></p>
<p>I'm displaying a data set with 288 rows and 8 columns (2304 records) using a ScrollableDataTable and the performance leaves a lot to be desired. An AJAX request that rerenders the control takes nearly 20 seconds to complete, compared to 7 seconds when rendering t... | <p>The bottleneck is most likely in the "Render Response" phase of the JSF lifecycle. It's trying to render too many components for the view at one time.</p>
<p>My suggestion is to use pagination. It should significantly increase your performance because it's rendering smaller portions of the view at a time.</p>
<p>B... | <p>I had similar problems a long time ago and ended up writing an applet to display the data that interacted with the page using livescript. My performance problems were the same as what you were seeing. The client took over 30 seconds to render the table data, and the server turned my response around in less than 2 ... | 11,168 |
<p>We have a graphics intensive application that seems to be experiencing problems on AMD 64 bit Dual Core platforms that are not apparent on Intel platforms.</p>
<p>Running the application causes the CPU to run at 100%, in particular when using code for shadows and lighting (Open GL).</p>
<p>Does anyone know of spec... | <p>Note that AMD64 is a <a href="http://en.wikipedia.org/wiki/Non-Uniform_Memory_Access" rel="nofollow noreferrer">NUMA</a> architecture - if you are using a multi-processor box you may be running lots of memory accesses across the hypertransport bus which will be slower than the local memory and may explain the behavi... | <p>I would invest in profiling software to trace down the actual cause of the problem. </p>
<p>On linux, Valgrind ( which contains Cachegrind & Callgrind ) + KCacheGrind can make working out where all the heavy function calls are going on. </p>
<p>Also, compile with full debug symbols and it can even show the as... | 12,626 |
<p>Note: not ASP.NET.</p>
<p>I've read about various methods including using SOAPClient (is this part of the standard Windows 2003 install?), ServerXMLHTTP, and building up the XML from scratch and parsing the result manually.</p>
<p>Has anyone ever done this? What did you use and would you recommend it?</p>
| <p>Well, since the web service talks XML over standard HTTP you could roll your own using the latest XML parser from Microsoft. You should make sure you have the latest versions of MSXML and XML Core Services (see <a href="http://msdn.microsoft.com/en-us/aa570309.aspx" rel="nofollow noreferrer">Microsoft Downloads</a>)... | <p>We use the MS Soap Toolkit version 3 here. Seems to work ok (I only wrote the services).</p>
| 16,112 |
<p>I am really stuck with this Parser Error Message telling me "<code>Could not load the assembly 'App_Web_amlohswi'. Make sure that it is compiled before accessing the page.</code>" I have been looking around for a few hours checking different posts here and googling information. I have found out that I need to set ... | <p>ASP.NET 3.5 sites run in 2.0 app pools as long as that version of .NET is installed on the system.</p>
<p>You may have to set up web.config properly. Visual Studio should do this for you when you create a new project.</p>
<p>You should also make sure you don't combine 1.1 and 2.0 applications in the same app pool.... | <p><a href="http://www.hanselman.com/blog/HowToSetAnIISApplicationOrAppPoolToUseASPNET35RatherThan20.aspx" rel="nofollow noreferrer">Here</a> is how you use 3.5 in IIS. All hail Hansleman!</p>
| 36,733 |
<p>I'm trying to write a simple query involving two tables. The "person" table has a unique <code>person_id</code> and a <code>name</code>, and the "friends" table has a <code>person_id</code> and a <code>friend_id</code> which is a FK to a <code>person_id</code> in the person table.</p>
<pre><code>person:
<PK>... | <p>You want something like this:</p>
<pre><code>SELECT p.name, f.friend_id
FROM person AS p
INNER JOIN friends AS f ON p.person_id = f.person_id
WHERE p.person_id = 1
</code></pre>
<p>This joins the two tables together using <code>p.person_id = f.person_id</code></p>
<p>If a person has no friends, you won't get any ... | <pre>select p.name
from person p, friends f
where f.friend_id = p.person_id
and f.person_id = 1</pre>
| 43,427 |
<p>In order to perform a case-sensitive search/replace on a table in a SQL Server 2000/2005 database, you must use the correct collation.</p>
<p>How do you determine whether the default collation for a database is case-sensitive, and if it isn't, how to perform a case-sensitive search/replace?</p>
| <pre><code>SELECT testColumn FROM testTable
WHERE testColumn COLLATE Latin1_General_CS_AS = 'example'
SELECT testColumn FROM testTable
WHERE testColumn COLLATE Latin1_General_CS_AS = 'EXAMPLE'
SELECT testColumn FROM testTable
WHERE testColumn COLLATE Latin1_General_CS_AS = 'eXaMpLe'
</code></pre>
<... | <p>First of all check this:
<a href="http://technet.microsoft.com/en-us/library/ms180175(SQL.90).aspx" rel="nofollow noreferrer">http://technet.microsoft.com/en-us/library/ms180175(SQL.90).aspx</a></p>
<p>You will see that CI specifies case-insensitive and CS specifies case-sensitive.</p>
| 13,909 |
<p>I'm in the trade of developing business web applications. They are mostly internal-use, sometimes with a partner zone, but rarely available to the public internet. They are applications that help companies run their business.</p>
<p>For some time now I have an idea bugging me - why not use Flash for them? Up to now... | <p>It's already happening? <a href="http://en.wikipedia.org/wiki/Adobe_Flex" rel="nofollow noreferrer">Flex!</a></p>
| <p>Many people and organisations are doing this with both Flex and regular Flash.</p>
| 49,406 |
<p>I always tend to forget these built-in <strong>Symfony</strong> functions for making links.</p>
| <p>If your goal is to have user-friendly URLs throughout your application, use the following approach:</p>
<p>1) Create a routing rule for your module/action in the application's routing.yml file. The following example is a routing rule for an action that shows the most recent questions in an application, defaulting ... | <p>In addition, if you actually want a query string with that url, you use this: </p>
<pre><code>link_to('My link name', 'yourmodule/youraction?key=value&key2=value',array('query_string'=>'page=2'));
</code></pre>
<p>Otherwise, it's going to try to route it as part of the url and likely break your action.</p>... | 5,465 |
<p>Is there a difference in behavior between adding a control to the ASPX page directly and loading a control programmatically and adding to a placeholder?</p>
<p>The control inherits from <code>System.Web.UI.WebControls.DataBoundControl</code>.</p>
<p>The reason I ask is that I have a control that works when I add i... | <p>The control tree ends up the same if you define in markup or add programmatically. However there is plenty of room for the control implementor to screw up along the way.</p>
<p>You can go look how ASP.NET compiles the aspx:</p>
<pre><code>C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
</code... | <p>One important difference is that if you create a control dynamically, you will not get, by default, any values from skins set. You must manually call control.ApplyStyleSheetSkin(page): <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.control.applystylesheetskin.aspx" rel="nofollow">http://msdn.microsof... | 42,974 |
<p>Why is the <em>CheckBoxList</em> removed from ASP.NET MVC preview release 5? </p>
<p>Currently I don't see any way in which I can create a list of checkboxes (with similar names but different id's) so people can select 0-1-more options from the list.</p>
<p>There is an <code>CheckBoxList</code> list present in the... | <p>A for loop in the view to generate the checkboxes</p>
<pre><code><% foreach(Inhoud i in ViewData["InhoudList"] as List<Inhoud>) { %>
<input type="checkbox" name="Inhoud" value="<%= i.name %>" checked="checked" /> <%= i.name %>
<% } %>
</code></pre>
<p>Don't use <code>Html.C... | <p>I recommend using <strong>JeremiahClark</strong> extension posted above. (<a href="http://blogs.msdn.com/miah/archive/2008/11/10/checkboxlist-helper-for-mvc.aspx" rel="nofollow noreferrer">CheckBoxList</a>)</p>
<p>My controller resulted into very simple instructions. For clarify I add a fragment of my code that's a... | 24,589 |
<p>i'm currently experimenting using PixelShaders introduced with .net 3.5 sp1 to improve image processing performance. everything is much faster , but til yet i just had effects applied to some elements in my wpf forms, that i actually want to avoid.</p>
<p>we have a bunch of image processing functionality and i'd li... | <p>For who still needs this:
I just created this article here that shows how to do it in WPF.
<a href="http://www.codeproject.com/Articles/642151/Pixel-shaders-in-a-background-thread-in-WPF" rel="nofollow">http://www.codeproject.com/Articles/642151/Pixel-shaders-in-a-background-thread-in-WPF</a></p>
<p>The relevant co... | <p>What is generally done in C++ / DirectX to achive this is:</p>
<p>Preparation (done once)</p>
<ul>
<li>Create render target using CreateRenderTarget</li>
<li>Create off-screen surface using CreateOffscreenPlainSurface</li>
<li>Set render target surface using SetRenderTarget</li>
<li>Create any other input resources ... | 37,741 |
<p>From a <a href="https://stackoverflow.com/questions/29040/linq-to-sql-can-i-eager-load-only-one-field-in-a-joined-table">previous question</a>, I learn that Linq to SQL is not able to eager load only certain files of foreingKey tables.</p>
<p>So I'm asking what .net ORM can support including this type of statement ... | <p>As part of a projection, LINQ-to-SQL should handle that - have you tried</p>
<pre><code>select new {Order = order, ProductName = order.Product.Name,
CustomerName = order.Customer.Name,
OrderType = order.OrderType.Name } // etc
</code></pre>
<p>If you want those properties to become part o... | <p>There are times that you're just going to have to 'do the work yourself' and not rely on an ORM for specific function. This may be one of those times. You could put this information into a stored procedure, and pass in the objects as parameters.</p>
| 49,937 |
<p>How to integrate JQuery Intellisense support in VS 2005</p>
| <p>Doesn't seem like it's possible.
See answer 10 <a href="http://blogs.msdn.com/webdevtools/archive/2008/11/18/jscript-intellisense-faq.aspx" rel="nofollow noreferrer">here</a>.</p>
| <p>I just submitted a request to DevExpress - Refactor Pro and CodeRush - to create an add on for VS 2005. If you and your associates go the DevExpress and make the request they may take heed and produce something. Give it a try.</p>
| 41,370 |
<p>I am familiar with standard practices to assess performance query or stored procedure using SQL server 2000/2005/2008. How is the best way to assess MDX performance? I assume its possible to write structurely correct but poor performance MDX queries as easily as you can with standard T-SQL? Any suggestions?</p>
<... | <p>There are several facilities to assist tuning in Analysis Services (as of 2005).</p>
<ul>
<li><p>You can get query plans for MDX in
much the same way as SQL Server
supports them, although the actual
primitives in the engine are of a
somewhat different nature.</p></li>
<li><p>Running usage based aggregation will
pic... | <p>Try running <a href="http://www.mosha.com/msolap/mdxstudio.htm" rel="nofollow noreferrer">MDX Studio</a>. It analyzes MDX queries and gives general performance hints for common problems.</p>
<p>I've found it very useful and by following the tips I've increased performance of some queries by a factor of 8.</p>
<p>... | 46,876 |
<p>I have many articles in a database (with title,text), I'm looking for an algorithm to find the X most similar articles, something like Stack Overflow's "Related Questions" when you ask a question. </p>
<p>I tried googling for this but only found pages about other "similar text" issues, something like comparing ever... | <p><a href="http://en.wikipedia.org/wiki/Levenshtein_distance" rel="noreferrer">Edit distance</a> isn't a likely candidate, as it would be spelling/word-order dependent, and much more computationally expensive than Will is leading you to believe, considering the size and number of the documents you'd actually be intere... | <p>You can use SQL Server Full-text index to get the smart comparison, I believe that SO is using an ajax call, that does a query to return the similar questions.</p>
<p>What technologies are you using?</p>
| 30,665 |
<p>Currently I am using NetTiers to generate my data access layer and service layer. I have been using NetTiers for over 2 years and have found it to be very useful. At some point I need to look at LINQ so my questions are...</p>
<ol>
<li>Has anyone else gone from NetTiers to LINQ To SQL?</li>
<li>Was this switch over... | <ol>
<li>No</li>
<li>See #1</li>
<li>You should beware of standard abstraction overhead. Also it's very SQL Server based in it's current state.</li>
<li>Are you using SQL Server, then maybe. If you are using LINQ for other things right now like over XML data (great), Object data, Datasets, then yes you should could sw... | <p>My experience tells me that using by using linq you can get things done faster, however the actual actions to the database are slower.</p>
<p>So... if you have a small database, i'll say go for it. If not, i would wait for some improvements before changing</p>
| 10,703 |
<p>Transactional programming is, in this day and age, a staple in modern development. Concurrency and fault-tolerance are critical to an applications longevity and, rightly so, transactional logic has become easy to implement. As applications grow though, it seems that transactional code tends to become more and more b... | <p>I think no design pattern can solve this issue in itself. Good database design, good store procedure programming and especially learning how to keep your transactions short will ease most of the problems.
There is no 100% guaranteed method of not having problems though.</p>
<p>In basically every case I've seen in m... | <p>If you are talking 'cloud computing' here, the answer would be to localize each transaction to the place where it happens in the cloud. </p>
<p>There is no need for the entire cloud to be consistent, as that would kill performance (as you noted). Simply, keep track of what is changed and where and handle multiple s... | 11,339 |
<p>I want to attach a click event to a button element and then later remove it, but I can't get <code>unclick()</code> or <code>unbind()</code> event(s) to work as expected. In the code below, the button is <code>tan</code> colour and the click event works.</p>
<pre><code>window.onload = init;
function init() {
... | <p>There's no such thing as <code>unclick()</code>. Where did you get that from?</p>
<p>You can remove individual event handlers from an element by calling unbind:</p>
<pre><code>$("#startButton").unbind("click", process_click);
</code></pre>
<p>If you want to remove all handlers, or you used an anonymous function ... | <p>Are you sure you want to unbind it? What if later on you want to bind it again, and again, and again? I don't like dynamic event-handling bind/unbind, since they tend to get out of hand, when called from different points of your code.</p>
<p>You may want to consider alternate options:</p>
<ul>
<li>change the butto... | 14,726 |
<p>We need to test a website in both IE6 and IE7. We've had bugs appear running on actual windows machines that aren't visible under vmware (?!), so we have an actual windows laptop to do this - but only one. Is it possible to install IE6 and IE7 side-by-side in such a way that they absolutely, positively, behave exact... | <p>The officially sanctioned way is to use the microsoft-provided Virtual PC installation and VPC images. You don't need additional windows licenses to run these.</p>
<p><a href="http://blogs.msdn.com/ie/archive/2006/11/30/ie6-and-ie7-running-on-a-single-machine.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/ie... | <p>Virtual PC 2007 is the latest version of VPC. You should use the newer version if you're running Windows Vista. VPC 2004 isn't supported for Vista.</p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=28C97D22-6EB8-4A09-A7F7-F6C7A1F000B5&displaylang=en" rel="nofollow noreferrer">Download p... | 16,075 |
<p>I have a pattern to match with the string:
string pattern = @"asc"
I am checking the SQL SELECT query for right syntax, semantics, ...
I need to say that in the end of the query string I can have "asc" or "desc".
How can it be written in C#?</p>
| <p>That'd look like </p>
<pre><code>new Regex("asc$|desc$").IsMatch(yourQuery)
</code></pre>
<p>assuming that you're mandating that asc/desc is the end of the query. You could also do <code>(?:asc|desc)$</code> which is a little cleaner with the single <code>$</code>, but less readable.</p>
| <p>I reckon something like the following works as a regex in .Net:</p>
<pre><code>asc|desc\z
</code></pre>
<p>.. it will match end of line as well as end of string. If you just want end of string try:</p>
<pre><code>asc|desc$
</code></pre>
| 30,274 |
<p>We need to capture live video and display <em>easily</em> on Linux. We need a cheap card or USB device with a simple API. Anyone want to share some experience? </p>
| <p>Use the <a href="http://en.wikipedia.org/wiki/Video4Linux" rel="noreferrer">video4linux</a> library. I've used it with a c++ program and was able to capture webcam frames within about an hour. (Very easy to use and setup)</p>
| <p>There's the <a href="http://www.gnome.org/projects/cheese/" rel="nofollow noreferrer">cheese</a> gnome application. Really simple to use. Not too much features, just video capture.</p>
| 10,944 |
<p>I'd like to create a view in Sharepoint that has a filter based on a date field. </p>
<p>The filter should be >= Today and <- Today + 90 days. </p>
<p>I found a reference to the </p>
<pre><code><Today OffsetDays=”5” />
</code></pre>
<p>CAML function and could probably use this by setting the view usin... | <p>This can be done OTB using the filter dropdowns when modifying or creating a view:</p>
<p><a href="http://img91.imageshack.us/my.php?image=filterew5.png" rel="nofollow noreferrer">Filter Image</a></p>
<p><a href="http://img91.imageshack.us/my.php?image=filterew5.png" rel="nofollow noreferrer">alt text http://img91... | <p>Ok... when you using formula for the column...
It cant using [Today] because it doesnt exsist on the list column...]</p>
<p>So i suggest that you must required the column Today first, so you can use [Today] At the formula..</p>
<p>i think u just dont have using CAML or column formula, but it can do from filtering ... | 29,815 |
<p>I am about to start a project for a potentially heavily accessed ASPNET MVC application and I was thinking to use Subsonic for my DAL.
I have some concern about the ability of Subsonic to handle thousands of concurrent requests.
Can anyone give me some examples of popular web sites using Subsonic?
Also if you have ... | <p><em>Thousands</em> of concurrent requests? Are you sure that's likely?</p>
<p>For what it's worth, <a href="http://www.dotnetkicks.com/" rel="nofollow noreferrer">DotNetKicks</a> uses SubSonic, and never seems to have performance issues.</p>
| <p>As a guideline, if you have 1000 users, you won't have more than 1 or 2 concurrent users. At least in my experience. To have 1K concurrent users you should have at least 500K-1M users.</p>
| 18,020 |
<p>I'm new to 3D printing, I have printed the cat that comes on the SD card on my Ender 3 and it's amazing the level of detail. After that, I tried to print another figure and I don't know what I'm doing wrong. I don't even know what to search for troubleshooting images because none of those seems similar to my problem... | <p>In principle you can re-extrude it with a somewhat simpler machine/setup than making filament from scratch, but controlling the diameter is the hard part of making filament - as you can see from how the manufacturer of yours botched it.</p>
<p>I would first try insisting on a refund without returning the item unless... | <p>Personally I store all my filament waste in tubs for the day a recycling/reuse solution offers itself. You can "compact" waste prints using hot air which also sticks the whispy pieces together. Someone will eventually come out with a "re-extruder" that simply cooks old filament and then produc... | 2,137 |
<p>PTFE tubes are typically delivered coiled up. And because they are quite stiff, they always want to spring back to their original curvy shape, making them harder to route properly.</p>
<p>Is there a way to straighten them out?</p>
| <p>I just plugged the ends of tube and soaked it in real warm water for 5 minutes then stretched it out on a table. That helped then the hard part I spooling it up against the arch and soaked it again. This seem to work the best. </p>
| <p>I just plugged the ends of tube and soaked it in real warm water for 5 minutes then stretched it out on a table. That helped then the hard part I spooling it up against the arch and soaked it again. This seem to work the best. </p>
| 487 |
<p>Mac's have TextMate as there preferred application for ruby development, but what would be the preferred application for linux? I need something where it's easy to work with multiple files, project structure and setup commands to run my ruby app or if it is one my merb app.Syntax highlighting is also a must.</p>
<p... | <p>I use Vim on both Windows and Linux for development in Rails (we have to use Windows in work, and I only use Linux at home). The environment is almost exactly the same for both platforms. Especially important for me is easy navigation between the various Rails components - from Controllers to views, partials and mod... | <p>I prefer <a href="http://www.aptana.com/" rel="nofollow noreferrer">Aptana/RadRails</a> on both Mac and Linux. It gives a consistent experience for me no matter what OS I'm on.</p>
<p>I still don't get the excitement over Textmate...</p>
| 31,666 |
<p>Microsoft seems hell-bent on deprecating the swiss-army-knife of database tools. What else comes close for facading/file-swapping/cloning/name-your-acronym-connecting arbitrary database servers/spreadsheets/CSV's/flatfiles?</p>
<p>What weird kinds of functionality have you squeezed out of Access? And what else is t... | <p>Access is not a DBMS. Or at least it's not <em>just</em> a simple DBMS. It's a very good RAD environment, a simple way to create SQL code graphically, and a regular front-end to fully fledged DBMs.</p>
<p>Neither SQL Server (Express or MSDE) nor Oracle, MySQL, etc. will <strong>ever</strong> replace it, until they ... | <p>I believe File Maker Pro will probably become a new standard if people ever figure out it exists. </p>
<p>FMP has all of same features / short comings of Access plus you can actually make a real client / server setup if you know what you're doing.</p>
<p>In a single file you can define your forms, reports, tables,... | 42,396 |
<p>Our company has for many years had multiple domain names to protect our product name. When our webiste was first set up we had all these domain names resolving to on IP address which worked fine until now. We rewrote the site with ASP.NET MVC and now use Recaptcha. The Recaptcha keys are registered to "www.example.c... | <p>For the CNAME approach you need to pick ONE domain name and make that your primary. So make www.example.com the go-to, and every OTHER domain name redirects to this one. Then you can avoid the infinite loop.</p>
<p>There is also a way to setup a configuration on the server so that browsers will allow multiple domai... | <p>Just off the top of my head, you may want to look into DNS CNAME here. </p>
<p>Another possible solution is to set up a website in IIS with domain aliases for all of your other domains in place and have that website redirect the user to your primary domain/site.</p>
| 44,430 |
<p>I'm looking for some insight into XNA on Xbox 360, mainly if its possible to run vector-based float mathematics on its GPU?</p>
<p>If there's a way, can you point me into the right direction?</p>
| <p>I don't claim to be an expert on this, but hopefully this can point you in a helpful direction.</p>
<p>Is it possible? Yes. You probably already know that the GPU is good at such calculations (hence the question) and you can indeed control the GPU using XNA. Whether or not it will suit your needs is a different mat... | <p>I wonder if there were any new results (articles, source code etc.) on the subject matter (doing some form of CUDA-like computation) on Xbox(es). There was one research paper with a source code promise (<a href="https://www.academia.edu/1379928/Linear_genetic_programming_GPGPU_on_Microsofts_Xbox_360" rel="nofollow n... | 15,249 |
<p>Is there a <em>portable</em> way of getting thread and/or process identifier (string, int, ...) with C++?</p>
| <p>There is no portable way when portable means a way that works on <strong>every</strong> platform for that a C++ compiler exists. Such a way had to be part of the C++ standard, in which case it really would work everywhere (just like the other parts of the C++ standard work everywhere). Everything not in the standard... | <p>I'm not sure how portable they are but <a href="https://computing.llnl.gov/tutorials/pthreads/" rel="nofollow noreferrer">Posix threads</a> may be another option you want consider. See also <a href="http://www.humanfactor.com/pthreads/" rel="nofollow noreferrer">here</a>. I agree with Steve's comment--portable to ... | 21,111 |
<p>All of this is pertaining to WebHttp binding, hosted in a custom Service Host (IIS is not an option at this time).</p>
<p>I've implemented a custom UserNamePasswordValidator, and a custom IAuthorizationPolicy. When I configure the endpoint's binding to use Basic authentication, everything works just as I'd like (c... | <p>First of all, the service responds correctly to the anonymous call, according to the <a href="http://www.faqs.org/rfcs/rfc2617.html" rel="nofollow noreferrer">specification</a>.</p>
<p>Second, this is impossible. When you are self-hosting your service and you have some http binding, WCF will use a <code><a href="ht... | <p>I don't think so... I was just writing you need to create to separate endpoint when I decided to read you question again and noticed the last statement of your question. So the answer would be no (that I know of)</p>
| 25,753 |
<p>I am considering adding OpenID to our customer facing admin and control panel areas...</p>
<p><strong>1 - Associating OpenID's With Existing Accounts</strong></p>
<p>For customers that already have accounts with us, I'm thinking they would need to login using their existing account number that we issue and then I'... | <p>It seems to me that a lot of the arguments against OpenID are either made out of ignorance or by people with an axe to grind.</p>
<p>For example, the document you link to complains that identifying yourself with a URI is "dehumanising and more than a little frightening". Is that a legitimate complaint, or somethin... | <p>I'd allow the registration of <em>multiple</em> OpenIDs with a particular account. That's a nice feature to have because it allows users to migrate between OpenIDs should the need ever arise.</p>
<hr>
<p>That said, the idcorner link raises a good point. I think he massively overblows the security issue and makes m... | 17,409 |
<p>I've got some Japanese in the ALT attribute, but the tooltip is showing me the ugly block characters in the tooltip. The rest of the content on the page renders correctly. So far, it seems to be limited to the tooltips.</p>
| <p>This is because the font used in the tooltip doesn't include the characters you are trying to display. Try installing a font pack that includes those characters. I'm affraid you can't do much for your site's visitors other than implementating a tooltip yourself using javascript.</p>
| <p>Can you sanitize the alt text so that it doesn't have the characters in it, preferably by replacing the entire text with something useful (rather than just filtering the string)? That's not ideal, but neither is displaying broken characters, or telling your users to install a new font pack.</p>
| 3,278 |
<p>Is there any known way of listing the WMI classes and their properties available for a particular system? Im interested in a vbscript approach, but please suggest anything really :)</p>
<p>P.S. Great site.</p>
| <p>I believe this is what you want.</p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?familyid=2cc30a64-ea15-4661-8da4-55bbc145c30e&displaylang=en" rel="noreferrer">WMI Code Creator</a></p>
<p>A part of this nifty utility allows you to browse namespaces/classes/properties on the local and remote PCs... | <p>This MSDN page walks through enumerating the available classes: <a href="http://msdn.microsoft.com/en-us/library/bb429532.aspx" rel="nofollow noreferrer">How to: List the Classes in a WMI Namespace</a></p>
<p>for retrieving properties from a class:</p>
<pre><code>ManagementPath l_Path = new ManagementPath(l_classN... | 3,338 |
<p>I have an XML document, and contained within one of the nodes, I have <code><li></code> tags. I don't need <code><ul></ul></code> tags for Flash because it only accepts <code><li></code> tags anyway. For example, here's part of the XML doc:</p>
<pre><code><node>
<li>item1</li... | <p>open project properties, go to the web tab and choose the option for IIS.</p>
<p>That actually starts an instance of the app in IIS and attaches the debugger. If you only wanted to attach to an existing IIS instance, choose attach to process from the debug menu.</p>
| <p>go to the properties of the web application. Select the "Start Options" section, and change from "USe default web server" to "use custom server". Enter "<a href="http://localhost" rel="nofollow noreferrer">http://localhost</a>" in the base url. </p>
<p>(assumes VS 2008)</p>
| 25,805 |
<p>I just got surprised by something in TSQL. I thought that if xact_abort was on, calling something like</p>
<pre><code>raiserror('Something bad happened', 16, 1);
</code></pre>
<p>would stop execution of the stored procedure (or any batch).</p>
<p>But my ADO.NET error message just proved the opposite. I got both... | <p>This is By Design<sup>TM</sup>, as you can see on <a href="http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=275308" rel="noreferrer">Connect</a> by the SQL Server team's response to a similar question:</p>
<blockquote>
<p>Thank you for your feedback. By design, the XACT_ABORT set optio... | <p>microsoft suggests using throw instead of raiserror. Use XACT_State to determine commit or rollback for the try catch block</p>
<pre><code>set XACT_ABORT ON;
BEGIN TRY
BEGIN TRAN;
insert into customers values('Mark','Davis','markdavis@mail.com', '55909090');
insert into customer values('Zack','R... | 10,197 |
<p>My Flash (AS3/AIR) application is currently using a slightly unusual architecture (for a Flash app) to provide particular base classes for loaded content at runtime. The external content is published with 'stub' base classes, which are eclipsed by the 'real' base classes at runtime when it is loaded. I've heard this... | <p>A warning doesn't automatically mean that code is <em>bad</em>, just suspicious-looking.</p>
<p>Personally I start from a position of enabling all the warnings I can, then turn off any that prove more annoying than useful. That one that fires anytime you cast anything to a bool is usually the first to go.</p>
| <p>A simple way to avoid the warning would be:</p>
<pre><code>#ifdef CONFIG_FOO
extern int foo_enabled;
#else
extern int foo_enabled = 0;
#endif
</code></pre>
| 27,724 |
<p>I have a php script which accesses a MSSQL2005 database, reads some data from it and sends the results in a mail. </p>
<p>There are special characters in both some column names and in the fields itself. </p>
<p>When I access the script through my browser (webserver iis), the query is executed correctly and the con... | <p>Depending on the type of characters you have in your database, it might be a console limitation I guess. If you type <code>chcp</code> in the console, you'll see what is the active code page, which might something like <a href="http://en.wikipedia.org/wiki/Code_page_437" rel="nofollow noreferrer">CP437</a> also know... | <p>PHP's poor support for the non English world is well known. I've never used a database with characters outside the basic ASCII realm, but obviously you already have a work around and it seems you just have to live with it.</p>
<p>If you wanted to take it a step further, you could:
1. Write an array that contains a... | 44,005 |
<p>I have a cookie which is generated from a servlet and that I would like to be persistent - that is, set the cookie, close down IE, start it back up, and still be able to read the cookie. The code that I'm using is the following:</p>
<pre><code>HttpServletResponse response =
(HttpServletResponse) FacesContext... | <p>I know nothing of Java or servlets, but IE will only persist a cookie if it has an Expires date, setting max-age is not sufficient, IE will continue to treat it as a session cookie.</p>
| <p>As I don't use windows this is some fainted memory: If you set your IE cookie settings to "ask for permission" each time a cookie is set - doesn't it show how long the cookie is supposed to be valid? Also, you might want to add the site to another security zone (local or whatever that was called) in order to get com... | 47,139 |
<p>I'm trying to compile such code:</p>
<pre><code>#include <iostream>
using namespace std;
class CPosition
{
private:
int itsX,itsY;
public:
void Show();
void Set(int,int);
};
void CPosition::Set(int a, int b)
{
itsX=a;
itsY=b;
}
void CPosition::Show()
{
cout << "x:" << it... | <p>In addition to the normal getter you should also have a const getter.<br>
Please note the return by reference. This allows you any call to SetXX() to affect the copy of Position inside CCube and not the copy that you have been updating.</p>
<pre><code>class CCube
{
private:
CPosition Position;
publi... | <p>Well, you already got an answer for the error. One things though:
Do you plan on having the cube access the private members of CPosition (itsX, itsY)? If not, it doesn't need to be declared as a friend. If it is, consider exposing public methods in CPosition to return X and Y, and you still don't need to declare it ... | 30,571 |
<p>I'm looking for a tool like Atlassian's <a href="http://www.atlassian.com/software/fisheye/" rel="nofollow noreferrer">FishEye</a>. The alternatives I've found so far (like <a href="http://statcvs.sourceforge.net/" rel="nofollow noreferrer">StatCVS</a>, <a href="http://www.viewvc.org/" rel="nofollow noreferrer">View... | <p>Another SVN tool which has repository browsing capabilities is <a href="http://trac.edgewall.org/" rel="nofollow noreferrer">Trac</a>. This is nice because as well as a browser for the repository it also has a timeline showing commits. It also does bug tracking.</p>
| <p>There is also <a href="http://sourceforge.net/projects/cvsmonitor/" rel="nofollow noreferrer">CVS Monitor</a>, though it hasn't got the nearly the number of features as FishEye.</p>
<p>We use ViewCVS for repository browsing.</p>
| 14,059 |
<p>I'm getting a weird error occassionally in VS2008. A colleague gets a similar error, we both noticed it after installing TFS PowerToys so I'm wondering if it's related.</p>
<p>Anyway the error is:</p>
<p>Team Foundation Error
Retrieving the COM class factory for component with CLSID{GUIID...} failed due to the fol... | <p>Team Explorer has collaboration facilities to allow it to interact with Windows Live Messenger or Office Communicator. If you've uninstalled these, you might get the same error from Team Explorer trying to talk to a non existent program. In Team Explorer, right click on Team Members, click Personal Settings. Unde... | <p>We recently changed from SourceSafe to TFS at my workplace and a good bunch of us had to reinstall SP1 in VS2008 to get Powertools and TFS to work properly. Wheter this is related to your problem however I am unsure... It did seem to clear up several weird errors for me.</p>
| 47,349 |
<p>An <a href="https://stackoverflow.com/questions/61278/quick-and-dirty-way-to-profile-your-code#231614">answer to one of my questions</a> included the following line of code:</p>
<pre><code>label = std::safe_string(name); // label is a std::string
</code></pre>
<p>The intent seems to be a wrapper around a string li... | <p>After searching <a href="http://www.google.com/codesearch" rel="nofollow noreferrer">google code search</a> (I should have thought of this first...) I found this:</p>
<pre><code>//tools-cgi.cpp
string safe_string (const char * s)
{
return (s != NULL) ? s : "";
}
</code></pre>
<p>Which converts <code>NULL</code... | <p>It is not part of C++ standard (but perhaps it should be?)</p>
<p>I have been using the same kind of helper function to avoid a std::string throw an exception with a NULL char * string. But it was more something like:</p>
<pre><code>// defined somewhere else as ""
extern const char * const g_strEmptyString ;
inli... | 29,438 |
<p>I want to store the data returned by <code>$_SERVER["REMOTE_ADDR"]</code> in PHP into a DB field, pretty simple task, really. The problem is that I can't find any proper information about the maximum length of the <strong>textual representation</strong> of an IPv6 address, which is what a webserver provides through ... | <p><strong>45 characters</strong>.</p>
<p>You might expect an address to be</p>
<pre><code>0000:0000:0000:0000:0000:0000:0000:0000
</code></pre>
<blockquote>
<p>8 * 4 + 7 = 39</p>
</blockquote>
<p>8 groups of 4 digits with 7 <code>:</code> between them.</p>
<p>But if you have an <a href="https://www.rfc-editor.org/rfc/... | <p>Watch out for certain headers such as <code>HTTP_X_FORWARDED_FOR</code> that appear to contain a single IP address. They may actually contain multiple addresses (a chain of proxies I assume).</p>
<p>They will appear to be <a href="http://www.jamescrowley.co.uk/2007/06/19/gotcha-http-x-forwarded-for-returns-multipl... | 20,062 |
<p>I've written a rails app that follows the regular directory structure (model code in models, controller code in controllers).</p>
<p>But I'm now working on a new feature and for that I have written some (what I would call) "service" code.<br>
The new feature is to import some data into the system, at the moment it'... | <p>This is what the 'lib' folder is for.</p>
<p>The lib folder is in the automatically looked up path, so you can have</p>
<pre><code>class MyFoo
end
</code></pre>
<p>in <code>lib/my_foo.rb</code> and then just by calling</p>
<pre><code>MyFoo.new
</code></pre>
<p>from a controller the code will be loaded without y... | <p>./lib is definitely the place to go.</p>
<p>Another place to put this is in the initializers directory under config, depending on what it is your doing. You might also consider making the whole thing into a plugin, but if it's a small amount of functionality, it probably isn't worth it.</p>
| 36,194 |
<p>I'm trying to build a Windows installer using Nullsoft Install System that requires installation by an Administrator. The installer makes a "logs" directory. Since regular users can run this application, that directory needs to be writable by regular users. How do I specify that all users should have permission to... | <p>Use the <a href="http://nsis.sourceforge.net/AccessControl_plug-in" rel="noreferrer">AccessControl</a> plugin and then add this to the script, where the "logs" directory is in the install directory.</p>
<pre><code>AccessControl::GrantOnFile "$INSTDIR\logs" "(BU)" "FullAccess"
</code></pre>
<p>That gives full acces... | <p>Why not create a log-directory in the user's %APPDATA% directory? Do you really need to put all the logs in the install directory? Why?</p>
| 14,237 |
<p>What is the best modeling methodology for representing software system. I mean like UML and so on.
Is UML better or is there something better than that out there?
My need is to represent graphically my web application , which is a 3-tier architecture.
I need a engineering model methodology like UML to depict the en... | <p>You might wanna take a look at ArchiMate - <a href="http://www.archimate.org/" rel="nofollow noreferrer">http://www.archimate.org/</a></p>
| <p>I don't use any formal modelling language at all, instead merging bits from UML, flowcharts and doodles together with a brief description of what is happening.</p>
<p>Although the ideals of UML is to provide a common unambiguous interpretation of what is going on, I've found that in practice one needs to provide a ... | 33,665 |
<p>I'm getting the error when accessing a Stored Procedure in SQL Server</p>
<pre><code>Server Error in '/' Application.
Procedure or function 'ColumnSeek' expects parameter '@template', which was not supplied.
</code></pre>
<p>This is happening when I call a Stored Procedure with a parameter through .net's data con... | <p>I would check my application code and see what value you are setting @template to. I suspect it is null and therein lies the problem.</p>
| <p>First - why is that an EXEC? Shouldn't that just be</p>
<pre><code>AS
SELECT Column_Name, ...
FROM ...
WHERE TABLE_NAME = @template
</code></pre>
<p>The current SP doesn't make sense? In particular, that would look for a <strong>column</strong> matching @template, not the varchar value of @template. i.e. if @templ... | 48,129 |
<p>One of the major advantages with Javascript is said to be that it is a prototype based language. </p>
<p>But what does it mean that Javascript is prototype based, and why is that an advantage?</p>
| <p><strong>Prototypal inheritance</strong> is a form of object-oriented <strong>code reuse</strong>. Javascript is one of the only [mainstream] object-oriented languages to use prototypal inheritance. Almost all other object-oriented languages are classical.</p>
<p>In <strong>classical inheritance</strong>, the prog... | <p>Memory conservation is one of the benefits of prototypal inheritance in JS. In a language like Java, objects generate their own copies of the superclass' instance variables and methods, while in JS, the "super"-object offers get-access to its variables and methods to each "sub"-object that inheri... | 22,536 |
<p>How do I setup an Ant task to generate <a href="http://emma.sourceforge.net" rel="noreferrer">Emma</a> code coverage reports?</p>
| <p>To answer questions about where the source and instrumented directories are (these can be switched to whatever your standard directory structure is):</p>
<pre><code><property file="build.properties" />
<property name="source" location="src/main/java" />
<property name="test.source" location="src/test... | <p>Emma 2.1 introduces another way of obtaining runtime coverage information (.ec file). One can remotely request the data from the given port of the computer where an instrumented application is runnig. So there's no need to stop VM.</p>
<p>To get the file with runtime coverage data you need to insert the following s... | 7,635 |
<p>I've been using jQuery to do the whole AJAX magic in my web based applications.
But I came to a decision that I don’t need all these amazing features jQuery has, except its AJAX functions (like <code>$.ajax()</code>, <code>$.get()</code>, <code>$.post</code>, <code>getJSON()</code> and <code>load();</code>). </p>
<... | <p>You can make jQuery smaller by removing the modules you don't need / Just modify the <a href="https://github.com/jquery/jquery/blob/master/Makefile" rel="nofollow noreferrer">Makefile</a> file.</p>
| <p><em>MooTools</em>...!!</p>
<p>Don't believe the jQuery guys ... ;)</p>
| 26,765 |
<p>Currently we have a hybrid ASP/PHP setup connecting to a SQL Server 2005 database. But all the query work is done on the client side, I'd like to move some of this to PHP. </p>
<p>What driver and/or connection string is needed to connect to Sql Svr and what is the syntax to use in PHP?</p>
<hr>
<p>Update: OK so I... | <p>You have two options:</p>
<p>1) <strong>php_mssql extension</strong> : If you'd like something that has the same API mysql and mysqli has, then use the php_mssql extension. But there is a catch, the bundled ntwdblib.dll file with PHP is not working. You have to find this file from a SQL Server 2000 installation or ... | <p>PHP provides an extension for accessing Microsoft SQL Server databases. To use the SQL Server extension, all that is required is to activate the extension in the PHP configuration file.</p>
<p>Details on <a href="http://msdn.microsoft.com/en-us/library/bb264561.aspx" rel="nofollow noreferrer">the MSDN page</a></p>
| 4,021 |
<p>Have any of you tried Hadoop? Can it be used without the distributed filesystem that goes with it, in a Share-nothing architecture? Would that make sense?</p>
<p>I'm also interested into any performance results you have...</p>
| <p>Yes, you can use Hadoop on a local filesystem by using file URIs instead of hdfs URIs in various places. I think a lot of the examples that come with Hadoop do this.</p>
<p>This is probably fine if you just want to learn how Hadoop works and the basic map-reduce paradigm, but you will need multiple machines and a ... | <p><strong>Parallel/ Distributed computing = SPEED</strong> << Hadoop makes this really really easy and cheap since you can just use a bunch of commodity machines!!!</p>
<p>Over the years disk storage capacities have increased massively but the speeds at which you read the data have not kept up. The more data yo... | 3,830 |
<p>The situation:</p>
<p>I want to play around with IRC bots as general communications interfaces to other code I am investigating. The server hardware would be old and low-memory, but running on a relatively up-to-date Debian GNU/Linux install. I don't expect more than a hundred users at a time, tops, and probably ... | <p>During the past couple days I have been coding a bot with Python and IRCLib. Since I am coding the communication interface I needed to see the raw data transfered between the server and the client. So, I needed an IRC server which would support that. At first I was using IRCD, and it was totally fine. But after a wh... | <p>Use XMPP instead. IRC is not very well designed for your situation; it can be made to work, but it is a big pain.</p>
| 17,374 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.