instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>We are using IIS 6 and ASP.Net, When users make secure page requests using </p>
<blockquote>
<p><strong><a href="https://somesite.com/securePage.aspx" rel="nofollow noreferrer">https://somesite.com/securePage.aspx</a></strong></p>
</blockquote>
<p>the user gets an error:</p>
<hr>
<blockquote>
<p><strong>Erro... | <p>The only solution is to include the second domain in the certificate with a SubjectAlternativeName. Some certificate authorities will allow you to do this without extra cost.</p>
<p>Everything else would only happen <em>after</em> the ssl connection is established and therefor <em>after</em> the error is encountere... | <p>In Apache this is usually done with mod_rewrite:</p>
<pre><code>RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
</code></pre>
<p>Google for "rewrite URL IIS", you'll find some equivalents for IIS.</p>
| 34,681 |
<p><a href="http://msdn.microsoft.com/en-us/netframework/aa569603.aspx" rel="nofollow noreferrer">BCL</a></p>
<p>Specifically, am I breaking the EULA by doing this? </p>
| <p>Why bother using reflector? <a href="http://weblogs.asp.net/scottgu/archive/2008/01/16/net-framework-library-source-code-now-available.aspx" rel="noreferrer">Just look at the original source code</a>!</p>
<p>After more research, I found that the .NET Framework falls under the same EULA as the operating system on wh... | <p>The question is why you aren't using <a href="http://referencesource.microsoft.com/" rel="nofollow noreferrer">http://referencesource.microsoft.com/</a> instead; it's much easier to access the BCL source code that way, if you're good with their licence agreement.</p>
| 49,576 |
<p>Say I have a rectangular string array - not a jagged array</p>
<pre><code>string[,] strings = new string[8, 3];
</code></pre>
<p>What's the best way to extract a one-dimensional array from this (either a single row or a single column)? I can do this with a for loop, of course, but I'm hoping .NET has a more elega... | <p>You can cast a string array to an object array trivially - going the other way doesn't work. The actual extraction <em>has</em> to use a for loop though, as far as I can see: <a href="http://msdn.microsoft.com/en-us/library/system.array.copy.aspx" rel="noreferrer"><code>Array.Copy</code></a> requires the source and ... | <p>i made extention method. i dont know about the performance .</p>
<pre><code>public static class ExtensionMethods
{
public static string[] get1Dim(this string[,] RectArr, int _1DimIndex , int _2DimIndex )
{
string[] temp = new string[RectArr.GetLength(1)];
if (_2DimIndex == -1)
... | 28,777 |
<p>How do I resolve merge conflicts in my Git repository?</p>
| <p>Try:</p>
<pre class="lang-bash prettyprint-override"><code>git mergetool
</code></pre>
<p>It opens a GUI that steps you through each conflict, and you get to choose how to merge. Sometimes it requires a bit of hand editing afterwards, but usually it's enough by itself. It is much better than doing the whole thing ... | <p>If you do not use a tool to merge, first copy your code outside:</p>
<pre><code>- `checkout master`
- `git pull` / get new commit
- `git checkout` to your branch
- `git rebase master`
</code></pre>
<p>It resolve conflict and you can copy your code.</p>
| 19,566 |
<p>How do I make a tree data structure in C++ that uses iterators instead of pointers? I couldn't find anything in the STL that can do this. What I would like to do is to be able to create and manipulate trees like this:</p>
<pre><code>#include <iostream>
#include <tree>
using namespace std;
int main()
... | <p>Here is <a href="http://www.aei.mpg.de/~peekas/tree/" rel="noreferrer">tree.hh</a> which is a bit close to what you want to do, though a bit
different.</p>
<p>Here is a piece of code extracted from its website.</p>
<pre><code>int main(int, char **)
{
tree<string> tr;
tree<string>::iterator to... | <p>Why would you want to do that? If this is for learning purposes then you can write your own tree data structure. If this is for gaining the benefit of a data-structure holding arbitrary index types, optimized for searching and good at insertion then consider using a map.</p>
<p>A map is an associative container t... | 3,967 |
<p>I'm writing a Java app that is accepting URL parameter values that may or may not be encoded. I need an easy way to tell whether or not I need to encode the parameter string.</p>
<p>In other words, I want a function <code>boolean needsEncoding(String param)</code>, which will return true if I pass in the String "f... | <p>I thought I'd put this as a proposed answer so that people can vote:</p>
<p>One way to handle this is to modify my contract - require clients to pass in un-encoded strings so that I know I always need to encode them.</p>
| <p>Signs a string has been URL Encoded:</p>
<ol>
<li>There are no spaces, but a lot of plus symbols.</li>
<li>All percentage signs are followed by two digits.</li>
<li>There are no characters outside of a..b, A..B, 0..9, ".", "_", "-", "*", "%" and "+" in it.</li>
</ol>
<p>However I think that changing the contract i... | 22,225 |
<p>Is there a command in Git to see (either dumped to stdout, or in <code>$PAGER</code> or <code>$EDITOR</code>) a particular version of a particular file?</p>
| <p>You can use <code>git show</code> with a path from the root of the repository (<code>./</code> or <code>../</code> for relative pathing):</p>
<pre><code>$ git show REVISION:path/to/file
</code></pre>
<p>Replace <code>REVISION</code> with your actual revision (could be a Git commit SHA, a tag name, a branch name, a r... | <p><strong>Helper to fetch multiple files from a given revision</strong></p>
<p>When trying to resolve merge conflicts, this helper is very useful:</p>
<pre><code>#!/usr/bin/env python3
import argparse
import os
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument('revision')
parser.add_argument... | 43,930 |
<p>So no doubt that building a domain model is something that I think happens best when you approach it as as team. Even going so far as to involve someone who is not technical and a member of the 'business' in the modeling sessions. So much can get done quickly when you put the right people in a room and hammer out ... | <p>Everyone does it differently, I think, but...</p>
<p>I almost always start with a Class diagram (usually UML-like and on paper), paying special attention to relationships between classes and their arity. Validation at this stage is mostly trying to understand if the high-level semantics of the entities make sense t... | <p>If you're building it all on your own, just make sure it's adaptable, because there's no way you'll think of everything on the first shot. </p>
<p>Get some big paper. Draw everything out, and be messy. Don't worry about making it perfect. Put everything down that you think of, cross out stuff as it proves to no... | 22,901 |
<p>I'm looking to implement something in Java along the lines of:</p>
<pre><code>class Foo{
private int lorem; //
private int ipsum;
public setAttribute(String attr, int val){
//sets attribute based on name
}
public static void main(String [] args){
Foo f = new Foo();
f.setAttribute("lorem",1);
f.... | <p>Here's how you might implement <code>setAttribute</code> using reflection (I've renamed the function; there are different reflection functions for different field types):</p>
<pre><code>public void setIntField(String fieldName, int value)
throws NoSuchFieldException, IllegalAccessException {
Field field... | <p>You might want to cache some of the reflection data while you're at it:</p>
<pre><code>import java.lang.reflect.Field;
import java.util.HashMap;
class Foo {
private HashMap<String, Field> fields = new HashMap<String, Field>();
private void setAttribute(Field field, Object value) {
fiel... | 34,874 |
<p>So this might be really simple, but I haven't been able to find any examples to learn off of yet, so please bear with me. ;) </p>
<p>Here's basically what I want to do:</p>
<pre><code><div>Lots of content! Lots of content! Lots of content! ...</div>
....
$("div").html("Itsy-bitsy bit of content!");
... | <p>Try this jQuery plugin:</p>
<pre><code>// Animates the dimensional changes resulting from altering element contents
// Usage examples:
// $("#myElement").showHtml("new HTML contents");
// $("div").showHtml("new HTML contents", 400);
// $(".className").showHtml("new HTML contents", 400,
// ... | <p>Hello meyahoocoma4c5ki0pprxr19sxhajsogo6jgks5dt.</p>
<p>You could wrap the 'content div' with an 'outer div' which is set to an absolute width value. Inject the new content with a "hide()" or "animate({width})" method, shown in the other answers. This way, the page doesn't reflow in between because the wrapper div ... | 30,354 |
<p>I am trying to write some JavaScript RegEx to replace user inputed tags with real html tags, so <code>[b]</code> will become <code><b></code> and so forth. the RegEx I am using looks like so</p>
<pre><code>var exptags = /\[(b|u|i|s|center|code){1}]((.){1,}?)\[\/(\1){1}]/ig;
</code></pre>
<p>with the followin... | <p>The easiest solution would be to to replace all the tags, whether they are closed or not and let <code>.innerHTML</code> work out if they are matched or not it will much more resilient that way..</p>
<pre><code>var tagreg = /\[(\/?)(b|u|i|s|center|code)]/ig
div.innerHTML="[b][i]helloworld[/b]".replace(tagreg, "<... | <p>Yes, you will have to loop. Alternatively since your tags looks so much like HTML ones you could replace <code>[b]</code> for <code><b></code> and <code>[/b]</code> for <code></b></code> separately. (.){1,}? is the same as (.*?) - that is, any symbols, least possible sequence length.</p>
<p>Updated: Tha... | 10,654 |
<p>I'm trying to use boost::signal to implement a callback mechanism, and I'm getting a memory access assert in the boost::signal code on even the most trivial usage of the library. I have simplified it down to this code:</p>
<pre><code>#include <boost/signal.hpp>
typedef boost::signal<void (void)> Event;... | <p>I have confirmed this as a problem - Stephan T Lavavej (STL!) at Microsoft <a href="http://blogs.msdn.com/vcblog/archive/2007/02/26/stl-destructor-of-bugs.aspx" rel="noreferrer">blogged about this</a>.</p>
<p>Specifically, he said:</p>
<blockquote>
<p>The general problem is that the linker does not diagnose all One ... | <p>Brian, I've just experienced exactly the same problem as you. Thanks to your answer about the blog post, I tracked it down to our disabling of <code>_HAS_ITERATOR_DEBUGGING</code> and <code>_SECURE_SCL</code>.</p>
<p>To fix this problem, I built the boost libraries manually. I didn't need to mess around with config... | 16,584 |
<p>I have A $param that I am passing into a template. I wish to use the value of this parameter as class name for a div. The class is not taking the value of the parameter but taking the parameter name (in the html page it is $param). Is there any way I can use the value of a parameter as a class name?</p>
| <p><br />
The following should work:</p>
<pre><code><div>
<xsl:attribute name="class">
<xsl:value-of select="$param"/>
</xsl:attribute>
</div>
</code></pre>
| <p>Please use the xsl:attribute element to add the value , for example,</p>
<pre><code>print("<div><xsl:attribute name="class"><xsl:value-of select="$param" /></xsl:attribute></div>");
</code></pre>
| 36,465 |
<p>What's the best way to initialize an array in PowerShell?</p>
<p>For example, the code</p>
<pre><code>$array = @()
for($i=0; $i -lt 5;$i++)
{
$array[$i] = $FALSE
}
</code></pre>
<p>generates the error</p>
<pre><code>Array assignment failed because index '0' was out of range.
At H:\Software\PowerShell\TestArr... | <p>Yet another alternative:</p>
<pre><code>for ($i = 0; $i -lt 5; $i++)
{
$arr += @($false)
}
</code></pre>
<p>This one works if $arr isn't defined yet.</p>
<p><strong>NOTE</strong> - there are better (and more performant) ways to do this... see <a href="https://stackoverflow.com/a/234060/4570">https://stackove... | <p>Or try this an idea. Works with powershell 5.0+.</p>
<pre><code>[bool[]]$tf=((,$False)*5)
</code></pre>
| 28,025 |
<p>We've run into some problems with the <a href="http://www.parashift.com/c++-faq-lite/static-init-order.html" rel="noreferrer">static initialization order fiasco</a>, and I'm looking for ways to comb through a whole lot of code to find possible occurrences. Any suggestions on how to do this efficiently?</p>
<p>Edit:... | <h1>Solving order of initialization:</h1>
<p>First off, this is just a temporary work-around because you have global variables that you are trying to get rid of but just have not had time yet (you are going to get rid of them eventually aren't you? :-)</p>
<pre><code>class A
{
public:
// Get the global inst... | <p>If your project is in Visual Studio (I've tried this with VC++ Express 2005, and with Visual Studio 2008 Pro):</p>
<ol>
<li>Open Class View (Main menu->View->Class View)</li>
<li>Expand each project in your solution and Click on "Global Functions and Variables"</li>
</ol>
<p>This should give you a decent list of a... | 43,494 |
<p>I find that the .NET event model is such that I'll often be raising an event on one thread and listening for it on another thread. I was wondering what the cleanest way to marshal an event from a background thread onto my UI thread is.</p>
<p>Based on the community suggestions, I've used this:</p>
<pre><code>// e... | <p>A couple of observations:</p>
<ul>
<li>Don't create simple delegates explicitly in code like that unless you're pre-2.0 so you could use: </li>
</ul>
<pre class="lang-cs prettyprint-override"><code> BeginInvoke(new EventHandler<CoolObjectEventArgs>(mCoolObject_CoolEvent),
sender,
... | <p>I am using something like</p>
<pre><code>Invoke((Action)(() =>
{
//your code
}));
</code></pre>
| 4,238 |
<p>How can i connect two or more machines to form a network grid and how can i distribute work load to the two machines? </p>
<p>What operating systems do i need to run on the machines, and what application should i use to manage the load balancing?</p>
<p>NB: I read somewhere that google uses cheap machines to perfo... | <p>An excellent place to start is with the <a href="http://www.beowulf.org/" rel="nofollow noreferrer">Beowulf project</a>. Basically an opensource cluster built on the Linux OS.</p>
| <p>There are many different approaches to parallel processing, and many types of system architectures you could use. </p>
<p>For commodity systems, there are clusters and grids, or you can even form a single system image from several pieces of commodity hardware. There is of course also load balancing, high availabili... | 48,402 |
<p>I have the following function that is pulling data from a database. The ajax call is working correctly. How can I send the tab delimited data in my success function to the user? Setting the contect type to "application/vnd.ms-excel" didn't work. The alert on success shows the correctly formatted data.</p>
<pre>... | <p>AJAX is... the wrong choice. Redirect the user to a server resource that will send the data down with the proper MIME type, and let the browser figure out what to do with it.</p>
| <p>It's possible that you don't want to do this with javascript.</p>
<p>What I think you want to do is create a response page with the mine type <strong>application/csv</strong> then redirect the user to that page. I would probably do a window.open() since the user doesn't lose the page they're currently on.</p>
| 18,051 |
<p>I'm developing in an environment that is severely constrained, but the developers also have tight control over. </p>
<p>VCRedist_x86.exe - A 4Mb redistributable - is no fun (four hours to transfer). I'd really prefer to just redistribute MFC90.dll, msvcm90.dll, msvcp90.dll and msvcr90.dll - that's more like 2Mb. ... | <p>We use this: <a href="http://blog.kalmbach-software.de/2008/05/03/howto-deploy-vc2008-apps-without-installing-vcredist_x86exe/" rel="noreferrer">Howto: Deploy VC2008 apps without installing vcredist_x86.exe</a> </p>
<p>Essentially</p>
<ul>
<li>Don't embed a manifest in your exe files. </li>
<li>Copy the C++ DLLs a... | <p>Install them as private assemblies. See here:</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms235291.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms235291.aspx</a></p>
<p>Note that if you don't need all of the DLLs provided you can modify the manifest files to only reference th... | 21,319 |
<p>I need to debug JavaScript in Internet Explorer 7.</p>
<p>Unfortunately, its default debugger doesn't provide me with much information. It tells me the page that the error showed up on (not the specific script) and gives me a line number. I don't know if that is related to my problem.</p>
<p>It'd be nice if it coul... | <p><a href="http://web-development-helper.software.informer.com" rel="noreferrer">Web Development Helper</a> is very good.</p>
<p>The <a href="http://www.microsoft.com/downloads/en/details.aspx?familyid=95E06CBE-4940-4218-B75D-B8856FCED535&displaylang=en" rel="noreferrer">IE Dev Toolbar</a> is often helpful, but u... | <p>The following tools works great for me: </p>
<p>1) <a href="http://www.debugbar.com/" rel="nofollow noreferrer">http://www.debugbar.com/</a></p>
<p>Provide a convenience UI to with feature like source, style, DOM, Script, HTML check. It also show the actual error in your JS file (which line, which file). </p>
<p>... | 47,200 |
<p>I have written C# code for ascx. I am trying to send an email on click of image button which works in Mozilla Firefox but not in Internet Explorer.</p>
<p>This function is called on button click:</p>
<pre><code><%@ Control Language="C#" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="Syste... | <p>In code behind just change
protected void btnSubmit_Click(object sender, EventArgs e)</p>
<p>with
protected void btnSubmit_Click(object sender, ImageClickEventArgs e)</p>
| <p>Why are you using an ImageButton ... why not just use a regular button, and change the background with CSS. </p>
| 38,188 |
<p>Previously, I had a class that wrapped an internal <code>System.Collections.Generic.List<Item></code> (where Item is a class I created). The wrapper class provided several collection-level properties that provided totals, averages, and other computations on items in the list. I was creating a <code>BindingSo... | <p>The system treats anything that implements <code>IList</code> (or <code>IListSource</code>) as a container, rather than an item. As such, you cannot bind to properties of anything that implements <code>IList</code>. As such, <em>encapsulation</em> (i.e. what you already have) is the best approach if you want to be a... | <p>The problem here is that you want to use your one class for two completely different purposes (in terms of bindings).</p>
<p>Example: The "AverageValue" property doesn't make sense to be on each item, because it's a global property that spans all items.</p>
<p>Either way, I'm guessing that your _itemsBindingSource... | 34,686 |
<p>I've been using Eclipse with each project in a separate window by right clicking on a project and selecting Open in New Window. This worked fine, but suddenly... even when I close Eclipse and reopen it, the Navigator only shows one of the projects I was working on. How can I navigate back???</p>
<p>Thanks!</p>
| <p>Okay, I got it: I used Window -> New Window and in the new window everything is back to normal.</p>
| <p>The most easy way you can follow is switch to another workspace from eclipse (go to file menu</p>
<p>// then switch workspace)and then import the projects(file menu // import // Existing Projects into Workspace) .</p>
| 33,120 |
<p>We're testing our ClickOnce deployed application internally on IIS (Internet Information Services), but we're wondering if we can deploy it to the wider internet using Apache on Linux so we can make use of our existing external website host.</p>
<p>If so, is there anything else I need to consider other than as spec... | <p>I found a number of people asking the same question starting around 2005, but here is the first google result - also discusses silverlight.</p>
<p><a href="http://software.clempaul.me.uk/articles/clickonce/" rel="noreferrer">http://software.clempaul.me.uk/articles/clickonce/</a></p>
<p>
As far as I can tell, howev... | <p>The <a href="http://software.clempaul.me.uk/articles/clickonce/" rel="noreferrer">Paul Clement</a> article is the best description I've found. I also came across a topic in the <a href="http://httpd.apache.org/docs/1.3/howto/htaccess.html#when" rel="noreferrer">Apache documentation</a> that suggests putting the conf... | 11,889 |
<p>I Have an old vbs script file being kicked off by an AutoSys job. Can I, and how do I, return an int return value to indicate success or failure?</p>
| <p>Try:</p>
<pre><code>WScript.Quit n
</code></pre>
<p>Where n is the ERRORLEVEL you want to return</p>
| <p>Try:</p>
<pre><code>WScript.Quit n
</code></pre>
<p>Where n is the ERRORLEVEL you want to return</p>
| 22,645 |
<p>I got a very similar error to the one below:</p>
<p><a href="https://stackoverflow.com/questions/97800/how-can-i-fix-this-delphi-7-compile-error-duplicate-resources">How can I fix this delphi 7 compile error - "Duplicate resource(s)"</a></p>
<p>However, the error I got is this:</p>
<pre><code> [Error] ... | <p>Try renaming Manufacturing,res to Manufacturing.bak or something. Delphi should recreate the res file.</p>
<p>You would of course need to recreate any references, strings etc in the res file in the new one, but worth trying anyway...</p>
| <p>the extra <code>{$R *.res}</code> is in the *.dpr file like this:</p>
<pre><code>program Test;
uses
Forms,
Unit1 in 'Unit1.pas' {Form1},
Sample in 'Sample.pas',
Proc in 'Proc.pas';
{$R *.res} //<----delete this if you put them in the Unt1.pas. ok.
begin
Application.Initialize;
Application.CreateFo... | 22,383 |
<p>I'd like to make anchors to every post in my asp.net forum. Every forum's post is rendered using repeater control. How can I render <code><a name="anchor_name"></a></code> in asp.net?</p>
| <pre><code><a name='<%# Eval("PostId") %>' />
</code></pre>
<p>where PostId is the name of the property you want to appear in your anchor.</p>
| <p>Adding <code><a name="anchor_name"></a></code> in the ItemTempate of the repeater at the appropriate spot should do the trick. A little more information might help.</p>
| 28,055 |
<p>I've got a utility that outputs a list of files required by a game. How can I run that utility within a C program and grab its output so I can act on it within the same program?</p>
<p>UPDATE: Good call on the lack of information. The utility spits out a series of strings, and this is supposed to be portable acros... | <p>For simple problems in Unix-ish environments try <a href="http://pubs.opengroup.org/onlinepubs/009696799/functions/popen.html" rel="noreferrer"><code>popen()</code></a>. </p>
<p>From the man page:</p>
<blockquote>
<p>The popen() function opens a process by creating a pipe, forking and invoking the shell.</p>
</b... | <pre><code>//execute external process and read exactly binary or text output
//can read image from Zip file for example
string run(const char* cmd){
FILE* pipe = popen(cmd, "r");
if (!pipe) return "ERROR";
char buffer[262144];
string data;
string result;
int dist=0;
int size;
//TIME_STAR... | 6,471 |
<p>Probably an easy one:</p>
<p><strong>Are there any rules of thumb or pointers that could help recognise political requirements?</strong></p>
<p>Letβs say one of stakeholders (your boss, a head of another department or an actual user) asks for a feature or particular characteristic of software being developed by yo... | <p>Will it really help you to know? I mean - if you're already embroiled in political games you'll know anyway. If you're not it isn't something you'll be able to use.</p>
<p>If you're going to have to implement the feature anyway I'd say just get on with it. Finding out that it's part of some management game will onl... | <p>The use of ambiguous words or phrases is often political.</p>
<p>However,</p>
<p><a href="http://en.wikiquote.org/wiki/Robert_J._Hanlon" rel="nofollow noreferrer">Never attribute to malice that which is adequately explained by stupidity.</a></p>
| 27,833 |
<p>I am having trouble deciding on whether to classify my application as 'real time' or 'near real time', or perhaps even something else.</p>
<p>The software receives data immediately as it is generated from the source, then based on certain rules, raises an alert when certain conditions are met. It takes the approach... | <p>Real-time = Guaranteed maximum time for resolution. It could be picoseconds or minutes depending on the application's requirements</p>
<p>This is StackOverflow's biggest problem: unqualified people answer LOTS of questions with answers that "sound right" and get voted up, people who care whether the answer is actu... | <p>I am in agreement with John, in your scenario you are looking at least 30 seconds of delay, I would say that it is nearly real time.</p>
| 10,587 |
<p>At the <a href="http://www.binpress.com" rel="noreferrer">startup</a> I'm working at we are now considering scaling solutions for our database. Things get somewhat confusing (for me at least) with MySQL, which has the <a href="http://dev.mysql.com/doc/refman/5.0/en/faqs-mysql-cluster.html" rel="noreferrer">MySQL clu... | <p>I've been doing A LOT of reading on the available options. I also got my hands on High Performance MySQL 2nd edition, which I highly recommend.</p>
<p>This is what I've managed to piece together:
<h2>Clustering</h2></p>
<p>Clustering in the general sense is distributing load across many servers that appear to an ... | <p>I haven't used them, but from the docs i'd say that replication is the preferred solution if the biggest load is reading from the database.</p>
| 23,042 |
<p>I have been trying to understand a bit more about the wider picture of OSGi without reading thru the entire specification. As with so many things, the <a href="http://www.osgi.org/About/FAQ#q6" rel="noreferrer">introduction</a> to what OSGi actually is was probably written by someone who had been working on it for a... | <p>Yes, OSGi only deals with bundles and services running on the same VM. However, one should note that it is a distinct feature of OSGi that it facilitates running multiple applications (in a controlled way and sharing common modules) on the same JVM at all. </p>
<p>When it comes to accessing services outside the cli... | <p>If you are looking for a distributed OSGi centric Cloud runtime - then the Paremus Service Fabric ( <a href="https://docs.paremus.com/display/SF16/Introduction" rel="nofollow">https://docs.paremus.com/display/SF16/Introduction</a> ) provides these capabilities.</p>
<p>One or more Systems each consisting of a number... | 49,172 |
<p>In my Java program, I create an <a href="http://www.erlang.org/doc/apps/jinterface/java/com/ericsson/otp/erlang/OtpNode.html" rel="nofollow noreferrer">OtpNode</a> and a "named" <a href="http://www.erlang.org/doc/apps/jinterface/java/com/ericsson/otp/erlang/OtpMbox.html" rel="nofollow noreferrer">OtpMBox</a>. Whenev... | <p>You can share the OtpMBox object and use it from multiple threads. This <a href="http://erlang.org/pipermail/erlang-questions/2008-April/034558.html" rel="nofollow noreferrer">erlang-questions thread about jinterface threadsafety</a> discusses the matter.</p>
<p>Also, for the pure java specific matters you probably... | <p>I'm not really familiar with this stuff, but I suppose you may do some calculates )
You have overhead of running OtpMBox for each java-thread and overhead of controlling system (written in java) that would ask different threads to do some work and take results from them. I believe java isn't good tool for it )</p>
... | 35,970 |
<p>I'm planning to develop an app for the iPhone and that app would have to access a couple of SOAP services. While doing some basic checking in the iPhone SDK I was not able to find any support for accessing SOAP services, a bit of Googling lead to the conclusion that there is no support for SOAP in the iPhone SDK. </... | <p>One word: Don't.</p>
<p>OK obviously that isn't a real answer. But still SOAP should be avoided at all costs. ;-) Is it possible to add a proxy server between the iPhone and the web service? Perhaps something that converts REST into SOAP for you?</p>
<p>You <em>could</em> try <a href="http://csoap.sourceforge.net/... | <p>Have a look at <a href="http://www.remobjects.com" rel="nofollow noreferrer">here this link</a> and their roadmap. They have RO|C on the way, and that can connect to their web services, which probably includes SOAP (I use the VCL version which definitely includes it).</p>
| 25,025 |
<p>I'm trying to grab data from a MySQL database.</p>
<p>Approach 2 - apply/map style</p>
<p>I'm using the <a href="http://dev.mysql.com/doc/refman/5.1/en/connector-net-examples-mysqlcommand.html" rel="nofollow noreferrer" title="MySQL Reference Site">MySQL ADO Reference</a> to try to build this system. In particular... | <p>The Seq type has a neat function for handling database cursors called generate_using (see <a href="http://research.microsoft.com/fsharp/manual/FSharp.PowerPack/Microsoft.FSharp.Compatibility.Seq.html" rel="nofollow noreferrer">F# Manual</a> and the Data Access chapter in <a href="http://apress.com/book/view/97815905... | <p>It can be hard to work with imperative APIs in a non-imperative way. I don't have MySql handy, but I made an approxmiation, hopefully this will provide inspiration. Seq.unfold is a function people find pretty awesome once they grok it. List.init (or Array.init) are also handy for initializing known-size data stru... | 37,169 |
<p>I'm wandering myself what component is the best for displaying fast search results in swing. I want to create something like this, make a text field where user can enter some text, during his entering I'll improve in back end fast search on database, and I want to show data bellow the text box, and he will be able t... | <p>Are you looking for something like an AutoComplete component for Java Swing?</p>
<p><a href="https://swingx.dev.java.net/" rel="noreferrer">SwingX</a> has such a component. See <a href="http://javadesktop.org/swinglabs/build/weekly/latest/swingx-HEAD/javadoc/org/jdesktop/swingx/autocomplete/AutoCompleteDecorator.ht... | <p>Use Hibernate Search.</p>
<p>The SwingHack (<a href="http://oreilly.com/catalog/9780596009076/" rel="nofollow noreferrer">http://oreilly.com/catalog/9780596009076/</a>) book has an example of this.</p>
| 14,056 |
<p><code>Connection.close()</code> may throw <code>SqlException</code>, but I have always assumed that it is safe to ignore any such exceptions (and I have never seen code that does not ignore them). </p>
<p>Normally I would write:</p>
<pre><code> try{
connection.close();
}catch(Exception e) {}
</code></pre>
<p... | <p>Actually, what you're doing is (almost) best practice :-) here's what I saw in Spring's JdbcUtils.java. So, you might want to add
another Catch block.</p>
<pre><code>/**
* Close the given ResultSet and ignore any thrown exception.
* This is useful for typical finally blocks in manual code.
* @param resultSet ... | <p>From my experience ignoring an exception is never a good idea.
Believe me, the production support engineers and analysts will thank you a tonne if you logged the exception.</p>
<p>Also, if you are using the right Logging framework, there would be zero or minimal performance impact of the exception.</p>
| 30,832 |
<p>I know how to generally move around in command mode, specifically, jumping to lines, etc. But what is the command to jump to the end of the line that I am currently on?</p>
| <p>Just the <kbd>$</kbd> <em>(dollar sign)</em> key. You can use <kbd>A</kbd> to move to the end of the line and switch to editing mode (Append). To jump the last non-blank character, you can press <kbd>g</kbd> then <kbd>_</kbd> keys.</p>
<p>The opposite of <kbd>A</kbd> is <kbd>I</kbd> (Insert mode at beginning of l... | <p>The easiest option would be to key in <kbd>$</kbd>. If you are working with blocks of text, you might appreciate the command <kbd>{</kbd> and <kbd>}</kbd> in order to move a paragraph back and forward, respectively. </p>
| 13,124 |
<p>I see many similar questions, however I want to find the Username of the currently logged in user using Java.</p>
<p>Its probably something like:</p>
<pre><code>System.getProperty(current.user);
</code></pre>
<p>But, I'm not quite sure.</p>
| <p>You're actually really close. This is what you're looking for:</p>
<pre><code>System.getProperty("user.name")
</code></pre>
| <p>As mentioned above (and linked for Java 6), to get the current user:</p>
<pre><code>System.getProperty("user.name")
</code></pre>
<p>For Java 7: <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/System.html#getProperties%28%29" rel="nofollow noreferrer">System.getProperties()</a></p>
<p>For Java... | 5,132 |
<p>First off, I'm working on an app that's written such that some of your typical debugging tools can't be used (or at least I can't figure out how :). </p>
<p>JavaScript, html, etc are all "cooked" and encoded (I think; I'm a little fuzzy on how the process works) before being deployed, so I can't attach VS 2005 to i... | <p>setAttribute is unreliable in IE. It treats attribute access and object property access as the same thing, so because the DOM property for the 'class' attribute is called 'className', you would have to use that instead on IE.</p>
<p>This bug is fixed in the new IE8 beta, but it is easier simply to use the DOM Level... | <p>You might want to place your onclick call on the actual <code><tr></code> tag rather than the individual <code><th></code> tags. This way you have less JS in your HTML which will make it more maintainable.</p>
| 12,780 |
<p>Due to the legacy nature of some of our code, we're still using Microsoft Visual 6.0 (SP6). When I attach to a running process to debug it for the first time, it has no knowledge of where the source files are located when I break into the process. It therefore asks me to navigate to the appropriate directory in my s... | <p>The paths to the source files are recorded in the debugging information (Program Database, .pdb). Make the build tree on your machine the same as the machine it was built on.</p>
| <p><br>Yes.
<br> go into </p>
<p><BR> TOOLS
<BR> OPTIONS
<BR> DIRECTORY (tab)
<br>
<BR> and you can set the SOURCES/LIBRARIES/INCLUDE directory locations. These values apply to all projects within the workspace.</p>
<p><br> I do not know if setting those values will allow the information to be seen using direct mak... | 18,698 |
<p>Is there a command that would allow me to check if the string <code>"xyz"</code> was ever in file <code>foo.c</code> in the repository and print which revisions they were found in? </p>
| <p>This will print any commits where the diff contains xyz</p>
<pre><code>git log -Sxyz foo.c
</code></pre>
| <p>This will print any commits where the diff contains xyz. Note the <code>--</code> separating the filename from the rest of the command.</p>
<pre><code>git log -Sxyz -- foo.c
</code></pre>
<p>Without the <code>--</code>, I get this error:</p>
<pre><code>fatal: ambiguous argument 'foo.c': unknown revision or path ... | 11,457 |
<p>What is the most accurate way of timing a thread or a line of code in C# assuming the application is multithreaded?</p>
<p>Kind regards,</p>
| <p>What exactly do you mean by "timing a thread"?</p>
<p>To just time (in wall time) how long something takes, use System.Diagnostics.Stopwatch. I don't believe there's anything to measure the processor time taken by a particular thread. Of course, profilers will help you a lot, but they also affect the timing of the... | <p>If you need to accurately time operations in .NET, you want the <a href="http://msdn2.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx" rel="nofollow noreferrer">Stopwatch</a> class (which wraps the Windows QueryPerformanceCounter API). Check out this (Internet Archive) <a href="https://web.archive.org... | 31,494 |
<p>What is the best way of dynamically writing LINQ queries and Lambda expressions? </p>
<p>I am thinking of applications where the end user can design business logic rules, which then must be executed.</p>
<p>I am sorry if this is a newbie question, but it would be great to get best practices out of experience.</p>
| <p>I cannot recommend higher than you reading through the postings of Bart De Smet (<a href="http://community.bartdesmet.net/blogs/bart/" rel="noreferrer">http://community.bartdesmet.net/blogs/bart/</a>), he is really brilliant when it comes to Lambda.</p>
<p>His recent series covered dynamic Lambda, starting with <a ... | <p>I don't understand what do you mean saying "best way". It would be better to provide simple example of what you want to achieve. Composing dynamic LINQ expression is not hard but tricky. </p>
<p>Here is an example of dynamic linq expression creation:</p>
<p><a href="https://stackoverflow.com/questions/53597/how-do... | 13,923 |
<p>Recently our svn server was changed and we did a svn switch.</p>
<p>Since the working copy had a huge amount of unversioned resources, the working copy got locked and we started switching folder by folder for all folders under svn, which works perfectly fine.</p>
<p>But at the top most level of the repository, whe... | <p>If you get a "not a working copy" when doing a recursive <code>svn cleanup</code> my guess is that you have a directory which should be a working copy (i.e. the <code>.svn</code> directory at the top level says so), but it is missing its own <code>.svn</code> directory.</p>
<p>In that case, you could try t... | <p>Delete .svn folder that is present in your local machine. Press windows icon and type .svn, delete the entire folder. It worked for me.</p>
| 48,950 |
<p>I want to design a web page with a banner and an iframe. I hope the iframe can fill all the remaining page height and be resized automatically as the browser is resizing. Is it possible to get it done without writing JavaScript code, only with CSS?</p>
<p>I tried to set <code>height:100%</code> on iframe, the result... | <h3>Update in 2019</h3>
<p><strong>TL;DR:</strong> Today the best option is - <strong>flexbox</strong>. Everything supports it nicely and has for years. Go for that and don't look back. Here is a code sample for flexbox:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"... | <p>You can do this by measuring the body size on load/resize events and setting the height to the (full height - banner height).</p>
<p><em>Note that currently in IE8 Beta2 you can't do this onresize as that event is currently broken in IE8 Beta2.</em></p>
| 42,114 |
<p>Can fogbugz track case dependencies?</p>
| <p>Yes and no. Cases can be linked to each other, but if you're looking for a tree of cases (prerequisites and such), you need FogBugz 7 or later.</p>
<p>If you're using FogBugz 7.3 or greater, you can now use the <a href="http://www.fogcreek.com/fogbugz/plugins/plugin.aspx?ixPlugin=57" rel="nofollow noreferrer">Case ... | <p>FogBugz 7 now supports sub-cases. This may or may not solve your problem, depending on how you want to handle it.</p>
| 4,681 |
<p>For last two weeks I have been struggling with flow rate adjustments. I'm using an UM2, colorFabb XT 1.75mm and Slic3r. Before printing a test cube I made flow rate adjustments using the "Perimeter test" (printed a hallow cube with 1 layer thin perimeter line). I then compared the desired value of the perimeter's wi... | <p>It looks like you overtune it. I think it's because top layer of hollow object doesn't have any support (which is obvious) but because of that the filament is not oblate that's why it looks like underextruded.</p>
<p>If you really need hollow object then set number of top layers to 3..5 then check if it helps. I kn... | <p>I've had that issue on my 3D printing shop. </p>
<p>That kind of problem usually happens when the extruder driving gear gets worn out. This makes the extruder loose it's grip on the filament and diminishes the flow of the extrusion, resulting on the prints you show on your photo.</p>
<p>Depending on the time you h... | 296 |
<p>I would like to generate documentation for a RESTful web service API that is written in Python. Ideally it would look like Yahoo's RESTful web service docs. Does anyone have any ideas or references?</p>
| <p>The Sphinx project (<a href="https://www.sphinx-doc.org" rel="nofollow noreferrer">www.sphinx-doc.org</a>) is the current state-of-the-art in Python documentation. It's really powerful and flexible... so also somewhat confusing. Still, I think it is your best bet.</p>
<p>There is excellent documentation on their si... | <p>Unfortunately I don't know anything specific that will help you in Python specifically -- However just as points of reference, you might take a peak at the WADL specification that the JAX-RS java spec is using -- <a href="https://wadl.dev.java.net/" rel="nofollow noreferrer">https://wadl.dev.java.net/</a> -- Additio... | 38,558 |
<p>I'm asking for a template trick to detect if a class has a specific member function of a given signature.</p>
<p>The problem is similar to the one cited here
<a href="http://www.gotw.ca/gotw/071.htm" rel="noreferrer">http://www.gotw.ca/gotw/071.htm</a>
but not the same: in the item of Sutter's book he answered to t... | <p>I'm not sure if I understand you correctly, but you may exploit SFINAE to detect function presence at compile-time. Example from my code (tests if class has member function size_t used_memory() const).</p>
<pre><code>template<typename T>
struct HasUsedMemoryMethod
{
template<typename U, size_t (U::*)()... | <p>Without C++11 support (<code>decltype</code>) this might work:</p>
<h1>SSCCE</h1>
<pre><code>#include <iostream>
using namespace std;
struct A { void foo(void); };
struct Aa: public A { };
struct B { };
struct retA { int foo(void); };
struct argA { void foo(double); };
struct constA { void foo(void) const;... | 11,292 |
<p>I get the following message in a VC6 project compile:</p>
<blockquote>
<p>OTE: WINVER has been defined as 0x0500 or greater which enables
Windows NT 5.0 and Windows 98 features. When these headers were released,
Windows NT 5.0 beta 1 and Windows 98 beta 2.1 were the current versions.
For this release when W... | <p>The warning message you're seeing is from the Platform SDK that was supplied with the Visual C++ 6.0 installation, which it seems dates from when Windows 2000 was in beta.</p>
<p>If your application requires <code>WINVER</code> to be <code>0x0500</code>, and you still need to use Visual C++ 6.0, I would recommend t... | <p>Or VC6's include path doesn't include your SDK and it's only using the ones that came with VC6.</p>
| 29,191 |
<p>In a stylesheet i have:</p>
<pre><code> * HTML BODY
{
padding-right: 0px;
padding-left: 0px;
padding-bottom: 25px;
padding-top: 190px;
}
* HTML #maincontent
{
width: 100%;
height: 100%;
}
</code></pre>
<p>i know that a . means class and a # mea... | <p>The * is the universal selector, and thus matches any element. e.g.</p>
<pre><code>P * { }
</code></pre>
<p>Matches any element which is the child of a P tag</p>
<pre><code>* HTML
</code></pre>
<p>should mean nothing because HTML cannot be the child of anything (by definition). It's used because IE (edit, at lea... | <p>For the 2nd snippet, since * matches anything the element item is redundant. It looks like it's there to remind the author of the intent of the styles- that if he changes something in the 2nd snippet make sure he checks the #maincontent element to make sure it looks right.</p>
| 49,516 |
<p>I have a button on my webform. Clicking this button will do an HttpWebRequest during the onclick event handler. After the request we copy the response from the request into HttpContext.Current.Response and send that to the client.</p>
<p>This web request can take a while (up to 5 seconds, since it's generating a re... | <p>As an alternative to the Professional AJAX.NET library, jQuery has a really nice way of doing this.</p>
<p>Take a look at <a href="http://www.junasoftware.com/blog/using-jquery-ajax-and-page-methods-with-a-asp.net-webservice.aspx" rel="nofollow noreferrer">this example</a> of using a .NET PageMethod (if possible in... | <p>The solution I'm presenting here is aimed to show a method to let a "Loading..." box to appear while you're server-side processing and to disappear when server-side processing is complete.</p>
<p>I'll do this with the very basic AJAX machinery (tested on FF, but IE should be ok either), i.e. not using a framework l... | 22,401 |
<p>I have a .net (3.5) WinForms application and want to display some html on one of the forms. Is there a control that I can use for this?</p>
| <p>Yep sure is, the WebBrowser control.</p>
| <p>what about the browser control? a bit heavy, but at least you'll get an accurate rendering.</p>
| 12,311 |
<p>I have an Panel control that I need to maintain position across postbacks. I am able to do this by maintaining a cookie which is read each time the page is loaded to get the position of the Panel before the page is loaded. </p>
<p>The problem is, the page is loaded, then repositioned which causes this brief flash w... | <p>Could you register the function that positions the panel in the pageLoad event of the ASP.NET client-side library?</p>
<p>This link may be helpful: <a href="http://asp.net/AJAX/Documentation/Live/overview/AJAXClientEvents.aspx" rel="nofollow noreferrer">ASP.NET AJAX Client Life-Cycle Events</a></p>
| <p>Because you're storing the panel's location in a cookie, you could update the panel's location during the server side postback event.</p>
| 17,987 |
<p>I definitifely like the one at stackoverflow, because it's clean and simple. Also the live preview with code/syntax hilighting is really helpful (and motivating).</p>
<p>What is your favourite Javascript Editor Framework and why?</p>
| <p>I like <a href="http://themaninblue.com/experiment/widgEditor/" rel="nofollow noreferrer">widgEditor</a> because it's very simple and it only do the minimum. TinyMCE or FCKeditor are goods, but they are too big for what I need.</p>
| <p>I love <a href="http://tinymce.moxiecode.com/" rel="nofollow noreferrer">tiny_mce</a></p>
<p>Goran</p>
| 17,806 |
<p>By default tomcat will create a session cookie for the current domain.</p>
<p>If you are on www.example.com, your cookie will be created for www.example.com (will only work on www.example.com). Whereas for example.com it will be created for .example.com (desired behaviour, will work on any subdomain of example.com ... | <p>This is apparently supported via a configuration setting in 6.0.27 and onwards:</p>
<blockquote>
<p>Configuration is done by editing
META-INF/context.xml</p>
<p><Context
sessionCookiePath="/something"
sessionCookieDomain=".domain.tld" /></p>
</blockquote>
<p><a href="https://issues.apache.org/bu... | <p>I've run into this at $DAYJOB. In my case I wanted to implement SSL signon then redirect to a non SSL page. The core problem in tomcat is the method (from memory) SessionManager.configureSessionCookie which hard codes all the variables you would like to get access to. </p>
<p>I came up with a few ideas, including a... | 10,833 |
<p>I need a cross-platform editor control to use as GUI-part in an in-house tool. The control may be commercial, but with reasonable price.</p>
<p>Required features:</p>
<ul>
<li>Platforms: Win32, OS X, Linux</li>
<li>UTF-8 support</li>
<li>Fine-grained run-time control to the text style (or at least color)</li>
<li>... | <blockquote>
<p>Scintilla and descendants (no OS X)</p>
</blockquote>
<p>But, scintilla does work on OS X.</p>
<hr>
<p>You could try GTK+ with <a href="http://library.gnome.org/devel/gtk/stable/GtkTextView.html" rel="nofollow noreferrer"><code>GtkTextView</code></a>, or Qt's <a href="http://doc.trolltech.com/4.4/q... | <p>Well,
you might be able to use <a href="http://www.tcl.tk/" rel="nofollow noreferrer">tk</a> -- the text widget is supposedly good and flexible -- have a looksie at <a href="http://wiki.tcl.tk/1402" rel="nofollow noreferrer">the tcl/tk wiki</a>.</p>
<p>Or you could go for some embedded/game toolkit (like <a href="h... | 23,915 |
<p>When using C++ namespaces, do you prefer to explicitly name them, like this:</p>
<pre><code>std::cout << "Hello, world!\n";
</code></pre>
<p>Or do you prefer <code>using namespace</code>:</p>
<pre><code>using namespace std;
cout << "Hello, world!\n";
</code></pre>
<p>And if if you prefer the latter, ... | <p>I always use <code>using namespace</code> for std & boost. Everything else I tend to use an explicit namespace unless it is used so much that it would clutter up the code.</p>
<p>In headers, I never use <code>using namespace</code> to avoid polluting the global namespace of the #including source.</p>
| <p>I only use explicit namespaces when there's some ambiguity. It is more readable, but the extra typing is too tedious, and you have to assume other developers have a baseline level of familiarity with standard libraries.</p>
<p>The only other times I spell out a namespace are when I'm only using it once or twice, l... | 26,422 |
<p>Can anyone point me to a good, simple, example of a Google API (AJAX Search API I suppose?) that can be implemented in VB.net (2008)? I have tried to sign up for a Google API key but it wants a URL from which the search will be executed from. I dont have a URL for this example. I tried <a href="http://localhost"... | <p>If you're running a Google API locally for development or test purposes, you can use an internal IP address - it doesn't have to be URL that's exposed to the Internet. For example, I have development machines running the Google Maps API using addresses in the 192.168.0.xxx range. This allows them to be accessed from... | <p>I do not think the Google API TOS allows for .net development. I read that in a newsgroup article recently.</p>
| 13,144 |
<p>For more information - <a href="http://en.wikipedia.org/wiki/Personal_Software_Process" rel="noreferrer">Personal Software Process on Wikipedia</a> and <a href="http://en.wikipedia.org/wiki/Team_Software_Process" rel="noreferrer">Team Software Process on Wikipedia</a>.</p>
<p>I have two questions:</p>
<ol>
<li>Wha... | <p>I went through the training and then my company paid for me to go to Carnegie Mellon and go through the PSP instructor training course to get certified as an instructor. I think the goal was to use this as part of our company's CMM/CMMI effort. I met Watts Humphrey and found him to be a kind, gentle soul with some... | <p>I used it during university but at work we really don't have a process at all. Only recently have we started using version control.</p>
<p>My experience with it was that it seemed far too tedious to be useful. If it's not automated, then it can go away.</p>
| 4,784 |
<p>We have SOAP web services in production that are relying on SOAP Headers (containing plain client credentials) for the authentication. The WS are used in heterogeneous environments with .NET/Java/PHP/Python/C++ clients both web app or desktop app.</p>
<p>We are considering a v2 for those WS and I am wondering what ... | <p>The easiest way to handle it across a variety of platforms is to use HTTP basic authentication and HTTPS for the transport layer. WS-Security would be good if your needs go beyond simple username/password but the support is going to vary quite a bit between platforms. HTTP authentication is supported by every decent... | <p>If you have to roll it all yourself and can't use HTTPS, I'd suggest the hash-based UsernameToken portion of WS-Security. It's pretty secure and fairly easy to implement as long as your libraries have the hashing functions.</p>
<p>If you're doing web services, I wouldn't rely on HTTP for authentication.</p>
<p>WS... | 19,641 |
<p>Do you use code-generation tools (aside from those used to generate proxies and from designers built-in to visual studio)? </p>
<p>What part(s) of your application do you generate? </p>
<p>Do you typically roll your own generator? If so, what type of generator do you write (asp templates, coddom etc.). If not, wha... | <p>I'm in the philosophical camp that considers code generators to be "wrong", because they indicate something that should be made part of the language.</p>
<p>But it's been a big part of the Pragmatic Programmer's ethic to write code that writes code, and in practice code generation works well if the generated code i... | <p>We have an in-house built code generator that takes care of database access. One writes stored procedures and gets corresponding methods abstracted in a gateway class.</p>
<p>We also generate web services in order to properly interface with Flash -- i.e. handling exception in a sane manner.</p>
<p>Finally we have ... | 17,359 |
<p>I have a simple .NET 2.0 windows form app that runs off of a networked drive (e.g. \MyServer\MyShare\app.exe). It's very basic, and only loads the bare minimum .NET libraries. However, it still takes ~6-10 seconds to load. People think something must be wrong that app so small takes so long to load.</p>
<p>Are t... | <p>Try out <a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx" rel="nofollow noreferrer">Sysinternals Process Explorer</a>. It has an column of "% time in JIT". If that number is large you could run <a href="http://msdn.microsoft.com/en-us/library/6t9t5wcf(VS.80).aspx" rel="nofollow noreferrer">nge... | <p>You could cheat like Microsoft Office (and Adobe I think) and add an app in the Startup group that tells the app to load and then immediately unload. That way the DLL's are pre-cached in memory for when the user tries to start the app. Only catch: I'm not completely sure if it works this way with networked files -... | 13,039 |
<p>Let's say we have the following method declaration:</p>
<pre><code>Public Function MyMethod(ByVal param1 As Integer, _
Optional ByVal param2 As Integer = 0, _
Optional ByVal param3 As Integer = 1) As Integer
Return param1 + param2 + param3
End Function
</code></pre>
<p>How does VB.NET make the optiona... | <p>Interestingly, this is the decompiled C# code, obtained via reflector.</p>
<pre><code>public int MyMethod(int param1,
[Optional, DefaultParameterValue(0)] int param2,
[Optional, DefaultParameterValue(1)] int param3)
{
return ((param1 + param2) + param3);
}
</code></pre>
... | <p>Contrary to popular belief, optional parameters do appear to be CLS-compliant. (However, my primary check for this was to mark the assembly, class and method all with the CLSCompliant attribute, set to True.)</p>
<p>So what does this look like in MSIL? </p>
<pre><code>.method public static int32 MyMethod(int32 pa... | 12,963 |
<p>Starting with 2005, VS started this behavior of when starting debugging session it spawns up a webserver for every project in a solution. I have a solution with 15 projects so it takes a while and is a waste of resources. Is there a way to configure it differently besides just using IIS?</p>
| <p>Some details here on why it does it and how you can overcome it:</p>
<p><a href="http://vishaljoshi.blogspot.com/2007/12/tips-tricks-start-up-options-and.html" rel="noreferrer">http://vishaljoshi.blogspot.com/2007/12/tips-tricks-start-up-options-and.html</a></p>
<blockquote>
<p>There are instances when you might... | <p>I have also been highly annoyed by that behavior. The only solution I have found is to manually change the properties page for each web appllication so it hits a real running instance in IIS.</p>
<p>I prefer this anyway, because debugging with the integrated web server can give you a very false impression of how y... | 3,707 |
<p>I have an Access 2007 form that is searchable by a combobox. When I add a new record, I need to update the combobox to include the newly added item. </p>
<p>I assume that something needs to be done in AfterInsert event of the form but I can't figure out what. </p>
<p>How can I rebind the combobox after inserting... | <p>The easiest way is to guarantee that the combobox is always up-to-date is to just requery the combobox once it gets the focus. Even if the recordset is then updated somewhere else, your combobox is always up-to-date. A simple TheCombobox.Requery in the OnFocus event should be enough.</p>
| <p>I assume your combobox is a control on a form, not a combobox control in a commandBar. This combobox has a property called rowsource, that can be either a value list (husband;wife;son;girl) or a SQL SELECT instruction (SELECT relationDescription FROM Table_relationType). </p>
<p>I assume also that your form records... | 10,639 |
<p>Does the Java language have delegate features, similar to how C# has support for delegates?</p>
| <p>Not really, no.</p>
<p>You may be able to achieve the same effect by using reflection to get Method objects you can then invoke, and the other way is to create an interface with a single 'invoke' or 'execute' method, and then instantiate them to call the method your interested in (i.e. using an anonymous inner class... | <p>Java doesn't have delegates and is proud of it :). From what I read here I found in essence 2 ways to fake delegates:
1. reflection;
2. inner class</p>
<p>Reflections are slooooow! Inner class does not cover the simplest use-case: sort function. Do not want to go into details, but the solution with inner class basi... | 6,668 |
<p>I'm doing some searching of tags, and some users like "cat" while others like "Cat" Go figure...</p>
<p>Anyways, is there a way to force a particular find to be case sensitive? Such as:</p>
<pre><code>Tag.find(:some-special-option-here)
</code></pre>
<p>Any ideas?</p>
| <p>You can also do a case-sensitive search without changing your column properties. </p>
<pre><code>SELECT * FROM mytable WHERE myfield='Value'
</code></pre>
<p>This query matches:</p>
<ul>
<li>Value</li>
<li>value</li>
<li>VALUE</li>
<li>vAlUe</li>
<li><em>and so on</em></li>
</ul>
<p>While...</p>
<pre><code>SEL... | <p>In the mysql database, set your text's data type to utf_collate_bin. For example:</p>
<pre><code>ALTER TABLE `sets` CHANGE `set_name` `set_name` VARCHAR( 64 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL
</code></pre>
<p>Where 'sets' is the table, 'set_name' is the column of type VARCHAR(64). You can also do this ... | 33,113 |
<p>How would I Export tables specifying only certain fields?</p>
<p>I am using mysql 5.0 - using either a sql command or mysqldump.</p>
<p>My table is X, and the fields I want to export are A,B,C</p>
| <pre><code>SELECT A,B,C
FROM X
INTO OUTFILE 'file name';
</code></pre>
<p>You need the FILE privilege to do this, and it won't overwrite files.</p>
<p><code>INTO OUTFILE</code> has a bunch of options to it as well, such as <code>FIELDS ENCLOSED BY</code>, <code>FIELDS ESCAPED BY</code>, etc... that you may want to <a... | <p>Try:</p>
<pre><code>SELECT col1, col2
INTO OUTFILE '/filepath/export.txt'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM table;
</code></pre>
| 47,396 |
<p>The problem is in the title - IE is misbehaving and is saying that there is a script running slowly - FF and Chrome don't have this problem.</p>
<p>How can I find the problem . .there's a lot of JS on that page. Checking by hand is not a good ideea</p>
<p><strong>EDIT :</strong> It's a page from a project i'm work... | <p>Long running scripts are detected differently by different browsers:</p>
<ul>
<li>IE will raise the warning once 5 million statements have been executed (<a href="http://support.microsoft.com/kb/175500" rel="noreferrer">more info on MSDN</a>)</li>
<li>Firefox will warn if the script takes longer than 10 seconds (<a... | <p>I don't believe there's a tool that can find the offending script. You might try attaching an IE debugger like Visual Studio and maybe it will break at the point where the problem is occurring. But I can't give any guarantees on that working.</p>
<p>In the past when I've had similar problems I've simply commented o... | 26,122 |
<p>I'm logged into a SQL Server 2005 database as a non-sa user, 'bhk', that is a member of the 'public' server role only. The following code tries to execute within a stored procedure called by user 'bhk'. This line of code...</p>
<pre><code>TRUNCATE TABLE #Table1
DBCC CHECKIDENT('#Table1', RESEED, @SequenceNumber) WI... | <p>Here is an alternate solution, that may work if you need to re-seed with a sequence number of more than 1.</p>
<pre><code>TRUNCATE #Table1
SET IDENTITY_INSERT #Table1 ON
INSERT INTO #Table1 (TableID) -- This is your primary key field
VALUES (@SequenceNumber - 1)
SET IDENTITY_INSERT #Table1 OFF
DELETE FROM #Tabl... | <p>An alternate solution to doing the TRUNCATE and CHECKIDENT commands would be to simply drop and re-create your temporary table. E.g.</p>
<pre><code>DROP TABLE #Table1
CREATE TABLE #Table1
(
....
)
</code></pre>
<p>This may not be the most efficient solution though.</p>
| 22,775 |
<p>I have 3 tables (archive has many sections, section (may) belong to many archives):</p>
<ul>
<li><p><code>archive</code></p>
<ul>
<li><code>id PK</code></li>
<li><code>description</code></li>
</ul></li>
<li><p><code>archive_to_section</code></p>
<ul>
<li><code>archive_id PK FK</code></li>
<li><code>section_id PK ... | <p>According to <a href="http://www.w3schools.com/browsers/browsers_stats.asp" rel="nofollow noreferrer">some</a> - <a href="http://www.adtech.info/news/pr-08-07_en.htm" rel="nofollow noreferrer">browser</a> - <a href="http://www.thecounter.com/stats/2008/September/browser.php" rel="nofollow noreferrer">statistics</a>,... | <p>Unfortunately, I have a bunch of friends in other businesses that are sticking with IE6, and don't have a plan to upgrade.</p>
<p>They don't like the tabs in IE7, they don't want to go with another browser, etc, etc, etc.</p>
<p>There is enough of this that filters back to me, that I continue to test against IE6, ... | 25,625 |
<p>I'm creating an ORM in PHP, and I've got a class 'ORM' which basically creates an object corresponding to a database table (I'm aiming for similar to/same functionality as an ActiveRecord pattern.) ORM itself extends 'Database', which sets up the database connection. </p>
<p>So, I can call: <code><pre>$c = new Cust... | <p>I agree with the other answers here - put the additional methods into a descendant class. I'd also add an asterisk to that though: each time you extend the class with extra methods, think about what you are trying to achieve with the extension, and think about whether or not it can be generalised and worked back int... | <p>You should absolutely extend the ORM class. Different things should be objects of different classes. Customers are very different from Products, and to support both in a single ORM class would be unneeded bloat and completely defeat the purpose of OOP.</p>
<p>Another nice thing to do is to add hooks for before save... | 17,693 |
<p>I have a requirement to validate an incoming file against an XSD. Both will be on the server file system.<br /></p>
<p>I've looked at <code>dbms_xmlschema</code>, but have had issues getting it to work.</p>
<p>Could it be easier to do it with some Java?<br />What's the simplest class I could put in the database?</... | <p><strong>Update</strong></p>
<p>XML Schema registration requires following privileges:</p>
<pre><code>grant alter session to <USER>;
grant create type to <USER>; /* required when gentypes => true */
grant create table to <USER>; /* required when gentables => true */
</code></pre>
<p>For som... | <p>If I remember correctly, that error message is given when XDB (Oracle's XML DataBase package) is not properly installed. Have the DBA check this out.</p>
| 10,775 |
<p>How do you use network sockets in Pascal?
ΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒΒ</p>
| <p>Here's an example taken from <a href="http://www.bastisoft.de/programmierung/pascal/pasinet.html" rel="nofollow noreferrer">http://www.bastisoft.de/programmierung/pascal/pasinet.html</a></p>
<pre><code>program daytime;
{ Simple client program }
uses
sockets, inetaux, myerror;
const
RemotePort : Word = 13;
... | <p>If you are using Delphi, I highly recommend <a href="http://www.indyproject.org/index.en.aspx" rel="nofollow noreferrer">Indy</a> sockets, a set of classes for easy manipulation of sockets and many other internet protocols (HTTP, FTP, NTP, POP3 etc.)</p>
| 3,775 |
<p>I need to get the data of an particular <code><td></code>, but I don't have any <code>id</code> or <code>name</code> for that particular <code><td></code>. How do you get the contents of that <code><td></code>?</p>
<p>For example:</p>
<pre><code><table>
<tr><td>name</td>... | <p>A quick solution:</p>
<pre><code>function GetTdContent(label)
{
var TDs = document.getElementsByTagName("TD");
var foundFlag = false;
for (i = 0; i < TDs.length; i++)
{
if (foundFlag) return TDs[i].innerHTML;
foundFlag = TDs[i].innerHTML.toLower() == label.toLower();
}
}
</code></pre>
<p>els... | <p>Use XPath (tutorial here, including instructions for IE and other browsers: <a href="http://www.w3schools.com/XPath/xpath_examples.asp" rel="nofollow noreferrer">http://www.w3schools.com/XPath/xpath_examples.asp</a>)</p>
<p>The xpath for your example is</p>
<p>//table/tr/td[text()="designation"]/following::td</p>
... | 32,207 |
<p>First of all, I'm kinda new to the barcode formats and what I do know, I've learned from Wikipedia.</p>
<p>We have some barcodes generated by an existing app that uses the Barcode.4NET library. The barcode is in Code 128A format. The code to generate them is pretty simple, looking something like this:</p>
<pre><co... | <p>Is it really necessary for them to look exactly the same? The different versions of Code 128 are all capable of encoding numbers, even if the barcodes themselves look completely different; the reader should sort it all out in the end.</p>
<p>I prefer the B variant, because it has the lower case letters in addition... | <p>While I think balexandre has the generators mixed up, his advice is good.</p>
<p>Evidently Barcode.4NET is correctly generating the Code 128A barcode that I am trying to emulate.</p>
<p>iTextSharp is generating a Code 128C barcode which, according to Mark Ransom, should be OK except for the users and customer will... | 37,630 |
<p>I am trying out FirePHP.</p>
<p>I installed it and restarted Firefox, enabled Firebug for my localhost, moved the demo <code>oo.php</code> file that comes with the download into an IIS virtual directory, changed the include path, removed the <code>apache_request_headers()</code> call since I am running IIS, and the... | <p>I believe FirePHP required you install a Firefox extension (in addition to Firebug) that watches for the HTTP headers and puts them in the console. </p>
<p>If that isn't the problem then I'd recommend grabbing a copy of <a href="http://www.charlesproxy.com/" rel="noreferrer">Charles</a>. It will let you view the he... | <p>I had the same issue and it turned out that the 'Net' tab of firebug wasn't enabled caused firephp to not show anything in the console. Enabled Net tab and voila!</p>
| 9,437 |
<p>Could someone please explain to me how the current python webframworks fit together?</p>
<p>The three I've heard of are CherryPy, TurboGears and Pylons. However I'm confused because TurboGears seems to use CherryPy as the 'Controller' (although isn't CherryPy a framework in in it's own right?), and TurbGears 2 is g... | <p>There are more to it ofcourse.</p>
<p>Here's a comprehensive list and details!</p>
<p><a href="http://wiki.python.org/moin/WebFrameworks" rel="noreferrer"><strong>Web Frameworks for Python</strong></a></p>
<p>Extract from above link:</p>
<blockquote>
<p><H2>Popular Full-Stack Frameworks</H2></p>
<p>A web ... | <p>Have you tried FastAPI.
It's a is a modern, fast (high-performance), web framework for building APIs with Python 3.6+ based on standard Python type hints.</p>
<p>Pretty easy to learn, quite powerful and lightweight.
<a href="https://fastapi.tiangolo.com/" rel="nofollow noreferrer">https://fastapi.tiangolo.com/</a>... | 23,198 |
<p>How can I convert a JavaScript string value to be in all lower case letters?</p>
<p>Example: <code>"Your Name"</code> to <code>"your name"</code></p>
| <pre><code>var lowerCaseName = "Your Name".toLowerCase();
</code></pre>
| <p>Try</p>
<pre class="lang-html prettyprint-override"><code><input type="text" style="text-transform: uppercase"> <!-- uppercase -->
<input type="text" style="text-transform: lowercase"> <!-- lowercase -->
</code></pre>
<p><a href="http://jsfiddle.net/o... | 18,733 |
<p>I just noticed the other day that my Ender 3 is printing stuff a lot slower than it can, and realized when I was slicing a part that it's because the default "Wall Print Speed" is half the "Print Speed" even though "Infill Speed" is full speed. I can enter higher speeds, of course, but... | <p>Cura has a lot of bad defaults, but also a lot of defaults that are chosen to let you get acceptable prints out of a really bad printer, a miscalibrated printer, or a printer with bad firmware.</p>
<p>Printing at anything above very low speeds requires compensation for the differing pressure needed to move material ... | <p>Perimeters, especially External Perimeters, are particularly sensitive to small deflections of the printhead, as well as extrusion issues from too fast of a print speed. You may be able to increase this speed for regular perimeters, however, higher speeds may introduce more ghosting issues.</p>
| 1,981 |
<p><a href="http://thedailywtf.com/Articles/The-Hot-Room.aspx" rel="noreferrer">http://thedailywtf.com/Articles/The-Hot-Room.aspx</a></p>
<p>You see how at the bottom there're links to the next and previous articles ("Unprepared For Divide_By_Zero" and "A Completely Different Game")? How do I do that, but selecting th... | <p>Or extending Jeremy's answer...<br />
In one query</p>
<pre><code>(SELECT * FROM articles WHERE id > ?
AND private IS NULL
ORDER BY id ASC LIMIT 1)
UNION
(SELECT * FROM articles WHERE id < ?
AND private IS NULL
ORDER BY id DESC LIMIT 1)
</code></pre>
| <p>How about a nested select?</p>
<pre><code>SELECT * FROM articles WHERE id IN (
SELECT id FROM articles WHERE id > ? AND private IS NULL ORDER BY id ASC LIMIT 1)
)
OR id IN (
SELECT id FROM articles WHERE id < ? AND private IS NULL ORDER BY id DESC LIMIT 1
);
</code></pre>
| 20,427 |
<p>I don't want a "close window" menu item in the task bar context menu for my WPF window. My intention is to annoy the user.</p>
<p>Thank you!</p>
| <p>Although I don't see a reason to remove the close command from the menu other than to annoy users you can find information how to modify the system menu of an application in C# using WinAPI calls here:</p>
<blockquote>
<p><a href="http://www.codeguru.com/csharp/csharp/cs_misc/userinterface/article.php/c9327" rel=... | <p>Although I don't see a reason to remove the close command from the menu other than to annoy users you can find information how to modify the system menu of an application in C# using WinAPI calls here:</p>
<blockquote>
<p><a href="http://www.codeguru.com/csharp/csharp/cs_misc/userinterface/article.php/c9327" rel=... | 45,417 |
<p>My singleton accessor method is usually some variant of:</p>
<pre><code>static MyClass *gInstance = NULL;
+ (MyClass *)instance
{
@synchronized(self)
{
if (gInstance == NULL)
gInstance = [[self alloc] init];
}
return(gInstance);
}
</code></pre>
<p>What could I be doing to impr... | <p>Another option is to use the <code>+(void)initialize</code> method. From the documentation:</p>
<blockquote>
<p>The runtime sends <code>initialize</code> to each class in a program exactly one time just before the class, or any class that inherits from it, is sent its first message from within the program. (Thus... | <p>I usually use code roughly similar to that in Ben Hoffstein's answer (which I also got out of Wikipedia). I use it for the reasons stated by Chris Hanson in his comment.</p>
<p>However, sometimes I have a need to place a singleton into a NIB, and in that case I use the following:</p>
<pre><code>@implementation Sin... | 17,499 |
<p>I have a question about best practices regarding how one should approach storing complex workflow states for processing tasks in a database. I've been looking online to no avail, so I figured I'd ask the community what they thought was best.</p>
<p>This question comes out of the same "BoxItem" example I gave in a ... | <p>If I'm understanding correctly, I would add the BoxItemTasks table (just an enumeration table, right?), then a BoxItemActions table with foreign keys to BoxItems and to BoxItemTasks for what type of task it is. If you want to make it so that a particular task can only be performed once on a particular box item, jus... | <p>For what it's worth, in BizTalk they "dehydrate" long-running message patterns (workflows and the like) by binary serializing them to the database.</p>
| 14,225 |
<p>In a C# application I am working on I have a very long identifier as follows:-</p>
<pre><code>foo.bar.bwah.blah.whatever.very.very.huge
</code></pre>
<p>Whenever I to reference this object it's an absolute nightmare, and unfortunately I do need to reference it a lot:-</p>
<pre><code>var something = foo.bar.bwah.b... | <p>One way out is to use one or a pair of lambdas.</p>
<p>For example:</p>
<pre><code>Func<string> getter = () => blah_de_blah;
Action<string> setter = x => blah_de_blah = x;
</code></pre>
<p>Now, you can use getter and setter to read and write the long identifier.</p>
<p>However, since your dots ... | <p>First thing. I would rethink your architecture. That seems way too complicated! :)</p>
<p>Anyways, let's get to business. </p>
<p><strong>Strings are immutable in .NET</strong> and that's your problem. When you change the object's property, you are creating a new string on memory and pointing there with the object... | 41,448 |
<p>I have come to see an Installer class item in Visual studio. Why they have maintain an seperate item for Installer. Do they create any custom installers ?</p>
| <p>The Installer class can be used to configure items such as performance counters and message queues as part of the installation of your code. They can be included with any assembly and the most basic way to install components related to an assembly is to use InstallUtil yourassembly.dll which would contain your code... | <p>I also use them to override behavior in the base installer class, such that I can run validations based on input in the MSI wizard, create files and folders, etc.</p>
<p>For Windows Services, I think they are required.</p>
| 24,361 |
<p>I have an HBot 3D 1.1 printer (it's a CoreXY style printer, newer versions are produced by ZMorph). I think that a filament guide tube inside the hotend got damaged, resulting in decreased diameter, which means I can't push the filament through it. It stops halfway through the heatsink (black marker in the attached ... | <p>This is an old hotend type, it is called a <a href="https://www.google.com/search?q=j+head+nozzle" rel="noreferrer">J-Head</a> (see e.g. the <a href="https://reprap.org/wiki/J_Head_Nozzle#Mk_V" rel="noreferrer">J-Head Nozzle Mk V</a>, I'm unsure which exact version you have). The hotend is serviceable, you can buy s... | <p>Not exactly the type of answer you probably want, but this hotend does not look servicable. The nozzle is usually considered a consumable part unless it's made of something like tungsten carbide, or at least steel. The nozzle is almost surely long past its useful life unless the printer was barely used, and the enti... | 2,209 |
<p>I would like to know the complexity in Big O notation of the STL multiset, map and hash map classes when:</p>
<ul>
<li>inserting entries</li>
<li>accessing entries</li>
<li>retrieving entries</li>
<li>comparing entries</li>
</ul>
| <h1>map, set, multimap, and multiset</h1>
<p>These are implemented using a <a href="http://en.wikipedia.org/wiki/Red-black_tree" rel="noreferrer">red-black tree</a>, a type of <a href="http://en.wikipedia.org/wiki/Balanced_binary_search_tree" rel="noreferrer">balanced binary search tree</a>. They have the following a... | <p>For <strong>set</strong>, <strong>multiset</strong>, <strong>map</strong>, <strong>multimap</strong> the time complexity for insertion, deletion and retrieving information is <strong>O(logn)</strong> as they follow the balance binary tree to structure the data.</p>
<p>For <strong>unordered_set</strong> and <strong>u... | 27,474 |
<p>How do you modify a propertygrid at runtime in every way? I want to be able to add and remove properties and add "dynamic types", what I mean with that is a type that result in a runtime generated dropdown in the propertygrid using a TypeConverter.</p>
<p>I have actually been able to do both those things (add/remov... | <p>What you do, is adding StatesList (a TypeConverter) as a property.<br>
What you should do, is adding a property with StatesList as its TypeConverter.</p>
| <p>in my case TypeConverter did not apply to States class</p>
<pre><code>[TypeConverter(typeof(StatesList))] // not work
public class States
{
}
</code></pre>
<p>so i added override in CustomPropertyDescriptor</p>
<pre><code>public override TypeConverter Converter
{
get {
if (this.PropertyType.Equals(typ... | 40,468 |
<p>As part of my integration strategy, I have a few SQL scripts that run in order to update the database. The first thing all of these scripts do is check to see if they need to run, e.g.:</p>
<pre><code>if @version <> @expects
begin
declare @error varchar(100);
set @error = 'Invalid version.... | <p>Here's what I came up with:</p>
<p>Wrap it in an EXEC(), like so:</p>
<pre><code>if @version <> @expects
begin
...snip...
end
else
begin
exec('CREATE PROC MyProc AS SELECT ''Victory!''');
end
</code></pre>
<p>Works like a charm!</p>
| <pre><code>IF NOT EXISTS(SELECT * FROM sys.procedures WHERE name = 'pr_MyStoredProc')
BEGIN
CREATE PROCEDURE pr_MyStoredProc AS .....
SET NOCOUNT ON
END
ALTER PROC pr_MyStoredProc
AS
SELECT * FROM tb_MyTable
</code></pre>
| 7,930 |
<p>I am experiencing some strange behavior of embedded audio (wav file) on HTML page.
I've got a page <code>https://server.com/listen-to-sound</code>, and a Wav file embedded in it via <code><EMBED/></code> tag, like this:</p>
<pre><code><embed src='https://server.com/path-to-sound' hidden="true" autostart="t... | <p>I think the main reason is acting different on each computer/browser you're using is because it is a non-standard tag.</p>
<p>Getting media to play inside a web page has always been a bit of a pain. You may try something like this:</p>
<pre><code><object type="audio/x-wav" data="data/test.wav" width="200" heig... | <p>I could'nt find any informations on this, but have you tried playing sound from Javascript ? I don't know if it's a viable workaround for you but this might be a solution.<br />
You can find different ways to do it here: <a href="http://www.phon.ucl.ac.uk/home/mark/audio/play.htm" rel="nofollow noreferrer">http://ww... | 30,587 |
<p>Has anyone been able to get xinc to run correctly under OpenBSD's chrooted default Apache? I'd like to keep our development server running fully chrooted just like our Production server so that we make sure our code runs just fine chrooted.</p>
| <p>Have you posted the issue on the Xinc <a href="http://code.google.com/p/xinc/issues/list" rel="nofollow noreferrer">bug tracker</a>? Xinc itself should run fine as it runs both as a daemon and as a web app. As you alluded to, the issue may be that the daemon is not running in a chroot'ed environment where as the web... | <p>Having never used xinc myself, I can only hint as to how I usually get to chrooting apps.</p>
<p>First step would be to gather information on everything the app needs to run; this I usually accomplish by running <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=systrace&sektion=1" rel="nofollow noreferrer">... | 3,087 |
<p>I'm running MAMP 1.7.2 on a Mac and I'd like to install the extension php_gd2. How do I do this? I know that on Windows using WAMP I'd simply select the <code>php_gd2</code> entry in the extensions menu to activate it. How is it done when using MAMP? I know that I can do it using MacPorts but I'd prefer not to ma... | <p>You shouldn't need to install the extension. I have 1.7.2 installed and running right now and it has GD bundled (2.0.34 compatible).</p>
<p>From the MAMP start page, click on phpinfo and you should see a GD section.</p>
| <p>php.ini for MAMP 1.7.2 is located:
if using <strong>php5</strong>, here: <strong>/Applications/MAMP/conf/php5/php.ini</strong>
if <strong>php4</strong>, here: <strong>/Applications/MAMP/conf/php4/php.ini</strong></p>
<p>hope that helps...</p>
| 4,698 |
<p>Some people have figured out how to take raw LiDAR data and after going through multiple steps (using LAS tools, converting to digital elevation model (DEM), converting to an STL) getting an STL file that they can then slice and print.</p>
<p>Could you write a program that cuts out all of those intermediate steps an... | <p>TL;DR - The problem would <em>appear</em> to be that some of the steps require a bit of manual tinkering in order to complete them successfully - it isn't just a simple question of conversion. So, no (not currently).</p>
<p><em>Also, whilst writing this answer, it dawned on me that unless someone has actually manage... | <p>The answer is highly depending on the programming skills of the programmer, but in theory, if all pieces of software exist, they can either be tied together in a workflow process (automated) or directly programmed into a new tool.</p>
| 1,983 |
<p>I want to handle different types of docs the same way in my application
Therefore:
I have a generic interface like this.</p>
<pre><code>public interface IDocHandler<T>where T: class
{
T Document { get;set;}
void Load(T doc);
void Load(string PathToDoc);
void Execute();
void Execute(T doc);
}
</code></pr... | <p>I think that with your current design, you are creating a "dependency" between <code>IDocumentHandler</code> and a specific Document (<code>ReportDocument</code> or <code>MediaDocument</code>) and so if you want to use <code>IDocumentHandler<ReportDocument or MediaDocument></code> directly in your code you mus... | <p>You need to use a non-generic interface on the left side.</p>
<p>Try:</p>
<pre><code>public interface IDocumentHandler { }
public interface IDocumentHandler<T> : IDocumentHandler { }
</code></pre>
<p>This will create two interfaces. Put everything common, non-T-specific into the base interface, and everythi... | 46,330 |
<p>I am attempting to programmatically monitor the size of a SQL Server database, so that my admin section of my web app can report it, and I can use that to execute some cleanup SPs, to clear log files, etc.</p>
<p>I use the following code to calculate the size of the tables, per SO recommendation:</p>
<pre><code>CR... | <p>The difference, in my opinion, is due to the fact that the size you see in the "Properties" page is calculated by querying the table .sys.database_files, which counts the number of 8KB pages allocated by each database file.</p>
<p>To obtain the same result, simply run the following query (SQL Server 2005):</p>
<pr... | <p>Just a quick observation, your script seems to only be summing the data column of sp_spaceused and not the reserved column (Reserved = data + index + unused). Also sp_msforeachtable does not include system tables.</p>
<p>Also from the SQL Server Books online for sp_spaceused</p>
<blockquote>
<p>If objname is not... | 45,517 |
<p>Has anyone used OSGi and JSF together?</p>
<p>I ask because JSF uses class-loader magic to find custom components. From a tutorial (emphasis mine):</p>
<blockquote>
<p>This configuration file will end up
being META-INF/faces-config.xml in the
.jar file that represents this
component. <strong>JSF will look ... | <p>A variable switch, such as:</p>
<pre><code><%
dim columnWidth
if session("lang") = "eng" then
columnWidth = 50
else
columnWidth = 100
end if
%>
<table>
<tr>
<td width="<%= columnWidth %>px">[content]</td>
</tr>
</table>
</code></pre>
<p>For c... | <p>Use if-else inside scriplet based on the currently selected language and place appropriate "td" tags.</p>
<p>Hope this is what you are looking for !</p>
| 24,915 |
<p>Everything was going well. Nightly builds ran for more than a month with no problems. However, suddenly when invoking the feature builder from Eclipse the execution ends right away with the message.</p>
<p>ERRORLEVEL 13</p>
<p>As far as I know I haven't changed anything, as this computer is normally not touched.... | <p>After reading what the error code means thanks to the answer from VonC I understood where to look. The problem was a lot more obscure that it seems.</p>
<p>I looked into the configuration folder for Eclipse (logs are either written there or in the .metadata folder when something goes wrong), and I found a huge log... | <p>It should mean "<strong><em>ant</em></strong> <strong>build failed</strong>", meaning the headless ant script fails at some point.</p>
<p>You should check if you can catch the log/output generated by this script to analyze this ant session and see at what point the ant script fails.</p>
<hr>
<p>If it fails right ... | 48,904 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.