instruction stringlengths 27 22.5k | chosen stringlengths 27 28.2k | rejected stringlengths 19 24.9k | __index_level_0__ int64 0 10k |
|---|---|---|---|
<p>I've got a Repeater that lists all the <code>web.sitemap</code> child pages on an ASP.NET page. Its <code>DataSource</code> is a <code>SiteMapNodeCollection</code>. But, I don't want my registration form page to show up there.</p>
<pre><code>Dim Children As SiteMapNodeCollection = SiteMap.CurrentNode.ChildNodes
... | <p>Your shouldn't need CType</p>
<pre><code>Dim children = _
From n In SiteMap.CurrentNode.ChildNodes.Cast(Of SiteMapNode)() _
Where n.Url <> "/Registration.aspx" _
Select n
</code></pre>
| <p>I got it to work with code below:</p>
<pre><code>Dim children = From n In SiteMap.CurrentNode.ChildNodes _
Where CType(n, SiteMapNode).Url <> "/Registration.aspx" _
Select n
RepeaterSubordinatePages.DataSource = children
</code></pre>
<p>Is there a better way where I don't have ... | 3,334 |
<p>I have 3 Linux machines, and want some way to keep the dotfiles in their home directories in sync. Some files, like .vimrc, are the same across all 3 machines, and some are unique to each machine.</p>
<p>I've used SVN before, but all the buzz about DVCSs makes me think I should try one - is there a particular one t... | <p>I've had the same problem, and built a tool on top of Subversion that adds permission, ownership and secontext tracking, keeps the .svn directories out of the actually versioned trees, and adds a concept of layers so you can for example track all your config related to development, which you then only check out on m... | <p>Version control software isn't really great for home directories. Worse, some software doesn't really like the .svn folders or starts to interpret their contents. You could of course try to fix this with some very complex mirroring setup, but that's hard.</p>
| 5,928 |
<p>I'm trying to wrap my head around reflection, so I decided to add plugin capability to a program that I'm writing. The only way to understand a concept is to get your fingers dirty and write the code, so I went the route of creating a simple interface library consisting of the IPlugin and IHost interfaces, a plugin ... | <p>I'm just guessing here because from your code it's not obvious where do you have definition of IPlugin interface but if you can't cast in your host application then you are probably having IPlugin interface in your host assembly and then at the same time in your plugin assembly. This won't work.</p>
<p>The easiest ... | <p>Is your type not public, if so, call the overload that takes in a boolean:</p>
<pre><code>Activator.CreateInstance(type, true);
</code></pre>
<p>Also, in your first example, see if o is null and if not, print out o.GetType().Name to see what it really is.</p>
| 5,152 |
<p>I recently ran out of disk space on a drive on a FreeBSD server. I truncated the file that was causing problems but I'm not seeing the change reflected when running <code>df</code>. When I run <code>du -d0</code> on the partition it shows the correct value. Is there any way to force this information to be updated... | <p>This probably centres on <em>how</em> you truncated the file. <em>du</em> and <em>df</em> report different things as <a href="http://www.unix.com/unix-dummies-questions-answers/29223-sco-unix-disk-space.html" rel="nofollow noreferrer">this post on unix.com explains</a>. Just because space is not used does not necess... | <p>Does df --sync work?</p>
| 4,836 |
<p>I have the need to copy the entire contents of a directory on a FTP location onto a shared networked location. FTP Task has you specify the exact file name (not a directory) and File System Task does not allow accessing a FTP location.</p>
<p><strong>EDIT</strong>: I ended up writing a script task.</p>
| <p>I've had some similar issues with the FTP task before. In my case, the file names changed based on the date and some other criteria. I ended up using a Script Task to perform the FTP operation.</p>
<p>It looks like this is what you ended up doing as well. I'd be curious if anyone else can come up with a better way ... | <p>When I need to do this sort of thing I use a batch file to call FTP on the command line and use the mget command. Then I call the batch from the DTS/DTSX package.</p>
| 6,358 |
<p>I'm trying to disable a bunch of controls with JavaScript (so that they post back values). All the controls work fine except for my radio buttons as they lose their value. In the below code which is called via a recursive function to disable all child controls the Second else (else if (control is <code>RadioButton</... | <p>I found 2 ways to get this to work, the below code correctly distinguishes between the RadioButton and Checkbox controls.</p>
<pre><code> private static void DisableControl(WebControl control)
{
Type controlType = control.GetType();
if (controlType == typeof(CheckBox))
{
... | <p>Off the top of my head, I think you have to check the "type" attribute of the checkbox to determine if it's a radio button.</p>
| 5,211 |
<p>I want to run two stepper motors using Arduino Mega 2560 and RAMPS 1.4. But, somehow I burned the Arduino while I was connecting the motor and plugging the board to the computer.</p>
<p>Can I plug external power supply and USB connection to the computer at the same time?</p>
<h3>Additional info from comments</h3>
<p... | <p>I had a similar issue building my Prusa i3 Mk2s clone. I was constantly hooking & unhooking my Arduino from my PC while the printer was plugged into the mains. At some point it had enough & it released some "magic smoke". Later on I found out this was the power regulator on the Arduino.</p>
<p>Y... | <p>The answer is, yes you can, but you need to follow guidelines.</p>
<p>Reversing +/- or otherwise incorrectly connecting power can destroy your electronics and cause fire hazard.</p>
<hr />
<p>From <a href="http://reprap.org/wiki/RAMPS_1.4" rel="nofollow noreferrer">RepRap wiki - RAMPS 1.4</a></p>
<blockquote>
<p>Max... | 871 |
<p>Is there a .NET Control Similar to the Access 2007 Split Form?</p>
<p>Or has anyone built such a control?</p>
<p>I upgraded a small personal Name and Address DB to Access 2007 and noticed the Form had a property called “Default View” which can be set to “Split Form”. “Split Form” mode has a GridView and a Form tog... | <p>Not that I know of, but pretty much all you need is:</p>
<ul>
<li>a split container</li>
<li>a user control containing your actual form</li>
<li>a grid view</li>
</ul>
<p>Now you just hook up the grid view's item selection events with a controller that loads data into the user control's child controls.</p>
<p>Fro... | <p>A Flex Grid Control will probably do what you want but you will need to write a bit of VBA code, have a look at my Flex Grid Demo program for some examples.</p>
<p>Go to <a href="http://www.rogersaccesslibrary.com/forum/forum_posts.asp?TID=180" rel="nofollow noreferrer">http://www.rogersaccesslibrary.com/forum/foru... | 7,043 |
<p>I've spent a good amount of time coming up with solution to this problem, so in the spirit of <a href="https://stackoverflow.com/questions/21245/questions-vs-conveying-information">this post</a>, I'm posting it here, since I think it might be useful to others. </p>
<p>If anyone has a better script, or anything to a... | <p>I've modified the version above to run for all tables and support new SQL 2005 data types. It also retains the primary key names. Works only on SQL 2005 (using cross apply).</p>
<pre><code>
select 'create table [' + so.name + '] (' + o.list + ')' + CASE WHEN tc.Constraint_Name IS NULL THEN '' ELSE 'ALTER TABLE '... | <p>If you are using management studio and have the query analyzer window open you can drag the table name to the query analyzer window and ... bingo! you get the table script.
I've not tried this in SQL2008</p>
| 4,168 |
<p>I admit it: I don't bother with too much exception handling. I know I should do more but I can never wrap my head around where to start and where to stop. I'm not being lazy. Far from it. It's that I'm overwrought with exception handling ambivalence. It just seems that there is a seemingly infinite number of pla... | <p>Microsoft's <a href="http://msdn.microsoft.com/en-us/practices/default.aspx" rel="nofollow noreferrer">Patterns & Practices team</a> did a good job incorporating best practices of exception management into Enterprise Library <a href="http://msdn.microsoft.com/en-us/library/cc511522.aspx" rel="nofollow noreferrer... | <p>Well at the very basic level you should be handling the HttpApplication.Error event in the Global.asax file. This should log any exception that occurs to a single place so you can review the stack trace of the exception.</p>
<p>Apart from this basic level you should ideally be handling exceptions where you know you... | 7,981 |
<p>I'm considering buying <a href="http://reprapworld.com/?products_details&products_id/783/cPath/1680">this package</a>, the Kossel, as my first 3D printer. </p>
<p>It's not the cheapest model, but apparently a high resolution and stable, which is what I'm after.</p>
<p>The question is, what is the life expecta... | <p>Much like your car, the number of miles, or the number of prints that you can get out of it is entirely up to how well <strong>you</strong> can maintain it.</p>
<p>A 3D Printer is a machine, and a machine needs general maintenance; if you see something starting to break - or get worn out - or anything abnormal, fix... | <p>I have built a Kossel too. Got lots of tips from the Google Deltaprinter group.
Most important when using the Traxxas rod ends is to have the metal parts go into the freezer and the plastic parts in warm water(not boiling, just 60 degrees celsius or so). Then put the 2 together, due to the fact the metal crimps just... | 127 |
<p>I was able to connect my terminal program (Putty) to my 3D Printer (Creality Ender 3 Pro) and was able to send G-code commands to my printer and it obeys.</p>
<p>Now suppose I sent long command like</p>
<pre><code>G29 ; auto bed leveling
</code></pre>
<p>and it is still executing. Printer writes me</p>
<pre><code>ec... | <p>Photo interpretation: I understand that the image on the right presents the actual error: it happens on many layers, following the red "Starting Point" line (so above it on the photo). Interesting issue. Btw. which side of the print is the bottom (zero layer)? - I believe the left side, and the right side ... | <p>Photo interpretation: I understand that the image on the right presents the actual error: it happens on many layers, following the red "Starting Point" line (so above it on the photo). Interesting issue. Btw. which side of the print is the bottom (zero layer)? - I believe the left side, and the right side ... | 1,820 |
<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>I bought an Ender 3, and after assembling it following the description and some YouTube videos and after correct leveling, I printed the test dog gcode on the micro SD card that comes with the printer. PLA 1.75 mm. Attached the image of the printing result. What went wrong? I didn't change or modify any setting... | <p>This is an extreme case of repeated layer shifting in the Y-carriage, which can come from some pieces related to the carriage. Luckily for you, they are easily fixable.</p>
<ul>
<li>The Ender3 Y-carriage has an eccentric nut to adjust the force the wheels press down on the V-slot. Adjust it (most likely loosen them... | <p>Ender 3's have a reputation to be not quite square on the base. Make sure that your X, Y, and X axis' are all perfectly squared.</p>
| 1,238 |
<p>Is the return value of GetHashCode() guaranteed to be consistent assuming the same string value is being used? (C#/ASP.NET)</p>
<p>I uploaded my code to a server today and to my surprise I had to reindex some data because my server (win2008 64-bit) was returning different values compared to my desktop computer.</p>... | <p>If I'm not mistaken, GetHashCode is consistent given the same value, but it is NOT guaranteed to be consistent across different versions of the framework.</p>
<p>From the MSDN docs on String.GetHashCode():</p>
<blockquote>
<p>The behavior of GetHashCode is dependent on its implementation, which might change from... | <p>I would have to Say...you cannot rely on it. For example if I run file1 through c#'s md5 hash code and copy nd paste the same file to a new directory...the hash code come out different even tough it is he same file. Obviously its the same .net version, same everything. The only thing that changed was the path.</p... | 7,651 |
<p>I'm doing some web scraping and sites frequently use HTML entities to represent non ascii characters. Does Python have a utility that takes a string with HTML entities and returns a unicode type?</p>
<p>For example:</p>
<p>I get back:</p>
<pre><code>&#x01ce;
</code></pre>
<p>which represents an "ǎ" with a to... | <p>The standard lib’s very own HTMLParser has an undocumented function unescape() which does exactly what you think it does:</p>
<p>up to Python 3.4:
</p>
<pre><code>import HTMLParser
h = HTMLParser.HTMLParser()
h.unescape('&copy; 2010') # u'\xa9 2010'
h.unescape('&#169; 2010') # u'\xa9 2010'
</code></pre>
<... | <p>Here is the Python 3 version of <a href="https://stackoverflow.com/a/58125/2086547">dF's answer</a>:</p>
<pre><code>import re
import html.entities
def unescape(text):
"""
Removes HTML or XML character references and entities from a text string.
:param text: The HTML (or XML) source text.
:retur... | 8,205 |
<p>Today I was printing some parts and I got these burn marks at the corners:</p>
<p><a href="https://i.stack.imgur.com/D8b3n.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/D8b3n.jpg" alt="1"></a></p>
<p>This is the first time I see this on this printer (Anycubic I3 Mega). I was using more or less... | <p>In addition to <a href="https://3dprinting.stackexchange.com/a/7933/5740">this answer</a> which addresses <strong><em>what</em></strong> is actually the cause (<em>but doesn't explain where the burnt corners come from</em>), I've added some information <strong><em>why</em></strong> this is showing burnt corners.</p>... | <p>Could be a dirty nozzle and temperature too high. When the head changes direction on the corner, the nozzle wipes off burnt PLA. This might explain why there are no dark marks on the long runs and only the corners.</p>
<p>Heat nozzle up and clean with acetone and then see if the problem persists.</p>
| 1,175 |
<p>I'm using firmware Marlin 2.0.3 on an Anet A8 printer. I'm using a Roko SN04-N NPN bed leveller. I've managed to set up 3 points bed levelling but I wanted to try the bilinear levelling.</p>
<p>Issue is, the sensor goes out of the aluminum bed ever so slightly during levelling, resulting in the printing head crashi... | <p>If you have managed to setup 3-point levelling, you should be able to enable bi-linear levelling in the firmware.</p>
<p>From the <a href="https://github.com/MarlinFirmware/Configurations/blob/master/config/default/Configuration.h" rel="nofollow noreferrer">configuration.h</a> file for Marlin firmware you can find ... | <p>Note for anyone looking at the answer above, but in 2.1.x:
The <code>#define</code> lines have been renamed:</p>
<pre><code>#if PROBE_SELECTED && !IS_KINEMATIC
#define PROBING_MARGIN_LEFT PROBING_MARGIN
#define PROBING_MARGIN_RIGHT PROBING_MARGIN
#define PROBING_MARGIN_FRONT PROBING_MARGIN
#define PR... | 1,586 |
<p>If you're creating a temporary table within a stored procedure and want to add an index or two on it, to improve the performance of any additional statements made against it, what is the best approach? Sybase says <a href="http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.dc20020_1251/html/databases/data... | <p>A few thoughts: </p>
<ul>
<li>If your temporary table is so big that you have to index it, then is there a better way to solve the problem? </li>
<li><p>You can force it to use the index (if you are sure that the index is the correct way to access the table) by giving an optimiser hint, of the form: </p>
<pre><co... | <p>In Sybase if you create a temp table and then use it in one proc the plan for the select is built using an estimate of 100 rows in the table. (The plan is built when the procedure starts before the tables are populated.) This can result in the temp table being table scanned since it is only "100 rows". Calling a ano... | 7,728 |
<p>I have a "classic" home built 3D printer, Arduino Mega, RAMPS 1.4 with Marlin 2.0.</p>
<p>It worked, was put in storage, and now I am trying to get it running again.</p>
<p>During all of the testing phases, the PID autotune, etc., the temperature of the hotend is stable.</p>
<p>When printing, for a few lay... | <p><a href="https://i.stack.imgur.com/1ldX4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1ldX4.png" alt="Left right" /></a></p>
<p><a href="https://i.stack.imgur.com/TtrmF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TtrmF.png" alt="Filament sensors" /></a></p>
<p>The MK3 has... | <p>On the LCD, the MK3 will show <strong>Original Prusa MK3 OK</strong>, while the MK3S/+ will show <strong>Original Prusa MK3S OK</strong></p>
| 1,986 |
<p>I have a prusa i3 and have been trying to calibrate it. I have been trying to upload the new steps per mm and I get to done uploading. However when I go into Repetier host and type M503 to get the printers settings it still shows the steps as 100 for the y axis, it needs to be 96.1810. I am using ramps 1.4 I think, ... | <p><a href="https://www.youtube.com/watch?v=Mbn1ckR86Z8" rel="nofollow">See here</a> for why you <em>shouldn't</em> calibrate your X/Y-steps. The value of 100 is probably better and will give more accurate prints overall than the value you came up with.</p>
<p>When uploading new firmware you generally do not have to p... | <p><a href="https://www.youtube.com/watch?v=Mbn1ckR86Z8" rel="nofollow">See here</a> for why you <em>shouldn't</em> calibrate your X/Y-steps. The value of 100 is probably better and will give more accurate prints overall than the value you came up with.</p>
<p>When uploading new firmware you generally do not have to p... | 351 |
<p>I have had issues with printing on my i3 MK3, especially when it came to the first layer. In March 2020, I have installed the Prusa Mesh Leveling plugin for Octoprint. With that plugin and a Nylock nut modification, I was able to reduce the bed variance from 0.6 mm down to 0.014 mm and prints were great. That took a... | <p>I have formatted the SD card and installed Octoprint from scratch. That's nasty, because I lost all the models I uploaded.</p>
<p>It seems to be a bug in <a href="https://github.com/PrusaOwners/OctoPrint-PrusaMeshMap/blob/master/octoprint_PrusaMeshMap/__init__.py" rel="nofollow noreferrer">__init__.py</a> of OctoPri... | <p>You have found a bug in the OctoPrint plugin. As you noticed, not more than 20 graphs can be created/open at a time. This implies that the developer has not implemented pyplot correctly, this is a common mistake that I have ran into myself once or twice. You should notify the developer.</p>
<p>The problem is that th... | 1,679 |
<p>I'm having trouble ordering by more than one field in my Linq to NHibernate query. Does anyone either know what might be wrong or if there is a work around?</p>
<p>Code:</p>
<pre><code>IQueryable<AgendaItem> items = _agendaRepository.GetAgendaItems(location)
.Where(item => item.Minutes.Contains(query) ... | <p>This looks to me like a bug with Linq to NHybernate. One possible workaround is to convert to an array before sorting. A potentially big downside is that you can't limit the results using Skip() and Take() before enumerating, so this may not be sufficient for you.</p>
<pre><code>var results = items
.ToArray()... | <p>although i dont think it'd make a difference, what happens if you do your linq like this:</p>
<p>(from i in items orderby i.prop1, i.prop2, i.prop3).Skip(...).Take(...).ToArray();</p>
| 8,582 |
<p>I'm wondering how the few Delphi users here are doing unit testing, if any? Is there anything that integrates with the IDE that you've found works well? If not, what tools are you using and do you have or know of example mini-projects that demonstrate how it all works?</p>
<h3>Update:</h3>
<p>I forgot to mention t... | <p><a href="http://dunit.sourceforge.net/" rel="noreferrer">DUnit</a> is a xUnit type of unit testing framework to be used with win32 Delphi. Since Delphi 2005 DUnit is integrated to a certan point into the IDE. Other DUnit integration tools for the Delphi IDE can be found <a href="http://www.elvenware.com/charlie/conf... | <p>We tried to use DUnit with Delphi 5, but it didn't work well. Specially if you are implementing COM interfaces, we found many dependencies to setup all the test infrastructure. I don't know if the test support has improved in newer versions.</p>
| 3,890 |
<p>Is this a leveling problem? or it's because the bed temperature isn't equal in everywhere? </p>
<p>If it's because of leveling, it means the distance between nozzle and bed in this not-sticked corners are lot and should be decrease? </p>
<p>EDIT: material is ABS, and it's recommended temp is 190-230/80-100. But I ... | <p>You can clearly print but there are also some problems it seems.</p>
<p>To see if you're about okay when it comes to leveling, I recommend to activate the 'skirt' in your slicer soft. Slic3r has it and I think most others too, it just makes the printer do a big one-layer all-around 'perimeter' around what is going ... | <p>For ABS, I use kapton tape, 90 degrees for the bed. You can also try acetone/ABS mixture (can be very thin). If you haven't got acetone, clean or new tape so there is no grease on it.</p>
<p>You can also try a higher nozzle temp for the first layer, sometimes that helps.</p>
<p>You can also try lowerimg the nozzle... | 743 |
<p>In our current database development evironment we have automated build procceses check all the sql code out of svn create database scripts and apply them to the various development/qa databases.</p>
<p>This is all well and good, and is a tremdous improvement over what we did in the past, but we have a problem with ... | <p>I'm not sure how best to approach the problem in your specific environment, but I'd suggest reading up on Rail's migrations feature for some inspiration on how to get started. </p>
<p><a href="http://wiki.rubyonrails.org/rails/pages/UnderstandingMigrations" rel="nofollow noreferrer">http://wiki.rubyonrails.org/rail... | <p>if you want to have re-runnability in your scripts, then you can't have them as definitions... what I mean by this is that you need to focus on change scripts rather than here is my Table script.</p>
<p>let's say you have a table Customers:</p>
<pre><code>create table Customers (
id int identity(1,1) primary k... | 7,220 |
<p>What Java library would you say is the best for consuming and parsing feeds? Requirements:</p>
<ul>
<li>Embeddable</li>
<li>Supports Atom & RSS</li>
<li>Has caching architecture</li>
<li>Should be able to deal with any feed format the same way</li>
</ul>
<p>(Please: <em>one</em> suggestion per answer.)</p>
| <p>Will <a href="https://rome.dev.java.net/" rel="nofollow noreferrer">ROME</a> do?</p>
| <p>We also use ROME. While the SAX/eventing based <a href="http://commons.apache.org/dormant/feedparser/" rel="nofollow">FeedParser</a> architecture is interesting it is a <code>dormant</code> project at Apache.
The "dormant" at Apache seems to imply NO binary download links and NO active development.</p>
| 8,958 |
<p>We have a set of applications that basically display a bunch of bitmaps and text, then allow user to press "buttons" (certain bitmaps) that cause actions to occur.</p>
<p>We currently have these implemented using DirectX and a bunch of code to place the bitmaps and handle the button-presses. But we'd like to have ... | <p>Maybe the way to go is something like <a href="http://clutter-project.org/" rel="nofollow noreferrer">Clutter</a> or <a href="http://www.allegro.cc/" rel="nofollow noreferrer">Allegro</a>. If you check in this <a href="http://arstechnica.com/news.ars/post/20080604-hands-on-with-the-ubuntu-netbook-remix.html" rel="no... | <p>You could try <a href="http://www.wxwidgets.org/" rel="nofollow noreferrer">wxWidgets</a> (it has wxBitmapButton) or try to implement your own solution using <a href="http://www.libsdl.org/" rel="nofollow noreferrer">SDL</a> for all of the graphics.</p>
| 4,393 |
<p>How do I concatenate together two strings, of unknown length, in COBOL? So for example:</p>
<pre><code>WORKING-STORAGE.
FIRST-NAME PIC X(15) VALUE SPACES.
LAST-NAME PIC X(15) VALUE SPACES.
FULL-NAME PIC X(31) VALUE SPACES.
</code></pre>
<p>If <code>FIRST-NAME = 'JOHN '</code> and <... | <p>I believe the following will give you what you desire.</p>
<pre><code>STRING
FIRST-NAME DELIMITED BY " ",
" ",
LAST-NAME DELIMITED BY SIZE
INTO FULL-NAME.
</code></pre>
| <p>You could try making a loop for to get the real length.</p>
| 6,903 |
<p>I'm interested in using Office 2007 to convert between the pre-2007 binary formats (.doc, .xls, .ppt) and the new Office Open XML formats (.docx, .xlsx, .pptx)</p>
<p>How would I do this? I'd like to write a simple command line app that takes in two filenames (input and output) and perhaps the source and/or destina... | <p>Microsoft has a page which gives several examples of writing scripts to "drive" MS Word. <a href="http://gallery.technet.microsoft.com/scriptcenter/3f1802f7-60da-4d5a-841a-12ae8a2f8a4b" rel="nofollow noreferrer">One such example</a> shows how to convert from a Word document to HTML. By changing the last parameter ... | <p>The easiest way would be to use Automation thru the Microsoft.Office.Interop. libraries. You can create an instance of a Word application, for example. There are methods attached to the Application object that will allow you to open and close documents, plus pretty much anything else you can accomplish in VBA by r... | 5,618 |
<p>For writing scripts for process automisation in Linux platform, which scripting language will be better? Shell script, Perl or Python or is there anything else? I am new to all of them. So, am just thinking to which one to go for?</p>
| <p>The answer is: Whatever best fits the job!</p>
<p>My rule of thumb;</p>
<p><strong>Bash</strong> - for a short script that might need a for loop to do something repetitively.</p>
<p><strong>Perl</strong> - anything to do with some kind of text processing or file processing, especially if it's a one off. Just do a... | <p>On Linux? Choose your poison, basically. I like Python, others Ruby, still others Perl. Pick one and go for it. :-)</p>
| 9,584 |
<p>In C, what is the most efficient way to convert a string of hex digits into a binary <code>unsigned int</code> or <code>unsigned long</code>?</p>
<p>For example, if I have <code>0xFFFFFFFE</code>, I want an <code>int</code> with the base10 value <code>4294967294</code>.</p>
| <p>You want <a href="http://www.cplusplus.com/reference/clibrary/cstdlib/strtol.html" rel="noreferrer"><code>strtol</code></a> or <a href="http://en.cppreference.com/w/c/string/byte/strtoul" rel="noreferrer"><code>strtoul</code></a>. See also the <a href="http://man7.org/linux/man-pages/man3/strtoul.3.html" rel="noref... | <p>This currently only works with lower case but its super easy to make it work with both.</p>
<pre><code>cout << "\nEnter a hexadecimal number: ";
cin >> hexNumber;
orighex = hexNumber;
strlength = hexNumber.length();
for (i=0;i<strlength;i++)
{
hexa = hexNumber.substr(i,1);
if ((hexa>="0"... | 3,157 |
<p>I am writing a unit test to check that a private method will close a stream.</p>
<p>The unit test calls methodB and the variable something is null</p>
<p>The unit test doesn't mock the class on test</p>
<p>The private method is within a public method that I am calling.</p>
<p>Using emma in eclipse (via the eclem... | <p>I have found that the eclipse plugin for EMMA is quite buggy, and have had similar experiences to the one you describe. Better to just use EMMA on its own (via ANT if required). Make sure you always regenerate the metadata files produced by EMMA, to avoid merging confusion (which I suspect is the problem with the ... | <p>I assume when you say 'the unit test calls <code>methodB()</code>', you mean not directly and via <code>methodA()</code>. </p>
<p>So, is it possible <code>methodB()</code> is being called elsewhere, by another unit test or <code>methodC()</code> maybe?</p>
| 8,029 |
<p>In many places, <code>(1,2,3)</code> (a tuple) and <code>[1,2,3]</code> (a list) can be used interchangeably.</p>
<p>When should I use one or the other, and why?</p>
| <p>From the <a href="http://www.python.org/doc/faq/general/#why-are-there-separate-tuple-and-list-data-types" rel="noreferrer">Python FAQ</a>:</p>
<blockquote>
<p>Lists and tuples, while similar in many respects, are generally used in fundamentally different ways. Tuples can be thought of as being similar to Pascal rec... | <p><code>(1,2,3)</code> is a tuple while <code>[1,2,3]</code> is a list. A tuple is an immutable object while a list is mutable.</p>
| 2,419 |
<p>We have an application that works with MS Office and uses Microsoft.mshtml.dll. We use ClickOnce to deploy the application. The application deploys without issues on most machines, but sometimes we get errors saying "System Update Required, Microsoft.mshtl.dll should be in the GAC". </p>
<p>We tried installing the ... | <p>Do you know which version of MS Office you are targeting? These PIAs are very specific to the version of Office. I remember when we were building a smart client application, we used to have Build VM machines, each one targeting a specific version of Outlook.</p>
<p>Another hurdle was not being able to specify these... | <p>You can <a href="http://msdn.microsoft.com/en-us/library/h4k032e1.aspx" rel="nofollow noreferrer">set up prerequisites in a clickonce app</a>, which would check for specific assemblies in the GAC before allowing users to install. You would still need to manually install an app that includes the required office dll ... | 7,838 |
<p>I often switch my print material, i.e. ABS / PLA / Wood / Flex,</p>
<p>How can I best clean out my extruder between them to ensure I don't contaminate my next print?</p>
| <p>If you feel you need to <em>clean</em> the nozzle the best approach is a <em>cold pull</em>. You can perform this procedure with many printers, however, you should seek advice from your printer manufacturer before attempting this process if you have any doubts.</p>
<p>With the previously filament still loaded and ... | <p>Some people use a nylon "cleaning" filament when switching types of filaments. It heats well to a variety of temperatures and seems to stick well to whatever is in there when pulling it back out. Be sure to heat it up to the temperature of the filament being removed to get that to bind with the nylon.</p>
| 136 |
<p>I can display and select a single file in windows explorer like this:</p>
<pre><code>explorer.exe /select, "c:\path\to\file.txt"
</code></pre>
<p>However, I can't work out how to select more than one file. None of the permutations of select I've tried work.</p>
<p>Note: I looked at these pages for docs, ne... | <p>This should be possible with the shell function <a href="http://msdn.microsoft.com/en-us/library/bb762232(VS.85).aspx" rel="noreferrer"><code>SHOpenFolderAndSelectItems</code></a></p>
<p><strong>EDIT</strong></p>
<p>Here is some sample code showing how to use the function in C/C++, without error checking:</p>
<pr... | <p>I suppose you can use <code>FindWindowEx</code> to get the SysListView32 of Windows Explorer, then use <code>SendMessage</code> with <code>LVM_SETITEMSTATE</code> to select the items. The difficulty being to know the position of the items... Perhaps <code>LVM_FINDITEM</code> can be used for this.</p>
| 3,079 |
<p>Starting with 2005, VS started this behavior of when starting debugging session it spawns up a webserver for every project in a solution. I have a solution with 15 projects so it takes a while and is a waste of resources. Is there a way to configure it differently besides just using IIS?</p>
| <p>Some details here on why it does it and how you can overcome it:</p>
<p><a href="http://vishaljoshi.blogspot.com/2007/12/tips-tricks-start-up-options-and.html" rel="noreferrer">http://vishaljoshi.blogspot.com/2007/12/tips-tricks-start-up-options-and.html</a></p>
<blockquote>
<p>There are instances when you might... | <p>I have also been highly annoyed by that behavior. The only solution I have found is to manually change the properties page for each web appllication so it hits a real running instance in IIS.</p>
<p>I prefer this anyway, because debugging with the integrated web server can give you a very false impression of how y... | 3,707 |
<p>I have a generic class that should allow any type, primitive or otherwise. The only problem with this is using <code>default(T)</code>. When you call default on a value type or a string, it initializes it to a reasonable value (such as empty string). When you call <code>default(T)</code> on an object, it returns nul... | <p>Keep in mind that default(string) is null, not string.Empty. You may want a special case in your code:</p>
<pre><code>if (typeof(T) == typeof(String)) return (T)(object)String.Empty;
</code></pre>
| <p>The discussion for String is not working here.</p>
<p>I had to have following code for generics to make it work -</p>
<pre><code> private T createDefault()
{
{
if(typeof(T).IsValueType)
{
return default(T);
}
el... | 5,146 |
<p>Is there a way to get the current xml data when we make our own custom XPath function (see here).</p>
<p>I know you have access to an <code>XPathContext</code> but is this enough?</p>
<p><strong>Example:</strong></p>
<p>Our XML:</p>
<pre><code><foo>
<bar>smang</bar>
<fizz>buzz</fiz... | <p>There is the classic 'ab' (apachebench) program. More power comes from <a href="http://jakarta.apache.org/jmeter/" rel="nofollow noreferrer">JMmeter</a>. For server health, I recommend Munin, which can painlessly capture data from several systems and aggregate it on one page. </p>
| <p>Try <a href="http://www.nagios.org/" rel="nofollow noreferrer">Nagios</a>, it's the default tool to monitor servers. You can write plugins to report just about any data. </p>
| 9,486 |
<p>What is the best method for including a CSS or Javascript file for a specific node in Drupal 6.</p>
<p>I want to create a page on my site that has a little javascript application running, so the CSS and javascript is specific to that page and would not want to be included in other page loads at all.</p>
| <p>I'd advise against using <code>hook_nodeapi</code> for that. Adding CSS and Javascript is related to layout so <code>hook_nodeapi</code> is not the place for it: use themeing. This way, you <em>can</em> override those files when you're going to develop a new theme. Doing that with the nodeapi approach would be a bit... | <p>You can have a custom template for that node (node-needsjs.tpl.php) which calls the javascript. That's a little cleaner than using PHP right in the node body, and makes changes to content easier in the future.</p>
<p><strong>EDIT:</strong> I don't think I was very clear above. You want to name the template file n... | 8,702 |
<p>I have a container div with a fixed <code>width</code> and <code>height</code>, with <code>overflow: hidden</code>.</p>
<p>I want a horizontal row of float: left divs within this container. Divs which are floated left will naturally push onto the 'line' below after they read the right bound of their parent. This wil... | <p>You may put an inner div in the container that is enough wide to hold all the floated divs.</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-css lang-css prettyprint-override"><code>#container {
background-c... | <p>Float them left. In Chrome, at least, you don't need to have a wrapper, <code>id="container"</code>, in LucaM's example.</p>
| 5,780 |
<p>Is it possible to format certain text in a WinForm Label instead of breaking the text into multiple labels? Please disregard the HTML tags within the label's text; it's only used to get my point out.</p>
<p>For example:</p>
<pre><code>Dim myLabel As New Label
myLabel.Text = "This is <b>bold</b> text. ... | <p>That's not possible with a WinForms label as it is. The label has to have exactly one font, with exactly one size and one face. You have a couple of options:</p>
<ol>
<li>Use separate labels</li>
<li>Create a new Control-derived class that does its own drawing via GDI+ and use that instead of Label; this is probabl... | <p>Yeah.
You can implements, using HTML Render.
For you see, click on the link: <a href="https://htmlrenderer.codeplex.com/" rel="nofollow">https://htmlrenderer.codeplex.com/</a>
I hope this is useful.</p>
| 3,246 |
<p>I'm trying to choose a tool for creating UML diagrams of all flavours. Usability is a major criteria for me, but I'd still take more power with a steeper learning curve and be happy. Free (as in beer) would be nice, but I'd be willing to pay if the tool's worth it. What should I be using?</p>
| <p>Some context: Recently for graduate school I researched UML tools for usability and UML comprehension in general for an independent project. I also model/architect for a living.</p>
<p>The previous posts have too many answers and not enough questions. A common misunderstanding is that UML is about creating diagra... | <p>You might want to check out <a href="http://argouml.tigris.org/" rel="nofollow noreferrer">ArgoUML</a>. It's not the best tool I've ever used, but it's one of the better free ones I've seen. It's a little slow because it's written in Java, but it let's you do some basic UML diagrams with relative ease.</p>
| 3,619 |
<p>I have been looking to buy a new extruder. One of the options I have seen comes in "right handed" and "left handed". What does this mean? How can I tell what my current extruder is, so I get the right replacement?</p>
| <p>The short answer to identify what extruder type you have is the <strong>rotation of the extruder gear</strong>. </p>
<p>CCW rotation to extrude = right-handed extruder</p>
<p>Detailed explanation is below.</p>
<hr>
<p>In addition to the other answers, the right-handed designation comes from math and pysics conve... | <p>This is an example of a right handed extruder setup:</p>
<p><a href="https://i.stack.imgur.com/UKSrb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UKSrb.png" alt="Right Handed Extruder Setup"></a></p>
<p>And this is an example of a left handed extruder setup:</p>
<p><a href="https://i.stack.i... | 1,313 |
<p>Has anyone worked with <a href="http://www.google.com.br/url?sa=t&ct=res&cd=1&url=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FDomain-specific_programming_language&ei=QyWvSIXcC4foebjSlHs&usg=AFQjCNFsZOnJm-AGmi5sxai8YI-0Al6wfA&sig2=6nX5EkUmNkEwiSKAkUeyZQ" rel="noreferrer">DSLs (Domain Specific Langu... | <p>Jay Fields and Obie Fernandez have written and talked extensively on the subject.</p>
<ul>
<li>Jay Fields intro on <a href="http://blog.jayfields.com/2008/02/designing-domain-specific-language.html" rel="noreferrer">Domain Specific Languages</a></li>
<li>Jay Fields' series on <a href="http://bnl.jayfields.com/01_in... | <p>We worked on the idea of creating a financial valuation DSL with Fairmat ( <a href="http://www.fairmat.com" rel="nofollow">http://www.fairmat.com</a> )</p>
<p>-it exposes a DSL which can be used to express pay-offs and payment dependencies
-it contains an extension model for creating new types of analytic and imple... | 4,343 |
<p>I just switched to the Duet Wifi board (used MKS Gen L 1.0 before) and now small structures look terrible. From my observations the hot end moves correctly, but almost no filament gets extruded. On the other hand larger structures look very good. With the MKS board the exact same G-code worked fine.
After that I gra... | <p>The OP found the solution and shared this in comments but has not written a proper answer. The OP found:</p>
<blockquote>
<p>To complete this, the issue was related to the part cooling fan not spinning correctly. After replacing it the problem was gone.</p>
</blockquote>
| <p>This actually just looks like heating issues. Cura has an option to set a minimum layer time and speed, and any layer that takes less than that amount of time it'll lift the head away from the print to allow the plastic to cool.</p>
<p>Unfortunately, the only things I can find for Simplify3D around head lift and mi... | 1,179 |
<p>In Oracle, the number of rows returned in an arbitrary query can be limited by filtering on the "virtual" <code>rownum</code> column. Consider the following example, which will return, at most, 10 rows.</p>
<pre>SELECT * FROM all_tables WHERE rownum <= 10</pre>
<p>Is there a simple, generic way to do something ... | <p>Blatantly changing my answer. "Limit 10" works for MySql and others, Ingres uses</p>
<pre><code>Select First 10 * from myTable
</code></pre>
<p><a href="http://docs.ingres.com/sqlref/Selectinteractive" rel="noreferrer">Ref</a></p>
| <p>Hey Craig. I'm sorry, I made a Ninja Edit.
No, Limit 10 does not work, I was mistaken in thinking it was standard SQL supported by everyone. Ingres uses (according to doc) "First" to solve the issue.</p>
| 7,224 |
<p>I have a basic form with controls that are databound to an object implementing the <em>INotifyPropertyChanged</em> interface. I would like to add some validation to a couple of properties but dont want to go through implementing <em>IDataErrorInfo</em> for the sake of validating a couple of properties.</p>
<p>I ha... | <p>What kind of printer is that? Regular printers don't print white. Create in-memory image and 'flatten' it (remove alpha channel) and then print the result.</p>
| <p>Have you tried drawing a white rectangle to initialize the image before you call the DrawImage method?</p>
| 8,818 |
<p>I use emacs to edit my xml files (nxml-mode) and the files were generated by machine don't have any pretty formatting of the tags. </p>
<p>I have searched for pretty printing the entire file with indentation and saving it, but wasn't able to find an automatic way.</p>
<p>Is there a way? Or atleast some editor on l... | <p>You don't even need to write your own function - sgml-mode (a gnu emacs core module) has a built-in pretty printing function called (sgml-pretty-print ...) which takes region beginning and end arguments.</p>
<p>If you are cutting and pasting xml and you find your terminal is chopping the lines in arbitrary places y... | <p>I'm afraid I like Benjamin Ferrari version much better. The internal pretty print always places the end tag in a new line after the value, inserting unwanted CR in the tag values.</p>
| 3,351 |
<p>How do I know what nozzle to get for my Anet A6 printer? I want to get some hardened nozzles because I would love to print with some glow in the dark filament, but I know that eats up brass nozzles fast. But there is so many thread differences so I don't know which one to get, or even what thread the Anet A6 is. Cou... | <p>The <a href="https://www.creaform3d.com/en/customer-support/legacy-products/exascan-scanner" rel="nofollow noreferrer">Creaform EXAscan</a> is according to the manufacturer a laser based machine. This means that it determines data points and their positions by some triangonometry done with a laser, 32.000 times a se... | <p>So if the original manufacturer still exists, <a href="https://www.creaform3d.com/en/customer-support/legacy-products/exascan-scanner" rel="nofollow noreferrer">(which they appear to, and even list your scanner under 'legacy' products)</a> your best chance of getting it working is going to be to contact them directl... | 869 |
<p>I have a website that I've just uploaded onto the Internet. When I browse to the site using Firefox 3.0.1 on Ubuntu I don't see the favicon; Firefox 3.0.1 on WinXP does display it.</p>
<p><strong>Why</strong> isn't the favicon displaying under Ubuntu? It's a favicon.ico file in the root directory, not referenced... | <p>Previously, there was no favicon. The browser cached the lack of favicon. <a href="http://pcsupport.about.com/od/maintenance/ht/clearcacheff.htm" rel="noreferrer">Clear the Firefox cache</a>, and all is well.</p>
| <p>Try taking a look at this <a href="https://stackoverflow.com/questions/6642/perfect-way-to-use-favicons">previous Question</a>, which shows you must put two meta tags in your html in order for it to work across all browsers and operating systems.</p>
| 2,846 |
<p><strong>Emacs</strong>: <code>C-U (79) #</code> » a pretty 79 character length divider</p>
<p><strong>VIM</strong>: <code>79-i-#</code> » see above</p>
<p><strong><a href="http://macromates.com/" rel="nofollow noreferrer">Textmate</a></strong>: ????</p>
<p>Or is it just assumed that we'll make a Rub... | <p>I would create a bundle command to do this.</p>
<p>You can take editor selection as input to your script, then replace it with the result of execution. This command, for example, will take a selected number and print the character '#' that number of times.</p>
<pre><code>python -c "print '#' * $TM_SELECTED_TEXT"
... | <p>By taking the</p>
<pre><code>python -c "print '#' * $TM_SELECTED_TEXT"
</code></pre>
<p>a step further, you can duplicate the examples you gave in the question. </p>
<p>Just make a snippet, called divider or something, set the <code>tab trigger</code> field to something appropriate <code>'--'</code> for example, ... | 8,990 |
<p>Can anyone recommend some good resources that highlight the differences between Oracle and the AS/400 database?</p>
<p>I am trying to help someone with a lot of AS/400 experience implement an Oracle installation, and they need some guidance.</p>
<p>A book or online resource would be ideal.</p>
| <p>I've done this a fair few times and the solutions out there really depend on the environment (enterprise / mission critical or development). The BEST way would be the <strong><em>Oracle AS/400 Gateway</em></strong>. Here are some important links in that area:</p>
<p>Allow AS/400 apps to access oracle with the Ora... | <p>These links are not AS/400 specific, but generally a good place starting with Oracle: </p>
<p><a href="http://tahiti.oracle.com" rel="nofollow noreferrer">http://tahiti.oracle.com</a><br>
<a href="http://asktom.oracle.com" rel="nofollow noreferrer">http://asktom.oracle.com</a></p>
| 4,344 |
<p>Is there another way to render graphics in C# beyond <a href="https://en.wikipedia.org/wiki/Graphics_Device_Interface#Windows_XP" rel="nofollow noreferrer">GDI+</a> and <a href="http://en.wikipedia.org/wiki/Microsoft_XNA" rel="nofollow noreferrer">XNA</a>? </p>
<p>(For the development of a tile map editor.)</p>
| <p><a href="http://cs-sdl.sourceforge.net/" rel="nofollow noreferrer">SDL.NET</a> is the solution I've come to love. If you need 3D on top of it, you can use Tao.OpenGL to render inside it. It's fast, industry standard (<a href="http://en.wikipedia.org/wiki/Simple_DirectMedia_Layer" rel="nofollow noreferrer">SDL</a>, t... | <p>You could try looking into WPF, using Visual Studio and/or Expression Blend. I'm not sure how sophisticated you're trying to get, but it should be able to handle a simple editor. Check out this <a href="http://msdn.microsoft.com/en-us/library/ms742562.aspx" rel="nofollow noreferrer">MSDN Article</a> for more info.<... | 8,261 |
<p>I recently heard that the 3D printing lab at my college can do fused-deposition with ABS and PLA, but I would like to use TPU, for greater flexibility.</p>
<p>Is it possible to feed a TPU filament into the same machine built for ABS/PLA? Or is there no difference? Assume the diameters of the filaments are the same.... | <blockquote>
<p>Is it possible to feed a TPU filament into the same machine built for ABS/PLA? Or is there no difference? Assume the diameters of the filaments are the same.</p>
</blockquote>
<p>The question is not what the machine is <em>built for</em> but <em>how</em> it is built. Let's break stuff down some into why... | <p>Most printers can print most filaments. However, some more exotic filaments are not suitable for all printers:</p>
<ul>
<li><p>To print a flexible filament such as TPU, the filament path from the extruder needs to be well-constrained. A bowden extruder is generally less good at handling flexible filaments than a di... | 1,680 |
<p>Recently I got IE7 crashed on Vista on jar loading (presumably) with the following error:</p>
<pre><code>Problem signature:
Problem Event Name: BEX
Application Name: iexplore.exe
Application Version: 7.0.6001.18000
Application Timestamp: 47918f11
Fault Module Name: ntdll.... | <p>BEX=Buffer overflow exception. See <a href="http://technet.microsoft.com/en-us/library/cc738483.aspx" rel="nofollow noreferrer">http://technet.microsoft.com/en-us/library/cc738483.aspx</a> for details. However, c000000d is STATUS_INVALID_PARAMETER; the technet article talks primarily about status c0000005 or c000040... | <p>Most likely there is an addon that is messing with IE.</p>
<p>You can try this.
1. Open IE
2. Switch to the Advanced tab.
3. Click the Reset Internet Explorer Settings button.
4. Click Reset to confirm the operation.
5. Click Close when the resetting process finished.
6. Uncheck Enable... | 7,491 |
<p>I need a function called <code>SizeOfPipe()</code> which should return the size of a pipe - I only want to know how much data is in the pipe and not actually read data off the pipe itself. </p>
<p>I thought the following code would work:</p>
<pre><code>fseek (pPipe, 0 , SEEK_END);
*pBytes = ftell (pPipe);
rewind (... | <p>Depending on your unix implementation ioctl/FIONREAD might do the trick</p>
<pre>
err = ioctl(pipedesc, FIONREAD, &bytesAvailable);
</pre>
<p>Unless this returns the error code for "invalid argument" (or any other error) bytesAvailable contains the amount of data available for unblocking read operations at that ti... | <p>On Windows you can always use <code>PeekNamedPipe</code>, but I doubt that's what you want to do anyway.</p>
| 9,738 |
<p>Anet A8 with Cura. First time use. The extrusion temperature is set at 190 °C for PLA but the temperature never quite gets that hot, e.g. 189.2 °C. So the printer never prints.</p>
<p>The bed temperature is fine.</p>
<p>Any suggestions on how to fix?</p>
| <p>Two common problems to look out for in this situation:</p>
<ul>
<li>Make sure that your <strong>part fan</strong> (the fan that is supposed to cool the filament you just extruded, and that does not start spinning until the print starts) do <em>not</em> blow air on the hot end of your extruder.</li>
<li>Make sure th... | <p>I had the same problem.</p>
<p><em><strong>If</strong> your mains supply is 110 V</em>, then make sure that the voltage selector switch of your PSU is set to 110 V... it should then print.</p>
<p>If the voltage selector switch is set to the default of 220 V, <em>and the mains supply is only 110 V</em>, then the PSU ... | 807 |
<p>I want to use Powershell to write some utilities, leveraging our own .NET components to handle the actual work. This is in place of writing a small console app to tie the calls together. My question is where I would find a good source of documentation or tutorial material to help me fast track this?</p>
| <p>If you want to load an assembly into your PowerShell session, you can use reflection and load the assembly.</p>
<pre><code>[void][System.Reflection.Assembly]::LoadFrom(PathToYourAssembly)
</code></pre>
<p>After you load your assembly, you can call static methods and create new instances of a class. </p>
<p>A goo... | <p>you can use <code>[]</code> or use <code>add-type -AssemblyName "System.example"</code> to use assembly for example use :</p>
<pre><code>[system.drawing]::class ...
</code></pre>
| 4,571 |
<p>I support a third party system that uses COM, classic ASP, and SQL Server. Our company has gone to using TFS as our source control provider - which pushes things through Visual Studio. So, what's the best way to get a classic asp front-end into Visual Studio?</p>
| <p>When I had to do this, I created a blank solution in VS and then added the folders from the ASP site one at a time, adding "existing items" to each folder as I created it.</p>
<p>In this way I'm able to open the solution which keeps track of what files I had open at last open, plus I get the benefits of intellisens... | <p>Did any of you heard of Visual Web developer 2008 Express edition?
Work wonders for me.
Most important as soon as you ask to open website in it- it opens each folder of intended website and when you save project it does what you need to do to later open this website in regular visual studio.</p>
<p>It have some lim... | 4,067 |
<p>I am trying to find a way to determine at run-time how much memory a given class is using in .NET. Using <code>Marshal.SizeOf()</code> is out, as it only works on value types. Is there a way to check exactly how much memory a class uses?</p>
| <p>I've only recently started looking into this type of thing, but i have found that memory profilers can give quite detailed information regarding instances of objects within your application.</p>
<p>Here are a couple that are worth trying:</p>
<ul>
<li><a href="http://www.red-gate.com/Products/ants_profiler/index.h... | <p>I agree that a memory profiler is the easiest way to get the information you are looking for. In addition to the two previously mentioned, I recommend JetBrains <a href="http://www.jetbrains.com/profiler/index.html" rel="nofollow noreferrer">dotTrace</a>, which is both a performance profiler and a memory profiler.</... | 7,464 |
<p>In an Outlook 2003 macro; Is there a way to move a message between folders without changing the ReceivedTime-header?</p>
<p>I currently use the method <code>MailItem.Move</code>. But that automatically sets the <code>ReceivedTime</code> property to the current time, which isn't really what I want.</p>
| <p>I just tried moving a mailitem from my inbox to the deleted items folder, and it seems to have kept the receivedtime without a problem...</p>
<p>You may want to try using the MailItem.copy function and moving the resulting mailitem object, but like I said I'm not seeing the same problem...</p>
<p>Hope that helps..... | <p>Do an item.Save() and then do item.Move(), It will stamp current timestamp.</p>
| 8,305 |
<p>I have to admit that I always forgot the syntactical intracacies of the naming patterns for Nant (eg. those used in filesets). The double asterisk/single asterisk stuff seems to be very forgettable in my mind.</p>
<p>Can someone provide a definitive guide to the naming patterns?</p>
| <p>The rules are:</p>
<ul>
<li>a single star (*) matches zero or more characters <em>within a path name</em></li>
<li>a double star (**) matches zero or more characters <em>across directory levels</em></li>
<li>a question mark (?) matches exactly one character within a path name</li>
</ul>
<p>Another way to think abo... | <p>Check out the <a href="http://nant.sourceforge.net/release/latest/help/types/fileset.html" rel="nofollow noreferrer">Nant reference</a>. The fileset patterns are:</p>
<p>'*' matches zero or more characters, e.g. *.cs<br>
'?' matches one character, e.g. ?.cs</p>
<p>And '**' matches a directory tree e.g. src/**/*.cs... | 9,522 |
<p>I'm already using <a href="http://www.matasano.com/log/958/enough-with-the-rainbow-tables-what-you-need-to-know-about-secure-password-schemes/" rel="nofollow noreferrer">salted hashing</a> to store passwords in my database, which means that I should be immune to <a href="https://en.wikipedia.org/wiki/Rainbow_table" ... | <p>Bruce Schneier has a good response to this kind of problem.</p>
<blockquote>
<p>Cryptography is not the solution to your security problems. It might be part of the solution, or it might be part of the problem. In many situations, cryptography starts out by making the problem worse, and it isn't at all clear that ... | <p>You really have to weigh your worst case senario of someone obtaining those email addresses, the likelihood of someone obtaining them, and your extra effort/time needed to impliement the change.</p>
| 9,583 |
<p>We're seeing some pernicious, but rare, deadlock conditions in the Stack Overflow SQL Server 2005 database.</p>
<p>I attached the profiler, set up a trace profile using <a href="http://www.simple-talk.com/sql/learn-sql-server/how-to-track-down-deadlocks-using-sql-server-2005-profiler/" rel="noreferrer">this excelle... | <p>According to MSDN:</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms191242.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/ms191242.aspx</a></p>
<blockquote>
<p>When either the
READ COMMITTED SNAPSHOT or
ALLOW SNAPSHOT ISOLATION database
options are ON, logical copies
(versions) a... | <p>I would have to agree with Greg so long as setting the isolation level to read uncommitted doesn't have any ill effects on other queries.</p>
<p>I'd be interested to know, Jeff, how setting it at the database level would affect a query such as the following:</p>
<pre><code>Begin Tran
Insert into Table (Columns) Va... | 4,038 |
<p>I have a script that parses the filenames of TV episodes (show.name.s01e02.avi for example), grabs the episode name (from the www.thetvdb.com API) and automatically renames them into something nicer (Show Name - [01x02].avi)</p>
<p>The script works fine, that is until you try and use it on files that have Unicode s... | <p>Use a subrange of <code>[\u0000-\uFFFF]</code> for what you want.</p>
<p>You can also use the <code>re.UNICODE</code> compile flag. <a href="http://docs.python.org/lib/re-syntax.html" rel="nofollow noreferrer">The docs</a> say that if <code>UNICODE</code> is set, <code>\w</code> will match the characters <code>[0-9... | <p>\X seems to be available as a generic word-character in some languages, it allows you to match a single character disregarding of how many bytes it takes up. Might be useful.</p>
| 3,517 |
<p>How do I target .NET 3.5 alone after installing SP1 in VS2008? This is because VS 2008 lists only .NET 3.5, .NET 3.0 & .NET 2.0 and does not specifically show .NET 3.5 SP1.</p>
| <p><a href="http://michael.toren.net/code/tcptraceroute/" rel="nofollow noreferrer">tcptraceroute</a></p>
| <p>I have lot's of problems with that firewall. Having my server into EEUU doesn't help. If you need tools to test your site hosted outside from china like you were in China, you can try that page:</p>
<p><a href="http://www.websitepulse.com/help/tools.php" rel="nofollow noreferrer">http://www.websitepulse.com/help/to... | 7,207 |
<p>I've been programming for 10+ years now for the same employer and only source code control we've ever used is VSS. (Sorry - That's what they had when I started). There's only ever been a few of us; two right now and we usually work alone, so VSS has worked ok for us. So, I have two questions: 1) Should we switch to ... | <p>I'd probably go with Subversion, if I were you. I'm a total Git fanatic at this point, but Subversion certainly has some advantages: </p>
<ul>
<li>simplicity</li>
<li>abundance of interoperable tools</li>
<li>active and supportive community</li>
<li>portable</li>
<li>Has really nice Windows shell integration</li>
... | <p>I'd say stick with what works for you. Unless you are having issues with VSS, why switch? Subversion is swell, though a little sticky to begin using it. TFS is far better than VSS, though it is fairly expensive for such a small team. I have not used git so I can't really speak to it.</p>
| 5,158 |
<p>Although the <a href="http://www.adobe.com/devnet/pdf/pdf_reference.html" rel="noreferrer">PDF specification</a> is available from Adobe, it's not exactly the simplest document to read through. PDF allows documents to be encrypted so that either a user password and/or an owner password is required to do various thi... | <p>A plugin for GSview for viewing encrypted PDFs is <a href="http://www.cs.cmu.edu/~dst/Adobe/Gallery/Keating/" rel="nofollow noreferrer">here</a>.</p>
<p>If this works for you, you may be able to look at the source.</p>
| <p>xpdf is probably a good reference implementation for this sort of problem. I have successfully used them to open encrypted pdfs before.</p>
| 7,202 |
<p><em>Disclaimer: This is not actually a programming question, but I feel the audience on stackoverflow is more likely to have an answer than most question/answer sites out there.</em></p>
<p>Please forgive me, Joel, for stealing your question. Joel asked this question on a podcast a while back but I don't think it ... | <p>At least for PCs, the fact that you dismiss an item does get sync'd, and fairly quickly for me. I'm not sure why phones don't seem to do it, though. Maybe the ActiveSync protocol doesn't offer that option.</p>
| <p>Thanks from me, too :)</p>
<p>Maybe it's because all your devices clocks are synchronized to a time server, so they all have the exactly correct atomic-clock time, and all the devices notify you within a couple of seconds of each other, so the "dismiss" synchronization just doesn't happen fast enough.</p>
| 3,443 |
<p>To grab the inode of a file in PHP, you can use this:</p>
<pre><code>$fs = stat($file);
echo $fs['ino'];
</code></pre>
<p>The problem with this is EVERYWHERE says it's slow and you should avoid it. So the question becomes what's the fast(er) way to do it?</p>
| <p>You could use <a href="http://php.net/fileinode" rel="nofollow noreferrer"><code>fileinode()</code></a> but you should run benchmarks if you think it is slow.</p>
| <p>I think you should benchmark and take a look at what you are doing to determine if stat() is the slowest part of your code. Stating 1 file on each request on a server that gets about 100 hits/day is not a problem. Stating every file could be a problem when you have to eek out a few more requests a second.</p>
<p>Yo... | 4,008 |
<p>In our place we're split between using mysqli and PDO for stuff like prepared statements and transaction support. Some projects use one, some the other. There is little realistic likelihood of us ever moving to another RDBMS.</p>
<p>I prefer PDO for the single reason that it allows named parameters for prepared sta... | <p>Well, you could argue with the object oriented aspect, the prepared statements, the fact that it becomes a standard, etc. But I know that most of the time, convincing somebody works better with a killer feature. So there it is:</p>
<p>A really nice thing with PDO is you can fetch the data, injecting it automaticall... | <p>There's one thing to keep in mind.</p>
<p>Mysqli does not support fetch_assoc() function which would return the columns with keys representing column names. Of course it's possible to write your own function to do that, it's not even very long, but I had <strong>really</strong> hard time writing it (for non-believe... | 3,450 |
<p>Are System.IO.Compression.GZipStream or System.IO.Compression.Deflate compatible with zlib compression?</p>
| <p>From <a href="http://msdn.microsoft.com/en-us/library/system.io.compression.gzipstream.aspx" rel="noreferrer">MSDN</a> about System.IO.Compression.GZipStream:</p>
<blockquote>
<p>This class represents the gzip data format, which uses an industry standard algorithm for lossless file compression and decompression.<... | <p>I agree with andreas. You probably won't be able to open the file in an external tool, but if that tool expects a stream you might be able to use it. You would also be able to deflate the file back using the same compression class.</p>
| 9,570 |
<p>I'm interested in seeing a good diff algorithm, possibly in Javascript, for rendering a side-by-side diff of two HTML pages. The idea would be that the diff would show the differences of the <em>rendered</em> HTML.</p>
<p>To clarify, I want to be able to see the side-by-side diffs <em>as</em> rendered output. So if... | <p>There's another nice trick you can use to significantly improve the look of a rendered HTML diff. Although this doesn't fully solve the initial problem, it will make a significant difference in the appearance of your rendered HTML diffs.</p>
<p>Side-by-side rendered HTML will make it very difficult for your diff t... | <p>I believe a good way to do this is to <a href="http://weblogs.mozillazine.org/roc/archives/2005/05/rendering_web_p.html" rel="nofollow noreferrer">render the HTML to an image</a> and then use some <a href="http://www.scootersoftware.com/" rel="nofollow noreferrer">diff tool that can compare images</a> to spot the di... | 5,165 |
<p>For my day job, I live in Emacs. Utterly. I also have become pretty dependent on CScope to help me find things in the code.</p>
<p>Normally, I have 2 windows in a split (C-x 3):
<a href="http://bitthicket.com/files/emacs-2split.JPG">alt text http://bitthicket.com/files/emacs-2split.JPG</a></p>
<p>And I use the r... | <p>Put this in your .emacs file:</p>
<pre><code>;; Toggle window dedication
(defun toggle-window-dedicated ()
"Toggle whether the current active window is dedicated or not"
(interactive)
(message
(if (let (window (get-buffer-window (current-buffer)))
(set-window-dedicated-p window
(not (window... | <p>Well, I decided to not be a reputation-whore and find the answer myself. I looked in cscope.el as shown on the Emacs wiki, as well as the xcscope.el that comes with the cscope RPM package on RHEL.</p>
<p>Neither appear to give a way to do what I'm wanting. The way is probably to edit the ELisp by adding a package... | 6,533 |
<p>Is it possible to use BackGroundWorker thread in <a href="http://en.wikipedia.org/wiki/ASP.NET" rel="nofollow noreferrer">ASP.NET</a> 2.0 for the following scenario, so that the user at the browser's end does not have to wait for long time?</p>
<h2>Scenario</h2>
<ol>
<li>The browser requests a page, say SendEmails... | <p>If you don't want to use the AJAX libraries, or the e-mail processing is REALLY long and would timeout a standard AJAX request, you can use an AsynchronousPostBack method that was the "old hack" in the .net 1.1 days. </p>
<p>Essentially what you do is have your submit button begin the e-mail processing in an asynch... | <p>It is possible. Once you start a new thread asynchronously from page, page request will proceed and send the page back to the user. The async thread will continue to run on the server but will no longer have access to the session.</p>
<p>If you have to show task progress, consider some Ajax techniques.</p>
| 8,225 |
<p>Is there any way to check whether a file is locked without using a try/catch block? </p>
<p>Right now, the only way I know of is to just open the file and catch any <code>System.IO.IOException</code>.</p>
| <p>No, unfortunately, and if you think about it, that information would be worthless anyway since the file could become locked the very next second (read: short timespan).</p>
<p>Why specifically do you need to know if the file is locked anyway? Knowing that might give us some other way of giving you good advice.</p>
... | <p>What I ended up doing is:</p>
<pre><code>internal void LoadExternalData() {
FileStream file;
if (TryOpenRead("filepath/filename", 5, out file)) {
using (file)
using (StreamReader reader = new StreamReader(file)) {
// do something
}
}
}
internal bool TryOpenRead(strin... | 2,370 |
<p>Can anyone explain this behavior?
Running:</p>
<pre><code>#!/bin/sh
echo "hello world" | read var1 var2
echo $var1
echo $var2
</code></pre>
<p>results in nothing being ouput, while:</p>
<pre><code>#!/bin/sh
echo "hello world" > test.file
read var1 var2 < test.file
echo $var1
echo $var2
</code></pre>
<p>pro... | <p>A recent addition to <code>bash</code> is the <code>lastpipe</code> option, which allows the last command in a pipeline to run in the current shell, not a subshell, when job control is deactivated.</p>
<pre><code>#!/bin/bash
set +m # Deactiveate job control
shopt -s lastpipe
echo "hello world" | read var1 var2... | <p>Try:</p>
<pre><code>echo "hello world" | (read var1 var2 ; echo $var1 ; echo $var2 )
</code></pre>
<p>The problem, as multiple people have stated, is that var1 and var2 are created in a subshell environment that is destroyed when that subshell exits. The above avoids destroying the subshell until the result has be... | 2,483 |
<p>I am building my CoreXY 3D printer with 350x350 mm heated bed at about 4 mm thickness. I just found out that borosilicate glass is unavailable at the local glazier. He offered tempered or ceramic glass instead. Which one should I go for? I read that both are a more expensive option to borosilicate glass, but I worry... | <p>The primary advantage of borosilicate isn't that it's resistant to thermal shock -- as someone already noted, there's not much in the way of rapid heating or cooling in FDM printing (yes, the filament is hot, but its mass is low enough the glass it touches won't pick up much heat). Rather, it's the low expansion. ... | <p>People choose borosilicate because of its thermal properties.</p>
<p>Between ceramic and tempered, I would suggest tempered glass, it's not good as borosilicate when comes to adapting to rapid temperatures but better than ceramic. The other option I would suggest will be "Aluminium", which is much better.<... | 2,015 |
<p>I have looked in vain for a good example or starting point to write a java based facebook application... I was hoping that someone here would know of one. As well, I hear that facebook will no longer support their java API is this true and if yes does that mean that we should no longer use java to write facebook a... | <p>Facebook stopped supporting the official Java API on 5 May 2008 according to their <a href="http://developers.facebook.com/blog/post/106" rel="nofollow noreferrer">developer wiki</a>.</p>
<p>In no way does that mean you shouldn't use Java any more to write FB apps. There are several alternative Java approaches outl... | <p>You might want to try <a href="http://www.springsource.org/spring-social" rel="nofollow">Spring Social</a>. It might be limited in terms of Facebook features, but lets you also connect to Twitter, LinkedIn, TripIt, GitHub, and Gowalla. </p>
<p>The other side of things is that as Facebook adds features some of the o... | 8,785 |
<p>When creating scrollable user controls with .NET and WinForms I have repeatedly encountered situations where, for example, a vertical scrollbar pops up, overlapping the control's content, causing a horizontal scrollbar to also be needed. Ideally the content would shrink just a bit to make room for the vertical scro... | <p>You will need your controls to resize slightly to accommodate the width of the vertical scroll bar. One way to achieve this achieved through docking. Rather than just dropping controls on the form, you'll have to play a bit with panels, padding, min/max sizing and docking.</p>
<p>Here is example code you can place ... | <p>If your controls are inside a panel, try setting the AutoScroll property of the Panel to False. This will hide the scrollbars. I hope this points you in the right direction.</p>
<pre><code>myPanel.AutoScroll = False
</code></pre>
| 4,628 |
<p>I have just got a MacBook Pro and have been using it (+Fusion) to develop on for about a month now. The purpose of this question is similar to <a href="https://stackoverflow.com/questions/9033/hidden-features-of-c#35342">Hidden Features of C#</a>; to become a how-to of tips and trick for windows development on a ma... | <p>@Andrew - I'm exactly in your situation. I use a MBP while my company work is purely Microsoft based: i.e., .NET, COM etc. While nothing can beat running Vista natively in Boot Camp (I've never seen Vista run so fast), the niceties of having your Mac OS be the "main" OS, for internet, mail etc. has gotten me to the ... | <p>I use a Mac Book Pro as well but I run Vista. I set aside a little space so I could also run Leopard and just use Boot Camp. You can use Boot Camp to just boot from windows so you never have to deal with Leopard unless you want to. </p>
<p>I would highly reccomend it because Apple makes great hardware while Microso... | 6,637 |
<p>Is it possible to use both JScript and VBScript in the same HTA? Can I call VBScript functions from JScript and vice-versa? Are there any "gotchas," like the JScript running first and the VBScript running second (classic ASP pages have this issue).</p>
| <p>Yeah, just separate them into different script tags:</p>
<pre><code><script language="javascript">
// javascript code
</script>
<script language="vbscript">
' vbscript code
</script>
</code></pre>
<p>Edit: And, yeah, you can cross call between Javascript and VBScript with no extra wo... | <p>Also you can give references between them. For example:
at the background some function on vbscript handle with database and FSO issues, and let javascript create user interfaces and dialogs etc. with DOM in frontline.
Whenever you need you can call both functions from each script sides.
In js you can call vbs func... | 9,019 |
<p>Is it necessary or advantageous to write custom connection pooling code when developing applications in .NET with an SQL Server database? I know that ADO.NET gives you the option to enable/disable connection pooling -- does that mean that it's built into the framework and I don't need to worry about it? Why do peo... | <p>The connection pooling built-in to ADO.Net is robust and mature. I would recommend against attempting to write your own version.</p>
| <p>Well, it is going to go away as the answer to all these questions will be LINQ. Incidentally, we have never needed custom connection pooling for any of our applications, so I am not sure what all the noise is about.</p>
| 2,969 |
<p>I got my Ender 3 a couple weeks ago. Within a couple days of test prints, I was able to get it working pretty well. Prints looked great. However, I installed <a href="https://www.thingiverse.com/thing:2959991" rel="noreferrer">a more permanent solution to my X-Gantry binding issues</a> and now print quality is down ... | <p>The answer now seems brain-dead obvious now. <em>Hindsight is 20/20, amirite?</em></p>
<p>I had a decent filament clog in the extruder past the end of the Bowden tube. This was resolved by sticking a <a href="https://smile.amazon.com/dp/B078HXTLX8" rel="nofollow noreferrer">nozzle cleaner rod</a> up and down the fi... | <p>I had a real problem with what I was poor bed adhesion and layer separation on my 6month old Ender 3 pro. this problem started all at once, I checked the bed height several times and layer height, temperatures etc still the problem was there.
Then I noticed the filament guide pinch roller was at a slight angle and o... | 1,005 |
<p>My group is developing a service-based (.NET WCF) application and we're trying to decide how to handle exceptions in our internal services. Should we throw exceptions? Return exceptions serialized as XML? Just return an error code?</p>
<p>Keep in mind that the user will never see these exceptions, it's only for ... | <p>WCF uses <code>SoapFaults</code> as its native way of transmitting exceptions from either the service to the client, or the client to the service.</p>
<p>You can declare a custom SOAP fault using the <code>FaultContract</code> attribute in your contract interface:</p>
<p>For example:</p>
<pre><code>[ServiceContra... | <p>Phil, different parts of the application call each other using WCF. By "return exceptions serialized as XML," I meant that the return value of the function wold be an exception object. Success would be indicated by null. </p>
<p>I don't think that's the right option.</p>
<p>WCF fault contracts sound good, but I... | 6,133 |
<p>I've just heard the term covered index in some database discussion - what does it mean?</p>
| <p>A <em>covering index</em> is an index that contains all of, and possibly more, the columns you need for your query.</p>
<p>For instance, this:</p>
<pre><code>SELECT *
FROM tablename
WHERE criteria
</code></pre>
<p>will typically use indexes to speed up the resolution of which rows to retrieve using <em>criteria</... | <p>Covering indexes are indexes which "cover" all columns needed from a specific table, removing the need to access the physical table at all for a given query/ operation.</p>
<p>Since the index contains the desired columns (or a superset of them), table access can be replaced with an index lookup or scan -- which is ... | 8,749 |
<p>I've been looking for a way to convert an mp3 to aac programmatically or via the command line with no luck. Ideally, I'd have a snippet of code that I could call from my rails app that converts an mp3 to an aac. I installed ffmpeg and libfaac and was able to create an aac file with the following command:</p>
<p><... | <p><a href="http://en.wikipedia.org/wiki/Ffmpeg" rel="noreferrer">FFmpeg</a> provides AAC encoding facilities if you've compiled them in. If you are using Windows you can grab full binaries from <a href="http://arrozcru.no-ip.org/ffmpeg_builds/" rel="noreferrer">here</a></p>
<pre><code>ffmpeg -i source.mp3 -acodec lib... | <p>I've had good luck using mplayer (which I believe uses ffmpeg...) and lame. To the point that I've wrapped it up in a script:</p>
<pre><code>#!/bin/sh
TARGET=$1
BASE=`basename "${TARGET}"`
echo TARGET: "${TARGET}"
echo BASE: "${BASE}" .m4a
# Warning! Race condition vulnerability here! Should use a mktemp
# var... | 9,549 |
<p>In a .net system I'm building, there is a need for automated e-mail notifications. These should be editable by an admin. What's the easiest way to do this? SQL table and WYSIWIG for editing?</p>
<hr>
<p>The queue is a great idea. I've been throwing around that type of process for awhile with my old company.</p>
| <p>From a high level, yes. :D The main thing is some place to store the templates. A database is a great option unless you're not already using one, then file systems work fine.</p>
<p>WSIWIG editors (such as fckeditor) work well and give you some good options regarding the features that you allow.</p>
<p>Some sor... | <p>Are you just talking about the interface and storage, or the implementation of sending the emails as well?</p>
<p>Yes, a SQL table with FROM, TO, Subject, Body should work for storage and, heck, a textbox or even maybe a RichText box should work for editing.</p>
<p>Or is this a web interface?</p>
<p>For actually ... | 2,803 |
<p>I can't seem to find details on how to unsubscribe from ubiquity commands. The command list page only seems to have information about the installed commands and there are no links to deleting them. Am I missing something?</p>
| <p>Go to about:ubiquity in Firefox. Under the section "subscribed feeds" there should be an option to unsubscribe to command feeds you no longer desire.</p>
<p>Also, if you clear your entire browser history, it will delete all command feeds (this will be fixed by 0.2)</p>
| <p>Check this out:
<a href="http://getsatisfaction.com/mozilla/topics/how_do_you_edit_delete_the_default_ubiquity_commands_verbs" rel="nofollow noreferrer">http://getsatisfaction.com/mozilla/topics/how_do_you_edit_delete_the_default_ubiquity_commands_verbs</a></p>
<p>Also, you can find a utility to reset your ubiquity... | 5,685 |
<p><strong>Original Question</strong></p>
<p>I want to be able to generate a new (fully valid) MP3 file from an existing MP3 file to be used as a preview -- try-before-you-buy style. The new file should only contain the first <em>n</em> seconds of the track.</p>
<p>Now, I know I could just "chop the stream" at <em>n<... | <p>I also recommend ffmpeg, but the command line suggested by John Boker has an unintended side effect: it re-encodes the file to the default bitrate (which is 64 kb/s in the version I have here at least). This might give your customers a false impression of the quality of your sound files, and it also takes longer to ... | <p>My package <strong>medipack</strong> is a very simple command-line app as a wrapper over <code>ffmpeg</code>.</p>
<p>you can achieve trimming your video using these commands:</p>
<pre><code>medipack trim input.mp3 -s 00:00 -e 00:30 -o output.mp3
medipack trim input.mp3 -s 00:00 -t 00:30 -o output.mp3
</code></pre>
<... | 6,552 |
<p>I am creating an installer in IzPack. It is quite large, and I have broken up my XML files appropriately using <xinclude> and <xfragment> tags. Unfortunately, IzPack does not combine them together when you build your installer. This requires you to package the files with the installer, which just won't w... | <p>If you can't get xinclude to work and you're using Ant, I'd recommend <a href="http://www.oopsconsultancy.com/software/xmltask" rel="nofollow noreferrer">XMLTask</a>, which is a plugin task for Ant. It'll do lots of clever stuff, including the one thing you're interested in - constructing a XML file out of fragments... | <p>I'm not sure if java supports automatic xinclude. But you will have to use namespaces to make it work. So don't use <code><xinclude ....></code>, but use: </p>
<pre><code><xi:xinclude xmlns:xi="http://www.w3.org/2001/XInclude" href="example/File2.xml" />
</code></pre>
<p>Normally the included file shou... | 9,861 |
<p>I have a semi-diy hotend setup on my MOOZ-2 (an obscure chinese printer). It requires that the total nozzle length (including threading) is longer than 15 mm. So far, I've been using Volcano nozzles because they're the only ones I can find that meet this requirement. However I believe this negatively impacts perform... | <p><strong>I think this is just an overcomplicated lost-PLA (investment) casting.</strong></p>
<p>What you're asking for is to create an object, create a mold around it, and then burn out the object and replace it with metal. Traditionally this is done with wax, <a href="https://en.wikipedia.org/wiki/Lost-wax_casting"... | <p>I don't see why it wouldn't work. It doesn't seem to be the optimal way but I haven't tried it.</p>
<p>Only thing that might be an issue is that PLA doesn't burn away clean (not for me anyway) which can leave defects in the product. But there are filaments specifically made for casting which apparently burn away wit... | 2,135 |
<p>I'm looking to introduce a unit testing framework into the mix at my job. We're using Visual Studio 2005 (though we may be moving to 2008 within the next six months) and work primarily in C#. If the framework has some kind of IDE integration that would be best, but I'm open to frameworks that don't have integration... | <p>I think <a href="https://en.wikipedia.org/wiki/NUnit" rel="nofollow noreferrer">NUnit</a> <strong>is</strong> your best bet. With <a href="https://testdriven.net/" rel="nofollow noreferrer">TestDriven.NET</a>, you get great integration within Visual Studio. (ReSharper also has a unit test runner if you're using it).... | <p><a href="https://en.wikipedia.org/wiki/List_of_unit_testing_frameworks#.NET_programming_languages" rel="nofollow noreferrer">MbUnit</a> is worth a look. It has a set of features comparable to NUnit. It has its own GUI, or can be integrated into Visual Studio if you have <a href="https://en.wikipedia.org/wiki/JetBrai... | 2,313 |
<p>I have had a 3d printer for a while now, and I have a lot of the quality settings dialed in pretty well, but one thing that constantly bugs me is removing the raft from my finished prints. I am using Repetier and I have set the air gap to 0.2 mm. That led to much better results than the default 0, which were impossi... | <p>I have been able to get rafts that peel off by editing the g-code after the raft has finished and adding an M104 set temperature command telling my printer to cool the nozzle down to about 40 degrees and then another M104 command to tell the nozzle to heat back up again. This gives the raft enough time to cool and t... | <p>I use raft almost always for ABS and PLA. My favorite setting for gap is somewhere between 0.11-0.13 mm both for 0.1 and 0.2 mm layer height.</p>
<p>By using 3-4 layers of raft I always get predictably good quality of a lower layer and not have any issues with removing prints from the surface which I had without us... | 692 |
<p>I'm just about wrapped up on a project where I was using a commercial SVN provider to store the source code. The web host the customer ultimately picked includes a repository as part of the hosting package, so, now that the project is over, I'd like to relocate the repository to their web host and discontinue the co... | <p>If you want to move the repository and keep history, you'll probably need filesystem access on both hosts. The simplest solution, if your backend is FSFS (the default on recent versions), is to make a filesystem copy of the entire repository folder.</p>
<p>If you have a Berkley DB backend, if you're not sure of wh... | <p>Assuming you have the necessary privileges to run svnadmin, you need to use the <a href="http://svnbook.red-bean.com/en/1.4/svn.ref.svnadmin.c.dump.html" rel="nofollow noreferrer">dump</a> and <a href="http://svnbook.red-bean.com/en/1.4/svn.ref.svnadmin.c.load.html" rel="nofollow noreferrer">load</a> commands.</p>
| 7,201 |
<p>Why are unsigned integers not CLS compliant?</p>
<p>I am starting to think the type specification is just for performance and not for correctness.</p>
| <p>Not all languages have the concept of unsigned ints. For example VB 6 had no concept of unsigned ints which I suspect drove the decision of the designers of VB7/7.1 not to implement as well (it's implemented now in VB8).</p>
<p>To quote:</p>
<blockquote>
<p><a href="http://msdn.microsoft.com/en-us/library/12a7a7h3.a... | <p>Unsigned integers are not CLS compliant because they're not interoperable between certain languages.</p>
| 2,807 |
<p>What are the common algorithms being used to measure the processor frequency?</p>
| <p>Intel CPUs after Core Duo support two Model-Specific registers called IA32_MPERF and IA32_APERF.<br>
MPERF counts at the maximum frequency the CPU supports, while APERF counts at the actual current frequency.</p>
<p>The actual frequency is given by:</p>
<p><img src="https://chart.apis.google.com/chart?cht=tx&c... | <p>I'm not sure why you need assembly for this. If you're on a machine that has the /proc filesystem, then running:</p>
<pre><code>> cat /proc/cpuinfo
</code></pre>
<p>might give you what you need.</p>
| 9,085 |
<p>I was surprised to learn that, AFAICT, neither Protolabs, Xometry, or Shapeways* can supply 3D printed parts from acrylic. Is anyone aware of a commercial source of 3D printed parts made from acrylic [polymethylmethacrylate (PMMA)]?</p>
<p>*Shapeways does 3D print their "Fine Detail Plastic" which is an a... | <p>You can definitely use glue - however you can also brush some of the liquid resin along the edges of the two pieces, push them together and cure them, this will fuse them together.</p>
<p>You don't need much, and you need to watch for drip out while curing (don't your fingers in it)</p>
| <p>You can definitely use glue - however you can also brush some of the liquid resin along the edges of the two pieces, push them together and cure them, this will fuse them together.</p>
<p>You don't need much, and you need to watch for drip out while curing (don't your fingers in it)</p>
| 1,730 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.