instruction stringlengths 27 22.5k | chosen stringlengths 27 28.2k | rejected stringlengths 19 24.9k | __index_level_0__ int64 0 10k |
|---|---|---|---|
<p>Suppose someone worked for a company that put up an HTTP proxy preventing internet access without password authentication (NTLM, I think). Also suppose that this password rotated on a daily basis, which added very little security, but mostly served to annoy the employees. How would one get started writing a Firefox ... | <p>This is built into Firefox. Open up about:config, search for 'ntlm'</p>
<p>The setting you're looking for is called network.automatic-ntlm-auth.trusted-uris and accepts a comma-space delimited list of your proxy server uris.</p>
<p>This will make FireFox automatically send hashed copies of your windows password to... | <p>It's your lucky day - no need for an add-on!</p>
<h2>How to configure Firefox for automatic NTLM authentication</h2>
<ol>
<li>In Firefox, type about:config into the address bar and hit enter. You should see a huge list of configuration properties. </li>
<li>Find the setting named network.negotiate-auth.delegation... | 6,244 |
<p>I'm looking into writing a audio syntesizer in Java, and was wondering if anybody has any advice or good resources for writing such a program. I'm looking for info on generating raw sound waves, how to output them into a usable form (playing over speakers), as well as general theory on the topic. Thanks guys.</p>
| <ol>
<li><p>This problem is basically about mapping functions to arrays of numbers. A language that supports first-class functions would come in really handy here.</p></li>
<li><p>Check out
<a href="http://www.harmony-central.com/Computer/Programming" rel="nofollow noreferrer">http://www.harmony-central.com/Computer/P... | <p>I dont't know if that helps, but if you can use MIDI for anything, you should check out <a href="http://www.jfugue.org/" rel="nofollow noreferrer">JFuge</a>.</p>
| 5,717 |
<p>On these questions:</p>
<ul>
<li><a href="https://stackoverflow.com/questions/17653/which-vista-edition-is-the-best-for-developer-machine">Which Vista edition is best for a developer machine?</a></li>
<li><a href="https://stackoverflow.com/questions/4433/vista-or-xp-for-dev-machine">Vista or XP for Dev Machine</a><... | <p>A number of reasons.</p>
<ol>
<li>Yes, you're right it is so you can have more than 3 gig of ram</li>
<li>More and more systems are going to be 64 bit soon so it makes sense to develop on what you're going to be running on</li>
<li>Some bugs can only be observed when running in 64 bit mode</li>
</ol>
| <p>XP 64bit wasn't ready for prime time, there were no drivers for it. In Windows Vista 64-bit this isn't the case. So if you are looking to install Windows Vista go 64-bit if you are keeping XP stay at 32-bit.</p>
| 3,866 |
<p>This is an ASP.Net 2.0 web app. The Item template looks like this, for reference:</p>
<pre><code><ItemTemplate>
<tr>
<td class="class1" align=center><a href='url'><img src="img.gif"></a></td>
<td class="class1"><%# DataBinder.Eval(Container.DataItem,"fiel... | <p>Off the top of my head, you can try something like this:</p>
<pre><code><ItemTemplate>
<tr>
<td "class1"><asp:Literal ID="litField1" runat="server" Text='<%# Bind("Field1") %>'/></td>
<td "class1"><asp:Literal ID="litField2" runat="server" Text='<%# Bind("Fi... | <p>If you can afford a smidge more overhead in the generation, go for DataList and use the DataKeys property, which will save the data fields you need.</p>
<p>You could also use labels in each of your table cells and be able to reference items with e.Item.FindControl("LabelID").</p>
| 7,830 |
<p>Prusa MK3 heatbed power cable shorted out (on the Einsy side) and it looks like I need to replace the Einsy. Should I replace the heatbed too? I don’t know electronics well and am worried I will just fry a new Einsy.</p>
<p>Heatbed end:
<a href="https://i.stack.imgur.com/1pA7t.jpg" rel="nofollow noreferrer" title="H... | <p>It's common for modeling software to flip normals, causing what you describe. You said,</p>
<blockquote>
<p>I only care about the externally facing faces.</p>
</blockquote>
<p>But are you sure they are truly externally facing? Turn on normals in Blender and ensure that all the arrows/pointers are external.</p>
<p>An... | <p>Okay, so like suggested I put it into 3D Builder (A free Windows 3D modeling program). I imported it as an stl, then exported it as an stl and imported that stl into Cura. And lo and behold all problems were gone! If you are having a similar issue give that a try! The 3D Builder program and similar ones are designed... | 1,892 |
<p>To make a JavaScript class with a public method I'd do something like:</p>
<pre><code>function Restaurant() {}
Restaurant.prototype.buy_food = function(){
// something here
}
Restaurant.prototype.use_restroom = function(){
// something here
}
</code></pre>
<p>That way users of my class can:</p>
<pre><code... | <p>You can do it, but the downside is that it can't be part of the prototype:</p>
<pre><code>function Restaurant() {
var myPrivateVar;
var private_stuff = function() { // Only visible inside Restaurant()
myPrivateVar = "I can set this here!";
}
this.use_restroom = function() { // use_restro... | <p>Private functions cannot access the public variables using module pattern</p>
| 7,942 |
<p>I switched my Anet A8 over to a Bowden and it's printing great. Moving that weight off has enabled me to almost double the speed and resonance problems have vanished. </p>
<p>My question is regarding after the print is done should I add a retraction code and back the filament out of the v6 or is it okay to leave it... | <p>It's okay to leave the filament in the hot end, as long as you let it cool down with the hot end cooling fan running.</p>
<hr>
<p><em>From comment:</em></p>
<blockquote>
<p>That's not an issue, you can simply leave it in the hot end. The only "end of print" clogs usually occur when leaving the hot end hot for a... | <p>I agree with towe's answer. I would leave it, retracting at most a mm or two just to avoid a mess. If you retract much at end of print, initial state for the second or later print is different from after just loading new filament, and this leads to different priming/skirt outcomes for the two cases, which can be pro... | 1,518 |
<p>We generate dynamic reports in all of our business web applications written for .Net and J2EE. On the server side we use ActiveReports.Net and JasperReports to generate the reports. We then export them to PDF to send down to the browser.</p>
<p>Our clients all use Adobe Reader. We have endless problems with the ... | <p>I've used SQL Reporting Services for this purpose. You can design a report template in Visual Studio or generate the XML for the report on the fly in code. You can then have SSRS export the report to about 10 different formats and send to the client including pdf, excel, html, etc. You can also write your own plugin... | <p>I've always had the most success using PDFs to accomplish this. I can't think of a more universally acceptable format that does what you are trying to do. Rather than looking for another format, perhaps it would be better to try to understand how to overcome the problems that you are experiencing with Acrobat on t... | 6,817 |
<p>Given a reference to a method, is there a way to check whether the method is bound to an object or not? Can you also access the instance that it's bound to?</p>
| <pre class="lang-py prettyprint-override"><code>def isbound(method):
return method.im_self is not None
def instance(bounded_method):
return bounded_method.im_self
</code></pre>
<p><a href="https://docs.python.org/2.7/reference/datamodel.html#index-40" rel="nofollow noreferrer">User-defined methods:</a></p>... | <p>A solution that works for both Python 2 and 3 is tricky.</p>
<p>Using the package <a href="https://six.readthedocs.io/" rel="nofollow noreferrer"><code>six</code></a>, one solution could be:</p>
<pre class="lang-py prettyprint-override"><code>def is_bound_method(f):
"""Whether f is a bound method&... | 7,666 |
<p>So basically I am looking for good templates for writing both technical and functional specs on a project or work request.</p>
<p>What do you use? How deep do you get while writing the specs? Any additional general tips you could provide would be appreciated.</p>
<p>My company needs these badly. I work for a contr... | <p>On general tips;</p>
<p>We are implementing a process of </p>
<p>1) Business Requirements Statement (BRS)</p>
<p>2) Functional Specification</p>
<p>3) Technical specification</p>
<p>The BRS covers what the business problems are, and what the requirements are around solutions, testing, security, reliability and ... | <p>Start off simple, and work your way from there. Since this is your first experience working with this, use a word document with bullet points. Write it, re-read it and provide enough detail that it makes sense. For technical specifications, you may want to lead the developer toward a solution, but for functional ... | 7,552 |
<p>How can I build a loop in JavaScript?</p>
| <p><strong>For loops</strong></p>
<pre><code>for (i = startValue; i <= endValue; i++) {
// Before the loop: i is set to startValue
// After each iteration of the loop: i++ is executed
// The loop continues as long as i <= endValue is true
}
</code></pre>
<p><strong>For...in loops</strong></p>
<pre>... | <p>A loop in JavaScript looks like this:</p>
<pre><code>for (var = startvalue; var <= endvalue; var = var + increment) {
// code to be executed
}
</code></pre>
| 7,531 |
<p>I have a c# asp.net web app. Breakpoints in the database layer are no longer stopping execution but the breakpoints in the UI layer are still working okay. Can anyone hazard a guess why this might be happening?</p>
<p>I've checked all the usual suspects (Debug build is on for all projects) and recompiled all projec... | <p>I would ensure that the UI layer is referencing the appropriate 'debug' .dll's. I'd also consider pressing <kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>U</kbd> (<code>Modules View</code>) when you're debugging to see if symbols are loaded for your BLL and DAL <code>.dlls</code>. If not then Visual Studio is unable to find <c... | <p>Have you tried deleting your bin directories before recompiling?</p>
| 8,489 |
<p>I have a .NET application, which is using an open source C++ compression library for compressing images. We are accessing the C++ library via managed C++. I'm seeing heap corruption during compression. A call to _CrtIsValidHeapPointer is finding an error on a call to free() when cleaning up after compression.</p>... | <p>In native code, if the corruption always occurs in the same place in memory, you can use a <a href="http://msdn.microsoft.com/en-us/library/350dyxd0.aspx" rel="nofollow noreferrer">data breakpoint</a> to break the debugger when that memory is changed. Unfortunately, you cannot set a data breakpoint in the managed C+... | <p><a href="http://www-01.ibm.com/software/awdtools/purifyplus/win/" rel="nofollow noreferrer">Rational Purify for Windows</a> supports .NET, so I guess that could be used.</p>
| 5,536 |
<p>What is the fastest way of transferring few thousand rows of data from one DataTable to another? Would be great to see some sample code snippets.</p>
<p>Edit: I need to explain a bit more. There is a filtering condition for copying the rows. So, a plain Copy() will not work.</p>
| <p>You can't copy the whole table, you need to copy one rows. From <a href="http://support.microsoft.com/kb/308909" rel="noreferrer">http://support.microsoft.com/kb/308909</a> (sample code if you follow the link)</p>
<p>"How to Copy DataRows Between DataTables
Before you use the ImportRow method, you must ensure that... | <p>What is wrong with <a href="http://msdn.microsoft.com/en-us/library/system.data.datatable.copy.aspx" rel="nofollow noreferrer">DataTable.Copy</a>?</p>
| 9,347 |
<p>Are there any good tools out there for automatically converting non-Java source code into Java source?</p>
<p>I'm not expecting something perfect, just to get the worst of the grunt work out of the way.</p>
<p>I guess there is a sliding scale of difficulty. C# should be relatively easy (so long as you ignore all t... | <p>One thing you can try is find a Java bytecode compiler for the language you're talking about (there are JVM compilers for all kinds of languages) and then decompile the bytecode back into Java using a decompiler like Jad. </p>
<p>This is fraught with peril. The regenerated code will suck and will probably be unre... | <p>ADA to Java can be done with a find-and-replace!</p>
| 6,893 |
<p>After encountering extreme under extrusion on my Anycubic i3 Mega, I first cleaned the nozzle and ended up replacing the entire hotend + nozzle. Since that did not help and I couldn't see any issues with it, I went on to check my E-steps. It seems that this is the root cause of the issue.</p>
<p>I removed the Bowden... | <p>The raft still needs to fit on the bed, and it counts as a print, because, it is printed. You want the raft for better adhesion, so that means that you need more contact with the bed. If you’re not, your basically wasting filament. Its kinda logical actually.</p>
| <h2>Adjusted model Dimensions</h2>
<p>The model has the size determined by the base area of the bounding box, in this case, <span class="math-container">$\pu{190 \times 200 mm }$</span>. The raft as told by OP adds 15mm on <strong>all</strong> sides of the model, and thus adds 30 mm in total on both the X and Y dimensi... | 2,225 |
<p>I've recently switched to Linux on my work machine and, new to the Linux desktop environment, I'd like to find a decent ERD tool for database design. Booting back into my Windows partition every time I need to create a diagram is going to get unpleasant quickly. I looked at Dia, but didn't see any DB tools - only ... | <p>MySQL just officially released the alpha of "MySQL Workbech for linux":</p>
<p>See the announcement here:
<a href="http://dev.mysql.com/workbench/?p=153" rel="noreferrer">MySQL Workbench 5.1 Alpha for Linux available</a>.</p>
| <p>You can try Base from <a href="https://www.libreoffice.org/features/base/" rel="nofollow">LibreOffice</a>. It can connect to any database and you can easily create, design and write queries using visual wizards and tools.</p>
| 3,491 |
<p>My path to a 'fulltime'- developer stated as a analyst using VBA with Excel, Access, and then onto C#. I went to college part time once I discovered I had a passion for coding not business.</p>
<p>I do about most of my coding in C#, but being an ASP.NET developer I also write in HTML, JavaScript, SQL etc. . . the... | <p>If you want to be one of the best you need to specialise. If you become very good in many skills then you may never become truly excellent in one. I know because I have taken this route myself and have found it difficult to get employment at times. After all, who wants someone who is capable at many languages when ... | <p>Why don't you swap stacks and look at the LAMP stack?</p>
<p>Or how about a functional language like haskell?</p>
<p>Or write a DSL?</p>
<p>Or an app for your phone?</p>
| 4,336 |
<p>To create a playlist for all of the music in a folder, I am using the following command in bash:</p>
<pre><code>ls > list.txt
</code></pre>
<p>I would like to use the result of the <code>pwd</code> command for the name of the playlist.</p>
<p>Something like:</p>
<pre><code>ls > ${pwd}.txt
</code></pre>
<p... | <p>The best way to do this is with <code>"$(command substitution)"</code> (thanks, <a href="https://stackoverflow.com/a/58233/1899640">Landon</a>):</p>
<pre><code>ls > "$(pwd).txt"
</code></pre>
<p>You will sometimes also see people use the older backtick notation, but this has <a href="https://stackoverflow.com/q... | <p>to strip all but the directory name</p>
<pre><code>ls >/playlistdir/${PWD##/*}.txt
</code></pre>
<p>this is probably not what you want because then you don't know where the files are (unless you change the ls command)</p>
<p>to replace "/" with "_"</p>
<pre><code>ls >/playlistdir/${PWD//\//_}.txt
</code></... | 8,260 |
<p>Typically I develop my websites on trunk, then merge changes to a testing branch where they are put on a 'beta' website, and then finally they are merged onto a live branch and put onto the live website.</p>
<p>With a Facebook application things are a bit tricky. As you can't view a Facebook application through a n... | <p>The way I and my partner did it was we each made our own private Facebook applications, that pointed to our IP address where we worked on it. Since we worked in the same place, we each picked a different port, and had our router forward that port to our local IP address. It was kinda slow to refresh a page, but it w... | <p>Another solution is NGROK</p>
<p><a href="https://ngrok.com/" rel="nofollow">https://ngrok.com/</a></p>
<p>It opens a public tunnel to your local app</p>
<p>Example on my rails application by simply typing</p>
<pre><code>./ngrok 3000
</code></pre>
<p>I get</p>
<pre><code>http://630066fe.ngrok.com -> 127.0.0... | 6,038 |
<p>I'm working on a cube in Blender. I just deleted one of the faces (the top face) of the cube and added solidify to avoid non manifold edges. </p>
<p>In this case, when I check the design it shows that the bottom face is an overhang face (shown with yellow color). However, if I change the overhang parameter in 3D ... | <p>Overhangs that are substantially greater than 45° to the vertical generally require supports, and overhangs of 90° will definitely require supports, unless they are bridges (supported at both ends). Depending on how well you have your printer and filament "dialled in", it is possible to print overhangs up to 70° wit... | <p>Overhangs that are substantially greater than 45° to the vertical generally require supports, and overhangs of 90° will definitely require supports, unless they are bridges (supported at both ends). Depending on how well you have your printer and filament "dialled in", it is possible to print overhangs up to 70° wit... | 1,333 |
<p>Im searching a tool which allows me to specify some folders as "bookmarks" and than access them on the commandline (on Windows XP) via a keyword. Something like:</p>
<pre><code>C:\> go home
D:\profiles\user\home\> go svn-project1
D:\projects\project1\svn\branch\src\>
</code></pre>
<p>I'm currently using a... | <p>What you are looking for is called DOSKEY </p>
<p>You can use the doskey command to create macros in the command interpreter. For example:</p>
<pre><code>doskey mcd=mkdir "$*"$Tpushd "$*"
</code></pre>
<p>creates a new command "mcd" that creates a new directory and then changes to that directory (I prefer "pushd... | <p>Environment variables?</p>
<pre><code>set home=D:\profiles\user\home
set svn-project1=D:\projects\project1\svn\branch\src
cd %home%
</code></pre>
<p>On Unix I use this along with popd/pushd/cd - all the time.</p>
| 5,194 |
<p>I'm loading a <strong><em>SQL Server 2000</em></strong> database into my new <strong><em>SQL Server 2005</em></strong> <strong><em>instance</em></strong>. <strong><em>As expected, the full-text catalogs don't come with it.</strong> <strong>How can I rebuild them?</em></strong></p>
<p>Right-clicking my full text cat... | <p>Try it using SQL.</p>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/ms189520%28SQL.90%29.aspx" rel="nofollow noreferrer">CREATE FULLTEXT CATALOG</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/ms176095%28SQL.90%29.aspx" rel="nofollow noreferrer">ALTER FULLTEXT CATALOG</a></li>
</ul>
<p>He... | <p>Thanks, that helped because it showed what was wrong: My file paths were different. Here's how I fixed it:</p>
<p>1) Load database from SQL 2000 backup</p>
<p>2) Set compatibility mode to SQL 2005</p>
<pre><code>USE mydb
GO
ALTER DATABASE mydb SET COMPATIBILITY_LEVEL = 90
GO
</code></pre>
<p>3) Get the filegrou... | 7,016 |
<p>I'm using Flash to play an .flv movieclip on my site, but I want to have the .swf send trigger an event in my javascript when it start loading, starts playing and ends playing.</p>
<p>What is the best way to do that in Flash CS3 using Actionscript 3.0 ?</p>
| <p>You need to use the "allowScriptAccess" flash variable in the HTML. You probably want to use "sameDomain" as the type. Note that if you go cross-domain, you also need to host a special file on the server called 'crossdomain.xml' which enables such scripting (the flash player will check for this. More info at <a href... | <p>A common way to do this is with the <strong>ExternalInterface</strong> class, which you can use to call JavaScript methods.</p>
<p>First define your JavaScript methods, for example:</p>
<pre><code><script language="JavaScript">
function startsPlaying()
{
// do something when the FLV starts pl... | 5,930 |
<p>We are automating Excel using VB.Net, and trying to place multiple lines of text on an Excel worksheet that we can set to not print. Between these we would have printable reports.
We can do this if we add textbox objects, and set the print object setting to false. (If you have another way, please direct me)</p>
<p>... | <p>If you have the cell name or position, you can do:</p>
<pre><code>With ActiveSheet
.Shapes.AddTextbox msoTextOrientationHorizontal, .Cells(3,2).Left, .Cells(3,2).Top, .Cells(3,2).Width, .Cells(3,2).Height
End With
</code></pre>
<p>This will add a textbox over cell B3. When B3 is resized, the textbox is also.</p>... | <p>When you copy & paste a textbox, Excel will place the new textbox over whichever cell is currently selected. So you can achieve this very easily by simply using the VBA copy & paste commands. This can be particularly useful if you are going to be using a lot of very similar textboxes, as you are effectivel... | 9,252 |
<p>What is the best way to keep an asp:button from displaying it's URL on the status bar of the browser? The button is currently defines like this:</p>
<pre><code><asp:button id="btnFind"
runat="server"
Text="Find Info"
onclick="btnFind_Click">
</asp:button>
</code><... | <p>I use FF so never noticed this, but the link does in fact appear in the status bar in IE..</p>
<p>I dont think you can overwrite it :( I initially thought maybe setting the ToolTip (al la "title") property might do it.. Seems it does not..</p>
<p>Looking at the source, what appears is nowhere to be found, ... | <p>I don't see a link, I see this:</p>
<pre><code>javascript:__doPostBack('btn','');
</code></pre>
<p><strong>EDIT</strong>: Sorry, was looking at a LinkButton, not an ASP:Button. The ASP:Button shows the forms ACTION element like stated. </p>
<p>But, if you are trying to hide the DoPostBackCall, the only way to do... | 8,369 |
<p>I'm trying to improve performance under high load and would like to implement opcode caching. Which of the following should I use?</p>
<ul>
<li>APC - <a href="http://www.howtoforge.com/apc-php5-apache2-debian-etch" rel="noreferrer">Installation Guide</a></li>
<li>eAccelerator - <a href="http://www.howtoforge.com/ea... | <p>I think the answer might depend on the type of web applications you are running. I had to make this decision myself two years ago and couldn't decide between Zend Optimizer and eAccelerator.</p>
<p>In order to make my decision, I used ab (apache bench) to test the server, and tested the three combinations (zend, ea... | <p>I've been using XCache for more than a year now with no problems at all.</p>
<p>I tried to switch to eAccelerator, but ended up with a bunch of segmentation faults (it's less forgiving of errors). The major benefit to eAccelerator is that it's not just an opcode cache, it's also an optimizer.</p>
<p>You should ful... | 4,834 |
<p>I am currently running my Tronxy X5s with a MKS Gen L board. So far I have not ran the heat bed over 50 degrees C since I have only printed with PLA so far. I plan to try PETG and/or ABS in the near future and I have a spare power supply 12V/360W laying around. </p>
<p>When I first got my printer I purchased <a hre... | <p>Short answer YES. You can run it from a different power supply at a higher voltage. Also it has a PC817 Optical isolator (for some reason) therefore the second power supply and your main board should not be electrically connected at all.</p>
| <p>For reference,I done tracing this module as shown.
<a href="https://i.stack.imgur.com/ols3z.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ols3z.jpg" alt="enter image description here" /></a>
<a href="https://i.stack.imgur.com/r8ao6.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.c... | 1,261 |
<p>Wouldn't it be better to mount lead screws with the motor on top and the bottom end unconstrained? Compared to the conventional way (motor on the bottom) the lead screw would be under constant tension rather than compression and any misalignment would always be "pulled straight" and in this way minimize z-... | <p>The motor is mounted in a fixed position no matter if it's on top or bottom.
You can imagine the lead screw as a rod hanging down and supporting the bed in the Z direction only, because all of the XY rigidity comes from the Liner rails the bed is attached to it works just as well if the stiff rod is under compressio... | <p>The motor is mounted in a fixed position no matter if it's on top or bottom.
You can imagine the lead screw as a rod hanging down and supporting the bed in the Z direction only, because all of the XY rigidity comes from the Liner rails the bed is attached to it works just as well if the stiff rod is under compressio... | 2,017 |
<p>It happens to me all the time. I accidentally version a file, I do not want to be versioned (i.e. developer/machine specific config-files).</p>
<p>If I commit this file, I will mess up the paths on all the other developer machines - they will be unhappy.</p>
<p>If I do delete the file from versioning, it will be d... | <p>SVN version 1.5 supports removing/deleting a file from a repository with out losing the local file</p>
<p>taken from <a href="http://subversion.tigris.org/svn_1.5_releasenotes.html" rel="noreferrer">http://subversion.tigris.org/svn_1.5_releasenotes.html</a> </p>
<p>New --keep-local option retains path after delete... | <p>As far as I know there is no easy way to remove an added file from versioning control in svn once it is committed.</p>
<p>You will have to save the file somewhere else and delete it from version control. Than copy the backup back again.</p>
<p>It's a version control system after all... ;)</p>
| 4,733 |
<p>What are the best open source (open source and commercial) reporting tools for ASP.NET similar to Crystal Reports for ASP.NET?</p>
| <p>Microsoft Reporting Services, <strong>free</strong> and included with SQL Server 2005 and 2008.</p>
<p>Of course, this is great if you need a separation of report design and application, which for Enterprise applications is a huge plus.</p>
<p>However, if what you want is to be able to create "in application" dash... | <p>As much as I despise Crystal Reports (we describe digging deep into it the seven layers of Crystal hell) -- it seems to be the best/most-flexible tool for the job. I hope someone comes along and knocks them off the block though. </p>
<p>Microsoft Reporting Services is an alternative, but didn't have the features we... | 4,352 |
<p>I'm thinking this might be a quick and easy way to lower the form spam on our site just a little bit. The idea being that (I have read) spammers aren't running with javascript enabled. (Or at least they are accessing your website without running javascript. I.e., they aren't browsing up to it in IE or FF.</p>
<p>I ... | <p>The simplest way is to set a cookie via javascript and check for it on postback.However, if you're looking to minimize spam you should actually have the browser perform a simple task which requires javascript execution. See Phil Haack's "Invisibile Captcha Validator" control, which has since been included in his Sub... | <p>I see you've accepted the <code>noscript</code> answer, but how will you use this to fight spam? <code>noscript</code> will allow you to add special content for users without JS, but unless you're generating the rest of your site in JS, it will still be available to user agents without JS.</p>
<p>A captcha of some ... | 7,559 |
<p>I have a very simple mapping function called "BuildEntity" that does the usual boring "left/right" coding required to dump my reader data into my domain object. (shown below) My question is this - If I don't bring back every column in this mapping as is, I get the "System.IndexOutOfRangeException" exception and want... | <p>Also check out this <a href="http://www.madprops.org/blog/another-idbcommand-extension-fill/" rel="noreferrer">extension method I wrote</a> for use on data commands:</p>
<pre><code>public static void Fill<T>(this IDbCommand cmd,
IList<T> list, Func<IDataReader, T> rowConverter)
{
using (va... | <p>Why don't you use LinqToSql - everything you need is done automatically. For the sake of being general you can use any other <a href="http://en.wikipedia.org/wiki/Object-relational_mapping" rel="nofollow noreferrer">ORM tool</a> for .NET</p>
| 4,218 |
<p>I am having a few problems with my BLTouch. I have calibrated it several times using different methods and get the nozzle being 1.3 mm lower than the BLTouch pin so a Z offset of -1.3 mm. This works fine for auto homing, bed levelling and using code <code>G1 Z0</code> to lower to where needed. However when... | <p>This answer is intended to be a generic answer for Z-offset determination. The question is not clear on how the Z-offset has been determined. It appears as if this distance is measured, while in reality this cannot be measured.</p>
<p>A touch (or a inductive or capacitive) probe uses a trigger point to determine th... | <p>You should be able to offset this with a <code>G54 Z-1.3</code> - <strong>if your setup accepts these gcodes</strong>. </p>
<p>If you do this, always add a <code>G53</code> to the very start and just before the <code>M30</code> to clear all offsets after job finish (or in the event of a cancel, at the start of the ... | 1,466 |
<p>Does anyone know of a way to find out how much memory an instance of an object is taking?</p>
<p>For example, if I have an instance of the following object:</p>
<pre><code>TestClass tc = new TestClass();
</code></pre>
<p>Is there a way to find out how much memory the instance <code>tc</code> is taking?</p>
<p>Th... | <p>If you are not trying to do it in code itself, which I'm assuming based on your ANTS reference, try taking a look at CLRProfiler (currently v2.0). It's free and if you don't mind the rather simplistic UI, it can provide valuable information. It will give you a in-depth overview of all kinds of stats. I used it a whi... | <p>I have good experiences with <a href="http://memprofiler.com/" rel="nofollow noreferrer">MemProfiler</a>. It gives you stack traces of when the object was created and all the graphs of why the object is still not garbage collected.</p>
| 8,584 |
<p>If it's possible, I'm interested in being able to embed a PostgreSQL database, similar to <a href="http://www.sqlite.org/" rel="noreferrer">sqllite</a>. I've read that it's <a href="http://bytes.com/forum/thread647637.html" rel="noreferrer">not possible</a>. I'm no database expert though, so I want to hear from yo... | <p>Unless you do a major rewrite of code, it is not possible to run Postgres "embedded". Either run it as a separate process or use something else. SQLite is an excellent choice. But there are others. MySQL has an embedded version. See it at <a href="http://mysql.com/oem/" rel="noreferrer">http://mysql.com/oem/</a>. Al... | <p>Anyone tried on Mac OS X:</p>
<p><a href="http://pagesperso-orange.fr/bruno.gaufier/xhtml/prod_postgresql.xhtml" rel="nofollow noreferrer">http://pagesperso-orange.fr/bruno.gaufier/xhtml/prod_postgresql.xhtml</a></p>
<p><a href="http://www.macosxguru.net/article.php?story=20041119135924825" rel="nofollow noreferre... | 8,515 |
<p>I have some C# / asp.net code I inherited which has a textbox which I want to make multiline. I did so by adding textmode="multiline" but when I try to insert a newline, the enter key instead submits the form :P</p>
<p>I googled around and it seems like the default behavior should be for enter (or control-enter) to... | <p>It turns out this is a bug with Firefox + ASP.NET where the generated javascript for the defaultButton stuff doesn't work in Firefox. I had to put a replacement for the WebForm_FireDefatultButton function as described <a href="http://forums.asp.net/t/1294544.aspx" rel="nofollow noreferrer">here</a>:</p>
<pre><code>... | <p>you can use \n for enter key
i.e.
[a-zA-Z 0-9/.\n]{20,500}</p>
| 5,011 |
<p>I've found myself increasingly unsatisfied with the DataSet/DataTable/DataRow paradigm in .Net, mostly because it's often a couple of steps more complicated than what I really want to do. In cases where I'm binding to controls, DataSets are fine. But in other cases, there seems to be a fair amount of mental overhe... | <p>Since .NET 3.5 came out, I've exclusively used LINQ. It's really that good; I don't see any reason to use any of those old crutches any more. </p>
<p>As great as LINQ is, though, I think any ORM system would allow you to do away with that dreck.</p>
| <p>I NEVER use datasets. They are big heavyweight objects only usable (as someone pointed out here) for "demoware". There are lot's of great alternatives shown here.</p>
| 3,909 |
<p><strong>problem solved by resetting cura.</strong></p>
<p>I have problems like this: How can I fix this? I can't find the right setting.</p>
<p><a href="https://i.stack.imgur.com/2cf9Q.png" rel="nofollow noreferrer" title="No top layer"><img src="https://i.stack.imgur.com/2cf9Q.png" alt="No top layer" title="No to... | <p>This problem appears when a face is inverted, so the slicer confuses and expect the other wall to close the object. So you need to reverse that face to show the face out and the back face inside the shape to be filled</p>
<p><a href="https://i.stack.imgur.com/OklcS.png" rel="nofollow noreferrer"><img src="https://i... | <p>I'm pretty sure the yellow lines are showing the full path of the extruder head, including where it's retracted. Somewhere in Cura's maze of menus, there's an option to turn on/off various displays related to the slicing. </p>
<p>As to why the top layer isn't there -- most likely it's too thin in your source mod... | 1,036 |
<p>I need to programatically determine whether .NET 3.5 is installed. I thought it would be easy:</p>
<pre><code><% Response.Write(Environment.Version.ToString()); %>
</code></pre>
<p>Which returns "2.0.50727.1434" so no such luck...</p>
<p>In my research I have that there are some rather obscure registry keys... | <p>You could try:</p>
<pre><code>static bool HasNet35()
{
try
{
AppDomain.CurrentDomain.Load(
"System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089");
return true;
}
catch
{
return false;
}
}
</code></pre>
<p>@<a href="https://stack... | <p>Without any assembly loading and catching exceptions (which is slow), check for class API changes between 2.0 and 3.5. <a href="http://mono.ximian.com/class-status/2.0-vs-3.5/index.html" rel="nofollow noreferrer">Mono Class Status</a> is very helpful for this. For example you could check for <code>GC.Collect Method ... | 3,693 |
<p>When applying the Single Responsibility Principle and looking at a class's reason to change, how do you determine whether that reason too change is too granular, or not granular enough?</p>
| <p>Make liberal use of [SuppressMessage] attribute to begin with. At least at the beginning. Once you get the count to 0 via the attribute, you then put in a rule that new checkins may not introduce FxCop violations. </p>
<p>Visual Studio 2008 has a nice code analysis feature that allows you to ensure that code analys... | <p>An alternative to FxCop would be to use the tool <a href="http://www.ndepend.com/" rel="nofollow noreferrer">NDepend</a>. This tool lets write <strong>Code Rules over C# LINQ Queries</strong> (what we call <a href="http://www.ndepend.com/Features.aspx#CQL" rel="nofollow noreferrer">CQLinq</a>). <em>Disclaimer: I am ... | 4,664 |
<p>I would like display something more meaningful that animated gif while users upload file to my web application. What possibilities do I have? </p>
<p><em>Edit: I am using .Net but I don't mind if somebody shows me platform agnostic version.</em></p>
| <p>Here are a couple of versions of what you're looking for for some common JavaScript toolkits.</p>
<ul>
<li>Mootools - <a href="http://digitarald.de/project/fancyupload/" rel="noreferrer">http://digitarald.de/project/fancyupload/</a></li>
<li>Extjs - <a href="http://extjs.com/learn/Extension:UploadForm" rel="norefer... | <p>jQuery UI Progressbar - <a href="http://jqueryui.com/demos/progressbar/" rel="nofollow noreferrer">http://jqueryui.com/demos/progressbar/</a></p>
| 7,219 |
<p>I have a basic understanding of mock and fake objects, but I'm not sure I have a feeling about when/where to use mocking - especially as it would apply to this scenario <a href="https://stackoverflow.com/questions/37375/how-do-i-unit-test-a-wcf-service"><strong>here</strong></a>.</p>
| <p>A unit test should test a single codepath through a single method. When the execution of a method passes outside of that method, into another object, and back again, you have a dependency.</p>
<p>When you test that code path with the actual dependency, you are not unit testing; you are integration testing. While t... | <p>You should mock an object when you have a dependency in a unit of code you are trying to test that needs to be "just so". </p>
<p>For example, when you are trying to test some logic in your unit of code but you need to get something from another object and what is returned from this dependency might affect what yo... | 5,907 |
<p>When using Business Objects' CrystalReportViewer control, how can you detect and manually print the report the user has currently drilled into? You can print this automatically using the Print() method of the CrystalReportViewer, but I want to be able to do a manual printing of this report.</p>
<p>It is possible to... | <p>You are after a native SQL query.</p>
<p>If you are using JPA the syntax is:</p>
<pre><code>Query q = em.createNativeQuery("select foo.* from Foo foo " +
"where f.x = max(f.x) over " +
"(partition by f.y)", Foo.class);
</code></pre>
<p>If you need to r... | <p>Another approach would be to use the mapping. Please see this article: <a href="https://forums.hibernate.org/viewtopic.php?f=1&t=998482" rel="nofollow noreferrer">https://forums.hibernate.org/viewtopic.php?f=1&t=998482</a></p>
<p>I am against the usage of native SQL queries in Hibernate... you lose the bene... | 9,977 |
<p>This morning I ran into an issue with returning back a text string as result from a Web Service call. the Error I was getting is below</p>
<pre><code>************** Exception Text **************
System.ServiceModel.CommunicationException: Error in deserializing body of reply message for operation 'GetFilingTreeXML'... | <p>Try this blog post <a href="https://web.archive.org/web/20210128000850/http://geekswithblogs.net/niemguy/archive/2007/12/11/wcf-maxstringcontentlength-maxbuffersize-and-maxreceivedmessagesize.aspx" rel="nofollow noreferrer">here</a>. You can modify the MaxStringContentLength property in the Binding configuration.</... | <p><a href="http://joewirtley.blogspot.com/2007/08/maximum-string-content-length-and.html" rel="nofollow noreferrer">Jow Wirtley's blog post</a> pointed me in the right direction.</p>
<p>All I had to do was update the bindings in the app.config of the client app and it all works now.</p>
| 9,117 |
<p>Today I was listening to the <a href="http://www.hanselminutes.com/default.aspx?showID=145" rel="nofollow noreferrer">Hanselminutes show about .NET 3.5 SP1...What's inside</a>, and they twice mentioned the Office 2007-like Ribbon control that is included in Visual Studio 2008 Service Pack 1. </p>
<p>I am very inte... | <p>Yeah I did a double-take when I heard them say that too.</p>
<p>The ribbon control, along with a DatePicker and DataGrid, are being developed out of band <a href="http://www.codeplex.com/wpf" rel="nofollow noreferrer">over here</a> on CodePlex. I'm not sure why Carl and Scott were suggesting that it was part of the... | <p>A preview of the WPF Ribbon control was released last week, you can find <a href="http://www.codeplex.com/wpf/Wiki/View.aspx?title=WPF%20Ribbon%20Preview" rel="nofollow noreferrer">here</a></p>
| 5,404 |
<p>How should I describe this part which looks like a threaded flange so that I can research replacements? It is the gold piece in the middle of each photo. It is used to create a bed raiser in the FLSUN Cube 3D printer.</p>
<p><a href="https://i.stack.imgur.com/iNRcM.png" rel="noreferrer"><img src="https://i.stack.im... | <p>To the best of my knowledge, it's just called a <strong>lead screw nut</strong> or <strong>lead nut</strong>. The flange and holes for attaching it to a surface are inherent in its role in letting the lead screw move something.</p>
| <p>To the best of my knowledge, it's just called a <strong>lead screw nut</strong> or <strong>lead nut</strong>. The flange and holes for attaching it to a surface are inherent in its role in letting the lead screw move something.</p>
| 1,411 |
<p>I'm looking for a way to check within <code>pageLoad()</code> if this method is raised during load event because of a postback/async postback or because of being loaded and access the first time.</p>
<p>This is similar to <code>Page.IsPostback</code> property within code behind page.</p>
<p>TIA,
Ricky</p>
| <p>One way you could do that is to wire up an Application.Load handler in Application.Init, then have that handler unbind itself after running:</p>
<pre><code>Sys.Application.add_init(AppInit);
function AppInit() {
Sys.Application.add_load(RunOnce);
}
function RunOnce() {
// This will only happen once per GET re... | <p>You can still use Page.IsPostback during an async call.</p>
| 6,218 |
<p>I'm starting a new project here (Windows Forms). What's the best option today for a small (free as in beer) DBMS?</p>
<p>I've used SQL Server Express on the past projects, but time and time again I hear people saying that the product from Oracle is faster and more powerful.</p>
<p>It will be used in a small compan... | <p>I would go for the <strong>SQL Server Express</strong> solution, unless you absolutely have to use a feature in Oracle that SQL Server does not have and you have no usable workaround.</p>
<p>Example of Oracle's strengths: </p>
<ul>
<li>Analytical Functions in Oracle ROCK!</li>
<li><a href="http://en.wikipedia.org... | <p>Is this any use:</p>
<p><a href="https://web.archive.org/web/1/http://downloads.techrepublic%2ecom%2ecom/5138-9592-6028761.html" rel="nofollow noreferrer">https://web.archive.org/web/1/http://downloads.techrepublic%2ecom%2ecom/5138-9592-6028761.html</a></p>
<p>NB Registration is required</p>
| 3,115 |
<p>On my OS X box, the kernel is a 32-bit binary and yet it can run a 64-bit binary.
How does this work?</p>
<pre><code>cristi:~ diciu$ file ./a.out
./a.out: Mach-O 64-bit executable x86_64
cristi:~ diciu$ file /mach_kernel
/mach_kernel: Mach-O universal binary with 2 architectures
/mach_kernel (for architecture i386):... | <p>The CPU can be switched from 64 bit execution mode to 32 bit when it traps into kernel context, and a 32 bit kernel can still be constructed to understand the structures passed in from 64 bit user-space apps.</p>
<p>The MacOS X kernel does not directly dereference pointers from the user app anyway, as it resides it... | <p>For the kernel to be 64-bit would only bring the effective advantage that kernel extensions (i.e., typically drivers) could be 64-bit. In fact, you'd need to have either all 64-bit kernel extensions, or (as is the case now) all 32-bit ones; they need to be native to the architecture of the running kernel.</p>
| 7,255 |
<p>Experienced with Rails / ActiveRecord 2.1.1</p>
<ul>
<li>You create a first version with (for example) ruby script\generate scaffold product title:string description:text image_url:string</li>
<li>This create (for example) a migration file called 20080910122415_create_products.rb</li>
<li>You apply the migration wi... | <p>You should be able to use </p>
<pre><code>rake db:migrate:up
</code></pre>
<p>to force it to go forward, but then you risk missing interleaved migrations from other people on your team</p>
<p>if you run </p>
<pre><code>rake db:migrate
</code></pre>
<p>twice, it will reapply all your migrations.</p>
<p>I enco... | <p>This is not the expected behaviour. I was going to suggest reporting this as a bug on lighthouse, but I see you've <a href="http://rails.lighthouseapp.com/projects/8994/tickets/1021-rake-dbmigrate-doesnt-detect-new-migration" rel="nofollow noreferrer">already done so</a>! If you provide some more information (incl... | 9,568 |
<p>What is the difference between Build Solution and Batch Build in Visual Studio 2008?</p>
| <p>The key point which seems to be missed in both the existing answers is that batch build allows you to build <em>multiple configurations</em> of each project (e.g. you can build debug <em>and</em> release configurations with a single operation).</p>
<p>With a normal build, you have to use the configuration manager t... | <p>Building the solution is the same as batch building all projects. Both methods respect the solution's dependencies.</p>
| 5,421 |
<p>We are now using NHibernate to connect to different database base on where our software is installed. So I am porting many SQL Procedures to Oracle.</p>
<p>SQL Server has a nice function called DateDiff which takes a date part, startdate and enddate.</p>
<p>Date parts examples are day, week, month, year, etc. . .... | <p>I stole most of this from an old tom article a few years ago, fixed some bugs from the article and cleaned it up. The demarcation lines for datediff are calculated differently between oracle and MSSQL so you have to be careful with some examples floating around out there that don't properly account for MSSQL/Sybase... | <p>YOU Could write a function in oracle for this</p>
<pre><code>function datediff( p_what in varchar2, p_d1 in date, p_d2 in date) return number as l_result number;
BEGIN
select (p_d2-p_d1) *
decode( upper(p_what), 'SS', 24*60*60, 'MI', 24*60, 'HH', 24, NULL )
into l_result from... | 6,544 |
<p>I have a table of tags and want to get the highest count tags from the list.</p>
<p>Sample data looks like this</p>
<pre><code>id (1) tag ('night')
id (2) tag ('awesome')
id (3) tag ('night')
</code></pre>
<p>using</p>
<pre><code>SELECT COUNT(*), `Tag` from `images-tags`
GROUP BY `Tag`
</code></pre>
<p>gets me ... | <p>In all versions of MySQL, simply alias the aggregate in the SELECT list, and order by the alias:</p>
<pre><code>SELECT COUNT(id) AS theCount, `Tag` from `images-tags`
GROUP BY `Tag`
ORDER BY theCount DESC
LIMIT 20
</code></pre>
| <p>Try this query</p>
<pre><code> SELECT data_collector_id , count (data_collector_id ) as frequency
from rent_flats
where is_contact_person_landlord = 'True'
GROUP BY data_collector_id
ORDER BY count(data_collector_id) DESC
</code></pre>
| 4,765 |
<p>I need to implement version control, even for just the developing I do at home. I have read about how great subversion is for the past couple of years and was about to dedicate myself to learning this on the side until I heard about Git being the up and coming version control system.</p>
<p>Given the situation, sho... | <p>The most important thing about version control is:</p>
<p><em><strong>JUST START USING IT</strong></em></p>
<p>Not using version control is a horrible idea. If you are not using version control, stop reading right now and start using it.</p>
<p>It is very easy to convert from</p>
<pre><code>cvs<->svn<->g... | <p>Short answer: Subversion if you're the only one coding it or you're on site with everyone you work with. GIT if you're working with people in different sites and your code base is huge.</p>
<p>Subversion is really, really easy to setup and get using. It is also nice because you can do relatively complicated things ... | 2,477 |
<p>How do you expose a LINQ query as an ASMX web service?
<br>
Usually, from the business tier, I can return a typed <code>DataSet</code> or a <code>DataTable</code> which can be serialized for transport over ASMX.</p>
<p>How can I do the same for a LINQ query? <br>
Is there a way to populate a typed <code>DataSet</cod... | <p>As mentioned in the question, <code>IEnumerable</code> has a <code>CopyToDataTable</code> method:</p>
<pre><code>IEnumerable<DataRow> query =
from order in orders.AsEnumerable()
where order.Field<DateTime>("OrderDate") > new DateTime(2001, 8, 1)
select order;
// Create a table from the q... | <p>For the sake of completeness, these solutions do not work for EF Core (at least not for EF Core 2.2). Casting to <code>IEnumerable<DataRow></code>, as suggested in the other answers here, fails. Implementing this class and extension methods worked for me <a href="https://learn.microsoft.com/en-us/dotnet/framew... | 2,236 |
<p>If I've got a table containing Field1 and Field2 can I generate a new field in the select statement? For example, a normal query would be:</p>
<pre><code>SELECT Field1, Field2 FROM Table
</code></pre>
<p>And I want to also create Field3 and have that returned in the resultset... something along the lines of this ... | <pre><code>SELECT Field1, Field2, 'Value' Field3 FROM Table
</code></pre>
<p>or for clarity</p>
<pre><code>SELECT Field1, Field2, 'Value' AS Field3 FROM Table
</code></pre>
| <p>Yes - it's very possible, in fact you almost had it!
Try:</p>
<pre><code>SELECT Field1, Field2, 'Value' AS `Field3` FROM Table
</code></pre>
| 5,994 |
<p>I'm building a Django project that needs search functionality, and until there's a <code>django.contrib.search</code>, I have to choose a search app. So, which is the best? By "best" I mean...</p>
<ul>
<li>easy to install / set up</li>
<li>has a Django- or at least Python-friendly API</li>
<li>can perform reasonabl... | <p>Check out <a href="http://haystacksearch.org/" rel="noreferrer">Haystack Search</a> - a new model based search abstraction layer that currently supports <a href="http://xapian.org/" rel="noreferrer">Xapian</a>, <a href="http://lucene.apache.org/solr/" rel="noreferrer">Solr</a> and <a href="https://bitbucket.org/mcha... | <p>Thanks Joe,</p>
<p>We decided to go with Tsearch2 and a custom postgres adaptor. Tsearch2 does not need an extra process to run, which was convenient since we are on a WebFaction hosting with limited memory... It's not completely done yet, but seems to be a good solution...</p>
| 7,876 |
<p>Perl has OOP features, but they are somewhat rarely used. How do you create and use Perl objects with methods and properties?</p>
| <p>You should definitely take a look at <a href="http://search.cpan.org/perldoc?Moose" rel="noreferrer"><code>Moose</code></a>.</p>
<pre><code>package Point;
use Moose; # automatically turns on strict and warnings
has 'x' => (is => 'rw', isa => 'Int');
has 'y' => (is => 'rw', isa => 'Int');
sub cle... | <p>On one foot, each class is a package; you establish (multiple, if desired) inheritance by setting the package variable <a href="http://perldoc.perl.org/perltoot.html#Inheritance" rel="nofollow noreferrer">@ISA</a> (preferably at compile time); you create an object from an existing piece of data (often, but not alway... | 2,945 |
<p>What's the best way to deal with a sharded database in Rails? Should the sharding be handled at the application layer, the active record layer, the database driver layer, a proxy layer, or something else altogether? What are the pros and cons of each?</p>
| <p>FiveRuns have a gem named <a href="https://github.com/bpot/data_fabric" rel="nofollow noreferrer">DataFabric</a> that does application-level sharding and master/slave replication. It might be worth checking out.</p>
| <p>To my mind, the simplest way is maintain a 1:1 between rails instances and DB shards.</p>
| 6,583 |
<p>In a world where manual memory allocation and pointers still rule (Borland Delphi) I need a general solution for what I think is a general problem:</p>
<p>At a given moment an object can be referenced from multiple places (lists, other objects, ...). Is there a good way to keep track of all these references so that... | <p>If you want to notify others of changes you should implement the <a href="http://en.wikipedia.org/wiki/Observer_pattern" rel="nofollow noreferrer">"Observer Pattern"</a>. Delphi has already done that for you for TComponent descendants. You can call the TComponent.FreeNotification method and have your object be notif... | <p>Are you trying to keep track of who's referencing an object so you can clear those references when the object is destroyed, or are you trying to keep track of when it's safe to destroy the object?</p>
<p>If the latter then it sounds like you're looking for a garbage collector. I've never dealt with Delphi so I don... | 3,874 |
<p>As the title already states, I'm trying to declare a nested function and return a pointer to that function. I want this function 'not' to return a new function pointer which will return the negation of whatever the original function was.</p>
<p>Here is what I have:</p>
<pre><code>someType not( someType original ) ... | <p>Steve, you have a completely wrong mental model of what is a C function. </p>
<pre><code>someType resultFunc = calloc( 1024, 1 );
memcpy( resultFunc, &isNot, 1024 );
</code></pre>
<p>From your code fragment, I can surmise that you think that you can copy function's compiled code into a block of memory, and the... | <p>I'm using GCC.</p>
<p>You can turn on nested functions by using the flag:</p>
<pre><code>-fnested-functions
</code></pre>
<p>when you compile.</p>
| 6,174 |
<p>I'm currently working on creating a new C# project that needs to interact with an older C++ application. There is an error enumeration that already exists in the C++ app that I need to use in the C# app.</p>
<p><em>I don't want to just re declare the enumeration in C# because that could cause sync issues down the l... | <p>Check out the PInvoke Interop Assistant tool <a href="http://www.codeplex.com/clrinterop/Release/ProjectReleases.aspx?ReleaseId=14120" rel="noreferrer">http://www.codeplex.com/clrinterop/Release/ProjectReleases.aspx?ReleaseId=14120</a>. Its a useful tool for generating PInvoke signatures for native methods. </p>
... | <p>If you had declared the enum like:</p>
<pre><code>namespace blah
{
enum DEVICE_ERR_CODES
{
eDEVICEINT_ERR_FATAL = 0x10001,
eDEVICEINT_ERR_OTHER = 0x10002,
};
}</code></pre>
<p>and in another file:</p>
<pre><code>DEVICE_ERR_CODES eDeviceIntErrCodes;</code></pre>
<p>and named the enum f... | 3,931 |
<p>According to the instructions I have read, you use the same output on the printers mainboard to control a 110 V heated bed with a solid state relay, as you do to power the 12/24 V heated bed that comes with the printer. </p>
<p>The relay's datasheet states that its max input current is 25 mA, obvious... | <blockquote>
<p>How does Marlin know that the heated bed pins are controlling a relay now instead of a bed directly, and therefore should limit their current output?</p>
</blockquote>
<p>Marlin does not (need to) know this. Simply put, all Marlin does is switch on/off the <em>voltage</em> at the heated bed output. T... | <p>There are two current parameters which you are looking at in your instructions for the solid state relay. The first one (the 25mA) is for the <em>control</em> circuit. This is how much amperage the device itself will draw when in operation. The second is for the <em>load</em> circuit. This is the max amperage which ... | 1,505 |
<p>I'm looking for a good article on using emacs as C/C++ IDE.</p>
<p>Something like Steve Yegge's <a href="http://steve.yegge.googlepages.com/effective-emacs" rel="noreferrer">"Effective emacs"</a>.</p>
| <p>No specific article, really, but I've found <a href="http://www.emacswiki.org/cgi-bin/wiki" rel="noreferrer">EmacsWiki</a> to be full of useful information. Consider checking out these entries:</p>
<ul>
<li><a href="http://www.emacswiki.org/cgi-bin/wiki/CPlusPlus" rel="noreferrer">CPlusPlus</a> as a starting point ... | <p>I recommend <a href="https://github.com/leoliu/ggtags" rel="nofollow">ggtags</a> and <a href="https://github.com/Sarcasm/irony-mode" rel="nofollow">irony-mode</a>. Other then that you may want to use <a href="https://github.com/syohex/emacs-helm-ag" rel="nofollow">helm-ag</a> to search ("grep") for strings in your c... | 3,207 |
<p>What's the best and/or fastest method of doing multijoin queries in Django using the ORM and QuerySet API? </p>
| <p>If you are trying to join across tables linked by ForeignKeys or ManyToManyField relationships then you can use the double underscore syntax. For example if you have the following models:</p>
<pre><code>class Foo(models.Model):
name = models.CharField(max_length=255)
class FizzBuzz(models.Model):
bleh = mo... | <p>Caktus blog has an answer to this: <a href="http://www.caktusgroup.com/blog/2009/09/28/custom-joins-with-djangos-queryjoin/" rel="nofollow noreferrer">http://www.caktusgroup.com/blog/2009/09/28/custom-joins-with-djangos-queryjoin/</a></p>
<p>Basically there is a hidden QuerySet.query.join method that allows adding ... | 9,819 |
<p>I have a Monoprice Maker Select Plus (Wanhao Duplicator i3 clone) and I'm having issued with the top layer of my prints. The bottom surface and the sides always come out perfect but my top layer is left with gaps in it. I have tried adjusting the print temperature, flow rate, print speed and layer height all with no... | <p>This is probably caused by too few top layers in combination with a too low infill percentage. Increase skin layers and increase infill percentage.</p>
<p>If you have multiple layers already (at least about 4 for 0.2 mm layer height, for smaller layer heights even more), you might be printing at a too high temperatu... | <p>To combat the bad top layers, I usually use usually 5 top layers for any model of layer height 0.1 to 0.3 mm. I generally don't print with less than 9 % infill for PLA, which I have found sufficient to support even complex geometry on top.</p>
<p>Also, I generally use a mixed setup of layers: the outermost layers I ... | 1,813 |
<p>I have an old C library with a function that takes a void**:</p>
<pre><code>oldFunction(void** pStuff);
</code></pre>
<p>I'm trying to call this function from managed C++ (m_pStuff is a member of the parent ref class of type void*):</p>
<pre><code>oldFunction( static_cast<sqlite3**>( &m_pStuff ) );
</c... | <p>EDIT: Fixed answer, see below.</p>
<p>Really you need to know what oldFunction is going to be doing with pStuff. If pStuff is a pointer to some unmanaged data you can try wrapping the definition of m_pStuff with:</p>
<pre><code>#pragma unmanaged
void* m_pStuff
#pragma managed
</code></pre>
<p>This will make th... | <p>Thanks for the advice, the pointer is to an C style abstract structure which I think if I leave that structure exposed to the managed code is going to cause further pain due to its lack of defined structure. So what I think I will do is wrap the C library in C++ and then wrap the C++ wrapper with managed C++, which... | 4,672 |
<p>First of all, I'm still new to this 3D printing and I've bought myself a second hand Ender 3 with some mods done to it.</p>
<p>I've successfully printed with PLA in different colors but after a good first layer the print seems like it is skipping lines.</p>
<p>I've already tried to:</p>
<ul>
<li>Change the nozzle</l... | <p>Many questions on 3D Printing SE are answered, at least by me, not with a "this is the problem", but instead, this is how I would analyze it.</p>
<p>Looking at the picture you supplied, there is something strangely periodic about the under-extrusion in the top visible flat layer.</p>
<p>I don't think it is... | <p>I'd suggest running through basic maintenance. Check</p>
<ul>
<li>Is the nozzle clean/unblocked? If not clean it out</li>
<li>Is the nozzle worn? If so, replace it</li>
<li>Is the bowden tube okay in the hot end ? If not, replace, or at least shorten it.</li>
<li>Are your e-steps calibrated correctly?<br />
...... | 1,674 |
<p>How do I get ms-access to connect (through ODBC) to an ms-sql database as a different user than their Active Directory ID? </p>
<p>I don't want to specify an account in the ODBC connection, I want to do it on the ms-access side to hide it from my users. Doing it in the ODBC connection would put me right back in to ... | <p>I think you can get this to work the way you want it to if you use an <a href="http://www.carlprothman.net/Default.aspx?tabid=90#ODBCDriverForSQLServer" rel="noreferrer">"ODBC DSN-LESS connection"</a></p>
<p>If you need to, keep your ODBC DSN's on your users' machines using windows authentication. Give your users r... | <p>I think you'd have to launch the MS Access process under the account you want to use to connect. There are various tools that let you do this, such as <a href="http://www.joeware.net/freetools/tools/cpau/index.htm" rel="nofollow noreferrer">CPAU</a>. This tool will let you encrypt the password as well.</p>
| 7,357 |
<p>I am in the middle of a "discussion" with a colleague about the best way to implement the data layer in a new application.</p>
<p>One viewpoint is that the data layer should be aware of business objects (our own classes that represent an entity), and be able to work with that object natively. </p>
<p>The opposing... | <p>It really depends on your view of the world - I used to be in the uncoupled camp. The DAL was only there to supply data to the BAL - end of story.</p>
<p>With emerging technologies such as Linq to SQL and Entity Framework becoming a bit more popular, then the line between DAL and BAL have been blurred a bit. In L2S... | <p>One trick I've found handy is to have my data layer be "collection agnostic". That is, whenever I want to return a list of objects from my data layer, I get the caller to pass in the list. So instead of this:</p>
<pre><code>public IList<Foo> GetFoosById(int id) { ... }
</code></pre>
<p>I do this:</p>
<pre><... | 3,203 |
<p>Recently I have been getting some layer shifting starting at layer one. I have had layer shifting at higher layers due to various reasons but mainly for the belts being too loose. But now I am reading that layer shifting can also be caused by belts being too tight.</p>
<p>The <a href="https://reprap.org/wiki/Shifte... | <p>I think the RepRap wiki is using the word "binding", which translates to <em>"stick together or cause to stick together in a single mass"</em> (from Google dictionary), to indicate that some sort of friction is experienced (as you experience when things are sticking together).</p>
<p>When there is too much tension ... | <p>It is the bearings that are binding (dragging), due to lateral forces caused by over-tight belts. It may be the bearings in the stepper motors that are binding, but it is more likely to be the bearings in the idler pulleys.</p>
| 1,423 |
<p>How do you debug <strong>PHP</strong> scripts?</p>
<p>I am aware of basic debugging such as using the Error Reporting. The breakpoint debugging in <strong>PHPEclipse</strong> is also quite useful.</p>
<p>What is the <strong>best</strong> (in terms of fast and easy) way to debug in phpStorm or any other IDE?</p>
| <p>Try <a href="https://eclipse.org/pdt/" rel="noreferrer">Eclipse PDT</a> to setup an Eclipse environment that has debugging features like you mentioned. The ability to step into the code is a much better way to debug then the old method of var_dump and print at various points to see where your flow goes wrong. When a... | <p>+1 for print_r(). Use it to dump out the contents of an object or variable. To make it more readable, do it with a pre tag so you don't need to view source. </p>
<pre><code>echo '<pre>';
print_r($arrayOrObject);
</code></pre>
<p>Also var_dump($thing) - this is very useful to see the type of subthings</p>
| 2,332 |
<p>I'm a long-time emacs user, and I'm now working about 1/2 time in Java.</p>
<p>What are the best emacs libraries for</p>
<ol>
<li>Debugging Java</li>
<li>Code Completion/Intellisense</li>
<li>Javadoc browsing</li>
</ol>
<p>?</p>
| <p>I've used <a href="http://jdee.sourceforge.net/" rel="noreferrer">JDEE</a> on several projects. It handles Code Completion. I've never used it for debugging or browsing docs, but it's a big step up from a basic text editor.</p>
| <p>I've had good success with <a href="http://code.google.com/p/jdibug/" rel="nofollow noreferrer">jdibug</a> for debugging Java code with Emacs.</p>
| 6,236 |
<p>This is what I've got. It works. But, is there a simpler or better way?</p>
<p>One an ASPX page, I've got the download link...</p>
<pre><code><asp:HyperLink ID="HyperLinkDownload" runat="server" NavigateUrl="~/Download.aspx">Download as CSV file</asp:HyperLink>
</code></pre>
<p>And then I've got the D... | <p>CSV formatting has some gotchas. Have you asked yourself these questions:</p>
<ul>
<li>Does any of my data have embedded commas?</li>
<li>Does any of my data have embedded double-quotes?</li>
<li>Does any of my data have have newlines?</li>
<li>Do I need to support Unicode strings?</li>
</ul>
<p>I see several prob... | <p>I use the following method when building a CSV file from a DataTable. ControllerContext is just the reponse stream object where the file is written to. For you it is just going to be the Response object. </p>
<pre><code>public override void ExecuteResult(ControllerContext context)
{
StringBuilde... | 6,590 |
<p>I have a 3D printer that I built using CD-ROM drives. It's all set and ready to go but when I generate <code>.stl</code> or <code>.obj</code> files my G-code sender program cannot load it. I have found that Slic3r will export the <code>.stl</code> into G-code but it has the option of changing the <em>G-code flavour<... | <p>From what I understand, you're trying to partition your object into smaller pieces with the hopes of putting them back together in a manner similar to a Jigsaw puzzle.</p>
<p>There are two options that I know of to do this, which requires using OpenSCAD:</p>
<ul>
<li>The <a href="https://www.thingiverse.com/thing:... | <p>Sorry to put it that way, but does 3D printing the best "tool" for your case? </p>
<p>it seems you want to generate a huge flat file when a CnC would be the best to generate a clean and solid part.</p>
<p>Otherwise, as others suggets you are looking for a tooling tool.</p>
| 714 |
<p>How can I get precompiled headers working with GCC?</p>
<p>I have had no luck in my attempts and I haven't seen many good examples for how to set it up. I've tried on <a href="https://en.wikipedia.org/wiki/Cygwin" rel="nofollow noreferrer">Cygwin</a> GCC 3.4.4 and using 4.0 on <a href="https://en.wikipedia.org/wiki... | <p><a href="http://gcc.gnu.org/onlinedocs/gcc/Precompiled-Headers.html" rel="noreferrer">Firstly, see the documentation here</a>.</p>
<p>You compile headers just like any other file but you put the output inside a file with a suffix of <code>.gch</code>. </p>
<p>So for example if you precompile stdafx.h you will hav... | <p>A subtle tip about the file extension that tripped me up, because I wasn't paying close enough attention: the <code>.gch</code> extension is added to the precompiled file's full name; it doesn't replace <code>.h</code>. If you get it wrong, the compiler won't find it and silently does not work.</p>
<p>precomp.h =&g... | 8,329 |
<p>Has anyone ever integrated an external web application with Siebel On-Premise CRM? Note that I'm not talking about Siebel On-Demand SaaS, but their behind-the-firewall product. Specifically, I'm trying to achieve two-way synchronization of CRM objects (contacts, accounts, sales opportunities) between my web appli... | <p>Siebel On-Premise offers a wealth of integration options. Start with Siebel Bookshelf and specifically Integration Platform Technologies: Siebel Enterprise Application Integration.</p>
<p>For your more static data, have a look at MDM. In this case refer to Siebel Master Data Applications Reference for Industry Appl... | <p>Worked on a couple of Siebel projects for my sins. Standard ways to interface include:
- Web Services (which I think MoMo was referring to) - you'll need to check with the Siebel app team to see if this is / can be turned on; also, the vanilla services might need to be modified to reflect any modifications to the Si... | 9,723 |
<p>I am trying to implement NTLM authentication on one of our internal sites and everything is working. The one piece of the puzzle I do not have is how to take the information from NTLM and authenticate with Active Directory.</p>
<p>There is a <a href="http://www.innovation.ch/personal/ronald/ntlm.html" rel="nofollow... | <p>What you're really asking is: Is there any way to validate the "WWW-Authenticate: NTLM" tokens submitted by IE and other HTTP clients when doing Single Sign-On (SSO). SSO is when the user enters their password a "single" time when they do Ctrl-Alt-Del and the workstation remembers and uses it as necessary to transpa... | <p>Hm, I'm not sure what you're trying to accomplish.</p>
<p>Usually implementing NTLM on an internal site is as simple as unchecking "Enable Anonymous Access" in "Authentication and Access Control" in the "Directory Security" tab of website properties in IIS. If that is cleared, then your web application users will s... | 4,212 |
<p>I'm looking for a light version of REST for a Java web application I'm developing. </p>
<p>I've looked at RESTlet (www.restlet.org) and the REST plugin for Struts 2, but I haven't made up my mind. I'm leaning towards RESTlet, as it seems to be lighter.</p>
<p>Has anyone implemented a RESTful layer without any of t... | <p>I'm a huge fan of JAX-RS - I think they've done a great job with that specification. I use it on a number of projects and its been a joy to work with. </p>
<p>JAX-RS lets you create REST resources using POJOs with simple annotations dealing with the URI mappings, HTTP methods and content negotiation all integrated ... | <p>I am working on a REST API for <a href="http://www.gliffy.com" rel="nofollow noreferrer">gliffy.com</a> and we ended up rolling our own. We didn't want to have to bring in Struts 2, Spring, or any other framework. I looked at RESTLet and found it incredibly confusing and over complicated.</p>
<p>Apache has an imp... | 9,184 |
<p>Basically what I want to do it this: a pdb file contains a location of source files (e.g. <code>C:\dev\proj1\helloworld.cs</code>). Is it possible to modify that pdb file so that it contains a different location (e.g. <code>\more\differenter\location\proj1\helloworld.cs</code>)?</p>
| <p>You can use the source indexing feature of the Debugging Tools for Windows, which will save references to the appropriate revisions of the files in your source repository as an alternate stream in the PDB file.</p>
| <p>It is certainly possible, as On Freund has already pointed out.
But if it is only so that the sources can be located and loaded during debugging, then a better way would be to set the source path correspondingly. Once set in a debugger, it will preemt all hard coded paths inside PDBs.</p>
<p>
In windbg (for instanc... | 4,763 |
<p>So I just got my first 3D printer the Ender 3 Pro. My nozzle is a bit too high (first image) and this is what happened after my first test print (second image).</p>
<p>I saved for a while to buy this and I’m really upset about this.</p>
<p><a href="https://i.stack.imgur.com/x1wNg.jpg" rel="nofollow noreferrer" title... | <p>Your Z-endstop assembly is clearly too high. Referring to your own first foto you see that the switch on the Z-endstop mount is nearly touching the bottom of the X-Z mounting.</p>
<p><a href="https://i.stack.imgur.com/GUPv9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GUPv9.png" alt="enter imag... | <p>Flash the firmware. If that doesn't fix it then you have a defective printer assuming everything else in your question and comments is correct.</p>
| 2,106 |
<p>The <a href="http://msdn.microsoft.com/en-us/library/kx145dw2.aspx" rel="noreferrer">ClientScriptManager.RegisterClientScriptInclude</a> method allows you to register a JavaScript reference with the Page object (checking for duplicates).</p>
<p>Is there an equivalent of this method for CSS references?</p>
<p>Simil... | <p>Short answer: no. You could certainly roll your own functions (as CMPalmer suggests) to take CSS embedded resources (as Gulzar suggests) and embed them on the page.</p>
<p>As a best-practice matter, though, I'm not sure why you would want to do this. If you're making a reusable control that has a lot of CSS styling... | <p>One more thought: You might want to consider "namespacing" your class names to avoid collisions with common class names that your consumers might already be using. E.g.</p>
<pre><code><div class="SmillerControls_Toolbar">
<a class="SmillerControls_Button" ...>...</a>
...
</div>
</cod... | 7,825 |
<p>I have a Prusa i3 that I am mostly happy with. However, I am seeing these strange artifacts when the extruder moves along one axis in one direction - in particular from the back of the printer towards the front. The extruded lines look uneven and the surface is quite rough, but only in that area and only while the e... | <p>In case of such difference in printing in different directions you can check if;</p>
<ol>
<li>for x and partially z axis
<ul>
<li>filament is blocked and cannot be pulled as it should</li>
<li>spool is blocked</li>
</ul></li>
<li>for x and y axis
<ul>
<li>rods on which caret/HB is sliding are parallel</li>
<li>ti... | <p>In my case, there were some artifacts only on the right side, and the problem was that the screw was partly out of the pulley under the bed. I would suggest moving the bed to the back and checking the pulley. You might also consider <a href="https://help.prusa3d.com/en/guide/maintenance-tips_23200" rel="nofollow nor... | 283 |
<p>I'm having trouble getting my MendelMax 2's heatbed <em>not</em> to heat up when I want to print without it. I don't get how multiple sources of control relate to each other (same with extrusion temperatures, actually):</p>
<ul>
<li><p>Slic3r (1.2.9) has settings under Filament Settings / Filament / Bed, for First ... | <p>3D printer get the temperature settings from g-code file. The firmware settings for min and max temperature are just safeguards.</p>
<p>You should verify instructions within the g-code file. If you are not familiar with g-code, take a look to <a href="https://en.wikipedia.org/wiki/G-code" rel="noreferrer">wikipedia... | <p>Sli3er will control the bed temperature during a print. The options in Pronterface can be used to pre-heat the bed and hot end, or to adjust the temperature during a print. </p>
<p>The slicer will put the temperatures you set in the filament tab settings into the gcode at the appropriate layers. As the printer read... | 204 |
<p>I am using PLA and I am looking for ideas on using the <code>Tune</code> option to tune my Prusa i3 MK3 to increase the speed to 300 %.</p>
<p>The 300 % speed works perfectly fine for some of the models.</p>
<p>However, for some of the flat surfaces, the printer cannot handle the speed. The issues are pointed in the... | <p>extruder clicking means you're getting backed up, grinding.</p>
<ul>
<li>Make the hotend hotter so you can melt filament 3X faster than expected; most materials have quite a range; aim high.</li>
<li>Slow down the cooling fan; a lot of them can cool the hotend.</li>
<li>You have a silicone boot on the nozzle? that w... | <p>Changing "Flow" will affect whole print. So even if it helped for the middle part (I doubt), the next it would ruin the print on sides by overextrusion. However: <strong>if sides are printed ok, then why the middle couldn't?</strong> Because walls are printed slower? Indeed, the under-extrusion may quickly... | 1,840 |
<p>I work for a company whose primary business is not software related. Most documentation for using source control is written with a development team writing for commercial or open source projects in mind. As someone who writes in house software I can say that work is done differently then it would be in a commercial ... | <p>Setting up SVN repositories can be tricky only in the sense of how you organize them. Before we setup SVN, I actually RTFM'd the online <a href="http://svnbook.red-bean.com/" rel="nofollow noreferrer">Subversion manual</a> which discusses organizational techniques for repositories and some of the gotchas you should... | <p>As specified in <a href="https://stackoverflow.com/questions/49601/is-there-a-barebones-windows-version-control-system-thats-suitable-for-only-one#49722">this thread</a>, distributed VCSs (git, Mercurial) are a better model than centralized ones, due to branch creation ease, branch merging ease, no need to setup a s... | 7,421 |
<p>I'm using a Monoprice Maker Select v2 (a Monoprice-branded Wanhao i3 duplicator) and would like to calibrate temperature readings for my hotend.</p>
<p>I used a thermal probe on my multimeter to determine the hotend is running about 5 degrees C above it's reported temperature (setting it to 200 degrees reads 205 on... | <p>Unless you are using a calibrated temperature sensor, it is a question what the temperature will be. </p>
<p>Actually it doesn't really matter what the temperature exactly is, you just need to find the sweet spot for your filaments on your machine. With respect to reported temperatures by others, your settings may ... | <p>Temperature from thermosensors gets collected as a resistance value that changes with temperature. The chip in your board decides the temperature from this value based on a temperature-resistance table.</p>
<p>If you are using Marlin Firmware, the setting which table is referenced by your machine to get its values ... | 1,125 |
<p><br />
I need to send MMS thought a C# application. I have already found 2 interesting components:
<a href="http://www.winwap.com" rel="nofollow noreferrer">http://www.winwap.com</a><br />
<a href="http://www.nowsms.com" rel="nofollow noreferrer">http://www.nowsms.com</a></p>
<p>Does anyone have experience with oth... | <p>Typically I have always done this using a 3rd party aggregator. The messages are compiled into SMIL, which is the description language for the MMS messages. These are then sent on to the aggregator who will then send them through the MMS gateway of the Network Operator. They are typically charged on a per message... | <p>You could use Twilio to accomplish this. You can <a href="https://www.twilio.com/docs/quickstart/csharp/sms/sending-via-rest" rel="nofollow">dive into the docs</a> for specific implementation details but using the <a href="https://www.twilio.com/docs/csharp/install" rel="nofollow">C# helper library</a> the code to s... | 7,769 |
<p>I am building a 3D printer from scratch, the bed will only move on Z and the head will stay at the top of the printer and move X and Y.</p>
<p>How do I modify the Marlin firmware to have the bed lower as it prints instead of lift like most printers.</p>
| <p>You can control in Marlin what the direction of the stepper motor is, e.g. my Hypercube CoreXY printer (which has a similar setup like you described) has the following set (in the Marlin <a href="https://github.com/MarlinFirmware/Marlin/blob/2.0.x/Marlin/Configuration.h" rel="nofollow noreferrer"><code>Configuration... | <p>To understand normal commands from a basic printer slicer, all movement commands in g-code are written to be away from the base layer as positive. Note that <em>technically</em> a "lower the bed" printer does violate Orthonormal coordinates unless you either swap X and Y while retaining 0 in the front-left... | 1,886 |
<p>This should hopefully be a simple one.</p>
<p>I would like to add an extension method to the System.Web.Mvc.ViewPage< T > class.</p>
<p>How should this extension method look?</p>
<p>My first intuitive thought is something like this:</p>
<pre><code>namespace System.Web.Mvc
{
public static class ViewPageExt... | <p>I don't have VS installed on my current machine, but I think the syntax would be:</p>
<pre><code>namespace System.Web.Mvc
{
public static class ViewPageExtensions
{
public static string GetDefaultPageTitle<T>(this ViewPage<T> v)
{
return "";
}
}
}
</code><... | <p>If you want the extension to only be available for the specified type
you simply just need to specify the actual type you will be handling</p>
<p>something like...</p>
<pre><code>public static string GetDefaultPageTitle(this ViewPage<YourSpecificType> v)
{
...
}
</code></pre>
<p>Note intellisense will the... | 9,430 |
<p>I am familiar with nunit for unit testing of the business layer however I am looking now to automate the test of the win forms gui layer. </p>
<p>I have seen <a href="http://watin.sourceforge.net/" rel="noreferrer">watin</a> and the watin recorder for automating tests on web application by accessing the controls a... | <p>Check out <a href="http://www.codeplex.com/white" rel="noreferrer">http://www.codeplex.com/white</a> and <a href="http://nunitforms.sourceforge.net/" rel="noreferrer">http://nunitforms.sourceforge.net/</a>. We've used the White project with success.</p>
<p><em>Same Answer to a previous question</em></p>
<p><strong... | <p>You may also use Winium(<a href="https://github.com/2gis/Winium" rel="nofollow noreferrer">https://github.com/2gis/Winium</a>) that works on multiple Windows platform besides Windows 10 and is similar to Selenium with extra features that support controlling the application remotely.</p>
| 4,498 |
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="https://stackoverflow.com/questions/361635/debugging-javascript-in-ie7">Debugging JavaScript in IE7</a> </p>
</blockquote>
<p>Firefox has Web Developer plugin and Firebug for troubleshooting html/css/javascript issues. Google Chrome and Safari ha... | <p>Yes - The Internet Explorer Developer Toolbar</p>
<p><a href="http://www.microsoft.com/downloads/en/details.aspx?familyid=95E06CBE-4940-4218-B75D-B8856FCED535&displaylang=en" rel="noreferrer">Download details: Internet Explorer Developer Toolbar</a></p>
| <p>Actually, the best add-on for developers to IE would be <a href="http://www.fiddlertool.com/fiddler/version.asp" rel="nofollow noreferrer">Fiddler</a>. It has a number of features that the other browsers possess.</p>
| 8,057 |
<p>I'm trying to rebuild an old metronome application that was originally written using MFC in C++ to be written in .NET using C#. One of the issues I'm running into is getting the timer to "tick" accurately enough.</p>
<p>For example, assuming an easy BPM (beats per minute) of 120, the timer should tick every .5 sec... | <p>There are three timer classes called 'Timer' in .NET. It sounds like you're using the Windows Forms one, but actually you might find the System.Threading.Timer class more useful - but be careful because it calls back on a pool thread, so you can't directly interact with your form from the callback.</p>
<p>Another... | <p>Timer classes can start behaving strangely when the timer 'tick' event code is not finished executing by the time the next 'tick' occurs. One way to combat this is to disable the timer at the beginning of the tick event, then re-enable it at the end.</p>
<p>However, this approach is not suitable in cases where the ... | 3,023 |
<p>I am interested in doing development on Cura. Initially I want to start with the UI rather than the Engine. I have found the <a href="https://github.com/Ultimaker/Cura" rel="nofollow noreferrer">repository</a> and have cloned it to my PC. I have also looked over the <a href="https://github.com/Ultimaker/Cura/wiki... | <p>As you are an experienced developer, these links should help:</p>
<p>This is a related question, but for Ubuntu <a href="https://3dprinting.stackexchange.com/questions/1309/how-to-build-curaengine">How to build CuraEngine?</a></p>
<p>Wikipedia has an informative page on <a href="https://en.wikipedia.org/wiki/Cura_... | <p>As you are an experienced developer, these links should help:</p>
<p>This is a related question, but for Ubuntu <a href="https://3dprinting.stackexchange.com/questions/1309/how-to-build-curaengine">How to build CuraEngine?</a></p>
<p>Wikipedia has an informative page on <a href="https://en.wikipedia.org/wiki/Cura_... | 603 |
<p>I want a user-privileged (not root) process to launch new processes as user <code>nobody</code>. I've tried a straight call to <code>setuid</code> that fails with -1 <code>EPERM</code> on <code>Ubuntu 8.04</code>:</p>
<pre><code>#include <sys/types.h>
#include <unistd.h>
int main() {
setuid(655... | <p>You <em>will</em> require assistance and a lot of trust from your system administrator. Ordinary users are not able to run the executable of their choice on behalf on other users, period.</p>
<p>She may add your application to <code>/etc/sudoers</code> with proper settings and you'll be able to run it as with <cod... | <p><a href="http://www.keltia.net/programs/calife/" rel="nofollow noreferrer"><code>calife</code></a> is an alternative to <code>sudo</code>.</p>
<blockquote>
<p>Calife is small program that enable a UNIX system administrator to become root (or another user) on his/her machines without giving the root password but h... | 9,240 |
<p>So I've been using InstantRails to check out Ruby on rails. I've been using Notepad++ for the editing. Now I don't want to install Ruby or Rails on my machine. Is there any walk through/tutorial on how to integrate Radrails or Netbeans with InstantRails? </p>
| <p>Here's a tutorial: <a href="http://ruby.meetup.com/73/boards/view/viewthread?thread=2203432" rel="nofollow noreferrer">http://ruby.meetup.com/73/boards/view/viewthread?thread=2203432</a><br>
(I don't know if it's any good.)</p>
<p>And here's one with InstantRails+Netbeans: <a href="https://web.archive.org/web/20100... | <p>I recommend learning Rails and Ruby itself first, and then picking up something like InstantRails. Having too many layers when learning something new can make it hard to know what features are part of which language, and potentially confuse you when trying to determine where a bug is occurring.</p>
| 5,832 |
<p>How should I store (and present) the text on a website intended for worldwide use, with several languages? The content is mostly in the form of 500+ word articles, although I will need to translate tiny snippets of text on each page too (such as "print this article" or "back to menu").</p>
<p>I know there are sever... | <p>Firstly put all code for all languages under one domain - it will help your google-rank.</p>
<p>We have a fully multi-lingual system, with localisations stored in a database but cached with the web application.</p>
<p>Wherever we want a localisation to appear we use:</p>
<pre><code><%$ Resources: LanguageProvi... | <p>If you're just worried about the article content being translated, and do not need a fully integrated option, I have used <a href="http://www.google.com/language_tools" rel="nofollow noreferrer">google translation</a> in the past and it works great on a smaller scale.</p>
| 9,802 |
<p>I've noticed that Visual Studio 2008 is placing square brackets around column names in sql. Do the brackets offer any advantage? When I hand code T-SQL I've never bothered with them.</p>
<p>Example:</p>
<p>Visual Studio:</p>
<pre><code>SELECT [column1], [column2] etc...
</code></pre>
<p>My own way:</p>
<pre><co... | <p>The brackets are required if you use keywords or special chars in the column names or identifiers. You could name a column <code>[First Name]</code> (with a space) – but then you'd need to use brackets every time you referred to that column.</p>
<p>The newer tools add them everywhere just in case or for consistency.... | <p>I believe it adds them there for consistency... they're only required when you have a space or special character in the column name, but it's cleaner to just include them all the time when the IDE generates SQL.</p>
| 7,624 |
<p>Got my Ender 3 v2 and stack with the bed leveling.</p>
<p>Used default settings, Creality slicer 4.2, test PLA from the kit and print model <a href="https://www.thingiverse.com/thing:3013319" rel="nofollow noreferrer">https://www.thingiverse.com/thing:3013319</a> (4 squares in each corner and 1 in the middle), nozzl... | <p>The gaps are, because the nozzle is to far from the bed at this point. It may sound like a big deal, but actually this is not leveling alone, but it looks like the bed is not a perfect plane/perfectly flat. This is normal, my ikea mirror and my stock bed show the same thing. Now here's one solution:</p>
<p>Print cal... | <p>I had exact same issues with my Ender 3 v2. Using the stock default glass the middle would be too far out and I was never able to level it just right - no matter what I did - I could have stayed on it for hours.</p>
<p>In matter of fact, it wasn't just the middle, it was the middle between each of the corner points ... | 1,709 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.