instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>Recently I was working with generating a PDF from Crystal Reports through a webform. It was failing, which I determined to be caused by the permissions settings on the c:\windows\temp dir. I gave the Network Service account full access to this folder, which promptly fixed the issue. But is there a reason the Ne... | <p>These days, the default option will tend to be the more secure one. I don't think there's any other reason.</p>
<p>I've had the same issue as you, and in my environment just gave the permission and moved on.</p>
<p><a href="https://stackoverflow.com/questions/167605/should-the-network-service-account-receive-temp... | <p><strong>%windows%\temp</strong> is not for general temp'ing and barfing around. It is crystal clear that Crystal Reports is abusing that directory. This happens a lot when developers are too lazy to boot up their machines with anything but an admin account.</p>
<p>Every user (including Network Service) has their ow... | 20,246 |
<p>Is there any regular expression library that i can use with CString of vc6?
Opensource/Free library is needed</p>
| <p>Version 3.1.3 of the <a href="http://www.tropicsoft.com/Components/RegularExpression/" rel="nofollow noreferrer">Regular Expression Component Library</a> based on boost regex supports VC6 and even version below than that.</p>
| <p>Boost has some support for VC6. Be prepared to fight with the compiler every step of the way though.</p>
| 38,654 |
<p>just wondering if anyone has ever tried embedding and actually integrating any js engine into the .net environment. I could find and actually use (after a <strong>LOT</strong> of pain and effort, since it's pretty outdated and not quite finished) spidermonkey-dotnet project. Anyone with experience in this area? Engi... | <p>The open source JavaScript interpreter Jint (<a href="http://jint.codeplex.com" rel="noreferrer">http://jint.codeplex.com</a>) does exactly what you are looking for.</p>
<p><strong>Edit:</strong> <br/>
The project has been entirely rewritten and is now hosted on Github at <a href="https://github.com/sebastienros/ji... | <p>It's Possible now with <code>ASP.Net MVC4 Razor</code> View engine. the code will be this:</p>
<pre><code>// c# class
public class A
{
public string Hello(string msg)
{
return msg + " whatewer";
}
}
// js snippet
<script type="text/javascript">
var a = new A();
console.log('@a.Hello('Call... | 20,814 |
<p>I have a BasePage class which all other pages derive from:</p>
<pre><code>public class BasePage
</code></pre>
<p>This BasePage has a constructor which contains code which must always run:</p>
<pre><code>public BasePage()
{
// Important code here
}
</code></pre>
<p>I want to force derived classes to call the ... | <p>The base constructor will always be called at some point. If you call <code>this(...)</code> instead of <code>base(...)</code> then that calls into another constructor in the same class - which again will have to either call yet another sibling constructor or a parent constructor. Sooner or later you will always get... | <p>One of the base constructors always needs to be called, and the default one is called when the base constructor is not explicitly stated.</p>
<p>Edit: rephrased for clarity. </p>
| 41,961 |
<p>I'm working on an embedded Linux project that interfaces an ARM9 to a hardware video encoder chip, and writes the video out to SD card or USB stick. The software architecture involves a kernel driver that reads data into a pool of buffers, and a userland app that writes the data to a file on the mounted removable de... | <p>For the record, there turned out to be two main aspects that seem to have eliminated the problem in all but the most extreme cases. This system is still in development and hasn't been thoroughly torture-tested yet but is working fairly well (touch wood).</p>
<p>The big win came from making the userland writer app m... | <p>Well obvious first, have you tried explicitly telling the file to flush? I also think there might be some ioctl you can use to do it, but I honestly haven't done much C/POSIX file programming.</p>
<p>Seeing you're on a Linux kernel you should be able to tune and rebuild the kernel to something that suits your needs... | 10,361 |
<p>Given a Marlin firmware and a line of G-code such as the following:</p>
<blockquote>
<p>G1 F100 X50 Y50 Z0 E-10</p>
</blockquote>
<p>What defines the speed at which the stepper motor associated with the E-value is retracting? It is my understanding that the Feed Rate defines the speed of the movement (in this ca... | <p>You instruct the printer to move from a certain X-Y position instructed by the previous move, to X=50 and Y=50. While moving at a feedrate of 100 mm/min, it will also retract 10 mm of filament (if the previous extruder distance was 0) during that move. If the movement distance is large, the retraction is slow. If yo... | <p>It seems like you are particularly talking about your extruder, please correct me if I have misread.</p>
<p>In the command <code>G1 F100 X50 Y50 Z0 E-10</code>:</p>
<ul>
<li><code>G1</code> - move linearly</li>
<li><code>F100</code> - Use a feed rate of 100 mm/minute</li>
<li><code>X50 Y50 Z0</code> - tells those ... | 1,093 |
<p>Is there a way to do your timezone offsets on the server side, by reading something in the request over http, instead of sending everything to the client and letting it deal with it?</p>
| <p>This is more complicated but I've had to resort to this scenario before because machine and user profile settings sometimes don't match your visitor's preferences. For example, a UK visitor accessing your site temporarily from an Australian server.</p>
<ol>
<li><p>Use a geolocation service (e.g MaxMind.com) as sugg... | <p>In any of the events prior to Page Unload...Request.ServerVariables. If you want their physical timezone then you check their IP address and use an IP to Geo-Location conversion tool. </p>
<p>I'm not sure if there's another way you can do it, so if you require the timezone their computer is configured for, it wou... | 43,939 |
<p>I need to get a file into memory in my app from a secured web location. I have the URL of the file to capture, but can't seem to get the security issue resolved. Here's the code from the <a href="http://groovy.codehaus.org/Simple+file+download+from+URL" rel="nofollow noreferrer">Cookbook samples page</a>:</p>
<pr... | <p>If creds on url doesn't work, you can use this. It works for Basic Authentication.</p>
<pre><code>new File(localPath).withOutputStream { out ->
def url = new URL(remoteUrl).openConnection()
def remoteAuth = "Basic " + "${user}:${passwd}".bytes.encodeBase64()
url.setRequestProperty("Authorization", re... | <p>Depending on the kind of auth for the server, you could put the creds on the url itself:</p>
<pre><code>def address = "http://admin:sekr1t@myhost.com"
def url = new URL(address)
assert "admin:sekr1t" == url.userInfo
</code></pre>
<p>If you're not going through a proxy, you don't want to do the proxy stuff that you... | 45,193 |
<p>I have experienced an annoying issue with Visual Studio 2005... sometimes when I rebuild, and even if I do a Rebuild Solution, it will come back with no errors or warnings, but then when I later edit another code file, even without changing it, and rebuild, it will find an error or warning in that other file. Clear... | <p>I've seen this happen before when you have multiple projects in your solution and the references get mixed up.</p>
<p>Say you have four projects in your solution, Common, Business, Data, and UI. Assume that Common is referenced by the other three projects. </p>
<p>What we want is for Common to be a "project refere... | <p>Is this related to the Configuration Manager? There you can select which projects in your solution build. Not sure if this helps.</p>
| 10,964 |
<p>I don’t think I’ve grokked currying yet. I understand what it does, and how to do it. I just can’t think of a situation I would use it.</p>
<p>Where are you using currying in JavaScript (or where are the main libraries using it)? DOM manipulation or general application development examples welcome.</p>
<p><a href=... | <p>Here's an <a href="http://javascriptweblog.wordpress.com/2010/10/25/understanding-javascript-closures/" rel="noreferrer"><strong>interesting AND practical use of currying in JavaScript that uses closures</strong></a>:</p>
<blockquote>
<pre><code>function converter(toUnit, factor, offset, input) {
offset = offse... | <p>I agree that at times you would like to get the ball rolling by creating a pseudo-function that will always have the value of the first argument filled in. Fortunately, I came across a brand new JavaScript library called jPaq (h<a href="http://jpaq.org/" rel="nofollow">ttp://jpaq.org/</a>) which provides this funct... | 13,892 |
<p>It looks quite easy to find such a tool for Java (<a href="http://checkstyle.sourceforge.net/" rel="noreferrer">Checkstyle</a>, <a href="http://jcsc.sourceforge.net/" rel="noreferrer">JCSC</a>), but I can't seem to find one for C/C++. I am not looking for a lint-like static code analyzer, I only would like to check ... | <p>The only tool I know is <a href="http://bitbucket.org/verateam/vera" rel="nofollow noreferrer">Vera</a>. Haven't used it, though, so can't comment how viable it is. <strike><a href="http://www.inspirel.com/vera/ce/demo.html" rel="nofollow noreferrer">Demo</a> looks promising.</strike></p>
| <p>I'm currently working on a project with another project to write just such a tool. I looked at other static code analysis tools and decided that I could do better. </p>
<p>Unfortunately, the project is not yet ready to be used without fairly intimate knowledge of the code (<em>read: it's buggy as all hell</em>). Ho... | 11,875 |
<p>How can I access a site configured in IIS 7 on the host machine from a guest OS in VMWare (Fedora 10). I have configured the VM to use "NAT"</p>
| <p>Depends on your network configuration of vmware product you are using (player, server, workstation). If it is set for a bridged mode, then you can do it as any other machine - by host machine's IP. If it is a "host only" or NAT mode - check what is the gateway IP for the guest (/sbin/route), and try using it:</p>
<... | <p>Depends on your network configuration of vmware product you are using (player, server, workstation). If it is set for a bridged mode, then you can do it as any other machine - by host machine's IP. If it is a "host only" or NAT mode - check what is the gateway IP for the guest (/sbin/route), and try using it:</p>
<... | 43,531 |
<p>This code is blunderous, as it adds a class to an array and later tries to pull it and manipulate it as if it were an object.</p>
<pre><code>private function fail(event:Event):void
{
var myObj:MyClass;
var a:ArrayCollection = new ArrayCollection();
var x:MyClass;
var y:MyClass;
myObj = new MyCl... | <p>The question seems to me to be equivalent to,"Why can I use a class as a value?" It's a good question. </p>
<p>There are two major things you can do with a class in ActionScript; you can <em>instantiate</em> it, and you can <em>access static properites</em> of it. (Okay, there are other things, but those are the ob... | <p>The nice thing about late binding (and dynamic languages) is that it allows you a lot more flexibility in implementation. The downside is that the language doesn't protect you from making some simple mistakes that early binding and strong typing prevent. Personally, I'd look into using TDD (test driven development... | 37,262 |
<p>For debugging purposes in a somewhat closed system, I have to output text to a file.</p>
<p>Does anyone know of a tool that runs on windows (console based or not) that detects changes to a file and outputs them in real-time?</p>
| <ul>
<li><a href="http://tailforwin32.sourceforge.net/" rel="noreferrer">Tail for Win32</a></li>
<li><a href="http://logging.apache.org/chainsaw/index.html" rel="noreferrer">Apache Chainsaw</a> - used this with <a href="http://logging.apache.org/log4net/release/howto/chainsaw.html" rel="noreferrer">log4net logs</a>, ma... | <p><a href="http://technet.microsoft.com/en-us/sysinternals/bb896642.aspx" rel="nofollow noreferrer">FileMon</a> is a free stand alone tool that can detect all kinds of file access. You can filter out any unwanted. It does not show you the data that has actually changed though.</p>
| 3,917 |
<p>I'm writing a touch screen .net winforms application and need a combobox with a larger dropdown arrow. Is there any way to resize the arrow, or am I looking at writing a custom control?</p>
| <p>I think the button's size is determined by a combination of the system font size and the system scroll-bar dimensions, both of which are controlled by the display properties.</p>
<p>Another option is to configure the combo box to drop down when it receives focus. That way, touching anywhere on the box will make it ... | <p>Can you switch to WPF? It's easier to make/derive custom controls in wpf. Alternatively you could just embed a WPF control in your winform.</p>
<p>Rolling your own control in Winforms is horrible.</p>
| 46,948 |
<p>Is there a better way to forcefully disconnect all users from an Oracle 10g database schema than restarting the Oracle database services?</p>
<p>We have several developers using SQL Developer connecting to the same schema on a single Oracle 10g server. The problem is that when we want to drop the schema to rebuild... | <p>To find the sessions, as a DBA use</p>
<blockquote>
<p><code>select sid,serial# from v$session where username = '<your_schema>'</code></p>
</blockquote>
<p>If you want to be sure only to get the sessions that use SQL Developer, you can add <code>and program = 'SQL Developer'</code>. If you only want to kill se... | <p>Have you tried ALTER SYSTEM KILL SESSION? Get the SID and SERIAL# from V$SESSION for each session in the given schema, then do</p>
<p>ALTER SCHEMA KILL SESSION <em>sid</em>,<em>serial#</em>;</p>
| 11,130 |
<p>I've just started developing an ExtJS application that I plan to support with a very lightweight JSON PHP service. Other than that, it will be standalone. My question is, what is the best way to organize the files and classes that will inevitably come into existence? Anyone have any experience with large ExtJS pro... | <p>I would start here <a href="http://blog.extjs.eu/know-how/writing-a-big-application-in-ext/" rel="noreferrer">http://blog.extjs.eu/know-how/writing-a-big-application-in-ext/</a></p>
<p>This site gives a good introductory overview of how to structure your application.</p>
<p>We are currently using these ideas in tw... | <p>When starting new big project, I decided to make it modular. Usually, in big projects not all modules are used by a particular user, so I load them on demand. F.e., if a project would have 50+ modules, the big probability is that user is working only with 10-. </p>
<p>Such architecture lets you to have the initial ... | 8,856 |
<p>In my custom printer I have probe and nozzle at same height and configured Marlin this way:</p>
<pre><code>#define NOZZLE_TO_PROBE_OFFSET { 43, -20, 0 }
</code></pre>
<p>On the bed I've a 2 mm glass. How I need to change the configuration? Do I need to act adding a positive Z offset? like this?</p>
<pre><cod... | <p>You can define the probe offset (or better the trigger point to bed level distance) in the array definition of <code>NOZZLE_TO_PROBE_OFFSET</code>, but it is not the usual and logical place to do that. Instead you position the probe higher than the nozzle and define the offset later when calibrating the bed level. A... | <h1>No.</h1>
<p>You define the Z-Value of the Nozzle to Probe offset mainly to get avoidance of collisions, but it is checked nowhere in the firmware code at all. Usually, the probe is mounted a millimeter or so above the nozzle anyway: you mount it in such a fashion that it triggers when the nozzle has the correct dis... | 1,609 |
<p>If you have Subversion installed on your development machine and you don't work in a team, is there any reason why you should use the <em>svn</em> protocol instead of <em>file</em>?</p>
| <p>If you are working by yourself on a single machine, then in my experience using the file:// protocol works fine. Even when my team was using Subversion off a remote server, I would set up a local file-based repository for my own personal projects. If you get to the point where you need to access it from a different ... | <p>Even if working by myself ... my protocol is to <strong>always</strong> use source control even for personal projects. It gives you a single point of backup for all of your code work, and allows you to change your mind and/or retrieve older versions.</p>
| 5,255 |
<p>T have used checkbox column in gridview. On click of a linkbutton, it should be checked that checkboxes in gridview are checked or not. If none check box is checked then it should display alert("Check at leat one check box"). </p>
| <p>I found the answer. and its working...</p>
<p>function checkBoxselectedornot()
{</p>
<pre><code> var frm=document.forms['aspnetForm'];
var flag=false;
for(var i=0;i<document.forms[0].length;i++)
{
if(document.forms[0].elements[i].id.indexOf('chkDownloadSelectedEvent')!=... | <p>I havnt used the checkbox in grid view but would you not do a for loop around the columns in gridview and check the state? Myabe add a count and if 0 then alert.</p>
| 45,420 |
<p>Is there any reasonable method to allow users of a webapp to download large files? I'm looking for something other than the browser's built-in download dialog - the requirements are that the user initiates the download from the browser and then some other application takes over, downloads the file in background and ... | <p>This might be a suitable use for BitTorrent. It works using a separate program (in most browsers), and will still run after the browser is closed. Not a perfect match, but meets most of your demands.</p>
| <p>Take a look at this:
<a href="http://msdn.microsoft.com/en-us/library/aa753618(VS.85).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/aa753618(VS.85).aspx</a></p>
<p>It´s only for IE though.</p>
<p>Another way is to write a BandObject for IE, which hooks up on all links and starts your appl... | 36,480 |
<p>How am I supposed to get the <code>IDENTITY</code> of an inserted row?</p>
<p>I know about <code>@@IDENTITY</code> and <code>IDENT_CURRENT</code> and <code>SCOPE_IDENTITY</code>, but don't understand the implications or impacts attached to each.</p>
<p>Can someone please explain the differences and when I would be u... | <ul>
<li><p><a href="http://msdn.microsoft.com/en-us/library/ms187342.aspx" rel="noreferrer"><code>@@IDENTITY</code></a> returns the last identity value generated for any table in the current session, across all scopes. <strong>You need to be careful here</strong>, since it's across scopes. You could get a value from... | <p>After Your Insert Statement you need to add this. And Make sure about the table name where data is inserting.You will get current row no where row affected just now by your insert statement. </p>
<pre><code>IDENT_CURRENT('tableName')
</code></pre>
| 6,420 |
<p>Initialization would include creating all the required tables, constraints and populating the tables.</p>
<p>edit: Is there already a project doing this?</p>
| <p>Create a script that is either part of of the end of your database creation script, or runs after it.</p>
<p>It may typically contain a lot of insert statements to populate reference tables, or similar.</p>
| <p>I don't know about <em>specific</em> tools for other databases, but mysqldump does exactly this for MySQL.</p>
| 25,143 |
<p>I'm struggling to think of a good way to use linq2sql, simply I want to use it, but I can't figure out whether it's best to wrap up the linq2sql generated classes inside my model classes providing some form of generic abstract base class / or interface for the common methods on my model classes like add, update, del... | <p>Personally, I wrap Linq2SQL in the repository pattern.</p>
| <p>Depending on the complexity of your application you may or may not need to use anything other than the generated classes for your ORM. I find that I am able to happily live with the generated classes, extended by partial methods and by wrapping the data context with a wrapper (and possibly extended if I need to add... | 42,650 |
<p>Do you know of well designed open source applications that are instructive to analyse?</p>
<p>Specifically, I'm interested in practical applications object-relational mapping in C++ based programs, where there is a good separation between a domain model and persistence/serialization functionality.</p>
| <p>If you include well designed open source <em>libraries</em> that are instructive to analyse, have a look at <a href="http://www.boost.org" rel="nofollow noreferrer">Boost</a>.</p>
<p>About persistence / serialization (not relational mapping though), have a look at <a href="http://www.boost.org/doc/libs/1_36_0/libs/... | <p>While this doesn't fit your specific requirements (it's not a business app for a start), I think that <a href="http://ogre3d.org" rel="nofollow noreferrer" title="OGRE">OGRE 3D</a> is a great example of an open source C++ project.</p>
| 29,001 |
<p>Can the iPhone use other databases besides SQLite, like MySQL?</p>
| <p>The iPhone can only use SQLite as a database, directly on the device. This means there is no MySQL server inside the iPhone. But you can, and are free to have (your own) MySQL Back-end server, to which iPhone applications connect to. But Apple doesn't provide the server, so you have to pay the maintenance costs</p>
| <p>SQLite is installed on all iPhones. Theoretically, you can run other databases but since you cannot start other processes, you cannot run MySQL -- MySQL requires a separate process (the mysqld daemon).</p>
| 40,900 |
<p>An example of an app that does this is <a href="http://www.humanized.com/enso/" rel="nofollow noreferrer">Enso</a>, it pops up when you press the caps lock.</p>
| <p>You can act on global hotkeys by calling the winapi function <a href="https://www.pinvoke.net/default.aspx/user32/RegisterHotKey.html" rel="nofollow noreferrer">RegisterHotKey</a>. Also see <a href="https://www.codeproject.com/Articles/4345/NET-system-wide-hotkey-component" rel="nofollow noreferrer">https://www.code... | <p>You need to install a hook in user32.dll. Lookup the Win32-API call SetWindowsHookEx. You can call it from C# via the stuff in System.Runtime.InteropServices.</p>
<p><a href="https://www.codeproject.com/Articles/14485/Low-level-Windows-API-hooks-from-C-to-stop-unwante" rel="nofollow noreferrer">This article</a> dis... | 8,581 |
<p>I am working on a form widget for users to enter a time of day into a text input (for a calendar application). Using JavaScript (we are using jQuery FWIW), I want to find the best way to parse the text that the user enters into a JavaScript <code>Date()</code> object so I can easily perform comparisons and other thi... | <p>A quick solution which works on the input that you've specified:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>function parseTime( t ) {
var d = new Date();
var... | <p>Why not use validation to narrow down what a user can put in and simplify the list to only include formats that can be parsed (or parsed after some tweaking).</p>
<p>I don't think it's asking too much to require a user to put a time in a supported format.</p>
<p>dd:dd A(m)/P(m)</p>
<p>dd A(m)/P(m)</p>
<p>dd</p>
| 17,077 |
<p>After looking on MSDN, it's still unclear to me how I should form a proper predicate to use the Find() method in List using a member variable of T (where T is a class)</p>
<p>For example:</p>
<pre><code>public class Car
{
public string Make;
public string Model;
public int Year;
}
{ // somewhere in my ... | <p>Ok, in .NET 2.0 you can use delegates, like so:</p>
<pre><code>static Predicate<Car> ByYear(int year)
{
return delegate(Car car)
{
return car.Year == year;
};
}
static void Main(string[] args)
{
// yeah, this bit is C# 3.0, but ignore it - it's just setting up the list.
List<Ca... | <p>You can use this too:</p>
<pre><code>var existData =
cars.Find(
c => c.Year== 1999);
</code></pre>
| 29,961 |
<p>I am trying to port a WebForms app to Silverlight, this application is using the GDI Graphics class to draw polygons to a in-memory bitmap, it will then do pixel by pixel comparisons so I need access to the pixel buffer.</p>
<p>Example:</p>
<pre>
Graphics g = Graphics.FromImage(bmp);
g.FillClosedCurve(brus... | <p>If you write a polygon rendering algorithm for Silverlight, it would have to be all managed code, I haven't seen any examples of this, but if you write one let me know, I've been looking for something like the for XNA. </p>
<p>Silverlight 3 should be adding some of the things you need to make this a lot easier like... | <p>Could you grab an image from a server and process that? You could dynamically generate the image and you'd have access to whatever you needed outside of Silverlight.</p>
| 49,909 |
<p>I'm working on an ASP.Net application and working to add some Ajax to it to speed up certain areas. The first area that I am concentrating is the attendance area for the teachers to report attendance (and some other data) about the kids. This needs to be fast.</p>
<p>I've created a dual-control set up where the use... | <p>If speed/performance is a major concern for you, I would strongly suggest against UpdatePanels, as they cause a full page postback that drags the ViewState in the header, among other crap, and forces the page to go through the whole life cycle every time (even though the user doesn't see this).</p>
<p>You should be... | <p>To find out why it's taking so long I would recommend using Fiddler to spy on your IE traffic: <a href="http://www.fiddlertool.com/fiddler/" rel="nofollow noreferrer">http://www.fiddlertool.com/fiddler/</a></p>
<p>You'll be looking at the response of each of the messages to see how large they are. If the messages a... | 33,497 |
<p>I want to maintain state in my Perl web app. How can I do this effectively? I looked at CGI::Session but it says that it doesn't work well with UTF-8 pages, which is a requirement. I'd also like to be able to pass some basic information to another Java application running on the Glassfish app server, so people ar... | <p>The basics of sessions are that you need a place to hold the session data (the store) and a way to store and retrieve the session data. While some frameworks call that The State, it really boils down to having a session key (or session ID) and passing it back to your app via either a cookie or a URL parameter.</p>
... | <p>Find a Perl web framework that handles sessions for you.</p>
<p>For example <a href="http://www.catalystframework.org/" rel="nofollow noreferrer">Catalyst</a>. It will completely abstract out user sessions so that you don't really even have to think about it. See <a href="http://search.cpan.org/dist/Catalyst-Plugin... | 44,066 |
<p>In a comment I read</p>
<blockquote>
<p>Just as a side note, it's sometimes faster to drop the indices of your table and recreate them after the bulk insert operation.</p>
</blockquote>
<p>Is this true? Under which circumstances?</p>
| <p>As with Joel I will echo the statement that yes it can be true. I've found that the key to identifying the scenario that he mentioned is all in the distribution of data, and the size of the index(es) that you have on the specific table.</p>
<p>In an application that I used to support that did a regular bulk import... | <p>One thing you should consider when dropping and recreating indexes is that it should only be done on automated processes that run during the low volumne periods of database use. While the index is dropped it can't be used for other queries that other users might be riunning at the same time. If you do this during pr... | 45,550 |
<p>I have a post-compilation step that manipulates the Java bytecode of generated classes. I'd like to make life as painless as possible for library consumers, so I'm looking at ways I can make this process automatic and (if possible) compiler agnostic.</p>
<p>The <a href="http://java.sun.com/javase/6/docs/api/javax/a... | <p>The Groovy compiler is the only bytecode compiler which allows to hook into the compilation process (example: <a href="http://svn.codehaus.org/groovy/trunk/groovy/groovy-core/src/main/org/codehaus/groovy/transform/SingletonASTTransformation.java" rel="nofollow noreferrer">Generate bytecode to support the Singleton p... | <p>It can be done.</p>
<p>Take a look at my blog post <a href="http://www.iam.unibe.ch/~akuhn/blog/2008/roman-numerals-in-your-java" rel="nofollow noreferrer">Roman Numerals, in our Java</a> where an annotation processor is used to rewrite code. Limitation being that it works with Sun's javac only.</p>
| 44,219 |
<p>I need to do some command lines through a browser.
What I need to do in a command-line would be:</p>
<pre><code>$login
<login name>
<password>
$passwd
<old password>
<new password>
<retype new password>
</code></pre>
<p>So, how can I do this using the <a href="http://www.php.net/manua... | <p>Windows NLB is definitely your solution - it sits in the network stack on each of your IIS servers and distributes TCP requests among the member servers. NLB works with SSL traffic, since it distributes via TCP Ports, not the contents of the traffic.</p>
<p>You will need to install the same SSL certs on each serve... | <p>DNS based load balancing should take you a long way. <a href="http://content.websitegear.com/article/load_balance_dns.htm" rel="nofollow noreferrer">Click here</a> for an article on the subject. For an overview of load balancing in the IIS/ASP world, <a href="http://www.microsoft.com/technet/archive/itsolutions/ecom... | 16,053 |
<p>There seem to be a decent number of <code>mod_rewrite</code> threads floating around lately with a bit of confusion over how certain aspects of it work. As a result I've compiled a few notes on common functionality, and perhaps a few annoying nuances.</p>
<p>What other features / common issues have you run across u... | <h2>Where to place mod_rewrite rules</h2>
<p><code>mod_rewrite</code> rules may be placed within the <code>httpd.conf</code> file, or within the <code>.htaccess</code> file. if you have access to <code>httpd.conf</code>, placing rules here will offer a performance benefit (as the rules are processed once, as opposed t... | <p>Another great feature are rewrite-map-expansions. They're especially useful if you have a massive amout of hosts / rewrites to handle:</p>
<p>They are like a key-value-replacement:</p>
<pre><code>RewriteMap examplemap txt:/path/to/file/map.txt
</code></pre>
<p>Then you can use a mapping in your rules like:</p>
<... | 36,330 |
<p>Is there a way to get the amount of free diskspace of a disk or a folder in a CMD
without having to install some thirdparty applications?</p>
<p>I have a CMD that copies a big file to a given directory and could of course use
the errorlevel return from the copy command, but then I have to wait for the time
it takes... | <p>If you run "<code>dir c:\</code>", the last line will give you the free disk space.</p>
<p><strong>Edit:</strong>
Better solution: "<code>fsutil volume diskfree c:</code>"</p>
| <p>Is cscript a 3rd party app?
I suggest trying <a href="http://www.microsoft.com/technet/scriptcenter/default.mspx" rel="nofollow noreferrer">Microsoft Scripting</a>, where you can use a programming language (JScript, VBS) to check on things like <a href="http://www.microsoft.com/technet/scriptcenter/scripts/storage/d... | 37,499 |
<p>I'm using the MIDP 2.0 (JSR 118) and I just noticed that there is no reader for strings in J2ME.</p>
<p>Does anyone know how you are supposed to read Strings from an <code>InputStream</code> or <code>InputStreamReader</code> in a platform independent way (i.e. between two java enabled cell phones of different model... | <p>Which profile are you using? The MID profile in JSR 118 specifies <a href="http://java.sun.com/javame/reference/apis/jsr118/java/io/InputStreamReader.html" rel="noreferrer">InputStreamReader</a> (not StringReader, but that wouldn't help you read from an InputStream anyway).</p>
<p>EDIT: To reflect the change to the... | <p>Would you be able to provide an example of this?</p>
<p>You use <code>InputStreamReader.read(char[], int, int)</code> and when you've read all you want to, create a new string from a char array. If you want to read a line at a time as you would from <code>BufferedReader</code>, you basically need to implement the f... | 24,420 |
<p>I'm not sure, will the visual c ++ compiler express edition work for compiling c and if not can someone link me to an easy c compiler to use. Thanks in advance.</p>
| <p>Yes, it will work. C is a subset of C++ (for all but a very small number of exceptional cases). Any C++ compiler should work with valid C code.</p>
<p>See the answers to <a href="https://stackoverflow.com/questions/304088/is-c-code-still-considered-c">this question</a> for some of the rare examples of C code that... | <p>Depends partly on what C you're talking about. Visual C++ will happily compile C programs (make sure they've got a .c extension, and make sure the "Compile As" option in the "Advanced" part of the "C/C++" property pages is not set to C++ only), but is missing a whole lot of stuff in the C99 standard. If you're inte... | 43,412 |
<p>This is a follow-up to <a href="https://stackoverflow.com/questions/365522/what-is-the-best-way-to-add-two-numbers-without-using-the-operator">my question yesterday</a>:</p>
<p>CMS kindly provided this example of using bitwise operators to add two numbers in C:</p>
<pre><code>#include<stdio.h>
int add(int x... | <p>As I pointed out in my response to CMS' answer yesterday, left-shifting a negative number is undefined behavior in C so this isn't even guaranteed to work in C (the problem is how to handle the signed bit, do you shift it like a value bit or is it not affected by a shift? The standards committee couldn't agree on a... | <p>I've noticed that you're assuming that python works with numbers the same way as C does.<br>
Thats not entirely true. Meaning C's int numbers have a fixed length of 16 bits. For detailed info on C datatypes you can refer to <a href="http://en.wikipedia.org/wiki/C_data_types" rel="nofollow noreferrer">C_data_types on... | 47,862 |
<p>It should be easy, right?
Have a listview, add an imagelist, add images to the imagelist, assign image index to the column you want.<br>
But, it doesn't work.<br>
<a href="http://support.microsoft.com/kb/314933" rel="nofollow noreferrer">Microsoft article</a> states that it is a known problem in .NET 1.1.<br>
But ha... | <p>It entirely depends on what the results are. If they are related to one another, I'd usually create a custom class.</p>
<p>If they're not really related, I'd either use an out parameter or split the method up. If a method wants to return three unrelated items, it's probably doing too much. The exception to this is ... | <p>If 2, a Pair.</p>
<p>If more than 2 a class.</p>
| 43,859 |
<p>I have a website that employs a generic mod_rewrite rule to push all requests to the index.php page, with the exception of certain file extensions:</p>
<pre><code>RewriteRule !\.(js|ico|gif|jpg|JPG|png|css|php|phtml|pdf|txt|xml)$ index.php
</code></pre>
<p>What I need to be able to do is also exclude a certain dir... | <p>Before the line you have quoted, for a directory named 'style' for instance, you need:</p>
<pre><code>RewriteRule ^style/ - [L]
</code></pre>
<p>The hyphen means 'no redirection', and the '[L]' means 'last rule', as in don't carry on trying to match the URL to the follwing rules. You can put as many of these li... | <p>You could check with <code>RewriteCond %{REQUEST_FILENAME} !-f</code> for any request that doesn't match to an existing filename.</p>
| 43,021 |
<p>Currently I use .Net <code>WebBrowser.Document.Images()</code> to do this. It requires the <code>Webrowser</code> to load the document. It's messy and takes up resources. </p>
<p>According to <a href="https://stackoverflow.com/questions/138313/how-to-extract-img-src-title-and-alt-from-html-using-php">this question<... | <p>If your input string is valid XHTML you can treat is as xml, load it into an xmldocument, and do XPath magic :) But it's not always the case.</p>
<p>Otherwise you can try this function, that will return all image links from HtmlSource :</p>
<pre><code>public List<Uri> FetchLinksFromSource(string htmlSource)
... | <p>If it's valid xhtml, you could do this:</p>
<pre><code>XmlDocument doc = new XmlDocument();
doc.LoadXml(html);
XmlNodeList results = doc.SelectNodes("//img/@src");
</code></pre>
| 16,809 |
<p>So, no matter what I seem to do, I cannot seem to avoid having Dev C++ spew out numerous Multiple Definition errors as a result of me including the same header file in multiple source code files in the same project. I'd strongly prefer to avoid having to dump all my source code into one file and only include the he... | <p>Since you're declaring those variables in the header file, and including the header file in each C++ file, each C++ file has its own copy of them.</p>
<p>The usual way around this is to <em>not</em> declare any variables within header files. Instead, declare them in a single C++ file, and declare them as <code>exte... | <p>GCC 3.4 and up supports <code>#pragma once</code>. Just put <code>#pragma once</code> at the top of your code instead of using include guards. This may or may not be more successful, but it's worth a shot. And no, this is not (always) precisely equivalent to an include guard.</p>
| 27,635 |
<p>I have an app built against MVC Preview 3 (referencing local copies of the MVC assemblies) that I'm trying to modify/test on a machine with the ASP.NET MVC beta installed. I am not interesting in updating this app to run against MVC beta yet - I just need to make a few small changes.</p>
<p>It's failing with Missi... | <p>You could possible download the <a href="http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=13792" rel="nofollow noreferrer" title="ASP.NET - Release: ASP.NET MVC Preview 3 Source">ASP.NET MVC Preview 3 Source</a> and compile it with your own SNK or give it a different version as the offical one a... | <p>As per <a href="https://stackoverflow.com/questions/267719/run-aspnet-mvc-preview-3-or-4-or-5-and-mvc-beta-simultaneously">this question here</a> and <a href="http://dylanbeattie.blogspot.com/2008/11/working-on-aspnet-mvc-beta-and-preview.html" rel="nofollow noreferrer">this reference link</a> you need to delete the... | 34,623 |
<p>I'm looking to automate the backup of a Windows XP file structure (a wiki) into CVS.<br>
Through repeated calls to <em>cvs commit</em> and <em>cvs add</em> I can identify and commit changed files and newly added files, but I can't see a cvs command that would let me know a local file has been deleted. </p>
<p>One ... | <p>You could do a</p>
<pre><code>cvs -nq update
</code></pre>
<p>and look for lines like</p>
<pre><code>cvs update: warning: SourceControlledFile.xml was lost
</code></pre>
| <p><strong>UPDATE:</strong></p>
<p>I am using CVSNT 2.5.05 on Windows XP. Discovered that if you just run</p>
<pre><code>cvs remove -R
</code></pre>
<p>on a directory (without the <code>-f</code> param) it will only remove files that are actually missing from the file system. For files that are still there, it will ... | 48,201 |
<p>I'm writing a game in Java, and I want the user to be able to provide input from both the command line and my GUI. Currently, I use this method to get input:<br></p>
<pre><code> static String getInput(){
System.out.println("Your move:");
Scanner sc = new Scanner(System.in);
return sc.next... | <p>This is possible - the easiest substitution for <em>System.in</em> would be a <a href="http://java.sun.com/javase/6/docs/api/java/io/PipedInputStream.html" rel="nofollow noreferrer">PipedInputStream</a>. This must be hooked up to a <a href="http://java.sun.com/javase/6/docs/api/java/io/PipedOutputStream.html" rel="n... | <p>I made an application once that could run via the command line or using a GUI.
<br>The way I did this was to define an Interface (named IODevice) which defined the following methods:
<li> public String getInput();</li>
<li> public void showOutput(String output);</li>
</p>
<p><br></p>
<p>I then had two classes whic... | 20,608 |
<p>Can one specify XML attribute values as CDATA ? If yes - what would be the schema for the same. If not - why is this limitation not addressed in XML ?</p>
| <p>No you cannot do this.</p>
<p>There's a very fine line (and a very large debate) between what constitutes an attribute and what constitutes a child element. See <a href="https://stackoverflow.com/questions/152313/xml-attributes-vs-elements">here</a> for example. </p>
<p>That given, the "limitation" isn't addressed... | <p>The way you handle that is to use a child element rather than an attribute. </p>
| 46,856 |
<p>I'm creating a gem which has</p>
<ul>
<li>several scripts in the bin directory</li>
<li>the utility classes in the lib directory</li>
<li>and several tests in the test directory</li>
</ul>
<pre>
supertool
bin
toolA
toolB
lib
supertool
supertool.rb
helper.rb
test
tc_main.rb
tc_etc.rb
</p... | <p>I'm not sure what you're trying to achieve with that script. It doesn't seem to have anything to do with gems...</p>
<p>Is it so that you can run <code>ruby tc_main.rb</code> from within the test directory (or <code>ruby test/tc_main.rb</code> from the base dir), and have it set the load path appropriately? If so, ... | <p>Take a look at hoe gem, it is a helper for other gems.</p>
| 26,394 |
<p>I have an Ender 3 and I have a problem with auto home. I use auto home and then level the bed with the wheels beneath the bed. I then start a print and the first layer is well above the bed. Perhaps about a millimeter. If I stop the print at this point and level the bed so that the first layer prints the normal pape... | <p>It sounds like there’s two things that could be going wrong here:</p>
<ol>
<li><p>Your starting G-code has some code in it that’s making it think that you want to treat a few layers up as <code>Z0</code>. If I were you I would minimize the start G-code until you get this sorted out. A quick fix would Be to add the f... | <p>The Z stop can be loosened and moved up but it seems weird that it would need to be moved and I don't think that would fix your issue. The Z height should be the same for the auto home and printing. I auto home then disable steppers and slowly move to all 4 corners. I have caught myself resting my arm on the X axis ... | 1,612 |
<p>How are arrays manipulated in D?</p>
| <p><a href="http://www.digitalmars.com/d/2.0/arrays.html" rel="nofollow noreferrer">Here</a> you can find a complete reference of array manipulations in D.</p>
| <p>To slice arrays, it's a simple matter of using</p>
<pre><code>int[7] a;
int[] b;
b = a[5..7];
</code></pre>
<p>which sets b[0] to a[5] and b[1] to a[6]. But remember that this is a reference to the elements in a, <em>not</em> another copy of them. If you change b[0], this also affects a[5].</p>
<p>If you want t... | 23,907 |
<p>I have a LinkButton that has to postback to perform some logic.</p>
<p>Once it is finished, instead of loading the page back up in the browser, I want to leave it alone and pop open a new window.</p>
<p>So far, the best idea I've had is to put the LinkButton in an UpdatePanel, and have it render some JavaScript ou... | <p>Use LinkButton.PostBackUrl to set a different page to POST to, and some client script to get a new window (and the old target restored so that future postbacks work normally). The 2nd page can use PreviousPage to get access to any needed state from the original page.</p>
<pre><code><script runat="server">
... | <p>One thing you could try is to have your LinkButton OnClick event do its processing, then register a Page.ClientScript.RegisterStartupScript with the popup code, which will put some Javascript into the tag to fire off after the page loads. This should launch your new window after the processing completes.</p>
<p>ED... | 39,938 |
<p>I have a SQL statement that looks like:</p>
<pre><code>SELECT [Phone]
FROM [Table]
WHERE
(
[Phone] LIKE '[A-Z][a-z]'
OR [Phone] = 'N/A'
OR [Phone] LIKE '[0]'
)
</code></pre>
<p>The part I'm having trouble with is the where statement with the "LIKEs". I've seen SQL statements where authors used <code>li... | <p>Check <a href="http://technet.microsoft.com/en-us/library/aa933232(v=sql.80).aspx" rel="nofollow noreferrer">here</a>.</p>
<p>[] matches a range of characters.</p>
<p>I think you want something like this:</p>
<pre><code>SELECT [Phone]
FROM [Table]
WHERE
(
[Phone] LIKE '%[A-Z]%'
OR [Phone] LIKE '%[a-z]%'
... | <p>Try using the <code>t-sql</code> <code>ISNUMERIC</code> function. That will show you which ones are/are not numeric.</p>
<p>You may also need to <code>TRIM</code> or <code>REPLACE</code> spaces to get what you want.</p>
<p>For example, to find valid phone numbers, replace spaces with '', test with <code>ISNUMERIC... | 12,200 |
<p>Just last night the heat bed stopped working. It was fine up to 75 % of the print, then when it was done the bed was not on anymore. The display said it was set to 50 °C, but it was at 18 °C. I did try moving the pins, and that is not loose (very simple thing to try). </p>
<p>I want to know w... | <p>This is a shot in the dark, but the vast majority of problems with a heating bed stopping to work is usually at the cables/connectors interface.</p>
<p>This is because in printers like the A6, the cable/connector is subject to constant mechanical stress, and - since <a href="https://en.m.wikipedia.org/wiki/Metal_Fa... | <p>The bed stopped working yesterday. I used the multimeter on the bed plug. The bed heater reads 1.7-1.8 Ohm.</p>
<p>There was no 12 V supplied from the mainboard and I read its terminals. There were 12 V there. I tightened the screws and the plug received 12 V.</p>
<p>The bed heated for one prin... | 822 |
<p>I have a client server based windows forms application that needs an administrator only screen. The administrator functionality needs to be implemented in such a way that at any given time only one administrator can access that screen. The windows forms client application talks to the server using .NET Remoting. An... | <p>This can be done most easily through using a DB table. Typically the DB is already fault tolerant and is a safe resource to use for a shared lock scenario. Just have a lock table that contains some info about the locked resource, who has it, when, etc.</p>
<p>You can also use one of the various "state servers" on... | <p>You need to maintain a static member on the server that indicates if the window is currently in use. Make sure it is thread-safe by using the <b>lock()</b> function when setting the value. You can then check that value before showing the admin screen.
<br>
<br>
As far as the server side is concerned, you mention t... | 46,126 |
<p>I need to keep the arrow keys from being able to scroll through my various tabs. Anyone know of a way to do this?</p>
| <p>I fixed the problem with the following code</p>
<pre><code>string tempstring = e.KeyValue.ToString();
if (tempstring == "37" || tempstring == "38" || tempstring == "39" || tempstring == "40")
{
e.Handled = true;
}
</code></pre>
<p>I placed it inside of the tabControl1_KeyDown(object sender, KeyEventArgs e) me... | <p>I think you can trap event "KeyPress" for that control</p>
<p>then on the handle you have </p>
<pre><code>System::Windows::Forms::KeyPressEventArgs^ e
</code></pre>
<p>You then check </p>
<pre><code>if (e->KeyChar == [find the number representing the arrow key])
e->Handled = true; // Meaning that no one... | 46,685 |
<p>Name the design considerations in deciding between use of a <a href="http://en.wikipedia.org/wiki/Singleton_pattern" rel="noreferrer">singleton</a> versus a static class. In doing this, you're kind of forced to contrast the two, so whatever contrasts you can come up with are also useful in showing your thought proce... | <ul>
<li>Singletons can implement interfaces and inherit from other classes.</li>
<li>Singletons can be lazy loaded. Only when it is actually needed. That's very handy if the initialisation includes expensive resource loading or database connections.</li>
<li>Singletons offer an actual object.</li>
<li>Singletons can b... | <p>When the single class needs state. Singletons maintain a global state, static classes do not.</p>
<p>For instance, making a helper around a registry class: If you have changable hive (HKey Current User vs. HKEY Local Machine) you could go:</p>
<pre><code>RegistryEditor editor = RegistryEditor.GetInstance();
edi... | 6,869 |
<p>My requirement is to replace a set of words in a given text file with a second set of words, which might be given from the command line or another file. Wanting to use Perl to do this, as the rest of my code is also in Perl.</p>
<p>So, if I have the following:</p>
<pre><code>server name="${server1}" host="abc.com"... | <p>The regular expression for your second question would be <code>s/server/myword/g;</code>. That matches (and substitutes) any occurrence of "server".</p>
<p>To replace server1, server2, etc., with a different string each, you could have a text file that contains the replacement rule, e.g.:</p>
<pre><code>server1 ab... | <p>Change your Regex to the following:</p>
<pre><code>perl -pie 's/\{server/myword/g' loginOut.txt > loginOut1.txt
</code></pre>
| 45,806 |
<p>Not really getting the point of the map function. Can anyone explain with examples its use?</p>
<p>Are there any performance benefits to using this instead of a loop or is it just sugar?</p>
| <p>Any time you want to generate a list based another list:</p>
<pre><code># Double all elements of a list
my @double = map { $_ * 2 } (1,2,3,4,5);
# @double = (2,4,6,8,10);
</code></pre>
<p>Since lists are easily converted pairwise into hashes, if you want a hash table for objects based on a particular attribute:</p... | <p>As others have said, map creates lists from lists. Think of "mapping" the contents of one list into another. Here's some code from a CGI program to take a list of patent numbers and print hyperlinks to the patent applications:</p>
<pre><code>my @patents = ('7,120,721', '6,809,505', '7,194,673');
print join(", ", ... | 16,488 |
<p>I'm not talking about how to indent here. I'm looking for suggestions about the best way of organizing the chunks of code in a source file.</p>
<p>Do you arrange methods alphabetically? In the order you wrote them? Thematically? In some kind of 'didactic' order?</p>
<p>What organizing principles do you follow? Why... | <p>i normally order by the following</p>
<ol>
<li>constructors</li>
<li>destructors</li>
<li>getters</li>
<li>setters</li>
<li>any 'magic' methods </li>
<li>methods for changing the persisted state of reciever (save() etc)</li>
<li>behaviors</li>
<li>public helper methods</li>
<li>private/protected helper methods</li>... | <p>I group them based on what there doing, and then in the order I wrote them (alphabetically would probs be better though)</p>
<p>eg in texture.cpp I have:</p>
<pre><code>//====(DE)CONSTRUCTOR====
...
//====LOAD FUNCTIONS====
...
//====SAVE FUNCTIONS====
...
//====RESOURCE MANGEMENT FUNCTIONS====
//(preventing multi... | 9,870 |
<p>I have a number of web apps running on several IIS6/Server 2003 boxes. They run well and are happy. They are all asp.net web apps and use .NET 3.5.</p>
<p>What, if any, would be valid reasons for contemplating moving the web apps to IIS7/Server 2008?</p>
| <p>IIS7 is rewritten from the ground up with a concept of being "pluggable". IIS7 is more extensible than it ever has been before. The entire request pipeline has be reworked to allow you to more easily work with requests, as well.</p>
<p>From a performance aspect, these changes are immediately recognizable. You ca... | <ol>
<li>Eventually, Microsoft will discontinue Server 2003 support. Admittedly, that won't be for several years, so it doesn't impact you today.</li>
<li>Improved support for ASP.NET MVC. This is probably the big one for most of us. You can get ASP.NET MVC working on IIS6, but there are <a href="http://forums.asp.net/... | 36,158 |
<p>How can you get and set the hash or anchor part of an URL in pure Actionscript? When googling for a solution I've found explainations for doing it using JavaScript, but is it possible to get it without using JavaScript? (I'm using Actionscript 2, I may consider updating the code to AS 3, but it doesn't seem to be a ... | <p>What you want is <a href="http://www.asual.com/swfaddress/" rel="nofollow noreferrer">SWFAdress</a>, it's a small library that let's you modify that part of the url from flash (via a javascript)</p>
| <p>If you ever make it to actionscript3 you could use the <a href="http://weblogs.macromedia.com/as_libraries/docs/corelib/com/adobe/net/URI.html" rel="nofollow noreferrer">com.adobe.net.URI class</a>. It exposes a URI::fragment getter/setter which looks to be exactly what you need.</p>
| 38,037 |
<p>When running my application I sometimes get an error about <code>too many files open</code>.</p>
<p>Running <code>ulimit -a</code> reports that the limit is 1024. How do I increase the limit above 1024? </p>
<p><strong>Edit</strong>
<code>ulimit -n 2048</code> results in a permission error.</p>
| <p>You could always try doing a <code>ulimit -n 2048</code>. This will only reset the limit for your current shell and the number you specify must not exceed the hard limit</p>
<p>Each operating system has a different hard limit setup in a configuration file. For instance, the hard open file limit on Solaris can be ... | <p>If some of your services are balking into ulimits, it's sometimes easier to put appropriate commands into service's init-script. For example, when Apache is reporting</p>
<blockquote>
<p>[alert] (11)Resource temporarily unavailable: apr_thread_create: unable to create worker thread</p>
</blockquote>
<p>Try to pu... | 5,490 |
<p>I'm looking at the MySQL docs <a href="http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-constraints.html" rel="noreferrer">here</a> and trying to sort out the distinction between FOREIGN KEYs and CONSTRAINTs. I thought an FK <strong>was</strong> a constraint, but the docs seem to talk about them like they'r... | <p>Yes, a foreign key is a type of constraint. MySQL has uneven support for constraints:</p>
<ul>
<li><code>PRIMARY KEY</code>: yes as table constraint and column constraint.</li>
<li><code>FOREIGN KEY</code>: yes as table constraint, but only with InnoDB and BDB storage engines; otherwise parsed but ignored.</li>
<l... | <p>This is probably the most confusing topìc in MySQL. </p>
<p>Many people say that, for instance, the 'PRIMARY KEY', the 'FOREIGN KEY', and the 'UNIQUE' key are actually indexes! (MySQL official documentation is included here)</p>
<p>Many others, on the other hand, say that they're rather constraints (which does mak... | 40,014 |
<p><strong>I'm searching for the best way to automatically organize all user generated content in a social network.</strong>
I'm building a site in ruby based upon lovdbyless' framework. the site is a place for men to share specialised knowledge.</p>
<p>I've looked into wikis,forums, blogs by need a platform/organizat... | <p>Titles and Tags.</p>
| <p>Thanks to stuff like <a href="http://semantic-mediawiki.org/wiki/Semantic_MediaWiki" rel="nofollow noreferrer">semantic mediawiki</a>, and <a href="http://sioc-project.org/" rel="nofollow noreferrer">SIOC</a> turning up in both <a href="http://sioc-project.org/wordpress/" rel="nofollow noreferrer">wordpress</a> and ... | 34,368 |
<p>I have a dropdownlist in a page. The values of all the list items = "0". I have viewstate turned off. When the page posts back, the selected index always = 1 in Page_load event, regardless of the selection in the list. If the values of the list items are different, the selectedIndex has the proper value. Is this nor... | <p>If dropdownlist becomes an HTML Select List, then yes, the browser submits the value attribute of each option, thus if they are all the same, you will always get the same value.</p>
| <p>Well, pretty much. The selectedIndex tells you which option has value that was posted back. Since all of the values are the same, the browser can select any option it likes and it will be correct. The 'interesting' attribute is the value, not the text of the option.</p>
| 49,238 |
<p>I have a dialog that resizes. It also has a custom background which I paint in response to a WM_ERASEBKGND call (currently a simple call to FillSolidRect). </p>
<p>When the dialog is resized, there is tremendous flickering going on. To try and reduce the flickering I enumerate all child windows and add them to t... | <p>Assuming that "FillSolidRect" is the erase of your background then return TRUE from the WM_ERASEBKGND.</p>
<p>To do the double buffering that you are almost doing in your code fragment, you will need to use CreateCompatibleBitmap and select that into your memDC.</p>
| <p>Double buffering is indeed the only way to make this work.</p>
<p>Child controls will take care of themselves so long as you make sure <code>CLIPCHILDREN</code>.</p>
| 19,913 |
<p>Similar to the one here on StackOverFlow, I would be needing to implement a way for people to vote up and vote down comments in a forum like site.</p>
<p>However instead of having a generic overall score, we will display the total amount of "thumbs up" and "thumbs down". The overall score will be needed for filteri... | <p>Well you'll need to store ratings (Comment ID, UserID, Vote-Value) so you can calculate and stop duplicate voting but I would strongly suggest you also add a VotesUp and VotesDown fields on your main comment entity.</p>
<p>Why the duplication? Speed. You're going to be doing disgusting amounts of <code>SUM-WHERE</c... | <p>A good open source reference for some but not all you ask would be <a href="http://www.dotnetkicks.com/" rel="nofollow noreferrer">dotnetkicks</a></p>
<p>Also listen to this <a href="http://www.hanselman.com/blog/HanselminutesPodcast134StackOverflowUsesASPNETMVCJeffAtwoodAndHisTechnicalTeam.aspx" rel="nofollow nore... | 31,226 |
<p>This database will store a list of children. But the problem is, they will have their weight measured once a day. How can I store the changes so I can easily query their actual weight and the weight variation over one day, one week and one month?</p>
| <p>I'd think something like the following:</p>
<pre><code>table kid
int pkey(id)
text name
table weight
date when
int kidid fkey(kid.id)
int weight
int pkey(id)
</code></pre>
| <p>Two tables. The first, say children, should have an id column and information about each child like name, age, etc. The second should be called something like childrenweights. Each row contains three things. The id of the child from the children table, the weight, and the time the measurement was taken. Then you... | 48,859 |
<p>So how does someone create a music visualizer? I've looked on Google but I haven't really found anything that talks about the actual programming; mostly just links to plug-ins or visualizing applications.</p>
<p>I use iTunes but I realize that I need Xcode to program for that (I'm currently deployed in Iraq and can... | <p>As a visualizer plays a song file, it reads the audio data in very short time slices (usually less than 20 milliseconds). The visualizer does a Fourier transform on each slice, extracting the frequency components, and updates the visual display using the frequency information.</p>
<p>How the visual display is upda... | <ol>
<li>Devise an algorithm to draw something interesting on the screen given a set of variables</li>
<li>Devise a way to convert an audio stream into a set of variables analysing things such as beats/minute frequency different frequency ranges, tone etc.</li>
<li>Plug the variables into your algorithm and watch it dr... | 18,560 |
<p>Basically I want to know how to set center alignment for a cell using VBScript...</p>
<p>I've been googling it and can't seem to find anything that helps.</p>
| <pre><code>Set excel = CreateObject("Excel.Application")
excel.Workbooks.Add() ' create blank workbook
Set workbook = excel.Workbooks(1)
' set A1 to be centered.
workbook.Sheets(1).Cells(1,1).HorizontalAlignment = -4108 ' xlCenter constant.
workbook.SaveAs("C:\NewFile.xls")
excel.Quit()
set excel = nothing
'If t... | <p>There are many ways to select a cell or a range of cells, but the following will work for a single cell.</p>
<pre><code>'Select a Cell Range
Range("D4").Select
'Set the horizontal and vertical alignment
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
End With
</code></pre>
<p>... | 17,180 |
<p>I'm looking for a make utility for building large java programs. I'm aware of ANT already, but want to see what else is available.</p>
<p>Ideally, it should be able to handle the .java->.class package directory weirdness that fouls up GNU Make.</p>
<p>Win32, but cross platform is a plus.</p>
<p><strong>EDIT:</str... | <p>Ant and Maven are definitely the two standards. If you're already familiar with Ant and want the dependency management that comes with Maven, you might take a look at <a href="http://ant.apache.org/ivy" rel="nofollow noreferrer">Ivy</a>.</p>
<p>One thing both Ant and Maven lack is true control structures in your bu... | <p>Well, obviously, there's the classic make (make, gmake, nmake) utilities, there's also (I think) some build systems written in Ruby, or maybe Python. They aren't Java specific, rather just scriptable build systems.</p>
<p>But ANT has been the leader of the pack pushing 8-9 years now, and in terms of the basics, it'... | 20,437 |
<p>This is a bit of a strange one, but I've been struggling for a few hours now and I can't understand what is happening.</p>
<p>I was wondering if anyone else has experienced this problem, and can perhaps explain it. I'm building a simple Winforms app and trying to use many of the built in controls. </p>
<p>Basicall... | <p>Just guessing here, because I don't have time to set up a test and confirm right now, but are you doing any validating? I seem to remember that data-bound controls won't let you leave if the contents don't validate. Even if you aren't explicitly, try setting CausesValidation to False to see if there's any sort of va... | <p>For Infragisticst Dropdowns (may not be true for other winform dropdowns): If you have "LimitToList" set to true you can be stuck in a dropdown that you can't get out of without realizing it. Use the ItemNotInList even to trigger a warning message.</p>
| 37,053 |
<p>An example of unspecified behavior in the C language is the order of evaluation of arguments to a function. It might be left to right or right to left, you just don't know. This would affect how <code>foo(c++, c)</code> or <code>foo(++c, c)</code> gets evaluated.</p>
<p>What other unspecified behavior is there tha... | <p>A language lawyer question. Hmkay.</p>
<p>My personal top3:</p>
<ol>
<li><p>violating the strict aliasing rule</p>
</li>
<li><p>violating the strict aliasing rule</p>
</li>
<li><p>violating the strict aliasing rule</p>
<p>:-)</p>
</li>
</ol>
<p><strong>Edit</strong> Here is a little example that does it wrong twice:... | <p>Be sure to always initialize your variables before you use them! When I had just started with C, that caused me a number of headaches.</p>
| 12,377 |
<p>I made a panel and set it to fill the screen, now I can see the windows under it but I want it to be click through, meaning they could click a file or see a tool tip of another object through the transparency.</p>
<blockquote>
<blockquote>
<p>RE: This may be too obvious, but have you tried sending the panel t... | <p>Creating a top level form that is transparent is very easy. Just make it fill the screen, or required area, and define it to have a TransparenyKey color and BackColor of the same value. </p>
<p>Getting it to ignore the mouse is simple enough, you just need to override the WndProc and tell the WM_HITTEST that all mo... | <p>A much simpler method that might work.</p>
<p>step 1.) click on the panel in (design)</p>
<p>step 2.) look in properties</p>
<p>step 3.) set Enabled to False</p>
<p>this allowed me to click past my panel to the one behind it.</p>
| 13,736 |
<p>I have a ASP.NET page which allows an administrator to change the password for a user. Since the administrator does not know the user's password, I am using the following:</p>
<pre><code>MembershipUser member = Membership.GetUser(_usernameTextBox.Text);
member.ChangePassword(member.ResetPassword(), _passNewTextBox... | <p>You can use the following properties to test the password against:</p>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/system.web.security.membership.passwordstrengthregularexpression.aspx" rel="noreferrer">Membership.PasswordStrengthRegularExpression</a></li>
<li><a href="http://msdn.microsoft.com/en-us/... | <p>You can use a Regular Expression Validator to check if the password meets the complexity requirements.</p>
<p>Also you can use an <a href="http://www.asp.net/AJAX/AjaxControlToolkit/Samples/PasswordStrength/PasswordStrength.aspx" rel="nofollow noreferrer">Pasword Strength Meter</a> control.</p>
| 49,145 |
<p>I am curious whether it is OK to copy a directory that is under version control and start working on both copies.</p>
<p>I know it can be different from one VCS to another, but I intentionally don't specify any VCS since I am curious about different cases.</p>
<p>I was talking to a coworker recently about doing it... | <p>In Subversion, every .svn folder has whatever is necessary for the containing folder. And since all local paths are stored as relative, you are safe while copying whole or partial trees outside the original checkout tree. They will continue to function in their new homes.</p>
<p>I frequently copy subtrees from my t... | <p>Seems to me like GIT might also serve your needs, as you mention being disconnected or over a crappy connection. GIT also has very nice SVN support so the two are complementary and you'll end up with a nice versioned file system.</p>
| 8,066 |
<p>In ASP.NET, a <code>ListBox</code> has a Rows attribute I can set to say how many rows to show. A <code>DropDownList</code>, though, doesn't. Is there any way I can set the maximum number of rows a <code>DropDownList</code> should display? Code? Markup? CSS?</p>
| <p>If you want that level of control, you are left to re-implement drop down lists in javascript. Kinda sucks.</p>
| <p>Dropdownlist is rendered in a browser as html select... html
select does not support the requirements you are asking...</p>
<p>You will need to write a custom control to set the limit on max number of rows.</p>
<p>you got to write a custom control for that or use client side add-ins...</p>
<p>The following <a hre... | 33,454 |
<p>Consider this case:</p>
<pre><code>dll = LoadDLL()
dll->do()
...
void do() {
char *a = malloc(1024);
}
...
UnloadDLL(dll);
</code></pre>
<p>At this point, will the 1k allocated in the call to malloc() be available to the host process again?
The DLL is statically linking to the CRT.</p>
| <p>You can't tell. This depends on the implementation of your static and dynamic CRT. It may even depend on the <em>size</em> of the allocation, as there are CRTs that forward large allocations to the OS, but implement their own heap for small allocations.</p>
<p>The problem with a CRT that leaks is of course that it ... | <p>No, you do not leak. </p>
<p>If you mix dll models (static, dynamic) then you can end up with a memory error if you allocate memory in a dll, that you free in a different one (or freed in the exe)</p>
<p>This means that the heap created by the statically-linked CRT is not the same heap as a different dll's CRT.</p... | 16,033 |
<p>I work a lot with decision makers looking to use technology better in their businesses. I have found that <strong>a picture is worth a thousand words</strong> and prototyping a system in a diagram of some sorts always lends a lot to a discussion. I have used Visio, UML (somewhat), Mind Maps, Flow Charts and Mocked... | <p>Paper or whiteboard!</p>
<p>For the lone deveoper, I'd recommend paper. At least at first, eventually you may want to formalize it with UML, but I don't think its necessary.</p>
<p>For a group of developers that work together (physically), I'd recommend a whiteboard. That way its visible for everyone and everyone ... | <p>The UML advice works well if you're working on a large & risk-averse project with a lot of stakeholders, and with lots of contributors. Even on those projects, it really helps to develop a prototype to show to the decision makers. Usually walking them through the UI and a typical user story is quite sufficient. ... | 18,868 |
<p>That's my first 3d printer. I'm using Repetier Host as the brand recomends, and set all the configuration as the recommended one. I decided to print one STL file but the result is not the best one.
That's what I was trying to print:
<a href="https://i.stack.imgur.com/f1V22.jpg" rel="nofollow noreferrer"><img src="ht... | <p>From the video it is very clear there is <strong>a major problem with bed adhesion</strong>.</p>
<p>It also looks like you are printing on bare metal (aluminium?) which I never saw anybody doing. I must admit I don't know it is impossible or simply very rare, but the first thing I would try in your case is <strong>... | <p>I would suggest buying Buildtak, which is a high-quality adhesion surface. This surface is almost guaranteed to make your prints stick to your bed. If Buildtak is outside of your budget, I would suggest using a relatively high grade painters tape combined with either purple gluestick or hairspray applied to your bed... | 818 |
<p>I've done numerous searches and I realize that I can just download this file and install it either in windows/system32 or in the application's directory. My question is, how does this dll generally get installed on Vista? I tried installing the .net framework 3.5 and it didn't get installed with that. </p>
<p>Backg... | <p>msvcr71.dll is the Microsoft Visual C++ Common Runtime for Visual Studio 2003. Applications developed with VS2003 will usually install this.</p>
| <p>have you tried executing using "java -jar java.jar"? Does it produce the same result?</p>
| 31,758 |
<p>We have a Perl program to validate XML which is invoked from a Java program. It is not able to write to standard error and hanging in the print location. </p>
<p>Perl is writing to STDERR and a java program is reading the STDERR using getErrorStream() function. But the Perl program is hanging to write to STDERR. I ... | <p>getErrorStream does not <em>read</em> the error stream, it just obtains a handle to it. As it's a pipe, if you never actually read it, it will fill up and force the Perl program to block.</p>
<p>You need something like:</p>
<pre><code>Inputstream errors = getErrorStream();
while (errors.read(buffer) > 0) {
... | <pre><code>STDOUT->autoflush(1);
STDERR->autoflush(1);
</code></pre>
<p>This is the information I needed!
I have a Java app running some Perl scripts and I'd only get the output after it was finished.
By adding the <code>autoflush(1)</code> I get it right away.</p>
<p>BTW, I do have separate threads for reading... | 46,307 |
<p>I'm pretty sure this is not the right way to do this so I'm looking for some suggestions.</p>
<p>I don't think my problem so much is that I'm trying to solve a spatial problem. I'm just not sure of a good way to take the latitude and longitude and return a geography data type in a select statement. I have success... | <p>Since what you're wanting to do is add dependency management to an existing Ant project, that's precisely what Ivy's designed to do. Dependency management is a big part of Maven, but far from all of it. Maven is more of a project-oriented tool that does several other things in addition to dependencies. It would be w... | <p>I've just spent 2 days reading through the Ivy documentation and I have to say, USE MAVEN if you have any kind of choice. Ivy is complete and utter garbage as far as I can tell. I just wasted 2 days trying to incorporate it into my build and am cutting my losses now. Why?</p>
<ul>
<li>Ivy is a half-assed attempt at... | 41,213 |
<p>I was using mysql++ library and compiling with GCC 3.3.4.<br>
That GCC version had some bugs so I upgraded to GCC 3.4.6.<br>
After upgrading GCC I rebuilt mysql++ and recompiled my program. But now I get a segmentation fault error.</p>
<p>I get the following message:</p>
<blockquote>
<p>./mysqlTest: Symbol `_ZTV... | <p>After upgrading the C++ standard library from GCC 3.3 to GCC 3.4 you <strong>must</strong> recompile all libraries linking against it if your program uses them and at the same time also links directly against the standard C++ library. In your case, considering your follow-up, libdb_cxx-4.2 is at fault, so rebuild Be... | <p>Did you 'make clean' before rebuilding mysql++?</p>
<p>Seems like the mysqlTest program wasn't recompiled and is still wanting the previous lib.</p>
<p>If you did do make clean (supposing mysqlTest is a program coming in the package), did you 'ldconfig' after installing the new library?</p>
| 26,581 |
<p>I once had a MySQL database table containing 25 million records, which made even a simple <code>COUNT(*)</code> query takes minute to execute. I ended up making partitions, separating them into a couple tables. What i'm asking is, is there any pattern or design techniques to handle this kind of problem (huge number ... | <p>See <a href="http://www.mysqlperformanceblog.com/2006/06/09/why-mysql-could-be-slow-with-large-tables/" rel="nofollow noreferrer">Why MySQL could be slow with large tables</a> and <a href="http://www.mysqlperformanceblog.com/2007/04/10/count-vs-countcol/" rel="nofollow noreferrer">COUNT(*) vs COUNT(col)</a></p>
<p>... | <p>I'm going to second <a href="https://stackoverflow.com/questions/181792/what-techniques-are-most-effective-for-dealing-with-millions-of-records#181867">@Mark Baker</a>, and say that you need to build indices on your tables.</p>
<p>For other queries than the one you selected, you should also be aware that using cons... | 21,950 |
<p>Recently I have become curious about the Minix OS. <a href="http://www.minix3.org/" rel="noreferrer">http://www.minix3.org/</a></p>
<p>I am very taken with descriptions of its robustness & reliability features, but I have noticed a distinct paucity of software packages available for the platform.</p>
<p>Has an... | <p>Minix 3 is a new version; LINUX was prompted on the original Minix.</p>
<p>Minix is really best suited to small systems of embedded systems. If you have an old x86 PC around it should run minix handily, giving you an environment very much like what we called "an amazing workstation" in the mid-80's. </p>
<p>I lov... | <p>Coded round robin scheduler and such with nano, SSH connection can be used to code in new fashion platforms and send back the files. Minix is a great way to learn basics about Operating Systems. </p>
| 39,107 |
<p>I have something funky going on with MOSS & was wondering if anyone out there has seen anything like it:</p>
<p>I have a document library in MOSS that has several custom columns added to it. I have a column of type choice. For one document in the library (a word document), the selected value does not get disp... | <p>My first guess is a name collision between your custom column and the columns that ship with SharePoint out of the box. What is the column name that is causing the problem?</p>
<p>I have seen situations like this when there are documents in a library, and then columns are added. The existing information does not ... | <p>Along a similar line, it could be that the problem doc has a Word metadata field named subject, and MOSS is doing its property promotion thing to mess up your field. If so, clearing the Word metadata might fix it.</p>
| 21,777 |
<p>This is a question brought up in a local user group mailing list at dot.net.nz ...</p>
<blockquote>
<p>I when I create an XHTML page
old-fashioned way, I used to use the
following syntax for my CSS
declarations:</p>
</blockquote>
<pre><code><link rel=”stylesheet” type=”text/css” media=”screen” href=”css... | <p>You should define media in the CSS file:</p>
<pre><code>@media print
{
p
{
...
}
...put styles here.
}
</code></pre>
| <p>You can declare the media type inside the stylesheets. For example, printer.css:</p>
<pre><code>@media print
{
/* Print CSS rules here */
}
</code></pre>
| 42,653 |
<p>What business cases are there for using Markov chains? I've seen the sort of play area of a markov chain applied to someone's blog to write a fake post. I'd like some practical examples though? E.g. useful in business or prediction of stock market, or the like...</p>
<p><strong>Edit</strong>: Thanks to all who ga... | <p>The obvious one: Google's PageRank.</p>
| <p>Markov Chains can be used to simulate user interaction, f.g. when browsing service.</p>
<p>My friend was writing as diplom work plagiat recognision using Markov Chains (he said the input data must be whole books to succeed).</p>
<p>It may not be very 'business' but Markov Chains can be used to generate fictitious ... | 15,638 |
<p>there was a somewhat detailed thread (228684) on how to globally (using extern struct) declare a structure that could be seen in more than 1 c++ file, but I can not figure out exactly how to do it (there was a lot of discussion about do this, do that, maybe do this, try this, etc...). </p>
<p>couuld someone please ... | <p>It's called a header file.</p>
<p>in your header file (call it foo.h)</p>
<pre><code>#ifndef FOO_H
#define FOO_H
class X {
};
#endif
</code></pre>
<p>Then, in any C files you have</p>
<pre><code>#include "foo.h"
X x;
</code></pre>
<p>For C++ it's more common/preferred to use class, but you can use struct as wel... | <p>Here's a little example:</p>
<pre><code>#ifndef __my_header__
#define __my_header__
class my_class
{
};
#endif
</code></pre>
<p>The class <code>my_class</code> will be visible in any file that includes this header. I think there is something else to your question, though, but I don't quite see what.</p>
| 41,171 |
<p>For simplicity, I generally split a lot of my configuration (i.e. the contents of app.config and web.config) out into separate .config files, and then reference them from the main config file using the 'configSource' attribute. For example:</p>
<pre><code><appSettings configSource="appSettings.config"/>
</cod... | <p>Found it:</p>
<p>If you edit the test run configuration (by double clicking the .testrunconfig file that gets put into the 'Solution Items' solution folder when you add a new unit test), you get a test run configuration dialog. There's a section there called 'Deployment' where you can specifiy files or whole folder... | <ol>
<li><p>write this in your connectionString. First <strong>ConnectionString.config</strong> is not exists. </p>
<p><"connectionStrings configSource="ConnectionString.config"> "</p></li>
<li><p>open command prompt (CMD) in administrator privileged.</p></li>
<li>Create a symbolic links with the name of <strong>Co... | 18,442 |
<p>I have a collection of classes that inherit from an abstract class I created. I'd like to use the abstract class as a factory for creating instances of concrete implementations of my abstract class. </p>
<p>Is there any way to hide a constructor from all code except a parent class.</p>
<p>I'd like to do this basic... | <p>You can make the sub classes child classes, something like this:</p>
<pre><code>public abstract class AbstractClass
{
public static AbstractClass MakeAbstractClass(string args)
{
if (args == "a")
return new ConcreteClassA();
if (args == "b")
return new ConcreteClassB(... | <p>What you need to do is this to prevent the default constructor to be create. The internal can be change to public if the classes are not in the same assembly.</p>
<pre><code>public abstract class AbstractClass{
public static AbstractClass MakeAbstractClass(string args)
{
if (args == "a")
return Conc... | 4,053 |
<p>I recently began working on a project which has many gridviews on a single page. During creation of a new record, the user needs to be able to add/remove/edit these gridviews and then save to the database at the end. The problem with this obviously is that there is no datasource to bind the data too until after its ... | <p>Use a DataSet as an intermediate connection to your data source. Fill the DataSet with your data and then bind your GridView to the DataSet setting the GridView DataMember to the name of the table it is supposed to bind to.</p>
<p>As the user updates tables it will add/modify records in the DataTables in the DataS... | <p>Use a DataAdapter and a Dataset. Invoke the fillschema method in the adapter to create de metadata (cols, constraints, relations, etc) in the dataset. bind the data tables created to the different grid views. update manually cheking each row rowstate on each table or call the adapter's update method to do it au... | 46,703 |
<p>What is the best way to generate a Unique ID from two (or more) short ints in C++? I am trying to uniquely identify vertices in a graph. The vertices contain two to four short ints as data, and ideally the ID would be some kind of a hash of them. Prefer portability and uniqueness over speed or ease. </p>
<p>The... | <p>A simple solution is to use a 64 bit integer where the lower 16 bits is the first vertex coordinate, next 16 bits is the second, and so on. This will be unique for all your vertices, though not very compact.</p>
<p>So here's some half-assed code to do this. Hopefully I got the casts right.</p>
<pre><code>uint64_t ... | <p>off the cuff I'd say use prime numbers,</p>
<pre><code>id = 3 * value1 + 5 * value2 + .... + somePrime * valueN
</code></pre>
<p>Make sure you don't overflow your id space (long? long long?). Since you've got a fixed number of values just crap some random primes. Don't bother generating them, there are enough avai... | 9,127 |
<p>I want to fabricate a sample holder and shadow masks to use in vacuum chambers. The type of printing material is not important to me PLA/ABS/PC-ABS/nylon).</p>
<p>I'm worried that 3d printed objects (FDM) would degas under high vacuum. Is that an actual concern?</p>
| <p>Almost all of the FDM materials outgas even at normal atmospheric pressure, and, in fact, most plastics outgas. Further, FDM and many other printing processes do not guarantee no internal voids - meaning that putting a 3D printed object into a vacuum may result in breakage, cracking, and possible explosion hazards.... | <p>At work, I put a 3d ABS part printed via 3d hubs (5*20*30), in the chamber at 1 mbar. No signs of breakage what so ever. No signs of sudden leaks.</p>
<p>Going anywhere below 1mbar, i.e., to 10^-infinity mbar, I think should theoretically still not cause any breakage or sudden leaks, as the expected mechanism of fa... | 108 |
<p>I have a table with more than a millon rows. This table is used to index <code>tiff</code> images. Each image has fields like <code>date</code>, <code>number</code>, etc. I have users that index these images in batches of 500. I need to know if it is better to first insert 500 rows and then perform 500 updates or, w... | <p>Updates in Sql server result in ghosted rows - i.e. Sql crosses one row out and puts a new one in. The crossed out row is deleted later.</p>
<p>Both inserts and updates can cause page-splits in this way, they both effectively 'add' data, it's just that updates flag the old stuff out first.</p>
<p>On top of this u... | <p>I'm not a database guy, but I imagine doing the inserts in one shot would be faster because the updates require a lookup whereas the inserts do not.</p>
| 6,322 |
<p>I would like to have a VM to look at how applications appear and to develop OS-specific applications, however, I want to keep all my code on my Windows machine so if I decide to nuke a VM or anything like that, it's all still there.</p>
<p>If it matters, I'm using VirtualBox.</p>
| <p>This is usually handled with network shares. Share your code folder from your host machine and access it from the VMs.</p>
| <p>I do this all the time.
I have a directory in a Windows drive that I mount in my host ubuntu 12.04.
I run virtualbox ubuntu 13.04 as a guest.
I want the guest to mount the Windows directory with full non-root permissions.
I do almost all my work from a bash shell, so this method is natural for me.</p>
<p>When searc... | 6,830 |
<p>I am putting together a proposal for a large multinational company for our licenced solution. Problem is I've never put together something this big before and so I don't know what is acceptable. Ignoring hosting or support (or even the functionality of the app) for the moment and just concentrating the licence - do... | <p>With big deals it's usually discounted on each unit of whatever you're selling so that you can scale with their volume. Probably makes sense to have a base price plus a per user license that scales with their usage. Another rule of thumb is that when you have a large purchase to get approved your sales cycle will be... | <p>It's going to depend on your situation I suppose, is this licensed solution already complete, or is it going to be created specifically for this company. If it's the first, I'd suggest using previous offers as basis. If it's going to be developped, it's going to depend on how you want to recoup your money for develo... | 14,641 |
<p>We have a need to leverage client side resources for lists containing tasks.</p>
<p>The client needs to:</p>
<ul>
<li>be notified of updates to the list</li>
<li>be able to re-order/filter the list (requesting an update from the server with tasks that the client does not know of/have in cache)</li>
</ul>
<p>The p... | <p>an IPSTAG is a .uk only designation of the domain's registrar. basically, the webhost is asking you to transfer the domain name registration away from them to a new provider.</p>
<p>i would suggest you (or your client) find a new registrar, get their IPSTAG, and then send that to your old host, who will then be abl... | <p>A quick Google search turns up </p>
<blockquote>
<p>Each Domain Name registration agent is identified by a unique IPSTAG assigned by the UK Governing body for UK Domain Names, Nominet. If you want to move a UK domain name to another Internet Service Provider, you will need to know the Tag Name of your new ISP.</p... | 38,972 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.