instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>I have a number of native C++ libraries (Win32, without MFC) compiling under Visual Studio 2005, and used in a number of solutions. </p> <p>I'd like to be able to choose to compile and link them as either static libraries or DLLs, depending on the needs of the particular solution in which I'm using them.</p> <p>W...
<p>I may have missed something, but why can't you define the DLL project with no files, and just have it link the lib created by the other project? And, with respect to settings, you can factor them out in vsprop files...</p>
<p>Why not go for version 1 and generate the second set of project files from the first using a script or something. That way you know that the differences are JUST the pieces required to build a dll or static lib.</p>
49,256
<p>I know that python has a <code>len()</code> function that is used to determine the size of a string, but I was wondering why it's not a method of the string object?</p>
<p>Strings do have a length method: <code>__len__()</code></p> <p>The protocol in Python is to implement this method on objects which have a length and use the built-in <a href="http://www.python.org/doc/2.5.2/lib/built-in-funcs.html#l2h-45" rel="noreferrer"><code>len()</code></a> function, which calls it for you, sim...
<p>It doesn't?</p> <pre><code>&gt;&gt;&gt; "abc".__len__() 3 </code></pre>
29,344
<p>I've recently been looking into targeting the .NET Client Profile for a WPF application I am building. However, I was frustrated to notice that the Client Profile is only valid for the following OS configurations: </p> <ul> <li>Windows XP SP2+</li> <li><strike>Windows Server 2003</strike> <strong>Edit:</strong> <a ...
<p>Ultimately, it will not hurt any users if you target the Client Profile. This is because the client profile is a subset of the .net framework v3.5 sp1, and if v3.5 sp1 is already installed you don't need to install anything. </p> <p>The assemblies in the client profile are the same binaries as the full framework, s...
<blockquote> <p>I believe that once the .NET Framework has been installed, extra information is passed to a web server as part of a web request signifying that the framework is available.</p> </blockquote> <p>On IE, yes. It sends the .NET Framework version as part of the UA string, e.g.:</p> <pre><code>Mozilla/4.0 ...
3,648
<p>Was considering the <code>System.Collections.ObjectModel ObservableCollection&lt;T&gt;</code> class. This one is strange because </p> <ul> <li>it has an Add Method which takes <strong>one</strong> item only. No AddRange or equivalent. </li> <li>the Notification event arguments has a NewItems property, which is a <...
<p>It seems that the <code>INotifyCollectionChanged</code> interface allows for updating when multiple items were added, so I'm not sure why <code>ObservableCollection&lt;T&gt;</code> doesn't have an <code>AddRange</code>. You could make an extension method for <code>AddRange</code>, but that would cause an event for ...
<p>Take a look at <a href="https://stackoverflow.com/questions/670577/observablecollection-doesnt-support-addrange-method-so-i-get-notified-for-each/670579#670579">Observable collection with AddRange, RemoveRange and Replace range methods</a> in both C# and VB.</p> <p>In VB: INotifyCollectionChanging implementation.</...
8,123
<p>If you think it shouldn't, explain why.</p> <p>If yes, how deep should the guidelines be in your opinion? For example, indentation of code should be included?</p>
<p>I think a <em>team</em> (rather than a <em>company</em>) need to agree on a set of guidelines for reasonably consistent style. It makes it more straightforward for maintenance. </p> <p>How deep? As shallow as you can agree on. The shorter and clearer it is the more likely it is that all the team members can agree ...
<p>Yes, I think companies should. Developer may need to get used to the coding-style but in my opinion a good programmer should be able to work with any coding style. As Midhat said: It is important to have a consistent codebase.</p> <p>I think this is also important for opensource projects, there is no supervisor to ...
17,543
<p>The <code>Open</code> button on the open file dialog used in certain windows applications includes a dropdown arrow with a list of additional options &mdash; namely <code>Open With..</code>. </p> <p><a href="https://i.stack.imgur.com/GLM3T.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GLM3T.pn...
<p>I used the draggable search in Spy++ (installed with VS) to look at the split open button on the file-open dialog of VS.</p> <p>This revealed that it's an ordinary windows button with a style which includes BS_DEFSPLITBUTTON. That's a magic keyword which gets you to some interesting places, including</p> <p><a h...
<p>Since I found the control in Windows itself, I was hoping to find it built-in somewhere already so I didn't have to add anything to my code-base to use it. But the split button at <a href="http://blogs.msdn.com/jfoscoding/articles/491523.aspx" rel="nofollow noreferrer">this link</a> (found via the msdn suggestion) ...
5,098
<p>I'm trying to write a (sh -bourne shell) script that processes lines as they are written to a file. I'm attempting to do this by feeding the output of <code>tail -f</code> into a <code>while read</code> loop. This tactic seems to be proper based on my research in Google as well as <a href="https://stackoverflow.com/...
<p>If you want to break out, when your file does not exist any more, just do it:</p> <pre><code> test -f file || break </code></pre> <p>Placing this in your loop, should break out. </p> <p>The remaining problem is, how to break the read line, as this is blocking.</p> <p>This could you do by applying a timeout, like...
<p>I don't know about HP-UX <code>tail</code> but GNU <code>tail</code> has the <code>--follow=name</code> option which will follow the file by name (by re-opening the file every few seconds instead of reading from the same file descriptor which will not detect if the file is unlinked) and will exit when the filename u...
44,098
<p>My team is responsible for the development of an API for a large system that we also write. We need to provide example code so that other developers using our API can learn how to use it. We have been documenting the code using the xml document comments. eg.</p> <pre><code>/// &lt;summary&gt;Summary here&lt;/summar...
<p>Yes, sandcastle supports this and it's great to maintain the correctness of examples. You can point to a code region like this:</p> <pre><code> /// &lt;summary&gt; /// Gizmo which can act as client or server. /// &lt;/summary&gt; /// &lt;example&gt; /// The following example shows how to use the gizmo...
<p><strong>Simple solution:</strong> Make a small application in which you include all the sample code headers and then call their respective entry points</p> <pre><code>#include "samples/sampleA.h" void main() { SomeFunction(); } </code></pre> <p>then after you make a build run these little apps you need to be su...
38,655
<p>Suppose I have a collection (be it an array, generic List, or whatever is the <strong>fastest</strong> solution to this problem) of a certain class, let's call it <code>ClassFoo</code>:</p> <pre><code>class ClassFoo { public string word; public float score; //... etc ... } </code></pre> <p>Assume ther...
<p>With the constraint that the condition clause can be "anything", then you're limited to scanning the entire list and applying the condition.</p> <p>If there are limitations on the condition clause, then you can look at organizing the data to more efficiently handle the queries.</p> <p>For example, the code sample ...
<p>Not sure I understand... All you can really do is optimize the rule, that's the part that needs to be fastest. You can't speed up the loop without just throwing more hardware at it. </p> <p>You could parallelize if you have multiple cores or machines.</p>
12,280
<p>I am a totally blind programmer who would like to learn Python. Unfortunately the fact that code blocks are represented with different levels of indentation is a major stumbling block. I was wondering if there were any tools available that would allow me to write code using braces or some other code block delimiter ...
<p>There's a solution to your problem that is distributed with python itself. <code>pindent.py</code>, it's located in the Tools\Scripts directory in a windows install (my path to it is C:\Python25\Tools\Scripts), it looks like you'd have to <a href="https://svn.python.org/projects/python/trunk/Tools/scripts/pindent.py...
<p>There are various answers explaining how to do this. But I would recommend not taking this route. While you could use a script to do the conversion, it would make it hard to work on a team project.</p> <p>My recommendation would be to configure your screen reader to announce the tabs. This isn't as annoying as it ...
14,445
<p>What files do I need to put the header comment in for adding GPL to a C# project? </p> <p>Does form generated code require it?</p> <p>Does just need to be in every *.cs file?</p> <p>Is there a resource or in-depth list of language-specific steps required to add GPL to any kind of project?</p>
<p>The canonical answer is in the <a href="http://www.gnu.org/licenses/gpl-howto.html" rel="noreferrer">GPL Howto</a>:</p> <blockquote> <p>Whichever license you plan to use, the process involves adding two elements to each source file of your program: a copyright notice (such as “Copyright 1999 Terry Jones”)...
<p>Please notice that the FSF postal address is not 59 Temple Place, but the one below.</p> <blockquote> <p>Free Software Foundation, Inc.<br> 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA</p> </blockquote> <p>The only way not to screw up the license text is to take it from GNU web site. Notice tha...
18,481
<p>First off, how do I know if my html file is running on localhost in Xampp? Is there a tutorial on how to manage files/directories and get that all working under htdocs? Is there a good tutorial on how to setup includes?</p> <p>I want to use "includes" in Xampp with my html. Can I use both html includes AND php incl...
<p>Since <strong>XAMPP</strong> uses <strong>Apache</strong> you need to configure it to permit <strong>SSI</strong>.</p> <blockquote> <p>To permit SSI on your server, you must have the following directive either in your httpd.conf file, or in a .htaccess file:</p> <pre><code>Options +Includes </code></pre> <p...
<p>You might want to look at AMPstart instead of xampp-control. It has some nice ability to allow you to place site-folders outside of htdocs w/o messing around with apache conf stuff</p>
40,300
<p>I am using iText to generate PDF invoices for a J2EE web application and included on the page is an image read from a URL constructed from the request URL. In the development and test environments this works fine, but in production I get a java.io.IOException: is not a recognized imageformat.</p> <p>If I paste the...
<p>Well,</p> <p>If you ask for an image from a URL, it must actually point to the image. If the URL points to a web page that then redirects to another URL (or the return code from the URL is a redirection), then it is going to fail.</p> <p>This is essentially due to the getInstance() method understanding how to use ...
<p>Is there a reason you have to get this using the URL?? Do you have to match the image that the url is pointing to? What if it changes or gets removed?</p> <p>I am not sure of your requirement, but it may be easier to save the image from the url and place it somewhere within your project. Then you can add it to y...
39,266
<p>This is for a small scheduling app. I need an algorithm to efficiently compare two "schedules", find differences, and update only the data rows which have been changed, as well as entries in another table having this table as a foreign key. This is a big question, so I'll say right away I'm looking for either <str...
<p>I have worked extensively with periods, but I'm afraid I don't understand entirely how table A and B work together, perhaps it's the word <em>subsume</em> that I don't understand.</p> <p>Can you give some concrete examples of what you want done?</p> <p>Do you mean that timespans recorded in table A contains entire...
<p>You post is almost in the "too long; didnt read" category - shortening it will probably give you more feedback.</p> <p>Anyway, on topic: you can try lookin into a thing called <a href="http://en.wikipedia.org/wiki/Allen&#39;s_Interval_Algebra" rel="nofollow noreferrer">"Interval Algebra"</a></p>
20,766
<p>If you could help me with ANY part of this question, I would appreciate it. Thanks.</p> <pre><code>2^0 = 1 2^N = 2^(N-1) + 2^(N-1) </code></pre> <ol> <li><p>Convert this definition into an exactly equivalent tree-recursive function called two-to-the-power-of. Describe its asymptotic time complexity and explain why...
<p>The hues of magenta, yellow, and cyan are primary for subtractive combination (e.g. paints or inks) rather than additive combination such as light where red, green, and blue are primary.</p> <p><a href="http://en.wikipedia.org/wiki/Primary_colors" rel="noreferrer">Wikipedia has more detail on the whys and wherefore...
<p>Because combining light sources (which computer monitors do) does not work the same way as combining printed ink. It's just a guess.</p>
28,266
<p>I need to add DVD writing functionality to an application I'm working on. However it needs to be able to write out files that are being grabbed "live" from a camera, over a long period of time. I can't wait until all the files are captured before I start writing them to the DVD, I need to write them out in chunks as...
<p>The <a href="http://www.primoburner.com/" rel="nofollow noreferrer">Primo burning engine</a> for .Net works nicely. </p>
<p>Format your optical media to a <a href="http://en.wikipedia.org/wiki/Live_File_System" rel="nofollow">Live File System</a> (<a href="http://en.wikipedia.org/wiki/Packet_writing" rel="nofollow">Incremental Packet Writing</a> instead of using a mastered disc format with IMAPIv2) and then you will be able to add any fi...
8,322
<p>I have a legacy VB6 application that was built using MSDE.</p> <p>As many client's database grow towards the MSDE 2 GB limit they are upgraded to SQL 2005 Express.</p> <p>This has proven very successful until today.</p> <p>I have spent the entire day troubleshooting a client's network on which our application run...
<p>'define' operation itself is rather slow - confirmed by xdebug profiler.</p> <p>Here is benchmarks from <a href="http://t3.dotgnu.info/blog/php/my-first-php-extension.html" rel="noreferrer">http://t3.dotgnu.info/blog/php/my-first-php-extension.html</a>: </p> <ul> <li><p>pure 'define'<br> 380.785 fetches/sec<br> 1...
<p>Main differences:</p> <ul> <li>define is constant, variable is variable </li> <li>they different scope/visibility</li> </ul>
17,857
<p>Anybody know a nice way to restart a mongrel cluster via capistrano in a "rolling" style, eg, one mongrel at a time. Would be great to have a bit of wait time in there as well for each, to let the mongrel load the rails app up as well. </p> <p>I've done some searching, and haven't found too much, so looking for hel...
<p>I agree with the seesaw approach more than the rolling approach you are seeking. The problem is that you end up in situations where load balancing can throw users back and forth between different versions of the application while you are transitioning.</p> <p>The solutions we came up with (before finding SeeSaw, wh...
<p>Seesaw is a gem found in the <a href="http://rubyforge.org/projects/rails-oceania/" rel="nofollow noreferrer">Rails Oceania Rubyforge Project</a> that provides this kind of functionality to mongrel clusters. However, the project may be suffering from some bit-rot not havain had a release since 2007. Still worth a ...
15,114
<p>How does operating system know what filesystem a partition is using? In other words, how are FAT16/32, NTFS, ext2/3 etc. distinguished from each other?</p>
<p>If you're using Win32 APIs on Windows, then you can call GetVolumeInformation (<a href="http://msdn.microsoft.com/en-us/library/aa364993.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/aa364993.aspx</a>) to determine the type of file system present on a given mounted volume.</p> <p>For example, if yo...
<p>On linux when you mount a filesystem, you can pass -t ext3/ext3 etc - if you look in /etc/fstab (or equivalent) each drive probably has its fs type listed.</p> <p>Then for automatically doing it, there is the superblock/equivalent (think windows types call it something else) ...</p> <p>See this:</p> <p>Superblock...
49,858
<p>With the recent buzz on multicore programming is anyone exploring the possibilities of using <a href="http://www-unix.mcs.anl.gov/mpi/" rel="noreferrer">MPI</a> ?</p>
<p>I've used MPI extensively on large clusters with multi-core nodes. I'm not sure if it's the right thing for a single multi-core box, but if you anticipate that your code may one day scale larger than a single chip, you might consider implementing it in MPI. Right now, nothing scales larger than MPI. I'm not sure ...
<p>You have to decide if you want low level threading or high level threading. If you want low level then use pThread. You have to be careful that you don't introduce race conditions and make threading performance work against you.</p> <p>I have used some OSS packages for (C and C++) that are scalable and optimize t...
17,796
<p>I want to create a dmg file for my Mac project. Can someone please tell me how to do this? This being my first Mac project, I do not have any idea how to proceed. I also want to give the user an option of running the app on start-up. How do I do this?</p> <p>Thanks.</p> <p>P.S. I also want to add a custom license ...
<p>To do this manually:</p> <p><strong>Method 1:</strong></p> <ul> <li>Make a folder with the files your DMG will contain.</li> </ul> <p><a href="https://i.stack.imgur.com/sOBin.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sOBin.png" alt="enter image description here"></a></p> <ul> <li>Open Di...
<p>I made a little bash script to automate a disc image creation.</p> <p>It creates a temporary directory to store all needed files then export it in a new DMG file. Temporary directory is then deleted. You can automatically launch this script at the end of your build process.</p> <pre class="lang-sh prettyprint-over...
47,999
<p>I have an HTML page (say welcome.html) which contains an iframe to a page I have no control over (say app.html). The user performs some actions using the app within the iframe and clicks submit. Once they do this, they are taken to a new page (say thanks.jsp), which loads within the iframe. Is there a way in whic...
<p>You probably want to use a framebuster, with a base target in case it fails.</p> <p>First:</p> <p><strong>If</strong> <code>thanks.jsp</code> is requested via a post request - redirect so it you present the page as the response to a get request.</p> <p>Then:</p> <p>Include framebuster JavaScript:</p> <pre><code...
<p>On <code>thanks.jsp</code> you can put in the following JS:</p> <pre><code>// Parent window not the same as this one if (self !=top) { top.location.href = self.location.href; } </code></pre> <p>This will work provided that you have <code>thanks.jsp</code> on the same server as the original page containing th...
23,611
<p>I've not used C++ very much in the past, and have recently been doing a lot of C#, and I'm really struggling to get back into the basics of C++ again. This is particularly tricky as work mandates that none of the most handy C++ constructs can be used, so all strings must be char *'s, and there is no provision for ST...
<p>You'll probably need to use strcmp to see if the string is already stored:</p> <pre><code>for (int index=0; index&lt;=lastIndex; index++) { if (strcmp(registeredNames[index], name) == 0) { return; // Already registered } } </code></pre> <p>Then if you really need to store a copy of the string, then you'l...
<p>If you are not worried about conventions and just want to get the job done use realloc. I do this sort of thing for lists all of the time, it goes something like this:</p> <pre><code>T** list = 0; unsigned int length = 0; T* AddItem(T Item) { list = realloc(list, sizeof(T)*(length+1)); if(!list) return 0; list[...
11,714
<p>How come this doesn't work (operating on an empty select list <code>&lt;select id="requestTypes"&gt;&lt;/select&gt;</code></p> <pre><code>$(function() { $.getJSON("/RequestX/GetRequestTypes/", showRequestTypes); } ); function showRequestTypes(data, textStatus) { $.each(data, ...
<p><code>$("#requestTypes")</code> returns a jQuery object that contains all the selected elements. You are attempting to call the <code>add()</code> method of an individual element, but instead you are calling the <code>add()</code> method of the jQuery object, which does something very different.</p> <p>In order to...
<p>For stuff like this, I use <a href="http://www.texotela.co.uk/code/jquery/select/" rel="nofollow noreferrer" title="jQuery Select box plugin">texotela's select box plugin</a> with its simple ajaxAddOption function.</p>
12,026
<p>There are three assembly version attributes. What are differences? Is it ok if I use <code>AssemblyVersion</code> and ignore the rest?</p> <hr> <p>MSDN says:</p> <ul> <li><p><a href="https://learn.microsoft.com/en-us/dotnet/api/system.reflection.assemblyversionattribute" rel="noreferrer">AssemblyVersion</a>:</p> ...
<p><strong>AssemblyVersion</strong></p> <p>Where other assemblies that reference your assembly will look. If this number changes, other assemblies must update their references to your assembly! Only update this version if it breaks backward compatibility. The <code>AssemblyVersion</code> is required.</p> <p>I use the f...
<p>When a assembly' s AssemblyVersion is changed, If it has strong name, the referencing assemblies need to be recompiled, otherwise the assembly does not load! If it does not have strong name, if not explicitly added to project file, it will not be copied to output directory when build so you may miss depending assemb...
9,018
<p>I have a scenario in which I'm going to need an arbitrary number of servers to provide the same SOAP web service. I would like to generate one set of proxy classes and be able to supply them with a location to point them at the different servers at runtime. Unfortunately, it looks as though the <code>wsdl:port</code...
<p>No, in .NET you can change the URL at runtime.</p> <pre><code>Service svc = new Service (); svc.url = "Value read from config. file or some such" output = svc.method (input); </code></pre>
<p>When you add a web reference to your project, it places the address of the web service into the .config file of your application / web application. You can then simply change this setting in the config file to point to a different web service location, assuming of course that the services are identical.</p>
47,088
<p>"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil." (Donald Knuth). My SQL tables are unlikely to contain more than a few thousand rows each (and those are the big ones!). SQL Server Database Engine Tuning Advisor dismisses the amount of data as irr...
<p>The value of indexes is in speeding reads. For instance, if you are doing lots of SELECTs based on a range of dates in a date column, it makes sense to put an index on that column. And of course, generally you add indexes on any column you're going to be JOINing on with any significant frequency. The efficiency gain...
<p>I guess there is an auto indexing on the primary key of the table which should be sufficient when querying on a table with less data.</p> <p>So, yes explicit indexes can be avoided in case there is a small data set to be worked upon.</p>
31,507
<p>In writing the code that throws the exception I asked about <a href="https://stackoverflow.com/questions/259800/is-there-a-built-in-net-exception-that-indicates-an-illegal-object-state">here</a>, I came to the end of my message, and paused at the punctuation. I realized that nearly every exception message I've ever...
<p>A conversational tone in system messages makes the software look unprofessional and sloppy. Exclamation points, insults, and slang don't really have a place in polished exception messages.</p> <p>Also, I tend to use different styles in Java for runtime exceptions and checked exceptions, since runtime exceptions are...
<p>I tend to work my exception messages into the exception themselves. E.g. a file_not_found should say "file not found". Specific data should only be included if the user can't figure it out; in this case, the user knows the filename, so I don't add that data. Formatting can be done by whatever outputs the information...
32,476
<p>I am new to PHP and trying to get the following code to work:</p> <pre><code>&lt;?php include 'config.php'; include 'opendb.php'; $query = "SELECT name, subject, message FROM contact"; $result = mysql_query($query); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "Name :{$row['name']} &lt;br&gt;"...
<p><strong>Edit</strong></p> <p>You say that you're still getting an error. Did you remember to add a <strong>.</strong> when you removed that extra semi-colon?</p> <hr> <p>You have a semi-colon in the middle of your string, two lines after the echo.</p> <p><img src="https://farm4.static.flickr.com/3049/2989189590...
<p><strong>Edit:</strong> Your SQL query only returns 3 fields. But you try to access a lot more than that. Try "SELECT *" if you want to return all the fields of a table. Otherwise make sure you select the fields you try to read (probably not why you get an error though, just an observation).</p> <p>The syntax colo...
31,573
<p>I need to store of 100-200 data in mysql, the data which would be separated by pipes..</p> <p>any idea how to store it on mysql? should I use a single column or should I make many multiple columns? I don't know exactly how many data users will input. </p> <p>I made a form, it halted at the part where multiple data...
<p>You should implement your table with an ID for the source of the data. This ID will be used to group all those pieces of similar data so you don't need to know how many you have beforehand.</p> <p>Your table columns and data could be set up like this:</p> <pre><code>sourceID data -------- ---- ...
<p>If you have a form where this data is coming from, store each input from your form into it's own separate column.</p> <p>Look for relationships in your data: sounds like you have a "has many" relationship which indicates you may want a linking table where you could do a simple join query...</p> <p>Storing multiple...
37,338
<p>Is there a standard X / Gnome program that will display the X,Y width and depth in pixels of a window that I select? Something similar to the way an xterm shows you the width and depth of the window (in lines) as you resize it.</p> <p>I'm running on Red Hat Enterprise Linux 4.4.</p> <p>Thanks!</p>
<p>Yes, you're looking for the program 'xwininfo'. Run it in another terminal and then click on the window you want info about and it will give it to you. </p> <p>Hope this helps! </p>
<pre><code>$ xwininfo xwininfo: Please select the window about which you would like information by clicking the mouse in that window. xwininfo: Window id: 0x1200007 "xeyes" Absolute upper-left X: 1130 Absolute upper-left Y: 0 Relative upper-left X: 0 Relative upper-left Y: 0 Width:...
9,876
<p>I'm trying to solve this flickering problem on the iphone (open gl es game). I have a few images that don't have pow-of-2 dimensions. I'm going to replace them with images with appropriate dimensions... but why do the dimensions need to be powers of two?</p>
<p>The reason that most systems (even many modern graphics cards) demand power-of-2 textures is mipmapping. </p> <p><strong>What is mipmapping?</strong></p> <p>Smaller versions of the image will be created in order to make the thing look correctly at a very small size. The image is divided by 2 over and over to mak...
<p>Try implementing wrapping texture-mapping in software and you will quickly discover why power-of-2 sized are desirable.</p> <p>In short, you will find that if you can assume power-of-2 dimensions then a lot of integer multiplications and divisions turn into bit-shifts.</p> <p>I would hazard a guess that the recent...
26,378
<p>for the xml </p> <pre><code>&lt;grandparent&gt; &lt;parent1&gt; &lt;child&gt;data1&lt;/child&gt; &lt;/parent1&gt; &lt;parent2&gt; &lt;child&gt;data2&lt;/child&gt; &lt;/parent2&gt; &lt;/grandparent&gt; </code></pre> <p>I need the list containing tuples of parent,data for each parent in xml.</p> <...
<p>It seems you can get access to the parent from the child using version 1.3 of ElementTree (check <a href="http://effbot.org/zone/element-xpath.htm" rel="nofollow noreferrer">http://effbot.org/zone/element-xpath.htm</a>), by using xpath commands like <code>child.find('../parent')</code>. But I think python ships wit...
<p>This syntax seemed to work for cElementTree </p> <pre><code>ET.fromstring("&lt;c&gt;&lt;a&gt;&lt;b&gt;&lt;/b&gt;&lt;/a&gt;&lt;/c&gt;").find('.//b/..') </code></pre> <p>No going to base parent, and using double slash then single slash in path.<br> (would have posted as a comment to above thread but it seems I have...
48,942
<p>As someone who hasn't used either technology on real-world projects I wonder if anyone knows how these two complement each other and how much their functionalities overlap?</p>
<p>LINQ to SQL forces you to use the table-per-class pattern. The benefits of using this pattern are that it's quick and easy to implement and it takes very little effort to get your domain running based on an existing database structure. For simple applications, this is perfectly acceptable (and oftentimes even pref...
<p>Or you could use the Castle ActiveRecords project. I've been using that for a short time to ramp up some new code for a legacy project. It uses NHibernate and works on the active record pattern (surprising given its name I know). I haven't tried, but I assume that once you've used it, if you feel the need to drop...
4,661
<p>The located assembly's manifest definition does not match the assembly reference</p> <p>getting this when running nunit through ncover. Any idea?</p>
<p>This is a mismatch between assemblies: a DLL referenced from an assembly doesn't have a method signature that's expected.</p> <p>Clean the solution, rebuild everything, and try again. </p> <p>Also, be careful if this is a reference to something that's in the GAC; it could be that something somewhere is pointing to...
<p>If you got this error trying to add a component to Visual Studio,- <code>Microsoft.VisualStudio.TemplateWizardInterface</code> - (after trying to install weird development tools)</p> <p>consider this solution(courtesy of larocha (thanks, whoever you are)):</p> <ol> <li>Open C:\Program Files\Microsoft Visual Studio...
11,951
<p>SVN merging is very time consuming (especially on large code bases) and error prone. Eclipse and Netbeans plugins don't serve me very well. At the moment I'm using a combination of manual "svn merge" and the graphical diff <a href="http://meld.sourceforge.net/" rel="noreferrer">Meld</a>. Are there better alternative...
<p>Meld is arguably one of the best and one of the most used tools for non-win32. On Windows or with Wine <a href="http://winmerge.org/" rel="noreferrer">WinMerge</a> wins hands down. Some alternatives for Linux:</p> <ul> <li><a href="http://www.caffeinated.me.uk/kompare/" rel="noreferrer">Kompare</a></li> <li><a href...
<p>Which platform are you running on? On Windows I use <strong>TortoiseSVN</strong> to carry out most diffs and merges pretty easily. Only some of the more complicated strands of diffs are performed with UltraCompare.</p>
26,819
<p>I'm trying to read data from a photocell resistor and my Arduino Decimila and then graph it in real-time with Processing.</p> <p>Should be painfully simple; but its growing into a little bit of a nightmare for me.</p> <p>code I'm running on my Arduino:</p> <pre class="lang-java prettyprint-override"><code>int p...
<p>You could transmit that data with the Plotly Arduino API, which along with the documentation and setup is available <a href="http://plot.ly/api/arduino" rel="nofollow noreferrer">here</a>. Basic idea: you can continuously stream data from your Arduino, or transmit a single chunk. </p> <p>Then, if you want to embed ...
<p>After a closer look at the resources at hand, I realized that the problem had already been solved for me by the folks over at <a href="http://arduino.cc" rel="nofollow noreferrer">http://arduino.cc</a></p> <blockquote> <p><a href="http://arduino.cc/en/Tutorial/Graph" rel="nofollow noreferrer">http://arduino.cc/en...
31,973
<p>I am encountering error like </p> <pre><code>test(10)[1].csv file cannot be found at C:\Documents and Settings\Ron\Local Settings\Temporary Internet Files\Content.IE5\PQ0STUVW </code></pre> <p>When trying to do export of CSV file using the following codes. Anyone have any idea what could be wrong? This issue doe...
<p>I've already got that problem and asked the <a href="https://stackoverflow.com/questions/120497/how-to-work-around-the-1-ie-bug-while-saving-an-excel-file-from-a-web-server">question that as a correct answer</a> (or, shall I say, a good workaround for IE).</p>
<p>Are there "special" characters in your "fileFullName"? You cold also try to check the length of your file name, I once had an issue with IE6 when the file name got too long.</p> <p>Just to be on the safe side: your "fileFullName" only contains the name of the file and not the path, right? </p>
23,028
<p>I'm trying to build my first generic list and have run into some problems. I understand the declaration looks like " <code>List&lt;T&gt;</code> ", and I have <code>using System.Collections.Generic;</code> at the top of my page. However, Visual Studio doesn't recognize the <code>T</code> variable. </p> <p>What am I ...
<p><code>List&lt;T&gt;</code> means <code>List&lt;WhateverTypeYouWantItToBeAListOf&gt;</code>. So for example:</p> <p>If I have an Employee Class, and I wanted a collection of Employees, I could say:</p> <pre><code>List&lt;Employee&gt; employeeList = new List&lt;Employee&gt;(); </code></pre> <p>I could then add <cod...
<p>Are you trying to use the List class or are you trying to build your own? What does your code look like at the moment?</p>
47,156
<p>In my MFC program I am using a splitter to create two panes. I now want to split one of these panes in half again and put in another view, can someone talk me through how to do it or point me in the direction of some code?</p> <p>I would prefer to code it myself so I am not interested in custom derived classes unle...
<p>In <code>CMainFrame::OnCreateClient</code></p> <pre><code>// Create splitter with 2 rows and 1 col m_wndSplitter.CreateStatic(this, 2, 1); // Create a view in the top row m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CView1), CSize(100, 100), pContext); // Create a 2 column splitter that will go in the bottom row of...
<p>I am not an expert in MFC, but can't you just put a splitter in one of the panes you made with the first splitter ? that how we do in winform....</p>
25,047
<p>I am having a lot of trouble with mod_rewrite, and for a while I had it going, but for some reason everything has stopped working.</p> <p>Is there any sort of basic test that I can do to make sure that it is not something fundamental broken.</p> <p>It does show up in phpinfo();</p>
<p>A secret that nobody mentions is that mod_rewrite is confusing partly beacuse it's <em>buggy</em>.</p> <p>Once you're sure you understand it, it does something strange and you get depressed and vow never to touch it again. Earlier this year I found a bug which was <a href="http://archive.apache.org/gnats/7879" rel=...
<p>Use an .htaccess file to create some rules. If they don't work then something is broken :)</p>
30,930
<p><em>Disclaimer: This is not actually a programming question, but I feel the audience on stackoverflow is more likely to have an answer than most question/answer sites out there.</em></p> <p>Please forgive me, Joel, for stealing your question. Joel asked this question on a podcast a while back but I don't think it ...
<p>At least for PCs, the fact that you dismiss an item does get sync'd, and fairly quickly for me. I'm not sure why phones don't seem to do it, though. Maybe the ActiveSync protocol doesn't offer that option.</p>
<p>Thanks from me, too :)</p> <p>Maybe it's because all your devices clocks are synchronized to a time server, so they all have the exactly correct atomic-clock time, and all the devices notify you within a couple of seconds of each other, so the "dismiss" synchronization just doesn't happen fast enough.</p>
3,443
<p>I had a new Extruder tip on my Ender 3 3D printer. the tip looked like the left tip in the below image. After I have been using it for about 5 months, the tip got dull/flat, like the tip on the right in the below image.</p> <p>The only filament I have used is a spool of PLA (from hatchbox) and a spool of PETG (from...
<p>Playing around with the nozzle height will help: back it off until just before you have first layer adhesion issues. Don't jam the filament into the bed as you might for ABS. This helps with small prints. However, my experience has been that if you have a large enough continuous contact area (i.e. more than a few...
<p>Correctly level your bed. Seriously, that's the answer. PETG does stick well, but it only gets difficult to remove if you're smashing the first layer against the bed with a nozzle that's way too close. With the bed leveled properly - using feeler gauges or test prints and a sub-0.1-mm-precision caliper - I have no t...
1,778
<p>I have a workspace for running an H.263 Video Encoder in a loop for 31 times i.e. the main is executed 31 times to generate 31 different encoded bit streams. This MS Visual Studio 2005 Workspace has all C source files. When i create a "DEBUG" configuration for the workspace and build and execute it, it runs fine, i....
<p>It's hard to say what the problem might be without carefully inspecting the code. However...</p> <p>One of the differences between debug and release builds is how the function call stack frame is set up. There are certain classes of bad things you can do (like calling a function with the wrong number of arguments) ...
<p>Are you sure there are no precompile directives that, say, ignores some really important code in Release mode but allows them in Debug?</p> <p>Also, have you implemented any logging that might point out to the precise assembly that's throwing the error?</p>
3,005
<p>Using Lucene, one can retrieve the terms contained within in an index, i.e. the unique, stemmed words, excluding stop-words, that documents in the index contain. This is useful for generating autocomplete suggestions amongst other things. Is something similar possible with MS SQL Server full text indices?</p>
<p>You can use the new system view in SQL Server 2008 to get you the terms and count of occurrences, is this what you want?</p> <pre><code>sys.dm_fts_index_keywords_by_document ( DB_ID('database_name'), OBJECT_ID('table_name') ) </code></pre> <p>You need to supply the <code>db_id</code> and <code>object_...
<p><code>sys.dm_fts_index_keywords</code> gives returns the list of indexed terms, with additional statistics, not the list of noise words which is retruned thanks to <code>sys.fulltext_stopwords</code>.</p>
36,521
<p>Can I setup a custom MIME type through ASP.NET or some .NET code? I need to register the Silverlight XAML and XAP MIME types in IIS 6.</p>
<p>To add to the master mime type list:</p> <pre><code>using (DirectoryEntry mimeMap = new DirectoryEntry("IIS://Localhost/MimeMap")) { PropertyValueCollection propValues = mimeMap.Properties["MimeMap"]; IISOle.MimeMapClass newMimeType = new IISOle.MimeMapClass(); newMimeType.Extension = extension; // str...
<p>'Active DS IIS Namespace Provider' on the COM add references tab.</p> <p>If it's not there, you have to install IIS on your machine.</p> <p>See <a href="https://stackoverflow.com/questions/1191811/is-there-a-way-to-get-all-the-mime-types-instead-of-wrinting-a-huge-case-statemen/1767242#1767242">Is there a way to g...
29,030
<p>I'd like to make sure that a thread is moved to a specific CPU core and can never be moved from it by the scheduler.</p> <p>There's a <code>SetThreadAffinityMask()</code> call but there's no <code>GetThreadAffinityMask()</code>.</p> <p>The reason I need this is because high resolution timers will get messed up if ...
<p>You should probably just use SetThreadAffinityMask and trust that it is working.</p> <p><a href="http://msdn.microsoft.com/en-us/library/ms684251.aspx" rel="noreferrer">MSDN</a></p>
<p>There is no need for Get<i>Thread</i>AffinityMask. Just get the value of Get<i>Process</i>AffinityMask, turn some bits off, then call SetThreadAffinityMask. The threads inherit the process' affinity mask, and since their affinity is under your control, you already know a thread's affinity mask (it's the one you set ...
19,827
<p>I need a distinct sound to play when a error occurs. The error is the result of a problem with one of perhaps two hundred barcodes that are being inputted in rapid fire. The event queue seems to handle keyboard input (which the barcode scanner emulates) first, and playing of my sound second. So if the barcodes ar...
<p>Javascript is not multi-threaded, so option 2 won't work. And I suspect that the event queue you speak of is the OS's event queue, which isn't likely to accessible from a browser, if at all.</p> <p>Beyond that, I'm having a little trouble understanding your problem. What is firing the error sound? Is it a <code>key...
<p>What if you try to delay the scans (using <a href="http://www.sean.co.uk/a/webdesign/javascriptdelay.shtm" rel="nofollow noreferrer"><code>setTimeout()</code></a>), allowing the sounds to start and finish between them?</p>
35,684
<p>this is my log output</p> <pre><code>INFO main digestemails - process inbox INFO main digestemails - checking for emails in c:\development\DCMail\email\KN-Source INFO main digestemails - digesting 003d01c95a7b_3446880_0202fea9@xxxx.com.eml INFO main digestemails - extracting attachments INFO main digestemails - no ...
<p>Use <code>%d</code> in your PatternLayout.</p> <p>Also <code>%d</code> can take a format pattern as in <code>%d{dd MMM yyyy HH:mm:ss,SSS}</code> you can pick and choose the elements that you want. When the format pattern is omitted the date will be in ISO8601 format.</p>
<p>You can find more conversion characters usage in log4j javadoc.For example, at <a href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PatternLayout.html" rel="nofollow noreferrer">http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PatternLayout.html</a>.</p>
46,714
<p>What is the best method to scrape a dynamic website where most of the content is generated by what appears to be ajax requests? I have previous experience with a Mechanize, BeautifulSoup, and python combo, but I am up for something new.</p> <p>--Edit-- For more detail: I'm trying to scrape the CNN <a href="http://...
<p>This is a difficult problem because you either have to reverse engineer the javascript on a per-site basis, or implement a javascript engine and run the scripts (which has its own difficulties and pitfalls).</p> <p>It's a heavy weight solution, but I've seen people doing this with greasemonkey scripts - allow Firef...
<p>This seems like it's a pretty common problem. I wonder why someone hasn't anyone developed a programmatic browser? I'm envisioning a Firefox you can call from the command line with a URL as an argument and it will load the page, run all of the initial page load JS events and save the resulting file.</p> <p>I mean...
25,349
<p>Are there any noted differences in appearance rendering of HTML and XHTML in Google Chrome from Firefox? From IE? From other browsers? What browser does it render the code the most similar to?</p>
<p>Since it's based on WebKit, its rendering will most closely resemble Safari and Konqueror.</p>
<p>There are <a href="http://www.flickr.com/photos/kurafire/2822606444/" rel="nofollow noreferrer">anti-aliasing differences</a> between Safari 3.1 and Google Chrome, for whatever that's worth. This will doubtless be because Safari on Windows uses its own text-rendering and anti-aliasing layer instead of Windows's GDI....
9,528
<p>I have an SSIS Package that sets some variable data from a SQL Server Package Configuration Table. (Selecting the "Specify configuration setings directly" option)</p> <p>This works well when I'm using the Database connection that I specified when developing the package. However when I run it on a server (64 bit) in...
<p>The only way I was able to do this was to use Windows Environment Variables. You can specify things like connection strings and user preferences in environment variables, and then pick up those environment variables from your SSIS Task.</p>
<p>We want to keep our package configs in a database table, we know it gets backuped with our other data and we know where to find it. Just a preference.</p> <p>I have found that to get this to work I can use an environment variable configuration to set the connection string of the connection manager that I am reading...
5,972
<p>Since version 1.5 Subversion supports to have a local caching-proxy for the main Master-repository. </p> <p>I got the slave synced and the master replaying the commits to the slave. Everything works fine so far, but now I am wondering how to do the authentication (working with <a href="http://blogs.open.collab.net...
<p>In the end the problem was solved by configuring the mod_proxy correctly. Ones mod_proxy is aware that is also has to proxy the authentication credentials, it works fine and the user has to enter username/password only once.</p>
<p>Remembering the password must surely be up to the svn client you're using, why would it ask you again if you told it to remember it?</p> <p>Also you might want to read up on apache, specifically the Require directive, which controls HTTP authentication: <a href="http://httpd.apache.org/docs/2.2/mod/core.html#requir...
32,227
<p>I am attempting to use the .Net System.Security.SslStream class to process the server side of a SSL/TLS stream with client authentication.</p> <p>To perform the handshake, I am using this code:</p> <pre><code>SslStream sslStream = new SslStream(innerStream, false, RemoteCertificateValidation, LocalCertificateSelec...
<p>It does not look like this is currently possible using the .NET libraries. </p> <p>I solved it by using the Mono class library implementation of System.Security.SslStream, which gives better access to overriding the servers behavior during the handshake.</p>
<p>It is not the validation part I want to change. The problem is in the initial handshake, the server transmits the message informing the client that client authentication is required (that is the CertificateRequest message). As part of this message, the server sends the names of CAs that it will accept as issuers of ...
7,741
<p>I'm pretty new to the Spring Framework, I've been playing around with it and putting a few samples apps together for the purposes of evaluating Spring MVC for use in an upcoming company project. So far I really like what I see in Spring MVC, seems very easy to use and encourages you to write classes that are very un...
<p>The spring docs are great on this: <a href="http://static.springframework.org/spring/docs/2.5.x/reference/beans.html#context-introduction-ctx-vs-beanfactory" rel="noreferrer">3.8.1. BeanFactory or ApplicationContext?</a>. They have a table with a comparison, I'll post a snippet:</p> <p><strong>Bean Factory</strong>...
<p>I think it is worth mentioning that since Spring 3, if you want to create a factory, you can also use the <a href="https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/context/annotation/Configuration.html" rel="nofollow noreferrer"><code>@configuration</code></a> annotation combined with the p...
30,155
<p>I'm getting something pretty strange going on when trying to read some data using the MySql .net connector. Here's the code:</p> <pre><code>IDataReader reader = null; using (MySqlConnection connection = new MySqlConnection(this.ConnectionString)) { String getSearch = "select * from organization"; MySqlComm...
<p>from what I understand the SqlDataReader is intended to be used for a one-time enumeration of the data you've returned. Once you've cycled through the results once, the object has done its duty. Here are a couple ideas for working around this, one or the other of which may solve this for you depending on your need...
<p>Since a datareader reads in information, your using block closes the connection to the reader just after assigning its value to the variable. <a href="http://www.simple-talk.com/dotnet/.net-framework/should-you-use-ado.net-datareader-or-dataset/" rel="nofollow noreferrer">Here is an article</a> that shows you some ...
32,426
<p>I'm building my first flex app and am currently bussy splitting it up in multiple components to make it maintainable. I have a screen which holds a list that is displayed and filled after a succesfull login attempt:</p> <p>Part of the main app:</p> <pre><code>&lt;mx:ViewStack id="vsAdmin" height="100%" width="100%...
<p>I would make sure the component exists that you are calling before calling the next function. This could be done by forcing creationPolicy=all as you figured out. You could also add an event listener for the CreationComplete to call the function you want:</p> <pre><code>private function doThisFirst():void{ ...
<p>Alternatively, you can have creationComplete define in your mxml</p> <pre><code>&lt;mx:Canvas ... creationComplete="onCreationComplete()"&gt; &lt;mx:Script&gt; &lt;![CDATA[ private function onCreationComplete():void { requestBeheerdersList() } ]]&gt; &lt;/mx:Script&gt; </code></pre> <p>or possibl...
24,074
<p>I want to add a constant value onto an incoming bound integer. In fact I have several places where I want to bind to the same source value but add different constants. So the ideal solution would be something like this...</p> <pre><code>&lt;TextBox Canvas.Top="{Binding ElementName=mySource, Path=myInt, Constant=5}"...
<p>I use a <code>MathConverter</code>that I created to do all simple arithmatic operations with. The code for the converter is <a href="http://rachel53461.wordpress.com/2011/08/20/the-math-converter/" rel="noreferrer">here</a> and it can be used like this:</p> <pre><code>&lt;TextBox Canvas.Top="{Binding SomeValue, ...
<p>I've never used WPF, but I have a possible solution.</p> <p>Can your binding Path map to a Map? If so, it should then be able to take an argument (the key). You'd need to create a class that implements the Map interface, but really just returns the base value that you initialized the "Map" with added to the key.<...
15,260
<p>How can I call a BizTalk Orchestration dynamically knowing the Orchestration name? </p> <p>The call Orchestration shapes need to know the name and parameters of Orchestrations at design time. I've tried using 'call' XLang keyword but it also required Orchestration name as Design Time like in expression shape, we ca...
<p>The way I've accomplished something similar in the past is by using direct binding ports in the orchestrations and letting the MsgBox do the dirty work for me. Basically, it goes something like this:</p> <ol> <li>Make the callable orchestrations use a direct-bound port attached to your activating receive shape.</li...
<p>Look at ESB Guidance (www.codeplex.com/esb) This package provides the functionality you are looking for</p>
9,787
<p>How do you setup an asp.net sql membership role/membership provider on a production machine? I'm trying to setup BlogEngine.NET and all the documentation says to use the ASP.NET Website Administration tool from Visual Studio but that isn't available on a production machine. Am I the first BlogEngine user to use it o...
<p>I solved this problem by setting up a default super user at application start up.</p> <p>By adding this to gobal.asax</p> <pre> <code> void Application_Start(object sender, EventArgs e) { // Code that runs on application startup // check that the minimal security settings are created ...
<p>You'll have to have .NET 2.0 installed on the machine, all the VS tool is is a GUI wrapper for a command line tool which is part of the framework.</p> <p>Check C:\Windows\Microsoft.NET\Framework\v2.0.50727 for the app aspnet_regsql.exe</p> <p>/? for command line switches, /W for a wizard mode</p>
18,943
<p>I have a few questions related:</p> <p>1) Is possible to make my program change filetype association but only when is running? Do you see anything wrong with this behavior?</p> <p>2) The other option that I'm seeing is to let users decide to open with my application or restore default association ... something lik...
<p>Regarding file associations, I've wrote an answer earlier that at least <a href="https://stackoverflow.com/questions/212906/script-to-associate-an-extension-to-a-program#212921">covers the "How"</a>.</p> <p>This should also point you to the right direction how to handle backup and restore. With direct registry acce...
<p>1) you get to define the file types that are in the Open Dialog file type droplist. Outside of that, it's <em>possible</em> to change the filetype default on application open, and then replace during application close, as file type association are just a registry setting.</p> <p>As for wrong, I wouldn't. First rea...
27,460
<p>What would prevent one machine from consuming a Silverlight Enabled WCF service some of the time, whilst another on the same network domain, behind the same proxy / firewall / etc.. can fine? Service and app are on the same domain.</p> <p>I'm writing to the event log when the service comes in, and I can't even see ...
<p>Install <a href="http://www.fiddlertool.com/" rel="nofollow noreferrer">Fiddler</a> and see what is going on. No other good way to figure this out (sometimes even fiddler can't help).</p>
<p>Install <a href="http://www.fiddlertool.com/" rel="nofollow noreferrer">Fiddler</a> and see what is going on. No other good way to figure this out (sometimes even fiddler can't help).</p>
43,319
<p>I've an linux image(debian) running on VMWare ESX 3.1. Is it possible to copy that image and run it locally on my local VMWare workstation? how?</p>
<p>I <em>believe</em> that while ESX (commercial) is reverse-compatible to Server (free), Server is <strong>NOT</strong> forward-compatible to ESX.</p> <p>Therefore, you can import Server images to ESX, but not the other way around.</p> <p>You <em>may</em> be able to go from an ESX host to an ESXi (free) host, howeve...
<p>Kasper, what version of ESX are you running? Trying to export an image from our ESX server always ends in a I/O error (don't have access to the server right now so I cannot remember the exact error message).</p> <p>Would love to get this feature working but I not found anything on the web that might help with this ...
41,880
<p>I write tools that are used in a shared workspace. Since there are multiple OS's working in this space, we generally use Python and standardize the version that is installed across machines. However, if I wanted to write some things in C, I was wondering if maybe I could have the application wrapped in a Python scri...
<p>Launching a Python interpreter instance just to select the right binary to run would be much heavier than you need. I'd distribute a shell .rc file which provides aliases.</p> <p>In /shared/bin, you put the various binaries: /shared/bin/toolname-mac, /shared/bin/toolname-debian-x86, /shared/bin/toolname-netbsd-dre...
<p>You know, you should look at static linking.</p> <p>These days, we all have HUGE hard drives, and a few extra megabytes (for carrying around libc and what not) is really not that big a deal anymore. </p> <p>You could also try running your applications in chroot() jails and distributing those.</p>
6,099
<p>With a seriously big .NET site/solution (100's of assemblies), are there any tools available to recognise which assemblies have changed since the last build (using something more intelligent than file dates that will always change).</p> <p>I need to change our deployment process to a) increment the version of chang...
<p>Have a look at <a href="http://www.ndepend.com/" rel="nofollow noreferrer">NDepend</a>. I believe you can use it to generate reporots of just that sort of thing and use these as inputs to your deployment process</p>
<p>One of the great traceability features in Team Build is how it tracks changesets, as well as, work items associated to changesets from build to build. </p> <p>We use these build summaries to help us generate our release notes between versions. We use a build definition what we run manually when we are ready to de...
43,796
<p>I was wondering why <code>shared_ptr</code> doesn't have an implicit constructor. The fact it doesn't is alluded to here: <a href="https://stackoverflow.com/questions/142391/getting-a-boostsharedptr-for-this">Getting a boost::shared_ptr for this</a></p> <p>(I figured out the reason but thought it would be a fun que...
<p>In this case, the shared_ptr would attempt to free your stack allocated int. You wouldn't want that, so the explicit constructor is there to make you think about it.</p>
<pre><code>int main() { int foo = 5; fun(&amp;foo); cout &lt;&lt; foo &lt;&lt; endl; // ops!! return 0; } </code></pre>
39,071
<p>How does one read a data file in an iPhone project? For example, lets say I have a static file called "level.dat" that is structured as follows: obstacles: 10 time: 100 obstacle1: 10,20 ...</p> <p>I would like to read the contents of the file into a NSString then do the parsing. How do I read the contents of a fi...
<p>See this answer: <a href="https://stackoverflow.com/questions/318341/how-to-fopen-on-the-iphone">How to fopen() on the iPhone?</a> which shows how to get access to resources in your bundle. Once you have the path, just use [NSString stringWithContentsOfFile:encoding:error:].</p> <pre><code>NSString *path = [[NSBu...
<p>If you need help parsing the data string, there's a helpful article on <a href="http://www.macresearch.org/cocoa_for_scientists_part_xvii_representing_data_in_tables" rel="nofollow noreferrer">Cocoa For Scientist</a></p>
41,635
<p>I have seen a few (old) posts on the 'net about hacking together some support for pre-compiled headers in CMake. They all seem a bit all-over the place and everyone has their own way of doing it. What is the best way of doing it currently?</p>
<p>There is a <a href="https://github.com/sakra/cotire" rel="noreferrer">third party CMake module named 'Cotire'</a> which automates the use of precompiled headers for CMake based build systems and also supports unity builds.</p>
<p>Don't even go there. Precompiled headers mean that whenever one of the headers changes, you have to rebuild <em>everything</em>. You're lucky if you have a build system that realizes this. More often than never, your build will just fail until you realize that you changed something that is being precompiled, and the...
17,897
<p>Tomcat (version 5 here) stores session information in memory. When clustering this information is periodically broadcast to other servers in the cluster to keep things in sync. You can use a database store to make sessions persistant but this information is only written periodically as well and is only really used f...
<p>There definitely is a way. Though I'd strongly vote for sticky sessions - saves so much load for your servers/database (unless something fails)...</p> <p><a href="http://tomcat.apache.org/tomcat-5.5-doc/config/manager.html" rel="nofollow noreferrer">http://tomcat.apache.org/tomcat-5.5-doc/config/manager.html</a> ha...
<p>Take a look at <a href="http://www.terracotta.org/" rel="nofollow noreferrer">Terracotta</a>, I think it can address your scaling issues without a major application redesign.</p>
10,802
<p>I am the owner of a pretty Anycubic Mega I3 and it was very cool to own it. </p> <p>However, now I have several problems when printing with it. It clicks all along, at high or low temperature, at 5&nbsp;mm above the plate, and the result is very disgusting. It is the same with the basic black PLA, or with other PLA...
<p>I redid the print in order to reply to some questions posed in the answer of @kdtop. The print started but the output was not consistent and sometimes stopped. The temperature is 195°C and sometimes 'drop' to 194°C. First I pushed the new real so that the extruder did not need to pull so much. When this did not solv...
<p>My slicer (Cura-lulzbot) has a setting for initial printing temp, and then printing temp after the first few layers. Is it possible that your temp is initially OK, but then drops too low? Does your printer have a readout that shows the current temp? Is the temp still OK when it stops?</p> <p>It sounds like you a...
927
<p>It's common to want browsers to cache resources - JavaScript, CSS, images, etc. until there is a new version available, and then ensure that the browser fetches and caches the new version instead.</p> <p>One solution is to embed a version number in the resource's filename, but will placing the resources to be manag...
<p>Yes, any change in <em>any part</em> of the URL (excluding HTTP and HTTPS protocols changes) is interpreted as a different resource by the browser (and any intermediary proxies), and will thus result in a separate entity in the browser-cache.</p> <p><strong>Update:</strong></p> <p>The claim in <a href="http://www....
<p>In most browsers the full url is used. In some browsers, if you have a query in the url, the document will never be cached.</p>
10,954
<p>I'm trying to encrypt some integers in java using java.security and javax.crypto. </p> <p>The problem seems to be that the Cipher class only encrypts byte arrays. I can't directly convert an integer to a byte string (or can I?). What is the best way to do this?</p> <p>Should I convert the integer to a string an...
<p>You can turn ints into a byte[] using a DataOutputStream, like this:</p> <pre><code>ByteArrayOutputStream baos = new ByteArrayOutputStream (); DataOutputStream dos = new DataOutputStream (baos); dos.writeInt (i); byte[] data = baos.toByteArray(); // do encryption </code></pre> <p>Then to decrypt it later:</p> <pr...
<p>create a 4-byte array and copy the int to the array in 4 steps, with bitwise ANDs and bitshifting, like Paulo said.</p> <p>But remember that block algorithms such as AES and DES work with 8 or 16 byte blocks so you will need to pad the array to what the algorithm needs. Maybe leave the first 4 bytes of an 8-byte ar...
41,651
<p>We have a website, where transactions are entered in and put through a workflow. We are going to follow the standard BLL(Business Logic Layer), DTO(Data Transfer Object), DAL(Data Access Layer) etc. for a tiered application. We have the need to separate everything out because some transactions will cross multiple ap...
<p>One thing that I picked up on while learning MVC over the last couple years is the difference between what I call application logic and domain logic. I don't like the term business logic anymore, because it has too much baggage from all the conflicting theories and practices that have used that term too loosely.</p>...
<p>The "Ideal" way to do this depends on the project at hand and the various requirements of the system.</p> <p>My default design is to have it act as one app. But if there are more heavyweight processes taking place, I like to create a batching process where the parameters of the requested job are stored and acted up...
32,567
<p>I have two applications under <code>tomcat/webapps</code> folder. </p> <pre><code>tomcat/webapps/App1 tomcat/webapps/App2 </code></pre> <p>Both applications share the same libraries. Which are stored for example in <code>tomcat/webapps/App1/WEB-INF/lib</code>.</p> <p>Are both libraries loaded twice in memory?</...
<p>As you can see <a href="http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html" rel="noreferrer">here</a>, Tomcat creates one class-loader per webapp on your server. Thus, if you have webapp1 and webapp2 that share the same library, then this library will be indeed loaded twice.</p> <p>You can eventually p...
<p>PermGen Space of heap is used to store classes and Meta data about classes in Java.</p> <p>Error java.lang.OutOfMemoryError: PermGen space can occurred frequently because we are loading lots of duplicate library in apache tomcat can anyone share about it in details</p>
33,616
<p>Is there a way to use form fields that does not correspond to database field for temporary processings?</p> <p>I.e. I want to add:</p> <ul> <li>temp fields <strong>item1</strong>, <strong>item2</strong></li> <li>database field <strong>sum</strong></li> <li>button with record hook that sets <strong>sum</strong> = <...
<p>As far as I know it's simply not possible with ClearQuest. I've tried to do something similar and was told by our IBM consultant that the only way is to create a DB field for all variables.</p>
<p>ClearQuest schema designers often include 'temporary' fields in their record types. They do this so they perform operations on hooks to generate another value.</p> <p>For example, for the Notes fields, there is a 'temporary' Notes_entry field that the user types the most recent note into, and when the record is sav...
19,040
<p>Consider a regular web application doing mostly form-based CRUD operations over SQL database. Should there be explicit transaction management in such web application? Or should it simply use autocommit mode? And if doing transactions, is "transaction per request" sufficient?</p>
<p><strong>I would only use explicit transactions when you're doing things that are actually transactional</strong>, e.g., issuing several SQL commands that are highly interrelated. I guess the classic example of this is a banking application -- withdrawing money from one account and depositing it in another account mu...
<p>You should use transactions given that different users will be hitting the database at the same time. I would recommend you do <em>not</em> use autocommit. Use explicit transaction brackets. As to the resolution of each transaction, you should bracket a particular unit of work (whatever that means in your context).<...
21,396
<p>Sometimes you need to upgrade the database with many rows that you have in a datatable or you have an array full of data, instead of putting all this data together in a string and then splitting in SQL SERVER, or instead of iterating the datatable in the code row by row and updating database, is there any other way?...
<p>There's a few ways to do this.</p> <p>If you're simply inserting rows, then I would create a DataTable object with the information in it, then use the SqlBulkCopy object:</p> <pre><code>SqlBulkCopy copier = new SqlBulkCopy(connectionString, SqlBulkCopyOptions.Default); copier.BatchSize = 500; //# of rows to insert...
<p>John mentioned using XML... and that's the approach I would use for your situation (SQL Server 2005, and making a sproc that handles the SQL for you).</p> <p>Here's an example of how to get started (this is just a select statement, but you can make it an update if you want):</p> <pre><code>CREATE PROCEDURE MySproc...
31,281
<p>I would like to set some vim options in one file in the comments section.</p> <p>For example, I would like to set this option in one file</p> <pre><code>set syntax=python </code></pre> <p>The file does not have a .py extension and I am not interested in making my vim installation recognise all files with this ext...
<p>You're wanting a <a href="http://vim.wikia.com/wiki/Modeline_magic" rel="noreferrer">modeline</a> syntax, e.g.</p> <pre><code># vim: set syntax=python: </code></pre> <p>See: <a href="http://vim.wikia.com/wiki/Modeline_magic" rel="noreferrer">Modeline magic</a> at Vim Wikia for more details.</p>
<p>You override the Vim options by adding the modeline near the top or the bottom of the file, such as:</p> <pre><code>// vim: set syntax=python: </code></pre> <p>or:</p> <pre><code>/* vim: set syntax=python: */ </code></pre> <p>or like:</p> <pre><code># vim: set syntax=python ts=4 : </code></pre> <p>Other exampl...
49,223
<p>I have a table that stores all the volunteers, and each volunteer will be assigned to an appropriate venue to work the event. There is a table that stores all the venues.</p> <p>It stores the volunteer's appropriate venue assignment into the column <code>venue_id</code>.</p> <pre><code>table: venues columns: id, v...
<p>We had the same behaviour as Todd Smith mentions. After the upgrade to .Net 3.5 SP1 we got this error.</p> <p>In our case the reason was the <strong>protection / obfuscation</strong> of our DLLs with Remotesoft Protector.</p> <p>This is most likely only our problem and not a solution for anyone else. Nevertheless ...
<p>I'm not familiar with this error but have you verified that your security/permissions are set correctly on the dedicated server? </p> <p>Also you might want to confirm that you can access the feed directly from a browser on the dedicated server.</p> <p><a href="http://forums.asp.net/p/675515/675515.aspx" rel="nof...
24,280
<p>I have a generic list of objects in C#, and wish to clone the list. The items within the list are cloneable, but there doesn't seem to be an option to do <code>list.Clone()</code>.</p> <p>Is there an easy way around this?</p>
<p>You can use an extension method.</p> <pre><code>static class Extensions { public static IList&lt;T&gt; Clone&lt;T&gt;(this IList&lt;T&gt; listToClone) where T: ICloneable { return listToClone.Select(item =&gt; (T)item.Clone()).ToList(); } } </code></pre>
<p>I've made for my own some extension which converts ICollection of items that not implement IClonable</p> <pre><code>static class CollectionExtensions { public static ICollection&lt;T&gt; Clone&lt;T&gt;(this ICollection&lt;T&gt; listToClone) { var array = new T[listToClone.Count]; listToClone...
27,466
<p>I am a web-developer working in PHP. I have some limited experience with using Test Driven Development in C# desktop applications. In that case we used nUnit for the unit testing framework.</p> <p>I would like to start using TDD in new projects but I'm really not sure where to begin. </p> <p>What recommendations d...
<p>I've used both PHPUnit &amp; <strong><a href="http://simpletest.org/" rel="noreferrer">SimpleTest</a></strong> and I found <strong>SimpleTest</strong> to be easier to use.</p> <p>As far as TDD goes, I haven't had much luck with it in the purest sense. I think that's mainly a time/discipline issue on my part though...
<p>Test driven development is an approach where tests are always written before code. You should learn to <a href="https://phpunit.de/" rel="nofollow noreferrer">PHPUNIT</a> first in order to start TDD Development. Then while making your function you should always think how function can fail and write test case in php...
6,831
<p>I am trying to use the JQuery UI datepicker (latest stable version 1.5.2) on an IE6 website. But I am having the usual problems with combo boxes (selects) on IE6 where they float above other controls. I have tried adding the bgIframe plugin after declaring the datepicker with no luck.</p> <p>My guess is that the .u...
<p>This should be taken care of for you by default.</p> <p>The iframe gets included by default in IE6 in the datepicker. The style for it, called ui-datepicker-cover that handles the transparency. The only time this isn't the case is in the old themeroller code the style wasn't in there.</p>
<p>I have noted Marc's comment that the ui-datepicker-cover style should handle this. In my case the right and bottom edges of the calendar would still show drop downs through them.</p> <p>It looks like the size of the iFrame is initially being set by the following lines of code</p> <pre><code>if ($.browser.msie &amp...
19,168
<p>I've got a bunch of 3D vertex positions &amp; need to generate a convex hull containing them; does anyone know of any QHull bindings for .NET? or native 3D Delaunay triangulation algorithms?</p>
<p>A 3d delaunay is tricky, I'm not sure it's even possible to strictly define a delaunay constraint for a 3d surface.<br> The normal technique if you just want to mesh a surface is to pick a direction and map that onto 2 coordinates and do a 2d delaunay. For a height map it's easy to just use x,y. Then when you have t...
<p>Have a look at <a href="http://ozviz.wasp.uwa.edu.au/~pbourke/geometry/insidepoly/" rel="nofollow noreferrer">this site</a> that takes about 2D and 3D point finding in shapes.</p>
21,916
<p>How do I get a list of the files checked out by users (including the usernames) using P4V or P4? </p> <p>I want to provide a depot location and see a list of any files under that location (including sub folders) that are checked out.</p>
<p>From the command line:</p> <pre><code>p4 opened -a //depot/Your/Location/... </code></pre> <p>The ... indicates that sub folders should be included.</p>
<p>In p4v : try to do a rename of the top directory. You will get a warning and list of the currently checked out files with user names.</p>
16,124
<p>I want to create buttons with icons in Flex dynamically using Actionscript.</p> <p>I tried this, with no success:</p> <pre><code>var closeButton = new Button(); closeButton.setStyle("icon", "@Embed(source='images/closeWindowUp.png"); </code></pre>
<p>I found an answer that works for me. In my .mxml file, I create Classes for the icons I will use:</p> <pre><code>// Classes for icons [Embed(source='images/closeWindowUp.png')] public static var CloseWindowUp:Class; [Embed(source='/images/Down_Up.png')] public static var Down_Up:Class; [Embed(source='/images/Up_Up...
<p>I'm assuming you're adding it to the stage?</p> <p>Also, I think your Embed is missing a close quote / paren.</p> <pre><code>closeButton.setStyle("icon", "@Embed(source='images/closeWindowUp.png"); </code></pre> <p>should be:</p> <pre><code>closeButton.setStyle("icon", "@Embed(source='images/closeWindowUp.png')"...
38,499
<p>I have a simple web service, it takes 2 parameters one is a simple xml security token, the other is usually a long xml string. It works with short strings but longer strings give a 400 error message. maxMessageLength did nothing to allow for longer strings.</p>
<p>You should remove the quotas limitations as well. Here is how you can do it in code with Tcp binding. I have added some code that shows removal of timeout problems because usually sending very big arguments causes timeout issues. So use the code wisely... Of course, you can set these parameters in the config file a...
<p>You should remove the quotas limitations as well. Here is how you can do it in code with Tcp binding. I have added some code that shows removal of timeout problems because usually sending very big arguments causes timeout issues. So use the code wisely... Of course, you can set these parameters in the config file a...
16,434
<p>I read the Git manual, FAQ, Git - SVN crash course, etc. and they all explain this and that, but nowhere can you find a simple instruction like:</p> <p>SVN repository in: <code>svn://myserver/path/to/svn/repos</code></p> <p>Git repository in: <code>git://myserver/path/to/git/repos</code></p> <pre><code>git-do-the...
<p>Create a users file (i.e. <code>users.txt</code>) for mapping SVN users to Git:</p> <pre><code>user1 = First Last Name &lt;email@address.com&gt; user2 = First Last Name &lt;email@address.com&gt; ... </code></pre> <p>You can use this one-liner to build a template from your existing SVN repository:</p> <pre><code>svn ...
<h1>For this, I have used <strong>svn2git</strong> library with the following procedure:</h1> <blockquote> <p>sudo apt-get install git-core git-svn ruby<br> sudo gem install svn2git<br> svn log --quiet | grep -E "r[0-9]+ \| .+ \|" | cut -d'|' -f2 | sed 's/ //g' | sort | uniq > authors.txt (this command is for ma...
10,454
<p>I want to execute a certain batch file and redirect its console output to a text control in visual c++ or redirect the console output at the same time the logs/echo are showing.</p>
<p>Basically, you have to make the run process to write to a pipe, and to read the output of this pipe.</p> <p>[EDIT] I know how SciTE does that (you can take a look at the source: win32/SciTEWin.cxx, ExecuteOne function), I searched a slightly more generic way, found <a href="http://support.microsoft.com/?scid=kb%3Be...
<p>If elegance is not a priority then a really simple solution might be to redirect the output to a file, and then read in the file contents.</p>
15,384
<p>What is the difference between <code>bool</code> and <code>Boolean</code> types in C#?</p>
<p><code>bool</code> is an alias for <code>System.Boolean</code> just as <code>int</code> is an alias for <code>System.Int32</code>. See a full list of aliases here: <a href="https://msdn.microsoft.com/en-us/library/ya5y69ds.aspx" rel="noreferrer">Built-In Types Table (C# Reference)</a>.</p>
<p>Perhaps bool is a tad "lighter" than Boolean; Interestingly, changing this:</p> <pre><code>namespace DuckbillServerWebAPI.Models { public class Expense { . . . public bool CanUseOnItems { get; set; } } } </code></pre> <p>...to this:</p> <pre><code>namespace DuckbillServerWebAPI.Models ...
16,316
<p>A table in my area of responsibility of our product has been criticised as having more than one orthogonal index.</p> <p>What is an orthogonal index?<br> Why is it bad?<br> How can the situation be avoided?</p> <p>--Update--<br> The back-end database engine isn't necessarily relevant here as our application is dat...
<p>Orthogonal means independent of each other.</p> <p>No idea why it would be bad. In fact, i usually use secondary indexes (besides the 'id' autoincrement primary key) when there's a common query that has nothing to do with the primary one.</p>
<p>Othogonal simply means independent i.e. unrelated to the main concern.</p>
16,151
<p>I have a MySQL database of keywords that are presently mixed-case. However, I want to convert them all to lowercase. Is there an easy command to do this, either using MySQL or MySQL and PHP?</p>
<pre><code>UPDATE table SET colname=LOWER(colname); </code></pre>
<p>I believe in php you can use</p> <pre><code>strtolower() </code></pre> <p>so you could make a php to read all the entries in the table then use that command to print them back as lower case</p>
27,341
<p>I'm using the GoDiagrams suite which seems to recommend .emf files for node images since they scale better on resizing. Bitmaps get all blurry.<br> Google doesn't show up any good tools that seem to do this... So to reiterate I'm looking for a image converter (preferably free) that converts an image (in one of the c...
<p><a href="http://www.inkscape.org/" rel="nofollow noreferrer">Inkscape</a> works well, it was recommended to me <a href="https://stackoverflow.com/questions/28872/free-windows-based-emf-editor">here</a>. </p>
<p>Really funny one Microsoft. Now this might seem outlandish but it works... (I have Visio2007). Just found this out from a colleague</p> <p>You can drop a JPEG into <strong>Microsoft Visio</strong> (no less), Do a 'Save As' to .emf and voila! nice quality of a picture too.</p>
7,750
<p>My application has just started exhibiting strange behaviour.</p> <p>I can boot it through the Carbide Debugger (using TRK) and it works fine with no visible errors and is left installed on the device.</p> <p>Any further attempts to launch the application fail, even after a restart. Uninstalling and downloading th...
<p>why do you need the IList ? </p> <pre><code>static void SetValue2(this Array a, object value, int i) { int[] indices = new int[a.Rank]; for (int d = a.Rank - 1; d &gt;= 0; d--) { var l = a.GetLength(d); indices[d] = i % l; i /= l } a.SetValue(value, indices); } </code></pre> ...
<p><code>SetValue()</code> should work. Take a look at <a href="http://msdn.microsoft.com/en-us/library/758awxk7.aspx" rel="nofollow noreferrer">this</a> for a little more inspiration.</p> <p>EDIT: Could you not just do</p> <pre><code>{{30,30,30}, {30,30,30}, {30,30,30}} , {{30,30,30}, {30,30,30}, {30,30,30}} , {{...
46,957
<p>I change the FontSize of Text in a Style trigger, this causes the Control containing the text to resize as well. How can I change the Fontsize without affecting the parent's size? </p>
<p>A nice trick to isolate an element from its parent layout wise is to place the element in a Canvas</p> <p>In the markup below there are two copies of your element The first is hidden and establishes the size of your control The second is visible but wrapped in a Canvas so its layout size does not affect the parent....
<p>What kind of control are you using? If this is a HeaderedControl like a GroupBox or TabItem then you need to specifically set the HeaderTemplate like this:</p> <pre><code>&lt;DataTemplate x:Key="MyHeaderTemplate"&gt; &lt;TextBlock Text="{Binding}" Fontsize="14" FontWeight="Bold" /&gt; &lt;/DataTemplate&gt; </code...
41,641
<p>I'm wondering how do you deal with displaying release revision number when pushing live new versions of your app?</p> <p>You can use <code>$Rev$</code> in a file to get latest revision, but only after you update the file.</p> <p>What if I want to update a string in one file every time I change any file in the repo...
<p>Did you try to use hooks? They work on server-side only but may do the trick. Otherwise I would just call a script do update the revision if the keywords aren't suitable for you.</p>
<p>On the one project where I had a reason do this, I cheated: it calls <code>svnversion</code> on itself when it starts up.</p>
13,322
<p>I am currently working on an web application that uses ASP.NET 2.0 framework. I need to redirect to a certain page, say SessionExpired.aspx, when the user session expires. There are lot of pages in the project, so adding code to every page of the site is not really a good solution. I have MasterPages though, which I...
<p>You can handle this in global.asax in the Session_Start event. You can check for a session cookie in the request there. If the session cookie exists, the session has expired:</p> <pre><code> public void Session_OnStart() { if (HttpContext.Current.Request.Cookies.Contains("ASP.NET_SessionId") != null) ...
<p>Add or update your Web.Config file to include this or something similar:</p> <pre><code>&lt;customErrors defaultRedirect="url" mode="RemoteOnly"&gt; &lt;error statusCode="408" redirect="~/SessionExpired.aspx"/&gt; &lt;/customErrors&gt; </code></pre>
16,974
<p>I've used MyGeneration, and I love it for generating code that uses Data Access Applicaiton Blocks from Microsoft for my Data Access Layer, and keeping my database concepts in sync with the domain I am modeling. Although, it took a steeper than expected learning curve one weekend to make it productive.</p> <p>I'm ...
<p>T4 is the CodeSmith killer for Microsoft!!!!</p> <p>Go check it out. Microsoft doesn't want to destroy their partners so they don't advertise it, but it is a thing to be reckoned with and ITS FREE and comes installed in Visual Studio 2008.</p> <p><a href="http://www.olegsych.com" rel="nofollow noreferrer">www.oleg...
<p>I have used CodeSmith. Was pretty helpful.</p>
11,915
<p>I have a simple email address sign up form as follows:</p> <pre><code>&lt;form action="" id="newsletterform" method="get"&gt; &lt;input type="text" name="email" class="required email" id="textnewsletter" /&gt; &lt;input type="submit" id="signup" /&gt; &lt;/form&gt; </code></pre> <p><strong>Here's what...
<p>First, please be sure you do all of your validation on the server-side. I like to get my forms working without any JavaScript whatsoever. I am assuming you have done that much.</p> <p>****ORIGINAL ANSWER***</p> <p>Then, change your "submit" element to a button element. On the OnClick of the button element, run ...
<p>Thanks for all your help guys.</p> <p>I have a solution that works perfectly the way I want (had to hire somebody :) - Anywho, for anybody else that needs it, here you go:</p> <pre><code>$(document).ready(function () { $('#textnewsletter').click(function () { if($('#textnewsletter').val()=...
46,560
<p>My goal is to maintain a web file server separately from my main ASP.NET application server for better scalability. The web file server will store a lot of files downloaded by users.<br> So the question is: Is it worth to adopt FreeBSD + Apache + ZFS, or will good old IIS be сonvenient enough?</p>
<p>I understand you will serve only static files. In this case, lightweight HTTP servers will give you a higher performance for a given machine. The following are well known:</p> <ul> <li><a href="http://en.wikipedia.org/wiki/Lighttpd" rel="nofollow noreferrer">Lighttpd</a></li> <li><a href="http://en.wikipedia.org/wi...
<p>If you're serving files over the Internet, you might also consider <a href="http://www.amazon.com/gp/browse.html?node=16427261" rel="nofollow noreferrer">Amazon's S3 service</a>. I've found the rates and reliability to be better than anything I could do (or find) on my own.</p>
4,746
<p>I have two processes one will query other for data.There will be huge amount of queries in a limited time (10000 per second) and data (>100 mb) will be transferred per second.Type of data will be an integral type(double,int) My question is in which way to connect this process?</p> <p>Shared memory , message queue ...
<p>One Word: <a href="https://www.boost.org/doc/libs/1_74_0/doc/html/interprocess.html" rel="noreferrer">Boost.InterProcess</a>. If it really needs to be fast, shared memory is the way to go. You nearly have zero overhead as the operation system does the usual mapping between virtual and physical addresses and no copy ...
<p>I'll second Marc's suggestion -- I'd not bother with boost unless you have a portability concern or want to do cool stuff like map standard container types over shared memory (in which case I'd definitely use boost). </p> <p>Otherwise, message queues and shared memory are pretty simple to deal with.</p>
48,649