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 a Sony SNC-RZ30N IP-based webcam to monitor osprey nests and would like to stream the video feed via our own webserver.</p>
<p>Rather than use the built-in webserver of the camera (which requires either ActiveX or Java on the client side) to display the live feed, I would like to weed out just the live... | <p><em>I don't have enough reputation to comment, so a new answer...</em></p>
<p>In that case I think there are only two options: run a service that converts the existing video feed to a more useable feed (for example to wmv, is accepted by most clients), or create some kind of 'applet' (like in Flash) that updates th... | <p>Some IP-based webcams (I know the Axis cameras do), also offer a static JPG or a motion JPEG over HTTP.
like <code>http://<ip>/img/static.jpg</code>.</p>
<p>Maybe that helps you?</p>
| 10,890 |
<p>I have a JTextArea which displays HTML of an Arabic web page. So it's essentially a mix of English and Arabic. In the JTextArea, with columns set to 30, certain text just disappears instead of wrapping properly. The weird thing is that if I copy the invisible text and paste it into Notepad, then I can see it in Note... | <p>See this screenshot of the problem: </p>
<p><img src="https://i.stack.imgur.com/lErjB.jpg" alt="http://i.stack.imgur.com/lErjB.jpg"></p>
<p>Elie, thanks for the response. Not sure I explained the problem properly though. On the left in the screenshot is the JTextArea. On the right is the selection from the JTex... | <p>Is it the 30th character which is disappearing? It's possible due to the script that the JTextArea cannot render the Arabic characters properly. So it's counting the characters correctly, but doesn't realize that they take up more space. Support for such fonts is not great, so you may want to write a custom renderer... | 41,024 |
<p>I am developing a web-app using zend framework. I like how all the autoloading works however I don't really like the way Zend_Controller names the controllers by default. I am looking for a way to enable zend_controller to understand my controller class named Controller_User stored in {$app}/Controller/User.php . Is... | <p>This is certainly not a step-by-step answer, but I believe you can accomplish what you want by subclassing the standard dispatcher class, and making a few changes to the functions that deal with the controller directory and controller objects. <a href="http://framework.zend.com/manual/en/zend.controller.dispatcher.h... | <p>a subclassed dispatcher ( quoted from <a href="http://cslai.coolsilon.com/2009/03/28/extending-zend-framework/" rel="nofollow noreferrer">http://cslai.coolsilon.com/2009/03/28/extending-zend-framework/</a> )</p>
<pre><code>class Coolsilon_Controller_Dispatcher
extends Zend_Controller_Dispatcher_Standard {
... | 49,543 |
<p>In IIS Manager under Web Service Extensions, ASP.NET v2.0.50727 is set to "Prohibited" by default. I would like to set this to Allow during the install.</p>
<p>I am currently using WiX Version 2.</p>
<p>I have tried using:</p>
<pre><code><Component Id="Allow_WebServiceExtension_ASP.NET_2.0" DiskId="1" Guid="0... | <p>I ended up putting the following code into a custom action:</p>
<pre><code>Dim WebSvcObj As Object
Dim LocatorObj As Object = CreateObject("WbemScripting.SWbemLocator")
Dim ProviderObj As Object = LocatorObj.ConnectServer(".", "root/MicrosoftIISv2", "", "")
WebSvcObj = ProviderObj.get("IIsWebService='w3svc'")
WebSv... | <p>Use the <a href="http://www.wixwiki.com/index.php?title=WebApplicationExtension_Element" rel="nofollow noreferrer">WebApplicationExtension</a> Element in WIX, it's in the IISExtension, need to add the reference to the WIX project.</p>
| 33,929 |
<p>With a distributed application, where you have lots of clients and one main server, should you:</p>
<ul>
<li>Make the clients dumb and the server smart: clients are fast and non-invasive. Business rules are needed in only 1 place</li>
<li>Make the clients smart and the server dumb: take as much load as possible off... | <p>You should do as much client-side processing as possible. This will enable your application to scale better than doing processing server-side. To solve your temperamental user problem, you could look into making your client processes run at a very low priority so there's no noticeable decrease in performance on the ... | <blockquote>
<p>The server must analyze all of this
info to determine the health of these
computers</p>
</blockquote>
<p>That is probably the biggest clue so far explaning what your application is kinda about. Are you able to provide a more elaborate briefing on what this application is seeking to achieve in thi... | 5,626 |
<p>When opening a window, I register a Deleted-event-handler on my business object. It is passed to the constructor as <code>business</code>:</p>
<pre><code>business.Deleted += new EventHandler<EventArgs>(business_Deleted);
</code></pre>
<p>Now the user can click a button to delete it (removing the record, you ... | <p>If you realy want this behaviour ( I don't think, this is good pattern, bud its not matter ), you can derive from EventArgs class and add property for author of deletion.
Then you can do:</p>
<pre><code>c.Delete( this ); //this = window
// ...
void business_Deleted(object sender, EventArgs e) {
bool isDeletedFr... | <p>From the few lines that I see, this could be the problem:</p>
<pre><code>Business business = (Business)businessBindingSource.DataSource;
</code></pre>
<p>It looks like you are changing the reference held by business to a different object. Perhaps yours was only an example though and you are using the same object ... | 39,148 |
<h3>The situation</h3>
<p>When you study social sciences, you are frequently confronted with the need for online surveys (scientific data collection online). That's one of the main reasons why I started with <strong>PHP</strong> in the first place.</p>
<p>Recently these survey applications have grown and grown. A <stro... | <blockquote>
<p>is PHP/mysql still a way to go?</p>
</blockquote>
<p>Yes, PHP/MYSQL (LAMP) has been successfully used in hundreds of sites with exponentially larger user bases than yours. </p>
<blockquote>
<p>could a framework like codeIgnitor be a basis for such an application or should I develop everything from... | <p>You should look into the Open Source Limesurvey application.</p>
<p>It use PHP/Mysql, so that addresses one of your questions regarding the appropriateness of PHP for the task.</p>
<p>The previous version of Limesurvey was written in CodeIgniter, but the projects lead changed to the Yii framework after uncertainty... | 30,225 |
<p>I am writing an editor using <a href="http://www.scintilla.org/" rel="nofollow noreferrer">Scintilla</a>.</p>
<p>I am already using a lexer to do automatic syntax highlighting but now I would like to mark search results. If I want to mark only one hit I can set the selection there, however, I would like to mark (e.... | <p>Have you read the <a href="http://scintilla.sourceforge.net/ScintillaDoc.html#Markers" rel="noreferrer" title="Markers in Scintilla">Markers reference in Scintilla doc</a>?
This reference can be a bit obscure, so I advise to take a look at the source code of SciTE as well. This text editor was originally a testbed f... | <p>I used <a href="http://www.scintilla.org/ScintillaDoc.html#Indicators" rel="nofollow">Indicators</a> to highlight search results.</p>
| 11,805 |
<p>I've got an ASP.NET application running and on the production box it's using about 450MB RAM, however, it shouldn't be using quite so much, and it seems to increase over time, so it seems there might be a leak or atleast something not being released properly. </p>
<p>I took a look with PerfMon and there was 416MB i... | <p>Watching <a href="http://channel9.msdn.com/posts/MSDNSweden/Vanliga-fel-som-grs-med-ASPNET-och-hur-du-hittar-dem-med-WinDbg/" rel="nofollow noreferrer">this</a> TecheEd presentation by Tess would be a good start.</p>
<p>She demonstrates using adplus to take a dump of an ASP.NET application that is consuming a great... | <p>Are you properly disposing of objects of classes that implement IDisposable? This would include SqlConnections, SqlCommand, SqlDataAdapter, DirectoryEntry, etc. Do you have any objects that use unmanaged memory that don't implement IDisposable (and/or aren't getting disposed)?</p>
| 42,689 |
<p>If I have an mssql varchar[1024] that is always empty in a table, how much actual bytes will be wasted in the db file on disk per row?</p>
<p>Please let me know the size for both:</p>
<ol>
<li>NULLs allowed storing ''
<ul>
<li>NULLs not allowed storing ''</li>
<li>NULLs allowed storing NULL</li>
</ul></li>
</ol>
... | <p>I believe that a varchar uses only the minimum storage required to hold the string.
MSDN and books online seem to confirm this.
However, the sum of stored data (including other fields) cannot exceed a certain length (which I think is 8K). I don't think you've got this problem, as I think it is flagged at creation ti... | <p>Depends on whether or not "empty" means NULL or ''. In any rate, it's impossible to determine exactly without knowing the DDL of your table (are they all NOT NULL columns? Some null columns? What do you mean by empty?) but it's 2 bytes per row to calculate the length of the field offset for the next column. Nothing ... | 43,787 |
<p>I have a Prusa MK2.5 which runs at 12 V, the Prusa MK3 runs at 24 V.</p>
<p>I noticed that on <a href="https://www.prusa3d.com/product/stepper-motors-set/" rel="nofollow noreferrer">Prusa's webpage</a>, they list the stepper motors as being compatible with both the MK2 <em>and</em> the MK3 even though they run at di... | <p>The steppers have two voltages in the specifications: nominal voltage and maximum voltage for the electrical insulation between windings.</p>
<p>The nominal voltage is basically never that high. The motors from Prusa are likely rated at 4-5 V operating voltage: the voltage you apply from the control board is higher,... | <p>Without having the exact model number of the motor to check the data sheet, this can't be answered. Glancing at the link you supplied, I didn't see either a data sheet or a model number I could use to get a data sheet.</p>
<p>Typically stepper motors overheat when they are run at too high of a voltage. However, th... | 2,076 |
<p>I recently changed the printhead on my DeltaMaker from stock to an E3D Lite6, and am struggling to get back to my original quality, reliability, and repeatability. I thought I had gotten the recipe pretty close to dialed in and tried a bigger print last night. It turned out pretty good in most respects except for ... | <p>Since you said you don't have a cooling fan, try lowering the temperature on your print head to something like 205. The strings in the first and second picture also occur more often when the print temperature is too high as well. </p>
<p>The layer time gets really small at that transition, so make sure the print sp... | <p>It looks like the first layers that are making the vertical transition do not have enough to stick to and are curling up. Are you using a cooling fan?</p>
| 412 |
<p>I'm refactoring a 500-lines of C++ code in main() for solving a differential equation. I'd like to encapsulate the big ideas of our solver into smaller functions (i.e. "SolvePotential(...)" instead of 50 lines of numerics code). </p>
<p>Should I code this sequentially with a bunch of functions taking <strong>very ... | <p>Write it sequentially and then refactor if there's something you think you can reuse or would make it clearer.</p>
<p>Also, a SolvePotential class doesn't make a lot of sense since a class should be an Object with the method SolvePotential.</p>
| <p>Since you're using an object-oriented language, you should go for objects, assuming you could <strong>reuse</strong> those in the future.</p>
<p>Just one advice: try to design a good class diagram. What are the entities of you program? I'd see an "equation" class with a derived "differentialEquation" one, and so on... | 41,179 |
<p>I have never "hand-coded" object creation code for SQL Server and foreign key decleration is seemingly different between SQL Server and Postgres. Here is my sql so far:</p>
<pre><code>drop table exams;
drop table question_bank;
drop table anwser_bank;
create table exams
(
exam_id uniqueidentifier primary key,
... | <pre><code>create table question_bank
(
question_id uniqueidentifier primary key,
question_exam_id uniqueidentifier not null,
question_text varchar(1024) not null,
question_point_value decimal,
constraint fk_questionbank_exams foreign key (question_exam_id) references exams (exam_id)
);
</code></pre... | <p>Necromancing.<br />
Actually, doing this correctly is a little bit trickier. </p>
<p>You first need to check if the primary-key exists for the column you want to set your foreign key to reference to. </p>
<p>In this example, a foreign key on table T_ZO_SYS_Language_Forms is created, referencing dbo.T_SYS_Language_... | 7,121 |
<p>Currently I have two Linux servers running MySQL, one sitting on a rack right next to me under a 10 Mbit/s upload pipe (main server) and another some couple of miles away on a 3 Mbit/s upload pipe (mirror).</p>
<p>I want to be able to replicate data on both servers continuously, but have run into several roadblocks... | <p>We at Percona offer free tools to detect discrepancies between master and server, and to get them back in sync by re-applying minimal changes.</p>
<ul>
<li><a href="http://www.percona.com/doc/percona-toolkit/pt-table-checksum.html" rel="nofollow">pt-table-checksum</a></li>
<li><a href="http://www.percona.com/doc/pe... | <p><a href="http://www.goldengate.com/" rel="nofollow noreferrer">GoldenGate</a> is a very good solution, but probably as expensive as the MySQL replicator.</p>
<p>It basically tails the journal, and applies changes based on what's committed. They support bi-directional replication (a hard task), and replication betw... | 2,583 |
<p>I have built an MSI that I would like to deploy, and update frequently. Unfortunately, when you install the MSI, and then try to install a newer version of the same MSI, it fails with a message like "Another version of this product is already installed. Installation of this version cannot continue..." appears. The M... | <p>I have built numerous MSIs with VS 2005 Pro that do this correctly.</p>
<p>Are you sure that the 'Version' property of the <strong>deployment project</strong> has been incremented? This property is independent of the version of the assemblies in the application, and this is the error message you will see if the Ver... | <p>Had the same problem when going from XP to Win7. To solve it I had to set DetectNewerInstalledVersion to False. Also, as mentioned by others, you need to inc the version of the setup project.</p>
<p>Good luck.</p>
| 6,183 |
<p>I got a message saying <code>script xyz.py returned exit code 0</code>. What does this mean?</p>
<p>What do the exit codes in Python mean? How many are there? Which ones are important?</p>
| <p>You're looking for calls to <a href="https://docs.python.org/2/library/sys.html#sys.exit" rel="noreferrer"><code>sys.exit()</code></a> in the script. The argument to that method is returned to the environment as the exit code.</p>
<p>It's fairly likely that the script is never calling the <em>exit</em> method, and t... | <p>To allow exception handlers and other things execute I recommend a clean shutdown with the <a href="https://docs.python.org/3/library/constants.html#exit" rel="nofollow noreferrer"><code>exit(0)</code></a> builtin rather than using <code>sys.exit()</code> which terminates the process abruptly.</p>
| 36,213 |
<p>I've used asp.net profiles (using the AspNetSqlProfileProvider) for holding small bits of information about my users. I started to wonder how it would handle a robust profile for a large number of users. Does anyone have experience using this on a large website with large numbers of simultaneous users? What are the ... | <p>You can also eliminate Windows XP's styling of buttons (and every other version of Windows) by setting the <code>background-color</code> and/or <code>border-color</code> on your buttons.</p>
<p>Try the following styles:</p>
<pre><code>background-color: black;
color: white;
border-color: red green blue yellow;
</co... | <p>Not too much you can do about it, but the good news is that it is fixed in IE8</p>
<p><a href="http://webbugtrack.blogspot.com/2007/08/bug-101-buttons-render-stretched-and.html" rel="nofollow noreferrer">http://webbugtrack.blogspot.com/2007/08/bug-101-buttons-render-stretched-and.html</a></p>
| 18,146 |
<p>Opinions: I want to disallow direct invocation of certain scripts, that have functionality accessible from a menu, via Web at the OS level (Linux). </p>
<p>I was hoping to call a authorize.pl script that checks the session validity, checks user privileges etc. Then it will redirect to the target script. </p>
<p... | <p>You could try with a subquery</p>
<pre>
select group, id, value, date from A where date in
( select MAX(date) as date
from A
group by group )
order by group
</pre>
| <p>As long as the Date column is unique for each group I think something like this might work:</p>
<pre><code>SELECT A.ID, A.Value
FROM A
INNER JOIN (SELECT Group, MAX(Date) As MaxDate FROM A GROUP BY Group) B
ON A.Group = B.Group AND A.Date = B.MaxDate
</code></pre>
| 49,289 |
<p>Take the following generics example</p>
<pre><code>import java.util.List;
import java.util.ArrayList;
public class GenericsTest {
private List<Animal> myList;
public static void main(String args[]) {
new GenericsTest(new ArrayList<Animal>()).add(new Dog());
}
public GenericsTe... | <p>If I understand what you're trying to do then you need to put the generic type at class level:</p>
<pre><code>public class GenericsTest<T extends Animal>
{
private List<T> myList;
public static void main(String args[])
{
new GenericsTest<Dog>(new ArrayList<Dog>());
}
public G... | <p>You may want to make the <strong>whole</strong> class generic rather than only the parameters:</p>
<pre><code>import java.util.List;
import java.util.ArrayList;
public class GenericsTest<T extends Animal> {
private final List<T> myList;
public static void main(final String args[]) {
ne... | 27,652 |
<p>How are paged results commonly implemented in PHP?</p>
<p>I'd like to have a results page with 10 results. Paging forward in the navigation would give me the next and previous sets.</p>
<p>Is there a way this is commonly done? Does anyone have simple advice on getting started?</p>
| <p>You'll need a beginner's understanding of PHP, and probably some understanding of relational databases.</p>
<p>Pagination is often implemented with some simple query parameters.</p>
<pre><code>stackoverflow.com/myResults.php?page=1
</code></pre>
<p>The page increments the query parameter:</p>
<pre><code>stackove... | <p>If database is not so big - I implement pagination on client side. I recommend jquery plugin tablefilter - it gives you not only pagination, but also filtering and sorting. You can easily browse through given recordset. It's very good solution if performance is not very important.
There's page:
<a href="http://ide... | 33,606 |
<p>I defined a Controller to force authentication by using the [Authorize] attribute. When a session times out, the request is still passed down and executed instead of forcing a redirect.</p>
<p>I do use FormsAuthentication to login and logoff users.</p>
<p>Any ideas on how to control that?</p>
<p>Example: </p>
<p... | <p>Again, ASP.NET MVC builds on top of traditional ASP.NET. Yes, there is an "built authentication shizzle"... it's the <em>exact</em> same Membership API that traditional ASP.NET uses.</p>
<p>Meaning... something else is the problem here. Maybe you have sliding sessions turned on... or maybe the timeout is higher tha... | <p>Based on your other <a href="https://stackoverflow.com/questions/329123/forms-in-masterpage-and-views" title="question">question</a>, I would guess you are not getting to this controller at all.</p>
| 42,646 |
<p>Does anyone know where I can find a good tutorial to walk me through how to setup TeamCity CI server? I am new to unit testing and the agile philosophy of development so I could use some help getting my feet wet. I'm working with Asp.NET code using NUnit for my unit tests and would prefer a windows environment for t... | <p>The folks at DimeCasts.net have a nice <a href="http://www.dimecasts.net/Casts/ByTag/Team%20City" rel="noreferrer">TeamCity tutorial</a>. </p>
| <p>I recently wrote a <a href="http://kellytadams.com/blog/2011/1/7/using-teamcity-to-publish-clickonce-packages-to-a-network-sh.html" rel="nofollow">post on publishing winforms ClickOnce deployments with TeamCity</a>. You don't mention exactly what kind of stuff you need to build with your CI environment, so I don't k... | 47,163 |
<p>I have developed an asp.net application and when using the publish tool in Visual Studio 2008, my changes don't get uploaded to the server (ie new css files). I made a thread about this on asp.net and was told to clear my local settings folder in my documents/application data, but because I am on a networked pc at w... | <p>You could always use FTP. I personally never use "Publish", I use <a href="http://www.scootersoftware.com/" rel="nofollow noreferrer">Beyond Compare</a> for all my publishing needs.</p>
| <p>Try the following to rule out permissions errors:</p>
<ol>
<li>Navigate to the server virtual dir using unc paths </li>
<li>Edit a List item key value pair in the published web.config and check whether you are able to save the change</li>
<li>if that was successful try manually deleting all the files then publishin... | 32,703 |
<p>I've created a copy utility in c# (.NET 2.0 Framework) that copies files, directories and recursive sub directories etc. The program has a GUI that shows the current file being copied, the current file number (sequence), the total number of files to be copied and the percentage completed for the copy operations. The... | <p>The FileInfo.CopyTo is basically a wrapper around the Win32 API call "CopyFile" in the kernel32.dll. This method does not support progress callback.</p>
<p>However, the CopyFileEx method does, and you can write your own .NET wrapper around it in a few minutes, like it is described here:
<a href="https://we... | <p>Thanks to @Gasper and @Dennis for pointing out CopyFileEx method.
I have extended dennis answer with abort copy</p>
<pre><code> /// <summary>
/// Type indicates how the copy gets completed.
/// </summary>
internal enum CopyCompletedType
{
Succeeded,
Aborted,
E... | 22,749 |
<p>I'm having trouble getting the right number of elements in the ArrayList <code>alt</code> in the JSP page below. When I view the JSP it shows the size is 1 (<code><%=alt.size()%></code>) when it should be 3; I think I'm adding that method to the array in the generator class, so I don't understand why it's show... | <p>The problem is you have only one Alert instance in your ArrayList, but that single Alert has 3 properties: alert1, alert2, and alert3.</p>
<p>Take a look at the line:</p>
<pre><code>alt.add(new Alert("alert1","alert2","alert3"));
</code></pre>
<p>You only have one add line, and it is not in a loop.</p>
<p>A poss... | <p>The ArrayList contains ONLY one element Alert (the element Alert contains three Strings alerts.</p>
| 31,589 |
<p>I have been searching everywhere for the following functionality in Lisp, and have gotten nowhere:</p>
<ol>
<li><p>find the index of something in a list. example:</p>
<pre><code>(index-of item InThisList)
</code></pre></li>
<li><p>replace something at a specific spot in a list. example:</p>
<pre><code>(replace it... | <p>You can use <code>setf</code> and <code>nth</code> to replace and retrieve values by index.</p>
<pre><code>(let ((myList '(1 2 3 4 5 6)))
(setf (nth 4 myList) 101); <----
myList)
(1 2 3 4 101 6)
</code></pre>
<p>To find by index you can use <a href="http://www.cs.cmu.edu/afs/cs/project/ai-repository/... | <p>I have to agree with Thomas. If you use lists like arrays then that's just going to be slow (and possibly awkward). So you should either use arrays or stick with the functions you've written but move them "up" in a way so that you can easily replace the slow lists with arrays later.</p>
| 6,703 |
<p>I was recently working with a <code>DateTime</code> object, and wrote something like this:</p>
<pre><code>DateTime dt = DateTime.Now;
dt.AddDays(1);
return dt; // still today's date! WTF?
</code></pre>
<p>The intellisense documentation for <code>AddDays()</code> says it adds a day to the date, which it doesn't - i... | <pre><code>private int myVar;
public int MyVar
{
get { return MyVar; }
}
</code></pre>
<p>Blammo. Your app crashes with no stack trace. Happens all the time.</p>
<p>(Notice capital <code>MyVar</code> instead of lowercase <code>myVar</code> in the getter.)</p>
| <p>Some code:</p>
<pre><code> List<int> a = new List<int>();
for (int i = 0; i < 10; i++)
{
a.Add(i);
}
var q1 = (from aa in a
where aa == 2
select aa).Single();
var q2 = (from aa in a
wher... | 29,841 |
<p>Is it possible?
By debug I mean setting breakpoints, inspect values and advance step by step.</p>
| <p>You can do remote debugging of python web apps over TCP/IP with <a href="http://winpdb.org/" rel="nofollow noreferrer">winpdb</a>.</p>
<p>(Link appears down as of June 2019. Try <a href="https://pypi.org/project/winpdb/" rel="nofollow noreferrer">PyPI winpdb</a>) </p>
| <p>As Carl stated, it is as easy as:</p>
<ol>
<li>Installing PyDev in Eclipse</li>
<li>Right Click on your Web2Py project, selecting Debug As > Python Run</li>
<li>Selecting web2py.py as the file to run</li>
</ol>
<p>No other plugins or downloads are needed.</p>
| 40,682 |
<p>How can I make:</p>
<p>DELETE FROM foo WHERE id=1 AND <strong>bar not contains id==1</strong></p>
<p>To elaborate, how can I remove a row with <code>id = 1</code>, from table <code>foo</code>, only if there is not a row in table <code>bar</code> with <code>id = 1</code>.</p>
| <pre><code>DELETE FROM foo WHERE id=1 AND NOT EXISTS (SELECT * FROM bar WHERE id=1)
</code></pre>
<p>I'm assuming you mean that foo and bar are tables, and you want to remove a record from foo if it doesn't exist in bar.</p>
| <p>Use the SQL "Exists" command.</p>
<p><a href="http://www.techonthenet.com/sql/exists.php" rel="nofollow noreferrer">http://www.techonthenet.com/sql/exists.php</a></p>
| 33,075 |
<p>Why can I not see an <strong>option</strong> for copying database objects when I <code>right click > tasks</code> on my database? </p>
| <p>MS Sql Server Express doesn't come with SSIS which is what you will need to import/export objects out of your database.</p>
<p>You can also manually script this process. One way is to use BCP (<a href="http://msdn.microsoft.com/en-us/library/ms162802.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/l... | <p>Have a look at Red Gate <a href="http://www.red-gate.com/products/SQL_Compare/index.htm" rel="nofollow noreferrer">SQL Compare</a> and <a href="http://www.red-gate.com/products/SQL_Data_Compare/index.htm" rel="nofollow noreferrer">SQL Data Compare</a>.</p>
<p>You can download the trial and use them to build a scrip... | 9,668 |
<p>I'm creating an alt-tab replacement for Vista but I have some problems listing all active programs.</p>
<p>I'm using EnumWindows to get a list of Windows, but this list is huge. It contains about 400 items when I only have 10 windows open. It seems to be a hwnd for every single control and a lot of other stuff.</p>... | <p>Raymond Chen answered this a while back<br>
(<a href="https://devblogs.microsoft.com/oldnewthing/20071008-00/?p=24863" rel="nofollow noreferrer">https://devblogs.microsoft.com/oldnewthing/20071008-00/?p=24863</a>):</p>
<blockquote>
<p>It's actually pretty simple although
hardly anything you'd be able to guess
... | <p>This is a function in pascal/delphi, you can easily translate it to C#.</p>
<p>It includes support for Windows 10 applications.</p>
<pre class="lang-pascal prettyprint-override"><code>
EnumWindows(@ListApps, 0);
function ListApps(LHWindow: HWND; lParam: Pointer): Boolean; stdcall;
var
LHDesktop: HWND;
LHPar... | 25,838 |
<p>How do I get:</p>
<pre><code>id Name Value
1 A 4
1 B 8
2 C 9
</code></pre>
<p>to</p>
<pre><code>id Column
1 A:4, B:8
2 C:9
</code></pre>
| <p><strong>No CURSOR, WHILE loop, or User-Defined Function needed</strong>. </p>
<p>Just need to be creative with FOR XML and PATH.</p>
<p>[Note: This solution only works on SQL 2005 and later. Original question didn't specify the version in use.]</p>
<pre><code>CREATE TABLE #YourTable ([ID] INT, [Name] CHAR(1), [V... | <p>Another example without the garbage: ",TYPE).value('(./text())[1]','VARCHAR(MAX)')"</p>
<pre><code>WITH t AS (
SELECT 1 n, 1 g, 1 v
UNION ALL
SELECT 2 n, 1 g, 2 v
UNION ALL
SELECT 3 n, 2 g, 3 v
)
SELECT g
, STUFF (
(
SELECT ', ' + CAST(v AS ... | 34,417 |
<p>What materials which are <a href="http://www.shapeways.com/materials/">commonly used in 3D printing</a>, are food-safe?</p>
<p>Are there any certifications/grading process for such materials, which can help me with my cross-checking and selection?</p>
<hr>
<p>I have been using an <a href="https://en.wikipedia.org... | <p>Food safety is a property of both the process and the material. You can't stick food-safe material in a printer that has previously been used to print something food-dangerous and expect the result to be food safe.</p>
<p>The only way to know if a given material is food-safe is to ask your supplier, but a lot depen... | <p>I have looked at this a lot, both from the standpoint of my own use, and of selling items on Etsy.</p>
<p>As far as I can determine, PLA and ABS are both generally safe. </p>
<p>The FDA lists ABS and PLA as safe plastics for food contact, although some pigments and additives can bring their own problems. ABS is ni... | 114 |
<p>I'm using IIS 6 with EPiserver CMS which requires all requests to go through aspnet_isapi.dll.</p>
<p>I want to gzip all my static files (js, css mainly). Trying to setup compression in IIS didn't work.</p>
<p>Is there a setting in EPiServer that will allow me to achieve this?
Can .net framework compress files au... | <p>You'll need to configure the html extension in the IIS metabase <strong>as a dynamically compressed extension</strong>. You are probably treating it as a static page. If the .js and .css extensions are mapped to aspnet_isapi they are considered as dynamic pages. </p>
<p>The setting in <a href="http://www.microsoft... | <p>What if you wanted to gzip all files (for use in a web service with extensionless URLs)?</p>
| 36,609 |
<p>In Visual Studio website projects (in Visual Studio 2005 or later, not web application projects where there is still a .csproj file) how is the reference information stored, and is it possible to source control it without storing compiled binaries in source control?</p>
<p>If you right-click on a website project an... | <p>If you reference a .dll by file name through the browse tab, there should be a .refresh file created (nested under the dll in BIN). We put those in SVN and it works great (you may have to hand edit them to use relative paths).</p>
<p>References added from the .NET tab are added to web.config</p>
<p>Project referen... | <p>I use copyprojectDll.ps1 powershell.</p>
<p>My folder structure is below</p>
<ul>
<li>ClassLibraries<br>
ThirdParty<br>
Website/Bin<br>
CopyprojectDll.ps1<br>
Website.sln</li>
</ul>
<p>ClassLibraries are code classes for my project, DAL ..
Website project includes only web files, aspx, aspx.cs ..
ThirdParty are r... | 35,314 |
<p>i wonder if it is possible to cascade converters when using wpf databinding.
e.g. something like </p>
<pre><code><SomeControl Visibility="{Binding Path=SomeProperty, Converter={StaticResource firstConverter}, Converter={StaticResource secondConverter}}"/>
</code></pre>
<p>is it possible at all or do i have t... | <p>You may be looking for a solution similar to Josh Smith's "<a href="http://www.codeproject.com/KB/WPF/PipingValueConverters_WPF.aspx" rel="noreferrer">Piping Value Converters</a>".</p>
<p>In his article, he presents the following:</p>
<pre><code><local:ValueConverterGroup x:Key="statusDisplayNameGroup">
&l... | <p>You may be looking for a solution similar to Josh Smith's "<a href="http://www.codeproject.com/KB/WPF/PipingValueConverters_WPF.aspx" rel="noreferrer">Piping Value Converters</a>".</p>
<p>In his article, he presents the following:</p>
<pre><code><local:ValueConverterGroup x:Key="statusDisplayNameGroup">
&l... | 25,960 |
<p>Is it possible to over interface? when designing an system now, I will start from interfaces and progressively write unit tests along with the interfaces until I have a pattern that works well.. I'll move onto writing some concrete classes and set the unit tests up against these..</p>
<p>Now I'm someone who loves i... | <p>Interfaces describe a contract for behavior. If you need to address some set of objects according to a behavioral pattern, interfaces are useful, not so much if you're simply describing the structure of objects. I think you need to have a good reason to use them, such as using a factory that creates behaviorally rel... | <p>ISwissArmyKnife!</p>
<p>Consult this:</p>
<p><a href="http://thedailywtf.com/Articles/Classic-WTF-Implements-ISwissArmyKnife.aspx" rel="nofollow noreferrer">http://thedailywtf.com/Articles/Classic-WTF-Implements-ISwissArmyKnife.aspx</a></p>
| 13,747 |
<p>I'm a PHP developer and now I use <a href="http://en.wikipedia.org/wiki/Notepad_%28software%29" rel="nofollow noreferrer">Notepad++</a> for code editing, but lately I've been searching for an IDE to ease my work.</p>
<p>I've looked into <a href="http://en.wikipedia.org/wiki/Eclipse_%28software%29" rel="nofollow nor... | <p><a href="http://netbeans.org/kb/trails/php.html" rel="nofollow noreferrer">NetBeans</a>. Check out 7.0.1. </p>
<p>It supports FTP/SFTP synchronization, integrates well with Subversion, CVS, Mercurial and even with Git (with plugin). Also, it supports HTML, CSS, JavaScript, popular frameworks and <a href="http://net... | <p>Have you tried NetBeans 6? Zend Studio and NetBeans 6 are the best IDEs with PHP support you'll come across and NetBeans is free.</p>
| 14,169 |
<p>I want to check for data, but ignore it if it's null or empty. Currently the query is as follows...</p>
<pre><code>Select
Coalesce(listing.OfferText, company.OfferText, '') As Offer_Text,
from tbl_directorylisting listing
Inner Join tbl_companymaster company
On listing.compan... | <p>I think this: </p>
<pre><code>SELECT
ISNULL(NULLIF(listing.Offer_Text, ''), company.Offer_Text) AS Offer_Text
FROM ...
</code></pre>
<p>is the most elegant solution.</p>
<p>And to break it down a bit in pseudo code:</p>
<pre><code>// a) NULLIF:
if (listing.Offer_Text == '')
temp := null;
else
temp := list... | <p>This caters for spaces as well.</p>
<pre><code>(len(rtrim(ltrim(isnull(MyField,'')))) !=0
</code></pre>
| 43,313 |
<p>Recently, my Eclipse 3.4 installation started complaining while trying to update installed software.</p>
<p>I normally have Automatic Updates switched on, so this is particularly annoying.</p>
<p>Updates are found, but I am unable to install them because eclipse is unable to satisfy version dependencies.</p>
<p>F... | <p>In this case, the new version of jst, which has been released to the jst update site, relies on a new version of wst.</p>
<p>The update site for wst is not the same as for jst, and hadn't been updated on the 17th.</p>
<p>Writing today, on the 19th, the jst update site now has the correct new version, and the updat... | <p>It seems it is a current <a href="https://glassfishplugins.dev.java.net/issues/show_bug.cgi?id=54" rel="nofollow noreferrer">problem</a>, where the Eclipse p2 update process does not warn the user of missing dependencies and happily tries to install a new server plugin, then fails on restart and leaves the user out ... | 38,749 |
<p>Or should they always be a function when business logic is invloved ?</p>
<p>Example: Order.RequiresPayment </p>
<p>property or function ?
There are business rules as for when it is true or not</p>
<p>IS there a pattern that may determine this?</p>
| <p>When in doubt, consider maintenance of your code as a guideline.</p>
<p>If <code>OrderRequiresPayment</code> is determined very simply (for example, set <code>true</code> on order creation, <code>false</code> when payment is received), a property is fine.</p>
<p>If it's determined by a formula, or if it's updated ... | <p>You can usually decide by whether it makes more sense to think of it as a Business Property or a Business Function. The level of abstraction doesn't change the way you think about things.</p>
| 34,920 |
<p>I am planning on generating a Word document on the webserver dynamically. Is there good way of doing this in c#? I know I could script Word to do this but I would prefer another option.</p>
| <p>I've worked at a company in the past that really wanted generated word documents, in the end they were perfectly satisfied with RTF docs that had a ".doc" extension. Word has no problem recognizing and opening them.</p>
<p>The RTF docs were generated with <a href="http://sourceforge.net/projects/itextdotnet/" rel=... | <p>Here is the component that generates document based on the custom template. The documents are generated from the sharepoint list ... so the data is pulled from the list item into the document on the fly:
<a href="http://store.sharemuch.com/products/generate-word-documents-from-sharepoint-list" rel="nofollow noreferr... | 42,358 |
<p>Is there any <em>easy</em> way to explicitly make an already threaded application utilise a multicore environment? (if avaliable).</p>
<p>The first problem would be how do I determine if my runtime environment supports multi-core applications?</p>
<p>If I then determine that I can use multi core functionality, can... | <p>If your application is already threaded properly, you dont have to do anything. Thread context execution and handling is done for you. </p>
<p>Now when it comes to threading, is your app threaded in a way to utilize the cores? do you have processor intensive tasks split into seperate threads. If not, then you will ... | <p>Without getting into specifics (I'm not sure how much information is public yet), the next version of the .NET framework will be more helpful with doing this. You will likely not want or need to be thinking about managing threads by hand. I'm sure more information will be public about this after PDC (end of October)... | 23,099 |
<p>We implemented a server application available on Windows only. Now we like to port it to Linux, HP-UX and AIX, too. This application provides internal statistics through performance counters into the Windows Performance Monitor.</p>
<p>To be more precise: The application is a data base, and we like to provide infor... | <p>I just came across the following answer on another question:
<a href="https://stackoverflow.com/questions/128796/pretty-urls-for-search-pages#128864">Pretty URLs for search pages</a></p>
<p>Hope that helps!</p>
| <p>I researched this topic briefly and it seems you need an additional piece which is called <em>URL Rewrite (Go Live)</em>.</p>
<p><a href="http://learn.iis.net/page.aspx/466/enabling-pretty-permalinks-in-wordpress/" rel="nofollow noreferrer">Here is an article</a> that walks you through how to create a rewrite rule ... | 13,858 |
<p>I purchased a glass bed to use with my still-in-transit Ender 3. Since the bed came in before the printer, I pulled it out and used a flat edge ruler to see how flat the glass surface is. </p>
<p>It appears the glass is slightly "dished" in the center from one side and "raised" in the center on the other side. I am... | <p>Glass will not change its shape you can watch this interesting video: <a href="https://www.youtube.com/watch?v=0j9fa86jiv0" rel="nofollow noreferrer">YouTube - Fix Your Bowed Glass Build Surface - CR-10 3D Printer </a>.</p>
<p>Or simply change your glass. </p>
| <p>Yes, glass will warp. Think about it this way: the edges cannot be as hot as the centre if you use uniform heating, because they lose heat more quickly.</p>
<p>If the edges are colder, they are also shorter than the hotter centre, which expands more.</p>
<p>If the centre is longer than the edges, it will bend to a... | 989 |
<p>Did you ever have to choose between WISA or LAMP at the beginning of a web project?</p>
<p>While pros and cons are littered around the net, it would be helpful to know about your real experience in coming up w/ criteria, evaluating, deciding, and reflecting upon your decision to go w/ either platform.</p>
| <p>I think the first part is your Application. If you decide to go PHP, you almost automatically end up with LAMP, as WIMP or WISP stacks are quite rare (I think blog.stackoverflow.com runs on WIMP), and with .net you definitely want to go WISA.</p>
<p>So normally, it boils down to .net vs. PHP. (Ignoring Ruby, Python... | <p>I think the team is the biggest issue. WISA isn't universally worse or better than LAMP for any particular job. My expertize is in LAMP. I have very little experience with WISA, so I would never pick it. </p>
<p>It's more along the lines of photography -- if all your lenses were Canon's, why would you buy a Nikon b... | 4,306 |
<p>We are using <a href="https://en.wikipedia.org/wiki/Oracle_Application_Development_Framework#History" rel="nofollow noreferrer">Oracle ADF Faces</a> in a new web project. I am always looking for an unobtrusive user experience with <a href="https://en.wikipedia.org/wiki/Progressive_enhancement" rel="nofollow noreferr... | <p>ADF is a continuation of BC4J, so this is why you are experiencing non-validating HTML again. Instead, try to <a href="http://www.oracle.com/technology/products/jdev/101/collateral/101/adffaces/howto_customcomponents.html" rel="nofollow noreferrer">write your own custom UI components</a>.</p>
<p>Unfortunately, Stac... | <p>You can not influence the ADF output HTML code. And rewitring all the <a href="http://en.wikipedia.org/wiki/JavaServer_Faces" rel="nofollow noreferrer">JSF</a> components is not an option. You can use <a href="http://en.wikipedia.org/wiki/Google_Chrome" rel="nofollow noreferrer">Google Chrome</a> which formats the H... | 25,551 |
<p>(I don't want to hear about how crazy I am to want that! :)</p>
<p>Focus-follows-mouse is also known as point-to-focus, pointer focus, and (in some implementations) sloppy focus. [Add other terms that will make this more searchable!] X-mouse</p>
| <p>I've been coming back to this question periodically for about 10 years and I finally found a simple solution: AutoRaise <a href="https://github.com/sbmpost/AutoRaise" rel="noreferrer">https://github.com/sbmpost/AutoRaise</a></p>
<p>By default it enables focus-follows-mouse AND autoraise. You can delay the autoraise ... | <p>You can't really do it well, because the Mac interface simply isn't designed with focus-follows-mouse (with or without auto-raise) in mind. I doubt that's going to change any time soon, and unless it does, everybody who tries to implement focus-follows-mouse will run into the same hurdles and wind up with an unsati... | 12,375 |
<p>I have seen these two approaches for constant declaration which are to be used in the project.</p>
<ol>
<li><p>Constants in a public module. </p></li>
<li><p>Constants in a NonInheritable(Sealed) class </p></li>
</ol>
<p>Does anybody uses any other approach for the constant declartion ?</p>
<p>Is there any differ... | <p>Put the constant in the class where it's most relevant - e.g. <code>Math.Pi</code>, <code>Int32.MinValue</code> etc.</p>
<p>I've seen various constants which should actually be enums, too - particularly for status codes etc.</p>
<p>I don't think it's wise to create a class (or module) just for constants unless the... | <p>My practice is similar to what Jon states. The vast majority of the enums and constant are obviously tied to a particular class or module and are declared public in there. </p>
<p>The lowest level of my software is called Utility and contains math routines and other functions and method of general utility (rather t... | 46,846 |
<p>I understand how JS is run and I think I understand most of the DOM but I've no idea about animation. Does anybody here know of a good guide that can explain to me how it's done in Javascript?</p>
<p>In addition, should I even consider Javascript for animation? Should I instead be looking to learn flash?</p>
| <p>Avoid flash, its a horrible requirement, uncrawlable by Google, unsopported by a bunch of browsers and systems (eg iPhone) and most importantly: it forces you to reinvent web standards (e.g. scroll bars and whatnot), Javascript on the other hand is easier to maintain and code for in the noscript case.</p>
<p>try <a... | <p>If you aren't concerned with IE support, you could also try experimenting with the canvas element:</p>
<p>MOZILLA DEVELOPER NETWORK <a href="https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Basic_animations" rel="nofollow noreferrer">Basic animations</a></p>
| 3,130 |
<p>What are the differences between a <code>clustered</code> and a <code>non-clustered index</code>?</p>
| <p>Clustered Index</p>
<ul>
<li>Only one per table</li>
<li>Faster to read than non clustered as data is physically stored in index order</li>
</ul>
<p>Non Clustered Index</p>
<ul>
<li>Can be used many times per table</li>
<li>Quicker for insert and update operations than a clustered index</li>
</ul>
<p>Both types ... | <p>// Copied from MSDN, the second point of non-clustered index is not clearly mentioned in the other answers. </p>
<p><strong>Clustered</strong></p>
<ul>
<li>Clustered indexes sort and store the data rows in the table or view
based on their key values. These are the columns included in the
index definition. There c... | 11,709 |
<p>I recently began using <a href="http://www.eclipse.org/birt/phoenix/deploy/" rel="noreferrer">BIRT</a> and have developed a report to use with my <a href="http://developer.mozilla.org/en/XULRunner" rel="noreferrer">xulrunner</a> application. What I haven't yet figured out is how I should deploy the viewer. It seem... | <p>It appears that there is a genReport.bat file in the run-time somewhere that can generate reports from the command line. This appears to be what I need, and <a href="http://digiassn.blogspot.com/2006/07/birt-birt-report-scheduling-without.html" rel="noreferrer">this article</a> describes it.</p>
| <p>(11/2014) I'm going to add:</p>
<ul>
<li><p>download Birt runtime from: <a href="http://www.eclipse.org/downloads/download.php?file=/birt/downloads/drops/R-R1-4_3_0-201306131152/birt-runtime-4_3_0.zip" rel="nofollow">http://www.eclipse.org/downloads/download.php?file=/birt/downloads/drops/R-R1-4_3_0-201306131152/bi... | 20,466 |
<p>For example VK_LEFT, VK_DELETE, VK_ESCAPE, VK_RETURN, etc. How and where are they declared? Are they constants, #defines, or something else? Where do they come from?</p>
<p>If possible, please provide a file name/path where they are declared. Or some other info as specific as possible.</p>
| <p>These are declared using <code>#define</code> in the file <code>winuser.h</code> in the Platform SDK. In my installation of Visual Studio 2008, the full path is</p>
<pre><code>C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\WinUser.h
</code></pre>
| <p>These are macro-defined constants, <a href="http://msdn.microsoft.com/en-us/library/ms646271(VS.85).aspx" rel="nofollow noreferrer">declared in winuser.h</a>. To find where something is declared or defined you can read its documentation (Microsoft includes a section at the end, in Unix man pages it appears in the b... | 30,534 |
<p>I'll preface this by saying I'm a C# programmer who inherited horrible code with no documentation. I have an unmanaged C++ library wrapped with managed code that worked fine in VS2003 with .Net 1.1 Framework. I'm trying to get it upgraded to at least .Net 2.0.</p>
<p>I have the unmanaged C++ library that was comp... | <p>It should work, I expect that you are having issues with your marshalling. It is probably stuff that was declared incorrectly for PInvoking that managed to work in .NET 1.1 but not in later versions.</p>
<p>You don't say what sort of problems you are having at run time, nor do you state how you access your library.... | <p>--Rob Prouse:<br>
The wrapper uses managed C++, no PInvoke. The wrapper is compiled into a DLL that is then used by another application (as you illustrated).</p>
<p>The legacy code produces graphics objects. When I try to get the handle to an image, I get a null exception instead. The debugger doesn't let me get... | 32,503 |
<p>A few weeks back I was using std::ifstream to read in some files and it was failing immediately on open because the file was larger than 4GB. At the time I couldnt find a decent answer as to why it was limited to 32 bit files sizes, so I wrote my own using native OS API.</p>
<p>So, my question then: Is there a way ... | <p>Apparently it depends on how <code>off_t</code> is implemented by the library. </p>
<pre><code>#include <streambuf>
__int64_t temp=std::numeric_limits<std::streamsize>::max();
</code></pre>
<p>gives you what the current max is.</p>
<p><a href="http://stlport.sourceforge.net/" rel="noreferrer">STLport<... | <p>If you can move yourself away from using only standard C++, then you might be interested in <a href="http://www.boost.org/doc/libs/1_40_0/libs/iostreams/doc/faq.html#offsets" rel="nofollow noreferrer">boost::iostreams</a>. </p>
| 37,483 |
<p>I'm currently using a linux server, we run a couple of web sites of it, PHP apps with MySQL, the usual. Since the server is privately owned by some friends and myself (we do have it hosted at a professional datacenter though), from time to time we also use it to host our smallish counter-strike source and call of du... | <p>Before I give any opinion, I'll start by answering your core questions:</p>
<ul>
<li><p>Yes, you can run dedicated game servers on Windows Server Web ed.</p></li>
<li><p>The differences between web and standard:</p>
<ul>
<li>Web only supports 2 gigs of ram. Standard in 64bit mode can support 32gigs (and more?).</l... | <p>SPLA? Isn't that for service providers? My friends and I use the hosted services for ourselves (games, email and web), though of course our web sites are publicly viewable by all; but I think that hardly qualifies as "providing a service"?</p>
<p>Unfortunately, staying with Linux would make it such that I would not... | 47,997 |
<p>I want to draw user interfaces for web and desktop applications.</p>
<p>I need something less print-oriented than omnigraffle. think pixels!</p>
<p>Also, need good building blocks (aka stencils). Form elements, tableviews, etc.</p>
| <p>I very much like <a href="http://www.omnigroup.com/applications/Omnigraffle/" rel="nofollow noreferrer">Omnigraffle</A>, with <A HREF="http://v1.garrettdimon.com/resources/templates-stencils-for-visio-omnigraffle" rel="nofollow noreferrer">stencils</A> for UI design. More UI stencils are <A HREF="http://graffletopia... | <p>Try <a href="http://www.skitch.com/" rel="nofollow noreferrer">Skitch</a>. It seems to be one of the best kept secrets for simple drawing and image manipulation on the Mac. I heard about it recently on TMO Geek Gab podcast.</p>
| 11,435 |
<p>Strange error specific to a particular machine...</p>
<p>I have a app in which a combo box's text value is set to the path of a document (i.e...</p>
<pre><code>cmbAIDFile.Text = clsTonyToolkit.GetSetting("ExportAIDFile",gtypmetadata.gcnnCentral) & ""
</code></pre>
<p>Forget about all the GetSetting procedure ... | <p>You might be looking in the wrong place for the error. When you change the <code>Text</code> property of a <code>ComboBox</code>, the <code>ComboBox</code>'s <code>Change</code> event will fire, if the new text is different from the previous text. The <code>LostFocus</code> and/or <code>Validate</code> events might ... | <p><strong>Use these codes</strong></p>
<pre><code>Private Sub Command1_Click()
On Error Resume Next
'Your combo-box code here
On Error GoTo 0
End Sub
</code></pre>
| 42,169 |
<p>Is it even possible?</p>
<p>Basically, there's a remote repository from which I pull using just:</p>
<pre><code>git pull
</code></pre>
<p>Now, I'd like to preview what this pull would change (a diff) without touching anything on my side. The reason is that thing I'm pulling might not be "good" and I want someone ... | <p>After doing a <code>git fetch</code>, do a <code>git log HEAD..origin/master</code> to show the log entries between your last common commit and the origin's master branch. To show the diffs, use either <code>git log -p HEAD..origin/master</code> to show each patch, or <code>git diff HEAD...origin/master</code> (thre... | <p>What about cloning the repo elsewhere, and doing git log on both the real checkout and the fresh clone to see if you got the same thing. </p>
| 21,743 |
<p>If I'm trying to match a quote-delimited string with a regex, which of the following is "better" (where "better" means both more efficient and less likely to do something unexpected):</p>
<pre><code>/"[^"]+"/ # match quote, then everything that's not a quote, then a quote
</code></pre>
<p>or</p>
<pre><code>/".+?"... | <p>You should use number one, because number two is bad practice. Consider that the developer who comes after you wants to match strings that are followed by an exclamation point. Should he use:</p>
<pre><code>"[^"]*"!
</code></pre>
<p>or:</p>
<pre><code>".*?"!
</code></pre>
<p>The difference appears when you hav... | <p>I prefer the first regex, but it's certainly a matter of taste.</p>
<p>The first one might be more efficient?</p>
<pre><code>Search for double-quote
add double-quote to group
for each char:
if double-quote:
break
add to group
add double-quote to group
</code></pre>
<p>Vs something a bit more compl... | 49,077 |
<p>I'm using Spring's support for JDBC. I'd like to use <a href="http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/jdbc/core/JdbcTemplate.html" rel="noreferrer">JdbcTemplate</a> (or SimpleJdbcTemplate) to execute a query and obtain the result as an instance of ResultSet.</p>
<p>The only way t... | <p>If you want to just perform a query and get the results, why don't you use plain jdbc and grab the resultset? Notice that you don't need spring to do just this.</p>
<pre><code> Connection c = ...
c.prepareCall("select ...").getResultSet();
</code></pre>
<p>Besides, you get an advantage by using an object as... | <p>You can either invoke Jasper inside a JdbcTemplate callback (like a ResultSetExtractor) or use straight JDBC to pass the ResultSet to Jasper. Either way when you call Jasper your connection to the database is still active until your report is finished.</p>
| 26,125 |
<p>I'm not going to be too surprised if I get shot-down for asking a "non programming" question, but maybe somebody knows ...</p>
<p>I was zipping the contents of my subversion sandbox using WinXP's inbuilt "Send to Compressed (zipped) Folder" capability and was surprised to find that the .zip file created did not con... | <p>Send to zipped Folder does not traverse into folders without names before dot (like ".svn"). If you had other folders that begin with dots, those would not be included either. Files without names are not excluded. Hidden attribute does not come into play.</p>
<p>Might be a bug, might be by design. Remember that Win... | <p>A compressed folder doesn't mean that it will be a .ZIP file, only the contents of the folder are compressed and to you it will look like a normal folder</p>
| 5,002 |
<p>I'm trying to understand someone else's Perl code without knowing much Perl myself. I would appreciate your help.</p>
<p>I've encountered a Perl function along these lines:</p>
<pre><code>MyFunction($arg1,$arg2__size,$arg3)
</code></pre>
<p>Is there a meaning to the double-underscore syntax in <code>$arg2</code>,... | <p>There is no specific meaning to the use of a __ inside of a perl variable name. It's likely programmer preference, especially in the case that you've cited in your question. You can see more information about perl variable naming <a href="http://perldoc.perl.org/perlvar.html#Technical-Note-on-the-Syntax-of-Variabl... | <p>You will need to tell the interpreter that "$arg2" is the name of a variable. and not "$arg2__size". For this you will need to use the parenthesis. (This usage is similar to that seen in shell).</p>
<p>This should work
MyFunction($arg1,${arg2}__size,$arg3)</p>
<p>--Binu</p>
| 12,818 |
<p>I am using a microcontroller with a C51 core. I have a fairly timeconsuming and large subroutine that needs to be called every 500ms. An RTOS is not being used. </p>
<p>The way I am doing it right now is that I have an existing Timer interrupt of 10 ms. I set a flag after every 50 interrupts that is checked for bei... | <p>I think you have some conflicting/not-thought-through requirements here. You say that you can't call this code from the timer ISR because it takes too long to run (implying that it is a lower-priority than something else which would be delayed), but then you are being hit by the fact that something else which shoul... | <p>One straightforward solution is to have a timer interrupt that fires off at 500ms...<br>
If you have some flexibility in your hardware design, you can cascade the output of one timer to a second stage counter to get you a long time base. I forget, but I vaguely recall being able to cascade timers on the x51.</p>
| 26,004 |
<p>We have a number of developers located around the world which we need to collaborate with.</p>
<p>Our functionality required is: </p>
<ol>
<li>Some sort of white board, which multiple users can view, and update.</li>
<li>A private wiki.</li>
<li>A ticket system for managing workload.</li>
<li>A source control sys... | <p>I like <a href="http://www.assembla.com" rel="noreferrer">Assembla</a>, among others it offers:<br>
- SVN<br>
- Trac<br>
- MessageBoard<br>
- Wiki<br>
and some more features. Also you get 200MB free space for every project...</p>
| <h3><a href="https://github.com/" rel="nofollow">GitHub</a></h3>
<p>The free plan is for open source but it can be used for private projects too. Includes:</p>
<ul>
<li>Wiki</li>
<li>Issue tracker</li>
<li>Source control</li>
</ul>
| 25,022 |
<p>In our desktop application, we have implemented a simple search engine using an <a href="http://en.wikipedia.org/wiki/Inverted_index" rel="nofollow noreferrer">inverted index</a>.</p>
<p>Unfortunately, some of our users' datasets can get very large, e.g. taking up ~1GB of memory before the inverted index has been c... | <p>If it's going to be 1GB... put it on disk. Use something like Berkeley DB. It will still be very fast.</p>
<p>Here is a project that provides a .net interface to it:</p>
<p><a href="http://sourceforge.net/projects/libdb-dotnet" rel="nofollow noreferrer">http://sourceforge.net/projects/libdb-dotnet</a></p>
| <p>Is the index only added to or do you remove keys from it as well?</p>
| 27,405 |
<p>I am trying to gain a better understanding of tcp/ip sockets in c#, as i want to challenge myself to see if i can create a working MMO infrastructure (game world, map, players, etc) purely for educational purposes as i have no intention of being another one of those "OMGZ iz gonna make my r0x0r MMORPG that will be b... | <p>If you are doing socket level programming, then regardless of how many ports you open for each message type, you still need to have a header of some sort. Even if it is just the length of the rest of the message. Having said that it is easy to add a simple header and tail structure to a message. I would think it is ... | <p>Yeah i think you're right about the single connection, and of course the client wouldnt be sending any actual data to the server, more like just simple commands like 'move forward', 'turn left', etc. and the server would move the character on the map and send the new co-ordinates back to the client. </p>
| 36,156 |
<p>I have a Serializable object which is supposed to hold a java.awt.Image as its member. How should I go about serializing it?
<em>(Edited from a not so clear first version, sorry.)</em></p>
| <p>ImageIcon implements Serializable and it can be used to wrap an Image class</p>
<p><a href="http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/ImageIcon.html" rel="noreferrer">http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/ImageIcon.html</a></p>
| <p>None that I know of. I believe you need to write your own serializer for it to basically save out the width, height and pixel values... Or write it out to the stream as a PNG or something</p>
| 16,937 |
<p>My stored procedure has an output parameter:</p>
<pre><code>@ID INT OUT
</code></pre>
<p>How can I retrieve this using ado.net?</p>
<pre><code>using (SqlConnection conn = new SqlConnection(...))
{
SqlCommand cmd = new SqlCommand("sproc", conn);
cmd.CommandType = CommandType.StoredProcedure;
// add pa... | <p>The other response shows this, but essentially you just need to create a <code>SqlParameter</code>, set the <code>Direction</code> to <code>Output</code>, and add it to the <code>SqlCommand</code>'s <code>Parameters</code> collection. Then execute the stored procedure and get the value of the parameter.</p>
<p>Usi... | <p>That looks more explicit for me:</p>
<blockquote>
<p>int? id = outputIdParam.Value is DbNull ? default(int?) : outputIdParam.Value;</p>
</blockquote>
| 37,060 |
<p>Working on a little side project web app...</p>
<p>I'd like to have it set up so that, when users send email to a certain account, I can kick off a PHP script that reads the email, pulls out some key info, and writes it to a database.</p>
<p>What's the best way to do this? A cron job that checks for new email?</p>... | <p>Procmail is how I do it. Here's an example where I actually process the text inside the email to archive it back to a MySQL database. </p>
<pre><code>:0:
* ^(From).*test@example.com
{
:0 c
| php /var/www/app/process_email.php
}
</code></pre>
| <p>The Cronjob is the common solution to such a task. <a href="http://php.net/manual/en/function.imap-getmailboxes.php" rel="nofollow noreferrer">Checking for new Mails with PHP</a> is no Problem. If you run a qmail-server (maybe other servers can do this too?) you can <a href="http://www.faqts.com/knowledge_base/view.... | 5,351 |
<p>Can MySql 5.0 views use tables that are located on another server? What is the syntax for creating such a view?</p>
| <p>Federated Tables:
<a href="http://dev.mysql.com/doc/refman/5.0/en/federated-storage-engine.html" rel="noreferrer">http://dev.mysql.com/doc/refman/5.0/en/federated-storage-engine.html</a></p>
<p>This allows a table to be remotely accessed as if the remote table was a local table. It has its limitations but seems to ... | <p>Yes, you can create objects in one database that reference another database and even another host. The syntax to do so works something like this:</p>
<pre><code>USE localhost.myDB;
SELECT * FROM host2.db.tableName;
</code></pre>
| 21,502 |
<p>I have a directory to which a process uploads some <code>.pdf</code> files. This process is out of my control.</p>
<p>I need to make those files available through the website using Tomcat.</p>
<p>I have a directory <code>/var/lib/tomcat5/webapps/test1</code> available to the web and I can see the files in it with ... | <p>There are a few problems with the solution of creating a <code>META-INF/context.xml</code> that contains <code><Context path="/myapp" allowLinking="true"></code></p>
<p>The biggest issue is that if a <code>conf/context.xml</code> exists, the <code>allowLinking</code> in the <code><Context></code> there ... | <p>Adding following line into conf/context.xml enables softlinks for me on apache tomcat 8.5+</p>
<p><<strong>Resources allowLinking="true" cachingAllowed="true" cacheMaxSize="100000"</strong>></p>
| 40,672 |
<p>I have a system which sits on a web server and generates files on the fly in response to HTTP requests. This is currently implemented as an HTTPHandler.</p>
<p>Once the files are generated, they don't change very often, so I'd like to implement a cache.</p>
<p>Ideally, I'd like the web server to look at the cache ... | <p>It's actually really simple, just point your 404 error page in IIS to your HTTPHandler.</p>
<p>Request.RawUrl will look like:</p>
<pre><code>http://yourdomain.com/yourhandler.ashx;originally/requested/url
</code></pre>
| <p>How about redirecting to your HttpHandler using the customError configuration.</p>
<pre><code><customErrors mode="On">
<error statusCode="404" redirect="FileGeneratorHandler.ashx" />
</customErrors>
</code></pre>
<p>The only issue would be whether the referring page is available to the handler... | 35,787 |
<p>Has anyone got this working in a web application? </p>
<p>No matter what I do it seems that my appSettings section (redirected from web.config using appSettings file=".\Site\site.config") does not get reloaded. </p>
<p>Am I doomed to the case of having to just restart the application? I was hoping this method woul... | <p>Make sure you are passing the correct <a href="http://en.wikipedia.org/wiki/Case_sensitivity" rel="noreferrer">case sensitive</a> value to RefreshSection, i.e. </p>
<pre><code>ConfigurationManager.RefreshSection("appSettings");
</code></pre>
| <p>The App.Config settings are cached in memory when the application starts. For this reason, I don't think you'll be able to change those settings without restarting your application. One alternative that should be pretty straight forward would be to create a separate, simple XML configuration file, and handle loading... | 21,612 |
<p>How do I create a windows application that does the following:</p>
<ul>
<li>it's a regular GUI app when invoked with no command line arguments</li>
<li>specifying the optional "--help" command line argument causes the app to write usage text to stdout then terminate</li>
<li>it must be a single executable. No chea... | <p>Microsoft designed console and GUI apps to be mutually exclusive.
This bit of short-sightedness means that there is no perfect solution.
The most popular approach is to have two executables (eg. cscript / wscript,
java / javaw, devenv.com / devenv.exe etc) however you've indicated that you consider this "cheating".<... | <p>I know my answer is coming in late, but I think the preferred technique for the situation here is the ".com" and ".exe" method. </p>
<p>This may be considered "cheating" by your definition of two executables, but it requires very little change on the programmers part and can be done one and forgot about. Also this ... | 7,814 |
<p>So, up until today, when I tried to edit a read only file in VS2008, a dialog popped up giving me three options:</p>
<ul>
<li>Edit in memory</li>
<li>Make writable</li>
<li>Save a copy</li>
</ul>
<p>There was also a checkbox which read "Never allow in memory edits".</p>
<p>Suddenly, it has stopped offering these ... | <p>In case anyone is interested, resetting the following registry entry to 0 will restore the previous behaviour: </p>
<pre><code>HKCU\Sofware\Microsoft\Visual Studio\9.0\Source Control\UncontrolledInMemoryEditDialogSuppressed
</code></pre>
| <p>Actually, the most logical thing to do is this: </p>
<ol>
<li>If A file is not intended to be edited, mark it read only </li>
<li>If A file <strong>is</strong> intended to be edited, mark it writable!</li>
</ol>
<p>This is in part the whole <em>point</em> of the read only attribute. </p>
<p>If you think I am some... | 38,882 |
<p>I have seen these being used every which way, and have been accused of using them the wrong way (though in that case, I was using them that way to demonstrate a <a href="http://blog.gadodia.net/extension-methods-in-vbnet-and-c/" rel="noreferrer">point</a>).</p>
<p>So, what do you think are the best practices for em... | <p>The upcoming release of the Framework Design Guidelines, 2nd Edition will have some guidance for implementing extension methods, but in general:</p>
<p>You should only define extension methods "where they make semantic sense" and are providing helper functionality relevant to every implementation.</p>
<p>You also ... | <p>When I first found out about Extensions I really overused and abused them.</p>
<p>For the most part I have started to get away from using any Extension Methods for a number of reasons.</p>
<p>Some of the reasons I stopped using them are noted in Scott's blog link above, such as "Think twice before extending types ... | 2,531 |
<p><strong>Update:</strong> Since development machine has moved to Vista, i now automatically test as a standard user. And with XP being phased out, this question isn't so relavent anymore.</p>
<hr>
<p>Since the Windows 2000 logo requirements, Microsoft has been requiring that applications run as standard user. Like ... | <p>If you want to sell your application to businesses then yes, you <em>must</em> test your application running as a standard user. If your application can't run without administrative privelleges, that's going to doom any sale in to a business. </p>
<p>Even in the home market, plenty of people can and do use limited... | <p>Anyone else find it funny that Windows developers think its normal to run as Admin (apparently), but Linux developers pretty much never run as root?</p>
| 33,292 |
<p>I'm adding an existing site to SVN.</p>
<p>The files already exist on the webserver, and now identical copies (- configuration files) exist in the repository.</p>
<p>I want to convert the webserver directory into an SVN working copy, but when I run:</p>
<pre><code>svn checkout http://path.to/svn/repo/httpdocs .
<... | <p>Try the <code>--force</code> option. <code>svn help checkout</code> gives the details.</p>
| <p>Pull from the repository to a new directory, then rename the old one to <code>old_crufty</code>, and the new one to <code>my_real_webserver_directory</code>, and you're good to go.</p>
<p>If your intention is that every single file is in SVN, then this is a good way to test your theory. If your intention is that so... | 40,276 |
<p>I have a Tevo Tornado Gold 24 V. I want to use this LJ12 A3-4-Z/BX Inductive NPN NO 4 mm with 6-36 V operation current as a Z probe. I do not want to fry my machine by putting in 24 V into the sensor input.</p>
<p>What do I have is a 12 V, single channel optocoupler isolation module.</p>
<... | <p><strong>You can safely use the module with 24V.</strong></p>
<p>The input side shows a red LED, optocoupler and 1k resistor in series. The LED and optocoupler probably have a voltage drop in the neighbourhood of 3.1-3.5 V put together, so for a 12 V input you will get a current of approximately 9 mA-... | <h2>Not using a 12 V rated module <em>"on its own"</em>.</h2>
<p>Using a 12 V/5 V optocoupler to try to connect 24 V to the 5 V circuit is running the optocoupler outside of its rating, meaning you will destroy it, either immediately or after a short time.</p>
<h2>A properly rated one</h2>
<p>To shield the 5 ... | 1,435 |
<p>I'm fairly new to the STL, so I was wondering whether there are any dynamically sortable containers? At the moment my current thinking is to use a vector in conjunction with the various sort algorithms, but I'm not sure whether there's a more appropriate selection given the (presumably) linear complexity of inserti... | <p>You'll want to look at std::map</p>
<pre><code>std::map<keyType, valueType>
</code></pre>
<p>The map is sorted based on the < operator provided for keyType.</p>
<p>Or </p>
<pre><code>std::set<valueType>
</code></pre>
<p>Also sorted on the < operator of the template argument, but does not allow... | <p>STL maps and sets are both sorted containers.</p>
<p>I second Doug T's book recommendation - the Josuttis STL book is the best I've ever seen as both a learning and reference book.</p>
<p><a href="https://rads.stackoverflow.com/amzn/click/com/0201749629" rel="nofollow noreferrer" rel="nofollow noreferrer">Effectiv... | 9,298 |
<pre><code>public class Item
{
private int _rowID;
private Guid _itemGUID;
public Item() { }
public int Rid
{
get
{
return _rowID;
}
set { }
}
public Guid IetmGuid
{
get
... | <p>Are you putting a constraint on the generic type V? You'll need to tell the runtime that V can be any type that is a subtype of your <code>Item</code> type.</p>
<pre><code>public class MyGenericClass<V>
where V : Item //This is a constraint that requires type V to be an Item (or subtype)
{
public void D... | <pre><code>foreach( object element in myList ) {
Item itm = element as Item;
if ( null == itm ) { continue; }
Guid test = itm.ItemGuid;
}
</code></pre>
| 36,054 |
<p>How would I go about implementing dynamic/docking splitter panes in a vb.net app similar to visual studio?</p>
| <p>Check out the following demo at ZettaCube, their WebDock component seems to have functionalities close to VS.NET, especially docking and auto-hide.</p>
<p><a href="http://www.zettacube.com/" rel="nofollow noreferrer">http://www.zettacube.com/</a></p>
| <p>Not easily is the short answer. </p>
<p>A high level idea would be to define some regions using divs or a table and using your js framework of choice make these elements resizeable. that gets you the splitter aspect.</p>
<p>The docking will have to use absoluting positioned elements that you can drag and drop a... | 26,250 |
<p>In particular, I have to extract all the messages and attachments from Lotus Notes files in the fastest and most reliable way. Another point that may be relevant is that I need to do this from a secondary thread.</p>
<p><strong>Edit</strong></p>
<p>Thanks for the answers - both of which are good. I should provide ... | <p>I really do hate that NotesSession COM object.</p>
<p>You cannot use it in another thread than the thread it was initialized.
Threads in .NET are fibers, the real underlying thread may change at any time.</p>
<p>So I suggest using it this way, in a <em>using</em> block :</p>
<pre><code>Imports Domino
Imports Syst... | <p>I would personally do this native in Notes in either LotusScript or Java. You can do a scheduled agent in Notes much easier than a service in C#.</p>
| 6,693 |
<p>I'm looking at improving the performance of some SQL, currently CTEs are being used and referenced multiple times in the script. Would I get improvements using a table variable instead? (Can't use a temporary table as the code is within functions).</p>
| <p>You'll really have to performance test - There is no Yes/No answer. As per Andy Living's post above links to, a CTE is just shorthand for a query or subquery. </p>
<p>If you are calling it twice or more in the same function, you might get better performance if you fill a table variable and then join to/select from ... | <p><strong>Advantages of CTE</strong></p>
<p>CTE can be termed as 'Temporary View' used as a good alternative for a View in some cases.
The main advantage over a view is usage of memory. As CTE's scope is limited only to its batch, the memory allocated for it is flushed as soon as its batch is crossed. But once a view... | 7,777 |
<p>Here is what I have:</p>
<pre><code> context "Create ingredient from string" do
context "1 cups butter" do
setup do
@ingredient = Ingredient.create(:ingredient_string => "1 cups butter")
end
should "return unit" do
assert_equal @ingredient.unit, 'cups'... | <p>Here's a solution to your specific problem. The idea is to create a class method (like Shoulda's context, setup and should).</p>
<p>Encapsulate the repetition in a class method accepting all varying parts as arguments like this:</p>
<pre><code>def self.should_get_unit_amount_and_name_from_string(unit, amount, name... | <p>Personally for this test, I wouldn't use Shoulda.
You can easily remove duplication by using dynamic method creation as follows:</p>
<pre><code>class DefineMethodTest < Test::Unit::TestCase
[{:string => '1 cups butter', :unit => 'cups', :amount => 1.0, :name => 'butter'},{:string => '1 (18.25 ... | 13,835 |
<p>I'm writing Add-inn Application A in VB.Net and DLL B in C language.
Application A pass callback method to dll B.
When certain event occur the dll invoke the callback from A.
Whole works fine on my PC but when I move it to Notebook I get an error:</p>
<p><em>Run-Time Check Failure #0 - The value of ESP was not pro... | <p>If the calling convention is <code>cdecl</code>, then you need to declare your delegate like this:</p>
<pre><code><UnmanagedFunctionPointer(CallingConvention.Cdecl)>
Public Delegate Sub P_Fun()
</code></pre>
<p>You can only do this in .NET 2.0 and after, as the attribute was not introduced before then (and t... | <p>Do the two computers have different pointer sizes perhaps? Maybe one is a 64 bit machine and the other only 32?</p>
<pre><code>typedef void (__cdecl * OFFICE_PTR)();
void TAPIClient::tapiCallBack(
DWORD hDevice,
DWORD dwMessage,
DWORD dwInstance,
...){
...
OFFICE_PTR vbFunc =(OFFICE_PTR)dwInstance;
... | 49,864 |
<p>Basically I'm trying to change the <code>Canvas.Left</code> property of an Ellipse Silverlight control in C#. Here is how I'm accessing the control:</p>
<pre><code>Ellipse c1 = this.FindName("Circle1") as Ellipse;
</code></pre>
<p>How would I then set the <code>Canvas.Left</code> property?</p>
<p>Thanks,</p>
<p... | <p>The answer lies in Silverlights use of Dependancy Properties</p>
<p>c1.SetValue(Canvas.LeftProperty, value);</p>
| <p>something like this...</p>
<pre><code>double left=50;
c1.SetValue(Canvas.LeftProperty, left);
</code></pre>
| 32,164 |
<p>Trying to update some gems on a Windows machine and I continually get this error output for gems that do not have pre-compiled binaries:</p>
<p>Provided configuration options:</p>
<blockquote>
<pre><code> --with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
... | <p>There's a <a href="http://wiki.github.com/oneclick/rubyinstaller/development-kit" rel="nofollow noreferrer">DevKit</a> that could well be what you're after.</p>
| <p>In general, in my experience, code designed for a unix system can be very hard to make work on MinGW. For a quick port, use CygWin. Or do a full port of the software to Windows host, including using native windows shell and OS API -- which is pretty darn expensive in terms of time, but it pays of if you plan to sup... | 20,312 |
<p>We are writing a search application that saves the search criteria to session state and executes the search inside of an asp.net updatepanel. Sometimes when we execute multiple searches successively the 2nd or 3rd search will sometimes return results from the first set of search criteria. </p>
<p>Example: our fir... | <p>Just another thought, I've always run into problems with updatepanel and prefer to write my atlas ajax requests through the library directly, using PageMethods. You have more control over what you send and receive. UpdatePanel sends the entire page, and receives the entire page control heirarchy, then it parses out ... | <p>If you use generic handlers .ashx, just derive from IRequiresSessionState interface</p>
<pre><code>public class ActionRequest : IHttpHandler, IRequiresSessionState
{
}
</code></pre>
| 15,559 |
<p>How do I trigger a delay, let's say I want to call a method (once) in 3 seconds from now, and how do I cancel that call if I need to?</p>
| <p>You can also use <code>-[NSObject performSelector:awithObject:afterDelay:]</code>, and <code>+[NSObject cancelPreviousPerformRequestsWithTarget:selector:object]</code>.</p>
| <p>in your header..</p>
<pre><code>NSTimer *timer;
</code></pre>
<p>when you want to setup..</p>
<pre><code>timer = [NSTimer scheduledTimerWithTimeInterval:3.0 target:self selector:@selector(yourMethod:) userInfo:nil repeats:NO];
</code></pre>
<p>when you want to cancel..</p>
<pre><code>[timer invalidate];
</code>... | 43,762 |
<p>We are team of few Delphi developers who have been using VSS since years (I know it's a pity), but we don't use any of the advanced features of VCS, so it was working fine in many cases (but some times it was driving me crazy :( ).</p>
<p>The good thing that we have with VSS that we use third-party plug-ins to int... | <p>Just use <a href="http://subversion.tigris.org/" rel="nofollow noreferrer">SVN</a> and an excellent <a href="http://tortoisesvn.tigris.org/" rel="nofollow noreferrer">TortoiseSVN</a> client which integrates with the Windows Explorer.</p>
<p>P.S. Found this question: <a href="https://stackoverflow.com/questions/6395... | <p>Our Delphi team recently (last year ) upgraded from VSS to <a href="http://www.perforce.com" rel="nofollow noreferrer">Perforce</a> which is an absolute joy to work with. It is expensive but is well worth it. It makes source code control one of the tools of your trade rather than a chore or a hinderance. It has g... | 27,827 |
<p>What is the correct way to convert ASP.NET SOAP-based web services to JSON-based responses?
...And then call these from jQuery?</p>
<p>What are "best practices" when integrating jQuery based AJAX and ASP.NET?
Articles? Books?</p>
| <p>JSON conversion to .NET classes can be done with <strong>System.Runtime.Serialization</strong> and <strong>System.Runtime.Serialization.JSON</strong>. I suspect you're more interested in setting up function calls from client to server. I think it is worth trying <a href="http://asp.net/AJAX/Documentation/Live/tutori... | <p>I've used ASP.Net Ajax for a while, but without ever worrying about JSON or XML communication. Instead, I've used Web services to directly return content that you can set using innerHTML.</p>
<p>This is very easy to implement. Just create a web service (ASMX) file, and declare your methods as WebMethods (set the We... | 35,799 |
<p>i would like to release a snapshot project 'foo-1.0-SNAPSHOT' using the maven release plugin. The project depends on a 3rd party module 'bar-1.0-SNAPSHOT' which is not released yet.
I use the option 'allowTimestampedSnapshots' in my project's pom.xml to allow timestamped snapshots but i assume that the 3rd party mod... | <p>Problem is with the <code>allowTimestampedSnapshots</code> parameter name, it's in the documentation but the plugin's source uses a different parameter name in expression - <code>ignoreSnapshots</code>.</p>
<p>So just use <code>-DignoreSnapshots=true</code> and the prepare goal of the release plugin will ignore sna... | <p>Just install the jar with a pom you own. I generally change the group and artifact id to make it clear that this is not the official version, but that's generally the best work around for your problem.</p>
| 30,512 |
<p>Context: I have absolutely no knowledge of 3D printing other than you need a computer, a printer, some software, and a design. That is literally the extent of my knowledge on 3D printing.</p>
<p>However, I have an idea of something I'd like to have 3D printed. While the idea has a fairly reasonably defined shape in... | <p><s>There is a <a href="https://3dprinting.meta.stackexchange.com/questions/138/what-is-our-scope">new question on Meta</a> that should help define what is okay on this site.
</s></p>
<p>However, your question is important to address here.</p>
<p>Ultimately, you shouldn't be afraid to go ahead and ask the question.... | <p>I think your situation fits for many new users on this site, and saying that "easy" or "semi-defined" questions are discouraged would probably turn you - and many others - away from the site.</p>
<p>Rather, I believe it is the community's job to help you find a proper scope for your question. As long as you follow ... | 27 |
<p>I have a web application that's branded according to the user that's currently logged in. I'd like to change the favicon of the page to be the logo of the private label, but I'm unable to find any code or any examples of how to do this. Has anybody successfully done this before?</p>
<p>I'm picturing having a dozen ... | <p>Why not?</p>
<pre><code>var link = document.querySelector("link[rel~='icon']");
if (!link) {
link = document.createElement('link');
link.rel = 'icon';
document.getElementsByTagName('head')[0].appendChild(link);
}
link.href = 'https://stackoverflow.com/favicon.ico';
</code></pre>
| <p>Testing the proposed solutions on 2021 on Chrome, I found that some times the browser cache the favicon and do not show the change, even if the link was changed</p>
<p>This code worked (similar to previous proposal but adds a random parameter to avoid caching)</p>
<pre><code>let oldFavicon = document.getElementById(... | 32,617 |
<p>I'm obviously not talking about a full solution, but just a good starting point for common applications for software architects. It could be for a CMS, e-commerce storefront, address book, etc. A UML diagram is not essential, but a table schema with data types in the least. Thanks!</p>
| <p>Check out the <a href="http://databaseanswers.org/data_models/" rel="noreferrer">Library of Free Data Models</a> from DatabaseAnswers.org -- might be a good starting point. I can't vouch for the quality, but there is a lot here...</p>
| <p>Open source?</p>
<p><a href="https://sourceforge.net/projects/dbuml#item3rd-1" rel="nofollow noreferrer">DB-UML might work for you</a>.</p>
<p>EDIT:</p>
<p>Oh! The <a href="http://dev.mysql.com/workbench/" rel="nofollow noreferrer">MySQL Workbench</a> is good. </p>
| 8,257 |
<p>I currently have a couple of SVN repositories hosted at Unfuddle and I'd like to have a local copy of the repositories as a backup. Ideally, it would be a "live" backup so my local repository would "ping" the remote repository, and if any changes were detected, the changes would be applied to my local repository.</p... | <p>Try <a href="http://svn.collab.net/repos/svn/trunk/notes/svnsync.txt" rel="nofollow noreferrer"><code>svnsync</code></a>, which creates a full mirror of the repository. <code>svnsync sync</code> will download only the new revisions. There's also a <code>svn-mirror</code>, which does the same thing.</p>
<p>Git's <a ... | <p>I would just make a Scheduled Task that runs a PowerShell script/BAT file to execute a svn update for each of your repositories.</p>
| 29,545 |
<p>I have G729 encoded audio files. I need to programmatically convert them to WAV PCM (16bit 8kHz mono) in the flow of a tool that is doing other thing too. I have an executable that will do that for me. But spawning that external process every time I convert is too heavy on resources. Especially if I need many of the... | <p>Follow this link : <a href="http://www.voiceage.com/openinit_g729.php" rel="nofollow noreferrer">The VoiceAge Open G.729 Implementation</a>. They also provide g729 decoder and encoder written in C.</p>
| <p>According to Wikipedia, G.729 includes several patents and is licensed by <a href="http://www.spiro.com" rel="nofollow noreferrer">Sipra</a>, so you probably won't have much luck finding an appropriate lobrary. Unless you're decoding a large number of very small files, the cost of spawning a new process shouldn't b... | 26,175 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.