instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>Anyone done this and can share? I see an option or two but want to know what others have accomplished.</p>
| <p>According to joda-time documentation the preferred method to use is to call this:
<a href="http://joda-time.sourceforge.net/api-release/org/joda/time/base/AbstractDateTime.html#toCalendar(java.util.Locale)" rel="noreferrer">AbstractDateTime#toCalendar</a>.</p>
| <p>in the 2.1 you can use</p>
<pre><code>public static Calendar parseCalendar(DateTime dt){
return dt.toGregorianCalendar();
}
</code></pre>
| 47,508 |
<p>I've been developing a "Form Builder" in Javascript, and coming up to the part where I'll be sending the spec for the form back to the server to be stored. The builder maintains an internal data structure that represents the fields, label, options (for select/checkbox/radio), mandatory status, and the general sortin... | <p>When making and processing requests with JavaScript, I live and breath <a href="http://json.org/" rel="noreferrer">JSON</a>. It's easy to build on the client side and there are tons of parsers for the server side, so both ends get to use their native tongue as much as possible. </p>
| <p>I'd implement some sort of custom <code>text serialization</code> and transmit plain text. As you say, you can rebuild the information doing the reversed process.</p>
| 3,725 |
<p>Is there a way to print out the diffs like they show when you open them with "gvim -d", with all the common code folded away and only the diffs showing in context? I tried the print menu option, but it printed the entire file that I was currently "in", rather than printing the folded diffs.</p>
| <p>I dont think theres a way to get a side by side printout of the two files being diffed. But, you could use Vim's "Convert to HTML" tool on each of the two files being diffed and print those out separately. You could then stack them side by side to get the same effect.</p>
<p>Convert to HTML is kind of "pretty print... | <p>First, <code>TOhtml</code> plugin @Gowri was talking about, is able to output one HTML with both files shown (unless you have set <code>g:html_diff_one_file</code> to 1). Second, if you are not fine with output of TOhtml you can try my own <a href="http://www.vim.org/scripts/script.php?script_id=3113" rel="nofollow"... | 37,841 |
<p>I have a Visual Studio 2008 solution with two projects in it. A C++ DLL and a Csharp application.</p>
<p>The Csharp application uses [DllImport] to access the functions in the DLL, and has a dependency set on the DLL.</p>
<p>For some reason, setting the dependency isn't sufficient to cause VS to copy the DLL to th... | <p>"Build" and "Debug" do different things. In Tools - Options - Projects and Solutions - Build and Run, there is a checkbox "Only build startup projects and dependencies on Run". This is checked by default. So, if VS isn't recognising the DLL as a dependency, it won't build it when you choose "Debug".</p>
<p>I don't ... | <p>Hmm... so I haven't done this exact thing before but I just threw together a C++ lib project and a C# winform project in the same solution. I right-clicked the solution, chose Properties and then under Common Properties->Project Dependencies, I made the C# one depend on the C++ one.</p>
<p>When I make a mod to the... | 29,022 |
<p>Following the <a href="http://www.json.org/JSONRequest.html" rel="nofollow noreferrer">JSONRequest proposa</a>l, I've found <a href="http://www.devpro.it/code/153.html" rel="nofollow noreferrer">code for the JSONRequest object</a>. However, this object depends on JSONRequestError, and the code for that is nowhere to... | <p>For such a highly spoke of and nicely documented library, finding the download link is ridiculous but here goes:</p>
<ul>
<li><a href="http://devpro.it/javascript_id_152.html" rel="nofollow">JSONRequest.javascript</a></li>
<li><a href="http://devpro.it/javascript_id_153.html" rel="nofollow">JSONRequestError.javascr... | <p>I used the request <code>JSONRequestError site:devpro.it</code> in Google, it is a useful tip... ^_^</p>
<p>Found <a href="http://www.devpro.it/JSON/files/JSONRequestError-js.html" rel="nofollow noreferrer" title="JSONRequestError.js">JSONRequestError.js</a> which explain the API, and ... hmm, no source code!</p>
... | 38,213 |
<p>In python, there are some special variables and filenames that are surrounded by double-underscores. For example, there is the</p>
<pre><code>__file__
</code></pre>
<p>variable. I am only able to get them to show up correctly inside of a code block. What do I need to enter to get double underscores in regular ... | <p>__file__</p>
<p>Put a backslash before the first underscore.</p>
<p>Like this:</p>
<pre><code>\__file__
</code></pre>
| <p><code>_\_file__</code>
enter this will help you.</p>
| 7,644 |
<p>I'm running autoconf and configure sets SHELL to '/bin/sh'.
This creates huge problems. How to force SHELL to be '/bin/bash' for autoconf?</p>
<p>I'm trying to get this running on osx, it's working on linux. Linux is using SHELL=/bin/bash. osx defaults to /bin/sh.</p>
| <p>I have similar problems on Solaris with GCC - and I use the 'standard' technique:</p>
<pre><code>CONFIG_SHELL=/bin/bash ./configure ...
</code></pre>
<p>(Or, actually, I use /bin/ksh, but setting the CONFIG_SHELL env var allows you to tell autoconf scripts which shell to use.)</p>
<p>I checked the configure scrip... | <p><code>ln -f /bin/bash /bin/sh</code></p>
<p>:-P (No, it's not a serious answer. Please don't hose your system by doing it!)</p>
| 19,466 |
<p>How can I turn off anti-aliasing for one specific JLabel? It uses a very small font which might look better without anti-aliasing.</p>
<p>If important, I'm using Java 1.5 on Mac OS X.</p>
| <p>I think you'll have to override the paint(Graphics g) method and draw the text yourself.</p>
| <p>I think you'll have to override the paint(Graphics g) method and draw the text yourself.</p>
| 42,586 |
<p>I have a web application with multiple web services. This web application has business and persistency layer. Is it possible to use separate log appender (log file) per web service?</p>
<p>This applies to web pages too. Essentially I want to separate my logs NOT based on the class or layer/namespace, but from point... | <p>You can define which logger to get in each web service:</p>
<pre><code>namespace log4net
{
public class LogManager
{
public static ILog GetLogger(string name);
public static ILog GetLogger(Type type);
}
}
</code></pre>
<p>And then in your app, you can call each logger appropriately:</p>... | <p>Gortok,
That's the typical way we handle logs. However I mean something different and I think I wasn't clear enough in my question.</p>
<p>Here's a hypothetical example: We have a web application that has some Admin pages and some Customer pages and we want to have two different admin.log and customer.log files for... | 47,173 |
<p>In an embedded application (written in C, on a 32-bit processor) with hard real-time constraints, the execution time of critical code (specially interrupts) needs to be constant.</p>
<p>How do you insure that time variability is not introduced <strong>in the execution</strong> of the code, specifically due to the p... | <p>If you can get your hands on the hardware, or work with someone who can, you can turn off the cache. Some CPUs have a pin that, if wired to ground instead of power (or maybe the other way), will disable all internal caches. That will give predictability but not speed!</p>
<p>Failing that, maybe in certain places ... | <p>Understand your worst case runtime for complex operations and use timers.</p>
| 9,450 |
<p>How can I change default <a href="http://msdn.microsoft.com/en-us/library/3a7hkh29.aspx" rel="nofollow noreferrer">Generate Method Stub</a> behavior in Visaul Studio to generate method with body</p>
<pre><code>throw new NotImplementedException();
</code></pre>
<p>instead of </p>
<pre><code>throw new Exception("Th... | <p>Taken from: <a href="http://blogs.msdn.com/ansonh/archive/2005/12/08/501763.aspx" rel="noreferrer">http://blogs.msdn.com/ansonh/archive/2005/12/08/501763.aspx</a></p>
<blockquote>
<p>Visual Studio 2005 supports targeting the 1.0 version of the compact framework. In order to keep the size of the compact framework... | <p>There's another reason: FxCop catches instances of anybody throwing 'Exception' and flags it, but throwing instances of 'NotImplementedException' is acceptable.</p>
<p>I actually like the default behavior, because it does have this differentiation. NotImplementedException is not a temporary exception to be thrown w... | 6,803 |
<p>Is it possible to access a USB drive or Flash card without using the drive letter that Windows assigns it? I thought I read somewhere that the Volume GUID or something can be used but will that allow me to open it up in explorer once I identify it? The reason this is important to me is because there may not be enoug... | <p>If you are using NTFS, You can create 'volume mount points' in Windows. (Similar to *NIX, if you have used that).</p>
<p>Mount points make a folder on your filesystem (your C drive, say) point to another volume, so "C:\usb1" could actually contain the contents of a USB drive.</p>
<p>There are a couple of articles ... | <p>If you are using NTFS, You can create 'volume mount points' in Windows. (Similar to *NIX, if you have used that).</p>
<p>Mount points make a folder on your filesystem (your C drive, say) point to another volume, so "C:\usb1" could actually contain the contents of a USB drive.</p>
<p>There are a couple of articles ... | 48,435 |
<p>I want to write a web application using <a href="http://code.google.com/appengine/" rel="noreferrer">Google App Engine</a> (so the reference language would be <strong>Python</strong>). My application needs a simple search engine, so the users would be able to find data specifying keywords.</p>
<p>For example, if I ... | <p>I found these two books very useful when I used to build full-text search engines.</p>
<p><a href="https://rads.stackoverflow.com/amzn/click/com/0134638379" rel="noreferrer" rel="nofollow noreferrer">Information Retrieval</a></p>
<p><a href="https://rads.stackoverflow.com/amzn/click/com/1558605703" rel="noreferrer... | <p>Try this:
Say the variable table is your list of search entries.</p>
<pre><code>query = input("Query: ").strip().lower()#Or raw_input, for python 2
end = []
for item in table:
if query in item.strip().lower():
end.append(item)
print end #Narrowed results
</code></pre>
<p>It just iterates through all o... | 21,228 |
<p>I would like to place a link from my application's narrow profile box to it's application tab on the same profile. </p>
<p>I have combed through the FBML documentation to no avail. I have posted this question on the Facebook dev forums. I have experimented with pasting the URL of the tab into the profile box link w... | <p>You asked this a very long time ago, but it ranks well in Google for some search terms so here goes:</p>
<p>To link to a specific profile tab you can use the following href in your anchor</p>
<p>facebook.com/profile.php?id=123456&v=app_654321</p>
<p>obviously you need to replace the profile id and app id with... | <p>It is possible, but not with the profile.php... It always redirects to page wall, no matter of v parameter.
The only way I know is to give a direct link, ie.</p>
<p><a href="http://www.facebook.com/MichaelJordan?v=info" rel="nofollow noreferrer">http://www.facebook.com/MichaelJordan?v=info</a></p>
<p>The problem i... | 47,775 |
<p>I'm working on a projects which involves a lot of database writes, I'd say (<em>70% inserts and 30% reads</em>). This ratio would also include updates which I consider to be one read and one write. The reads can be dirty (e.g. I don't need 100% accurate information at the time of read).<br>
The task in question wi... | <p>I have briefly <a href="http://developer99.blogspot.com/2011/07/mysql-innodb-vs-myisam.html" rel="noreferrer">discussed</a> this question in a table so you can conclude whether to go with <strong>InnoDB</strong> or <strong>MyISAM</strong>.</p>
<p>Here is a small overview of which db storage engine you should use in... | <p>bottomline: if you are working offline with selects on large chunks of data, MyISAM will probably give you better (much better) speeds.</p>
<p>there are some situations when MyISAM is infinitely more efficient than InnoDB: when manipulating large data dumps offline (because of table lock). </p>
<p>example: I was ... | 4,049 |
<p>I have an app which could benefit from the user being able to choose to set an image as the wallpaper (the background image on the "slide to unlock" screen). </p>
<p>Is there a way for non-jailbreak third-party apps to do this? A search for "wallpaper" in the iPhone documentation returns nothing. </p>
| <pre><code><configuration>
<system.web>
<compilation>
<assemblies>
<add assembly="<AssemblyName>, Version=<Version>, Culture=<Culture>, PublicKeyToken=<PublicKeyToken>"/>
</assemblies>
</compilation>
</s... | <pre><code><configuration>
<system.web>
<compilation>
<assemblies>
<add assembly="<AssemblyName>, Version=<Version>, Culture=<Culture>, PublicKeyToken=<PublicKeyToken>"/>
</assemblies>
</compilation>
</s... | 30,943 |
<p>This is a question already asked by someone:</p>
<p><a href="https://stackoverflow.com/questions/242032/eclipse-project-directory">How can an Eclipse plugin access the project directory?</a></p>
<p>The answer was good: using <code>ResourcesPlugin</code>.</p>
<p>But for some reason, under no circumstances will my ... | <p>Finally, I figured out that redefined ErrorDocument in .htaccess file for the same VirtualHost as the SVN's caused invalid data to be sent to SVN client on some occasions and for some reason intercepting with commit process.</p>
| <p>Daren, you are not exactly correct right now. I've tried all the possible combinations of working copies, new repositories and so on. I've tried mostly everything. At last, I've found one strange message in NEON debug messages, displaying my 404 page on a homepage, which I mostly forgot about. Then, I've realized - ... | 40,039 |
<p>Given that these two examples are equivalent, which do you think is preferrable?</p>
<p><strong>Without explicit modifier</strong></p>
<pre><code>public class MyClass
{
string name = "james";
public string Name {
get { return name; }
set { name = value; }
}
void SomeMethod() { ..... | <p>I think explicity stating private helps in readability. It won't allow for a programmer to interpret its visibility differently.</p>
| <p>My understanding has always been members have "internal" accessibility unless stated otherwise. If that's true, the "private" modifier would be required to ensure those members are in fact private.</p>
<p>Regardless of whether I'm correct about the above or not, leaving the modifier in place will increase the read... | 31,802 |
<p>How does Google manage to properly align the second column <em>(i.e. the ticker name)</em> in the "Get Quotes" search box suggestion drop-down in <a href="http://finance.google.com" rel="nofollow noreferrer">google finance url</a></p>
<p><strong>Example:</strong> If you enter <code>iii</code> - the second column is... | <p>most likely just using margins. float the first column left then set the margin to the width of the first column.</p>
| <p>I just viewed source with a DOM inspector and it appears that they are <code>span</code>s for each cell with a margin set (as Darren said) to position the right column over.</p>
| 7,361 |
<p>I have an html like this:</p>
<pre><code><div id="container1">
<div class="dragme">drag me</div>
</div>
<div id="container2">
<div class="dragme">drag me</div>
</div>
<div id="droponme"></div>
$(".dragme").draggable();
$("#droponme").droppable({
... | <pre><code>$(".dragme").draggable();
$("#droponme").droppable({
accept: ".dragme",
drop: function(e, u) {
alert(u.draggable.parent().attr('id') );
// in your example: container1 or container2
}
});
</code></pre>
| <p>It's another form to get droppable container:</p>
<pre><code>$(".dragme").draggable();
$("#droponme").droppable({
accept: ".dragme",
drop: function(e, u) {
alert(e.toElement);
}
});
</code></pre>
| 38,487 |
<p>Now I have a stack of free time on my hands, I wanna get into iphone dev fo real.</p>
<p>But Objective C scares me (a bit). It feels I'm going a bit back in time. I say this because I've spent the last 8 months coding in C++.</p>
<p><a href="http://inexdo.com/JSCocoa" rel="nofollow noreferrer">JSCocoa</a> looks aw... | <p>(Hi, I'm the JSCocoa dev)
JSCocoa works on the iPhone simulator. Check out the latest version from Google svn and compile iPhoneTest2. </p>
<p>To work on the iPhone, it needs libffi. I've seen <a href="http://code.google.com/p/iphone-dev/source/browse/trunk/llvm-gcc-4.0-iphone/" rel="noreferrer">http://code.google... | <p>With a Jailbroken iPhone, you can deffintely write applications in Python and Ruby (and probably JSCocoa, but I've never looked into it)</p>
<p>The problem is, to use PyObjC/RubyObjC (and most likely JSCocoa, and any other similar projects) you <em>have</em> to know how to use regular ObjC and Cocoa, as the framewo... | 42,397 |
<p>I'm attracted to the neatness that a single file database provides. What driver/connector library is out there to connect and use SQLite with Java.</p>
<p>I've discovered a wrapper library, <a href="http://www.ch-werner.de/javasqlite/" rel="noreferrer">http://www.ch-werner.de/javasqlite</a>, but are there other mor... | <p>The <a href="http://www.sqlite.org/cvstrac/wiki?p=SqliteWrappers" rel="noreferrer">wiki</a> lists some more wrappers:</p>
<ul>
<li>Java wrapper (around a SWIG interface): <a href="http://tk-software.home.comcast.net/" rel="noreferrer">http://tk-software.home.comcast.net/</a></li>
<li>A good tutorial to use JDBC dri... | <p>Typo: <code>java -cp .:sqlitejdbc-v056.jar Test</code></p>
<p>should be: <code>java -cp .:sqlitejdbc-v056.jar; Test</code></p>
<p>notice the semicolon after ".jar" i hope that helps people, could cause a lot of hassle </p>
| 6,253 |
<p>As a counterpart to <a href="https://stackoverflow.com/questions/215470/c-coding-guideline-102">C++ Coding Guideline 102</a>, which of the <a href="http://www.gotw.ca/publications/c++cs.htm" rel="nofollow noreferrer">101 guidelines of Sutter & Alexandrescu</a> do you violate or ignore most often, and why?</p>
| <p>I'd say for me, it's probably 16. Avoid macros. I find there are a good number of things I can only do with macros (especially inlining __FILE__ and __LINE__ into expressions), and many cases where I need a compact expression which operates in the external function context (checking result codes and returning, for e... | <p>I ignore most of them, because they can be summarized as: use C++ as if it were a high-level object-oriented language. But if you want a high-level object-oriented language, there are much better candidates (C#, Java, Lisp, Python etc). C++ is essentially the mother of all structured macro assemblers, and I use it a... | 28,604 |
<p>Right now a project I'm working on has reached a level of complexity that requires more than a few steps (actually its become arcane!) to produce a complete/usable product. And unfortunately we didn't start out with a Continuos Integration mindset, so as you can imagine its kind of painful at times, and at others I ... | <p>Here it is in two simple (hah) steps.</p>
<ol>
<li>Go for the repeatable build:
<ol>
<li>Use source control, get all code checked in.</li>
<li>Establish and document all tools used to build (mainly, which compiler version). Have a repeatable deployment and set up process for these tools.</li>
<li>Establish and do... | <p>I would guess that migrating isn't really an option--Half-ass solutions will only make it worse. </p>
<p>My approach would be to take one creative engineer who understands the build process, sit him down and say "Fix this". Give him a week or two.</p>
<p>The end goal would be a process that runs beginning to end... | 38,572 |
<p>Is there a way to declare a variable as Nullable in c#?</p>
<pre><code>struct MyStruct {
int _yer, _ner;
public MyStruct() {
_yer = Nullable<int>; //This does not work.
_ner = 0;
}
}
</code></pre>
| <p>_yer must be declare as int? or Nullable<int>.</p>
<pre><code> int? _yer;
int _ner;
public MyStruct(int? ver, int ner) {
_yer = ver;
_ner = ner;
}
}
</code></pre>
<p>Or like this:</p>
<pre><code> Nullable<int> _yer;
int _ner;
public MyStruct(Nullable<int... | <p>How about <a href="http://msdn.microsoft.com/en-us/library/2cf62fcy(VS.80).aspx" rel="nofollow noreferrer">nullable types</a>:</p>
<pre><code>struct MyStruct
{
private int? _yer, _ner;
public MyStruct(int? yer, int? ner)
{
_yer = yer;
_ner = ner;
}
}
</code></pre>
| 25,001 |
<p>I'm new to BIRT and I'm trying to make the Report Engine running. I'm using the code snippets provided in <a href="http://www.eclipse.org/birt/phoenix/deploy/reportEngineAPI.php" rel="nofollow noreferrer">http://www.eclipse.org/birt/phoenix/deploy/reportEngineAPI.php</a></p>
<p>But I have a strange exception:</p>
... | <p>I had the same mistake a couple of month ago. I'm not quite sure what actually fixed it but my code looks like the following:</p>
<pre><code> IDesignEngine engine = null;
DesignConfig dConfig = new DesignConfig();
EngineConfig config = new EngineConfig();
IDesignEngineFactory factory = null;
... | <p>I had the same mistake a couple of month ago. I'm not quite sure what actually fixed it but my code looks like the following:</p>
<pre><code> IDesignEngine engine = null;
DesignConfig dConfig = new DesignConfig();
EngineConfig config = new EngineConfig();
IDesignEngineFactory factory = null;
... | 10,782 |
<p>Trying to build a CHM using Microsoft HTML Help Workshop. A soon as I click Compile, HTML Help Workshop states:</p>
<blockquote>
<p>An internal error has occurred. An error record has been saved to c:\os.err.</p>
</blockquote>
<p>The only contents of the file are:</p>
<blockquote>
<p>((Today's Date & Time... | <p>The Microsoft HTML Help compiler has some unstated requirements for path name sizes.</p>
<p>Moving the project to a directory closer to the root drive (i.e. "C:\helpsystem\") and renaming folders inside the project to smaller name reduced the path name size enough so that the project would compile.</p>
| <p>Another thing to watch out for is an Error 413 - Request Entity Too Large error.</p>
<p>I'm not sure how big is <em>too</em> big for HTML Help Workshop, but my htm file is a touch over 2MB, a large table, and it causes HTML Help Workshop to crash when processing it.</p>
<p>While this isn't the same problem, it was... | 15,106 |
<p>Given the <a href="http://www.niallkennedy.com/blog/2008/02/iphone-cache-performance.html" rel="nofollow noreferrer">iPhone's 25k limit for caching of files</a>, I'm wondering if there's interest in an iPhone optimized javascript library that makes caching a top level goal. Since it'd be iPhone only it could get rid... | <p>Newer update: looks like <a href="http://zeptojs.com/" rel="nofollow noreferrer">Zepto</a> is the way to go these days.</p>
<p>Found <a href="http://github.com/brianleroux/xui/tree/master" rel="nofollow noreferrer">XUI</a>, looks like what I was looking for, although I haven't given it a try yet.</p>
| <p>I think it would be fantastic, but it would be hard to match the testing and reliability of jquery unless someone really picks it up and runs with it. If there was a lightweight, safari only version of jquery that was completely compatible with the plugins and documented methods, it would be a godsend. </p>
| 40,774 |
<p>I intermittently get this in error in my .NET 1.1 C# Windows Forms application. Someone indicated that this is due to a bug in the 1.1 framework and suggests putting the following code into any custom controls.</p>
<pre><code>protected override void OnParentChanged(EventArgs e)
{
if (this.Parent != null)
{
... | <p>From the title it seems that your code is trying to access an already disposed object. This can happen in finalizer if you try to access a managed reference field. The order CLR finalizes managed objects is non-deterministic. </p>
| <p>Hey, I'm not sure about your problem as I haven't used .NET 1.1 in ages,
and I hate to state the obvious... but what is stopping you from migrating
to .NET 2.0 or even 3.5? (Please do not feel offended, I'm actually interested in knowing).</p>
<p>I can understand .NET 3.5 might be early in some cases,
but .NET 2.0 ... | 26,270 |
<p>I'm programming in C for RAM limited embedded microcontroller with RTOS.</p>
<p>I regularly break my code to short functions, but every function calling require to more stack memory.
Every task needs his stack, and this is one of the significant memory consumers in the project.</p>
<p>Is there an alternative to ke... | <p>Try to make the call stack flatter, so instead of <code>a()</code> calling <code>b()</code> which calls <code>c()</code> which calls <code>d()</code>, have <code>a()</code> call <code>b()</code>, <code>c()</code>, and <code>d()</code> itself.</p>
<p>If a function is only referenced once, mark it <code>inline</code>... | <p>Can you replace some of your local variables by globals?
Arrays in particular can eat up stack.</p>
<p>If the situation allows you to share some globals between some those between functions,
there is a chance you can reduce your memory foot print.</p>
<p>The trade off cost is increased complexity, and greater ris... | 16,382 |
<p>In Notepad++, I was writing a JavaScript file and something didn't work: an alert had to be shown when a button was clicked, but it wasn't working.</p>
<p>I has used the auto-complete plugin provided with Notepad++, which presented me with <code>onClick</code>.</p>
<p>When I changed the capital <code>C</code> to a... | <p>Javascript is <strong>ALWAYS</strong> case-sensitive, html is not.</p>
<p>It sounds as thought you are talking about whether html attributes (e.g. onclick) are or are not case-sensitive. The answer is that the attributes are not case sensitive, but the way that we access them through the DOM is.
So, you can do th... | <p>JavaScript API methods are almost all called with <a href="http://en.wikipedia.org/wiki/LowerCamelCase" rel="nofollow noreferrer">lowerCamelCase</a> names, and JavaScript is case-sensitive</p>
| 11,357 |
<p>My understanding of the MVC is as follows (incase it's horribly wrong, I am afterall new to it)</p>
<ol>
<li>Models are the things that interface with the database</li>
<li>Views are the design/layout of the page</li>
<li>Controllers are where everything starts and are essentially the page logic</li>
</ol>
<p>I'm ... | <p>Model is the wrong word to use when discussing what to do with products: each product is a <b>value object (VO)</b> (or data transfer objet/DTO, whatever fits in your mouth better). Value objects generally have the same fields that a table contains. In your case ProductVO should have the fields that are in Products ... | <p>In <a href="http://cakephp.org" rel="nofollow noreferrer">CakePHP</a> there are 3 more "parts" : </p>
<ol>
<li>Behaviors </li>
<li>Components</li>
<li>Helpers</li>
</ol>
<p>Logic that are used by many models should be made as a behavior. I do not know if CodeIgniter have this logic or not, but if it doesnt, I woul... | 16,771 |
<p>I found the discussion on <a href="https://stackoverflow.com/questions/105007/do-you-test-private-method">Do you test private method</a> informative.</p>
<p>I have decided, that in some classes, I want to have protected methods, but test them.
Some of these methods are static and short. Because most of the public m... | <p>If you're using PHP5 (>= 5.3.2) with PHPUnit, you can test your private and protected methods by using reflection to set them to be public prior to running your tests:</p>
<pre><code>protected static function getMethod($name) {
$class = new ReflectionClass('MyClass');
$method = $class->getMethod($name);
$m... | <p>Alternative.The code below is provided as an example.
Its implementation can be much broader.
Its implementation that will help you test private methods and replacing a private property .</p>
<pre class="lang-php prettyprint-override"><code> <?php
class Helper{
public static function sandbox(\Closu... | 31,045 |
<p>What are the methods to auto eject parts (into a collection area/box/basket) in order for the 3D printer to continue printing?</p>
<p>For some reason this feature isn't common (yet?). Is there a hidden reason why?</p>
<p>Will using the print head to ram the part off the build plate into a basket nearby cause the p... | <p>While the "best" method is probably unanswerable since it would be based on very specific requirements and subject to change as soon as a better method were devised, here are some feasible methods to auto-eject 3d printed parts.</p>
<p>Some of these are methods that I've considered for my personal use, others have ... | <p>Here's a wild idea. Since you're planning to have a bed which only moves in the Z-axis, build a roller system which feeds a thin, flexible layer of some material (unobtanium, I fear) to cover the build plate. The feed rollers have a weak spring to provide some tension to keep this layer flat but not overly stretche... | 406 |
<p>In my database, Concessions have a many-to-one relationship with Firms (each Concession has a FirmID). SqlMetal has captured this relationship and generated the appropriate classes, so that each Concession has a Firm element. I'm binding against a query (simplified here) that returns a list of Concessions along with... | <p>Your 2nd example is doing an inner join. It won't return Concessions which have null FirmID. You want to do an outer join in this case:</p>
<p><a href="http://msdn.microsoft.com/en-us/vbasic/bb737929.aspx#grpjoinleftout" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/vbasic/bb737929.aspx#grpjoinleftout</... | <p>Deal with it in the object constructor</p>
<pre><code>Public Property office() As String
Get
Return _office
End Get
Set(ByVal value As String)
If value IsNot Nothing Then
_office = value
Else
... | 29,527 |
<p>I know the general consensus for information like shopping cart items is to store them in session. But what about objects that belong to a user that can be altered by other users? Say, for instance, an eBay-like site. If you store a user's "items" in session, which contain the current bid amount, and another user... | <p>I would store it all in the database and retrieve it everytime. Depending on the volatility of the data caching for a few seconds may be in order. The biggest problem is keeping the two consistent.</p>
<p>I think that it isn't as expensive as you think to retrieve the data every time. Databases are very efficient i... | <p>I would personally store it in a database. Firstly, because your data is a lot safer there, and it makes it easier to share in the case where you need a web farm. Also, you don't need to have the data on every page. Just when the user goes to the shopping cart. The other plus of storing it in the database is that... | 38,082 |
<p>I have an Ender 5 pro and upgraded from the magnetic bed to the glass version. I print with Prusament PLA on 65 °C bed temp and 220 °C extruder temp. I measured that the glass surface has ~58 °C in the center and ~56 °C on the corners. That should be in the specs of the spool which has a printed recommendation of 50... | <p>The only time I've seen lifting, away from the edges of the part like this, is when the bed is contaminated with something which will stop the print sticking, like fingerprints and such.</p>
<p>A thorough wipe-down with IPA on the heated bed is usually enough to stop it.</p>
| <p>I haven't seen lifts that aren't on the edge of the print, such as warping, or the entire printed surface lifts. When I get something like in your photograph, it's because the print surface isn't flat and the first layer matches the surface topology. If the second image shows the print surface, it looks like blobs... | 1,874 |
<p>We don't need multiuser. Just relational. Our app currently uses Access but Access isn't exactly zero-administration because it's prone to corruption.</p>
<p>Is SQLite rock, rock solid, pure zero-administration? </p>
<p>Or...is there a way to configure SQL Server as a desktop engine so that it is pure zero... | <p>Other databases may be more stable than Access, but I'm not aware of anything that's as easy to use, and as easy for an end user to understand. Access (like SourceSafe) is always called "prone to corruption", but few and far between are the first-hand accounts of this. Most people "read it somewhere."</p>
<p>Cons... | <p>Since you are looking at no need for multiuser, you might want to check out SQL Server Compact Edition. <a href="http://www.microsoft.com/Sqlserver/2005/en/us/compact.aspx" rel="nofollow noreferrer">http://www.microsoft.com/Sqlserver/2005/en/us/compact.aspx</a></p>
| 28,951 |
<p>I'm getting this error:</p>
<pre><code>javax.servlet.ServletException: bean not found within scope
</code></pre>
<p>on a page with this at the top.</p>
<pre class="lang-html prettyprint-override"><code><jsp:useBean id="bean" type="com.example.Bean" scope="request" />
</code></pre>
<p>The class exists in th... | <p>You need the <code>class</code> attribute instead of the <code>type</code> attribute. </p>
<p>The following:</p>
<pre class="lang-html prettyprint-override"><code><jsp:useBean id="bean" type="com.example.Bean" scope="request" />
</code></pre>
<p>does <em>basically</em> the following behind the scenes:</p>
... | <p>You must add</p>
<pre><code><jsp:useBean id="givingFormBean" type="some.packg.GivingForm" scope="request" />
</code></pre>
<p>Because by default the bean is <a href="http://java.sun.com/products/jsp/tags/11/syntaxref11.fm14.html" rel="nofollow noreferrer">looked on the <em>page</em> scope</a></p>
| 33,988 |
<p>Ulimately I just wanted to extract strings from the .rc file so I could translate them, but anything that goes with .rc files works for me.</p>
| <p>I'd consider usage of <a href="http://en.wikipedia.org/wiki/Gettext" rel="nofollow">gettext</a> and <a href="http://gnu.cs.pu.edu.tw/software/gettext/manual/html_node/PO-Files.html" rel="nofollow">.PO files</a>, if your program fits GNU license</p>
<p>1) I'd suggest extracting from .rc files using state machine alg... | <p><a href="http://resxcrunch.com" rel="nofollow noreferrer">ResxCrunch</a> will be out sometimes soon.
It will edit multiple resource files in multiple languages in one single table.</p>
| 7,709 |
<p>I have a <code>JTable</code> with a custom <code>TableModel</code> called <code>DataTableModel</code>. I initialized the table with a set of column names and no data as follows:</p>
<pre><code>books = new JTable(new DataTableModel(new Vector<Vector<String>>(), title2));
JScrollPane scroll1 = new JScroll... | <p>Have you implemented the other methods for <code>TableModel</code>? If so, how does your implementation look? Maybe you should post your table model code to let us inspect it?</p>
<p>BTW: My main error when implementing <code>TableModel</code> was to override <code>getRowCount()</code> and <code>getColumnCount()</c... | <p>this solve the problem ; you not allowed to unbind the main bindingGroup but you specify the jtablebinding to update it like this</p>
<pre><code>Binding b = bindingGroup.getBindings().get(0);
b.unbind();
b.bind();
</code></pre>
| 48,385 |
<p>I have a non-.Net executable file that is included in my .net assembly as an embedded resource. Is there a way to run this executable that does not involve writing it out to disk and launching it?</p>
<p>This is .Net 2.0.</p>
| <p>You can load a .NET assembly from a byte array using an overload of <a href="http://msdn.microsoft.com/en-us/library/twt16z2x.aspx" rel="nofollow noreferrer">Assembly.Load</a>.</p>
<p>However, there are implications for the security model that need to be considered which make things more complex. See the discussion... | <p>You might try injecting your exe into a suspended process and then awakening the hijacked process, but this seems like a recipe for disaster.</p>
| 9,823 |
<p>I completely understand the concept of expression trees, but I am having a hard time trying to find situations in which they are useful. Is there a specific instance in which expression trees can be applied? Or is it only useful as a transport mechanism for code? I feel like I am missing something here. Thanks!</p>
| <blockquote>
<p>Or is it only useful as a transport mechanism for code?</p>
</blockquote>
<p>It's useful as an <em>execution mechanism</em> for code. Using the <a href="http://en.wikipedia.org/wiki/Interpreter_pattern" rel="noreferrer">interpreter pattern</a>, expression trees can directly be interpreted. This is us... | <p>Expression trees are useful when you need to access function logic in order to alter or reapply it in some way.</p>
<p>Linq to SQL is a good example:</p>
<pre><code>//a linq to sql statement
var recs (
from rec in LinqDataContext.Table
where rec.IntField > 5
select rec );
</code></pre>
<p>If we did... | 4,736 |
<p>On IIS 6, what does an IIS reset do? </p>
<p>Please compare to recycling an app pool and stopping and starting an ASP.NET web site.</p>
<p>If you replace a DLL or edit/replace the web.config on an ASP.NET web site is that the same as stopping and starting that web site?</p>
| <p>IISReset stops and restarts the entire web server (including non-ASP.NET apps)<br>
Recycling an app pool will only affect applications running in that app pool.<br>
Editing the web.config in a web application only affects that web application (recycles just that app).<br>
Editing the machine.config on the machine wi... | <p>Here what's technet has to say about <a href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/003ed2fe-6339-4919-b577-6aa965994a9b.mspx?mfr=true" rel="nofollow noreferrer">iisreset</a></p>
<blockquote>
<p>You might need to restart Internet Information Services (IIS) before certain confi... | 4,347 |
<p>When I run the following, PowerShell hangs waiting for the dialog to close, even though the dialog is never displayed:</p>
<pre><code>[void] [Reflection.Assembly]::LoadWithPartialName( 'System.Windows.Forms' )
$d = New-Object Windows.Forms.OpenFileDialog
$d.ShowDialog( )
</code></pre>
<p>Calling <code>ShowDialog</... | <p>I was able to duplicate your problem and found a workaround. I don't know why this happens, but it has happened to others.</p>
<p>If you set the ShowHelp property to $true, you will get the dialog to come up properly.</p>
<p>Example:</p>
<pre><code>[void] [Reflection.Assembly]::LoadWithPartialName( 'System.Windo... | <p>Apparently this has something to do with Multi-Threaded Apartment (MTA) mode.
It appears to work fine in Single-Threaded Apartment (-STA) mode.</p>
<p>See also: <a href="https://stackoverflow.com/questions/127188/could-you-explain-sta-and-mta">Could you explain STA and MTA?</a></p>
| 26,637 |
<p>I want to use svn command line with beyond compare and get the following output</p>
<pre><code>Text Compare
Produced: 11/16/2008 11:45:34 AM
SourceFile,CompareFile,IOriginal,IAdded,IDeleted,IChanged,UOriginal,UAdded,UDeleted,UChanged
"E:\Downloads\eeli\eel\1.c","E:\Downloads\eeli\eel\2.c",967,192,501,270,368,113,2... | <p>Put this in (for example) c:\bin\bcsvn.bat</p>
<pre><code>@REM To configure this as the Subversion diff command, add these lines to
@REM c:\Documents and Settings\username\Application Data\Subversion\config:
@REM
@REM [helpers]
@REM diff-cmd = c:\bin\bcsvn.bat
@REM
@"C:\Progra~1\Beyond~1\bcomp.exe" "%6" /title1=... | <p>The instructions suggested by the others didn't work for me. Here's how I finally got it:</p>
<p>I. On a Windows Explorer window, Right-click > TortoiseSVN > Settings</p>
<ol>
<li>Diff Viewer</li>
<li>External</li>
<li><p><code>...</code></p>
<p><a href="https://i.stack.imgur.com/m40IO.png" rel="nofollow noreferr... | 37,566 |
<p>I want to create a SQL Server Express database on my local machine and then upload it to a website that will be using the full SQL Server software - can I do this ?</p>
| <p>The MS SQL Express databases are completely compatible with full versions of MS SQL Server. So just backup and restore.</p>
| <p>Yes, they are designed to be compatible. You can either script out of the database or use the Backup/Restore functionality built into SQL Server Management Studio. More details on the latter can be found <a href="http://www.microsoft.com/technet/prodtechnol/sql/2005/MgSQLExpwSSMSE.mspx" rel="nofollow noreferrer">h... | 23,213 |
<p>How can I perform list comprehensions in C#?</p>
| <p>Found this when I was looking up how to do list comprehensions in C#...</p>
<p>When someone says list comprehensions I immediately think about Python. The below code generates a list that looks like this:</p>
<pre><code>[0,2,4,6,8,10,12,14,16,18]
</code></pre>
<p>The Python way is like this:</p>
<pre><code>list ... | <p>While this isn't a tutorial, here's some code that illustrates the concept:</p>
<pre><code>public List<string> ValidUsers(List<User> users) {
List<string> names = new List<string>();
foreach(User user in users) {
if(user.Valid) {
names.Add(user.Name);
}
}
return names;
... | 15,898 |
<p>I am working with a Visual Studio 2005 C++ solution that includes multiple projects (about 30).
Based upon my experience, it often becomes annoying to maintain all the properties of the projects (i.e include path, lib path, linked libs, code generation options, ...), as you often have to click each and every proje... | <p>I think you need to investigate properties files, i.e. <a href="http://msdn.microsoft.com/en-us/library/a4xbdz1e%28v=VS.90%29.aspx" rel="noreferrer">*.vsprops</a> (older) or <a href="https://msdn.microsoft.com/en-us/library/669zx6zc.aspx" rel="noreferrer">*.props</a> (latest)</p>
<p>You <strong>do</strong> need to ... | <p>*.vcxproj files are msbuild files. So you just take a property you don't want in all your project files and delete it. Then put it in your property sheet. Then make sure all the projects files properly import that property sheet.</p>
<p>This can be incredibly tedious for hundreds of files. I wrote a tool make this ... | 13,685 |
<p>I'm working on a search module that searches in text columns that contains html code. The queries are constructed like: WHERE htmlcolumn LIKE '% searchterm %';</p>
<p>Default the modules searches with spaces at both end of the searchterms, with wildcards at the beginning and/or the end of the searchterms these spac... | <p>Look into MySQLs fulltextsearch, it might be able to use non-letter characters as delimiters. It will alsow be much much faster than a %term% search since that requires a full table-scan.</p>
| <p>You could use a regular expression: <a href="http://dev.mysql.com/doc/refman/5.0/en/regexp.html" rel="nofollow noreferrer">http://dev.mysql.com/doc/refman/5.0/en/regexp.html</a></p>
| 34,184 |
<p>How can one open a PNG formatted image file with VB6? Ideally, I (that is my customer) would like to have the PNG file open and placed into seperate R(ed), G(reen) and B(lue) arrays.</p>
<p>VB6 is not my tool of choice (for lack of knowledge) and I be thrilled if some one could point me in the right direction for ... | <p>Take a look at System.Diagnostics.StackTrace and then you can create just one log call getting the function from the stack. </p>
| <p>Look at <a href="http://www.postsharp.org/about/features/" rel="nofollow noreferrer">PostSharp</a>. It allows you do this with very easy way and much more.</p>
<p>There is samples with loging too.</p>
| 31,244 |
<p>I am a part time developer (full time student) and the company I am working for uses SQL Server 2005. The thing I find strange about SQL Server that if you do a script that involves inserting, updating etc there isn't any real way to undo it except for a rollback or using transactions.</p>
<p>You might say what's w... | <p>I don't believe you missed anything. Using transactions to prevent against these kind of errors is the best mechanism and it is the same mechanism Oracle uses to protected the end user. The difference is that Oracle implicitly begins a transaction for you whereas in SQL Server you must do it explicitly.</p>
| <p>I think transactions work well. You could rollback the DB (to a previous backup or point in the log), but I think transactions are much simpler.</p>
| 47,057 |
<p>Does anyone know how to use CruiseControl.Net to publish to an FTP server?</p>
| <p>I don't think there's a specific way to do this. You can of course always run the commandline ftp client in window from cruise control.net</p>
<p>One tip:</p>
<p>I found that stuff like this can be hard to set up and maintain in cc.net. There's a lot of trial and error involved and because you're working on a serv... | <p>We had aa problem at work in that we need to do a lot of file operations during our builds, so i wrote a plugin to do this.</p>
<p>Resource wise, this is very easy to do, all the information i needed was in this link:
<a href="http://confluence.public.thoughtworks.org/display/CCNET/Custom+Builder+Plug-in" rel="nofo... | 33,152 |
<p>In algebra if I make the statement x + y = 3, the variables I used will hold the values either 2 and 1 or 1 and 2. I know that assignment in programming is not the same thing, but I got to wondering. If I wanted to represent the value of, say, a quantumly weird particle, I would want my variable to have two values a... | <p>You can't do this with native types, but there's nothing stopping you from creating a variable object (presuming you are using an OO language) which has a range of values or even a probability density function rather than an actual value. </p>
<p>You will also need to define all the mathematical operators between ... | <p>You could use a struct and handle the operations manualy. Otherwise, no a variable only has 1 value at a time.</p>
| 39,146 |
<p>I am trying to fix memory leaks in IE 7. Using Drip for investigations but it is not helping much when most dynamically generated DOM elements do not have unique ids.</p>
<p>Tips?</p>
| <p>You should try the <a href="https://learn.microsoft.com/en-us/archive/blogs/gpde/javascript-memory-leak-detector-v2" rel="nofollow noreferrer">Javascript Memory Leak detector</a> developed internally at Microsoft.</p>
| <p>Just remember that memory leaks are really about you not cleaning up after yourself. All you need is a little organization.</p>
<p>In the past, I have created my own proxy object for attaching events to DOM elements. It uses my javascript library's api to actually set and remove events. The proxy itself just keeps ... | 12,092 |
<p>I'd like to discuss the case <a href="https://3dprinting.stackexchange.com/questions/1144/how-to-enlarge-a-sketchup-model">'How to enlarge a Sketchup Model'</a> question and my answer of course.</p>
<p>I do agree with Robert Cartaino when he said:
'<em>The folks here will work hard to curate this collection of know... | <p>Looking at other SE sites, the most common approach seems to make everything lowercase (including names and trademarks) and using hyphens whenever there would be a space or hyphen in normal usage.</p>
<p>As such:</p>
<ul>
<li><p>MatterControl becomes mattercontrol</p></li>
<li><p>Makerbot becomes makerbot</p></li>... | <p>I would say we could use synonyms to stay with clear tag namespace.In this case we apply following pattern (especially for proper name (product name)):</p>
<pre><code>Topic | Existing tag | Synonym?
---------------+-----------------+--------------
MatterControl | mattercontrol | matter-control
</code... | 30 |
<p>I know this is pretty exotic, but I want to deploy a Ruby web application (not Rails, but Rack based, so it plugs into most Ruby servers just fine) using JRuby. Google and friends give me a few success stories, but mostly rails related and if not, no details on the deployment are provided. The framework I'm using is... | <p>In my opinion, running a Rack based application with a rackup script is the real Ruby way. And I wanted to apply the same for JRuby too. That is why I've written jetty-rackup <a href="http://github.com/geekq/jetty-rackup" rel="nofollow noreferrer">http://github.com/geekq/jetty-rackup</a></p>
<p>We are using it for ... | <p>This is the "just works" gem for me: <a href="https://github.com/matadon/mizuno" rel="nofollow">https://github.com/matadon/mizuno</a></p>
| 3,768 |
<p>I would like to implement an interactive evolutionary algorithm for generating music (probably just simple melodies to start with).</p>
<p>I'd like to use <a href="http://www.jfugue.org" rel="nofollow noreferrer">JFugue</a> for this. Its website claims that it is well-suited to evolutionary music, but I can't find... | <p>So far I've found only <a href="http://graphics.stanford.edu/~bjohanso/gp-music/gp_music-old.html" rel="nofollow noreferrer">this</a>, which is a genetic programming example in C.</p>
<p><strong>Update (January 2010):</strong> And <a href="http://darwintunes.org/" rel="nofollow noreferrer">this online system</a>, w... | <p>There is some research going into using <a href="http://en.wikipedia.org/wiki/Cellular_automata" rel="nofollow noreferrer">Cellular Automata</a> for generating music. As with all other music generation, it is really a question of mapping rather than generation. You could use pretty much anything as input as long as ... | 24,206 |
<p>I'm trying to figure out how to decide when to use NSDictionary or NSCoder/NSCoding?</p>
<p>It seems that for general property lists and such that NSDictionary is the easy way to go that generates XML files that are easily editable outside of the application.</p>
<p>When dealing with custom classes that holds data... | <p>Apple's documentation on <a href="http://developer.apple.com/documentation/Cocoa/Conceptual/Archiving/Concepts/objectgraphs.html" rel="noreferrer">object graphs</a> has this to say:</p>
<blockquote>
<p>Mac OS X serializations store a simple hierarchy of value objects, such as dictionaries, arrays, strings, and binar... | <p>I think you're a bit confused, NSDictionary is a data structure, it also happens to implement the NSCoding protocol. So in essence, you could either put all your data into a NSDictionary and have that encode itself later on, or you can implement the NSCoding protocol and encode your object tree using the NSCoder API... | 17,956 |
<p>I was wondering if i could get some help with two questions I have:</p>
<p>Firstly, is is possible, assuming I have a random variable to load up two different registration screens? Ie. one with and without the captcha? or one with and without some other stuff i would like to use?</p>
<p>Secondly, is it possible to... | <p>Chris have you tried asking the guys on the <a href="http://www.phpbb.com/community/?sid=fde569d6a492d70273b878edfeece0f4" rel="nofollow noreferrer">phpBB community forums</a>?</p>
<p>They might be able to help you as I would assume that modifying phpBB is thier bread and butter.</p>
<p><a href="http://www.phpbb.c... | <p>phpBB is open source, so you can modify it to do both those things - but they are not options available out-of-the-box.</p>
| 25,076 |
<p>I'm running Python 2.6 on Unix and when I run the interactive prompt (<a href="http://en.wikipedia.org/wiki/SQLite" rel="noreferrer">SQLite</a> is supposed to be preinstalled) I get:</p>
<pre><code>[root@idev htdocs]# python
Python 2.6 (r26:66714, Oct 23 2008, 16:25:34)
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] ... | <p>The error: </p>
<pre><code>ImportError: No module named _sqlite3
</code></pre>
<p>means that <a href="http://en.wikipedia.org/wiki/SQLite" rel="noreferrer">SQLite</a> 3 does not find the associated shared library. On Mac OS X it's _sqlite3.so and it should be the same on other Unix systems. </p>
<p>To resolve the... | <p>Does that fix your problem?</p>
<pre><code>Python 2.5.4 (r254:67916, May 31 2009, 16:56:01)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No mod... | 28,883 |
<p>I place using namespace in a view code behind but i can't call any class of this name space in aspx.</p>
<p>In codebehind:</p>
<pre><code>using MVCTest.Controller;
</code></pre>
| <p>try to use in your aspx / ascx file</p>
<pre><code><%@ import namespace='your namespace' %>
</code></pre>
<p>you could also try to import your namespace in the web.config</p>
<pre><code><system.web>
<pages>
<namespaces>
<add namespace='you namespace' />
</namespace... | <p>Suppose this is your .Cs file say</p>
<blockquote>
<p>namespace MVCTest.Controller {</p>
<pre><code>public class Utility
{
public static void func1()
{}
}
</code></pre>
<p>}</p>
</blockquote>
<p>Try calling the function by : Utility.func1()</p>
| 45,854 |
<p>Are there any free tools that implement evidence-based scheduling like <a href="http://www.joelonsoftware.com/items/2007/10/26.html" rel="nofollow noreferrer">Joel talks about</a>? There is FogBugz, of course, but I am looking for a simple and free tool that can apply EBS on some tasks that I give estimates (and act... | <p>FogBugz is free for up to 2 users by the way. As far I know this is the only tool that does EBS.</p>
<p>See here <a href="http://www.workhappy.net/2008/06/get-fogbugz-for.html" rel="noreferrer">http://www.workhappy.net/2008/06/get-fogbugz-for.html</a></p>
| <p><a href="http://en.wikipedia.org/wiki/Evidence_Based_Scheduling" rel="nofollow noreferrer">According to Wikipedia</a>, Fogbugz is the only product currently offering EBS.</p>
| 3,035 |
<p>I am trying to understand if I really have any case for using git/mercurial.</p>
<p>The projects I work are java and c# projects, usually with 5-20 people working towards
a common goal (the "release"). Most of the developers are professional developers who
refactor code <em>all of the time</em>. So where the typic... | <p>In terms of mentality, there is sometimes a benefit in being able to create a soft-branch, perform all the changes in the soft branch, test the result of the changes in the soft branch, and then when the soft-branch is "complete", reintegrate it with the main branch locally, retest it, and then propagate it. </p>
<... | <p>what you described in SVN, can be done using git/mercurial</p>
| 46,339 |
<p><strong>Problem</strong>. I need a way to find Starteam server time through Starteam Java SDK 8.0. Version of server is 8.0.172 so method <code>Server.getCurrentTime()</code> is not available since it was added only in server version 9.0.</p>
<p><strong>Motivation</strong>. My application needs to use views at spec... | <p>After some investigation I haven't found any cleaner solution than using a temporary item. My app requests the item's time of creation and compares it with local time. Here's the method I use to get server time: </p>
<pre><code>public Date getCurrentServerTime() {
Folder rootFolder = project.getDefaultView().ge... | <p><code><stab_in_the_dark></code>
I'm not familiar with that SDK but from looking at the API if the server is in a known timezone why not create and an OLEDate object whose date is going to be the client's time rolled appropriately according to the server's timezone?
<code></stab_in_the_dark></code></p>
| 15,335 |
<p>Our automated builds and tests are taking an increasing amount of resources, especially since we support many platforms and test in both debug and optimized. So, I'm looking for some tool support that would allow a more incremental "pipeline" approach so we could get feedback and results faster. Some ideal charact... | <p>You might want to take a look at <a href="http://jenkins-ci.org/" rel="nofollow noreferrer">Jenkins (formerly Hudson)</a>.</p>
| <p>My JetBrains TeamCity setup approximates what you need.</p>
<p>Under a single project, I've set up multiple different build configurations.</p>
<p>The difference between each build configuration is in the choice of build targets (I use NAnt) and in triggering.</p>
<p>I have an "XYZ Integration" configuration whic... | 28,093 |
<p>After a couple of hours fighting with the <a href="http://gallery.menalto.com/" rel="nofollow noreferrer">Gallery2</a> <a href="http://codex.gallery2.org/Gallery2:Modules:rss" rel="nofollow noreferrer">RSS module</a> and getting only the message, "no feeds have yet been defined", I gave up. Based on <a href="http:/... | <p>My eventual (and hopefully temporary) solution to this problem was a Python CGI script. My script follows for anyone who might find it useful (despite the fact that this is a total hack). </p>
<pre><code>#!/usr/bin/python
"""A CGI script to produce an RSS feed of top-level Gallery2 albums."""
#import cgi
#import... | <p>Well, I am unsure this can help you but here is a very simple RSS that was presented as solution in another topic:</p>
<p><a href="https://stackoverflow.com/questions/82872/php-rss-builder#84601">PHP RSS Builder</a></p>
| 2,899 |
<p>IDE: Microsoft Visual Studio Professional 2008</p>
<p>Language: C#</p>
<p>Background:
I have one form and two groupboxes that are going to be used as preference catagory groupboxes. My problem is that everytime I drag one groupbox on top of the other (hide/show groupboxes upon listview catagory select), the base g... | <p>You may consider resizing your second GroupBox into position over the first. Drag one side or one corner of the second group box until it covers the first GroupBox and continue to resize the second GroupBox until it is positioned as you desire.</p>
<p>Also available, in the Layout Toolbar, are the alignment and sizi... | <p>The behavior of the group box is that you can drag controls into it, including other group box controls. If you let go of the mouse while dragging it over, it will become a child of that groupbox, and AFAIK there is no way to change the designer. Unless you work potentially with send to back first, than load the o... | 33,285 |
<p>I am working with a bunch of Makerbot Replicator+ printers and one Z18 in a classroom. I would like my students to be able to print cups and stuff to drink from if they want. I know I need a food-safe material AND a food safe nozzle if it can be managed.</p>
<p>So, I wanted to check the following:</p>
<ol>
<li><p>Is... | <p>FDM itself is not particularly food-safe, coating the print may prevent bacteria to settle in crevices. Furthermore, the filament should be able to withstand high temperatures for extended periods of time in case you want to clean the printed cups to kill bacteria.</p>
<p>An overview of food-safe filaments is given ... | <p>A better alternative would be PETG, it's food safe on it's own and has more heat tolerance than PLA. It prints with much the same ease as PLA.</p>
<p>I'm not familiar with your particular printer, but nozzles are standard sizes. Swapping a brass nozzle for a stainless steel one doesn't need anything extra done. They... | 2,200 |
<p>Im planning on building an enclosure for my CR-10S and am debating whether to use MDF walls lined with an insulation foam that reduces noise and keeps the heat in or going with double pane glass walls.</p>
<p>My main concern is not necessarily keeping the enclosure hot as it is for noise reduction. Obviously the wo... | <p>First you should check if the bed still works when applying 12V directly. You can then also check the voltage over the 12V output terminals to measure the power supply unit while it is powering the bed. It is unclear whether you measured the voltage of the PSU while it was powering a large load.</p>
<p>It is also a... | <p>you can swap pins in Marlin firmware.
When you download it from GitHub, there is a file called <a href="https://github.com/prusa3d/Prusa-Firmware/blob/MK3/Firmware/pins.h" rel="nofollow noreferrer">pins.h</a> (please be aware that this file is an example), and you can play with your setup to skip the broken mosfet.<... | 931 |
<p>I am working on a site and working on a component that will take users using wap or xhtml-mp and redirect them to sites specifically setup for those devices. Is there a good standard way of detecting which of these the user is using?</p>
| <p>Because no matter what you do you WILL get it wrong sooner or later, each version of the site should include a link to a page where the user can choose an appropriate format. Once they chose, cookie them and, if present, use that cookie as an override to whatever user-agent sniffing would have told you.</p>
<p>In a... | <p><a href="http://en.wikipedia.org/wiki/User_agent" rel="nofollow noreferrer">User Agent</a> <a href="http://en.wikipedia.org/wiki/Browser_sniffing" rel="nofollow noreferrer">Sniffing</a></p>
| 44,287 |
<p>I’m starting a project where I need to implement a light-weight interpreter.
The interpreter is used to execute simple scientific algorithms.
The programming language that this interpreter will use should be simple, since it is targeting non- software developers (for example, mathematicians.)</p>
<p>The interpreter... | <p>I would write it in <a href="http://www.antlr.org/" rel="noreferrer">ANTLR</a>. Write the grammar, let ANTLR generate a C# parser. You can ANTLR ask for a parse tree, and possibly the interpreter can already operate on the parse tree. Perhaps you'll have to convert the parse tree to some more abstract internal repre... | <blockquote>
<p>The programming language that this interpreter will use should be simple, since it is targeting non- software developers.</p>
</blockquote>
<p>I'm going to chime in on this part of your question. A simple language is not what you really want to hand to non-software developers. Stripped down languag... | 32,023 |
<p>different programming languages have different features or lack certain features. Design patterns are a way to work around those shortcomings. I have seen the books and lists about design patterns in static, object oriented languages (Java, C++), but also the Videos about design patterns in Python.</p>
<p>I'm inter... | <p>Design patterns are sometimes called "idioms". In non-OO languages (C, Forth, COBOL, etc.) they're just "the usual ways of doing things". Sometimes, they're called "algorithms". Every language (indeed, every discipline) has patterns of designing solutions.</p>
<p>If you've seen something two or three times, you'... | <p>Delegates and events in C# and .Net make it trivial to implement the <a href="http://en.wikipedia.org/wiki/Observer_pattern" rel="nofollow noreferrer">observer pattern</a>, since it is so commonly used, e.g. to handle GUI events.</p>
| 15,497 |
<p>When deploying the application to the device, the program will quit after a few cycles with the following error:</p>
<pre><code>Program received signal: "EXC_BAD_ACCESS".
</code></pre>
<p>The program runs without any issue on the iPhone simulator, it will also debug and run as long as I step through the instructio... | <p>From your description I suspect the most likely explanation is that you have some error in your memory management. You said you've been working on iPhone development for a few weeks, but not whether you are experienced with Objective C in general. If you've come from another background it can take a little while bef... | <p>In my case it was caused tableview delete operation. This solution solved my bad access exception: <a href="https://stackoverflow.com/a/4186786/538408">https://stackoverflow.com/a/4186786/538408</a></p>
| 42,377 |
<p>I have OctoPrint set up on a Raspberry Pi (OctoPi). I have loaded a number of G-code files to the SD card on the printer.</p>
<p>My question is: If I initiate a print from the SD card via OctoPrint, can I then turn off the RPi so I can use it for other things while the print continues?</p>
| <p>Your printer will stop printing. So no.</p>
| <p>Disconnecting the USB or connecting it triggers a reboot in the printer. As a result, you can not disconnect or turn off the print server running OctoPrint.</p>
| 1,816 |
<p>I have a migration in Rails that inserts a record into the database. The Category model depends on this record. Since RSpec clears the database before each example, this record is lost and furthermore never seems to be created since RSpec does not seem to generate the database from migrations. What is the best way ... | <p>It's not that RSpec clears the database, it's that Rails's rake:db:prepare task copies the <em>schema</em> (but not the contents) of your dev database into your *_test db.</p>
<p>Yes, you can use <code>before(:all)</code>, as transactions are wrapped around each individual example - but a simple fixture file would ... | <p>What I like to do is create a folder in db/migration called data, and then put yml fixtures in there, in your case categories.yml</p>
<p>Then I create a migration with the following</p>
<pre>
def self.up
down
directory = File.join( File.dirname(__FILE__), "data" )
Fixtures.create_fixtures( directory, "categorie... | 34,070 |
<p>I have a winforms application that is doing the following:</p>
<p>on each query:</p>
<ol>
<li>Db connect</li>
<li>Db query</li>
<li>Db disconnect</li>
</ol>
<p>as we are trying to avoid having to keep the db connection open. This suffers from performance as we have to connect / disconnect everytime.</p>
<p>What... | <p>The most efficient means is connection pooling, and <a href="http://msdn.microsoft.com/en-us/library/8xx3tyca.aspx" rel="nofollow noreferrer">ADO.NET does this automatically for you</a> as long as you make sure to close your connections. Just wrap your <code>SqlConnection</code> objects into <code>using</code> state... | <p>Maybe try to think about caching your data? My own rough tests have shown querying in memory data to be up to 20x quicker than querying the same data from the database. Though this approach might not suit your schema or your data needs, it is always worth looking at caching frequently accessed data somewhere if you ... | 40,308 |
<p>I get this error when I do the make:</p>
<pre><code>relocation R_X86_64_32 against `vtable for Torch::MemoryDataSet' can not be used
when making a shared object; recompile with -fPIC
</code></pre>
<p>It says that I should recompile with the <code>-fPIC</code> option. I did that, adding
the <code>-fPIC</code> opt... | <p>I had this problem quite a while back and if I remember correctly, the fix was moving the placement of -fPIC just after gcc in the command line. Made absolutely no sense, and less so now, but as I remember, that fixed it.</p>
| <p>if the project you'd like to compile has a correct configure script use like this:</p>
<pre><code>$ ./configure 'CFLAGS=-g -O2 -fPIC ....' --enable-some-thing
</code></pre>
<p>so the flag will be all the Makefile's rule ...</p>
<p>few days before i've need an elder ver. of VLC to compile on an x64 machine, it has... | 43,122 |
<p>I'm thinking of asking my students to use git for pair programming. Because student work has to be secret, a public repo is out of the question. Instead, each student will have a private repo they maintain themselves, and they will need to exchange patches using git-format-patch. I've read the man page but I'm a ... | <p>It works best if they can see each other's git repos. git itself is managed this way (there's a public repo people can reference, and then they format-patch from there). If people <em>never</em> see each other's repos, things are a bit more difficult...</p>
<p>One thing they may do is maintain a reference to the ... | <p>It seems that <a href="https://git-scm.com/docs/git-bundle" rel="nofollow"><code>git bundle</code></a> is the better option. Unlike <code>git format-patch</code> which is a one-way communication workflow, bundle allows you to leverage the same workflow you use with public remotes but are separated from direct access... | 42,403 |
<p>I want to use input from a user as a regex pattern for a search over some text. It works, but how I can handle cases where user puts characters that have meaning in regex?</p>
<p>For example, the user wants to search for Word <code>(s)</code>: regex engine will take the <code>(s)</code> as a group. I want it to tr... | <p>Use the <code>re.escape()</code> function for this:</p>
<p><a href="http://docs.python.org/library/re.html#re.escape" rel="noreferrer">4.2.3 <code>re</code> Module Contents</a></p>
<blockquote>
<p><strong>escape(string)</strong></p>
<p>Return string with all non-alphanumerics backslashed; this is useful if ... | <p>Usually escaping the string that you feed into a regex is such that the regex considers those characters literally. Remember usually you type strings into your compuer and the computer insert the specific characters. When you see in your editor <code>\n</code> it's not really a new line until the parser decides it i... | 35,462 |
<p>I have a class to parse a matrix that keeps the result in an array member:</p>
<pre><code>class Parser
{
...
double matrix_[4][4];
};
</code></pre>
<p>The user of this class needs to call an API function (as in, a function I have no control over, so I can't just change its interface to make things work more ea... | <p>Here's a nice, clean way:</p>
<pre><code>class Parser
{
public:
typedef double matrix[4][4];
// ...
const matrix& getMatrix() const
{
return matrix_;
}
// ...
private:
matrix matrix_;
};
</code></pre>
<p>Now you're working with a descriptive type name rather than an array, but sin... | <p>I've used a union like this to pass around matrices in the past:</p>
<pre><code>union matrix {
double dflat[16];
double dmatr[4][4];
};
</code></pre>
<p>Then pass a pointer in to your setter and copy the data into the matrix in your class.</p>
<p>There are ways of handling this otherwise (that are more ge... | 7,880 |
<p>After reading it, this is <em>not</em> a duplicate of <a href="https://stackoverflow.com/questions/44917/explicit-vs-implicit-sql-joins">Explicit vs Implicit SQL Joins</a>.
The answer may be related (or even the same) but the <strong>question</strong> is different.</p>
<hr>
<p>What is the difference and what shoul... | <p>They are not the same thing.</p>
<p>Consider these queries:</p>
<pre><code>SELECT *
FROM Orders
LEFT JOIN OrderLines ON OrderLines.OrderID=Orders.ID
WHERE Orders.ID = 12345
</code></pre>
<p>and</p>
<pre><code>SELECT *
FROM Orders
LEFT JOIN OrderLines ON OrderLines.OrderID=Orders.ID
AND Orders.ID = 12345
</c... | <p>this is my solution.</p>
<pre><code>SELECT song_ID,songs.fullname, singers.fullname
FROM music JOIN songs ON songs.ID = music.song_ID
JOIN singers ON singers.ID = music.singer_ID
GROUP BY songs.fullname
</code></pre>
<p>You <em>must have</em> the <code>GROUP BY</code> to get it to work.</p>
<p>Hope this help.</... | 46,121 |
<p>I have some data that I want to store somewhere in my Rails app because I use it for generating form fields, checking a submitted form to ensure its values are valid, etc. Basically, I want the data in one location because I make use of it in several places.</p>
<p>Previously, I was defining an <code>initialize</c... | <p>For constants that don't really belong anywhere else I have a StaticData class.</p>
<pre><code> class StaticData
GRAPH_TYPES = ['bar', 'line']
SOMETHING_ELSE = ['A', 'B']
end
</code></pre>
<p>Then I get at it with</p>
<pre><code>StaticData::GRAPH_TYPES
</code></pre>
| <p>If you are generating forms that are related to some resource then it will be good variant to store it in the models. You don't need to store it in DB because it can be simple class or instance variables/methods.</p>
<p>The same idea is for validation. If you are validating resources/model instances then it will be... | 47,141 |
<p>I have a plug-in to an Eclipse RCP application that has a view. After an event occurs in the RCP application, the plug-in is instantiated, its methods are called to populate the plug-in's model, but I cannot find how to make the view appear without going to the "Show View..." menu.</p>
<p>I would think that there ... | <p>You are probably looking for this:</p>
<pre><code>PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("viewId");
</code></pre>
| <p>In e4, the EPartService is responsible for opening Parts. This can also be used to open e3 ViewParts. Instantiate the following class through your IEclipseContext, call the openPart-Method, and you should see the Eclipse internal browser view.</p>
<pre><code>public class Opener {
@Inject
EPartService partSe... | 20,714 |
<p>I'm looking to add localization to a web site (asp.net /c# if that makes a difference) with a minimum of effort. I've looked at tools like <a href="http://www.wizart.com/en/index.shtml" rel="nofollow noreferrer">wiztom</a> <a href="http://www.multilizer.com/" rel="nofollow noreferrer">multilizer</a> and I am curious... | <p>You can use <a href="https://stackoverflow.com/questions/85353/best-general-svn-ignore-pattern">svn:ignore</a> to avoid committing unnecessary files...</p>
| <p><a href="http://visualsvn.com" rel="nofollow noreferrer">VisualSVN</a> automatically creates svn:ignore rules for binary and user-specific folders, as soon as you add a solution to Subversion.</p>
| 22,486 |
<p>In a project I am working on, we have an ongoing discussion amongst the dev team - should the production environment be deployed as a checkout from the SVN repository or as an export?</p>
<p>The development environment is obviously a checkout, since it is constantly updated.
For the production, I'm personally for c... | <p><a href="http://subversion.tigris.org/faq.html#website-auto-update" rel="noreferrer">The Subversion FAQ</a> seems to advocate deployment as a checkout, autoupdated with post-commit hook scripts. They prevent Apache from exporting .svn folders (probably a good idea) by adding the following in httpd.conf:</p>
<pre><c... | <p><h2>EXPORT</h2> that's it. You don't have any good reason to put extra junk into production system.</p>
<ul>
<li>You'll expose your source code</li>
<li>If this is web application it's even worse, your visitors can download your source code, how cool is that! very open :)</li>
</ul>
| 21,106 |
<p>I am building a project involving natural language processing, since the nlp module currently only deal with english text, so I have to make sure the user submitted content (not long, only several words) is in english. Are there established ways to achieve this? Python or Javascript way preferred.</p>
| <p>If the content is long enough I would suggest some <a href="http://en.wikipedia.org/wiki/Frequency_analysis" rel="nofollow noreferrer">frequency analysis</a> on the letters. </p>
<p>But for a few words I think your best bet is to compare them to an English dictionary and accept the input if half of them match.</p>
| <p>You could break the phrase up into words and check a dictionary (there are some that you can download, <a href="http://wordlist.sourceforge.net/" rel="nofollow noreferrer">this</a> may be of interest), but that would require that the dictionary you used was good enough.</p>
<p>It would also fall over for proper nou... | 23,933 |
<p>Is there any way I can specify a standard or custom numeric format string to always output the sign, be it +ve or -ve (although what it should do for zero, I'm not sure!)</p>
| <p>Yes, you can.
There is conditional formatting. See <a href="http://msdn.microsoft.com/en-us/library/0c899ak8.aspx" rel="noreferrer">Conditional formatting in MSDN</a></p>
<p>eg: </p>
<pre><code>string MyString = number.ToString("+0;-#");
</code></pre>
<p>Where each section separated by a semicolon represents pos... | <p>I cannot comment so i Do an answer here (nuts reputation system ....)</p>
<p>You can Use number.ToString("+0;-#") very well to Produce the UTC String TimeFormat</p>
<p>Here showed in PowerShell code</p>
<pre><code>"$([System.DateTime]::Now.ToString('HH:mm:ss.fff'))$($([System.TimeZoneInfo]::Local.GetUtcOffset([Sy... | 45,308 |
<p>Looking to hear from people who are using WCF in an enterprise environment.</p>
<p>What were the major hurdles with the roll out?
Performance issues?
Any and all tips appreciated!</p>
<p>Please provide some general statistics and server configs if you can!</p>
| <p>WCF can be <a href="http://msdn.microsoft.com/en-us/library/ms731734.aspx" rel="nofollow noreferrer" title="WCF configuration schema">configuration hell</a>. Be sure to familiarize yourself with its <a href="http://msdn.microsoft.com/en-us/library/ms732023.aspx" rel="nofollow noreferrer">diagnostics and svcTraceView... | <p>WCF is definitely great for enterprise stuff as it is designed with scalability, extensibility, security, etc... in mind. </p>
<p>as maxidad said, it can be very hard though as exceptions often tell you nearly nothing, if you use security (obvisously for enterprise scenarios) you have to deal with certificates, mea... | 28,528 |
<p>I need to know how the performance of different XML tools (parsers, validators, XPath expression evaluators, etc) is affected by the size and complexity of the input document. Are there resources out there that document how CPU time and memory usage are affected by... well, what? Document size in bytes? Number of no... | <p>If I was faced with that problem and couldn't find anything on google I would probably try to do it my self.</p>
<p>Some "back-of-an-evelope" stuff to get a feel for where it is going. But it would kinda need me to have an idea of how to do a xml parser.
For non algorithmical benchmarks take a look here:</p>
<ul>... | <p>I was planning to load extremely large XML files in my application. I asked the question here on Stack Overflow: <a href="https://stackoverflow.com/questions/264020/fastest-possible-xml-handling-in-delphi-for-very-large-documents">Fastest Possible XML handling for very large documents</a>.</p>
<p>And yes, it was t... | 5,172 |
<p>How can i change database encoding for a PostgreSQL database using sql or phpPgAdmin?</p>
| <p>In short, you cannot do this with only phpPgAdmin or SQL without risking <strong>existing data corruption</strong>.
You have to export all data, create database with correct encoding and restore exported data.</p>
<p>This is how you should proceed:</p>
<ol>
<li><p><strong>create database dump</strong>:</p>
<p><co... | <p>To expand on the answers given, you can use these commands to accomplish your task.</p>
<pre><code>// Backup the database to outfile
pg_dump dbname > outfile
// Terminate all connections to the database
psql -c "SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname='dbname';"
// Delete the datab... | 49,922 |
<p>I'd like to sort on a column in the result of a stored procedure without having to add the Order By clause in the stored procedure. I don't want the data to be sorted after I have executed the query, sorting should be part of the query if possible. I have the following code:</p>
<pre><code>public static DataTable R... | <p>Get the DataTable you are populating in the dataSet ("Result").</p>
<p>Now - there's no way to sort the DataTable, except via the Query, View, or Stored
Procedure that populates it. </p>
<p>Since you don't wanna do it in the SP, you can sort the DefaultView of the
DataTable, or any DataView that is associated wi... | <p>To be honest, since you are using DataTable, you might as well just sort at the client.</p>
<p>Dynamic sorting (at the server) via SPs etc is always a pain; to do it in pure TSQL, you either need some horribly inefficient CASE block at the end of the SELECT, or you need to use dynamic SQL (for example via sp_Execut... | 41,851 |
<p>I have been trying to strip out some data from HTML files. I have the logic coded to get the right cells. Now I am struggling to get the actual contents of the 'cell':</p>
<p>here is my HTML snippet:</p>
<p>headerRows[0][10].contents</p>
<pre><code> [<font size="+0"><font face="serif" size="1"><b... | <p>The <a href="http://www.crummy.com/software/BeautifulSoup/documentation.html" rel="nofollow noreferrer">BeautifulSoup documentation</a> should cover everything you need - in this case it looks like you want to use <code>findNext</code>:</p>
<pre><code>headerRows[0][10].findNext('b').string
</code></pre>
<p>A more ... | <p>I have a base class that I extend all Beautiful Soup classes with a bunch of methods that help me get at text within a group of elements that I don't necessarily want to rely on the structure of. One of those methods is the following:</p>
<pre><code> def clean(self, val):
if type(val) is not StringType: val = ... | 27,575 |
<p>We have to convert EVERYTHING to images for archiving purpose. DOC, HTML, email, ZIP, PDF, TXT and any document you can read/view on computer. In addition, it must recursive convent on all embed attachment and files in zip.</p>
<p>I know ImgMaker only. Is it the best or I can have something better?
My boss ask me ... | <p>There is a whole industry built around this type of function and numerous service providers that charge a fee per document to do this type of conversion. You are better off buying than building it on your own.</p>
<p>The idea of converting Everything is fundamentally a fool's errand as you would need a single progr... | <p>The question as asked cannot be answered sensibly. One obvious solution is to simply rename each file by attaching .tiff. E.g. you could get ringtone.mp3.tiff. Insane as it is, there are not many better ways to convert an .mp3 to a .tiff.</p>
<p>Note that this is not an IT problem. The business is assuming everythi... | 44,292 |
<p>is it possible to use the ajaxComplete or ajaxStop features of jQuery to decide whether or not the callback gets called?</p>
<p>Essentially I want to be able to take basic error checking code that is currently in most of my callbacks, and add it to a sort of global callback.</p>
| <p>Sort answer: No.</p>
<p>Long answer: Both <code>ajaxComplete</code> and <code>ajaxStop</code> are jQuery AJAX events. You cannot prevent events from happening - and "event" means nothing else as "execute every callback function that has been registered". Callbacks get called regardless, if you want or not.</p>
<p>... | <p>I also wanted to be able to disable the callback event. Sometimes you want to be able to get the server to redirect you to a different action. Currently, this is not possible with a jQuery ajax call because the response has to go back to the calling view.</p>
| 37,482 |
<p>As a background, I am a developer of an opensource project, a c++ library called <a href="http://www.openframeworks.cc" rel="nofollow noreferrer" title="openframeworks">openframeworks</a>, that is a wrapper for different libraries, like opengl, quicktime, freeImage, etc. In the next release, we've added a c++ libra... | <p>I am not a Visual Studio expert by any stretch of imagination, having hardly used it, but I believe Visual Studio employs link-time optimizations, which can make the resulting code run faster, but can cost a lot of space in the libraries. Also, it may be (I don't know the internals) that debugging information isn't... | <p>The compiled library obj files will be huge because they must contain all of the functions, classes and template that your end users might eventually use.</p>
<p>Executables which link to your library will be smaller because they will include only the compiled code that they require to run. This will usually be a t... | 43,152 |
<p><strong>Does anyone know of an algorithm (or search terms / descriptions) to locate a known image within a larger image?</strong></p>
<p>e.g.</p>
<p>I have an image of a single desktop window containing various buttons and areas (target). I also have code to capture a screen shot of the current desktop. I would ... | <p>You said your image may not be exactly the same, but then say you don't want "fuzzy" algorithms. I'm not sure those are compatible. In general, though, I think you want to look at <a href="http://en.wikipedia.org/wiki/Image_registration" rel="noreferrer">image registration</a> algorithms. There's an open source C... | <p>Your don't need fuzzy as in "neural network" because (as I understand) you don't have rotation, tilts or similar. If OS display differences are the only modifications the difference should be minimal.
So WernerVanBelle's paper is nice but not really necessary and MrFooz's code works - but is terribly innefficient (<... | 38,107 |
<p>Can anyone point me to a good resource (or throw me a clue) to show me how to do DataBinding to controls (ComboBox, ListBox, etc.) in WPF? I'm at a bit of a loss when all my WinForms niceities are taken away from me, and I'm not all that bright to start with...</p>
| <p>The best resource I've found for WPF data binding is <a href="http://www.beacosta.com" rel="nofollow noreferrer">Bea Costa's blog</a>. Start from the first post and read forward. It's awesome.</p>
| <p>in code behind -- set the DataContext of your list box equal to the collection you're binding to.</p>
<pre><code>private void OnInit(object sender, EventArgs e)
{
//myDataSet is some IEnumerable
// myListBox is a ListBox control.
// Set the DataContext of the ListBox to myDataSet
myListBox.DataContext = m... | 2,900 |
<p>I am writing a custom tag in Django that should output a value stored in a user session, but I cannot find a way to access the session object from within a custom tag function. Is there any way to do this, without manually assigning the session object to a context variable?</p>
| <p>You should be able to add the request context processor in your settings.py file:</p>
<pre><code>TEMPLATE_CONTEXT_PROCESSORS = ("django.core.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
'django.core.context_processor... | <p>I found this useful: <a href="http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser" rel="nofollow noreferrer">http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser</a></p>
<p>You can use middleware to grab the user info and store it with a local thread, and then use it with your tag definition.</... | 43,472 |
<p>There are a couple of different ways to remove <code>HTML tags</code> from an <code>NSString</code> in <code>Cocoa</code>.</p>
<p><a href="http://cocoa.karelia.com/Foundation_Categories/NSString/_Flatten__a_string_.m" rel="noreferrer">One way</a> is to render the string into an <code>NSAttributedString</code> and t... | <p>A quick and "dirty" (removes everything between < and >) solution, works with iOS >= 3.2: </p>
<pre><code>-(NSString *) stringByStrippingHTML {
NSRange r;
NSString *s = [[self copy] autorelease];
while ((r = [s rangeOfString:@"<[^>]+>" options:NSRegularExpressionSearch]).location != NSNotFound)
... | <p>Here's a blog post that discusses a couple of libraries available for stripping HTML
<a href="http://sugarmaplesoftware.com/25/strip-html-tags/" rel="nofollow noreferrer">http://sugarmaplesoftware.com/25/strip-html-tags/</a>
Note the comments where others solutions are offered.</p>
| 34,955 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.