instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>I have an SQL Server DB with a table with these fields:</p> <ol> <li>A <code>bit</code> with the default value 1, <code>NOT NULL</code>.</li> <li>A <code>smalldatetime</code> with the default value <code>gettime()</code>, <code>NOT NULL</code>.</li> <li>An <code>int</code> with no default value, <code>IDENTITY</cod...
<p>Linq-To-Sql generated classes do not pick up the Default Value Constriants.</p> <p>Maybe in the future, but the issue is constraints aren't always simple values, they can also be scalar functions like <code>GetDate()</code>, so linq would somehow have to know how to translate those. In short, it doesn't even try. I...
<p>You can create another file for your datacontext (partial class) and then use the InsertYOURENTITY and UpdateYOURENTITY partial methods to inspect your properties and assign the proper values. Call ExecuteDynamicInsert or ExecuteDynamicUpdate after your code and you're set.</p>
24,639
<p>I am creating a decoupled WMI provider in a class library. Everything I have read points towards including something along these lines:</p> <pre><code>[System.ComponentModel.RunInstaller(true)] public class MyApplicationManagementInstaller : DefaultManagementInstaller { } </code></pre> <p>I gather the purpose of t...
<p>As I understand, DefaultManagementInstaller is ran by installutil.exe - if you don't include it, the class is not installed in WMI. Maybe it is possible to create a 'setup project' or 'installer project' that runs it, but I'm not sure because I don't use Visual Studio.</p> <p>[edit]</p> <p>for remote instalation, ...
<p>Thanks Uros. It does look like all that RunInstaller and DefaultManagementInstaller do is enable you to run InstallUtil successfully against the assembly. This is strange because I'm almost certain that I didn't know about InstallUtil at the point where I'd compiled and played with my first WMI provider.</p> <p>I w...
19,713
<p>I use a 3rd party tool that outputs a file in Unicode format. However, I prefer it to be in ASCII. The tool does not have settings to change the file format.</p> <p>What is the best way to convert the entire file format using Python?</p>
<p>You can convert the file easily enough just using the <code>unicode</code> function, but you'll run into problems with Unicode characters without a straight ASCII equivalent.</p> <p><a href="http://www.peterbe.com/plog/unicode-to-ascii" rel="noreferrer">This blog</a> recommends the <code><a href="http://www.python....
<p>It's important to note that there is no 'Unicode' file format. Unicode can be encoded to bytes in several different ways. Most commonly UTF-8 or UTF-16. You'll need to know which one your 3rd-party tool is outputting. Once you know that, converting between different encodings is pretty easy:</p> <pre><code>in_f...
21,129
<p>I have two tables Institutions and Results and I want to see if there are any results for institutions that way I can exclude the ones that don't have results.</p> <p>Can I get better performance using a JOIN or using EXISTS?</p> <p>Thank you,<br> -Nimesh</p>
<p>Depending on the statement, statistics and DB server it may make no difference - the same optimised query plan may be produced.</p> <p>There are basically 3 ways that DBs join tables under the hood:</p> <ul> <li><p>Nested loop - for one table much bigger than the second. Every row in the smaller table is checked f...
<p>If you're referring to using a left (or right) outer join or a not exists subquery, I'm fairly certain the left outer join wins performance-wise. For example:</p> <p><code>SELECT t1.* FROM table1 t1 LEFT OUTER JOIN table2 t2 ON t1.id = t2.id WHERE t2.id IS NULL </code></p> <p>The above should be quicker than the e...
28,090
<p>I have two versions of my application, one "stage" and one "dev."</p> <p>Right now, "stage" is exposed to the real world for beta-testing.</p> <p>From time to time, I want an exact replica of the data to be replicated into the "dev" database.</p> <p>Both databases are on the same hosted Linux machine.</p> <p>Som...
<p>Be sure to add security to your script so only the user you are authorizing is able to run that script. basically you want to use mysql and mysqldump commands.</p> <pre><code>mysqldump -u username --password=userpass --add-drop-database --add=locks --create-options --disable-keys --extend-insert --result-file=data...
<p>Just use <a href="http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html" rel="nofollow noreferrer">mysqldump</a> to create a backup of the staging database and then load the dump file over your dev database. This will give you an exact copy of the stage data.</p>
49,764
<p>I have a problem with the jQuery-UI dialog in my ASP.NET form:</p> <pre><code>$("#pnlReceiverDialog").dialog({ autoOpen:false, modal: true, height:220, width:500, resizable :false, overlay: { opacity: 0.5,background: "black" }, buttons: { "Cancel": function() { $(this).dialog("close"); ...
<p>I know that you probably already checked that the object name is the one that you wrote (ctl00$phContent$ctl00$LetterLocation$pupNewReceiver) but the first thing that i would do is to double or triple check it... </p> <p>i once spent almost a day in a similar situation where the only thing that was wrong was the ob...
<p>JQuery Script encapsulated in the ASP.Net custom Control and use Page.ClientScript.GetPostBackEventReference(this,""). pnlReceiverDialog is a DIV outside the control.</p> <p>I was checked the Request.Params, value of the TextBox dosn't exist.</p>
48,494
<p>The product we are working on allows the user to easily set it up to run automatically whenever the computer is started. This is helpful because the product is part of the basic work environment of most of our users.<br> This feature was implemented not so long ago and for a while all was well, but when we started t...
<p>This is the effect of a new feature in Vista called "Boxing": Windows has several mechanisms that allow the user/admin to set up applications to automatically run when windows starts. This feature is mostly used for one of these purposes: 1. Programs that are part of the basic work environment of the user, such that...
<p>The program probably needs some more info put into its properties. It needs to "Run As", instead of just running.</p> <p>Maybe this application should be developed as a service, instead of a program to be launched, or you could have service that launches the program when its determined the best window of opportuni...
3,662
<p>I have a need to find all of the writable storage devices attached to a given machine, <strong>whether or not</strong> they are mounted.</p> <p>The dopey way to do this would be to <em>try</em> every entry in <code>/dev</code> that corresponds to a writable devices (<code>hd* and sd*</code>)......</p> <p>Is there ...
<p><code>/proc/partitions</code> will list all the block devices and partitions that the system recognizes. You can then try using <code>file -s &lt;device&gt;</code> to determine what kind of filesystem is present on the partition, if any.</p>
<p>Modern linux systems will normally only have entries in /dev for devices that exist, so going through hda* and sda* as you suggest would work fairly well.</p> <p>Otherwise, there may be something in /proc you can use. From a quick look in there, I'd have said /proc/partitions looks like it could do what you need.</...
24,534
<p>I have a list of integers, <code>List&lt;Integer&gt;</code> and I'd like to convert all the integer objects into Strings, thus finishing up with a new <code>List&lt;String&gt;</code>.</p> <p>Naturally, I could create a new <code>List&lt;String&gt;</code> and loop through the list calling <code>String.valueOf()</cod...
<p>As far as I know, iterate and instantiate is the only way to do this. Something like (for others potential help, since I'm sure you know how to do this):</p> <pre><code>List&lt;Integer&gt; oldList = ... /* Specify the size of the list up front to prevent resizing. */ List&lt;String&gt; newList = new ArrayList&lt;&...
<p>I just wanted to chime in with an object oriented solution to the problem.</p> <p>If you model domain objects, then the solution is in the domain objects. The domain here is a List of integers for which we want string values.</p> <p>The easiest way would be to not convert the list at all.</p> <p>That being said, in...
3,908
<p><strong>Model:</strong> Infitary M508</p> <p><strong>Details:</strong> The filament is stuck in the extruder preheated for PLA (the filament is PLA 1.75 white). The extruder's motor works and the filament is in the hole of the extruder (not somewhere else). I took the fan covering the motor apart, to show what is i...
<p>Unfortunately you're going to have to tear the extruder head apart and clean the nozzle. There are kits like the following (found on Amazon - No affiliation):</p> <p><a href="https://i.stack.imgur.com/aDs2P.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aDs2P.jpg" alt="enter image description he...
<p>Unfortunately you're going to have to tear the extruder head apart and clean the nozzle. There are kits like the following (found on Amazon - No affiliation):</p> <p><a href="https://i.stack.imgur.com/aDs2P.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aDs2P.jpg" alt="enter image description he...
1,312
<p>I have the following text</p> <pre><code>tooooooooooooon </code></pre> <p>According to this book I'm reading, when the <code>?</code> follows after any quantifier, it becomes non greedy.</p> <p>My regex <code>to*?n</code> is still returning <code>tooooooooooooon</code>.</p> <p>It should return <code>ton</code> s...
<p>A regular expression can only match a fragment of text that actually exists.</p> <p>Because the substring 'ton' doesn't exist anywhere in your string, it can't be the result of a match. A match will only return a substring of the original string</p> <p>EDIT: To be clear, if you were using the string below, with a...
<p>The string you are searching in (the haystack as it were) does not contain the substring "ton".</p> <p>It does however contain the substring "tooooooooooooon".</p>
30,556
<p>What are the pros / cons of using <code>pthread_cond_wait</code> or using a semaphore ? I am waiting for a state change like this :</p> <pre><code>pthread_mutex_lock(&amp;cam-&gt;video_lock); while(cam-&gt;status == WAIT_DISPLAY) { pthread_cond_wait(&amp;cam-&gt;video_cond, &amp;cam-&gt;video_lock); } pthread_m...
<p>A semaphore is suited cleanly to a producer-consumer model, although it has other uses. Your program logic is responsible for ensuring that the right number of posts are made for the number of waits. If you post a semaphore and nobody is waiting on it yet, then when they do wait they continue immediately. If your pr...
<p>In your second snippet, you're getting the lock multitude of times, never releasing it.</p> <p>In general, the state you're waintin on can be completely expressed by a semaphore, then you can use just that. A lock structure is smaller in size, and it requires less atomic operations to check/set/release.</p> <p>Ot...
9,624
<p>I'm looking to increase the printing speed, through increasing the volumetric flow rate, which is currently at 5&nbsp;mm³/s. Larger amounts cause the feeding mechanism to skip steps.</p> <p>I'm running at 190&nbsp;&deg;C, which helps with easier bridging less stringing and personally see no reason to increase the t...
<p>This is opinion-based, but the volcano has drawbacks that affect print quality, mine is oozier and sloppier than a V6 with the shorter, more precise melt zone. It isn’t a slam dunk upgrade, more of a special applications part. I think there is no point to using a Volcano unless you’re running big nozzles fast, like ...
<p>Yes, the Volcano or the Super Volcano allow for larger flow rate (typically when using larger nozzles), that is where they were designed for. Just the nozzle will not help you, you need this larger nozzle shaft to be inside a Volcano heater block, else you cannot transfer the heat.</p> <p>According to measurements f...
1,651
<p>I've got a couple large checkouts where the .svn folder has become damaged so I'm getting and error, "Cleanup failed to process the following path.." And I can no longer commit or update files in that directory.</p> <p>I'd just delete and do the checkout again but the whole directory is over a gig.</p> <p>Is there...
<p>In case you have changes to the files, and cannot delete them, you can use the Subversion 1.5 feature that allows you to 'checkout with obstructions'.</p> <p>Just delete the .svn directory in this directory and:<br> (you don't need to delete inside directories when using --depth files, thanks Eric)</p> <p>In case ...
<p>I encountered the same error today. It happened when I tried to switch branches and fail to delete one of the file that is not in svn repository. After that, the folder was locked and I can't use any command to get it work again. </p> <p>I basically deleted what I had and redo the checkout. It is time consuming, bu...
12,192
<p>I have a web application that makes heavy use of the Session state to store information about the current user, their personal settings, record their session history and so on. </p> <p>I have found myself retrieving this session information in my business layer, like so:</p> <pre><code>((UserSession)HttpContext.Cu...
<p>Assuming that the business layer is a separate DLL, I would never add a reference to <code>System.Web</code> and in consequence I would never use the <code>Session</code> object directly. This would lead to a different design of the business layer and of the exposed interfaces to a client (either web or winforms). ...
<p>I guess you need to create a webservice or RESTfull service. The service will return an XML file representing your user information. You will be able to invoke the service wither from you windows or web application. </p>
29,252
<p>I tried to make a dynamic 2D array of <code>char</code> as follow:</p> <pre><code>char** ppMapData = (char**)malloc(sizeof(char*)*iMapHeight); for (int i=0; i&lt; iMapHeight; i++) { ppMapData[i] = (char*)malloc(sizeof(char)*iMapWidth); //do something } // do something for (int i=0; i&lt;iMapHeight; i++) ...
<p>At a quick glance, the frees look fine. The next thing you should test is to make sure you aren't overrunning any of these arrays past the end. This can cause problems with memory allocation systems.</p> <p>If you are using visual studio, you can call _CrtCheckMemory to help verify that you aren't trashing things...
<p>Is iMapHeight / iMapWidth constant? If not, they could be changed in between, causing problems. Also, as suggested by others, check for null returns by malloc.</p>
47,125
<p>I have a char array buffer that I am using to store characters that the user will input one by one. My code below works but has a few glitches that I can't figure out:</p> <ol> <li>when I execute a printf to see what's in Buffer, it does fill up but I get garbage characters at the end</li> <li>it won't stop at 8 c...
<p>You have to end the string with a <code>\0</code> character. That's why they are called zero terminated strings.</p> <p>It is also wise to allocate 1 extra char to hold the <code>\0</code>.</p>
<p>You might also want to look into using a <code>stringstream</code>.</p>
34,034
<p>How do I tar a list of files and folders (all in the same directory) with the exclusion of a single directory (which contains a huge amount of data)</p>
<p><code>tar --exclude=PATTERN xvzf nameof.tar.gz ./*</code></p> <p>PATTERN can be the directory name. GNU tar. </p>
<p>I think it may depend on your version of tar. You can use 'man tar' or 'tar --help' to check for details on your version. But the options I found are:</p> <p>tar -X <em>filename</em>: excludes anything listed in the given text file<br> tar --exclude=<em>pattern</em>: excludes anything matching the pattern</p>
17,128
<p>I work on a variety of projects using different languages and platforms. Parts of them I abstract out into their own separate projects, and I want to open some of these up to the public.</p> <p>What gets me stuck is the christening.</p> <p>So, does it matter? Should I just choose something and stick with it?</p> ...
<p>I think naming is an important part of getting ideas to spread. What I look for in a name are:</p> <ol> <li>Memorable. It should be different than other names but easy to remember.</li> <li>Accurate. It is helpful if the name reflects something about the project.</li> <li>Positive. It is helpful if the opposite of ...
<p>Would be hard to suggest a name to use if we don't know what the product is.</p> <p>Also, this sounds a lot like a marketing question. I would say something cool and memorable but is descriptive as well. iTunes comes to mind.</p>
23,506
<p>Is there anyway to declare an object of a class before the class is created in C++? I ask because I am trying to use two classes, the first needs to have an instance of the second class within it, but the second class also contains an instance of the first class. I realize that you may think I might get into an in...
<p>You can't do something like this:</p> <pre><code>class A { B b; }; class B { A a; }; </code></pre> <p>The most obvious problem is the compiler doesn't know how to large it needs to make class A, because the size of B depends on the size of A!</p> <p>You can, however, do this:</p> <pre><code>class B; // t...
<p>Is this close to what you want: The first class contains the second class, but the second class (that is to be created first) just has a reference to the first class?</p>
13,845
<p>Let's say I have a database, and an RSS feed. I have to find out what is the new data from an RSS feed, that isn't already in the database. How would you go about approaching this problem?</p>
<p>How about generating a hashcode or some unique identifier to each RSS item, then storing it in the database? Then you just generate the hashcode for each item in the new RSS, and check it against the database.</p>
<p>Pull from a unique field of a particular item in the rss feed. Then check to see if that item is already in the db. Run this logic in a loop.</p>
20,617
<pre><code>&lt;div spry:region="ds1" spry:repeatchildren="ds1"&gt; &lt;b spry:if=" '{title}'!='' "&gt; &lt;!-- this is the first if --&gt; &lt;a href="#" spry:if=" '{author}'!='' "&gt;{author} &lt;!-- this is the second if --&gt; &lt;/a&gt; &lt;/b&gt; &lt;/div&gt; </code></pre> <p><br><br> I wo...
<p>The syntax inside the <code>spry:if</code> attribute is Javascript, so you can use <code>&amp;&amp;</code>:</p> <pre><code>&lt;b spry:if="'{title}' != '' &amp;&amp; '{author}' != ''"&gt; &lt;!-- ... --&gt; &lt;/b&gt; </code></pre>
<p>Normally I do like this </p> <pre><code>&lt;div spry:region="ds1" spry:repeatchildren="ds1"&gt; &lt;b spry:if=" '{ds1::title}'!='' &amp;&amp; '{ds1::author}'!=''"&gt; &lt;a href="#"&gt;{author}&lt;/a&gt; &lt;/b&gt; &lt;/div&gt; </code></pre>
21,527
<p>I have an <strong>if</strong> condition which checks for value and the it throws new <strong>NumberFormatException</strong></p> <p>Is there any other way to code this</p> <pre><code>if (foo) { throw new NumberFormatException } // .. catch (NumberFormatException exc) { // some msg... } </code></pre>
<p>If your aim is to avoid to throw a new exception:</p> <pre><code>if(foo) { //some msg... } else { //do something else } </code></pre>
<p>In Java, you can try parsing a string with regular expressions before trying to convert it to a number.</p> <p>If you're trying to catch your own exception (why???) you could do this:</p> <pre><code>try { if (foo) throw new NumberFormatException(); } catch(NumberFormatexception) {/* ... */} </code></pre>
18,422
<p>I've download an image from the Internet and converted to a String (This is not changeable)</p> <pre><code>Dim Request As System.Net.WebRequest = _ System.Net.WebRequest.Create( _ "http://www.google.com/images/nav_logo.png") Dim WebResponse As System.Net.HttpWebResponse = _ DirectCast(Request.GetResponse(), ...
<p>Why have you converted binary (image) data to a string? This makes no sense... unless you are using base-64?</p> <p>Anyway, to reverse what you have done, you could try using <code>new MemoryStream(Encoding.UTF8.GetBytes(text))</code>?</p> <p>This will create a new MemoryStream primed with the string (via UTF8). P...
<p>Converting binary data to a string in the way you have shown will render it useless. You can't pull it pack out. The text encoding hoses it.</p> <p>You need to use Base64 - like <a href="https://stackoverflow.com/questions/351126/convert-a-string-to-stream#351156">@Marc</a> shows.</p>
45,707
<p>Just one quick question about the filament. </p> <p>Can I leave the filament in the extruder for a prolonged period of time while the printer is off?</p>
<p>Most filaments you can leave in the extruder indefinitely without any ill effects.</p> <p>There are some filaments that need to be stored away from moisture, particularly Nylon, because they absorb moisture from the air and don't print well if they contain a lot of absorbed moisture. However, this isn't an inherent...
<p>If you "planing" to leave the filament there for months, then it would be a good idea to store it away, but for most filaments it is not a big deal to be stay loaded... provided that the humidity is not high (e.g. a shower or kitchen next to it would be not so good). </p> <p>My experiences with "moistured" filament...
928
<p>I'm trying to get my head around SPL iterators and I've come up with 2 ways to handle it. I see the first version to be less complicated but the second version has composition feel to it (I think).</p> <p>What am I not seeing is which one is preferable over the other? Or am I just over complicating this?</p> <p>He...
<p>It depends on the situation. Is the box of chocolates going t0 contain multiple collections? If so you need to have the collections be members.</p> <p>Think of it this way. Is a box of chocolates a collection (i.e. PersonList) or something that owns a collection (i.e. a car may own a collection of it's last owners)...
<p>Well, I don't know PHP, so I can't properly answer the question, but I'll try relating it to an area that I do know.</p> <p>In C#, there are two interfaces: IEnumerable and IEnumerator. In your example, BoxOfChocolates would be Enumerable, Chocolates would be an Enumerator.</p> <p>Enumerables merely have a metho...
26,566
<h2><strong>Accuracy Vs. Precision</strong></h2> <p>What I would like to know is whether I should use <strong>System.currentTimeMillis()</strong> or <strong>System.nanoTime()</strong> when updating my object's positions in my game? Their change in movement is directly proportional to the elapsed time since the last c...
<p>If you're just looking for extremely precise measurements of <strong>elapsed time</strong>, use <code>System.nanoTime()</code>. <code>System.currentTimeMillis()</code> will give you the most accurate possible elapsed time in milliseconds since the epoch, but <code>System.nanoTime()</code> gives you a nanosecond-prec...
<p>one thing here is the inconsistency of the nanoTime method.it does not give very consistent values for the same input.currentTimeMillis does much better in terms of performance and consistency,and also ,though not as precise as nanoTime,has a lower margin of error,and therefore more accuracy in its value. i would th...
45,777
<p>I have just been getting into low level programming (reading/writing to memory that sort of thing) and have run into an issue i cannot find an answer to.</p> <p>The piece of information i want to read from has an address that is relative to a DLL loaded in memory e,g, it is at mydll.dll + 0x01234567. the problem im...
<p>i tried the method Rob Walker suggested and could not get it to work (i think it did not work because the dll was loaded as part of another executable so it could not be found so easily).</p> <p>I did however discover a solution that worked for me so here it is:</p> <p>i created an object of type Process</p> <pre...
<p>From a Win32 perspective you need to use the <a href="http://msdn.microsoft.com/en-us/library/ms683199(VS.85).aspx" rel="nofollow noreferrer">GetModuleHandle</a> and <a href="http://msdn.microsoft.com/en-us/library/ms683201(VS.85).aspx" rel="nofollow noreferrer">GetModuleInformation</a> functions. These let you loo...
33,818
<p>Not quite sure what's happening here. I printed it as a single ball and had this effect. I thought it might be a cooling issue so I printed 4 at once but the issue still occurred. If I size the ball up, the problem reduces.</p> <p>Note that the hole is supposed to be a cylinder.</p> <p><a href="https://i.stack.img...
<p>It looks like possibly a combination of too high of extruder temperature and poor retraction.</p> <ol> <li>First, try <strong><em>reducing your extruder temperature</em></strong>. PLA ideal extruder temps range from about 185C to 225C; depending on purity, quality, and climate. This can help prevent additional oozi...
<p>It looks like it is trying to fill in what might be small gaps and is putting blobs down because the gaps to too small of a detail to accurately fill.</p>
411
<p>I'm looking for something that will let me parse Atom and RSS in Ruby and Rails. I've looked at the standard RSS library, but is there one library that will auto-detect whatever type of feed it is and parse it for me?</p>
<p>Feedzirra is one of the better options: <a href="http://www.pauldix.net/2009/02/feedzirra-a-ruby-feed-library-built-for-speed.html" rel="noreferrer">http://www.pauldix.net/2009/02/feedzirra-a-ruby-feed-library-built-for-speed.html</a></p> <p>Of course, I'm biased since I wrote it. :)</p>
<p>I like using niokrigi or scrapi for parsing the xml in the atom/rss feeds. <a href="http://www.rubyinside.com/nokogiri-ruby-html-parser-and-xml-parser-1288.html" rel="nofollow noreferrer">http://www.rubyinside.com/nokogiri-ruby-html-parser-and-xml-parser-1288.html</a></p>
26,376
<p>So I understand what a static method or field is, I am just wondering when to use them. That is, when writing code what design lends itself to using static methods and fields. </p> <p>One common pattern is to use static methods as a static factory, but this could just as easily be done by overloading a constructor....
<p>It gives a better idea of the intent when you use a static factory -- it also lets you have different factories that take the same argument types but have a different meaning. For example, imagine if Bitmap had LoadFromResource(string) -- it would not be possible to have two constructors that both took string.</p> ...
<p>You may use static methods when the client of the class do not have an instance of the class to work with. For instance the Singleton design pattern is used to ensure that only one instance of a class exist in the system. It requires that the constructors of the Singleton be private so that no instances can be creat...
24,773
<p>I would like to hear of the experiences of classic vb developers who migrated their applications to delphi rather than vb.net. How has it worked out? Are you glad or sorry that you didn't move to vb.net? </p>
<p>I am not really a vb developer but rather a Delphi developer who was forced to maintain some vb apps for a while. I tried to migrate one vb app to vb.net and after that experience I never tried it again. I successfully migrated several vb apps to Delphi. It wasn't easy and it became a pain in the lower back to find ...
<p>I did try in two instance to migrate from VB to Delphi but unfortunately I had to abort midway in one app as it used a lot of third party ActiveX (most from ComponentOne and a few from CodeJoke). We had to abort midway as we could not find any VCL components having equivalent functionality to the ActiveX used in th...
45,750
<p>I want to show the publish date in the About dialog.</p>
<p>Unfortunately, no. ApplicationDeployment class exposes only the <a href="http://msdn.microsoft.com/en-us/library/system.deployment.application.applicationdeployment.currentversion(VS.80).aspx" rel="nofollow noreferrer">CurrentVersion</a> property, not the publish time.</p> <p>You could use the revision field to sto...
<p>Unfortunately, no. ApplicationDeployment class exposes only the <a href="http://msdn.microsoft.com/en-us/library/system.deployment.application.applicationdeployment.currentversion(VS.80).aspx" rel="nofollow noreferrer">CurrentVersion</a> property, not the publish time.</p> <p>You could use the revision field to sto...
26,816
<p>I am trying to find the virtual file that contains the current users id. I was told that I could find it in the proc directory, but not quite sure which file.</p>
<p>You actually want <code>/proc/self/status</code>, which will give you information about the currently executed process.</p> <p>Here is an example:</p> <pre><code>$ cat /proc/self/status Name: cat State: R (running) Tgid: 17618 Pid: 17618 PPid: 3083 TracerPid: 0 Uid: 500 500 500 500 Gid: 500 50...
<p>The things you are looking for may be in environment variables. You need to be careful about what shell you are using when you check environment variables. bash uses "UID" while tcsh uses "uid" and in <code>*nix</code> case matters. I've also found that tcsh sets "gid" but I wasn't able to find a matching variabl...
11,521
<p>I've recently come across this piece of JavaScript code:</p> <pre><code>if (",&gt;=,&lt;=,&lt;&gt;,".indexOf("," + sCompOp + ",") != -1) </code></pre> <p>I was intrigued, because to write this test I would have done:</p> <pre><code>if (/(&gt;=|&lt;=|&lt;&gt;)/.test(sCompOp)) </code></pre> <p>Is this just a styli...
<p>I ran some tests. The first method is slightly faster, but not by enough to make any real difference even under heavy use... <em>except</em> when <code>sCompOp</code> could potentially be a very long string. Because the first method searches a fixed-length string, its execution time is very stable no matter how long...
<p>Is it a really old piece of code? It may have been written before regexes were widely used in javascript. Overall it looks like someone was trying to be too clever and "optimized" that statement or came from a C background and wasn't used to regexes. A regular expression can be expensive to use but string concatenat...
22,188
<p>In a servlet I do the following:</p> <pre><code> Context context = new InitialContext(); value = (String) context.lookup("java:comp/env/propertyName"); </code></pre> <p>On an Apache Geronimo instance (WAS CE 2.1) how do i associate a value with the key <em>propertyName</em>?</p> <p>In Websphere AS 6 i can conf...
<p>One possibility is to add the properties to your web.xml file (in the WEB-INF directory), using one or more <code>&lt;env-entry&gt;</code> tags. For example, something like the following:</p> <pre><code>&lt;env-entry&gt; &lt;description&gt;My string property&lt;/descriptor&gt; &lt;env-entry-name&gt;propertyNa...
<p>It is possible to put your properties in a file and make the name and location of the file a resource-ref of type URL in web.xml. The value of the resource is set in geronimo-web.xml.</p> <p>Your web.xml will have the following entry:</p> <pre><code>&lt;resource-ref&gt; &lt;res-ref-name&gt;configFileName&lt;/r...
16,962
<p>Some of Oracle's analytic functions allow for a <a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions001.htm#i97640" rel="nofollow noreferrer">windowing clause</a> to specify a subset of the current partition, using keywords like "unbounded preceding/following", "current row", or "value_e...
<p>It doesn't really matter which you use. They are two different ways of expressing the windowing, but the optimizer will perform the query the same way. The term "current row" is one that is common to multiple databases with analytic functions, not just Oracle. It's more of a stylistic difference, in the same way tha...
<p>It is all about what you're trying to accomplish. You may want to use RANGE BETWEEN/ROWS BETWEEN use it to find LAST_VALUE within the sub-set or compare things within a sub-set. But most certainly you don't need for the example you provided.</p> <pre><code> select deptno, empno, hiredate, c...
49,741
<p>We often send emails in HTML for clients (Dont like it but not my choice)</p> <p>Does anyone have any info or a link on support for the dynscrc attribute or img in email clients?</p>
<p>My solution here would be to have a screenshot (perhaps with a 'click to watch' overlay) of your movie that links to a non-mail page that has a player in it.</p> <p>Dealing with html email, in my experience, isn't so much about having standards as it is learning to compromise. Web client and (the increasingly rare...
<p>I found some info here <a href="http://stylecampaign.com/blog/?p=29" rel="nofollow noreferrer">http://stylecampaign.com/blog/?p=29</a></p> <p>not comprehensive.</p> <p>Ben suggestion is something I would consider myself if appropriate to the situation</p>
39,170
<p>I have a range of random numbers. The range is actually determined by the user but it will be up to 1000 integers. They are placed in this:</p> <pre><code>vector&lt;int&gt; n </code></pre> <p>and the values are inserted like this:</p> <pre><code>srand(1); for (i = 0; i &lt; n; i++) v[i] = rand() % n; </code>...
<p>In this code:</p> <pre><code>if(i % v[j] == 0) cout &lt;&lt; v[j] &lt;&lt; endl; </code></pre> <p>You are testing your index to see if it is divisible by v[j]. I think you meant to do it the other way around, i.e.:</p> <pre><code>if(v[j] % i == 0) </code></pre> <p>Right now, you are printing random divisors o...
<p>The idea of the sieve that you try to implement depends on the fact that you start at a prime (2) and cross out multitudes of that number - so all numbers that depend on the prime "2" are ruled out beforehand. </p> <p>That's because all non-primes can be factorized down to primes. Whereas primes are not divisible w...
30,866
<p>We have various servers that have many directories shared. It's easy enough to look at the share browser to see what the "top level" shares are, but underneath is a jumbled mess of custom permissions, none of which is documented.</p> <p>I'd like to enumerate all the shares on the domain (definitely all the 'servers...
<p>According to the JEdit <a href="http://jedit.org/index.php?page=features" rel="nofollow noreferrer">features page</a> it already supports Objective C.</p>
<p>One of my favorite things about JEdit is how easy it is to define a new syntax highlighting mode. I work in a land in which every fool wants to create his own custom configuration file language and I've gotten to where I can create a new approximate syntax highlighting mode in about 5 minutes. I start by copying a...
14,094
<p>Is it possible to use the Flex Framework and Components, without using MXML? I know ActionScript pretty decently, and don't feel like messing around with some new XML language just to get some simple UI in there. Can anyone provide an example consisting of an .as file which can be compiled (ideally via FlashDevelop,...
<p>I did a simple bootstrap similar to Borek (see below). I would love to get rid of the mxml file, but if I don't have it, I don't get any of the standard themes that come with Flex (haloclassic.swc, etc). Does anybody know how to do what Theo suggests and still have the standard themes applied?</p> <p>Here's my si...
<p>Yes, you just need to include the flex swc in your classpath. You can find flex.swc in the flex sdk in frameoworks/lib/flex.swc</p> <p>edit: One more thing: if you're using Flex Builder you can simply create a new ActionScript project, which will essentially do the same as above.</p>
17,067
<p>I finally manage to setup the ABL on my Prusa. I run G28 to home all axes (for z I use the same probe used for ABL). Then I run G29 E ( I use E because otherwise for some reason I have not understood yet, Z does not lift during probings) probing 4 points on the corners of the bed.</p> <p>finally I get the map of th...
<p>I found the issue. As I mentioned in my question UPDATE, trying to print something that cover the full bed, the ABL was not working. The issue was the Gcode I added after the G29. In fact for some reason I added a G28 X0 after the G29 and that basically cancel the data acquired in the G29. I learned something new, d...
<p>I believe that the matrix is shown transposed from how it should be, but that doesn't affect the answer. The compensated Z position is derived from the original <code>(X,Y,Z)</code> position by multiplying the corresponding vector with that matrix. This means that the new Z position would be</p> <pre><code>Z' = 0.9...
423
<p>When I render a page using the Django template renderer, I can pass in a dictionary variable containing various values to manipulate them in the page using <code>{{ myVar }}</code>.</p> <p>Is there a way to access the same variable in Javascript (perhaps using the DOM, I don't know how Django makes the variables ac...
<p>The <code>{{variable}}</code> is substituted directly into the HTML. Do a view source; it isn't a "variable" or anything like it. It's just rendered text.</p> <p>Having said that, you can put this kind of substitution into your JavaScript.</p> <pre class="lang-html prettyprint-override"><code>&lt;script type="text...
<p>you can assemble the entire script where your array variable is declared in a string, as follows, </p> <blockquote> <p>views.py</p> </blockquote> <pre><code> aaa = [41, 56, 25, 48, 72, 34, 12] prueba = "&lt;script&gt;var data2 =[" for a in aaa: aa = str(a) prueba = prueba + "'" + aa + ...
38,259
<p>I'm working on a game for the iPhone and would like it to be able to submit scores back to the server. Simple enough, but I want the scores to be verified to actually come from a game-play. With the (defacto) prohibition on real crypto with the export conditions, what would be the best way to get information back ...
<p>Couldn't you just use a client certificate (signed by you) and establish an HTTPS connection to your server, which has been configured to only accept connections begun with a client certificate signed by you?</p>
<p>generate a random, something fairly long, then tack the score to the end, and maybe the name or something else static, then sha1/md5 it, and pass both to the server, verify that the random hashes, to be equal to the hash.</p> <p>After-thought: If you want to make it harder to reverse engenier, then multiply your ra...
10,405
<p>I have the need to be able to cycle my linksys router via a program, the reason I want to do this is complex, so let's just assume there is no better option.</p> <p>Is there anyway to do this? I think there is because when I install a firmware update to the router via the admin console, it cycles the router.</p>
<p>If you can find the function to do that on the router's web interface, you can achieve the same via a suitable HTTP request. Also, you can often telnet to the router and reboot it through its command-line interface. Programmatically you can achieve the same, by using a tool like <a href="http://en.wikipedia.org/wi...
<p><a href="https://github.com/danielrussellLA/restart-linksys-EA2700-router" rel="nofollow noreferrer">https://github.com/danielrussellLA/restart-linksys-EA2700-router</a> you can try using a nightwatch bot similar to this one to programatically restart your router through its browser ui. This works well if your route...
17,664
<p>i have a sharepoint list </p> <p>with 2 users for examole (user A and user B)</p> <p>i need a calculated field in the list items such that if user "A" created the item the field vaule will be "X" and if user "B" created the item fields value would be "Y"</p> <p>but i couldnt use [created by] in the furmiula o...
<p>If using Sharepoint Designer is an option you can create a workflow for that list. Set it to start when a new item is created -or- edited, use a condition of "If Created_By equals ..." and an action of "Set yourfield to yourvalue", then add an Else If branch and repeat. This will always override anything a user ente...
<p>I believe you can create a text field that has the default value set to [Me] which should then be usable in a calculated field.</p>
13,393
<p>I am having a listbox in ASP.net. I am populating the listbox values from another listbox in a page dynamically. During postbacks the values of output listbox are not persisted. (while going to another page and come back to this page).</p> <p>Please suggest some good answer. EnableViewstate = "true" is not working....
<p>Are you doing anything in Page_Load that should be in a </p> <pre><code>if(!IsPostBack) {} </code></pre> <p>Initialization code in load needs to only be called when the page is first loaded, not on postbacks.</p> <p>If you are going to another page and then coming back to this page, I think you need to preserve t...
<p>Initialize the content of your controls in your Page's Init event (Page_Init). That way any values the user supplies are not overwritten by your defaults.</p>
25,038
<p>So our scenario is this: We have multiple Sharepoint sites that are created dynamically on a "as requested" basis. Basically there's a new site for each new project. Now, for every site we want to add a search clause that says that only contents with a metadata tag value equal to the sitename should be found. Quick ...
<p>You can use script if you want to see if the logged on user is an administrator</p> <pre><code>Set objNetwork = CreateObject("Wscript.Network") strComputer = objNetwork.ComputerName strUser = objNetwork.UserName isAdministrator = false Set objGroup = GetObject("WinNT://" &amp; strComputer &amp; "/Administrators")...
<pre><code>Function isAdmin Dim shell Set shell = CreateObject("WScript.Shell") isAdmin = false errorLevel = shell.Run("%comspec% /c net session &gt;nul 2&gt;&amp;1", 0, True) if errorLevel = 0 isAdmin = true End If End Function </code></pre>
38,745
<p>I'm trying to produce sheets of photographs with captions arranged in a grid using XSLT and XSL-FO. The photo URLs and captions are produced using a FOR XML query against an SQL Server database, and the number of photos returned varies from sheet to sheet. I want to lay the photos out in four columns, filling the gr...
<p>To keep life simple I would normally setup a table for this, it's quite simple and will ensure that things get laid out right. If you wanted to do it similarly to how you would do it in HTML then you should layout block-container elements.</p> <p>However you decide to do it I would always recommend using the <a hre...
<p>In the end I used a table with one row and four cells for this. In each one I selected the source elements with position() mod 4 equal to 0, 1, 2 or 3 as appropriate, and then made sure that the photo and caption was always the same height so the rows lined up correctly.</p>
7,748
<p>I have a problem that confuses my users, being that although an item is highlighted (by the hover style) when the user mouses over it, they have to mouse over the actual item text, sometimes quite small compared to the item. Is there a way to make the whole item clickable?</p>
<p>Add some padding to the A element? Or if it's in a menu contained within a block-level element, make the A display as block too:</p> <pre><code>a { display: block; width: 100%; } </code></pre>
<p>If you only have the text in the &lt;a&gt; ... &lt;/a&gt;, that's the only part that can be clicked on. Move your graphics, etc. inside the link.</p>
12,596
<p>Well, i've got a nice WPF book its called Sams Windows Presentation Foundation Unleashed. I really like to read and learn with it. Are there any other WPF books you could recommend? </p>
<p>I've found the following books very useful:</p> <p><a href="https://rads.stackoverflow.com/amzn/click/com/0672328917" rel="noreferrer" rel="nofollow noreferrer">Windows Presentation Foundation Unleashed - Adam Nathan</a><br /> You mention you already have this book, however I wanted to give my opinion on it. It is ...
<p>Yes, I highly recommend <a href="https://rads.stackoverflow.com/amzn/click/com/0596510373" rel="nofollow noreferrer" rel="nofollow noreferrer">this one</a></p>
3,096
<p>I have an RSS source:</p> <pre><code>http://feedity.com/rss.aspx/mr1-kossuth-hu/VVdXUlY </code></pre> <pre><code>&lt;item&gt; &lt;title&gt;2008. november 23.&lt;/title&gt; &lt;link&gt;http://www.mr1-kossuth.hu/m3u/0039c36f_3003051.m3u&lt;/link&gt; &lt;description&gt;........&lt;/description&gt;...
<p><strong>This is a simple and pure XSLT 1.0 solution</strong>, consisting of just 47 lines, half of which are closing tags. <strong>The following transformation</strong>:</p> <pre> &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> &lt;xsl:output omit-xml-declaration="yes"/> &lt;...
<p>The easiest way is a simple string replace:</p> <pre><code>$str = file_get_contents('http://feedity.com/rss.aspx/mr1-kossuth-hu/VVdXUlY'); $str = str_replace('&lt;link&gt;http://www.mr1-kossuth.hu/m3u/', '&lt;link&gt;http://stream001.radio.hu:8000/content/', $str); $str = str_replace('m3u&lt;/link&gt;', 'mp3&lt;/li...
41,659
<p>I would like to evaluate .NET as a development platform for a desktop application. I am looking for good examples of .NET desktop applications used in the mainstream. The only ones I know of are:</p> <ol> <li>Visual Studio (The copy website form is one example.)</li> <li>Team Explorer UI</li> <li>Paint.NET</li> <li...
<p><a href="http://www.icsharpcode.net/OpenSource/SD/" rel="noreferrer">SharpDevelop</a> is an open source Development IDE for .NET very much like VS.NET written in .NET (iirc it still has some pinvokes, but it is all managed code) and is quite large and feature complete.</p> <p>You can even get the <a href="http://ww...
<p>Windows Media Center has a managed API I believe. I'm not sure how much .Net stuff is in WMC, but you can check it out.</p>
21,902
<p>I have got the following problem since the server has safe mode turned on, and directories are being created under different users:</p> <ol> <li>I upload my script to the server, it shows as belonging to 'user1'. All it is doing is making a new directory when a new user is created so it can store files in it.</li> ...
<p>I've used this workaround:</p> <p>instead of php mkdir you can create directories by FTP with proper rights.</p> <pre><code> function FtpMkdir($path, $newDir) { $path = 'mainwebsite_html/'.$path; $server='ftp.myserver.com'; // ftp server $connection = ftp_connect($server); // connection ...
<p>You might be able to turn safe mode off for a specific directory via a .htaccess file (if on Apache). </p> <pre><code>php_value safe_mode = Off </code></pre> <p>You might need to get your hosting provider to make this change for you though in the httpd.conf.</p>
31,472
<p>Is there a easy way to do this? Or do I have to parse the file and do some search/replacing on my own?</p> <p>The ideal would be something like:</p> <pre><code>var myXML: XML = ???; // ... load xml data into the XML object myXML.someAttribute = newValue; </code></pre>
<p>Attributes are accessible in AS3 using the <code>@</code> prefix.</p> <p>For example:</p> <pre><code>var myXML:XML = &lt;test name="something"&gt;&lt;/test&gt;; trace(myXML.@name); myXML.@name = "new"; trace(myXML.@name); </code></pre> <p>Output:</p> <pre><code>something new </code></pre>
<p>Problem is with some attributes, like @class. Just imagine you want to create HTML source and want to create tag test</p> <p>So code should be</p> <p>var myDiv:XML = test myDiv.@class = "myClass"; //I want to set it here, because it can vary</p> <p>but this is not compilable and it throw error (at least in Fl...
11,671
<p>I want (barely computer literate) people to easily submit a large number of files (pictures) through my web application. Is there a simple, robust, free/cheap, widely used, standard tool/component (Flash or .NET - sorry no java runtime on the browser) that allows a web user to select a folder or a bunch of files on ...
<p><a href="http://www.swfupload.org" rel="nofollow noreferrer">swfupload</a>, the best tool I know that lets you do that. Simple, easy to use and even has a fallback mechanism for the 1% web users that don't have flash 8+.</p>
<p>We had a company come up with a Silverlight upload that could resize the pictures before hand so that the 5MB files didn't have to be uploaded and then resized. The image resizing capability wasn't included with the clr that comes with Silverlight. Occipital came up with their own. You can see it here: <a href="...
12,267
<p>Is it possible to access the following formatted menu item like any other standard menu item (using the underscore-method, e.g. "_File" would be accessible by pressing "f")? I would like to use "O" as "access key" here.</p> <p>Unfortunately, <code>&lt;AccessText&gt;</code> does not seem to be usable directly (I ima...
<p>As I need the subscript, I cannot avoid the custom formatting. What I found out to be an ugly, but obviously possible solution is the following:</p> <pre><code>&lt;MenuItem&gt; &lt;MenuItem.Header&gt; &lt;StackPanel Orientation="Horizontal"&gt; &lt;AccessText&gt;_O&lt;/AccessText&gt; &lt;TextBlock...
<p>Do you even need to use an AccessKey at all? Assuming that you didn't need/want the custom styling of the MenuItem header text, you could get the same affect by doing the following:</p> <pre><code>&lt;MenuItem HeaderText="_02" /&gt; </code></pre> <p>Would just putting an underscore before the 0 work? Although I se...
41,457
<p>In <strong>classic ASP</strong> there is a global object called <strong>"Application"</strong> that is accessed simultaniously by all sessions.</p> <p>As the "Application" object is a shared resource, can it cause <strong>dead locks?</strong></p> <p>EDIT: If not, why does it has <strong>lock</strong> and <strong>u...
<p><b>Deadlock</b> is different from normal <b>blocking</b>. Since pages are processed in different threads, if you want to prevent another request from modifying that shared resource, you use Lock, and to allow modification again, you use the Unlock method. The thing is, if you don't use those methods, <i>another requ...
<p>No, it never blocks.</p>
40,496
<p>We've probably all heard about the connecting lava lamps and <a href="http://www.ambientdevices.com/cat/orb/orborder.html" rel="noreferrer">ambient orbs</a> to your continuous integration systems. I was curious to know what other interesting things people are using or have heard of for extreme feedback devices? Als...
<p>An idea I have is to buy one of those <a href="http://www.microplex.no/aspx/produkt/prdinfovnet.aspx?plid=45595" rel="noreferrer">USB missile launchers</a> and write a program that can aim it at the stations of known users...</p>
<p>CruiseControl.NET + CCTray + Growl + Prowl = iPhone Push Notifications of when and who broke the build.</p>
39,008
<p>Is the singleton class in Ruby a class in and of itself? Is it the reason why all objects belong to "class?" The concept is <strong>fuzzy</strong>, but I believe it has something to do with why I can define a class method at all (<code>class foo; def foo.bar ...</code>).</p> <p>What is the singleton class in Ruby?<...
<p>First, a little definition: a <strong>singleton method</strong> is a method that is defined only for a single object. Example:</p> <pre><code>irb(main):001:0&gt; class Foo; def method1; puts 1; end; end =&gt; nil irb(main):002:0&gt; foo = Foo.new =&gt; #&lt;Foo:0xb79fa724&gt; irb(main):003:0&gt; def foo.method2; p...
<p>The most pragmatic/action-oreinted way to think of it (IMHO) is: as an inheritance chain, or method lookup/resolution order. This picture might help</p> <p><a href="http://www.klankboomklang.com/2007/11/25/modules-part-i-enter-the-include-class/" rel="nofollow noreferrer">http://www.klankboomklang.com/2007/11/25/m...
26,106
<p>I'd love to know how Stack Overflow's tagging and search is architected, because it seems to work pretty well. </p> <p>What is a good database/search model if I want to do all of the following:</p> <ol> <li>Storing Tags on various entities, (how normalized? i.e. Entity, Tag, and Entity_Tag tables?) <ul> <li>Sea...
<p>Wow I just wrote a big post and SO choked and hung on it, and when I hit my back button to resubmit, the markup editor was empty. aaargh.</p> <p>So here I go again...</p> <p>Regarding Stack Overflow, it turns out that they use <a href="https://stackoverflow.com/questions/115831/what-is-the-search-engine-behind-st...
<p>I don't know if they qualify as optimal, but both DotNetKicks and Kigg are open source digg clone implementations. You can look at how they're doing tags and search. </p> <p>My best guesses without a lot of deliberation :)</p> <ol> <li>I never like the idea of serializing multiple values into a single field, so de...
29,062
<p>I'm setting up a number sites right now and many of them have multiple domains. The question is: do I alias the domain (with <a href="http://httpd.apache.org/docs/2.0/mod/core.html#serveralias" rel="noreferrer">ServerAlias</a>) or do I <a href="http://httpd.apache.org/docs/2.0/mod/mod_alias.html#redirect" rel="nore...
<p>Redirecting is better, then there is always one, canonical domain for your content. <strike>I hear Google penalises multiple domains hosting the same content, but I can't find a source for that at the moment (edit, <a href="http://www.searchenginejournal.com/duplicate-content-penalty-how-to-lose-google-ranking-fast/...
<p>Nowadays I doubt it matters. If you see both entries in google, then you know you're doing it wrong.</p>
16,922
<p>How can I print an embossed image in a concaved shape?</p> <p>Like a big saucer. I will use this an a mold for a project.</p> <p>So far I've found lots of software with huge spread of features. It's sort of overwhelming. There is lots of ways to create images into 3D printable objects but to add the extra step and...
<p>What you describe, sounds like you want to create a lithophane; a pattern etched or engraved on a thin translucent base material (in your case a bowl) that can only be seen clearly when backlit with a light source behind it. Apparently you want to use it for another purpose.</p> <p>Special software and or scripts t...
<p>You may want to look up <a href="https://3dp.rocks/lithophane/" rel="nofollow noreferrer">https://3dp.rocks/lithophane/</a> it lets you do things like that</p>
1,349
<p>My question is similar to Engram's <a href="https://stackoverflow.com/questions/223149/how-do-you-handle-the-output-of-a-dynamically-generated-form-in-aspnet-mvc">here</a>, but my question goes a bit further. The way i intend it to work is I have a textbox asking how many entries a user is going to make. After the...
<p>I'd break this up in stages, you'll need to add a "Save" view someplace depending on what you want.</p> <p>Scott</p> <pre><code>&lt;form action="/Demo01/Create" method="post"&gt; Number of Exercises: &lt;%= Html.TextBox("tbxNumberOfExercises") %&gt; &lt;br /&gt; &lt;br /&gt; &lt;input type="submit" value="Set Exer...
<p>Thanks for the help guys. I realized at 5 this morning that my issue is that the form didn't include the new textboxes / I needed another form. I'll have to seriously look into Javascript and actually modifying the DOM as it would be better to keep it client side.</p> <p>Thanks so much.</p>
38,591
<p>I have a message broker with some topics, and some set of applications running on it. Now I want to run a new set of the same applications (say for QA environment) on the same topics (on the same broker, if I could). What is the best way to do this. Creating a new broker and or creating a new set of topics is cumber...
<p>AFAIK EMS does not support anything like what you suggest. There are a few options to get what you are looking for. </p> <p>Having independent EMS servers would be the <em>ideal</em> solution. This would allow your non-production environment to have some hickups without causing problems in your production enviro...
<p>this requirement can be achieved by having as a qualifier in the message topics/queues or "subjects", so you can segregate the environment mode from DEV to TEST on the same server.Keep in mind that, flow of messages across environments are not recommended by using same EMS Server.</p> <p>This particular requiremen...
11,042
<p>In my app I have these Hibernate-mapped types (general case):</p> <pre><code>class RoleRule { private Role role; private PermissionAwareEntity entity; // hibernate-mapped entity for which permission is granted private PermissionType permissionType; // enum @ManyToOne @JoinColumn(name = "ROLE_ID") publi...
<p>I've generally used two methods of updating a collection (the many side of a one-to-many) in Hibernate. The brute force way is to clear the collection, call save on the parent, and then call flush. Then add all of the collection members back and call save on the parent again. This will delete all and then insert a...
<p>Brian Deterling's answer helped me to overcome the phantom delete. I wish he had put a real code. Here is what I got from his suggestion 1. Posting for someone to use it or to comment my code.</p> <pre><code>// snFile and task share many to many relationship @PersistenceContext private EntityManager em; public...
21,614
<p>It's big problem to convert mod_rewrite rules to lighttpd format</p>
<p>It is generally a case of just going through one by one and converting them. I don't know of any automated means,</p> <p>The docs - <a href="http://redmine.lighttpd.net/projects/1/wiki/Docs:ModRewrite" rel="nofollow noreferrer">http://redmine.lighttpd.net/projects/1/wiki/Docs:ModRewrite</a> - has the regexes avail...
<p>url rewriting does not work within a $HTTP["url"] conditional. [<a href="http://forum.lighttpd.net/topic/1092#3028]" rel="nofollow noreferrer">http://forum.lighttpd.net/topic/1092#3028]</a></p>
8,777
<p>How do I add radio buttons as my parameter type in SSRS reports?</p> <p>Thanks in advance, Anna</p>
<p>If you are referring to the Reporting Services web interface, you can't. Selectable value lists appear as dropdown lists. You can configure to the ability to select multiple values, which are rendered as a dropdown list of checkboxes.</p>
<p>Not true, I am actually having a problem with 2 reports using the same parameter but displaying it differently. The parameter is boolean, and in one report it renders as a dropdown list and in the other it renders as a radio button list. Therefore, both are possible, the question is why is the same code being render...
39,804
<p>Here is the story. I was doing a program, every time the program is closed all the data(File links) created by the user is lost, so whenever the user reopen the program, he does have to do all the work again.</p> <p>So I decided to use an xml file to store the data, because a dbms would take too long to load and co...
<p>If LINQ is in your toolbox, I would highly recommend using that to read/write xml as opposed to a DataTable. It's much more fluent and intuitive and you can control where the nodes go... wherever you add them to the collection is where they appear in the resulting XML.</p> <p>Here's a quick intro and there's a me...
<p>Your best option if you want a quick and dirty way is to load the users information into the dataset, call the "WriteXml" method to save and use "ReadXml" to pull it back in. The XML format that the DataSet uses on its own will come in and out in the same format.</p> <p>You also have many other options, but the Da...
29,547
<p>I've rewritten my family web site using JavaScript (JQuery) making Ajax calls to PHP on the back end. It's your standard &quot;bunch of image thumbnails and one main image, and when you click on a thumbnail image the main image changes&quot; kind of thing. Everything is working as expected when using Firefox, but on...
<p>Debugging through your site here's what it looks is happening:</p> <p>After the first image is pocessed, the resize event is being thrown, so this code gets called:</p> <pre><code>$(window).bind(&quot;resize&quot;, function(){ ResizeWindow( 'nicholas-1' ) }); </code></pre> <p>which as you know reloads your gall...
<p>IE is a piece of work, isn't it? Have you tried something like this?</p> <pre class="lang-js prettyprint-override"><code>var inProcess = 0; function eventHandler() { if (inProcess == 0) { inProcess = 1; // do stuff setTimeout('inProcess = 0', 5000); } } </code></pre> <p>Cute kid, by ...
37,382
<p>I've seen SaaS applications hosted in many different ways. Is it a good idea to split features and modules across multiple databases? For example, putting things like the User table on one DB and feature/app specific tables on another DB and perhaps other commonly shared tables in another DB?</p>
<p>Start with one database. Split data/functionality when project requires it.</p> <p>Here is what we can learn from LinkedIn:</p> <ul> <li>A single database does not work</li> <li>Referential integrity will not be possible</li> <li>Any data loss is a problem</li> <li>Caching is good even when it's modestly effective...
<p>Keep it a natural design (denormalize as much as needed, normalize as less as required). Split the DB Model into its modules and keep the service oriented principles in mind by fronting data with a service (that owns the data). </p>
9,460
<p>I have an asp.net text form that contains numerous decimal fields that are optional. I want to selectively update the database but not inserting a "0" for fields that do not have data (maintaining the null status). </p> <p>Typically, I would create multiple functions, each with a different signature to handle this....
<p><a href="http://msdn.microsoft.com/en-us/library/b3h38hb0(VS.80).aspx" rel="nofollow noreferrer">Nullable Types</a> are meant for the same purpose. They represent value types with the possibility of having no data in them. Presence of value can be checked using HasValue property of these types.</p> <p>Pseudo code t...
<p>You could use the <a href="https://learn.microsoft.com/en-us/dotnet/api/system.dbnull" rel="nofollow noreferrer">DBNull class</a> to represent a null value on your web service code. </p> <p>While you would still have to use a surrogate value (e.g., 0 or -1), and then just evaluate that value to convert it into the ...
21,866
<p><em><strong>TL;DR</strong> - Please help me rebuild my CR-6 SE so that I can move on</em></p> <hr /> <p>Here's a link to the latest issue that I had to make proof of in a video: <a href="https://youtu.be/9vChL7Il_9Y" rel="nofollow noreferrer">CR6-SE failed</a></p> <p>Basically, it's failing to reach/maintain tempera...
<p>70 °C is a specialty filament. It is well below the <code>MIN_TEMP</code> defined in any sane firmware. In Marlin, you <strong>can't</strong> turn on the extruder in any way, while this is online.</p> <p>You do need to define your firmware to allow such a print - either by dropping the value in the firmware or disab...
<p>In Cura Machine Settings, add <code>M302 S70</code>.</p> <p>Apparently, <code>M302 P1</code> and <code>M302 S0</code> do nothing, you need to define a non-zero minimum, and in my case, 70. Thanks to 0scar and Trish for your help.</p>
1,850
<p>I am working with a huge list of URL's. Just a quick question I have trying to slice a part of the URL out, see below:</p> <pre><code>http://www.domainname.com/page?CONTENT_ITEM_ID=1234&amp;param2&amp;param3 </code></pre> <p>How could I slice out:</p> <pre><code>http://www.domainname.com/page?CONTENT_ITEM_ID=1234...
<p>Use the <a href="http://docs.python.org/2/library/urlparse.html#urlparse.urlsplit" rel="nofollow noreferrer">urlparse</a> module. Check this function:</p> <pre><code>import urlparse def process_url(url, keep_params=('CONTENT_ITEM_ID=',)): parsed= urlparse.urlsplit(url) filtered_query= '&amp;'.join( ...
<pre><code>import re url = 'http://www.domainname.com/page?CONTENT_ITEM_ID=1234&amp;param2&amp;param3' m = re.search('(.*?)&amp;', url) print m.group(1) </code></pre>
32,306
<p>How do I determine the size of my array in C? </p> <p>That is, the number of elements the array can hold?</p>
<p><strong>Executive summary:</strong></p> <pre><code>int a[17]; size_t n = sizeof(a)/sizeof(a[0]); </code></pre> <hr> <p><strong>Full answer:</strong></p> <p>To determine the size of your array in bytes, you can use the <code>sizeof</code> operator:</p> <pre><code>int a[17]; size_t n = sizeof(a); </code></pre> <...
<p><strong>Note:</strong> This one can give you undefined behaviour as <a href="https://stackoverflow.com/questions/37538/how-do-i-determine-the-size-of-my-array-in-c/37539#comment91048046_51392277">pointed out by M.M</a> in the comment.</p> <pre><code>int a[10]; int size = (*(&amp;a+1)-a); </code></pre> <p>For more de...
5,828
<p>I have the following database table created thus:</p> <pre><code>CREATE TABLE AUCTIONS ( ARTICLE_NO VARCHAR(20), ARTICLE_NAME VARCHAR(100), SUBTITLE VARCHAR(20), CURRENT_BID DECIMAL(5,2), START_PRICE DECIMAL(5,2), BID_COUNT VARCHAR(20), QUANT_TOTAL VARCHAR(20), QUANT...
<p>You have a space after 46.44, not a tab,</p>
<p>There is a space after the number. If you have the option of using another field delimiter from the application that creates the text file for you, that will probably make these kinds of problems easier to spot.</p>
34,291
<p>I have Eclipse PDT with Subclipse installed and currently have a PHP project drawing from a repository on my production server. I have VMWare Workstation installed with Linux and was hoping to use that as a debug server using XDebug. The problem is that when I update files, they are only committed to the repositor...
<p>I think you may be confusing the concept of a repository and a working copy. There should only be one repository for a project. The repository is basically just a central copy of your code base. You checkout the code from the repository to your debug server. When you make changes to your source code you will com...
<p>You can create a post-commit hook on the repository-machine, which tells the dev-machine to update its revision.</p>
35,387
<p>I have a polygon soup of triangles that I would like to construct a BSP tree for. My current program simply constructs a BSP tree by inserting a random triangle from the model one at a time until all the triangles are consumed, then it checks the depth and breadth of the tree and remembers the best score it achieve...
<p>Construction of an optimal tree is an NP-complete problem. Determining if a given tree is optimal is essentially the same problem.</p> <p>From this <a href="http://www.faqs.org/faqs/graphics/bsptree-faq/" rel="nofollow noreferrer">BSP faq</a>:</p> <blockquote> <p>The problem is one of splitting versus tree bal...
<ul> <li>Try to pick planes that (could potentially) get split by the most planes as splitting planes. Splitting planes can't be split.</li> <li>Try to pick a plane that has close to the same number of planes in front as in back.</li> <li>Try to pick a plane that doesn't cause too many splits.</li> <li>Try to pick a pl...
19,731
<p>I am looking for a good primer or technical description of the <strong>System Call</strong> mechanism that is used by operating systems to transition from user space to the kernel to invoke functions such as "open", "read", "write", etc...</p> <p>Is there anything other than the <a href="http://en.wikipedia.org/wik...
<p>Well for source code, there are plenty of open source kernels to dive into. </p> <p>As for books, <a href="https://rads.stackoverflow.com/amzn/click/com/0672327201" rel="nofollow noreferrer" rel="nofollow noreferrer">Robert Love's book</a> on the Linux kernel is very informative.</p>
<p>For a good explanation of system calls in Linux, look at the sample device drivers in <a href="http://lwn.net/Kernel/LDD3/" rel="nofollow noreferrer">Linux Device Drivers</a>.</p>
15,448
<p>I am battling regular expressions now as I type. </p> <p>I would like to determine a pattern for the following example file: <code>b410cv11_test.ext</code>. I want to be able to do a search for files that match the pattern of the example file aforementioned. Where do I start (so lost and confused) and what is the b...
<p>Now that you have a human readable description of your file name, it's quite straight forward to translate it into a regular expression (at least in this case ;)</p> <blockquote> <p>must start with</p> </blockquote> <p>The caret (<code>^</code>) anchors a regular expression to the beginning of what you want to m...
<p>if the letters are unimportant, you could try \w\d\d\d\w\w\d\d_test.ext which would match the letter/number pattern, or b\d\d\dcv\d\d_test.ext or some mix of the two.</p>
39,969
<p>I am using link to sql, I have a connected set of objects.</p> <p>I start out and do a linq statement like this</p> <pre><code>Dim L= from II in context.InventoryItems select II Dim L2 = L.tolist </code></pre> <p>The second line was so that I could narrow down where the problem was occuring. When the second line ...
<p>Omer's comment brings up a very good point: is this DataContext being re-used from a previous operation? If so, you may want to check out Dino Esposito's <a href="http://weblogs.asp.net/despos/archive/2008/03/19/more-on-datacontext-in-hopefully-a-realistic-world.aspx" rel="nofollow noreferrer">blog post</a> regardi...
<p>Omer's comment brings up a very good point: is this DataContext being re-used from a previous operation? If so, you may want to check out Dino Esposito's <a href="http://weblogs.asp.net/despos/archive/2008/03/19/more-on-datacontext-in-hopefully-a-realistic-world.aspx" rel="nofollow noreferrer">blog post</a> regardi...
22,682
<p>I'd like to make some custom MenuHeaders in WPF so I can have (for example), an icon and text in a menu item.</p> <p>Normally using MenuItems, if you populate the Header field with straight text, you can add an accelerator by using an underscore. eg, _File</p> <p>However, if I wanted to put in a UserControl, I bel...
<p>I think the Icon property fits your needs.<br> However to answer the original question, it is possible to retain the Accelerator functionality when you compose the content of your menuitem. <strong>If you have nested content in a MenuItem you need to define the AccessText property explicitly</strong> like in the fir...
<p>@a7an: Ah, I didn't notice the Icon property before. That's a good start.</p> <p>However, specifically I wanted to add an extra 'button' to some MenuItems so I could have a 'Pin' feature (see the recently loaded Documents list in Office 2007 for the feature idea).</p> <p>Since there needs to be code as well, will ...
8,406
<p>Thanks to FireFox's buggy implementation of ActiveX components (it really should take an image of them when printing) Flex components (in our case charts) don't print in FX.</p> <p>They print fine in IE7, even IE6.</p> <p>We need these charts to print, but they also have dynamic content. I don't really want to dr...
<p>Using the ACPrintManager I was able to get firefox 3 to print perfectly!</p> <p>The one thing I had to add to the example was to check if stage was null, and callLater if the stage was null.</p> <pre><code>private function initPrint():void { //if we don't have a stage, wait until the next frame and try again ...
<p>Thanks. A load of <code>callLater</code>-s added to our custom chart code seems to have done it.</p>
3,066
<p>Does anyone know of an open source module or a good method for handling application errors and e-mailing them to an admin and/or saving to a database?</p>
<p><a href="http://code.google.com/p/elmah/" rel="nofollow noreferrer">ELMAH</a> is a great drop-in tool for this. DLL in the bin directory, and some markup to add to the web.config and you're done.</p>
<p>log4net is open source, fairly easy to learn, and can be configured to log to multiple sources (file, email, db, eventlog) very easily.</p>
11,012
<p>A co-worker asked me how the word "Nuke" relates to CMS? To be honest I never thought about it, and there wasn't any information on the web that I could find.</p> <p>Francisco Burzi wrote that his Perl script that he used to manage content was called NUKE. His knowledge of that system fueled his adaptation of thatw...
<p>the term Nuke originates with phpNuke and subsequent forks such as PostNuke. dotnetNuke just adopted the term from the php version. </p> <p>I have no clue why phpNuke was named as such, but google to the rescue!</p> <p><a href="http://74.125.95.132/search?q=cache:atpksHABV2AJ:www.uiarch.org/CMpro-v-p-36.htm+origin...
<p>I'd heard that it relates to the slang term for using a microwave oven. Using a CMS adds convenience to updating a web site in a similar way that using a microwave is so much faster and simpler than using a real oven. But that's just hearsay.</p>
38,943
<p>I'm sure there are different approaches to this problem, and I can think of some. But I'd like to hear other people's opinion on this. To be more specific I've built a widget that allows users to choose their location from a google maps map. This widget is displayed on demand and will probably be used every 1 out of...
<pre><code>function loadJSInclude(scriptPath, callback) { var scriptNode = document.createElement('SCRIPT'); scriptNode.type = 'text/javascript'; scriptNode.src = scriptPath; var headNode = document.getElementsByTagName('HEAD'); if (headNode[0] != null) headNode[0].appendChild(scriptNode); ...
<p>you can load script dynamically by adding <code>&lt;script src="..."&gt;</code> tag to DOM tree.</p>
40,019
<p>I'm building a traditional ASP.NET Web Service -- the style built using asmx. It's a pretty simple service. I started using the new Ado.NET Entity Framework for my persistence layer, and I'm running into some problems:</p> <p>1) I don't like the WSDL that gets automatically generated -- the complex types were ge...
<p>You're facing the kind of wall many of us have faced when trying to use the Entity Framework in an SOA style architecture. </p> <p>Version 1.0 of the Entity Framework doesn't work very well in the scenario you've described, as you end up in a world of hurt trying to manage object contexts (and likely having to ca...
<p>Thanks. This is what I was suspecting, but didn't want to spend a whole day researching. What I'm going to do for the time being is to keep my objects separate, this way I can keep the clean WSDL, and then in a data access layer, I'll convert between objects on the wire and the ADO.NET entity framework. </p> <p>...
43,289
<p>I've recently inherited a fairly large web site. The project is set up as a web site in Visual studio, and not a Web Application. For a number of reasons, I would like to convert it to a web application.</p> <p>I started converting the application using these directions from Scott Gu: <a href="http://webproject.sco...
<ul> <li>You should convert included aspx files to classes, if they are used as code libraries in the old situation</li> <li>You should convert aspx files, which contain html, server- and/or HTML-controls to usercontrols (ascx files)</li> </ul> <p>This should be a good starter for now. Later on you could refactor to y...
<p>You'll need to refactor the #included content into classes and controls that can be used in the main pages.</p> <p>ASP.Net will <em>not</em> do #include.</p>
26,997
<p>Is there a good command-line UNIX charting / graphing / plotting tool out there? I'm looking for something that will plot xy points on an ASCII graph.</p> <p>Just to clarify, I'm looking for something that will output a graph in ASCII (like ascii-art style), so I can use it over an interactive shell session withou...
<p>Try <a href="http://www.gnuplot.info/" rel="noreferrer">gnuplot</a>. It has very powerful graphing possibilities.</p> <p>It can output to your terminal in the following way:</p> <pre><code>gnuplot&gt; set terminal dumb Terminal type set to 'dumb' Options are 'feed 79 24' gnuplot&gt; plot sin(x) 1 ++-----------...
<p>Here is my patch for eplot that adds a -T option for terminal output:</p> <pre><code>--- eplot 2008-07-09 16:50:04.000000000 -0400 +++ eplot+ 2017-02-02 13:20:23.551353793 -0500 @@ -172,7 +172,10 @@ com=com+"set terminal postscript color;\n" ...
15,011
<p>I was re-reading Effective Java (2nd edition) item 18, <a href="http://my.safaribooksonline.com/9780137150021/ch04lev1sec6" rel="nofollow noreferrer">prefer interfaces to abstract classes</a>. In that item Josh Bloch provides an example of a skeletal implementation of the <code>Map.Entry&lt;K,V&gt;</code> interface...
<ol> <li>I would say it helps emphasize what the concrete class is intended to deal with, instead of just leaving it up to the compiler to tell you (or you having to compare both to see what is missing). Kind of self-documenting code. But it certainly isn't necessary, it is more of a style thing, as far as I can see.</...
<p>One reason that <code>AbstractMapEntry#getKey</code> and <code>getValue</code> are abstract (i.e. unimplemented) is that <code>Map.Entry</code> is an inner interface to <code>Map</code>. Using nested classes/interfaces is how Java implements composition. The idea in composition is that the composed part is not a fir...
29,346
<p>I am trying to set the background color of a DataGridView row to red. I tried with the following line:</p> <p>dgvActiveCalls.Rows[1].DefaultCellStyle.BackColor = Color.Red;</p> <p>but it doesn't work. Then just to see if something is wrong with update I tried to paint the column instead of row:</p> <p>dgvActiveCa...
<p>Make sure that the default style isn't being overriden by another of the styles. Interesting quirk of DGV in 2.0: Seems like the inheritence chain is almost upside down from what you'd expect. If you are dynamically adding columns, your DefaultCellStyle can be ignored and be overridden by the RowsDefaultCellStyle...
<p>I tested that on my machine and it worked fine. Are you sure that line isn't highlighted? If it's highlighted you'll see the highlighted color, not the red.</p>
32,902
<p>We've added performance measures to our application and are exposing them using JMX. Now we would like to gather and store performance data for analysis, in files or in a database.</p> <p>Does anyone know of a JMX client, open source or commercial, that can persist gathered information?</p>
<p><a href="http://www.oracle.com/technology/products/jrockit/missioncontrol/index.html" rel="nofollow noreferrer">JRockit Mission Control</a> can persist JMX data to log-rotated XML-files that you can open up and view in the gui. </p>
<p>you can attach logging functionality to jconsole itself and log mbean output etc.</p>
43,340
<p>I have just installed the Platform SDK for Windows Server 2008 and .NET 3.5 on my new system, and for the first time tried to compile a project for WIN64. The Unicode Release version of that program, built for 32 bit (using the optimizing compiler from the no longer available Free Toolkit), comes in at about 2.8 MB...
<p>A 64-bit binary will be larger than a 32-bit binary due to code side differences, static data, etc. Our project comes in at 7.1MB (x86) vs 10.7MB (x64), and that is for a significant amount of code. Nearly doubling sounds excessive, unless you have a lot of pointer sized static data.</p> <p>Make sure you are link...
<p>I highly doubt that it's the optimizer. The difference in program size probably has to with debugging information and/or static libraries being linked in. Make sure you're not linking against any static libraries you don't need.</p>
43,925
<p>The code below always return an empty array from <code>GetModifiedMembers(object)</code> but <code>dx.GetChangeSet().Updates.Contains( foo )</code> returns true.</p> <pre><code>DataContext dx = new DataContext( string.Empty ); MockLinqDataObject foo = new MockLinqDataObject(); dx.GetTable( foo.GetType() ).Attach( f...
<p>Homework?</p> <pre><code>set RootObject to the current object. while the parent of RootObject is not undefined, set RootObject to its parent. Finally, return RootObject. </code></pre>
<p>Why you have difficulty in locating the root? go from parent to parent until parent is not set.</p> <p>BTW Are you talking about B+ trees? They auto balance using blocks of children that get split when a threshold is exceeded look at this image in wikipedia <a href="https://web.archive.org/web/20100305054914/http:/...
38,243
<p>Is there any way to change the default datatype when importing an Excel file into Access? (I'm using Access 2003, by the way).</p> <p>I know that I sometimes have the freedom to assign any datatype to each column that is being imported, but that could only be when I'm importing non-Excel files. </p> <p><strong>EDI...
<p>This <em>may</em> be caused by Excel Jet driver default settings. Check out the following registry key and change it's value from default 8 to 0, meaning "guess column data type based on all values, not just first 8 rows."</p> <pre><code>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Excel] "TypeGuessRows"=...
<p>Access will do this.</p> <p>In your import process you can define what the data type of each column is.</p>
14,892
<p>Given an object:</p> <pre><code>let myObject = { &quot;ircEvent&quot;: &quot;PRIVMSG&quot;, &quot;method&quot;: &quot;newURI&quot;, &quot;regex&quot;: &quot;^http://.*&quot; }; </code></pre> <p>How do I remove the property <code>regex</code> to end up with the following <code>myObject</code>?</p> <pre><code>le...
<p>To remove a property from an object (mutating the object), you can do it like this:</p> <pre><code>delete myObject.regex; // or, delete myObject['regex']; // or, var prop = &quot;regex&quot;; delete myObject[prop]; </code></pre> <p>Demo <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-b...
<p>We can remove using</p> <ol> <li>using delete object.property</li> <li>using delete object['property']</li> <li>using rest, remove multiple property</li> </ol> <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 lan...
25,526
<p>I added the ModalPopupExtender to an existing ASP.NET application. At runtime I get the following error</p> <p>Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appro...
<p>You're trying to compile a .NET 3.5 application with a reference to a .NET 1.1 module. Make sure you have the .NET 3.5 framework installed, and if you do, make sure you're trying to build it in .NET 3.5.</p> <p>You may also want to see <a href="https://stackoverflow.com/questions/43939/targeting-multiple-versions-...
<p>You're trying to compile a .NET 3.5 application with a reference to a .NET 1.1 module. Make sure you have the .NET 3.5 framework installed, and if you do, make sure you're trying to build it in .NET 3.5.</p> <p>You may also want to see <a href="https://stackoverflow.com/questions/43939/targeting-multiple-versions-...
37,581
<p>I am using Direct3D to display a number of I-sections used in steel construction. There could be hundreds of instances of these I-sections all over my scene.</p> <p>I could do this two ways:</p> <p><img src="https://i.stack.imgur.com/Eu1Lr.png" alt="I-Sections"></p> <p>Using method A, I have fewer surfaces. Howev...
<p>From <a href="http://msdn.microsoft.com/en-us/library/system.timers.timer(VS.80).aspx" rel="nofollow noreferrer">MSDN</a>:</p> <blockquote> <p>The Elapsed event is raised on a ThreadPool thread. If processing of the Elapsed event lasts longer than Interval, the event might be raised again on another Threa...
<p>Well my most basic instinct would be that somehow you actually have two event wireups to the Elapsed event - resulting in two events firing. I've been caught out through this, sometimes because I've added the event wireup manually when it has already been added in the designer, or there is some inheritance aspect he...
29,616
<p>I have an idea for a 3D printed project, but I'm a total noob in this area and need someone to reality check it for me.</p> <p>Basically what I want to do is a tricopter frame made of a <a href="https://en.wikipedia.org/wiki/Tetragonal_disphenoid_honeycomb" rel="nofollow noreferrer">tetrahedral honeycomb</a>.</p> ...
<p>For designing your part, especially considering the repetitive mathematics involved, I would consider to learn to use OpenSCAD. I've learned the program and it fits your modeling requirement quite well. I feel it's easy to learn and is somewhat easier for folks who have a programming background. I don't have one, bu...
<p>In short, I don't think printing the full tetrahedral honeycomb design is a good approach considering the application of the part. Here are few things to note when attempting to 3D print the tetrahedral honeycomb:</p> <p>I wouldn't recommend trying to 3D print this with a an FDM/FFF printer as you will most likely ...
246
<p>I frequently start with a simple console application to try out an idea, then create a new GUI based project and copy the code in. Is there a better way? Can I convert my existing console application easily?</p>
<p>Just add a new Winform, add the following code to your <code>Main</code>:</p> <pre><code> Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); </code></pre> <p>Also, be sure the <code>[STAThread]</code> attribute is declared above your <co...
<p>For completeness - and for other newbs like me - you also need to add:</p> <p>using System.Windows.Forms;</p> <p>... to the top of Program.cs</p>
17,450