instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>I have Visual Studio 2005 Professional ENU installed and want to create GUIDs using its Create GUIDs utility. However, I cannot find it under the Tools menu. What should I do to get this utility? Thanks</p>
| <p><visual studio install>\Common7\Tools\guidgen.exe</p>
| <pre><code>9a005ff3-5dee-4667-b5b9-7663fee2b0f9
db031ebf-7ffa-4604-a6b6-7d60a38c60ca
96f1854c-3654-46a7-8f57-20eb23f62375
f43a4642-db72-4ed5-a9e7-32fc2c53d1f1
6fa5c074-d68c-4871-b26f-1e0b51374865
17cf6675-fce6-42ce-8501-f19dadbe0c6d
65c681ad-701e-4bc6-a373-2351d9fc1910
3eab6e3d-4040-4beb-9c79-57a0bd7c84c9
3aae1801-c595... | 17,479 |
<p>We are trying to implement a REST API for an application we have now. We want to expose read/write capabilities for various resources using the REST API. How do we implement the "form" part of this? I get how to expose "read" of our data by creating RESTful URLs that essentially function as method calls and return t... | <p>There are many different alternatives you can use. A good solution is provided at the <a href="http://microformats.org/wiki/rest/urls" rel="nofollow noreferrer">microformats wiki</a> and has also been referenced by the RESTful JSON crew. As close as you can get to a standard, really.</p>
<pre><code> Operate on a Re... | <p>The load should just be a normal GET request, and the saving of new data should be a POST to the URL which currently has the data...</p>
<p>For example, load the current data from <a href="http://www.example.com/record/matt-s-example" rel="nofollow noreferrer">http://www.example.com/record/matt-s-example</a> and th... | 6,804 |
<p>Why does everyone tell me writing code like this is a bad practice?</p>
<pre><code>if (foo)
Bar();
//or
for(int i = 0 i < count; i++)
Bar(i);
</code></pre>
<p>My biggest argument for omitting the curly braces is that it can sometimes be twice as many lines with them. For example, here is some code to ... | <p>Actually, the only time that's ever really bit me was when I was debugging, and commented out bar():</p>
<pre><code>if(foo)
// bar();
doSomethingElse();
</code></pre>
<p>Other than that, I tend to use:</p>
<pre><code>if(foo) bar();
</code></pre>
<p>Which takes care of the above case.</p>
<p><strong>EDIT</stro... | <p>AFAIR curly braces are always a scope, so for that it is good to use them everytime.</p>
<p>Without the braces:</p>
<pre><code>if(DoSomething)
MyClass myClass = new MyClass();
myClass.DoAnythingElse();
</code></pre>
<p>This will compile, but lead to null references easily. (C# compiler does not compile this,... | 46,930 |
<p>Navision is also known as Microsoft Dynamics NAV.</p>
| <p>Navision's application logic is written using a proprietary language called C/AL, which is loosely based on Pascal. It currently offers both a native database option as well as MS SQL Server.</p>
<p>The next version (NAV 2009) will use .NET assemblies served via IIS. C/AL logic will be translated to C# code and d... | <p>NAV 2009 is indeed using generated .Net assemblies, but it is WCF based. It is not required to use IIS. NAV 2009 does not support interfaces into their server code apart from the (web) services.</p>
<p>NAV 2009 includes both the new Role-Tailored Client, which uses the Service Tier and the old Classic Client, which... | 8,708 |
<p>Imagine you are implementing the user story containing various new features and adding complexity to the code base. The existing code is quite well covered and you have just decided upon interfaces. You are starting to implement the functionality starting with tests. </p>
<p>Now you have fairly complex test cases b... | <p>Do not decide on <em>all</em> interfaces beforehand. Develop incrementally in a typical TDD rhythm: write a test; make the test pass; refactor. That should keep everything in good shape, the bar will always be green and you can check code in without worrying that you will break the build.</p>
<p>It requires a diffe... | <p>What about skipping those tests that you know won't pass because the functionality is currently missing?</p>
<p>Make it obvious that you are skipping the tests too! Really make it scream "like a stuck pig", as they say in Oz! (-:</p>
<p>As you add functionality, enable the associated tests and keep "your bar green... | 18,408 |
<p>My application is a viewer for a custom format, a zip file with a well defined XML manifest and resources, such as images and movies. I use zlib to open up the zip file in memory and then proceed to display said resources. </p>
<p>One problem I've ran into is that I'm unable to properly display videos, apparently b... | <p>The problem your having is that m4v and m4p dont have a mime types registered with Launch Services (probably because the mime type for m4v and m4p is not standard). In any event, what you should probably do is handle edge cases like this and then check for nil when the function returns (in case the extension is both... | <p>Suggest that people change the return to [mimeType autorelease]; - some of us still use the ancient ways!</p>
<p>And thanks! This was a big help.</p>
| 38,544 |
<p>I've got some experience with <a href="http://en.wikipedia.org/wiki/Bash_%28Unix_shell%29" rel="noreferrer">Bash</a>, which I don't mind, but now that I'm doing a lot of Windows development I'm needing to do basic stuff/write basic scripts using
the Windows command-line language. For some reason said language reall... | <p>Python is well suited for these tasks, and I would guess much easier to develop in and debug than Windows batch files.</p>
<p>The question is, I think, how easy and painless it is to ensure that all the computers that you have to run these scripts on, have Python installed.</p>
| <p>As much as I love python, I don't think it a good choice to replace basic windows batch scripts. </p>
<p>I can't see see someone having to import modules like sys, os or getopt to do basic things you can do with shell like call a program, check environment variable or an argument.</p>
<p>Also, in my experience, go... | 26,280 |
<p>I'm using the MonthCalendar control and want to programmatically select a date range. When I do so the control doesn't paint properly if <code>Application.EnableVisualStyles()</code> has been called. This is a known issue according to MSDN. </p>
<blockquote>
<p>Using the MonthCalendar with visual
styles enabled... | <p>While looking for a solution to the same problem, I first encountered this question here, but later I discovered a blog entry by <a href="http://nickeandersson.blogs.com/blog/2006/05/_modifying_the_.html" rel="nofollow noreferrer">Nicke Andersson</a>. which I found very helpful.
Here is what I made of Nicke's exampl... | <p>you can try this code:</p>
<pre><code>Dim StartDate As Date = New DateTime(2011, 9, 21)
Dim EndDate As Date = New DateTime(2011, 9, 25)
MonthCalendar1.SelectionRange = New SelectionRange(StartDate, EndDate)
</code></pre>
<p>for more information:</p>
<p><a href="http://www.authorcode.com/how-to-select-a-range-of-d... | 25,405 |
<p>Provided I have admin access, I need a way to manage (Create, modify, remove) local accounts in a remote machine from an ASP.NET client.</p>
<p>I'm clueless in how to approach this. Is WMI a possibility (System.Management namespace)?
Any pointers?</p>
| <p>Give this a try:</p>
<pre><code>DirectoryEntry directoryEntry = new DirectoryEntry("WinNT://ComputerName" & ",computer", "AdminUN", "AdminPW");
DirectoryEntry user = directoryEntry.Children.Add("username", "user");
user.Invoke("SetPassword", new object[] { "password"});
ser.CommitChanges();
</code></pre>
<p>If... | <p>I used System.DirectoryServices to get data from users in a n ActiveDirectory (LDAP).
I don't know if that's the kind of thing you're looking for.<br>
Hope it helps.</p>
| 21,646 |
<p>Does anyone have any information about using a soldering iron to fix and retouch 3D prints?
On the market, for example, we can find Modifi3D pen. Why has nobody created a simple soldering tip for this use?</p>
<p>I have a TS100 soldering iron which has great temperature control and I think it would be perfect for th... | <p>I have used a standard soldering iron to modify and fix 3D prints in the past. You have to keep some things in mind when doing so:</p>
<ul>
<li>Don't overheat your material. PLA can take a soldering iron of about 230 °C before charring.</li>
<li>Don't use a tip with solder, or you will get grey deposits in the plast... | <p>Cutting materials with a 'hot knife' isn't anything new. There should be a fairly established toolset for working foam. For 3D prints, I prefer to add coatings rather than modify surfaces with a hand held tool after. I do run a drill bit through printed holes though.</p>
| 1,911 |
<p>This must be a classic .NET question for anyone migrating from Java. </p>
<p>.NET does not seem to have a direct equivalent to java.io.StreamTokenizer, however the JLCA provides a SupportClass that attempts to implement it. I believe the JLCA also provides a Tokenizer SupportClass that takes a String as the sourc... | <p>There isn't anything in .NET that is completely equivalent to StreamTokenizer. For simple cases, you can use String.Split(), but for more advanced token parsing, you'll probably end up using <a href="https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex(v=vs.110).aspx" rel="nofollow noreferre... | <p>To tokenize a string, use <code>string.Split(...)</code>.</p>
| 17,154 |
<p>I need to find the frequency of a sample, stored (in vb) as an array of byte. Sample is a sine wave, known frequency, so I can check), but the numbers are a bit odd, and my maths-foo is weak.
Full range of values 0-255. 99% of numbers are in range 235 to 245, but there are some outliers down to 0 and 1, and up to 2... | <p>The FFT is probably the best answer, but if you really want to do it by your method, try this:</p>
<p>To normalize, first make a histogram to count how many occurrances of each value from 0 to 255. Then throw out X percent of the values from each end with something like:</p>
<pre><code>for (i=lower=0;i< N*(X/1... | <p>I googled for "basic fft". <a href="http://logix4u.net/DSP/Fast_Fourier_Transform/Visual_Basic_program_for_Fast_Fourier_Transform.html" rel="nofollow noreferrer">Visual Basic FFT</a> Your question screams FFT, but be careful, using FFT without understanding even a little bit about DSP can lead results that you don't... | 11,278 |
<p>How do I create a master/detail form in Axapta/Dynamics Ax, with a master grid and a detail grid, where choosing a record in the master grid changes the content of the detail grid accordingly?</p>
| <p><a href="http://daxdave.blogspot.com/2006/10/creating-headerdetail-based-linkage-on.html" rel="noreferrer">http://daxdave.blogspot.com/2006/10/creating-headerdetail-based-linkage-on.html</a></p>
| <p>Just to add a bit to James' answer, often you can find an example of what your trying to do just by looking at an existing form. You didn't specify whether you were working in Dynamics AX 2012 or an earlier version, but you'd probably want to build a ListPage and Detail form if it's 2012. For an example, take a lo... | 47,905 |
<p>I want to know how events are used in embedded system code.</p>
<p>Main intention is to know how exactly event flags are set/reset in code. and how to identify which task is using which event flag and which bits of the flag are getting set/reset by each task.</p>
<p>Please put your suggestion or comments about it.... | <p>Many embedded systems use Interrupt Service Routines (ISR) to handle events. You would define an ISR for a given "flag" and reset that flag after you handle the event.</p>
<p>For instance say you have a device performing Analog to Digital Conversions (ADC). On the device you could have an ISR that fires each time t... | <p>In one family of embedded systems I designed (for a PIC18Fxx micro with ~128KB flash and 3.5KB RAM), I wrote a library to handle up to 16 timers with 1/16-second resolution (measured by a 16Hz pulse input to the CPU). The code is set up to determine whether any timer is in the Expired state or any dedicated wakeup ... | 27,747 |
<p>I am using Visual Studio, developing a native application, I have a programmatical breakpoint (assert) in my code placed using __asm int 3 or __debugbreak. Sometimes when I hit it, I would like to disable it so that successive hits in the same debugging session no longer break into the debugger. How can I do this?<... | <h2>x86 / x64</h2>
<p>Assuming you are writing x86/x64 application, write following in your watch window:</p>
<p>x86: <code>*(char *)eip,x</code></p>
<p>x64: <code>*(char *)rip,x</code></p>
<p>You should see a value 0xcc, which is opcode for INT 3. Replace it with 0x90, which is opcode for NOP. You can also use the... | <p>You might try something like this:</p>
<pre><code>#define ASSERT(x) {\
if (!(x)) \
{ \
static bool ignore = false; \
if (!ignore) \
{ \
ignore = true; \
__asm int 3 \
} \
}\
}
</code></pre>
<p>This should hit the debug only once. You might even show a messagebox t... | 14,053 |
<p>Saw a post about hidden features in C# but not a lot of people have written linq/lambdas example so... I wonder...</p>
<blockquote>
<p>What's the coolest (as in the most elegant) use of the C# LINQ and/or Lambdas/anonymous delegates you have ever saw/written?</p>
</blockquote>
<p>Bonus if it has went into produc... | <p>The <a href="http://blogs.msdn.com/lukeh/archive/2007/10/01/taking-linq-to-objects-to-extremes-a-fully-linqified-raytracer.aspx" rel="noreferrer">LINQ Raytracer</a> certainly tops my list =)</p>
<p>I'm not quite sure if qualifies as elegant but it is most certainly the coolest linq-expression I've ever seen!</p>
<... | <p>Working with attributes:</p>
<pre><code>private void WriteMemberDescriptions(Type type)
{
var descriptions =
from member in type.GetMembers()
let attributes = member.GetAttributes<DescriptionAttribute>(true)
let attribute = attributes.FirstOrDefault()
where attribute != nul... | 4,850 |
<p>I'm using a bookmarklet that inserts a script tag into the current web page.</p>
<p>This script has some UI and an "<code>input type=submit....</code>" tag in it.</p>
<p>Web page A has chosen not to style "<code>input type=submit..</code>" tags whereas web page B has styled them.</p>
<p>This results in the bookma... | <p>Taken from <a href="https://developer.mozilla.org/en/Common_CSS_Questions" rel="noreferrer">Mozilla Developer Center</a></p>
<blockquote>
<p><strong>Restoring the default property value</strong>
Because CSS does not provide a "default" keyword, the only way to restore the default value of a property is to expli... | <p>I came up with the same problem. This posts helped me a lot. I had to assign that CSS rule to text inputs in a special table but not to all of the text inputs in the page. So I had to used the CSS rule with id of the table. This should work fine with form ids.</p>
<p>'#addForum note' is the id of the special format... | 49,949 |
<p>First, I know about this: <a href="https://stackoverflow.com/questions/51217/how-would-you-organize-a-subversion-repository-for-in-house-software-projects">How would you organize a Subversion repository for in house software projects?</a>
Next, the actual question:
My team is restructuring our repository and I'm loo... | <p>If you follow my recommendations below (I have for years), you will be able to:</p>
<p>-- put each project anywhere in source control, as long as you preserve the structure from the project root directory on down</p>
<p>-- build each project anywhere on any machine, with minimum risk and minimum preparation</p>
<... | <p>I have a similar layout, but my trunk, branches, tags all the way at the top. So: /trunk/main, /trunk/utils, /branches/release/, etc.</p>
<p>This ended up being really handy when we wanted to try out other version control systems because many of the translation tools worked best with the basic textbook SVN layout.<... | 27,499 |
<p>I'm a bit confused here. Microsoft as far as I can tell claims that parametrization is the best way to protect your database from SQL injection attacks. But I find two conflicting sources of information here:</p>
<p><a href="http://support.microsoft.com/kb/200190" rel="nofollow noreferrer">This page</a> says to u... | <p>I could be wrong here, but I think this just means that someone could use the Command object to do bad things. I.e. it's not to be trusted if someone else is scripting it.</p>
<p>See <a href="http://www.avdf.com/mar97/art_interface.html" rel="nofollow noreferrer">safe for scripting</a> in this article. Every inst... | <p>I think "safe for scripting" means "safe to be run from a webpage we just retrieved from some Nigerian prince". The command object should be safe to run on the server.</p>
<p>At work though, back in the day my colleagues didn't trust it so we had an in-house framework that basically did the same thing.</p>
| 8,180 |
<p>The WebBrowser control has a property called "IsWebBrowserContextMenuEnabled" that disables all ability to right-click on a web page and see a context menu. This is very close to what I want (I don't want anyone to be able to right-click and print, hit back, hit properties, view source, etc).</p>
<p>The only probl... | <p>have you considered writing your own context menu in javascript? Just listen to the user right clicking on the body, then show your menu with copy and paste commands (hint: element.style.display = "block|none"). To copy, execute the following code:</p>
<pre><code> CopiedTxt = document.selection.createRange();
... | <p>We ended up using a combination of both of the above comments. Closer to the second, which is why I gave him credit.</p>
<p>There is a way to replace the context menu on both the client-side web code as well as through winforms, which is the approach we took. I really didn't want to rewrite the context menu, but ... | 24,408 |
<p>I hope someone might be able to help me here. I've tried to simplify my example as best I can.</p>
<p>I have an absolutely positioned DIV, which for this example I've made fill the browser window. This div has the overflow:auto attribute to provide scroll bars when the content is too big for the DIV to display.</p>... | <p>I had a problem with excessive horizonal bar in IE7. I've used D Carter's solution slighty changed</p>
<pre><code><div style="zoom: 1; overflow: auto;">
<div id="myDiv" style="zoom: 1;">
<table style="width: 100%"...
...
</table>
</div>
</div>
</code></pre>
... | <p>This looks like it should fix your problem, as long as you are not apposed to condition statements. <a href="http://blog.josh420.com/archives/2007/11/fixing-the-ie-overflow-vertical-scrollbar-bug.aspx" rel="nofollow noreferrer">Fixing IE overflow</a></p>
| 16,823 |
<p>When accessing my site, the user has to enter his credentials. They are basically plain directory access credentials.
At a certain point I check if a certain file they want to download exists by calling</p>
<pre><code>WebRequest req = HttpWebRequest.Create(checkUri.AbsoluteUri);
WebResponse res = req.GetResponse();... | <p>I think you want this:</p>
<pre><code>req.Credentials = CredentialCache.DefaultCredentials;
</code></pre>
| <p>You're going to need to enable Integrated Windows Authentication.</p>
<p>I don't know what happens in ASP.NET MVC, but in ASP.NET Web Forms impersonation is turned on by:</p>
<pre><code><identity impersonate="true">
</code></pre>
<p>in web.config.</p>
| 46,337 |
<p>Delphi object inspector doesn't show TFrame descendants's additional properties by design.
People tend to suggest using a known trick which is commonly used for showing TForm descendant's properties on the Object inspector. The trick is: registering custom module for TForm descendants to Delphi IDE via design time p... | <p>Which custom module class are you registering for your frame?
Which version of Delphi are you using?</p>
<p>From my experiments with Delphi 2007, the custom module class which seems to work is TFrameModule. This class is contained in delphivclide100.bpl. Since there is no corresponding delphivclide.dcp you have to ... | <p>No, I don't think this is fully possible.</p>
<p>What I usually do when I have similar needs is to simply install the frame descendant as a component of its own right. But yes, that way you lose a lot of the typical frame behaviour (especially at designtime), e.g. you can no longer manipulate sub-components directl... | 36,895 |
<p>consider this code block</p>
<pre><code>public void ManageInstalledComponentsUpdate()
{
IUpdateView view = new UpdaterForm();
BackgroundWorker worker = new BackgroundWorker();
Update update = new Update();
worker.WorkerReportsProgress = true;
worke... | <p>Threads count as root objects; I don't know exactly how BackgroundWorker operates, but it seems likely that the primary thread method is going to access state on the worker instance; as such, the worker thread itself will keep the BackgroundWorker instance alive until (at least) the thread has exited.</p>
<p>Of cou... | <p>Those local variable objects are keep alive until the function exits, which is when the form exits. So null them out before call to Run, or move them to a different context.</p>
<pre><code>public void ManageInstalledComponentsUpdate() {
UpdaterForm form = new UpdaterForm();
FireAndForgetWorker( form );
... | 30,176 |
<p>I am using <strong>mysql (5.0.32-Debian_7etch6-log)</strong> and i've got a nightly running bulk load <strong>php (5.2.6)</strong> script <strong>(using Zend_DB (1.5.1)</strong> via PDO) which does the following:</p>
<ol>
<li>truncating a set of 4 'import' tables</li>
<li>bulk inserting data into these 4 'import' t... | <p>Errors like this can occur when a MyISAM table becomes corrupt. Running the repair command on the table in question is usually all that's required to fix it:</p>
<pre><code>> repair table mytablename;
</code></pre>
<p>A better solution is not to use MyISAM for tables where the data is constantly changing - Inno... | <p>Could some other script be inserting into the database while your import script is running?</p>
| 27,287 |
<p>I am trying to place a big number in a C++ variable. The number is 600851475143</p>
<p>I tried unsigned long long int but got an error saying it the constant was too big.
I then tried a bigInt library called BigInt -> <a href="http://mattmccutchen.net/bigint/" rel="nofollow noreferrer">http://mattmccutchen.net/big... | <p>You can specify an integer literal as long by the suffix L.<br>
You can specify an integer literal as long long by the suffix LL.<br></p>
<pre><code>#include <iostream>
int main()
{
long long num = 600851475143LL;
std::cout << num;
}
</code></pre>
| <p>Try this one.
Basically you can have your own custom class which uses linked list to store the number of infinite size. ( RAM is the restriction )
Try this one
<a href="https://mattmccutchen.net/bigint/" rel="nofollow">https://mattmccutchen.net/bigint/</a></p>
| 29,473 |
<p>I am trying to create a SQL server login and database user from within my application, along with a custom application user row. I want these users to be able to create other users - i.e. the application will control who can/can't create users but I need all users to have permissions for creating SQL server logins a... | <p>Technically, yes. Whether it's right or wrong... no comment.</p>
<p>Anyway, database security is split into 2 functions:</p>
<ul>
<li>db_accessadmin to manage users (or "ALTER ANY USER" permission as you mentioned)</li>
<li><a href="http://msdn.microsoft.com/en-us/library/ms188685.aspx" rel="noreferrer">db_securit... | <p>This seems very dangerous, easily becoming a security nightmare. Not knowing anything about why you think this is the best solution to accomplish your objective I can't really tell you not to do it this way, but wow!! - I would think long and hard about whether this really is necessary. The spider-webbing of users j... | 48,743 |
<p>I have a very simple bit of script that changes the status of an item in a MySql database - it works fine in IE7, but if I try it in Firefox, it looks like it's worked, but hasn't... Which is extremely odd.</p>
<p>The code is very simple - first I get the details of the record I'm looking for:</p>
<pre><code><c... | <p>I found the cause of the problem... Firebug.</p>
<p>I haven't the slightest idea what Firebug thinks it's doing, if I remove the 'cflocation' tag from the script (the one that takes the user back to the summary page), then it works fine. But if I keep it in, Firebug seems to run the function again before forwarding... | <p>Try removing the semi-colon at the end of your WHERE clauses in your SQL code.</p>
<pre><code>WHERE iProductAttributeID = <cfqueryparam value="#Arguments.iProductAttributeID#" cfsqltype="CF_SQL_INTEGER" />;
</code></pre>
| 16,788 |
<p>How do I create a .Net Web Service in IronPython?
Preferably dynamically without any pre- or post-processing.</p>
| <p>Finally I have decided to use a watchdog process in the second script, so the script will be launched by this process instead of being launched by psexec.</p>
<p>Thanks a lot for your help and your time devoted to help me.</p>
<p>Best regards</p>
| <p>It may be related with an issue that one gets from too many linked server hops using integrated authentication - a <a href="http://support.microsoft.com/kb/887682" rel="nofollow noreferrer"><strong>double-hop Kerberos problem</strong></a>.</p>
<p>Since Integrated Windows Authentication covers two separate authentic... | 46,845 |
<p>I am supposed to provide my users a really simple way of capturing video clips out of my OpenGL application's main window. I am thinking of adding buttons and/or keyboard shortcuts for starting and stopping the capture; when starting, I could ask for a filename and other options, if any. It has to run in Windows (XP... | <p>There are two different questions here - how to grab frames from an OpenGL application, and how to turn them into a movie file.</p>
<p>The first question is easy enough; you just grab each frame with glReadPixels() (via a PBO if you need the performance).</p>
<p>The second question is a little harder since the cro... | <p>The easiest option is going to be saving each rendered frame from within your app and then merging them into an AVI. When you have the AVI there are many libraries available that can convert it into a more optimal format, or possibly skip the AVI step altogether.</p>
<p>In terms of getting each frame, you could acc... | 18,713 |
<p>I just wonder what the best approach is to have multiple users work on a Project in Visual Studio 2005 Professional.</p>
<p>We got a Solution with multiple Class Libraries, but when everyone opens the solution, we keep getting the "X was modified, Reload/Discard?" prompt all the time. Just opening one project is an... | <p>Use source control to keep a central repository of all your code. Then each user checks out their own copy of the source code and works locally. Then submits only the code that changed.</p>
<p><a href="https://en.wikipedia.org/wiki/Version_control" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Version_con... | <p>This might sound snide, but if you're opening up the solution from a shared location then you're doing something wrong. If that's the case then you should start using source control (something like Subversion) and have everyone check out a copy of the project to work on. </p>
<p>However if you're already using sour... | 6,262 |
<p>I am working on someone else's PHP code and seeing this pattern over and over:</p>
<p>(pseudocode)</p>
<pre><code>result = SELECT blah1, blah2, foreign_key FROM foo WHERE key=bar
if foreign_key > 0
other_result = SELECT something FROM foo2 WHERE key=foreign_key
end
</code></pre>
<p>The code needs to bra... | <p>There is not enough information to really answer the question. I've worked on applications where decreasing the query count for one reason and increasing the query count for another reason <em>both</em> gave performance improvements. In the same application!</p>
<p>For certain combinations of table size, database c... | <p>Considering that in one database hit you have all the data you need having one single SQL statement would be better performance 99% of the time. Not sure if the connections is being creating dynamically in this case or not but if so doing so is expensive. Even if the process if reusing existing connections the DBMS... | 49,268 |
<p>I understand object oriented programming, and have been writing OO programs for a long time. People seem to talk about aspect-oriented programming, but I've never really learned what it is or how to use it. What is the basic paradigm?</p>
<p>This question is related, but doesn't quite ask it:</p>
<p><a href="htt... | <p>AOP addresses the problem of <em>cross-cutting concerns</em>, which would be any kind of code that is repeated in different methods and can't normally be completely refactored into its own module, like with logging or verification. So, with AOP you can leave that stuff out of the main code and define it vertically l... | <p>AOP is a way to better modularize your application for functionality that spans across multiple boundaries. AOP is another way to encapsulate these features and follow Single Responsiblity by moving these cross-cutting concerns (logging, error handling, etc.) out of the main components of your application. When us... | 29,977 |
<p>I have a game with puzzles. Puzzles are created from script files using a puzzle engine ID. Puzzle engines register themselves using a static variable in a static hash. I'm having reports of crashes and we've tracked down the problem to the hash not having certain keys, which should have been added by the static fun... | <p>This is probably a <a href="http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.12" rel="nofollow noreferrer">static initialization</a> order issue. Try rewriting it as "<a href="http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.13" rel="nofollow noreferrer">construct on first use</a>".</p>
| <p>Looks like this had nothing to do with static initialization after all - after a lot of logging we found out some unrelated code was destroying the pointer, apparently.</p>
| 46,855 |
<p>We use ASP.NET / C#.</p>
<p>We work locally, test locally, check in our code and binaries through SVN.</p>
<p>On our server, we checkout the latest 'build' from SVN directly into our IIS web directory.</p>
<p>Is this a good practice, or is there something else we should be doing for rollouts?</p>
| <p>Why check it out? You could easily create a script to export it (clean, no .svn directories, no mess) to the IIS directory.</p>
<p>SVN supports an export feature, <a href="http://svnbook.red-bean.com/en/1.5/svn-book.html#svn.ref.svn.c.export" rel="nofollow noreferrer">SVN Export</a></p>
<p>Edit: Just noticed this ... | <p>I do the same thing with 1 exception...I first checkout the latest build to a dev version of the site on the same server just to make sure there aren't any weird issues on the server-side. It's rare that ever are any, but it's happened before.</p>
<p>Not sure if there's a better way of doing it, but it's worked we... | 30,230 |
<p>How can i check in JavaScript if a variable is defined in a page? Suppose I want to check if a variable named "x" is defined in a page, if I do <code>if(x != null)</code>, it gives me an error.</p>
| <p>I got it to work using <code>if (typeof(x) != "undefined")</code></p>
| <p>try to use <a href="http://www.w3schools.com/jsref/jsref_undefined.asp" rel="nofollow noreferrer">undefined</a></p>
<pre><code>if (x !== undefined)
</code></pre>
<p>This is how checks for specific Browser features are done.</p>
| 16,795 |
<p>This function exists on OS X and allows you to pass custom local to the function. setlocale is not thread-safe, and passing locale as parameter is.</p>
<p>If there is no equivalent, any way of locale-independent printf, or printf just for doubles (%g) will be ok.</p>
| <p>You might try <a href="http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/baselib-uselocale-3.html" rel="nofollow noreferrer"><code>uselocale</code></a>, which sets the thread locale (rather than the process locale) before calling <code>printf</code>.</p>
| <p>There is a whole family of locale-independent sprintf family of routines as stb_sprintf: <a href="https://github.com/nothings/stb" rel="nofollow noreferrer">https://github.com/nothings/stb</a>
It's dual licensed as public domain (where possible) and MIT license.</p>
| 34,292 |
<p>I am working with Crystal Reports and MS SQL Server.
I need to remap the crystal report to point to a different database on the same SQL Server. Is there an automated way of doing this, or do I have to remap for every single report? I am currently doing this by adding a new data connection, and then updating the sto... | <p>You'll find hereafter the procedure I use (I simplified it on the fly, suppressing our own objects and global variables). This procedure allows to redirect a report from an original connection used at development time to the active SQL server. It is written in VB and uses 2 main objects:</p>
<ol>
<li>The original r... | <p>You can get any of the info from the current report connection info. So if your not changing servers, then set the crystalServer variable to the reports current server.</p>
<pre class="lang-vb prettyprint-override"><code>'SET REPORT CONNECTION INFO
For i = 0 To rsource.ReportDocument.DataSourceConnections.Count - 1... | 25,050 |
<p>A lot of consumer desktop F.D.M. printers comes with a 0.4mm nozzle. I'm looking to print fine details objects and I was considering trying to use a smaller size nozzle. But before I do so I would like to establish a list of downsides and unwanted consequences.</p>
| <p>Here are some things to look out for when switching to a smaller nozzle size:</p>
<ul>
<li><strong>Curling</strong> (out of the nozzle): Make sure the nozzle is clear of any debris to avoid the extruded filament from catching and therefore curling around the nozzle.</li>
<li><strong>Warping</strong>: You might expe... | <p>In addition to the <a href="https://3dprinting.stackexchange.com/a/2974/5740">answer</a> of <a href="https://3dprinting.stackexchange.com/users/98/tbm0115">tbm0115</a>; special care has to be given to the strength and stiffness of the model. Lines are thinner and thus when using the same amount of walls and infill p... | 414 |
<p>I have the following code:</p>
<pre><code>if ($_POST['submit'] == "Next") {
foreach($_POST['info'] as $key => $value) {
echo $value;
}
}
</code></pre>
<p>How do I get the foreach function to start from the 2nd key in the array?</p>
| <p>For reasonably small arrays, use <a href="http://fr.php.net/manual/en/function.array-slice.php" rel="noreferrer">array_slice</a> to create a second one:</p>
<pre><code>foreach(array_slice($_POST['info'],1) as $key=>$value)
{
echo $value;
}
</code></pre>
| <pre>
<code>
foreach($_POST['info'] as $key=>$value) {
if ($key == 0) { //or what ever the first key you're using is
continue;
} else {
echo $value;
}
}
</code>
</pre>
| 48,559 |
<p>I was just wondering what the best way to do this is and if it could be bypassed.
These are my thoughts.</p>
<p>I have a bunch of links that when clicked open up a detail panel underneath which displays more information. This is done ajaxy. The thing is however...if the user is not logged in it should take them to ... | <p>I could easily be bypassed. The user could create their own AJAX call (don't even need to do AJAX, they could just create a plain old HTTP Request), with the login flag set, and get to the data they aren't supposed to. You'd probably be better off just using the information from the session to determine if the use... | <p>Instead of sending back the login status why not send back the data for the logged in user only if the user is logged in? So you do all the logic for determining what to display on the server. The AJAX call recieves data and displays it regardless.</p>
<p>If you have the javascript idisplay or not display data it i... | 40,381 |
<p>I have a modal popup that initially shows some content but expands a div if a checkbox is selected. The modal expands correctly but doesn't recenter unless you scroll up or down. Is there a javascript event I can tack on to my javascript function to recenter the entire modal?</p>
| <p>Here is what it is:</p>
<pre><code>$find('ModalPopupExtenderClientID')._layout();
</code></pre>
<p>For example:</p>
<pre><code>$find('detailsPopUpExtenderId')._layout();
</code></pre>
<p>and in aspx:</p>
<pre><code><ccl:ModalPopupExtender runat="server" ID="MyPopUpExtender" TargetControlID="pop" PopupControl... | <p>Whatever event you have bound to the scrolling to get it to re-center, bind that event to the checkbox/div expanding event as well (or call it from within the other event). Hard to say more without seeing some code.</p>
| 21,297 |
<p>I recently converted a ruby library to a gem, which seemed to break the command line usability</p>
<p>Worked fine as a library</p>
<pre><code> $ ruby -r foobar -e 'p FooBar.question' # => "answer"
</code></pre>
<p>And as a gem, irb knows how to require a gem from command-line switches</p>
<pre><code> $ irb ... | <p>-rubygems is actually the same as -r ubygems.</p>
<p>It doesn't mess with your search path, as far as I understand, but I think it doesn't add anything to your -r search path either. I was able to do something like this:</p>
<pre><code>ruby -rubygems -r /usr/lib/ruby/gems/myhelpfulclass-0.0.1/lib/MyHelpfulClass -e... | <p>Note: this problem exists for ruby 1.8, but is resolved in ruby 1.9.</p>
<p>On 1.8, if you specify both libs via <code>-r</code>, ruby will try to load each library without paying attention to changes in the <code>$LOAD_PATH</code>. But rubygems does change <code>$LOAD_PATH</code> so the gems can be found.</p>
<p>... | 15,086 |
<p>What I am trying to do when the user is in a textbox (in silverlight 2.0):</p>
<ul>
<li>When user presses the decimal point
(.) <strong>on the numeric pad</strong>, I want to
have it replaced by the correct
decimal separator (which is comma
(,) in a lot of countries)</li>
</ul>
<p>I can track that the user typed a... | <p>The answer was found on the website of MSDN:
<a href="http://code.msdn.microsoft.com/Replace-numpad-decimalpoint-c1e0e6cd" rel="nofollow">Replace-numpad-decimalpoint</a> </p>
<pre><code>Imports System.Threading
Imports System.Windows.Forms
Namespace My
' The following events are available for MyApplication:
... | <p>You could do your changes in _LostFocus wether it's changing the dot to a comma, or applying the correct culture to the input.</p>
<p>It wouldn't do the change straight away as you desire, but would do it as soon as the user left the text box.</p>
| 44,157 |
<p>My initial tests have shown that Robot won't work without an active, visible desktop. For example, while a scheduled task (or executed command from the continuous integration server) may be able to start robot as a command-line process, Robot will actually fail to execute the recorded script.</p>
<p>Logging into th... | <p>Unfortunately, Robot does require that you are logged on to the machine and that the desktop is not locked. </p>
<p>So, no, you are not missing something.</p>
<p>Depending on your situation, though, you may be able to work around the issue. Can you clarify what type of application you are trying to test? If it ... | <p>You can run Rational Robot from the command line, so you should be able to set up a scheduled task to run a .BAT file to do this for you. The command is something like:</p>
<p>[path to Rational Robot]\rtrobo [script file] /user "user name" /project [project file] /play /build "build name" /nolog /close</p>
<p>The ... | 8,834 |
<p>I've heard that it's possible with extension methods, but I can't quite figure it out myself. I'd like to see a specific example if possible.</p>
<p>Thanks!</p>
| <p>It really depends on what you mean by "mixin" - everyone seems to have a slightly different idea. The kind of mixin I'd <em>like</em> to see (but which isn't available in C#) is making implementation-through-composition simple:</p>
<pre><code>public class Mixin : ISomeInterface
{
private SomeImplementation impl... | <p>There are, fundamentally, several techniques to getting Mixin behavior in your classes:</p>
<ul>
<li>Behavioral mixins that hold no state are easily done using extension methods</li>
<li>Behavioral mixins for interfaces that use duck typing (currently, <code>IEnumerable</code> and <code>IDisposable</code>) <a href="... | 31,887 |
<p>I'm using ASP.NET WebClient.DownloadFile(url) to obtain images from the Image Servers of several of our clients. The 'url' is usually simple, like "<a href="http://somewhere.com/images/image01.jpg" rel="nofollow noreferrer">http://somewhere.com/images/image01.jpg</a>". </p>
<p>This works great for 99% of our client... | <p>Some servers will look for specific user-agent strings to prevent bots and other leeching sites from downloading images. Check out the user-agent that you're setting in webclient.</p>
| <p>It might be worth using something like the HttpFox FireFox addon to see exactly what the server is doing when you request that file as it might be doing something "odd" like setting/reading a tracking cookie before it will download (just a random example). </p>
<p>It won't fix the problem, but it might give you an... | 22,964 |
<p>I've got two versions of a project with a JUnit test. Looking at the diff of the files there's no obvious reason to this, but the test passes on one project but not on the other.</p>
<p>For a while now I've wondered if there was a program that would record a trace through the whole program when it runs and save it ... | <p>I'd use Aspects for this. Check out AspectJ for instance, it is very easy to design a rule (point cut) that says "For all methods invoked in my Java code, log method name".</p>
| <p>The Eclipse <a href="http://www.eclipse.org/tptp/" rel="nofollow noreferrer">TPTP project</a> has a trace engine that you might find useful.</p>
| 15,390 |
<p>I want another developer to run a Perl script I have written. The script uses many CPAN modules that have to be installed before the script can be run. Is it possible to make the script (or the <code>perl</code> binary) to dump a list of all the missing modules? Perl prints out the missing modules’ names when I atte... | <p>You could dump <code>%INC</code> at the end of your script. It will contain all used and required modules. But of course, this will only be helpful if you don't require modules conditionally (require Foo if $bar).</p>
| <p>Today I develop my Perl apps as <a href="https://stackoverflow.com/questions/1679835">CPAN-like distributions</a> using <a href="http://search.cpan.org/perldoc?Dist::Zilla" rel="nofollow noreferrer">Dist::Zilla</a> that can take care of the dependencies through the <a href="http://search.cpan.org/perldoc?Dist::Zilla... | 46,801 |
<p>Does anyone know of any DLLs (preferably .net) that encapsulate the lua 5.1 compiler? I'm working on a .net project where part of it needs to compile lua scripts, and i would rather have a DLL that i could send script code to instead of sending the script to a temporary file and running luac.exe.</p>
<p>Edit: I'd ... | <p>Have you looked into using something like Spring's proxy functionality? You tell it a bit about the webservice in a spring config file, and all your client code has to deal with is an interface that you create - it doesn't even have to know that there is a web service on the other side!</p>
<p>Example Spring confi... | <p>We tried to use complex objects and Axis. Don't! We had a bunch of problems with Dotnet being able to create a correct object from the WSDL. We ended up just using primitives, strings, and arrays. If someone has a good method of using complex object I would love to hear it.</p>
| 31,306 |
<p>Question says it all, really.
My application is a time tracker. It's currently written as a spreadsheet, but there's just too much data and I would like to impose a bit more structure on it. </p>
<p><a href="http://sqlite.org/" rel="nofollow noreferrer">SQLite</a> seems like a neat way to go.<br>
I would be open... | <p>There are some providers available:</p>
<p><a href="http://sqlite.phxsoftware.com/" rel="nofollow noreferrer">http://sqlite.phxsoftware.com/</a></p>
<p><a href="http://sourceforge.net/projects/sqlite-dotnet2" rel="nofollow noreferrer">http://sourceforge.net/projects/sqlite-dotnet2</a></p>
<p>And you can get up an... | <p>If you are working on an open source application and want a lightweight interop layer to SQLite, then the SQLite code in Media Portal may be of interest (see SQLiteClient.cs)</p>
| 20,935 |
<p>Visual Studio solutions contain two types of hidden user files. One is the solution <code>.suo</code> file which is a binary file. The other is the project <code>.user</code> file which is a text file. Exactly what data do these files contain?</p>
<p>I've also been wondering whether I should add these files to sour... | <p>These files contain user preference configurations that are in general specific to your machine, so it's better not to put it in SCM. Also, VS will change it almost every time you execute it, so it will always be marked by the SCM as 'changed'.
I don't include either, I'm in a project using VS for 2 years and had no... | <p>If you set your executable dir dependencies in <strong>ProjectProperties>Debugging>Environment</strong>, the paths are stored in '.user' files. </p>
<p>Suppose I set this string in above-mentioned field: <strong>"PATH=C:\xyz\bin"</strong>
This is how it will get stored in '.user' file: </p>
<p><code><LocalDebu... | 9,794 |
<p>I'd like to be able to add a class to images that adds a border that makes them look like a stack of photos. Anyone know how to do this?</p>
<p>Clarifications: Ideally something like the stack shown <a href="http://designreviver.com/tutorials/create-an-interactive-stack-of-photos/" rel="nofollow noreferrer">here</... | <p>The "depth" affect is probably going to be some type of <a href="http://www.webtoolkit.info/css-drop-shadow.html" rel="nofollow noreferrer">drop shadow</a>. Do you need to rotate the photos as well for the "messy photo pile" effect or are you looking for a "neatly stacked" look?</p>
<p>The "messy photo pile" effec... | <p>CSS3 it's supported by everyone yet, but you might want to look into <a href="http://www.css3.info/preview/border-image/" rel="nofollow noreferrer">border-image</a>.</p>
| 20,265 |
<p>I would like to be able to export my WF diagram from visual studio 2008 into Visio so I can better show it to non-programmers. Dose anyone know if its possible? I haven't come across any mention of it before, and I don't see anything that jumps out at me from VS.</p>
<p>[EDIT: WF = Windows Workflow Foundation]</p>
| <p>In the designer, click on the Workflow menu item and select "Save as Image" or "Copy to Clipboard"</p>
| <p>In VS2015, the Workflow menu doesn't exist but you can right-click in the Designer to reach the 'Copy as Image' and 'Save as Image' options. </p>
<p>I had the most success with the XPS format which rendered well even when zoomed-in, and can be viewed with the built-in XPS viewer in Windows.</p>
| 36,024 |
<p>When paging through data that comes from a DB, you need to know how many pages there will be to render the page jump controls.</p>
<p>Currently I do that by running the query twice, once wrapped in a <code>count()</code> to determine the total results, and a second time with a limit applied to get back just the res... |
<h3>Pure SQL</h3>
<p>Things have changed since 2008. You can use a <a href="https://www.postgresql.org/docs/current/functions-window.html" rel="noreferrer">window function</a> to get the full count <em>and</em> the limited result in one query. Introduced with <a href="https://www.postgresql.org/docs/8.4/release-8-4.ht... | <p>Seeing as you need to know for the purpose of paging, I'd suggest running the full query once, writing the data to disk as a server-side cache, then feeding that through your paging mechanism.</p>
<p>If you're running the COUNT query for the purpose of deciding whether to provide the data to the user or not (i.e. i... | 18,887 |
<p>I'm pretty sure this is a simple question in regards to formatting but here's what I want to accomplish:</p>
<p>I want to output data onto the screen using <code>cout</code>. I want to output this in the form of a table format. What I mean by this is the columns and rows should be properly aligned. Example:</p>
... | <p><a href="http://www.cplusplus.com/reference/iomanip/setw/" rel="noreferrer">setw</a>.</p>
<pre><code>#include <iostream>
#include <iomanip>
using namespace std;
int main () {
cout << setw(21) << left << "Test" << 1 << endl;
cout << setw(21) << left <&... | <p>you can do it with </p>
<pre><code>string str = "somthing";
printf ("%10s",str);
printf ("%10s\n",str);
printf ("%10s",str);
printf ("%10s\n",str);
</code></pre>
| 34,723 |
<p>Is it possible to write a PL/SQL query to identify a complete list of a stored procedures dependencies? I'm only interested in identifying other stored procedures and I'd prefer not to limit the depth of nesting that it gets too either. For example, if A calls B, which calls C, which calls D, I'd want B, C and D rep... | <p>On <a href="http://www.oracle.com/technology/oramag/code/tips2004/091304.html" rel="noreferrer">this page</a>, you will find the following query which uses the <a href="http://download.oracle.com/docs/cd/B28359_01/server.111/b28320/statviews_5132.htm#REFRN29106" rel="noreferrer">PUBLIC_DEPENDENCY</a> dictionary tabl... | <p>I agree with EddieAwad.</p>
<p>Its valuable to point out that Oracle only tracks the dependencies down to the object level. If you have your stored procedures in a package you can only track the dependencies if the package, not the individual functions/procedures within the package.</p>
<p>If you're looking to tra... | 38,063 |
<p>Is there a way to prevent mspdbsrv.exe from continuing to run
after finishing the compilation? or even after I terminate visual studio? or perhaps even prevent it from even spawning in the first place?</p>
<p>what is this guy good for anyway?</p>
<p>using vs2005</p>
| <p>mspdbsrv.exe is the process Visual Studio uses to create .pdb files when you compile; these are the symbol files that let you debug an application. Sometimes it goes berserk and doesn't shutdown correctly when you exit Visual Studio. I've had this cause bad compiles even after quitting and restarting Visual Studio... | <p>A little googling seems to indicate that mspdbsrv.exe zombies are a known issue in VS2005. We've had similar (intermittent) problems, but there did not seem to be a solution.</p>
<p>Yes, it sucks.</p>
| 10,531 |
<p>I am a bit confused about the uses of these words. I have a table with he following columns: SITE, LAT, LONG, NAME, ......</p>
<p>I want results with unique (or is it distinct) LAT, LONG.
How do I achieve this?</p>
| <pre><code>select unique colA, colB from atable
select distinct colA, colB from atable
</code></pre>
<p>In this context, unique and distinct mean the same thing. </p>
<p>Distinct however is ANSI standard, whereas unique is not.</p>
<p>Please note that unique has many other meanings when used in other area's ie inde... | <p>AFAIR both mean the same. To get unique vel distinct LAT & LONG from your table just do:</p>
<p>SELECT DISTINCT LAT, LONG FROM table;</p>
| 21,090 |
<p>I have a "username" TEdit on a Delphi 2006 login form. When the application starts up the user is asked to enter the username. The TEdit gets focus and the caret is placed in its horizontal center for some reason. As soon as anything is typed the caret is left aligned again and everything looks normal. </p>
<p>It i... | <p>I had also the same problem in Delphi 2007,<br>
with a TEdit placed in a modal form called by double-clicking in a Grid.</p>
<p>I made some tests launching the same Form from a TSpeedButton.
I noticed that the problem with the TEdit appears only when the grid is focused.</p>
<p><strong>after more tests the proble... | <p>Are you sure it is a simple TEdit? It might be initialized with a few spaces instead of an empty string. The onChange handler then might just strip spaces as soon as you start typing.
A TEdit extension might have text alignment set on centered instead of left, and set text alignment only on onChange.</p>
<p>[edit]
... | 34,523 |
<p>So from what little I understand about packaging for Macs, I see that the actual program that launches is the one defined under the CFBundleExecutable key in Info.plist.</p>
<pre><code><key>CFBundleExecutable</key>
<string>JavaApplicationStub</string>
</code></pre>
<p>Now, my app doesnt wor... | <p>You have most likely already implemented your solution, but to address a few issues; I would suggest considering Aleris's solution, or some derivative thereof. <br/></p>
<p><li> In your tables, you have a "removed at" field -- well, if that field were active (populated), technically the data shouldn't be there -- ... | <p>You could probably do it with a cross join and coalesce, but the union is probably still better from a performance standpoint. You can try testing each though.</p>
<pre><code>SELECT
COALESCE(C.CreatedAt, P.CreatedAt)
FROM
dbo.Countries C
FULL OUTER JOIN dbo.Provinces P ON
1 = 0
WHERE
C.LocalID =... | 27,228 |
<p>Is there any query which can return me the number of revisions made to the structure of a database table?</p>
<p>Secondly, how can I determine the number of pages (in terms of size) present in mdf or ldf files?</p>
| <p>I think you need to create a <code>trigger</code> and store all changes to the table in a separate table. You can then use this table to get the revision history.</p>
| <p><code>SQL Server</code> doesn't keep track of changes so it can't tell you this.</p>
<p>The only way you may be able to do this is if you had a copy of all the scripts applied to the database.</p>
<p>In order to be able to capture this information in the future you should look at <code>DDL triggers (v2005+)</code>... | 6,030 |
<p>I am using a System.Random object which is instantiated with a fixed seed all thoughout the application. I am calling the NextDouble method and after some time passed I am getting 0.0 as result.</p>
<p>Is there any remedy to this, has anyone else encountered this ?</p>
<p>EDIT: I have one seed for the whole run wh... | <p>The random number generator in .NET is not thread safe. Other developers have noticed the same behaviour, and one solution is as follows (from <a href="http://blogs.msdn.com/brada/archive/2003/08/14/50226.aspx" rel="noreferrer"><a href="http://blogs.msdn.com/brada/archive/2003/08/14/50226.aspx" rel="noreferrer">http... | <p>have a look at this <a href="http://msdn.microsoft.com/en-us/library/system.random.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/system.random.aspx</a> it should explain why your getting the same value.</p>
| 37,834 |
<p>What are my options? I tried MonoDevelop over a year ago but it was extremely buggy. Is the latest version a stable development environment?</p>
| <p>MonoDevelop 2.0 has been released, it now has a decent GUI Debugger, code completion, Intellisense C# 3.0 support (including linq), and a decent GTK# Visual Designer.</p>
<p>In short, since the 2.0 release I have started using Mono Develop again and am very happy with it so far.</p>
<p>Check out the <a href="http:... | <blockquote>
<p>Is the latest version stable a stable development environment?</p>
</blockquote>
<p>Probably ... it hit 1.0 this past spring.</p>
| 18,244 |
<p>Has anyone had good experiences of talking direct to RPG programs running on a V5R4 iSeries machine from Java? If so, what are the recommendations of the community, and what pitfalls should I try to avoid?</p>
<p>From the various pieces of literature and spike solutions I have attempted it looks as though we can us... | <p>I suggest using IBM's Java Toolbox for Java. Put the JT400.jar into your classpath (or JT400Ntv.jar if the Java is running on the iSeries). I've used both the ProgramCall class and the CommandCall classes.</p>
<p>The com.ibm.as400.access.CommandCall class is easy to use. It has a simple constructor that you pass... | <p>Hmm, I'm new here and would vote KC Baltz answer up, but cannot yet. Stored procedures are the way to go. I've used JT open to call programs natively and found issues with the number of parms that could be passed, issues with data types, etc. Once you have an SQL procedure wrapper around your program you'll find ... | 22,358 |
<p>In Vim I can <code>:set wrapscan</code> so that when I do an incremental search, the cursor jumps to the first match whether the first match is above or below the cursor.</p>
<p>In Emacs, if I start a search via <code>C-s</code>, the search fails saying <em>Failing I-search</em> if the first match is above the curs... | <p>The easiest way to do this is to use the following defadvice:</p>
<pre><code>(defadvice isearch-repeat (after isearch-no-fail activate)
(unless isearch-success
(ad-disable-advice 'isearch-repeat 'after 'isearch-no-fail)
(ad-activate 'isearch-repeat)
(isearch-repeat (if isearch-forward 'forward))
(... | <p>Set <code>isearch-wrap-pause</code> to <code>no</code>.</p>
<p><a href="https://www.gnu.org/software/emacs/manual/html_node/emacs/Repeat-Isearch.html" rel="nofollow noreferrer">https://www.gnu.org/software/emacs/manual/html_node/emacs/Repeat-Isearch.html</a></p>
| 36,276 |
<p>In a C# console app I have the need to extract the text from an RTF string, add some more text to it, and then convert it back into RTF. I have been able to do this using the System.Windows.Forms.RichTextBox class, but I find it a bit odd to use a Forms control in a non-Forms app. Any better way to do this?</p>
| <p>Doing anything with RTF is pretty difficult unless you're using the windows forms. As stated above, using forms is the easiest way to go.</p>
<p>You could write something yourself, but the RTF spec is pretty complicated.<br>
<a href="http://www.biblioscape.com/rtf15_spec.htm" rel="nofollow noreferrer">http://www.bi... | <p>It depends on what you mean by 'better'. You are already using the simplest and easiest way of doing it.</p>
| 4,236 |
<p>Does anyone know of a .NET library that will process HTML e-mails and can be used to trim out the reply-chain? It needs to be able to accept HTML -or- text mails and then trim out everything but the actual response, removing the trail of messages that are not original content. I don't expect it to be able to handl... | <p>Not an expert here, but "littering" your xaml with x:Uids is not worse than "littering" your Windows Forms code with all the string table nonsense you have to do for localizing them.</p>
<p>As far as I understand, WPF apps still support "all the Framework CLR resources including string tables, images, and so forth.... | <p>You can use the old "ResX" files which support all of your mentioned scenarios. How this can be accomplished in a WPF application is explained here:</p>
<p><a href="http://waf.codeplex.com" rel="nofollow noreferrer">WPF Application Framework (WAF)</a> => See Localization Sample</p>
| 11,268 |
<p>I'm used to doing basic password protection for Apache w/ the following method in Apache config files:</p>
<blockquote>
<p>AuthType Basic<br>
AuthName "By Invitation Only"<br>
AuthUserFile /path/to/.htpasswd<br>
Require valid-user </p>
</blockquote>
<p>However, I've been asked to put some protection on a ... | <p>You can go into IIS 6 and the properties for your website's folder you want to protect. Click directory security tab and uncheck allow anonymous. Then you need to choose an authntication type. If its over SSL you can use basic, otherwise use another type. But since you mention basic, this may suffice regardless. Kee... | <p>I believe you're looking for <a href="http://www.iistools.com/en/iispassword.html" rel="nofollow noreferrer">IISPassword from Parker Software</a>.</p>
| 18,196 |
<p>I need to know when the memory will be allocated for a particular program. How can i view where the memory is allocated.</p>
| <p>You'll need to be more specific with the OS, and perhaps language if it's interpreted or run time compiled (ie, PHP, JAVA, .NET, etc).</p>
<p>However, in general:</p>
<ul>
<li>Static and global variables are allocated when the program is loaded into memory.</li>
<li>Local variables are allocated on the stack (some... | <p>Install <a href="http://live.sysinternals.com/procexp.exe" rel="nofollow noreferrer">Process Explorer</a>, locate your application/process in the list, right click, Properties, Performance tab.</p>
| 17,754 |
<p>Our company has a policy imposing the requirement of keeping source code in a SourceSafe repository. I've tried hard to persuade the management to migrate to SVN with no success (whcih is an another issue, anyway). </p>
<p>As I and few of my colleagues use SVN repository placed on my computer (via Apache), I made a... | <p>I'm not sure there is a <strong>good</strong> way, but one way would be to use <a href="http://svnbook.red-bean.com/en/1.5/svn.reposadmin.create.html#svn.reposadmin.create.hooks" rel="nofollow noreferrer" title="SVN server hooks">SVN Server Hooks</a> to perform similar actions in Source Safe using the VSS command-li... | <p>Poor you, I feel your pain.</p>
<p>How about a nightly export of your code zipped up and stored in VSS? Most tools are for moving the other way so if you want this automated you will have to write something yourself.</p>
| 12,778 |
<p>How can I do for inserting a Default Value into a column of a table in Access?
I use this instruction:</p>
<pre><code>ALTER TABLE Tabella ADD Campo Double DEFAULT 0
ALTER TABLE Tabella ADD Campo Double DEFAULT (0)
ALTER TABLE Tabella ADD Campo DEFAULT 0
ALTER TABLE Tabella ADD Campo DEFAULT (0)
ALTER TABLE Tabella ... | <p>From <a href="http://msdn.microsoft.com/en-us/library/bb243857.aspx" rel="nofollow noreferrer">MSDN</a>:</p>
<blockquote>
<p>The DEFAULT statement can be executed
only through the Access OLE DB
provider and ADO. It will return an
error message if used through the
Access SQL View user interface.</p>
</bloc... | <p>You do not <em>insert</em> a new default value, you need to <em>alter</em> the existing one.</p>
<p>First switch Access to a sane SQL flavour, as in the answer linked above, then you can say:</p>
<pre><code>alter table Tabella alter column Campo Double DEFAULT 0
</code></pre>
| 45,973 |
<p>I need to convert several million dates stored as wide strings into boost dates</p>
<p>The following code works. However, it generates a horrible compiler warning and does not seem efficient.</p>
<p>Is there a better way?</p>
<pre><code>#include "boost/date_time/gregorian/gregorian.hpp"
using namespace boost::gr... | <p>efotinis found a good way using <strong>from_stream</strong> . </p>
<hr>
<p>I've looked into the manual of <code>date_time</code> and found it supports facets:</p>
<pre><code>#include <boost/date_time/gregorian/gregorian.hpp>
#include <iostream>
#include <sstream>
#include <locale>
int ma... | <p>You can use the <strong>from_stream</strong> parser function:</p>
<pre><code>using boost::gregorian::date;
using boost::gregorian::from_stream;
std::wstring ws( L"2008/01/01" );
date d1(from_stream(ws.begin(), ws.end()));
std::cout << d1; // prints "2008-Jan-01"
</code></pre>
| 42,471 |
<pre><code>class AbstractQuery {
virtual bool isCanBeExecuted()=0;
public:
AbstractQuery() {}
virtual bool Execute()=0;
};
class DropTableQuery: public AbstractQuery {
vector< std::pair< string, string> > QueryContent;
QueryValidate qv;
public:
explicit DropTableQuery(const string&a... | <p>No, in fact for it is unnecessary for the base class to have an explicitly defined constructor (though make sure you have a virtual destructor).</p>
<p>So for a typical interface you could have something like this:</p>
<pre><code>class MyInterface {
public:
virtual ~MyInterface() {}
virtual void execute() ... | <p>If the base class's constructor does not need any parameters, you do not need to call it in the derived class since it is called as a default constructor. However you need to provide a virtual destructor for your base class even if it is empty. Otherwise compiler will generate a default destructor which is non-virtu... | 34,013 |
<p>When is it a good idea to use factory methods within an object instead of a Factory class?</p>
| <p>I like thinking about design pattens in terms of my classes being 'people,' and the patterns are the ways that the people talk to each other.</p>
<p>So, to me the factory pattern is like a hiring agency. You've got someone that will need a variable number of workers. This person may know some info they need in th... | <p><a href="https://i.stack.imgur.com/wAQvR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wAQvR.png" alt="enter image description here" /></a>
Imagine you have a different customers with different preferences. Someone need Volkswagen another one Audi and so on. One thing is common - it's a car.</p>... | 9,525 |
<p>In an effort to satisfy "The Joel Test" question #2 "Can you make a build in one step?", I'm trying to complete a release candidate build script with the creation of a CD iso from the collection of files gathered and generated by the installer creator.</p>
<p>There seem to be many good tools (many free) out there t... | <p>Try mkisofs. It's part of the <a href="http://freshmeat.net/projects/cdrecord/" rel="noreferrer">cdrecord</a> project.</p>
| <p>I've used magiciso, but haven't tested it extensivly. (I may try some of the others mentioned here after some testing) I first make an installer (single file) then just make this an iso.</p>
<p><a href="http://www.magiciso.com/" rel="nofollow noreferrer">http://www.magiciso.com/</a></p>
<p>Here's the result of my... | 27,567 |
<p>I'd like to encourage our users of our RCP application to send the problem details to our support department. To this end, I've added a "Contact support" widget to our standard error dialogue.</p>
<p>I've managed to use URI headers to send a stacktrace using Java 6's JDIC call: <a href="http://java.sun.com/javase/6... | <p>You could save a temporary .eml file, and Desktop.getDesktop().open(emlFile)<br>
<strong>Edit:</strong> As you point out, this will unfortunately open outlook express instead of outlook.<br>
However if you have Windows Live Mail installed, it will use that.</p>
| <p>Using that method, you can set the subject line and body text with a URI like</p>
<pre><code>mailto:me@here.com?SUBJECT=Support mail&BODY=This is a support mail
</code></pre>
<p>However, the length of the subject and body text will <a href="http://forums.java.net/jive/thread.jspa?messageID=204302&tstart=0"... | 10,756 |
<p>I've been unsuccessful in getting Emacs to switch from 8 space tabs to 4 space tabs when pressing the <kbd>TAB</kbd> in buffers with the major mode <code>text-mode</code>. I've added the following to my <code>.emacs</code>:</p>
<pre><code>(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
;;; And I hav... | <h2>Short answer:</h2>
<p>The key point is to tell emacs to insert whatever you want when indenting, this is done by changing the indent-line-function. It is easier to change it to insert a tab and then change tabs into 4 spaces than change it to insert 4 spaces. The following configuration will solve your problem:</p... | <p>Have you tried</p>
<pre><code>(setq tab-width 4)
</code></pre>
| 9,538 |
<p>I need to implement an in-memory tuple-of-strings matching feature in C. There will be large list of tuples associated with different actions and a high volume of events to be matched against the list.</p>
<p>List of tuples:</p>
<pre><code>("one", "four")
("one")
("three")
("four", "five")
("six")
</code></pr... | <p>If you only have a small number of possible tuple values it would make sense to write some sort of hashing function which could turn them into integer indexes for quick searching.</p>
<p>If there are < 32 values you could do something with bitmasks:</p>
<pre><code>unsigned int hash(char *value){...}
typedef st... | <p>If you have a smallish number of possible strings, you can assign an index to each and use bitmaps. That way a simple bitwise and will tell you if there's overlap.</p>
<p>If that's not practical, your inverted index setup is probably going to be hard to match for speed, especially if you only have to build it once.... | 12,957 |
<p>When printing the first layer, the infill overlaps on just one side of my print. Thereupon there's a rough, and a lot higher, surface on the first few millimeters after the wall. </p>
<ul>
<li>Printer: Arduino Materia 101</li>
<li>Filament: Rec Pla</li>
<li>Temp: 210 degrees</li>
</ul>
<p>I have tried to troublesh... | <p>This may be a result of an unlevel build plate (OP did not specify if calibration was done at time of writing).</p>
<p>If the area that is overlapping is higher (closer to the nozzle), the filament will be pushed down and around the nozzle as it extrudes in that area. This will result in excess filament overlapping... | <p>Yes. That happens. I personally prefer this to the alternative which is it does not go far enough and curls back. That said depending on your slicer you will have a line overlap tolerance. But what's really happening is you are smooching your first layer. Aka your hot end is too high in relation to your first layer ... | 457 |
<p>I have several input and option elements on my page, each (well almost) have an event attached to update some text on the page once they change. I use jQuery which is really really cool :) </p>
<p>I also use Microsofts <a href="http://en.wikipedia.org/wiki/Ajax_%28programming%29" rel="noreferrer">Ajax</a> framework... | <p>Since you're using ASP.NET AJAX, you'll have access to a <code>pageLoad</code> event handler, that gets called each time the page posts back, be it full or partial from an UpdatePanel. You just need to put the function in to your page, no hooking up is required.</p>
<pre><code>function pageLoad(sender, args)
{
i... | <p>
</p>
<pre><code> <script type="text/javascript">
function pageLoad() {
if (Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack()) {
}
</script>
</ContentTemplate>
</asp:UpdatePanel>
</code... | 38,679 |
<p>What's the best way to call a generic method when the type parameter isn't known at compile time, but instead is obtained dynamically at runtime?</p>
<p>Consider the following sample code - inside the <code>Example()</code> method, what's the most concise way to invoke <code>GenericMethod<T>()</code> using th... | <p>You need to use reflection to get the method to start with, then "construct" it by supplying type arguments with <a href="http://msdn.microsoft.com/en-us/library/system.reflection.methodinfo.makegenericmethod.aspx" rel="noreferrer">MakeGenericMethod</a>:</p>
<pre><code>MethodInfo method = typeof(Sample).GetMethod(n... | <p>Inspired by <a href="https://stackoverflow.com/a/3958029/1016343">Enigmativity's answer</a> - let's assume you have two (or more) classes, like</p>
<pre><code>public class Bar { }
public class Square { }
</code></pre>
<p>and you want to call the method <code>Foo<T></code> with <code>Bar</code> and <code>Squa... | 28,776 |
<p>Anyone knows of a good error log beautifier? (should be able to handle apache error logs). </p>
<p>Should be open source / free, preferably with a web interface</p>
| <p>I use <a href="http://www.librelogiciel.com/software/ScanErrLog/action_Presentation" rel="nofollow noreferrer">http://www.librelogiciel.com/software/ScanErrLog/action_Presentation</a> It runs through the error log producing a summary webpage, or some other formats. While it's best run from a regular cron-job (and i... | <p><a href="http://logging.apache.org/chainsaw/index.html" rel="nofollow noreferrer">Apache Chainsaw</a></p>
| 19,951 |
<p>What my users will do is select a PDF document on their machine, upload it to my website, where I will convert into an HTML document for display on the website. The document will be stored in a database after conversion.</p>
<p>What's the best way to convert a PDF to HTML?</p>
<p>I have been handed a requirement ... | <p>Any document creation software that can save documents as PDF can save them as HTML. I'm assuming the issue is that your users will be creating rich documents (lots of embedded images), which results in multiple files, and your requirements stem from a desire to make uploading these documents as simple as possible ... | <p>You should look into DynamicPDF. They have a converter (currently Beta) out for serving exactly this purpose. We have used their products with great success (especially for dumping Reporting Services reports directly to PDF).</p>
<p>Ref: <a href="http://www.dynamicpdf.com/" rel="nofollow noreferrer">http://www.d... | 35,073 |
<p>Is there any visible progress? Is it now just an academic exercise? Do you believe Perl will continue to evolve with or without Perl 6 or will soon be forgotten?</p>
| <p>At the risk of sounding like a Perl fanboy, I'm still excited about Perl 6 and feel like the end result will be relevant when it's released. The last nine months have yielded some nice accomplishments on the Parrot front () and have even resulted in some <a href="http://news.perlfoundation.org/2008/05/tpf_receives_... | <p>It'll be out by Christmas. ;-) I've heard on podcasts that there there will be some kind of alpha before this Christmas. They were explicit about that but it has been a while since I heard that.</p>
| 9,181 |
<p>I have a basic understanding of mock and fake objects, but I'm not sure I have a feeling about when/where to use mocking - especially as it would apply to this scenario <a href="https://stackoverflow.com/questions/37375/how-do-i-unit-test-a-wcf-service"><strong>here</strong></a>.</p>
| <p>A unit test should test a single codepath through a single method. When the execution of a method passes outside of that method, into another object, and back again, you have a dependency.</p>
<p>When you test that code path with the actual dependency, you are not unit testing; you are integration testing. While t... | <p>You should mock an object when you have a dependency in a unit of code you are trying to test that needs to be "just so". </p>
<p>For example, when you are trying to test some logic in your unit of code but you need to get something from another object and what is returned from this dependency might affect what yo... | 5,907 |
<p>When using a Random Number Generator, which is the better way to use it for greater randomness of the new value:</p>
<ol>
<li><p>Have a method that instantiates a new instance of the RNG each time and then returns a value?</p></li>
<li><p>Have an instance of the RNG at the class level, which is instantiated once in... | <p>Option 1 does not work, actually.</p>
<p>Option 2 is the only choice. RNG's absolutely require that you generate the values in sequence from a single seed.</p>
<p>Your "create a new generator with a new seed" breaks the mathematical foundation. What you get then totally depends on your seeds, which -- sadly -- w... | <p>I suggest option 3: have a single RNG used throughout the program. It requires locking or a thread-local if the RNG isn't thread-safe (e.g. in .NET), but it makes life a lot simpler and you don't need to worry about repetition.</p>
<p>See <a href="http://pobox.com/~skeet/csharp/miscutil/usage/staticrandom.html" rel... | 40,947 |
<p>I've been parsing through some log files and I've found that some of the lines are too long to display on one line so Terminal.app kindly wraps them onto the next line. However, I've been looking for a way to truncate a line after a certain number of characters so that Terminal doesn't wrap, making it much easier to... | <p>Pipe output to:</p>
<pre><code>cut -b 1-LIMIT
</code></pre>
<p>Where LIMIT is the desired line width.</p>
| <p>The usual way to do this would be</p>
<pre><code>perl -wlne'print substr($_,0,80)'
</code></pre>
<p>Golfed (for 5.10):</p>
<pre><code>perl -nE'say/(.{0,80})/'
</code></pre>
<p>(Don't think of it as programming, think of it as using a command line tool with a huge number of options.) (Yes, the <a href="http://ww... | 16,607 |
<p>So I feel I pretty well understand the application layer, and everything below (and including) the transport layer.</p>
<p>The session and presentation layers, though, I don't fully understand. I've read the simplistic descriptions in Wikipedia, but it doesn't have an example of why separating out those layers is ... | <p>The session layer is meant to store states between two connections, like what we use cookies for when working with web programming.</p>
<p>The presentation layer is meant to convert between different formats. This was simpler when the only format that was worried about was character encoding, ie ASCII and EBCDIC. W... | <p>For the presentation layer :because most of communication done between heterogeneous systems (Operating Systems,programing langages,cpu architectures)we need to use a unified idepedent specification .like ANS1 ans BRE.</p>
| 18,446 |
<p>A sample perl script that connects to an oracle database, does a simple SELECT query, and spits the results to stdout in CSV format would be great. Python or any other language available in a typical unix distribution would be fine too. </p>
<p>Note that I'm starting from scratch with nothing but a username/passw... | <p>In perl you could do something like this, leaving out all the my local variable declarations and ... or die "failmessage" error handling for brevity.</p>
<pre><code>use DBI;
use DBD::Oracle;
$dbh = DBI->connect( "dbi:Oracle:host=127.0.0.1;sid=XE", "username", "password" );
# some settings that you usually wan... | <p>Mathematica has a package "DatabaseLink" built in that should make this easy but you need to find a driver for Oracle. Installing the "oracle client libraries" should do that...</p>
| 9,116 |
<p>When I am in a list and I press a letter to jump to the first entry that starts with that letter why does it leave that entry on the bottom of the visible entries? It should make the entry the top visable entry so that many entries that start with that letter can be seen.</p>
<p>In more concrete terms if I am selec... | <p>I agree. Especially if you have to continue hitting that letter to get to the next option.</p>
| <p>I think that it may be just the default way Windows handles changing the selected index of the default combo box control. It'll scroll down only as much as it needs to show the selected item, it doesn't care about what comes before or after.</p>
| 12,443 |
<p>If I was to create a ipfw divert rule to forward all FTP traffic to a specific socket, is it possible to use Java to connect to the socekt and read the packet information? If so, how would i go about reading/writing to the scoket?</p>
| <p>Take a look at trueSpace also, its just become free - but as Evil Activity stated; Blender is also a good sugestion i just never really got use to its interface and how to do stuff. trueSpace is a little more easy in that way, but i think that blender is more powerful.</p>
<p>I guess you know <a href="http://creato... | <p>Having worked a modeler and texture artist for over 3 years, I have tried the majority of modeling tools and keep coming back to <a href="http://www.nevercenter.com/" rel="nofollow noreferrer">Nevercenter's Silo</a>. It's the most elegant, well designed sub-d polygonal modeling application I have ever had the pleasu... | 13,612 |
<p>I would like to determine the operating system of the host that my Java program is running programmatically (for example: I would like to be able to load different properties based on whether I am on a Windows or Unix platform). What is the safest way to do this with 100% reliability?</p>
| <p>You can use:</p>
<pre><code>System.getProperty("os.name")
</code></pre>
<p>P.S. You may find this code useful:</p>
<pre><code>class ShowProperties {
public static void main(String[] args) {
System.getProperties().list(System.out);
}
}
</code></pre>
<p>All it does is print out all the properties p... | <p>Just use <code>com.sun.javafx.util.Utils</code> as below.</p>
<pre><code>if ( Utils.isWindows()){
// LOGIC HERE
}
</code></pre>
<p><strong>OR USE</strong> </p>
<pre><code>boolean isWindows = OSInfo.getOSType().equals(OSInfo.OSType.WINDOWS);
if (isWindows){
// YOUR LOGIC HERE
}
</code><... | 28,272 |
<p>In a C# Windows.Forms project I have a control that does not supply the KeyPressed event (It’s a COM control – ESRI map). </p>
<p>It only supplies the KeyUp and KeyDown events, containing the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.keyeventargs.aspx" rel="noreferrer">KeyEventArgs</a> s... | <p>The trick is to use a set of user32.dll functions: <a href="http://msdn.microsoft.com/en-us/library/ms633522(VS.85).aspx" rel="noreferrer">GetWindowThreadProcessId</a>, <a href="http://msdn.microsoft.com/en-us/library/ms646296.aspx" rel="noreferrer">GetKeyboardLayout</a>, <a href="http://msdn.microsoft.com/en-us/lib... | <p>Look at <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.keysconverter.aspx" rel="nofollow noreferrer">KeysConverter</a> and its ConvertToString method. Remember that not all KeyDown map to a KeyPress.</p>
| 48,441 |
<p>I've been trying to see if I can accomplish some requirements with a document based database, in this case CouchDB. Two generic requirements: </p>
<ul>
<li>CRUD of entities with some fields which have unique index on it </li>
<li>ecommerce web app like eBay (<a href="https://stackoverflow.com/questions/299723/ca... | <p>You need to think of how you approach the application in a document oriented way. If you simply try to replicate how you would model the problem in an RDBMS then you will fail. There are also different trade-offs that you might want to make. ([ed: not sure how this ties into the argument but:] Remember that Couch... | <p>Document based DBs are best suiting for storing, well, documents. Lotus Notes is a common implementation and Notes email is an example. For what you are describing, eCommerce, CRUD, etc., realtional DBs are better designed for storage and retrieval of data items/elements that are indexed (as opposed to documents).</... | 43,773 |
<p>I have a table that is created in a DataList in ASP.Net. This table has three fields of text, then a field with an edit button, and a field with a delete button. When a person clicks the delete button, it posts back, deletes the items, and then binds the DataList again. The DataList is in an UpdatePanel so the item ... | <p>You can use <a href="http://www.singingeels.com/Articles/Using_Page_Methods_in_ASPNET_AJAX.aspx" rel="nofollow noreferrer">page methods</a> in asp.net to send a request to the server without doing a postback. They are very simple to use and you can do whatever effect you like when the ajax call is completed (you get... | <p>have you tried looking at any of the Ajax control toolkit items? I believe there are some controls in there that will head with client side (java) code if your not extremely familiar</p>
| 22,145 |
<p>Looking in the gnuwin32/bin directory, there is an odd-looking program file named <code>[.exe</code></p>
<p>I couldn't find it in the documentation, gnuwin32.sourceforge.net or in a google search, so I ran it and got:</p>
<pre><code>$ [
[: missing `]'
$
</code></pre>
<p>so I gave it ] as a parameter and got</p>
... | <p>It's used to evaluate <em>conditional</em> expressions.<br>
It is equivalent to (possibly a symlink to?) the <code>test</code> executable.<br>
The manpage is <a href="http://www.ss64.com/bash/test.html" rel="noreferrer">here</a>. </p>
<p>You may see this in a lot of bash scripts:</p>
<pre><code>if [ "$LOGNAME" = "... | <p>Another answer already mentioned it is the same as <code>test</code>. On bash, it is also a builtin, so you can get the help for it with the <code>help</code> builtin (<code>help test</code>).</p>
| 38,515 |
<p>Is there a way to track changes in Windows registry? I'd like to see what changes in the registry are made during installation of various programs. </p>
| <p><a href="http://technet.microsoft.com/en-us/sysinternals/bb896645" rel="noreferrer">Process Monitor</a> allows you to monitor file and registry activity of various processes.</p>
| <p>I concur with Franci, all Sysinternals utilities are worth taking a look (Autoruns is a must too), and Process Monitor, which replaces the good old Filemon and Regmon is precious.</p>
<p>Beside the usage you want, it is very useful to see why a process fails (like trying to access a file or a registry key that does... | 17,424 |
<p>I have barcode images in jpg format and want to extract barcode # from those. Please help!</p>
| <p>we've developed a c# component that reads values from barcodes of all dimension, rotation, quality etc. it's not yet release but we will release detailed information about it at <a href="http://blog.lemqi.com" rel="noreferrer">http://blog.lemqi.com</a> . it will be probably free (maybe open source). but maybe it's s... | <p>I use the softek barcode toolkit - <a href="http://www.bardecode.com/" rel="nofollow noreferrer">http://www.bardecode.com/</a></p>
<p>Works very well - $249 for single developer.</p>
| 24,956 |
<p>We have a 50 projects solution in VS 2005. </p>
<p>Is any way to get incremental build if nothing was changed? </p>
<p>It is kind of doing it now, but it executes all prebuild and post build events for each project. </p>
<p>Is any way to prevent it?</p>
| <p>Have a look at the <strong>Build Events</strong> tab. Notice the dropdown at the bottom that says <strong>Run the post-build event:</strong>. Does it say "On successful build"? Try changing it to "When the build updates the project output".</p>
| <p>Visual studio does what you describe by default, custom build steps are not executed for up to date projects.</p>
<p>Something in your dependancies or build settings are causing it to update all builds. Unfortunately it's hard to track down without additional infromation.</p>
| 28,217 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.