instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>I am working on a proposal for my company into purchasing some load testing software. I have to give 2 choices. One of my choices I am proposing is HP(Mecurary) Loadrunner. Is there another program out there that is comparible with Loadrunner? We are looking at using the software to test the performance of the follo...
<p>OpenSourceTesting.com has a <a href="http://www.opensourcetesting.org/performance.php" rel="nofollow noreferrer">list of OSS performance tools</a>.</p> <p>The Software Testing FAQ also has a <a href="http://www.testingfaqs.org/t-load.html" rel="nofollow noreferrer">list of commercial and OSS performance testing too...
<p>TestComplete from Automated QA is also very well respected:</p> <p><a href="http://www.automatedqa.com" rel="nofollow noreferrer">http://www.automatedqa.com</a></p> <p>The product is comprehensive and you can script it in a variety of languages including C#. I'd try the 30-day trial and how it compares to LoadRunn...
46,540
<p>I need to select data when a page is viewed and update the 'views' column is there a way to do this in one query, or do I have to use to distinct queries?</p>
<p>If you do not want/need to use a transaction, you could create a stored procedure that first updates the view count and then selects the values and return them to the user.</p>
<p>PostgreSQL's <a href="http://www.postgresql.org/docs/8.3/static/sql-update.html" rel="nofollow noreferrer">UPDATE</a> statement has the RETURNING clause that will return a result set like a SELECT statement:</p> <pre><code>UPDATE mytable SET views = 5 WHERE id = 16 RETURNING id, views, othercolumn; </code></pre>...
6,525
<p>I think there are a lot of people out there unaware of RFC's (Request for Comments). I know what they are at a logical level, but can anybody give a good description for a new developer? Also, sharing some resources on how to use and read them would be nice. </p>
<p>The term comes from the days of ARPANET, the predecessor to the internet, where the researchers would basically just throw ideas out there to, well, make a request for comments from the other researchers on the project. They could be about pretty much anything and were not very formal at the time. If you go read t...
<p>It's a Request For Comments. That title is a little misleading though, as it's often used as a name for standards, mostly those by the IETF. See <a href="http://en.wikipedia.org/wiki/Request_for_Comments" rel="nofollow noreferrer">Wikipedia</a></p>
18,565
<p>I have a Java method which starts up a Process with ProcessBuilder, and pipes its output into a byte array, and then returns its byte array when the process is finished.</p> <p>Pseudo-code:</p> <pre><code>ProcessBuilder b = new ProcessBuilder("my.exe") Process p = b.start(); ... // get output from process, close p...
<p>Shield yourself from the classes to be mocked. Create an interface either for doing what you really want (e.g. hiding the fact that external processes are involved at all) or only for Process and ProcessBuilder. </p> <p>You don't want to test, that ProcessBuilder and Process work, only that you can work with their ...
<p>With newer releases of JMockit (0.98+) you should be able to easily mock JRE classes like Process and ProcessBuilder. So, no need to create interfaces just for testing...</p> <p>Full example (using JMockit 1.16):</p> <pre><code>public class MyProcessTest { public static class MyProcess { public byte[] ...
25,444
<p>I have an IIS located on serverA</p> <p>I have userA at locationA who has opened a content management system site, hosted on serverA.</p> <p>One of the features of the system is that it allows the user to move a file to LocationB, all within the same network. Now when this move occurs and due to bandwidth restrict...
<p>To follow up on Ian's suggestion of posting direct to server2, you're going to need some sort of webserver (prob IIS, but you could custom write one, that just accepts the CMS form submission and puts files where they need to go)</p>
<p>That's entirely going to depend on how the CMS works - if it does an <code>scp</code> in the background, then the answer is yes - it skips the local machine. </p> <p>If it uses http to transfer it to the user's machine then back out, the answer is "no".</p>
38,266
<p>I want pass values between web user controls without writing any code to the main page which user controls are put on. I do something like that but after doing that I need to click double to pass the value.</p> <p>The example of what I've done :</p> <p><strong><em>Department User Control (Code-Behind)</em></stron...
<p>In your Department User Control you are trying to get the value of selectedProductId before it is set in the Product User Control. That's why you don't get the value you expect until you postback twice.</p> <p>You'll need to get it after the Product User Control sets it in the ItemCommand event. Perhaps placing t...
<p>Try using delegates to achieve this more cleanly, example <a href="http://www.dotnetfunda.com/articles/article201.aspx" rel="nofollow noreferrer">here</a></p>
49,264
<p>It says in <a href="http://www.ibm.com/developerworks/java/library/j-jtp04223.html" rel="nofollow noreferrer">this article</a> that: </p> <blockquote> <p>Making a class final because it is immutable is a good reason to do so.</p> </blockquote> <p>I'm a bit puzzled by this... I understand that immutability is a g...
<p>The explanation for this is given in the book 'Effective Java'</p> <p>Consider <code>BigDecimal</code> and <code>BigInteger</code> classes in Java .</p> <p>It was not widely understood that immutable classes had to be effectively final when <code>BigInteger</code> and <code>BigDecimal</code> were written, so all ...
<p>Its a good idea to make a class immutable for performance reasons too. Take Integer.valueOf for example. When you call this static method it does not have to return a new Integer instance. It can return a previously created instance safe in the knowledge that when it passed you a reference to that instance last time...
17,620
<p>I need to define a calculated member in MDX (this is SAS OLAP, but I'd appreciate answers from people who work with different OLAP implementations anyway).</p> <p>The new measure's value should be calculated from an existing measure by applying an additional filter condition. I suppose it will be clearer with an ex...
<p>To begin with, you can define a new calculated measure in your MDX, and tell it to use the value of another measure, but with a filter applied:</p> <pre><code>WITH MEMBER [Measures].[Incoming Traffic] AS '([Measures].[Total traffic], [Direction].[(All)].[In])' </code></pre> <p>Whenever you show the new measure on ...
<p>I think you should put a column in your Total Traffic fact table for IN/OUT indication &amp; create a Dim table for the IN &amp; Out values. You can then analyse your data based on IN &amp; Out.</p>
24,021
<p>I am using a piece of html something like the following:-</p> <pre><code>&lt;a class="somePseudoClass" title="Blablabla"&gt;Something&lt;/a&gt; </code></pre> <p>and I have the following css in an imported file.</p> <pre><code>a.somePseudoClass:hover {color: #000000; text-decoration: underline;} </code></pre> ...
<p>Looks like you need a href attribute to make it work...</p> <pre><code>a.somePseudoClass {text-decoration: none;} a.somePseudoClass:hover {color: #000000; text-decoration: underline;} &lt;a class="somePseudoClass" title="Blablabla" href="#" onclick="return false;"&gt;Something&lt;/a&gt; </code></pre>
<p>this should work, but it depends on what other CSS declarations you have (before and after it)</p>
41,515
<p>I have a SVN structure like this:</p> <pre><code>/Projects /Project1 /Project2 /someFolder /Project3 /Project4 </code></pre> <p>I would like to move all the projects into the /Projects folder, which means I want to move Projects 3 and 4 from /someFolder into the /projects folder.</p> <p>The caveat...
<pre><code>svn help rename </code></pre> <p>Moving/renaming in subversion keeps history intact.</p>
<p>As far as I know, only Bazaar allow to keep history on directories, espacially when talking about moving directories. SVN allows you to keep history when moving files, but not directories.</p>
13,396
<p>I've got to get a quick and dirty configuration editor up and running. The flow goes something like this:</p> <p>configuration (POCOs on server) are serialized to XML.<br> The XML is well formed at this point. The configuration is sent to the web server in XElements.<br> On the web server, the XML (Yes, ALL OF IT)...
<p>Erm … <em>How</em> do you serialize? Usually, the XML serializer should never produce invalid XML.</p> <p>/EDIT in response to your update: Do <strong>not</strong> display invalid XML to your user to edit! Instead, display the properly escaped XML in the TextBox. Repairing broken XML isn't fun and I actually see no...
<p>This special character - "&lt;" - should have replaced with other characters so that your XML will be valid. Check this link for XML special characters:</p> <p><a href="http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/List_of_XML_a...
30,291
<p>I am writing a custom maven2 MOJO. I need to access the runtime configuration of another plugin, from this MOJO.</p> <p>What is the best way to do this?</p>
<p>Using properties is certainly one way to go, however not ideal. It still requires a user to define the ${propertyName} in multiple places throughout the pom. I want to allow my plugin to work with no modifications to the user's pom, other than the plugin definition itself.</p> <p>I don't see accessing the runtime p...
<p>I'm not sure how you would do that exactly, but it seems to me that this might not be the best design decision. If at all possible you should aim to decouple your Mojo from any other plugins out there.</p> <p>Instead I would recommend using custom properties to factor out any duplication in the configuration of se...
15,240
<p>I'm not talking about a pointer to an instance, I want a pointer to a class itself.</p>
<p>In C++, classes are not "<a href="http://en.wikipedia.org/wiki/First-class_object" rel="nofollow noreferrer">first class objects</a>". The closest you can get is a pointer to its <code>type_info</code> instance.</p>
<p>Depending upon how you want to think about pointers, you can have a "pointer" to a class, if by pointer you mean some integral value. Boost allows you to register types and assign a unique integer for every type that you register. If the types you are registering are all classes then you can look up at run-time the ...
36,314
<p>In my php web app, suppose I want to go the extra mile and in addition to going gang-busters and being anal-retentive about sanitizing my inputs, I also want to ensure that no JavaScript is being output in strings I am inserting into html templates. </p> <p>Is there a standard way to make sure I don't put JavaScrip...
<p>If you aren't opposed to external dependencies, the <a href="http://htmlpurifier.org/" rel="nofollow noreferrer">HTML Purifier library</a> is a pretty good filter for a majority of XSS attacks.</p>
<p>not exactly a standard way; because what if you were doing: <code>&lt;img src="${path}"&gt;</code>, and <code>${path}</code> expanded to <code>http://p0wned.com/jpg.jpg" /&gt;&lt;script src="p0wned.com/js.js"/&gt;</code></p> <p>Anyway I like this regular expression:</p> <pre><code>#from http://www.perlmonks.or...
18,843
<p>I'm painfully new to PHP, and was trying to set up phpBB on my local site. I have a stock debian install of apache2 and php5. The phpBB installer ran fine, connected to the database and created all its tables with no problem. But when I tried to open the login page, I got a 0-byte response.</p> <p>A little diggi...
<p>Just noted that you're using a @ in front of mysql_pconnect(). That suppresses all errors, which in this case is a pretty bad idea. Remove that and you would probably see the output. </p> <p>Otherwise:</p> <p>Check your php.ini, should be in /etc/php5/apache2/php.ini for debian.</p> <p>Check for a line called dis...
<p>I sometimes have PHP going down a 'black hole' when it finds a function that it can't find.</p> <p>Can you verify that the mysql extension is installed correctly?</p> <p>You can do this by creating a php page like this:</p> <pre><code>&lt;?php phpinfo(); ?&gt; </code></pre> <p>Saving it in your webroot, and then...
35,149
<p>I'm setting up a server which is on a network behind a firewall and I want programs on this computer to be able to use sendmail to send emails to any email address. We have an SMTP server running on this network (let's call it mailrelay.example.com) which is how we're supposed to get outgoing emails through the fir...
<p>@eli: modifying sendmail.cf directly is not usually recommended, since it is generated by the macro compiler. </p> <p>Edit /etc/mail/sendmail.mc to include the line:</p> <pre><code> define(`SMART_HOST',`mailrelay.example.com')dnl </code></pre> <p>After changing the sendmail.mc macro configuration file, it must ...
<p>@Espo: Thanks for the great advice on where to start. Your link would have been better if I had been configuring sendmail for its first use instead of taking an existing configuration and making this small change. However, once I knew to look for stuff on "SmartHost", I found an easier way.</p> <p>All I had to do...
6,559
<p>Does anyone have any experience with running C++ applications that use the boost libraries on uclibc-based systems? Is it even possible? Which C++ standard library would you use? Is uclibc++ usable with boost?</p>
<p>We use Boost together with GCC 2.95.3, libstdc++ and STLport on an ARMv4 platform running uClinux. Some parts of Boost are not compatible with GCC 2.x but the ones that are works well in our particular case. The libraries that we use the most are <em>date_time</em>, <em>bind</em>, <em>function</em>, <em>tuple</em> a...
<p>I have not tried but I don't know anything about uclibc that would prevent Boost from working.</p> <p>Try it and see what happens, I would say.</p>
39,893
<p>This is a very specific question regarding <strong>MySQL</strong> as implemented in <strong>WordPress</strong>.</p> <p>I'm trying to develop a plugin that will show (select) posts that have specific '<strong>tags</strong>' and belong to specific '<strong>categories</strong>' (both multiple)</p> <p>I was told it's im...
<p>I misunderstood you. I thought you wanted Nuclear or Deals. The below should give you only Nuclear and Deals.</p> <pre><code>select p.* from wp_posts p, wp_terms t, wp_term_taxonomy tt, wp_term_relationship tr, wp_terms t2, wp_term_taxonomy tt2, wp_term_relationship tr2 wp_terms t2, wp_term_taxonomy tt2, wp_term_...
<p>Thanks @Eric it works! Just a few code corrections for future reference:</p> <ul> <li>the first select statements misses a coma after wp_term_relationship tr2</li> <li>In the same select statemt the following must be change:</li> </ul> <pre><code>wp_terms t2, wp_term_taxonomy tt2, wp_term_relationship tr2</code>...
4,783
<p>I 'd like to use Criteria for my SQL query. I have 3 tables "home", "person" and a third table "liveIn" for correspondance between home and person.</p> <p>My sql query is "select home.id from home, person, liveIn where home.country = 'Japan' and person.id = '15' and liveIn.Homeid = home.id and liveIn.PersonId = per...
<p>Typically, my process runs something like this:</p> <ul> <li>I usually start with a logical model - a bastardised UML if you like - so I can visualise the key entities and relationships in my system. </li> <li>Then I think about a the underlying datamodel (thinking through potential issues around data consumption p...
<p>I never really bothered about UML (not "real" UML anyway). When I start a project, I'm interested in a few things:</p> <ol> <li>How will my software be used (and by whom)</li> <li>What does the software need to do</li> <li>How do the different features/components fit together</li> </ol> <p>For 1, you can use UML U...
41,473
<p>I have some char() fields in a DBF table that were left encrypted by a past developer in the project. </p> <p>However, I know the plaintext result of the decryption of several records. How can I determine the function/algorithm/scheme to decrypt the original data? These are some sample fields:</p> <p>For cryptext:...
<p>There is no easy way in general case. This question is too general. Try posting these plain + encrypted strings.</p> <p>EDIT: </p> <ul> <li>for the sake of learning you can read this article : <a href="http://en.wikipedia.org/wiki/Cryptography" rel="nofollow noreferrer">Cryptography on Wikipedia</a></li> <li><p>if...
<p>I think it's a misconception that XOR is an easily decryptable scheme. The theoretically strongest form of encryption is a one-time pad: simply a string of predetermined bits which you xor your plaintext with...</p> <p>Finite XORs, on the other hand...</p>
28,668
<p>I'm trying to do query result pagination with hibernate and displaytag, and Hibernate <code>DetachedCriteria</code> objects are doing their best to stand in the way. Let me explain...</p> <p>The easiest way to do pagination with displaytag seems to be implementing the <code>PaginatedList</code> interface that has, ...
<pre><code>Criteria.setProjection(null); Criteria.setResultTransformer(Criteria.ROOT_ENTITY); </code></pre> <p>Will effectively "reset" the criteria between the rowCount projection and execution of the criteria itself.</p> <p>I would make sure your Order hasn't been added before doing the rowCount, it'll slow things ...
<pre><code>public static DetachedCriteria Clone(this DetachedCriteria criteria) { var dummy = criteria.ToByteArray(); return dummy.FromByteArray&lt;DetachedCriteria&gt;(); } </code></pre>
48,179
<p>Given a table or a temp table, I'd like to run a procedure that will output a SQL script (i.e. a bunch of INSERT statements) that would populate the table. Is this possible in MS SQL Server 2000?</p>
<p>Something along the lines of</p> <blockquote> <pre><code>function(table) { for(var i=0;i&lt;table.rows.length;i++) { newcell = table.rows[i].cells[0].cloneNode(true); table.rows[i].appendChild(newcell); } } </code></pre> </blockquote>
<p>Something along the lines of</p> <blockquote> <pre><code>function(table) { for(var i=0;i&lt;table.rows.length;i++) { newcell = table.rows[i].cells[0].cloneNode(true); table.rows[i].appendChild(newcell); } } </code></pre> </blockquote>
20,362
<p>I have an Image control with it's source bound to a property on an object(string url to an image). After making a service call, i update the data object with a new URL. The exception is thrown after it leaves my code, after invoking the PropertyChanged event.</p> <p>The data structure and the service logic are al...
<pre><code>System.Windows.Deployment.Current.Dispatcher.BeginInvoke(() =&gt; {...}); </code></pre> <p>Also look <a href="https://stackoverflow.com/questions/1924408/invalid-cross-thread-access-issue/1925827#1925827">here.</a></p>
<p>The property getter for RootVisual on the Application class has a thread check which causes that exception. I got around this by storing the root visual's dispatcher in my own property in my App.xaml.cs:</p> <pre><code>public static Dispatcher RootVisualDispatcher { get; set; } private void Application_Startup(obj...
6,915
<p>How can you do a streaming read on a large XML file that contains a xs:sequence just below root element, without loading the whole file into a XDocument instance in memory?</p>
<p>Going with a SAX-style element parser and the <a href="http://msdn.microsoft.com/en-us/library/system.xml.xmltextreader.aspx" rel="noreferrer">XmlTextReader</a> class created with <a href="http://msdn.microsoft.com/en-us/library/system.xml.xmlreader.create.aspx" rel="noreferrer">XmlReader.Create</a> would be a good ...
<p>I think it's not possible if you want to use object model (i.e. XElement\XDocument) to query XML. Obviously, you can't build XML objects tree without reading enough data. However you can use <a href="http://msdn.microsoft.com/en-us/library/system.xml.xmlreader.aspx" rel="nofollow noreferrer">XmlReader</a> class.</p>...
6,736
<p>Why does the C++ STL not provide any "tree" containers, and what's the best thing to use instead?</p> <p>I want to store a hierarchy of objects as a tree, rather than use a tree as a performance enhancement...</p>
<p>There are two reasons you could want to use a tree:</p> <p>You want to mirror the problem using a tree-like structure:<br> For this we have <a href="https://www.boost.org/doc/libs/1_70_0/libs/graph/doc/index.html" rel="noreferrer">boost graph library</a></p> <p>Or you want a container that has tree like access cha...
<p>All STL containers can be used with iterators. You can't have an iterator an a tree, because you don't have ''one right'' way do go through the tree.</p>
25,232
<p>Anyone getting this error when using the new free chart controls MS bought from Dundas?</p> <p>"Error executing child request for ChartImg.axd"</p> <p>On the MSDN forum they suggested it was my web.config: <a href="http://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/1dc4b352-c9a5-49dc-8f35-9b176509...
<p>I encountered the same problem: the chart would work on one page but not on the next. Turns out if the chart is initialized for the first time in a POST (i.e. a postback) the error is thrown because the handler is configured incorrectly. To fix the issue modify the httpHandler configuration that user LaptopHeaven re...
<p>Just wanted to point out that it is also a permission problem with the image not found error.</p> <p>Set the "Allow modify" permissions on your image folder (per default it is "C:\TempImageFiles" for the account under which your website is running.</p> <p>Problem disappears.</p>
38,900
<p>I have analyzed a hibernate generated oracle database and discovered that a delete of a row from a single table will spawn the firing of 1200+ triggers in order to delete the related rows in child tables. The triggers are all auto-generated the same - an automatic delete of a child row without checking for existence...
<p>If possible, modify and setup your DB tables appropriately. - Involve a DBA if you have one at your disposal.</p> <p>You need to use <a href="http://www.techonthenet.com/oracle/foreign_keys/foreign_delete.php" rel="nofollow noreferrer">Foreign Key constraints and cascade deletes</a>. This eliminates the need for tr...
<p>You can query the special dba_objects table: </p> <pre><code>DECLARE X NUMBER; BEGIN SELECT COUNT(*) INTO X FROM DBA_OBJECTS WHERE OBJECT_TYPE = 'TRIGGER' AND OBJECT_NAME = 'YOUR_TRIGGER_NAME_HERE'; IF X = 0 THEN --Trigger doesn't exist, OK to delete... END IF; END; </code></pre>
48,841
<p>I have a WSI installer package that I'm using to install my application. The application itself can be run by a normal user, but I have a configuration app that should only be run by a system administrator. Thus, I don't want it to appear in the Start Menu for all users, just for the administrator.</p> <p>Is ther...
<p>since I doubt that you will know the name of every admin and there is no start folder for just admins, then I think a better solution would be for you to have the configuration app check to see if the user running it is an admin then exit gracefully if it is not.</p> <p>EDIT:</p> <p>Perhaps I should explain furthe...
<p>I would make a separate MSI for the configuration app and condition its launch sequence to require admin rights. Then you can install the application per user, or better yet update your configuration application to refuse to run at all as a regular user.</p>
12,268
<p>currently I have the following code:</p> <pre><code>String select = qry.substring("select ".length(),qry2.indexOf(" from ")); String[] attrs = select.split(","); </code></pre> <p>which works for the most parts but fails if given the following:</p> <pre><code>qry = "select a,b,c,DATETOSTRING(date_attr_name,'mm/dd/...
<pre><code>[^,]+\([^\)]+\)|[^,]+, </code></pre> <p>Should do it nicely provided you always add a final ',' to your select string:</p> <pre><code>a,b,c,DATETOSTRING(date_attr_name,'mm/dd/yyyy'),f,gg,dr(tt,t,),fff </code></pre> <p>would fail to split the last 'fff' attributes, but:</p> <pre><code>a,b,c,DATETOSTRING(d...
<p>You probably would have better luck with a <a href="http://www.gibello.com/code/zql/" rel="nofollow noreferrer">SQL parser</a>.</p>
35,319
<p>I have a (potentially dumb) question about the C++ STL. When I make a container (vector, set, map, etc), is it allocated on the stack or on the heap? If I make a set and put 5 million strings, will I have to worry about a stack overflow?</p>
<p>STL classes by default allocate their internal buffers from the heap, although these classes also allow custom allocators that allow a user to specify an alternate location to allocate from - e.g. a shared memory pool.</p>
<p>The container itself is allocated where you decide (it can be the stack, the heap, an object's member, etc) but the memory it uses is, by default, as others described, taken on the Free Store (managed through new and delete) which is not the same as the heap (managed through malloc/free).</p> <p><a href="http://www...
5,335
<p>For the past 2 years-(ish) I've been using <a href="http://maven.apache.org" rel="nofollow noreferrer">Maven2</a> for my build/continuous integration solution. I used <a href="http://ant.apache.org" rel="nofollow noreferrer">Ant</a> a bit before that but really didn't get a lot of experience with it. Now I've take...
<p>My experience with ant -- which is our primary build tool for Java source, so make of this what you will -- is that there are no such <em>formal</em> conventions. Many source projects I've seen organize things in a similar manner; JBoss uses &lt;module&gt;/src/main for sources, etc... Ant just uses whatever conven...
<p>An older resource but fine in my opinion are <a href="http://www.onjava.com/pub/a/onjava/2003/12/17/ant_bestpractices.html" rel="nofollow noreferrer">ant-best-practices</a>.</p>
24,619
<p>I have created a mutli-column combobox in VB.net 2008 using windows forms 2.0. I am having trouble accessing data once selected to use in the remainder of the form. There does not seem to be a selected event to use in conjunction with the winform 2.0 combobox.</p> <p>Does anyone have any experience using winforms 2...
<p>It may not be the only place, but <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.utilities.sputility.getserverrelativeurlfromprefixedurl.aspx" rel="nofollow noreferrer">SPUtility.GetServerRelativeUrlFromPrefixedUrl()</a> will parse URLs with ~site and ~sitecollection. MOSS also provides <a hre...
<p>I don't know for sure - but I'd bet that code is buried in one of the SharePoint HTTPModules or HTTPHandlers that run for every request.</p>
43,838
<p>Our company uses an app that was originally ColdFusion + Access later converted to classic ASP + MS Sql for task/time tracking called the request system. It's broken down by department, so there's one for MIS, marketing, logistics, etc. The problem comes in when (mainly managers) are using more than one at a time, w...
<p>refactor the code away from the direct Session("whatever") interface:</p> <ol> <li>create an API for session access and replace all existing use of Session with it (it can be a session 'class/object' or just an include-file)</li> <li>mangle the passed-in names for session variables with something that will make the...
<p>My manager (who's a business guy, not a code guy), is infatuated with this system. He's in no rush to rewrite it. If I did rewrite this the only session variables used would be login-related. I'm more concerned with fast than right unfortunately :(</p>
35,243
<p>I am getting a <code>NoClassDefFoundError</code> when I run my Java application. What is typically the cause of this?</p>
<p>While it's possible that this is due to a classpath mismatch between compile-time and run-time, it's not necessarily true.</p> <p>It is important to keep two or three different exceptions straight in our head in this case:</p> <ol> <li><p><strong><code>java.lang.ClassNotFoundException</code></strong> This excepti...
<p>I got this message after removing two files from the SRC library, and when I brought them back I kept seeing this error message.</p> <p>My solution was: Restart Eclipse. Since then I haven't seen this message again :-)</p>
5,466
<p>I recently had to take a quick look at Adobe InDesign server. In this enviroment you write your interactions with the servers libs via JavaSscript. </p> <p>This got me thinking, how could I use the Javascript language within a C# application so that I could expose set bits of functionality of my API/framework and a...
<p>Check this question:</p> <p><a href="https://stackoverflow.com/questions/356948/referencing-googles-v8-engine-from-a-net-app">Referencing Google’s V8 engine from a .NET app</a></p> <p>This article might be interesting:</p> <p><a href="http://www.west-wind.com/WebLog/posts/10688.aspx" rel="nofollow noreferrer">Eva...
<p>Try Javascript .NET:</p> <p><a href="http://javascriptdotnet.codeplex.com/" rel="nofollow noreferrer">http://javascriptdotnet.codeplex.com/</a></p> <p>It implements Google V8. You can compile and run Javascript directly from .NET code with it, and supply CLI objects to be used by the Javascript code as well. And V...
47,871
<p>I'm trying to create a horizontal 100% stacked bar graph using HTML and CSS. I'd like to create the bars using <code>DIVs</code> with background colors and percentage widths depending on the values I want to graph. I also want to have a grid lines to mark an arbitrary position along the graph.</p> <p>In my experime...
<p>You are right that CSS positioning is the way to go. Here's a quick run down:</p> <p><code>position: relative</code> will layout an element relative to <em>itself.</em> In other words, the elements is laid out in normal flow, then it is removed from normal flow and offset by whatever values you have specified (top,...
<p>If you need to position an element relative to its containing element first you need to add <code>position: relative</code> <strong>to the container element</strong>. The child element you want to position relatively to the parent <strong>has to have</strong> <code>position: absolute</code>. The way that absolute po...
13,053
<p><strong>Disclaimer:</strong> I am not a professional 3D printer, so I'm not really familiar with how 3D printing works.</p> <p>I was thinking about trying to make a real life model of the atomic orbitals, to clearly see how the orbitals are really shaped. I thought about trying to 3D print a block, made up of color...
<p><strong>problem definition</strong></p> <p>I'm not quite sure if it's really question for this group. Looks like the problem itself is more for programming or physics group. Having requested calculations (electron cloud shape) resolved, there will be something to print but...</p> <p><strong>printing probability cl...
<p>I suggest you look into Polysher: <a href="http://www.polymaker.com/shop/polysmoothpolysher/" rel="nofollow noreferrer">http://www.polymaker.com/shop/polysmoothpolysher/</a> and e3D cyclops extruder <a href="https://e3d-online.com/Cyclops" rel="nofollow noreferrer">https://e3d-online.com/Cyclops</a> you can make gra...
723
<p>I am trying to learn CodeIgniter to use for a shopping site, but I am not having luck with the official doc. Does anyone know of anything that will help?</p>
<p>re: CSS.</p> <p>I've got my CSS a separate folder at the root. (same place as 'index.php') ... /content/css/main.css</p> <p>Called as:</p> <pre><code>&lt;link href="&lt;?=base_url();?&gt;content/css/main.css" rel="stylesheet" type="text/css" /&gt; </code></pre>
<p>Just found a pretty good series on the basics of it: </p> <p><a href="http://capsizedesigns.com/blog/2008/05/getting-started-with-codeigniter-part-1/" rel="nofollow noreferrer">http://capsizedesigns.com/blog/2008/05/getting-started-with-codeigniter-part-1/</a> <a href="http://capsizedesigns.com/blog/2008/05/getting...
21,317
<p>How can I turn off certificate revocation for a WCF service's client? The client proxy was generated by wsdl.exe and inherits SoapHttpClientProtocol.</p>
<p>I think you're looking for <code>ServicePointManager.ServerCertificateValidationCallback</code>:</p> <blockquote> <p><a href="http://msdn.microsoft.com/en-gb/library/system.net.servicepointmanager.servercertificatevalidationcallback.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-gb/library/system.net.s...
<p>You can set certificate validation and revocation options in the config file for your application:</p> <p><a href="http://www.request-response.com/blog/PermaLink,guid,e9bb929b-d0b4-4626-b302-1d2715fc344a.aspx" rel="nofollow noreferrer">http://www.request-response.com/blog/PermaLink,guid,e9bb929b-d0b4-4626-b302-1d27...
24,979
<p>What is difference between <code>Server.Transfer</code> and <code>Response.Redirect</code>?</p> <ul> <li>What are advantages and disadvantages of each?</li> <li>When is one appropriate over the other?</li> <li>When is one not appropriate?</li> </ul>
<p><code>Response.Redirect</code> simply sends a message <a href="http://en.wikipedia.org/wiki/HTTP_302" rel="noreferrer">(HTTP 302)</a> down to the browser.</p> <p><code>Server.Transfer</code> happens without the browser knowing anything, the browser request a page, but the server returns the content of another. </p>...
<p><strong>Response.Redirect</strong> Response.Redirect() will send you to a new page, update the address bar and add it to the Browser History. On your browser you can click back. It redirects the request to some plain HTML pages on our server or to some other web server. It causes additional roundtrips to the server ...
27,749
<p>My model is a keycap for mechanical keyboards. There is the cap itself, and a stem with a hole in the form of a cross, which fits the switches themselves.</p> <p><a href="https://i.stack.imgur.com/r0Xxb.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/r0Xxb.jpg" alt="Print at bottom, the other cap...
<h2>This looks like a shift rather than a twist.</h2> <p>Looking closely at the "+" opening, it doesn't look as much twisted as it looks as if the top and bottom halves are sheared, with the top half shifted slightly right and the bottom shifted slightly left. The horizontal part of the plus seems aligned on the left...
<p>Another possibility is that those connectors you put in are pulling the cross-pattern off-center. Is there enough height that you could specify supports in that area instead? If so I'd recommend a brim "everywhere" to help stabilize the supports under the centerpost. </p> <p>If there is sufficient clearance in ...
1,597
<p>I was listening to <a href="http://itc.conversationsnetwork.org/shows/detail3798.html" rel="nofollow noreferrer">a podcast</a>. Where they talked about principles Toyota was using:</p> <blockquote> <p>Never do anything until you are ready to use it.</p> </blockquote> <p>I think this tells us to look in other pla...
<p>It <em>may</em> apply to software construction, but I am not sure it <em>does</em> apply</p> <p>If we consider the five elements in a "<a href="http://malvasiabianca.org/archives/2008/05/the-toyota-way-and-nemawashi/" rel="nofollow noreferrer">toyota-way of decision making</a>", based on the principle that "how you...
<p>It is a good agile practice to think just like that. There is also something called Test-Driven-Development, that helps you get software without bugs (almost), but also have that side effect that NOTHING is implemented that you don't use.</p> <p>A example is you're own collection class. If you only are needing a Ad...
13,602
<p>Working on a new back end system for my company, and one of their requests is for a window to become locked down and for the user to be sent to the login screen if they leave it idle for to long.</p> <p>I figure I'd do this with JavaScript by attaching listeners to clicks, mouse moves and key-ups but I worry about ...
<p>If you are wondering why you should use windbg over Visual Studio, then you need to read <a href="https://rads.stackoverflow.com/amzn/click/com/0321374460" rel="noreferrer" rel="nofollow noreferrer">Advanced Windows Debugging</a>. Any time you need to debug a truly ugly problem windbg has better technology to do it...
<p>I always liked the watch and trace feature: 'wt' -> It prints to the output window all the function calls as they happen. That was pretty cool stuff!</p>
13,074
<p>I have a .NET WinForms textbox for a phone number field. After allowing free-form text, I'd like to format the text as a "more readable" phone number after the user leaves the textbox. (Outlook has this feature for phone fields when you create/edit a contact)</p> <ul> <li>1234567 becomes 123-4567</li> <li>12345678...
<p>A fairly simple-minded approach would be to use a regular expression. Depending on which type of phone numbers you're accepting, you could write a regular expression that looks for the digits (for US-only, you know there can be 7 or 10 total - maybe with a leading '1') and potential separators between them (period, ...
<p>I don't know of any way other than doing it yourself by possibly making some masks and checking which one it matches and doing each mask on a case by case basis. Don't think it'd be too hard, just time consuming.</p>
22,912
<p>I'm pretty keen to develop my first Ruby app, as my company has finally blessed its use internally.</p> <p>In everything I've read about Ruby up to v1.8, there is never anything positive said about performance, but I've found nothing about version 1.9. The last figures I saw about 1.8 had it drastically slower than...
<p>There are some benchmarks of 1.8 vs 1.9 at <a href="http://www.rubychan.de/share/yarv_speedups.html" rel="nofollow noreferrer">http://www.rubychan.de/share/yarv_speedups.html</a>. Overall, it looks like 1.9 is a lot faster in most cases.</p>
<p>I'd second the recommendation of the use of Passenger - it makes deployment and management of Rails applications trivial</p>
4,551
<p>I have a Visual Studio Solution. Currently, it is an empty solution (=no projects) and I have added a few solution folders.</p> <p>Solution Folders only seem to be "virtual folders", because they are not really created in the Filesystem and files inside solution folders are just sitting in the same folder as the .s...
<p>No special setting. I don't think it's supported.</p> <p>You can create real folders in a "project" within the solution, but not in the solution itself.</p>
<p>The folder created underneath the solution will be virtual as said. Maybe this might be called a workaround but you can physically create the folder on disk either before or when you add new item/project and Robert should be a sibling of your dad.</p> <p>ps- on closer look maybe i should explain "bob's your uncle"...
33,511
<p>I'm drawing old school (unthemed - themed radios are a whole other problem) radio buttons myself using DrawFrameControl:</p> <pre><code>DrawFrameControl(dc, &amp;rectRadio, DFC_BUTTON, isChecked() ? DFCS_BUTTONRADIO | DFCS_CHECKED : DFCS_BUTTONRADIO); </code></pre> <p>I've never been able to figure out a sure fire...
<p>It has been a while since I worked on this, so what I am describing is what I did, and not necessarily a direct answer to the question.</p> <p>I happen to use bit maps 13 x 13 rather than 12 x 12. The bitmap part of the check box seems to be passed in the WM_DRAWITEM. However, I had also set up WM_MEASUREITEM an...
<p>It has been a while since I worked on this, so what I am describing is what I did, and not necessarily a direct answer to the question.</p> <p>I happen to use bit maps 13 x 13 rather than 12 x 12. The bitmap part of the check box seems to be passed in the WM_DRAWITEM. However, I had also set up WM_MEASUREITEM an...
8,703
<p>I am using an ancient version of Oracle (8.something) and my ADO.NET application needs to do some fairly large transactions. Large enough to not fin in our small rollback segments. Now we have a large rollback segment as well but it is not used by default.</p> <p>Oracle has a command to select the rollback segment ...
<p>If this is a 'one-off' requirement then one solution is to put the other rollback segments offline while you run your transactions then put them online when you've finished;</p> <pre><code>ALTER ROLLBACK SEGMENT &lt;name&gt; OFFLINE; ALTER ROLLBACK SEGMENT &lt;name&gt; ONLINE; </code></pre> <p>Otherwise make all ...
<p>I have absolutely no way of testing this, but you could try issuing a save point before your set transaction statement, e.g.</p> <blockquote> <p>SAVEPOINT use_big_rbs;</p> <p>SET TRANSACTION USE ROLLBACK SEGMENT big_rbs;</p> <p>UPDATE ...</p> <p>...</p> </blockquote>
36,616
<p>I'm trying to make a data bound column invisible after data binding, because it won't exist before data binding. However, the DataGrid.Columns collection indicates a count of 0, making it seem as if the automatically generated columns don't belong to the collection.</p> <p>How can I make a column that is automatic...
<p>You have to add code to the line item rendering code and set the visibility of that column to false. Even though its bound, the event will be fired for each record and you can manipulate the output.</p>
<p>The only way to do this I know of since it's created on the fly is to hide the cell, here's an example you can adapt:</p> <pre><code>protected void GridView_RowCreated(object sender, GridViewRowEventArgs e) { e.Row.Cells[1].Visible = false; } </code></pre>
11,748
<p>What steps do I need to take to get HTML documentation automatically building via the build step in Visual Studio? I have all the comments in place and the comments.xml file being generated, and Sandcastle installed. I just need to know what to add to the post-build step in order to generate the docs.</p>
<p>Some changes have been made since this question was asked. Sandcastle no longer includes <code>SandcastleBuilderConsole.exe</code>. Instead it uses plain old <code>MSBuild.exe</code>.</p> <p>To integrate this with visual studio here is what I did:</p> <p>Place this in your Post-build event:</p> <pre><code>IF "$(C...
<p>I must admit that I find the current version of Sandcastle a bit lacking; for large projects it is quite slow, and it isn't easy to integrate (since it is still early).</p> <p>For regular use, I actually find it easier just to point reflector at a folder with the dll and xml files - IIRC, it will load the xml file(...
26,018
<p>I'm trying to increase the timeout on all sessions. The site is hosted with Godaddy, and it is written in Flash (client side of course) and asp.net on the backend. I've added this to my web.config, </p> <pre><code>&lt;sessionState timeout="720"&gt; &lt;/sessionState&gt; </code></pre> <p>Is that really all that ...
<p>Yup! As in; Yes, that's the only thing you need to do...</p> <p>To get "never ending timeouts" you'd have to create a background HTTP request (which will transmit the session cookie) back to the server every 719 minute though. Though theoretically then you'd also have to have "Out of Process" sessions using e.g. so...
<p>If you are using Forms Authentication you will also need to set the Forms Authentication Timeout in your web.config</p> <p>Example:</p> <pre><code>&lt;authentication mode="Forms"&gt; &lt;forms name=".ASPXAUTH" loginUrl="/Home/Default.aspx" defaultUrl="/Dashboard/Default.aspx" protection="All" ...
40,822
<p>So our web server apps need to connect to the database, and some other apps have startup scripts that execute at boot time.</p> <p>What's the best way to store the name/password for these applications, in terms of</p> <ul> <li>security, e.g. perhaps we don't want sysadmins to know the database password</li> <li>ma...
<p>The best way to secure your password is to stop using one. Use a trusted connection: <a href="http://msdn.microsoft.com/en-us/library/ms998292.aspx" rel="nofollow noreferrer">How To: Connect to SQL Server Using Windows Authentication in ASP.NET 2.0</a>. Then you have nothing to hide - publish your web.config and so...
<p>You can bake a symmetric encryption key into your binary, and have that binary read an encrypted username/password from a file on disk when it starts up. </p> <p>However, this is not really much more than obfuscation, since your code is likely to be stored in some source repository somewhere. </p> <p>I would sug...
3,191
<p>After being troubled by <a href="http://blogs.cozi.com/tech/2008/03/transparent-png.html" rel="noreferrer">an issue</a> that I simply did not have the knowledge to debug, I've just decided that I <em>have</em> to learn how to use Windbg. My only problem: I have no clue where to start :-( I'm not really a WinApi-Guy,...
<p>For a book, try</p> <p><a href="https://rads.stackoverflow.com/amzn/click/com/0321374460" rel="nofollow noreferrer" rel="nofollow noreferrer">Advanced Windows Debugging (Addison-Wesley Microsoft Technology Series)</a></p> <p><a href="https://i.stack.imgur.com/27qDU.jpg" rel="nofollow noreferrer"><img src="https://...
<p><a href="https://rads.stackoverflow.com/amzn/click/com/0735622027" rel="nofollow noreferrer" rel="nofollow noreferrer">Debugging .NEt Applications</a> has a chapter on how to use WinDbg</p>
16,746
<p>I´ve been using my Ender 3 Pro for almost 1 year now. Always using the provided SD card. For a couple of days, the printed does not read any new file that I load to the SD card, but it does with the older files (and it then prints correctly as well).</p> <p>I tried deleting some old files that I don't need, I tried ...
<p>I think I found the problem. I think there was some crosstalk between the BLTouch wires and the other wires it was tied together leading to the hotend. When I moved the BLTouch wires away from the others the problem went away.</p> <p>I will be added a sheild to the cable in the future like in this <a href="https://w...
<p>The OP already found the problem and <a href="/a/16632/">answered</a> the question hinting to shielding of the cable. If this is the actual problem, of fiddling with the cables might have caused this, an alternative solution is presented as I've experienced similar behavior.</p> <p>If one side of the bed is higher t...
1,969
<p>In javascript, I've got a block of HTML like this:</p> <pre><code>&lt;h2&gt;{title}&lt;/h2&gt; &lt;p&gt;&lt;a href="{url}"&gt;{content}&lt;/a&gt;&lt;/p&gt; </code></pre> <p>And I'm trying use regex "match" to spit out an array of all the {item}'s. So my output should look like:</p> <pre><code>['title', 'url', 'co...
<p>You need to create a pattern with the global flag:</p> <pre><code>var pattern = new RegExp("\{[a-zA-Z]+\}", "g"); </code></pre> <p>or:</p> <pre><code>var pattern = /\{[a-zA-Z]+\}/g; </code></pre> <p>Then you can call the match() method on your string to get a list of matches:</p> <pre><code>var matches = "{Samp...
<p>I got off path by using <code>exec</code> for testing.</p>
37,881
<p>What are you guys using as reporting engine in .net, <strong>with end user designing capabilities</strong>?</p> <p>I tried DevExpress XtraReports, but i am not able to successfully achieve consistent results. (for example, i try to display a detailreport of sold machines for a certain contact -> first field works...
<p>SQL server Reporting services for any dynamic reports generated or Report builder for adhoc reports.</p>
<p>Please take a look at <a href="http://www.windwardstudios.com/" rel="nofollow noreferrer">Windward Reports</a>. With Windward you design the reports in Microsoft Word, Excel, or PowerPoint - so no learning curve for your end users. (Disclaimier - I'm the CTO at Windward.)</p> <p>As to your issue of not getting data...
38,262
<p>I'm creating a table that looks something like this.</p> <pre><code>CREATE TABLE packages ( productCode char(2) , name nvarchar(100) , ... ) </code></pre> <p>How do I make sure the productCode is always one of two values <code>XJ</code> or <code>XD</code>?</p>
<pre><code>ALTER TABLE packages ADD CONSTRAINT constraintname CHECK (productCode in ('XJ', 'XD')) </code></pre>
<p>In this case it sounds like the valueset for ProductCode is pretty limited and that you don't expects it to grow in a foreseeable future, so I tend to agree with checkconstraint answers. However in most cases I would implement the foreign key solution as suggested by Mr. Grant as my customers has a nasty habit of ch...
28,570
<p>I've got a nice little class built that acts as a cache. Each item has an expiration TimeSpan or DateTime. Each time an attempt to access an item in the cache is made, the item's expiration is checked, and if it's expired, the item is removed from the cache and nothing is returned.</p> <p>That's great for objects t...
<p>The best code is no code. Use the ASP.NET cache instead. You can reference it as System.Web.HttpRuntime.Cache in any application, not just web applications.</p>
<p>You can implement an LRU (Least Recently Used) strategy, keep your items sorted by access time, when a new item is inserted into the cache <strong>and</strong> the cache is full you evicted the item that is last in that list. See <a href="http://en.wikipedia.org/wiki/Cache_algorithms" rel="nofollow noreferrer">Cache...
17,094
<p>This is a contrived example, but lets say I have declared objects:</p> <pre><code>CustomObj fooObj; CustomObj barObj; CustomObj bazObj; </code></pre> <p>And I have an string array:</p> <pre><code>string[] stringarray = new string[] {"foo","bar","baz"}; </code></pre> <p>How can I programmatically access and insta...
<p>You need to be clear in your mind about the difference between an object and a variable. Objects themselves don't have names. Variable names are decided at compile-time. You can't access variables via an execution-time-determined name except via reflection.</p> <p>It sounds like you <em>really</em> just want a <cod...
<p>This is possible using reflection if the variables are class member variables, but it's hideously slow for anything more than very specialized applications. I think if you detail what you're trying to do, we can better offer suggestions. There's very rarely a case where you should access a variable like you're doi...
40,497
<p>The SQL Server Express 2008 setup allow you to assign different user account for each service. </p> <p>For a development environment, would you use a domain user, local user, NT Authority\NETWORK SERCVICE, NT Authority\Local System or some other account and why? </p>
<p><strong>Local System</strong> is not recommended, it is an administrator equivalent account and thus can lead to questionable coding that takes advantage of administrator privileges which would not be allowed in a production system since security conscious Admins/DBA's really don't like to run services as admin.</p>...
<p>Whatever it wants to use as default. Changing that is just asking for trouble later.</p>
8,915
<p>This snippet of Perl code in my program is giving the wrong result.</p> <pre><code>$condition ? $a = 2 : $a = 3 ; print $a; </code></pre> <p>No matter what the value of <code>$condition</code> is, the output is always 3, how come?</p>
<p>This is explained in the Perl <a href="http://perldoc.perl.org/perlop.html#Conditional-Operator" rel="noreferrer">documentation</a>.</p> <p>Because of Perl operator precedence the statement is being parsed as</p> <pre><code>($condition ? $a= 2 : $a ) = 3 ; </code></pre> <p>Because the ?: operator produces an ass...
<p>One suggestion to Tithonium's answer above:</p> <p>If you are want to assign different values to the same variable, this might be better (the copy-book way): </p> <p>$a = ($condition) ? 2 : 3;</p>
3,047
<p>For example:</p> <pre><code>int a = 12; cout &lt;&lt; typeof(a) &lt;&lt; endl; </code></pre> <p>Expected output:</p> <pre><code>int </code></pre>
<p>C++11 update to a very old question: Print variable type in C++.</p> <p>The accepted (and good) answer is to use <code>typeid(a).name()</code>, where <code>a</code> is a variable name.</p> <p>Now in C++11 we have <code>decltype(x)</code>, which can turn an expression into a type. And <code>decltype()</code> comes w...
<p>Consider this code:</p> <pre><code>#include &lt;iostream&gt; int main() { int a = 2; // Declare type &quot;int&quot; std::string b = &quot;Hi&quot;; // Declare type &quot;string&quot; long double c = 3438; // Declare type &quot;long double&quot; if(typeid(a) == typeid(int)) { std::cout&l...
10,757
<p>I know how they are different syntactically, and that C++ uses new, and C uses malloc. But how do they work, in a high-level explanation?</p> <p>See <a href="https://stackoverflow.com/questions/240212/what-is-the-difference-between-newdelete-and-mallocfree#240308">What is the difference between new/delete and mall...
<p>I'm just going to direct you to this answer: <a href="https://stackoverflow.com/questions/240212/what-is-the-difference-between-newdelete-and-mallocfree#240308">What is the difference between new/delete and malloc/free?</a> . Martin provided an excellent overview. Quick overview on how they <em>work</em> (without di...
<p>"new" does a lot more than malloc. malloc simply allocates the memory - it doesn't even zero it for you. new initialises objects, calls contructors etc. I would suspect that in most implementations new is little more than a thin wrapper around malloc for basic types.</p>
47,764
<p>I have this code</p> <pre><code>&lt;?php session_start(); if (isset($_GET["cmd"])) $cmd = $_GET["cmd"]; else die("You should have a 'cmd' parameter in your URL"); $pk = $_GET["pk"]; $con = mysql_connect("localhost","root","geheim"); if(!$con) { die('Connection failed because of' .mysql_error()); } mysql_select...
<p>It should be:</p> <pre><code>echo "&lt;img src=\"".$row['PIC_URL']."\"&gt;"; </code></pre>
<pre><code>while ($row = mysql_fetch_array($result)) { *snip* } echo "&lt;/table&gt;"; echo "&lt;img src=".$row['PIC_URL']."&gt;"; </code></pre> <p>Because the loop finished, $row is false. You need to change it to something like.</p> <pre><code>while ($row = mysql_fetch_array($result)) { *snip* $lastImg = $row['PIC_...
42,218
<p><strong>JavaFX</strong> is now out, and there are promises that Swing will improve along with JavaFX. Gone will be the days of ugly default UI, and at long last we can create engaging applications that are comparable to <strong>Flash, Air, and Silverlight</strong> in terms of quality.</p> <ol> <li><p>Will this mean...
<p>In my opinion Java Applets have been dead for years. I wrote some in the late 90s - a Tetris game during an internship to demonstrate on a 40MHz ARM Acorn Set Top Box for example. Of course I bet there are some casual game sites that have tonnes of them still, and thus it will remain supported, but active developmen...
<p>I agree with the others, Java Applets already died. JavaFX could possibly fill that void. However, I just don't see it replacing Java Desktop any time soon. It's the same thing as saying web apps will replace all desktop apps. Some people do believe that, and I agree that web apps will grow in popularity, howeve...
49,445
<p>I found an article on getting active tcp/udp connections on a machine.</p> <p><a href="http://www.codeproject.com/KB/IP/iphlpapi.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/IP/iphlpapi.aspx</a></p> <p>My issue however is I need to be able to determine active connections remotely - to see if a par...
<p>There is no way to know which ports are open without the remote computer knowing it. But you can determine the information without the program running on the port knowing it (i.e. without interfering with the program).</p> <p><strong>Use SYN scanning:</strong></p> <p>To establish a connection, TCP uses a three-wa...
<p><a href="https://stackoverflow.com/questions/124638/checking-ip-port-state-remotely#124643">neouser99</a> (et al) has suggested <a href="http://nmap.org/" rel="nofollow noreferrer">NMAP</a>. NMAP is very good if all you're trying to do is to detect ports that are open on the remote machine.</p> <p>But from the sound...
15,160
<p>I tried using the Microsoft ReportingControls but found them overly cumbersome, with too little documentation. I'd like a simple control that would convert a GridView control into a PDF document. I've started looking into PDFSHarp and am running into dead ends with documentation. Same thing with iTextSharp. I'm ...
<p>You could iterate over the data in your gridview and write it to a PDF table using iTextSharp. Have a look here: <a href="http://www.codeproject.com/KB/cs/iTextSharpPdfTables.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/cs/iTextSharpPdfTables.aspx</a></p> <p>I also recommend getting the book <a hr...
<p>I can recommend the ceTe DynamicPDF product if you just need to create PDF files. It is well documented and pretty easy to use. The only caveat that I would have is that your reports will all be built in Code. If you plan on adding a lot of reports then you might want to explore an alternative like Telerik's new ...
23,448
<p>1) user A goes to the site, creates an account, and logs in 2) user b goes to the site. Rather than having to log in, user b enters as though user b is user a. User b gets access to all of user a's data and can brows the site as user a.</p> <p>Note: user b does not log in. User b just hits the site, and the site...
<p>Check that you are not storing any data in static (c#) or Shared (VB) variables.</p>
<p>From research by other team members:</p> <blockquote> <p>Even though the authentication cookie may be in images from the portal, an authentication cookie with a ticket for David should never have been sent to Todd's browser. Also if images are cached somwhere somehow such that different users get other use...
32,894
<p>Is it possible to write a user interface in Java for an application written in C#?</p> <p>I am working on a user interface of a project that is written in C#, but I have no experience with C# and I am an avid Java user. Is it possible to build the user interface in Java using Java's Swing and AWT libraries that ope...
<p>You might be able to leverage some of the interoperability features that are integrated into Mono 2.0 </p> <p><a href="http://www.mono-project.com/Main_Page" rel="nofollow noreferrer">http://www.mono-project.com/Main_Page</a></p> <p>JNBridge is another possible interoperability solution:</p> <p><a href="http://ww...
<p>We did this recently and went the route of using a low level socket connection, but pushing xml through it. C# was the server side, and we used the Microsoft 'xsd' tool to generate the XSD schema for the objects and then used JAXB on the java side to generate java code to parse and hold the same objects.</p> <p>As...
40,425
<p>I may just be missing this functionality, but does anyone know if there is a widget available:</p> <p>I need to list the subject for all the entries that are associated with a given tag.</p> <p>For example: I have 5 articles tagged with "Tutorial", I'd like to see a list as follows:</p> <ul> <li>Tutorial 1: Insta...
<p>I don't think this is a concern.</p> <p>Yes, the mythical "somebody" can replace the implementation of MD5 with something insecure. But in order to do that, the mythical somebody must actually be able to get his code into the Ruby process. And if he can do that, then he presumably could also inject his code into a ...
<p>If someone monkeypatched an object or a module, then you need to look at 2 cases: He added a new method. If he is the only one adding this meyhod (which is very likely), then no problems arise. If he is not the only one, you need to see if both methods do the same and tell the library developer about this severe pr...
5,225
<p>How do I add a "last" class on the last <code>&lt;li&gt;</code> within a Views-generated list?</p>
<p>You could use the <strong>last-child</strong> pseudo-class on the li element to achieve this</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;style type="text/css"&gt; ul li:last-child { font-weight:bold } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;ul&gt; &lt;li&gt;IE&lt;/li&gt; &lt;li&gt;Firefox&lt;/li&gt; &lt;li&g...
<p>Does jquery come bundled with drupal, if so you could use </p> <pre><code>$('ul&gt;li:last').addClass('last'); </code></pre> <p>to achieve this</p>
13,881
<p>This may be too generic a question as is but... I am stumped by trying to move through the directories from within a shell script. I'm not a *nix power user, but I am comfortable working through the command line for most tasks. I'd like to call a script that can move 'me' to a directory instead of just the script pr...
<p>You can create a function that is called goto (or whatever) and make sure it is defined in your .bashrc (or you can "source" it from your current shell):</p> <pre><code>function goto { # the "$USER" part will expand to the current username # the "$1" will expand to the first argument to the function ("goto...
<p>You can't use cd in a bash script. You could alias the cd and path though.</p> <pre><code>alias goto='cd /path_to_work/usr/dir' </code></pre> <p>UPDATE: you would put that line in your .bashrc file and then do</p> <pre><code>source ~/.bashrc </code></pre> <p>to create the alias.</p>
36,694
<p>How to create a database using T SQL script on a specified location? Let's say, I want to create a SQL server database on <code>D:\temp\dbFolder</code>. How to do this?</p>
<p>When you create the new database you specify the location. For example:</p> <pre><code>USE [master] GO CREATE DATABASE [AdventureWorks] ON PRIMARY ( NAME = N'AdventureWorks_Data', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_Data.mdf' , SIZE = 167872KB , MAXSIZE = ...
<p>See this link : <a href="http://technet.microsoft.com/en-us/library/ms176061.aspx" rel="nofollow">CREATE DATABASE (Transact-SQL)</a></p> <pre><code>CREATE DATABASE [ADestinyDb] CONTAINMENT = NONE ON PRIMARY ( NAME = N'ADestinyDb', FILENAME = N'D:\temp\dbFolder\ADestinyDb.mdf' , SIZE = 3136 KB , MAXSIZE = UN...
14,706
<p>I started with <a href="http://code.google.com/p/jetlang/" rel="nofollow noreferrer">jetlang</a> and the basic samples are pretty clear. What I didn't found is a good sample for using the PoolFiber. Anybody played around with that already? I read also the retlang samples but it seems little bit different there.</p> ...
<p>Using a PoolFiber and ThreadFiber are nearly the same. The only difference is that the thread pool needs to initialized and used for creating each PoolFiber.</p> <pre><code>// create java thread pool. ExecutorService pool = Executors.newCachedThreadPool(); //initialize factory with backing pool PoolFiberFactory fib...
<p>Here it is on Github.</p> <p><a href="https://github.com/jetlang/jetlang/blob/readme/src/test/java/org/jetlang/examples/BasicExamples.java" rel="nofollow">https://github.com/jetlang/jetlang/blob/readme/src/test/java/org/jetlang/examples/BasicExamples.java</a></p> <p>Here's the mvn site <a href="http://jetlang.gith...
36,474
<p>I have more than one OpenID as I have tried out numerous. As people take up OpenID different suppliers are going to emerge I may want to switch provinders. As all IDs are me, and all are authenticated against the same email address, shouldn't I be able to log into stack overflow with any of them and be able to hit...
<p>I think each site that implements OpenID would have to build their software to allow multiple entries for your OpenID credentials. However, just because a site doesn't allow you to create multiple entries doesn't mean you can't swap out OpenID suppliers.</p> <h2>How to turn your blog into an OpenID</h2> <p>STEP 1...
<p>Doesn't using multiple open-id providers sort of undermine the point of open id?</p>
2,666
<p>To save some typing and clarify my code, is there a standard version of the following method?</p> <pre><code>public static boolean bothNullOrEqual(Object x, Object y) { return ( x == null ? y == null : x.equals(y) ); } </code></pre>
<p>With Java 7 you can now directly do a null safe equals:</p> <p><a href="http://docs.oracle.com/javase/7/docs/api/java/util/Objects.html" rel="noreferrer">Objects.equals(x, y)</a></p> <p>(The Jakarta Commons library ObjectUtils.equals() has become obsolete with Java 7)</p>
<p>If you are using &lt;1.7 but have Guava available: <a href="http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/base/Objects.html#equal(java.lang.Object,%20java.lang.Object)" rel="noreferrer"><code>Objects.equal(x, y)</code></a></p>
22,357
<p>Let's say I create a website like StackOverFlow and decide to use OpenID. What's to prevent me, or anyone else for that matter, from phishing the ID's? That is, how can you truly know that any website is using OpenID and not pretending to? And how do you protect myself against this?</p> <p>Expanding on this, let's ...
<p>All you enter is the ID, no password. The ID is public, therefore "phishing" it is not a security hole. Some providers even use the same ID for all users, for instance the ID for a google account is always <code>https://www.google.com/accounts/o8/id</code>. See the <a href="http://en.wikipedia.org/wiki/OpenID#Loggin...
<p>Funny story. I found an exploit on SO that allowed me to change someone's profile entirely. If Jeff'd been using email+password, I could have owned his account, but because SO uses OpenID, there was nothing to do but change his Gavitar to something funny.</p> <p>The bug in question was reported, fixed, and I'm stil...
41,193
<p>Searching for some sample code for converting a point in WGS84 coordinate system to a map position in Google Maps (pixel position), also supporting zoom levels. </p> <p>If the codes is well commented, then it can also be in some other language.</p> <p>You can also point me to a open source Java project :)</p> <p>...
<p><a href="http://web.archive.org/web/20110809084551/http://mapki.com/wiki/Tile_utility_code_in_Java" rel="nofollow noreferrer">Tile utility code in Java</a> on mapki.com (great resource for google map developers)</p>
<p>Someone took the javascript code from Google Maps and ported it to python: <a href="http://code.google.com/p/gheat/source/browse/trunk/__/lib/python/gmerc.py" rel="nofollow noreferrer">gmerc.py</a></p> <p>I've used this and it works great.</p>
2,922
<p>What are the best practices in setting up a new instance of TFS 2008 Workgroup edition? </p> <p>Specifically, the constraints are as follows:</p> <ul> <li>Must install on an existing Windows Server 2008 64 bit</li> <li>TFS application layer is 32 bit only</li> </ul> <p>Should I install SQL Server 2008, Sharepoin...
<p>This is my recipe for installing TFS 2008 SP1. </p> <p>There is no domain controller in this scenario, we are only a couple of users. If I was to do it again, I would consider changing our environement to use a active directory domain.</p> <ul> <li>Host Server running Windows Server 2008 with 8GB RAM and quad pro...
<p>I just upgraded our team to TFS 2008, from TFS 2005. The hardest part was upgrading SharePoint 2.0 to 3.0, so I would make sure to do that first, if you have not already installed TFS 2008. We had a couple of other difficulties, but they were all either related to the SharePoint upgrade, or to the fact that we were ...
5,254
<p>I start a .Net server side program on my local workstation, but soon it throws a security exception. I searched the web for answers, but no quick fix was found / worked. I just want to run my program. How do I get rid of the exception? I fully trust the program, because its mine.</p> <p>Edit: Oh, yes, I do run the ...
<p><a href="http://blogs.msdn.com/shawnfa/archive/2008/05/12/fulltrust-on-the-localintranet.aspx" rel="nofollow noreferrer">.NET 3.5 SP1 has better support for running applications on the local intranet.</a> </p> <p>If you can't target 3.5 SP1, you can map the share you're running the application from to a local driv...
<p>As a temporary measure, you can type...</p> <pre><code>caspol -s off </code></pre> <p>...and all .NET Code Access Security is suspended (until you hit &lt; enter >).</p>
24,079
<p>In a progression of languages, I have been learning C and C++. Now I would like to learn C#. I know there are some drastic differences between them - such as the removal of pointers and garbage collection. However, I don't know many of the differences between the two.</p> <p>What are the major differences that a...
<p><a href="https://msdn.microsoft.com/en-us/library/yyaad03b(v=vs.90).aspx?f=255&amp;MSPPError=-2147217396" rel="noreferrer">C# for C++ Developers</a> is a great place to start. It is a table that lists the most important comparisons between the two languages.</p> <p>Once you have explored some of these differences,...
<p>Look at the Generic collections and LINQ (all the related technology to LINQ) for STL like functionality.</p> <p>The number one thing to note is that ~/Destructor is c++ is nothing like the ~/finalizer in c# -- See IDisposable/using.</p>
34,925
<p>I need the name of the current logged in user in my <strong>Air/Flex</strong> application. The application will only be deployed on Windows machines. I think I could attain this by regexing the User directory, but am open to other ways.</p>
<p>Also I would try:</p> <pre><code>File.userDirectory.name </code></pre> <p>But I don't have Air installed so I can't really test this...</p>
<p>Update way later: there's actually a built in function to get the current user. I think it's in nativeApplication.</p>
2,376
<p>This confusion arises as most people are trained to evaluate arithmetic expressions as per <a href="http://en.wikipedia.org/wiki/PEMDAS#Mnemonics" rel="nofollow noreferrer">PEDMAS or BODMAS rule</a> whereas arithmetic expressions in programming languages like C# do not work in the same way.</p> <p>What are your tak...
<p><em>Precedence</em> rules specify priority of operators (which operators will be evaluated first, e.g. multiplication has higher precedence than addition, PEMDAS). </p> <p>The <em>associativity</em> rules tell how the operators of same precedence are grouped. Arithmetic operators are left-associative, but the assig...
<p>I am not sure there really is a difference. The traditional BODMAS (brackets, orders, division, multiplication, addition, subtraction) or PEDMAS (parentheses, exponents, division, multiplication, addition, subtraction) are just subsets of all the possible operations and denote the order that such operations should ...
9,621
<p>On Linux/GCC I can use the -rpath flag to change an executables search path for shared libraries without tempering with environment variables.</p> <p>Can this also be accomplished on Windows? As far as I know, dlls are always searched in the executable's directory and in PATH. </p> <p>My scenario: I would like t...
<p>Sadly there is no direct analogue to RPATH. There are a number of alternative possibilities, each of them most likely undesirable to you in its own special way.</p> <p>Given that you need a different exe for each build flavor anyway to avoid runtime library clashes, as you might guess the easiest thing to do is to ...
<p>The search order for DLLs in Windows is described on <a href="http://msdn.microsoft.com/en-us/library/ms682586%28VS.85%29.aspx" rel="noreferrer">this page</a> on MSDN. If you're using <a href="http://msdn.microsoft.com/en-us/library/ms686944%28VS.85%29.aspx" rel="noreferrer">run-time dynamic linking</a>, you can spe...
13,328
<h2>Update</h2> <p>I am making this a community wiki, for three reasons:</p> <ul> <li>I don't feel like I got a definitive answer, but</li> <li>I have long since stopped needing an answer, because I rolled my own accordion function</li> <li>this question gets tons of views, so clearly lots of people are still interes...
<p>I feel your pain! I recently went through a ridiculous troubleshoot where I tore everything out of the master page and page layout block by block (this was actually in SharePoint), continuously slimming down the page.</p> <p>The end result ended up being <strong>not having a doc type</strong> for the html document ...
<p>In options you should set:</p> <pre><code> navigation: true </code></pre>
43,066
<p>I mean, can you use couchDB for:</p> <ul> <li>CRUD of items, users</li> <li>bids and auctions resolutions</li> <li>bidirectional califications</li> <li>forum</li> <li>items comparison</li> </ul>
<p>You could try to use CouchDB for an application - as to whether you would be successful is another question. </p> <p>Something on the scale of eBay will have special requirements that are not representative of a typical application, If you are building a small auction site then perhaps CouchDB would suffice. A docu...
<p>I would look to see how Amazon uses SimpleDB internally (or do they?). Might have some clues as to right ways to use a document-based database.</p>
36,511
<p>For example:</p> <pre><code>from datetime import &lt;c-x&gt;&lt;c-o&gt;{list of modules inside datetime package} </code></pre>
<p>THe other option is when you create the project simply uncheck the default box for "create directory for solution"</p>
<p>I couldn't find a solution file for my project. I was able to run the project on one machine without a .sln in the project. The reason it worked on the machine I created it on was that that I keep my VS projects under C:\Dev\Projects but Visual Studio kept its .sln file c:\users\xyz\documents\VisualStudio2015\pro...
26,274
<p>So I have a script that I want to run as root, without hangup and nicely. What order should I put the commands in?</p> <p>sudo nohup nice foo.bash &amp;</p> <p>or</p> <p>nohup nice sudo foo.bash &amp;</p> <p>etc.</p> <p>I suspect it doesn't matter but would like some insight from those who <strong>really</stro...
<p>If negative niceness is desired, I would do: sudo nohup nice command because according to `info coreutils' nohup should <em>preceed</em> nice. If I want a negative nice value, sudo must come before, since only root is able to use negative nice values.</p> <p>If positive niceness is desired, I would do simply: nohup...
<p>I guess all of them do an exec* syscall to pass the ball to the next one, so, whatever the order, it won't leave any hanging processes.</p> <p>I'd say that nohup should be last so that the two other don't clober the signal handler. (I'm sure nice does not play with signals, but sudo does.)</p> <p>Then, sudo and ni...
45,607
<p>Say I have a <code>Textbox</code> nested within a <code>TabControl</code>. </p> <p>When the form loads, I would like to focus on that <code>Textbox</code> (by default the focus is set to the <code>TabControl</code>).</p> <p>Simply calling <code>textbox1.focus()</code> in the <code>Load</code> event of the form do...
<p>The following is the solution:</p> <pre><code>private void frmMainLoad(object sender, EventArgs e) { ActiveControl = textBox1; } </code></pre> <p>The better question would however be why... I'm not entirely sure what the answer to that one is.</p> <p>Edit: I suspect it is something to do with the fact that bo...
<pre><code> private void ChildForm1_Load(object sender, EventArgs e) { ActiveControl = txt_fname; } </code></pre> <p>i use this code it works fine on win tab control or dotnetbar supertab contrl</p>
7,116
<p>What is the main difference between <code>StringBuffer</code> and <code>StringBuilder</code>? Is there any performance issues when deciding on any one of these?</p>
<p><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/StringBuffer.html" rel="noreferrer"><code>StringBuffer</code></a> is synchronized, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/StringBuilder.html" rel="noreferrer"><code>StringBuilder</code></a> is not.</p>
<p>Every method present in StringBuffer is Synchronized. hence at a time only one thread is allowed to operate StringBuffer object. It Increases waiting time of a Thread and Creates Performance problems to overcome this problem SUN People intoduced StringBuilder in 1.5 version.</p>
46,279
<p>We use Log4j (and Commons Logging) to log our error messages. Now we want to set up an additional log appender that outputs fatal errors to syslog, but without the exceptionally long Java stacktraces (those will still be available in the full log file).</p> <p>How would one configure this (using log4j.xml)? Is ther...
<p>Edit after reading some more of the source:</p> <p>You still need to subclass PatternLayout, but the method you want to override is ignoresThrowable(): it should return false, which will prevent the appender from writing the Throwable (it assumes that the layout has done so already).</p> <p>No way to specify this ...
<p>If you can change the source code, then another option is available for consideration.</p> <p>In my applications, I always and only log FATAL messages from my applications entry point (e.g., "main()"), since I only know that they are fatal if I am about to exit the application because of them.</p> <p>Therefore, in...
45,350
<p>The problem is not about randomness itself (we have rand), but in cryptographically secure PRNG. What can be used on Linux, or ideally POSIX? Does NSS have something useful?</p> <p><strong>Clarification</strong>: I know about /dev/random, but it may run out of entropy pool. And I'm not sure whether /dev/urandom is ...
<p>Use <code>/dev/random</code> (requires user input, eg mouse movements) or <code>/dev/urandom</code>. The latter has an entropy pool and doesn't require any user input unless the pool is empty.</p> <p>You can read from the pool like this:</p> <pre><code>char buf[100]; FILE *fp; if (fp = fopen("/dev/urandom", "r"))...
<p>The <code>/dev/random</code> device is intended to be a source of cryptographically secure bits.</p>
14,621
<p>I'm trying to install some Ruby Gems so I can use Ruby to notify me when I get twitter messages. However, after doing a <code>gem update --system</code>, I now get a zlib error every time I try and do a <code>gem install</code> of anything. below is the console output I get when trying to install ruby gems. (along w...
<p>I just started getting this tonight as well. Googling turned up a bunch of suggestions that didn't deliver results</p> <pre><code>gem update --system </code></pre> <p>and some paste in code from jamis that is supposed to replace a function in package.rb but the original it is supposed to replace is nowhere to be...
<p>Try updating <a href="http://gnuwin32.sourceforge.net/packages/zlib.htm" rel="nofollow noreferrer">ZLib</a> before you do anything else. I had a similar problem on OS X and updating <a href="http://search.cpan.org/~pmqs/IO-Compress-2.020/lib/Compress/Zlib.pm" rel="nofollow noreferrer">Compress::Zlib</a> (a Perl inte...
4,791
<p>Can a flash front end talk to a .net backend?</p>
<p>Yes.</p> <p>We use <a href="http://www.adobe.com/products/flex/" rel="nofollow noreferrer">Adobe Flex</a> to talk to .Net XML web services.</p> <p>Be careful with complex serialised .Net types (for instance DataSets) - ActionScript can't handle them. </p> <p>Instead produce simple XML with primitive types.</p> <...
<p>My older brother and I developed several methods for Flash/.Net communication. I've seen web services mentioned above (which is a great way of doing it), but we also used simple .aspx pages and had stuff passed via querystring (poor man's way of doing things), using Flashvars to get data TO Flash, but my favorite -...
28,458
<p>I created a new project in Materialise Magics, added a few parts (different STLs), moved them around in certain positions and now I want to export this project into another STL, containing my recent work.</p> <p>The export menu seems to be all grey, like this function is not available. Do I have to do some repairin...
<p>Yes. Look up Arduino Ramps 1.4</p> <p><a href="http://reprap.org/wiki/RAMPS_1.4" rel="noreferrer">http://reprap.org/wiki/RAMPS_1.4</a></p> <p>Following the programing is all done for you in the firmware. That said you can edit it. Just open the firmware files -- it is compiled when you upload them. Generally howe...
<p>While Star Wind's answer is best as far as addressing what was not asked, but was probably the intent of the question, for educational purposes:</p> <p>To control the printer you need an microcontroller (most popular are Arduino) which will interface with the motor drivers. Microcontrollers cannot output the curren...
331
<p>I have a strange phenomenon while continuously instantiating a com-wrapper and then letting the GC collect it (not forced).</p> <p>I'm testing this on .net cf on WinCE x86. Monitoring the performance with .net Compact framework remote monitor. Native memory is tracked with Windows CE Remote performance monitor from...
<p>I doubt it's a bug in RPM. What we don't have here is any insight into the Ppb.Drawing stuff. The place I see for a potential problem is the GetIImagingFactory call. What does it do? It's probably just a singleton getter, but it's something I'd chase.</p> <p>I also see an AllochHGlobal, but nowhere do I see that...
<p>Well, there's a bug in your code in that you're creating a lot of IDisposable instances and never calling Dispose on them. I'd hope that the finalizers would eventually kick in, but they shouldn't really be necessary. In your production code, do you dispose of everything appropriately - and if not, is there some rea...
48,937
<p>I am looking for a way to mount\unmount a USB flash drive using VBScript. This is the closest I was able to get.</p> <pre><code>Sub EjectDrive(strDrive) On Error Resume Next CONST SSF_DRIVES = 17 Set objShell = CreateObject("Shell.Application") Set objDrive = objShell.Namespace(SSF_DRIVES).ParseName(strDrive) objD...
<p>This will work on Windows Server 2003, but not NT/2000/XP/Vista unfortunately.</p> <pre><code>strComputer = "." Set objWMIService = GetObject("winmgmts:" _ &amp; "{impersonationLevel=impersonate}!\\" &amp; strComputer &amp; "\root\cimv2") Set colItems = objWMIService.ExecQuery _ ("Select * From Win32_Volum...
<p>You can popup the eject dialog by using something like this. I am not sure if it possible to unmount a specific device.</p> <pre><code>Set WshShell = WScript.CreateObject("WScript.Shell") intReturn = WshShell.Run("RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll", 1, TRUE) </code></pre>
37,921
<p>I'm currently using <a href="http://www.usysware.com/dpack/" rel="noreferrer">DPack</a> as this adds a "Collapse All Projects" option to the Solution node in Solution Explorer. It works pretty well but can take a while to execute and doesn't always collapse everything fully.</p> <p>Are there any better alternatives...
<p>For VS2005, I've been using <a href="http://weblogs.asp.net/gmilano/archive/2006/10/17/Easily-Add-a-string-resource-with-CoolCommands.aspx" rel="noreferrer">CoolCommands 4.0</a>. The feature description is more complete for the <a href="http://weblogs.asp.net/gmilano/archive/2006/05/10/446010.aspx" rel="noreferrer"...
<p><a href="http://visualstudiogallery.msdn.microsoft.com/e5f41ad9-4edc-4912-bca3-91147db95b99/" rel="nofollow">PowerCommands for Visual Studio</a> will work for both VS2008 and VS2010. It is the Microsoft-enabled way to do this quickly.</p>
10,868
<p>Before, I have found the "Cost" in the execution plan to be a good indicator of relative execution time. Why is this case different? Am I a fool for thinking the execution plan has relevance? What specifically can I try to improve v_test performance?</p> <p>Thank you.</p> <p>Using Oracle 10g I have a simple query ...
<p>As <a href="http://download.oracle.com/docs/cd/A87860_01/doc/server.817/a76965/c20a_opt.htm#16287" rel="nofollow noreferrer">the Oracle documentation says</a>, the cost is the estimated cost relative to a particular execution plan. When you tweak the query, the particular execution plan that costs are calculated re...
<p>Have you gathered optimiser stats on all the underlying tables? Without them the optimiser's estimates may be wildly out of kilter with reality.</p>
12,806
<p>I've seen various options for URL rewriting here on Stack Overflow, and other places on the web, but was curious to see if there were other options.</p>
<p>This is speculation, as Cookies and URL Rewriting are the big two, but technologically, I think it'd be possible to:</p> <ul> <li>do some massive hackery with javascript that captures all links and submits a form with information.</li> <li>track the session on the server based on IP</li> </ul> <p>Both have their d...
<p>Session variables? At work, we are not allowed to use non session-cookies without a load of permissions.</p>
31,169