instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>I am on the hunt for CAD packages which can perform some level of slicing as an inherent model feature, instead of either exporting to STL and then importing into the slicer (a la OnShape) or directly opening the slicer from within the software (a la Fusion 360). I would like this because I want to model directly fo... | <p>Blender has a CNC slicer plugin, it's not exactly what you're asking for but it can perform some of the tasks that you're asking for.</p>
<p><a href="https://sourceforge.net/projects/cnc-slicer-blender-plugin/" rel="nofollow noreferrer">CNC slicer for Blender</a></p>
| <p>Microsoft 3d builder will do it. It's far from the best CAD or Printing software though. Works very well for what it is.</p>
| 2,172 |
<p>I have an ext combobox which uses a store to suggest values to a user as they type. </p>
<p>An example of which can be found here: <a href="http://extjs.com/deploy/ext/examples/form/combos.html" rel="nofollow noreferrer">combobox example</a></p>
<p>Is there a way of making it so the <strong>suggested text list</st... | <p>You can use plugin for this, since you can call or even override private methods from within the plugin:</p>
<pre><code>var suggested_text_plugin = {
init: function(o) {
o.onTypeAhead = function() {
// Original code from the sources goes here:
if(this.store.getCount() > 0){... | <p>So clarify, you want the selected text to render somewhere besides directly below the text input. Correct?</p>
<p>ComboBox is just a composite of <a href="http://extjs.com/deploy/dev/docs/?class=Ext.DataView" rel="nofollow noreferrer">Ext.DataView</a>, a text input, and an optional trigger button. There isn't an of... | 9,993 |
<p>I am new here and would like to work on a project to 3D print a precision prototype. What is the most affordable way to do it? How do I go about it?</p>
| <p>[The question ask asked is vague, but since you are new it is understandable.]</p>
<p>If you want to build a precision prototype then you have to decide on the level of precision that is necessary. There are different types of 3D printers and services available which give various levels of precision and functionali... | <p>These two videos seem to give a good, general, entry-level introduction to the various technologies and processes that are involved in 3D printing:</p>
<ul>
<li><a href="https://www.youtube.com/watch?v=3LBTkLsjHGQ" rel="nofollow noreferrer">The Ultimate Beginner's Guide to 3D Printing - Part 1</a></li>
<li><a href=... | 1,245 |
<p>When I print with a 0.4 mm nozzle I have no problem with stringing at all but because I need a more detailed print I must use a 0.25 mm nozzle.</p>
<p>I use Ultimaker Cura and an Anycubic i3 Mega.</p>
<p>What i tried so far:</p>
<ul>
<li>Enable/Disable Z hop</li>
<li>Tried different retraction distance... | <p>First, you should change the <strong>nozzle diameter</strong> setting, not just the line width setting, in Cura. Both are involved in determining extrusion. Line width can be less than or greater than nozzle size, but setting it much larger or smaller is not going to work well.</p>
<p>I suspect your main problem, t... | <p>What worked well for me in avoiding stringing is to increase the travel move speeds significantly, disable Z-hop and to decrease printing temperature</p>
| 1,344 |
<p>Is there any other way to get a list of file names via <code>T-SQL</code> other than </p>
<pre><code>INSERT INTO @backups(filename)
EXEC master.sys.xp_cmdshell 'DIR /b c:\some folder with sql backups in it
</code></pre>
<p>I am attempting to get a list of SQL backup files from a folder to restore and I do NOT want... | <p>If you have access to the <em>server that backup up the files</em>, you can use the system tables to find the backup file(s) you prefer.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms188062.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms188062.aspx</a></p>
<p>You'll be intere... | <p>If you have access to the <em>server that backup up the files</em>, you can use the system tables to find the backup file(s) you prefer.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms188062.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms188062.aspx</a></p>
<p>You'll be intere... | 36,663 |
<p>Which of these will heat a bed fastest?</p>
<ul>
<li><p>A. 12 V, 10 A power supply</p></li>
<li><p>B. 24 V, 5 A power supply</p></li>
<li><p>C. Both A and B will be the same (only total watts matter)</p></li>
<li><p>D. Depends on the situation</p></li>
</ul>
<p>I originally thought Amperage was... | <p>It depends on whether you are re-using the bed or not, it is actually the resistance of the bed that determines this in conjunction with the voltage (the current you get for free).</p>
<p>Let's say that the heatbed resistance is 1.2 Ω (depending on the heated bed make and model the resistance is typically ... | <p>Bed heaters look like this <a href="https://i.stack.imgur.com/A9Gqn.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A9Gqn.jpg" alt="enter image description here"></a></p>
<p>They are rated for use with 12V or 24V supplies. 12V supply would take longer to warm it up, as P = V^2/R. Say it was a 2... | 1,473 |
<p>I am starting to design a new application and what I am wondering is peoples opinions on Linq2SQL or Linq2Entities and what they feel is the better technology for rapid development.</p>
<p>I am also doing some research into ADO.net data services.</p>
| <p>I'm a big fan of LINQ to SQL if you meet the following design requirements:</p>
<ul>
<li>MS SQL Server as the DB engine</li>
<li>RAD development</li>
<li>1 - 1 class mapping is all that's required</li>
</ul>
<p>I've not done a whole lot of work with Entity Framework but from what I know and what I have done is tha... | <p>Linq to SQL is a dead end these days because Microsoft is not going to update it anymore. I used it for a little while for my own projects, but I found it underpowered in comparison to real SQL. Of course it might seem easier to run in the short run, but over the course of your application's development cycle you wi... | 47,614 |
<p>I'm a software engineer, not a lawyer, and my university doesn't offer any courses geared toward licensing software. In fact, their law-related courses are lacking (but slowly growing in number). Where can I go to learn about open-source licenses and how to choose them?</p>
| <p>There are lots described here:
<a href="http://www.gnu.org/licenses/license-list.html#SoftwareLicenses" rel="noreferrer">http://www.gnu.org/licenses/license-list.html#SoftwareLicenses</a></p>
<p>The decision of which one to use can be political, but should ultimately be determined by your plans/desires for the sof... | <p>We had a similar dilemma. At our company we decided invest lots of time on a framework, with the eventual hope of releasing it to the open source community. The business is built using open source tools (apache, php, etc.), it was time to give back. We decided on an LGPL/MPL dual license. That way, we could inco... | 6,330 |
<p>How can I implement the "tap and hold" behavior in an MFC CListCtrl?</p>
<p>I have an MFC CListCtrl in a CDialog and I need to add to the CListCtrl the "tap and hold" behavior.</p>
<p>That is what I mean for "tap and hold":</p>
<p>If the user clicks (a "standard" click with the left button of the mouse) on a CLis... | <p>Inherit CListCtrl and implement OnLButtonDown and OnLButtonUp. Set a timer in OnLButtonDown for the length you want to wait before doing a "tab and hold." </p>
<p>In your timer handler, perform the "tap and hold" action.</p>
<p>If you get OnLButtonUp before the timer expires, cancel the timer and perform the "cli... | <p>Here is another approach without timers <a href="http://www.codeproject.com/KB/mobile/tapandhold.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/mobile/tapandhold.aspx</a>.</p>
| 26,893 |
<p>I need to plan a voyage connecting n locations in the sea with a specified origin and specified destination with following constraints.<br />
The voyage has to touch all locations.<br />
If there is a reservation from A to B then a has to be touched before B <br />
The time spend at each location varies (depends upo... | <p>See <a href="http://en.wikipedia.org/wiki/Travelling_salesman_problem" rel="nofollow noreferrer">Traveling salesman problem</a></p>
| <p>There is a lot of work on this problem. It goes by different names</p>
<ol>
<li>traveling salesman (vehicle routing) problem with time windows and precedence constraints.</li>
<li>Pick-up and delivery problem.</li>
</ol>
<p>There is a host of research on this problem, a lot of it in the Operations Research <a hre... | 30,029 |
<p>I've been trying to trace down why I have 100% iowait on my box. If I do something like a mysql select query, system goes to 100% iowait (on more than one cpu on my server,) which kills my watchdogs and sometimes kills httpd itself. </p>
<p>In vmstat I see that every 8 seconds or so, there's a 5MB disk write. And t... | <p>Use <A HREF="http://guichaz.free.fr/iotop/" rel="noreferrer"><code>iotop</code></A>.</p>
| <p>OK, possible diagnosis steps (for posterity):</p>
<ol>
<li><p>Have you confirmed that you're not actually running out of virtual memory and therefore swapping processes out to disk?</p></li>
<li><p>If it's not the kernel swapping, you may be able to use <code>strace</code> (as you don't have <code>dtrace</code>) to... | 32,123 |
<p>Currently I am <a href="http://msdn.microsoft.com/en-us/magazine/cc163696.aspx" rel="noreferrer">borrowing <code>java.math.BigInteger</code> from the J# libraries as described here</a>. Having never used a library for working with large integers before, this seems slow, on the order of 10 times slower, even for <cod... | <p>As of .NET 4.0 you can use the System.Numerics.BigInteger class. See documentation here: <a href="http://msdn.microsoft.com/en-us/library/system.numerics.biginteger(v=vs.110).aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/system.numerics.biginteger(v=vs.110).aspx</a></p>
<p>Another alternative is t... | <p>This won't help you, but there was supposed to be a BigInteger class in .Net 3.5; it got cut, but from statements made at PDC, it will be in .Net 4.0. They apparently have spent a lot of time optimizing it, so the performance should be much better than what you're getting now.</p>
<p>Further, this question is essen... | 21,290 |
<p>I'm trying to see data in my OLAP cube by ascmd utility. As input I put a MDX query, but only what I have as output (in command line) is a XML file. I tried to use -Tf text and -Tf csv parameters, but they don't work in the way I think they should (I have a XML on output all the time). I want to have on my output so... | <p>I believe that the -Tf is the format for capturing trace output, not query results. </p>
<p>You could log this as a request in the Issue Tracker on the <a href="http://www.codeplex.com/MSFTASProdSamples" rel="nofollow noreferrer">ascmd site</a>. Another possible work around would be to configure a linked server on ... | <p>Indeed ascmd utility doesn't provide table output. I think it's because MDX queries can create multidimensional outputs (like pivot-tables, where there are many elements and hierarchies on rows and on columns). If you need the ability to create output in CSV format, try creating static method which transform XMLA to... | 35,954 |
<p>I have some problems with Miktex installed on Windows Vista Business SP1/32 bit. I use miktex 2.7, ghostscript, and texniccenter 1 beta 7.50. When I compile a document with the following profiles: Latex=>DVI, Latex=>PDF everything works fine; the system crashes when I compile with profiles Latex=>PS and Latex=>PS=>P... | <p>If everything you need is images, you could still compile directly to PDF. You only need to have an image in PNG or JPG format, and use the following code:</p>
<pre><code>%in the document preamble
\usepackage{graphicx}
%in the document, in the place where you want to put your image
\includegraphics{image_filename_... | <p>Thanks for reply. I have solved the problem: the dvi crashed because I have installed Miktex with the User Account Control enabled. I have disabled it, reinstalled and now it's working (with UAC still disabled). </p>
| 13,659 |
<p>Can an ArrayList of Node contain a non-Node type? </p>
<p>Is there a very dirty method of doing this with type casting?</p>
| <p>Yes, but you will get class cast exceptions if you try to access a non-node element as if it were a node. Generics are discarded at (for) runtime.</p>
<p>For example:</p>
<pre><code>import java.util.*;
import java.awt.Rectangle;
public class test {
public static void main(String args[]) {
List<Rect... | <p>Assuming you are using Generic to have an ArrayList, you can add non-Node into it by using reflection because during runtime the type information is not kept.</p>
<p>Depend on how you get the object out of the ArrayList, you might get hit by ClassCastException.</p>
<p>If you really have a need on non-specific type... | 25,378 |
<p>I have a pretty much default installation on mysql on Windows 2003. I am rebuilding some indexes and the process only seems to use 3-20% of the CPU.</p>
<p>Is there a way to allow it to use more and speed up the process?</p>
| <p>This applies to every application/process, not only mysql. If your database is using 3-20% CPU and the final performance is still unacceptable it means that you don't lack processor power, since it is most of the time idle. What is most probable is your bottleneck is at your HDD or HDD-controller level. Have you tes... | <p>Can you mount a ramdisk, and move your database tables to that instead? You'll need lots of RAM, but if your DB is only a few hundred MB, then you'd be skipping the heavy disk IO. Obviously, you'd want to be working from backups in case the power went out...</p>
| 35,665 |
<p>I have a simple business workflow with the following conditions</p>
<ol>
<li>Users need to change the workflow itself using a desinger</li>
<li>The workflow is a long rinning workflow, so it will be serialized</li>
</ol>
<p>Is there a way to automate the task of versioning different workflow assemblies?</p>
| <p>The versioning of different workflow assemblies is not a trivial task and has a lot of complications. <a href="http://msmvps.com/blogs/theproblemsolver/archive/2008/09/10/versioning-long-running-workfows.aspx" rel="nofollow noreferrer">Here</a> you can find a series of posts that deal exactly with this. </p>
| <p>Here is another article on workflow versioning:</p>
<p><a href="http://www.adefwebserver.com/DotNetNukeHELP/Workflow/VacationRequest3.htm" rel="nofollow noreferrer">http://www.adefwebserver.com/DotNetNukeHELP/Workflow/VacationRequest3.htm</a></p>
<p>Basically you can version workflows that use assemblies if:</p>
... | 13,994 |
<p>I am using sql server 2005. I just want to know is there something we can get the week number for the particular month. Example <code>Date = '2008-10-16'</code> Is there something we can have <code>SELECT WEEK(Date)</code>. Or any better suggestion.</p>
| <p>Yes, a single service host can expose multiple endpoints with different bindings. However, normal IIS restrictions apply to IIS, so IIS 6 doesn't support NetTcp bindings to begin with.</p>
| <p>Beginning with IIS 7.0 you <em>can</em> use the net.tcp binding with IIS. And <em>Yes</em> you can expose multiple bindings (i.e. wsHttpBinding and net.tcp) in a single WCF service installation. The following (2) links should help:</p>
<p><strong>Multiple Endpoints:</strong><br>
<a href="http://msdn.microsoft.com/e... | 24,846 |
<p>i'm trying to create a ObjectDataSource which I can use to bind to a BindingSource which on his turn should be bound to a ComboBox.</p>
<p>I've created a simple class and a simple list for this class (see below)</p>
<ol>
<li>The Times list class is not showing up at my toolbox, so I cannot drag it to the form so I... | <p>I assume in your real code you'd actually <em>populate</em> myObjs - and sort it.</p>
<p>Have you just tried it? It will depend on several factors:</p>
<ul>
<li>Do you need to sort the list for any other reason?</li>
<li>How fast is MyObj.CompareTo(MyObj)?</li>
<li>How fast is MyObj.GetHashCode()?</li>
<li>How fas... | <p>BinarySearch requires the list to already be sorted. [edit: Forgot that dictionary is a hashtable. So lookup is O(1)]. The 2 are not really the same either. The first one is really just checking if it exists in the list and where it is. If you want to just check existance in a dictionary use the contain method.</p>
| 46,829 |
<p>I'm writing a Winforms application and I've been writing these awful HTML reports where I have templates set up and use String.Replace to get my variables into the templates, then output the results to a WebBrowser control. I really don't like this set up. </p>
<p>I'd love to be able to use ASP.NET for my reports... | <p>Like was said earlier, use the report viewer with client side reporting. You can create reports the same way as you do for sql reporting services, except you dont need sql server(nor asp.net). Plus you have complete control over them(how you present, how you collect data, what layer they are generated in, etc). You ... | <p>You might look into <a href="http://www.ultidev.com/products/Cassini/" rel="nofollow noreferrer">Cassini</a> -- a free ASP.NET web server component that you can embed directly in your WinForms application. The UltiDev version (linked) is based on the code that Microsoft released back in .NET 1.0, which was also use... | 19,033 |
<p>I have a situation where I'm populating a gridview with a bound data source, and want two additional rows at the very bottom; one to show the sum of values in the columns and one to show the average of values in the columns. I can quite easily calculate these values by aggregating information taken from the rowData... | <p>You can use the Footer just like you use Headers in gridview. Another solution is use a query in such way:</p>
<p>query 1 : your original query</p>
<pre><code>UNION
</code></pre>
<p>query 2 : your query which contains sum </p>
<p>(This applies only if you don't apply paging to your grid)</p>
| <p>If it's a single row of information you can use summary footer. See <a href="http://www.asp.net/Learn/data-access/tutorial-15-cs.aspx" rel="nofollow noreferrer">Displaying Summary Information in the GridView's Footer</a>.</p>
<p><a href="https://i.stack.imgur.com/1Ig6v.png" rel="nofollow noreferrer"><img src="https... | 45,372 |
<p>I'm making a hybrid 3D printer and circuit etching (CNC milling) machine that can both 3D print and etch prototype circuit boards. I'll be using Marlin firmware with an Arduino Mega & RepRap 1.4 board. It will have a 3D printer head and a milling head side by side. I'd like to have it be able to read both .gbr (... | <p>You can use both .gcode and .gbr files one one machine. We do it where I work.</p>
<p>However, when we make prototype circuit boards, we don't print them; we acquire circuit board blanks, and then we either:</p>
<ol>
<li><p>Use a diode laser to burn off the top layer of garolite for isolation traces, then do a che... | <p>Well, I'm Using pronterface to send the gcode to print the traces of my PCB with an ink pen (sharpie); since the parameter in the Marlin-Rep rap1.4 is configured to fast print, So I can easily send the code just setting the origin or Zero to print on any area of the printer. </p>
<p>To set the new Zero just use the... | 1,413 |
<p>Is is possible to construct a regular expression that rejects all input strings?</p>
| <p>Probably this:</p>
<pre><code>[^\w\W]
</code></pre>
<p>\w - word character (letter, digit, etc)<br>
\W - opposite of \w</p>
<p>[^\w\W] - should always fail, because any character should belong to one of the character classes - \w or \W</p>
<p>Another snippets:</p>
<pre><code>$.^
</code></pre>
<p>$ - assert pos... | <p>EDIT:
[^\n\r\w\s]</p>
| 8,784 |
<p>for the following:</p>
<pre><code>( a != b ) ? cout<<"not equal" : cout<<"equal";
</code></pre>
<p>suppose I don't care if it's equal, how can I use the above statement by substituting <code>cout<<"equal"</code> with a no-op.</p>
| <p>If it really is for a ternary operator that doesn't need a second action, the best option would be to replace it for an if:</p>
<pre><code>if (a!=b) cout << "not equal";
</code></pre>
<p>it will smell a lot less.</p>
| <pre><code>if (a!=b) cout<<"not equal";
</code></pre>
| 38,475 |
<p>My requirement is to develop a page with 4 sections, which cannot have a postback.
Section 1. Content which can be changed on user click
Section 2. List of users viewing the page online (Auto update when user leaves or visits the page )
Section 3. Chat for the users online
Section 4. Rating the content and other fu... | <p>I think I'm following...</p>
<p>When you are looking at the .rpt in VS, right-click on Database Fields in the Field Explorer window and go to 'Set Datasource Location'. What does it show for your connection? Is it pointing to the Production db server? This setting will be stored in the .rpt file so this might expla... | <p>Questions are: Does this arise because running in VS is different from running the installed app? Why does the report try to connect to the DB anyway? How do I control it?</p>
<p>you can control it according to your report content</p>
<p>if your report contain one table and and you passed this table to your report... | 48,692 |
<p>the homework: <a href="http://www.cs.rit.edu/~waw/networks/prob1.082.html" rel="nofollow noreferrer">http://www.cs.rit.edu/~waw/networks/prob1.082.html</a></p>
<p>Ok, I am still confused why this question was asked for my data communications and networks class, but here is the question from my homework:</p>
<block... | <p>A few tips:</p>
<ul>
<li><code>print "$_"</code> is equal to <code>print</code></li>
<li>while(<>) {...} can be replaced by adding -n to the options on the <code>#!</code> line/</li>
<li>$_ =~ m// is equal to //</li>
<li>You're typing four <code>:</code>'s where one is good enough.</li>
</ul>
<p>Something like ... | <p>Well, assuming you have your header in a string with one item per line (To:, From:, etc) named $head, then in Powershell it would be:</p>
<p>$head.Split("`n") | ?{$_ -match "[To|From|Subject|Cc]:"}</p>
| 48,726 |
<p>I wanna see if there is an approach to pack a few plugins together as a meta plugin that install everything together automatically, works like a project template.</p>
<p>Why not a script? Because I want to put it in github so I don't have to worry about it when I am not with my own PC :) but of coz a script based s... | <p>My solution (ruby script):</p>
<pre><code>plugins = %w{
http://url_to_plugin_1
http://url_to_plugin_2
http://url_to_plugin_3
http://url_to_plugin_4
http://url_to_plugin_5
}
plugins.each do | p |
`ruby script/plugin install -x #{p}`
end
</code></pre>
<p>run from project root directory</p>
| <p>If what you really want is a project template, you might give <a href="http://m.onkey.org/2008/12/4/rails-templates" rel="nofollow noreferrer">templates</a> a try, which is a feature new to 2.3</p>
| 30,043 |
<p>As far as I can understand, when I new up a <em>Linq to SQL class</em>, it is the equivalent of new'ing up a <em>SqlConnection object</em>.</p>
<p>Suppose I have an object with two methods: <code>Delete()</code> and <code>SubmitChanges()</code>. Would it be wise of me to new up the <em>Linq to SQL class</em> in eac... | <p>Having now reviewed the code sample you edited to post, I would definitely refactor your class to take advantage of LINQ-to-SQL's built in functionality. (I won't edit my previous comment because it's a better answer to the general question)<br />
Your class's fields appear to be a pretty direct mapping of the colum... | <p>I assume that you mean holding a value for the DataContext class? Personally, my preference is to default to a "using" clause for anything that is IDisposable (which the DataContext classes are). Instantiating in the constructor and holding a DataContext in a private variable would make that impossible. So to me, I'... | 24,155 |
<p>I'm building an ASP.NET web application, and all of my strings are stored in a resource file. I'd like to add a second language to my application, and ideally, I'd like to auto-detect the user's browser language (or windows language) and default to that, instead of making them choose something besides English. Curre... | <p>This <a href="http://web.archive.org/web/20080930115525/http://microsoft.apress.com/asptodayarchive/71804/website-internationalization-using-asp" rel="noreferrer">article (linked to archive.org as original link is now dead)</a> might be helpful with auto detecting the browser's language setting.</p>
<p>[EDIT] Yes. ... | <pre><code> /// <summary>
/// Sets a user's Locale based on the browser's Locale setting. If no setting
/// is provided the default Locale is used.
/// </summary>
public static void SetUserLocale(string CurrencySymbol, bool SetUiCulture)
{
HttpRequest Request = HttpContext.Current.Reques... | 31,974 |
<p>We've currently got four web servers in a farm generating IIS web logs about 100Mb per day. These can be compressed pretty effieciently down to somewhere around 5% of their size.</p>
<p>We are planning to use waRmZip to move them off the servers and onto a SAN. After a week or so we can be confident we don't have a... | <p>Legal requirements will depend on your country, how much you're logging, and quite possibly the nature of your business. Talk to your company's lawyers - legal advice on SO is likely to be worth what you pay for it.</p>
<p>If you're only storing 5MB per day, you should be able to store them for basically as long as... | <p>I tend to keep mine forever. That's mainly for trend analysis because Google misses some visitors (non-JavaScript ones).</p>
| 25,530 |
<p>I'm trying to implement a stateful web service in PHP using the SOAP extension. (Yes I know that web services are supposed to be stateless; all I really care to persist is some form of a session ID so I don't need to authenticate with every call to the service). PHP.net's API documentation is somewhat lacking on th... | <p>I actually solved my own problem.</p>
<p>I was working under the assumptions that: 1) .NET handles cookies automatically; and 2) my problem was with the PHP. Neither was the case. My PHP code was fine but I needed to add one more element to my .NET code to handle the session cookie.</p>
<p>After instantiating th... | <p>Most soap clients start a new connection for each request so there is no "session".</p>
<p>If its your SOAP service you could send the session id somewhere inside in the SOAP envelope on every reply and ask the client to pass the session id on every subsequent request. </p>
<p>This is much nicer as your client now... | 37,849 |
<p>I've been attempting to hook a Rails application up to ActiveDirectory. I'll be synchronizing data about users between AD and a database, currently MySQL (but may turn into SQL Server or PostgreSQL).</p>
<p>I've checked out activedirectory-ruby, and it looks really buggy (for a 1.0 release!?). It wraps Net::LDAP, s... | <p>Here is sample code I use with the <a href="http://net-ldap.rubyforge.org/">net-ldap</a> gem to verify user logins from the ActiveDirectory server at my work:</p>
<pre><code>require 'net/ldap' # gem install net-ldap
def name_for_login( email, password )
email = email[/\A\w+/].downcase # Throw out the domain, if... | <p>Have you checked out thoughtbot's ldap-activerecord-gateway? It might be something for you to consider...</p>
<p><a href="http://github.com/thoughtbot/ldap-activerecord-gateway/tree/master" rel="nofollow noreferrer">http://github.com/thoughtbot/ldap-activerecord-gateway/tree/master</a></p>
| 43,377 |
<p>Our Development environment has many layers and is complicated to replicate or even backup effectively. Basically the File system (ie. /usr/appdir/webapp...) has other applications serving our web application, those application we update doing svn updates from their repository. </p>
<p>The use of the web applicat... | <p>Sounds fine to me, as long as your VM software is smart enough to change the VM's MAC address (VMware is at least)</p>
| <p>Sounds fine to me, as long as your VM software is smart enough to change the VM's MAC address (VMware is at least)</p>
| 49,321 |
<p>Google created protocol buffers as a replacement for the bulky XML method of data transition. Faster XML processing was just not good enough. Most of the web has grown up as a hodge podge of different technologies that have been integrated to work within the browser or to generate html. JavaScript is separate fro... | <p>There are all sorts of "replacements", and have been since before the web existed. The problem with talking about a "replacement" for HTML+JS is that the conversation generally starts out of frustration with one or more specific aspects of the current implementations: </p>
<ul>
<li>"i hate the lack of presentation-... | <p>You mentioned two alternatives already: <strong>Silverlight</strong> and <strong>Flash</strong>. It's safe to assume that ~95% people have Flash Player installed; Silverlight has also seen quite good adoption in this short amount of time. </p>
<p>But jumping on the eye-candy bandwagon isn't necessarily going to mak... | 10,041 |
<p>The catch is this is a .NET 1.0 project and there is no hidden field control...</p>
<p>So this is out of the question:</p>
<pre>
<code>
<asp HiddenField Runat="server" ID="hdn" />
</code>
</pre>
<p>I vaguely remember some type of HtmlHiddenInput class that allowed similar functionality...does anybody know how ... | <p>You can use a regular input or create a custom server control.</p>
<pre><code><input type="hidden" runat="server" />
</code></pre>
| <p>just use an asp textbox and the visible=false property</p>
| 44,337 |
<p>I've recently seen occasional problems with stored procedures on a legacy system which displays error messages like this:</p>
<blockquote>
<p>Server Message: Number 10901, Severity 17:
This query requires <em>X</em> auxiliary scan
descriptors but currently there are
only <em>Y</em> auxiliary scan descrip... | <p>You don't say what version of Sybase you are on but the following is good for ASE 12.5 onwards.</p>
<p>I suspect that it's the addition of the new index that's thrown out the query plan for that stored procedure. Have you tried running </p>
<pre><code>update statistics *table_name*
</code></pre>
<p>on it? If that... | <p>This is defect in Sybase 12.5.2 for which a CR was submitted, see issue 361967 in <a href="http://web.archive.org/web/20131003092614/http://www.sybase.com/detail?id=1038862" rel="nofollow noreferrer">this list</a>. It was patched for 12.5.3 and above.</p>
| 34,077 |
<p>I've tried cpan and cpanp shell and I keep getting:</p>
<pre><code>ExtUtils::PkgConfig requires the pkg-config utility, but it doesn't
seem to be in your PATH. Is it correctly installed?
</code></pre>
<p>What is the pkg-config utility and how do I install it? </p>
<p>Updates: </p>
<ul>
<li>OS: Windows</li>
<li... | <p>look here:
<a href="http://gtk2-perl.sourceforge.net/win32/howto_build_gtk2perl_win32.html" rel="nofollow noreferrer">http://gtk2-perl.sourceforge.net/win32/howto_build_gtk2perl_win32.html</a>
I found this page by googling for ExtUtils::PkgConfig and "PPM" (Actvestates Perl Package Manager).</p>
| <p>A better source for Windows binaries for pkg-config is <a href="http://www.gtk.org/download/win64.php" rel="nofollow">the gtk site</a></p>
| 13,597 |
<p>What is the proper way to implement the status bar and navigation bar that go on top of an UIView?</p>
<p><a href="http://img.skitch.com/20081217-t78sdixk37hqgdh1ia2fgec4st.png" rel="nofollow noreferrer">alt text http://img.skitch.com/20081217-t78sdixk37hqgdh1ia2fgec4st.png</a></p>
| <p>Just set “wants fullscreen layout” in your view controller. That solves the problem for me.</p>
<pre><code>self.wantsFullScreenLayout = YES;
</code></pre>
| <p>Set the statusbar style as black translucent and navigation bar style as black translucent. If you are using a navigation-based application, in the MainWindow.xib check the status bar is hidden and navigation bar is hidden checkboxes.</p>
<p>When the user touches the screen, start a timer to see if this was a singl... | 48,878 |
<p>We're running on .NET 3.5 SP1. </p>
<p>Recently, in IE, some of our users started getting "Out of Memory" errors once in a while. This doesn't happen all the time. I managed to replicate it a couple times and I found that this code, from the AjaxControlToolkit.Common.Common.js file, was causing an infinite loop:
Aj... | <p>You might want to post a bug report on <a href="http://connect.microsoft.com/feedback/default.aspx?SiteID=210" rel="nofollow noreferrer">Microsoft Connect</a>.</p>
| <p>You might want to post a bug report on <a href="http://connect.microsoft.com/feedback/default.aspx?SiteID=210" rel="nofollow noreferrer">Microsoft Connect</a>.</p>
| 20,571 |
<p>Has anybody tried programming on the EEE Pc in Visual Studio?</p>
<p>I'm considering buying one so I can show some apps on the fly, but also make small changes to them if necessary, without the inconvenience of a large laptop.</p>
<p>Some key points I'm after:</p>
<ul>
<li>How fast it is</li>
<li>Would it suit th... | <p>I own an eeepc 900 and have successfully installed Visual Studio 2008, the MSDN library and SQL Server 2005 developer edition.</p>
<p>The biggest issue was fitting it all in the 4GB solid state C Drive. In short, you can't. Therefore using the 16GB secondary internal flash drive is essential. </p>
<p>The utilit... | <p>I think it largely depends on the size of your project. A small project might not have too much trouble. But a large project would probably bring the thing to it's knees. I've seen my work project on VS.Net 2008 eat up to 350 MB pf RAM all by itself. Not counting loading the OS and actually running the project. A... | 20,647 |
<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace GenericCount
{
class Program
{
static int Count1<T>(T a) where T : IEnumerable<T>
{
return a.Count();
}
static void Main(string[] args)
{
... | <p>You want this</p>
<pre><code>static int Count1<T>(IEnumerable<T> a)
{
return a.Count();
}
</code></pre>
| <p>Your generic constraint is wrong. You cannot enforce it to implement IEnumerabl<T></p>
| 19,402 |
<p>I'm trying to convert some strings that are in French Canadian and basically, I'd like to be able to take out the French accent marks in the letters while keeping the letter. (E.g. convert <code>é</code> to <code>e</code>, so <code>crème brûlée</code> would become <code>creme brulee</code>)</p>
<p>What is the best ... | <p>I've not used this method, but Michael Kaplan describes a method for doing so in his blog post (with a confusing title) that talks about stripping diacritics: <a href="http://archives.miloush.net/michkap/archive/2007/05/14/2629747.html" rel="noreferrer">Stripping is an interesting job (aka
On the meaning of meaningl... | <p>Not having enough reputations, apparently I can not comment on Alexander's excellent link. - Lucene appears to be the only solution working in reasonably generic cases. </p>
<p>For those wanting a simple copy-paste solution, here it is, leveraging code in Lucene:</p>
<p>string testbed = "ÁÂÄÅÇÉÍÎÓÖØÚÜÞàáâãäåæçèéêë... | 30,962 |
<p>I have a database table (named Topics) which includes these fields :</p>
<ol>
<li>topicId </li>
<li>name</li>
<li>parentId</li>
</ol>
<p>and by using them I wanna populate a TreeView in c#. How can I do that ?</p>
<p>Thanks in advance...</p>
| <p>It will probably be something like this. Give some more detail as to what exactly you want to do if you need more. </p>
<pre><code>//In Page load
foreach (DataRow row in topics.Rows)
{
TreeNode node = new TreeNode(dr["name"], dr["topicId"])
node.PopulateOnDemand = true;
TreeView1.Nodes.Add(node);
}
... | <p>This code runs perfectly for me. Thought it might be useful for somebody looking to display hierarchial data in a treeview.By far, i guess this is the simplest. Please check it out and upvote if it helps you.</p>
<p>Reference : <a href="https://techbrij.com/display-hierarchical-data-with-treeview-in-asp-net" rel="n... | 47,203 |
<p>I want to convince the architecture manager to include the <a href="http://www.joda.org/joda-time/" rel="noreferrer">Joda-Time</a> jar in our product.</p>
<p>Do you know any disadvantages in using it?</p>
<p>I think Joda-Time needs to be constantly updated because of the files that it includes. And that is a disad... | <p>I've had almost entirely positive experiences with Joda Time. My one problem was when trying to construct my own time zone (for legitimate reasons, I assure you :) I got some very weird exceptions, and the documentation wasn't very good for that particular use case.</p>
<p>However, for the most part it's been a joy... | <p>The main issue with it is vendor lockin at least until it becomes part of the standard.</p>
<p>For the most part I would use longs to store any business date information on a database. This gives me the flexibility to adjust the precision as I see fit. In most cases I just convert them to java.util.Date. </p>
<p>T... | 49,148 |
<p>On the Apple iPhone developer center they have some videos such as "Introduction to the iPhone SDK", "iPhone Development Tools Overview", etc. </p>
<p>Problem is my mac hasn't arrived yet. Is there any way I can watch these videos on my Linux system? </p>
| <p>Not sure about the Apple ones, but this one has been really good at getting started:</p>
<p><a href="http://iphone.christosblog.com/" rel="nofollow noreferrer">Christos Blog</a></p>
<p>They hop into the code and tools rather than spending too much time explaining the tools. I think they will help you. </p>
| <p>I believe you need to download them from iTunes which requires either a Mac or PC but they are standard mpeg-4 videos and should be viewable in vlc.</p>
| 40,363 |
<p>I'm looking for a corporate collaboration tool to help bring together my team, who are geographically and organisationally distributed. Some team members operate on client sites, behind corporate firewalls and similar.</p>
<p>The restrictions I have are:</p>
<ul>
<li>Must allow creation of persistent 'channels' (... | <p>Just use Skype. It's free, it has excellent chatting capabilities, works over firewalls, supports lots of collaboration features out of box and plenty more as plugins.</p>
<p>P.S. It is also supported natively on Windows Mobile and has good clients on other mobile platforms (like Fring on S60)</p>
| <p>IIRC google talk uses the jabber protocol internally. You should be able to connect to it with any client and some of them should offer the channels functionality. Alternatively, you could set up your own jabber server if you want to keep your data away from google's eyes.</p>
| 18,970 |
<p>Instead of relying on my host to send an email, I was thinking of sending the email messages using my <strong>Gmail</strong> account. The emails are personalized emails to the bands I play on my show. </p>
<p>Is it possible to do it?</p>
| <p>Be sure to use <code>System.Net.Mail</code>, not the deprecated <code>System.Web.Mail</code>. Doing SSL with <code>System.Web.Mail</code> is a gross mess of hacky extensions.</p>
<pre><code>using System.Net;
using System.Net.Mail;
var fromAddress = new MailAddress("from@gmail.com", "From Name");... | <p><a href="https://i.stack.imgur.com/xrl3W.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xrl3W.png" alt="How to Set App-specific password for gmail" /></a></p>
<p>If your Google password doesn't work, you may need to create an app-specific password for Gmail on Google.
<a href="https://support.goo... | 5,219 |
<p>When I run selenium tests (written as nunit tests) from VS2008 I am getting: </p>
<blockquote>
<p>System.UnauthorizedAccessException : Access to the path /bin/Debug is denied.</p>
</blockquote>
<p>The test is trying to read an entry in App.Config. This file is copied to bin/Debug during compilation.</p>
<p>I us... | <p>I was having the same problem. The way I got around it was by starting Visual Studio with Administrator privileges (right click on visual studio --> run as Administrator). I then re-opened the solution and ran my tests. This time they passed. </p>
| <p>You need to change your test configuration so that access to the directory is allowed. See Test/Edit Test Run Configurations/Deployment.</p>
<p>If you are trying to read or write a file in that directory, you will probably need to copy it to the directory where the test is run. Again, the Deployment tab of the test... | 31,076 |
<p>Assuming a fluid layout is not an option (since that is a different discussion all together), what is the recommended width for a site layout? What are the pros and cons of different sizes?</p>
| <p>I've always kept with <code>960px</code> as it's viewable on <code>1024x768</code>, and is cleanly divisible by 2, 3, 4, 5, 6, 8, 10, 12, 15, 16, 20, 24, 30, 32, 40, 48, 60, 64, 80, 96, 120, 160, 192, 240, 320 and 480... so I can split up the design of my site (using the rule of thirds) cleanly.</p>
<p><strong>EDIT... | <p>According to <a href="http://www.w3schools.com/browsers/browsers_display.asp" rel="nofollow noreferrer">these</a> statistics, a minimum of 1024 pixels wide will cover most users.</p>
| 24,772 |
<p>I have these values: <code>d1, d45, d79, d33, d100</code></p>
<p>I want to sort these variables in ascending order from my table.</p>
<p>What is the query to get the output as:</p>
<pre><code>d1
d33
d45
d79
d100
</code></pre>
| <p>What you want is called a "natural sort". For Microsoft SQL Server 2005, see <a href="https://stackoverflow.com/questions/34509/natural-human-alpha-numeric-sort-in-microsoft-sql-2005">this question</a>. For other languages, see (for example) <a href="https://stackoverflow.com/questions/127913/sorting-strings-is-much... | <p>Sorry, not SQL answer at all. :) For variant with one letter only order by length and alpha.</p>
| 46,345 |
<p>With ASP.NET MVC (or using HttpHandlers) you can dynamically generate URLs, like the one in this question, which includes the title.</p>
<p>What happens if the title changes (for example, editing it) and there's a link pointing to the page from another site, or Google's Pagerank was calculated for that URL?</p>
<p... | <p>I use the same system as is in place here, everything after the number in the URL is not used in the db query, then I 301 redirect anything else to be the title.</p>
<p>In other words, if the title changed, then it would redirect to the correct place. I do it in PHP rather than htaccess as it's easier to manage mor... | <p>I think you're generally best off having the server send a permanent redirect to the new location, if possible.</p>
<p>That way any rank which is gained from third party links should, in theory, be transferred to the new location. I'm not convinced whether this happens in practice, but it should.</p>
| 13,136 |
<p>I would like to search my table having a column of first names and a column of last names. I currently accept a search term from a field and compare it against both columns, one at a time with </p>
<pre><code> select * from table where first_name like '%$search_term%' or
last_name like '%$search_term%';
</... | <p>What you have should work but can be reduced to:</p>
<pre><code>select * from table where concat_ws(' ',first_name,last_name)
like '%$search_term%';
</code></pre>
<p>Can you provide an example name and search term where this doesn't work?</p>
| <p>You can try this:</p>
<pre><code>select * FROM table where (concat(first_name, ' ', last_name)) = $search_term;
</code></pre>
| 39,016 |
<p>Is there a way to mount a Linux directory from a different PC to your local Linux PC? How?</p>
| <p>Yes, it's called <a href="http://en.wikipedia.org/wiki/Network_file_system" rel="noreferrer">NFS</a>. You might also want to check out <a href="http://fuse.sourceforge.net/sshfs.html" rel="noreferrer">sshfs</a> which is pretty nice.</p>
| <p>sshfs works pretty well for me.</p>
<pre><code>sudo sshfs -o allow_other root@1.2.3.4:/directory local_directory
</code></pre>
<p>remote machine ip : 1.2.3.4</p>
| 28,747 |
<p>I have a C# method which accepts a Predicate<Foo> and returns a list of matching items...</p>
<pre><code>public static List<Foo> FindAll( Predicate<Foo> filter )
{
...
}
</code></pre>
<p>The filter will often be one of a common set...</p>
<pre><code>public static class FooPredicates
{
pu... | <p>To perform your caching task, you can follow the other suggestions and create a Dictionary<Predicate<Foo>,List<Foo>> (static for global, or member field otherwise) that caches the results. Before actually executing the Predicate<Foo>, you would need to check if the result already exists in the dictionary... | <p>The same instance of an object will always return the same hashcode (requirement of GetHashCode() in .Net). If your predicates are inside a static list and you are not redefining them each time, I can't see a problem in using them as keys.</p>
| 26,057 |
<p>We're trying to analyse flow around circular cylinder and we have a set of Cp values that we got from wind tunnel experiment. Initially, we started off with a sample frequency of 20 Hz and tried to find the frequency of vortex shedding using FFT in matlab. We got a frequency of around 7 Hz. Next, we did the same exp... | <p>The problem you are seeing is related to "data aliasing" due to limitations of the FFT being able to detect frequencies higher than the <a href="http://en.wikipedia.org/wiki/Nyquist_Frequency" rel="noreferrer"><strong>Nyquist Frequency</strong></a> (half-the sampling frequency).</p>
<p>With data aliasing, a peak in... | <p>Take a look at <a href="https://stackoverflow.com/questions/138558/vb-fft-stuck-understanding-relationship-of-results-to-frequency">this</a> related question. While it was originally asked about asked about VB the responses are generically about FFTs</p>
| 20,659 |
<p>I have created an application that writes some data to the root folder of the directory in which it was installed (in Program Files). But under Windows Vista, the program is unable to write to the directory because the UAC restricts administrative privileges.</p>
<p>I need to be able to do the following</p>
<ol>
<... | <p>It sounds like the title of your question asks how to make the installer run with administrative privileges but your explanation asks how to make the program run with administrative privileges so it can write to Program Files at runtime. Which one is it?</p>
<p>If you really just want the installer to run with admi... | <p>Your best bet is to not write any files under "Program Files". Whatever you're trying to write there is better written to the Windows Registry. You will then have to of course modify your program to read the information from the Registry instead of that file. But really, this is what the Registry is for.</p>
| 45,343 |
<p>It seems like when you have a WinForms .NET application, and a ComboBox (set to the "DropDown" style), and that ComboBox has multiple items in it that are identical, weird things happen. Specifically, the index of the selected item can change <em>without</em> firing the SelectedIndexChanged event. </p>
<p>Of course... | <p>The .NET Framework does not actually keep track of the selected index of the combo box's drop down list; this is handled internally by the Windows API. As a consequence of this, .NET is reliant on the Windows API to notify it when the selected index changes by means of a notification message sent to the combo box's ... | <p>A similar problem occurs without having identical items if you enter free text, which does not match exactly but the first characters.
If the user does not open the dropdown no re-sync happen and the selected index is -1 as expected. (Not selecting one of the items is what the user intends to do)
Now the user closes... | 46,169 |
<p>I have inherited a very large and complex project (actually, a 'solution' consisting of 119 'projects', most of which are DLLs) that was built and tested under VC8 (VS2005), and I have the task of porting it to VC9 (VS2008).</p>
<p>The porting process I used was:</p>
<ol>
<li>Copy the VC8 .sln file and rename it
t... | <blockquote>
<p>Is there some way to force the construction of a global object prior to loading DLLs?</p>
</blockquote>
<p>How about the DELAYLOAD option? So that DLLs aren't loaded until their first call?</p>
| <p>That's certainly an interesting problem. I don't have a solution other than perhaps to change the design so that there is no dependence on undefined behavior of the order or link/dll startup. Have you considered linking with the older linker? (or whatever the VS.NET term is)</p>
<p>Because the behavior of your va... | 31,675 |
<p>I have a bunch of Velocity template files in a Visual Studio 2008 project, the problem is that despite the fact that the extension is <code>.vm</code> instead of <code>.xml</code> or similar Visual Studio thinks that the HTML they contains must conform to XML naming standards and generates errors (not just warnings ... | <p>Xml errors usually only show if the file is open.</p>
<p>You can normally disable it by not opening it into the xml editor; the errors don't normally stop a build - they just look like they do.
Right click -> Open With... Source (Text) Editor (or HTML if you prefer)
(and set as default).</p>
| <p>Have you tried: right-click on a .VM file, select Properties. There you can change the Build Action, you might want to set it to either Content or None.</p>
| 23,722 |
<p>I always believe they did, but seeing some answers here make me doubt...</p>
<p>Can I access private fields/properties/methods from outside a class through reflection?</p>
| <p>Yes you can access private fields via reflection. This is how a lot of ORMs go about populating an object without going through your properties (which will invoke business logic you might not have intended to be run on an object load).</p>
<p>Access modifiers are not a form of security!</p>
| <p>Yes you can: but you really should questions yourself why you're going to :)</p>
<p>There is actually only one case, where it can make sense and this is a UnitTest.</p>
| 12,154 |
<p>I want to compare two ms-access .mdb files to check that the data they contain is same in both.</p>
<p>How can I do this?</p>
| <p>I've done this kind of thing in code many, many times, mostly in cases where a local MDB needed to have updates applied to it drawn from data entered on a website. In one case the website was driven by an MDB, in others, it was a MySQL database. For the MDB, we just downloaded it, for MySQL, we ran scripts on the we... | <p>If you want to know if the files are identical then</p>
<pre><code>fc file1.mdb file2.mdb
</code></pre>
<p>on a DOS command line.</p>
<p>If the files aren't identical but you suspect they contain the same tables and records then the easiest way would be quickly write a small utility that opens both databases and... | 29,627 |
<p>Is there a site online that lists common regular expressions or has a utility to help you create one based on sample text?</p>
<p>Thanks!</p>
| <p>The most known regular expression sites are:</p>
<p><a href="http://www.regular-expressions.info/" rel="noreferrer">http://www.regular-expressions.info/</a></p>
<p><a href="http://www.regexbuddy.com/" rel="noreferrer">http://www.regexbuddy.com/</a></p>
<p><a href="http://regexlib.com/RETester.aspx" rel="noreferre... | <p>For a Windows RegX Tool</p>
<p>Try M Squared Technologies - Regx - It is free.
Good for single line, trial and error.</p>
<p><a href="http://mSquaredTechnologies.com" rel="nofollow noreferrer">http://mSquaredTechnologies.com</a></p>
| 42,941 |
<p>Some of us still "live" in a programming environment where unit testing has not yet been embraced. To get started, the obvious first step would be to try to implement a decent framework for unit testing, and I guess xUnit is the "standard".</p>
<p>So what is a good starting point for implementing xUnit in a new pro... | <p>Which language is it for - there are quite a few in <a href="http://opensourcetesting.org/unit_misc.php" rel="nofollow noreferrer">place already</a>.</p>
| <p>I'd suggest that a good starting point would be to use xunit on a couple of other languages to get a feel for how this style of unit test framework works. Then you'll need to go in depth into the behaviour and start working out how to recreate that behaviour in a way that fits with your new language.</p>
| 27,808 |
<p>What is the point of type definition on method parameters on Caché Object (from Intersystems) since after it's pre-compiled to the .int format, it removes any typing information, thus making no difference at all?</p>
| <p>Those types aren't used/checked internal to Cache code, but they are used when you expose your classes via XML, SQL, etc.</p>
<p>One would hope that in a future version Intersystems would start doing some compile-time type checking, but that may be too much to ask.</p>
| <p>If you're writing ANSI M code, you shouldn't have types at all. My guess is that this is specific to Intersystems code. </p>
| 12,249 |
<p>I'm using Flex Builder 3 now and it suddenly refuses to start debugging session. I've reinstalled debugger versions of Flash Player: both 9 and 10 versions. Then I've reinstalled Flex Builder itself allowing it to install it's native Flash Player version. And finally, I've tried to use both IE and Firefox as host fo... | <p>I had a similar problem and this is how it was solved:
<a href="http://therush.wordpress.com/2008/03/11/resolved-flex-builder-3-debugger-stopped-working" rel="nofollow noreferrer">http://therush.wordpress.com/2008/03/11/resolved-flex-builder-3-debugger-stopped-working</a></p>
<p>If this doesn't solve it:
Try to see... | <p>You mentioned reinstalling. Just to be meticulous, did you use the "uninstaller" tool? <a href="http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_14157" rel="nofollow noreferrer">http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_14157</a> . Uninstalling from the Windows add/remove UI doesn't wo... | 45,518 |
<p>I am having some difficulty writing a function that will search through a directory for a file that matches a specific regular expression (which I have compiled using 're.compile'). So my question is: How do I search through a directory (I plan to use os.walk) for a file that matches a specific regular expression? A... | <p>This will find all files starting with two digits and ending in gif, you can add the files into a global list, if you wish:</p>
<pre><code>import re
import os
r = re.compile(r'\d{2}.+gif$')
for root, dirs, files in os.walk('/home/vinko'):
l = [os.path.join(root,x) for x in files if r.match(x)]
if l: print l #Or... | <p>If the pattern you have to match is simple enough to grab with filesystem wildcards, I recommend you take a look at the glob module, which exists for this exact purpose.</p>
| 40,713 |
<p>In Eclipse 3.4.1 using JDK1.6.0_10 how can I activate a warning on a missing <code>@Override</code> annotation on a method that implements an interface method? </p>
<p>In the Preferences window this option:</p>
<blockquote>
<p>Java > Compiler > Errors / Warnings >
Annotations > Missing '@Override'
annotation... | <p>It is not possible in Eclipse 3.4.1. It is a <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=163194" rel="noreferrer">known issue</a>. See this bug report page for more information.</p>
| <p>Maybe I'm missing something but interface methods are already required to be implemented by implementation classes.</p>
<p>The compiler will generate an error if the interface is not completely implemented.</p>
| 27,803 |
<p>My goal is to launch an installation with admin credentials(user with install rights), In order to do this I need to pass these user credentials from a webservice. So the question is What is the most secure way I could pass this data. Keeping in mind the user of the end client is not logged in as an administrator ... | <p>Encryption will protect admin credentials during transport from WebService to application memory, as pointed by gedevan.</p>
<p>Do you mean you also want to protect them from the user who launches application?
Keep in mind, he is an owner of your process, so with the right tooling and a lot of determination he shou... | <p>Using encryption of message body (WS-Encryption) in pair with HTTPS is a quite secured in most cases.</p>
| 41,088 |
<p>I'm in Visual Studio 2008, and I'm editing a CSS file. I use ctrl+f a lot to find stuff around the file. Once I find something, I'm used to using the Esc key get out of the find window and back into the editor. </p>
<p>I'd swear this is how it works when I'm at the office, but at home, I have to hit ctrl+tab to ... | <p>Certain windows in VS can be set as Floating, Dockable, Tabbed, etc. Try changing it to one of the other ones and see if it helps (right click the title of the search window).</p>
| <p>Certain windows in VS can be set as Floating, Dockable, Tabbed, etc. Try changing it to one of the other ones and see if it helps (right click the title of the search window).</p>
| 48,029 |
<p>For those of you who aren't familiar with the concept, abstraction inversion is the implementation of low-level constructs on top of high-level constructs, and is generally considered a bad thing because it adds both needless complexity and needless overhead. Of course, this is a somewhat imprecise, subjective defi... | <p>Single-paradigm <em>anything</em> violates the First Commandment of Abstractions, which few people seem to know about and even less care about.</p>
<p><strong>Thou shalt not make unto thee any abstraction that cannot be overridden if necessary, that thy code be free of ugly abstraction inversions.</strong></p>
<p>... | <p>I don't think a <strong>language</strong> like Java or C# suffers from this in any tangible way, simply because the libraries accompanying the framework are so rich that the need to break into another paradigm isn't really required for general programming.</p>
<p>That said, the <strong>rich libraries</strong> thems... | 38,073 |
<p>I have been learning C++ for three months now and in that time created a number of applications for my company. I consider myself fairly comfortable with C++ / MFC and STL, however I don't just want to be an OK programmer, I want to be a good programmer. I have a few books on best practices but I was wondering if an... | <p>For C++, <a href="http://www.aristeia.com/books.html" rel="nofollow noreferrer">Scott Meyers books</a> are very good, and will help take you to the next level.</p>
<p>If you don't already have it <a href="https://rads.stackoverflow.com/amzn/click/com/0201700735" rel="nofollow noreferrer" rel="nofollow noreferrer">C... | <p>You can check out the Boost library and a number of the books written about it. While this may not have been what you had in mind, IMO, the Boost libraries are examples of well-designed modern C++ libraries that use the features of the language in pretty much the way they should be used to create among the most effe... | 42,233 |
<p>Does anyone know a good tool that can be run on a page (for asp.net, for example) to help to minimize the footprint size of the page?</p>
<p>The page will have typical items: HTML, Javascript, etc.</p>
<p>I've heard of Javascript crunchers in the past, that will make the size of the code as compact as possible (an... | <p>You could configure your web server to compress the page on the fly (and possibly cache the compressed version) for any client that indicates it can take a gzip or zip (or other) encoding, which is pretty much all of them.</p>
| <p>A bit of fundamentals:
IIS saves compressed response of JS/CSS/Html files on disk so, subsequent requests for JS/CSS is served from Disk(bypassing step of compression). While compressed response for ASPX/ASCX are not cached on disk, since response varies from request to request.</p>
<p>Therefore, Best practise is ... | 38,401 |
<p>I have some classes layed out like this</p>
<pre><code>class A
{
public virtual void Render()
{
}
}
class B : A
{
public override void Render()
{
// Prepare the object for rendering
SpecialRender();
// Do some cleanup
}
protected virtual void SpecialRender()
... | <p>You can seal individual methods to prevent them from being overridable:</p>
<pre><code>public sealed override void Render()
{
// Prepare the object for rendering
SpecialRender();
// Do some cleanup
}
</code></pre>
| <p>yes. If you mark a method as Sealed then it can not be overriden in a derived class.</p>
| 6,512 |
<p>What are some of the major differences to be aware of when developing Addins or Document level customizations for excel 2003/2007?</p>
| <p>A couple items:</p>
<p>VSTO 2SE - can be used for both Excel 2003 and Excel 2007 addins. (requires code-access security on installation)</p>
<p>VSTO 3 - can only be used for Excel 2007 add-ins. (Does not require code-access security)</p>
<p>Excel 2003 - can install add-in for all users or per-user.</p>
<p>Excel... | <p>FYI. The blog article mentioned above is not accurate in document level customizations. Perhaps at the time it was, but it is no longer accurate.</p>
<p>Excel 2007 Document Level Customizations are fully supported in Visual Studio 2008 however they utilize Visual Studio Tools For Office 2007 (aka VSTO 3.0).</p>
| 48,652 |
<p>I've got a VS 2008 C# Web project and whenever I make some changes to the files in it (not even to the project file itself) VS will remove some lines like this from the csproj file:</p>
<pre><code><SubType>ASPXCodeBehind</SubType>
</code></pre>
<p>So something like this:</p>
<pre><code><Compile Inc... | <p>For me, the difference depends on whether or not the web project is open in Visual Studio.</p>
<p>I find if I commit the project file to version control with the project open in Visual Studio the SubType elements are present. Closing the solution/project then removes the SubType elements from the project file. Now ... | <p>These lines are also appearing in the project file in VS2012 when committing project changes in Tortoise SVN. This project used to be a website that I converted into a web application.</p>
<p>I was able to bypass this issue using the following steps which <strong>do not</strong> require closing the project:</p>
<o... | 33,072 |
<p>I understand they both don't change the URL that the client sees. Is there anything in them that makes one of them preferable over the other?<br>
I'm planning to use it in the Application_BeginRequest in Global.asax, but also in regular aspx page.</p>
| <p>I think <code>Context.RewritePath()</code> is the better option.
Reason:</p>
<p><code>Server.Transfer()</code> throws a <code>ThreadAbortException</code> every time. The result of calling <code>Response.End()</code>.</p>
<p>For more details read the following MS articles:</p>
<ul>
<li><a href="http://support.mic... | <p>Context.RewritePath Assigns an internal rewrite path and allows for the URL that is requested to differ from the internal path to the resource. RewritePath is used in cookieless session state.</p>
<p>Whereas Server.transfer transfers the content assembled for processing of one page to another page .</p>
| 43,692 |
<p><strong>How do I represent an aggregation relation between two classes in UML, such that each class has a link to the other class's interface, not the implementing class?</strong></p>
<p>E.g. I have a class Foo that implements iFoo, and Bar that implements iBar. Foo should have a member variable of type iBar, and B... | <p>Setting FormBorderStyle = None will remove the title bar (at both design and
run time) - and also remove your ability to resize the form.</p>
<p>If you need a border you can set:</p>
<pre><code>ControlBox = false
Text = ""
</code></pre>
| <p>Set the ControlBox property of the form to False, and the Text property to empty string. The form will open with no perceivable (to the user) title bar, but they will be able to resize the form.</p>
| 11,933 |
<p>What guidlines do you use when deciding whether to let a method dodge an exception (ie: let the exception propogate up) or handle it once the exception is recieved?</p>
<p>Here is an example of what I am trying to ask</p>
<p>If I have three methods method1,2,3 and 3. Method1 calls Method2 which Calls Method3. and ... | <p>The rule I follow:</p>
<p>If I can fix an exception, or nullify the problem that caused it (sometimes this means just ignoring it altogether), I'll handle it. Otherwise it gets passed up to the next level.</p>
<p>And I always try to fix exceptions as low in the tree as possible (i.e. as soon as possible after they... | <p>From a Java point of view, I always try and use unchecked exceptions to avoid adding the throws declarations in the method signatures.</p>
<p>Then where I actually catch the exception will be depending on the situation. I'd always want to handle the exception as high in the chain as possible where the exception is... | 47,198 |
<p>I have a main window (#1) on my webpage from which I open a new browser window (#2) from which I open a new window (#3).</p>
<p>Now if my user closes window#2 before window#3, I have the problem that window#3 no longer can call function in its window.opener since it has gone away.</p>
<p>What I would like to do is... | <p>In the third wndow you put in:</p>
<pre><code><script type="text/javascript">
var grandMother = null;
window.onload = function(){
grandMother = window.opener.opener;
}
</script>
</code></pre>
<p>Thus you have the handle to the grandmother-window, and you can then use it for anything directly:... | <p>This may be tangential, but why do you need to open 3 separate windows? Can you use a jQuery dialog instead? I get very frustrated when apps open windows on me.</p>
| 29,735 |
<p>I need to ensure that any number of websites and services haven't bitten the dust. At the moment I rely on a simple 5 minute cronjob which uses curl and a file of urls to check that all the responses are correct (200 or rarely 301).</p>
<p>It all works on a basic level, I'm interested in more sophisticated open-sou... | <p>In my experience nagios works pretty well but seems to be hard to take care of at times. If you want to have stats and everything else on top of what nagios gives you then add <a href="http://www.cacti.net/" rel="nofollow noreferrer">cacti</a>. If you want it all in one package you should look into <a href="http://w... | <p><a href="http://www.zabbix.com/" rel="nofollow noreferrer">Zabbix</a> 1.6 supports multiple flows for web monitoring, and will allow you to monitor other things besides that. It's free and very flexible.</p>
| 26,403 |
<p>It seems like more and more OS X apps these days are doing all kinds of fancy drawing stuff for custom controls. Apps like Twitterific, Things, EventBox, Versions just to name a few....</p>
<p>So basically I'm looking for any information on how to get started doing this kind of thing. Not sure if it is just done by... | <p>It depends entirely on what you want to do.</p>
<p>The "Show Raw Properties" button in Versions for instance is an NSButton subclass, because basically what we needed is standard button behavior with our own look. One way to subclass a button is to simply implement your own -drawRect:(NSRect)rect method in the NSB... | <p>Have a look at some excellent example code: <a href="http://www.bitbucket.org/bwalkin/bwtoolkit/" rel="nofollow noreferrer">BWToolkit</a></p>
| 49,912 |
<p>Ok, I'm doing a bunch of RIA/AJAX stuff and need to create a "pretty", custom confirm box which is a DIV (not the built-in javascript confirm). I'm having trouble determining how to accomplish a pause in execution to give the user a chance to accept or decline the condition before either resuming or halting executio... | <p>I'm afraid to say that it's not possible to pause the Javascript runtime in the same way that the "confirm" and "alert" dialogs pause it. To do it with a DIV you're going to have to break up your code into multiple chunks and have the event handler on the custom confirm box call the next section of code.</p>
<p>Th... | <p>In my case, the goal was to display a <code>customConfirm</code> box whenever user clicks the delete link embedded within each row of a .Net Repeater</p>
<p>Whenever user clicks the delete link of any particular row,the Custom Confirm function is called. Now inside the confirm function, in addition to rendering the... | 46,705 |
<p>Does it make sense to qualify bit fields as signed / unsigned?</p>
| <p>The relevant portion of the standard (ISO/IEC 9899:1999) is 6.7.2.1 #4:</p>
<blockquote>
<p>A bit-field shall have a type that is a qualified or unqualified
version of _Bool, signed int, unsigned int, or some other implementation-defined
type.</p>
</blockquote>
| <p>if a 'bit' is signed, then you have a range of -1, 0, 1, which then becomes a ternary digit. I don't think the standard abbreviation for that would be suitable here, but makes for interesting conversations :)</p>
| 18,060 |
<p>C# and Java allow almost any character in class names, method names, local variables, etc.. Is it bad practice to use non-ASCII characters, testing the boundaries of poor editors and analysis tools and making it difficult for some people to read, or is American arrogance the only argument against?</p>
| <p>I would stick to english, simply because you usually never know who is working on that code, and because some third-party tools used in the build/testing/bugtracking progress may have problems. Typing äöüß on a Non-German Keyboard is simply a PITA, and I simply believe that anyone involved in software development sh... | <p>There is another hazzard to using non-ASCII characters, though it will probably only bite in obscure cases. The allowed characters are <a href="http://docs.oracle.com/javase/specs/jls/se7/html/jls-3.html#jls-3.8" rel="nofollow">defined</a> in terms of the methods <a href="http://docs.oracle.com/javase/7/docs/api/ja... | 8,683 |
<p>What do people recommend for creating popup's in ASP.Net MVC? I have used the AJAX toolkit and component art's methods in the web forms world and am looking something with similar capability. </p>
<p>What JQUERY plugins do people like? SimpleModal, JBOX (I think this was, what it was called)</p>
<p>Is it worth exp... | <p>jqModal looks pretty cool <a href="http://dev.iceburg.net/jquery/jqModal/" rel="nofollow noreferrer">http://dev.iceburg.net/jquery/jqModal/</a> - have only done some brief experiments, not used in production yet, but have put in the toybox for my current project.</p>
| <p>I like <a href="http://leandrovieira.com/projects/jquery/lightbox/" rel="nofollow noreferrer">lightBox</a></p>
| 42,024 |
<p>In C# I could easily write the following:</p>
<pre><code>string stringValue = string.IsNullOrEmpty( otherString ) ? defaultString : otherString;
</code></pre>
<p>Is there a quick way of doing the same thing in Python or am I stuck with an 'if' statement?</p>
| <p>In Python 2.5, there is</p>
<pre><code>A if C else B
</code></pre>
<p>which behaves a lot like ?: in C. However, it's frowned upon for two reasons: readability, and the fact that there's usually a simpler way to approach the problem. For instance, in your case:</p>
<pre><code>stringValue = otherString or defaultS... | <p>You can take advantage of the fact that logical expressions return their value, and not just true or false status. For example, you can always use:</p>
<pre><code>result = question and firstanswer or secondanswer
</code></pre>
<p>With the caveat that it doesn't work like the ternary operator if firstanswer is fal... | 16,389 |
<p>We deployed a live, fresh, swanky site using preview 3 including rigorous stress testing. </p>
<p>Page Output caching was our saviour and afforded us the ability to meet our performance contractual requirements.</p>
<p>My question is, is there a difference between action <code>OutputCacheFilter</code> and page out... | <p>Internally, the OutputCacheAttribute (aka output cache filter) uses the same internal mechanism as <a href="http://msdn.microsoft.com/en-us/library/hdxfb6cy.aspx" rel="nofollow noreferrer">page output caching</a> (aka the @OutputCache directive).</p>
<p>Therefore, it's not any faster than page output caching. Howev... | <p>Just be aware that there currently is a bug if you call Html.RenderAction(..) on an Action that is marked to be cached. Instead of the specific action being cached, the entire page gets cached. I reported this on codeplex already and it seems to be a known issue:
<a href="http://www.codeplex.com/aspnet/WorkItem/View... | 3,187 |
<p>I upgraded from SQl server 05 to 08 and had a few issues. After uninstalling 05 and a few restarts later 08 installed okay, but now I don't have any SQL Server services running.</p>
<p>I can't connect to (local)\SQLExpress or .\SQLEXPRESS via SQL Server management studio and the SQL Server services dialog shows no ... | <p>I've had similar issues and the solution we used was to reinstall SQL server 2008 and at the point where it asks you for default instance or named instance, used a named instance and continue on.</p>
<p>This does not affect any currently installed instances but creates a new instance of the name supplied and then f... | <p>If it's an instance you want to create you might wanna have a look at <a href="https://stackoverflow.com/questions/265081/how-to-create-default-instance-after-creating-a-named-instance">this question</a> - it might work the same way </p>
| 34,214 |
<p>Q.: How to get a cellular phone SMS "Long code" for use by U.S. carrier subscribers within U.S.?</p>
<p>Background: I'm building a web app that receives queries from/sends answers to cell phones. The app design (and business model) expects to communicate with cell devices via SMS, addressing the web app via an SMS ... | <p>This is not an easy task. First, you'll need to get a code. Then you have to negotiate with all the carriers to get them to recognize it.</p>
<p>Or you can use someone like Cell It (<a href="http://www.cellitmarketing.com/" rel="nofollow noreferrer">http://www.cellitmarketing.com/</a>) which has handled all of thes... | <p>I believe that I have answered your question in a different post. You can see it here:</p>
<p><a href="https://stackoverflow.com/questions/53019/what-kind-of-technologies-are-available-for-sending-text-messages#53067">What kind of technologies are available for sending text messages</a></p>
<p>Hopefully, it is wh... | 17,716 |
<p>If I want to create a .NET object in the powershell I write something like the following:</p>
<pre><code>[System.Reflection.Assembly]::LoadWithPartialName("System.Xml") | out-null"
$doc = new-object -typename System.Xml.XmlDocument"
</code></pre>
<p>If I want to call a static .Net method I use a command similar to... | <p>The brackets are used when you are using a static method on a given class. When you are instantiating a new object of a particular class, you don't need the brackets.</p>
<p>The brackets are also used to cast variables to a certain type</p>
<pre><code>PS C:\> $i = [int]"1"
PS C:\> $i.gettype().Name
Int32
PS ... | <p>Yes, the way you worded your question is a bit confusing.
System.Xml.XmlDocument and System.String are defined as classes, so you can use new-object for each of these to create an object of that particular type.</p>
<p>Just because you have "foo.bar.joe" doesn't mean that you're doing anything different than "abc.d... | 46,796 |
<p>What I would like to do is the following. I have a single table, Products, containing a private key ProductID. Instead of having SQL Server auto-increment ProductID on inserts, I want to increment it in the DataContext partial method "InsertProduct":</p>
<pre><code>Partial Public Class MyDataContext
Private Su... | <p>I would really recommend letting SQL Server do the incremental numbering. The above approach even if you do get it working would fail under load in a multi-user scenario where they both get the same ID and try to insert the same one.</p>
| <p>InsertProduct isn't declared as a partial method in the code above. Is this a typo in your post or have you declared it with a different signature than required and thus it is not being executed?</p>
<p>[EDIT] I'm not a VB programmer (I use C#), but I think your code needs to declare the code as partial as well... | 34,689 |
<p>Is it possible to use a C++ .lib file from within a C# program?</p>
| <p>Not directly. You can create a C++/CLI assembly that consumes the lib and then access that from C#, or you can wrap the lib as a DLL.</p>
| <p>That depends, do you have any limitations on this scenario?</p>
<p>If you have a lib file, it should be possible to first compile it into a DLL file, secondly exposing the functions you want to call in the DLL interface, and thirdly, call them using C# native methods (have a look at pinvoke.net on how to do this bi... | 19,248 |
<p>When I have a regular textbox in a UpdatePanel (not an ASP.NET control) with some JavaScript events on it, after the UpdatePanel updates my events are gone. Is there a way to re-attach my events after the update? (Preferably without putting my events inline).</p>
| <p>You can use the <a href="http://www.asp.net/AJAX/documentation/live/ClientReference/Sys.WebForms/PageRequestManagerClass/PageRequestManagerEndRequestEvent.aspx" rel="nofollow noreferrer">endRequest</a> event of the <a href="http://www.asp.net/AJAX/documentation/live/ClientReference/Sys.WebForms/PageRequestManagerCla... | <p>The events are gone because your textbox is a new element in the DOM (after the UpdatePanel refresh). As said by <a href="https://stackoverflow.com/questions/159252/how-do-i-perform-an-action-after-an-updatepanel-updates#159330">korchev</a>, use the endRequest event to re-attach the eventhandlers.</p>
| 19,263 |
<p>I love BlogEngine. But from what I can se it does not collect the standard information about the visitors I would like to see (referrer, browser-type and so on). </p>
<p>When I log in as Admin I have a menu item named "Referrer". I can choose a weekday and then I'll be presented with 1 or 2 rows with </p>
<p>"goog... | <p>This isn't an extension, but it's what I use to collect all my blogengine.net data and it should be upgrade safe.</p>
<p>When you log into the Blogengine.NET admin screens you can go to "Settings> Custome Code > Tracking Script", here you can put your <a href="http://www.google.com/analytics/" rel="nofollow norefer... | <p>For the vast majority of cases, Google Analytics does just fine. It all depends on how much data you want. For example, if you want to keep note of IP addresses and resolve them to get domain names, and also highlight all visits to your blog from, say, your coworkers at the company where you work, you'd have to writ... | 13,108 |
<p>I have a set of tables that are used to track bills. These tables are loaded from an SSIS process that runs weekly.</p>
<p>I am in the process of creating a second set of tables to track adjustments to the bills that are made via the web. Some of our clients hand key their bills and all of those entries need to be ... | <p>I personally would have the SSIS-fed tables in one database (set to simple recovery mode) and the other tables in a separate database on the same server which is set to full recovery mode,. Then I would set up backups on the second datbase on a regular schedule. A typical backup schedule would be full backup once a ... | <p>I personally would have the SSIS-fed tables in one database (set to simple recovery mode) and the other tables in a separate database on the same server which is set to full recovery mode,. Then I would set up backups on the second datbase on a regular schedule. A typical backup schedule would be full backup once a ... | 30,122 |
<p>I have a class with many embedded assets. </p>
<p>Within the class, I would like to get the class definition of an asset by name. I have tried using getDefinitionByName(), and also ApplicationDomain.currentDomain.getDefinition() but neither work.</p>
<p>Example:</p>
<pre><code>public class MyClass
{
[Embed(sou... | <p>This doesn't answer your question, but it may solve your problem. I believe doing something like this should work:</p>
<pre><code>public class MyClass
{
[Embed(source="images/image1.png")] private static var Image1Class:Class;
[Embed(source="images/image2.png")] private static var Image2Class:Class;
[Embed(s... | <p>Thank you so much! I just spent almost 5 hours trying to get the POS getDefinitionByName to work with the getQualifiedClassName that I was ready to throw stuff!! My final working code looks like this and even gets the string name from an array. </p>
<p>CreatureParam is a 2 dimentional array of strings;</p>
<p>T... | 11,312 |
<p>Are there any free online tools out there to make visio kind of diagrams. I would like to practice my flowchart skills. Are there any good sites or books or articles out there that discuss best practices for flowchart diagrams.</p>
| <p>Dia is an open source option:
<a href="http://projects.gnome.org/dia/" rel="noreferrer">http://projects.gnome.org/dia/</a></p>
| <p><a href="http://www.gliffy.com/" rel="nofollow noreferrer">Gliffy</a> is an online flowcharthing program.</p>
<p>Personally I use <a href="http://projects.gnome.org//dia/" rel="nofollow noreferrer">Dia</a>, an open source Visio kind of clone (it works under Windows, Linux and MacOSX).</p>
| 37,152 |
<p>With the MacPorts version of ImageMagick 6.4.4 installed, I'm getting an error installing the RMagick gem.</p>
<pre><code>/opt/local/bin/ruby extconf.rb update rmagick
checking for Ruby version >= 1.8.2... yes
checking for /usr/bin/gcc-4.0... yes
checking for Magick-config... no
Can't install RMagick 2.7.0. Can'... | <p>I suggest using <a href="https://brew.sh/" rel="nofollow noreferrer">Homebrew</a> instead of Macports. After installing Homebrew, run:</p>
<pre><code>brew install imagemagick
gem install rmagick
</code></pre>
| <p>I've run the install command, but I keep getting this error:</p>
<blockquote>
<p>/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- RMagick2.so (LoadError)</p>
</blockquote>
<p>Turns out it correctly builds the shared object file, but the name is "wrong".</p>
... | 19,859 |
<p>When manually controlling the z-axis in reprap, it works fine. If I use the home button, it doesn't move. Instead, it stalls/freezes/hangs. It attempts to turn, but can't successfully make a full turn. </p>
| <p>lower the moving speed of the Z-axis motor, search for </p>
<blockquote>
<p>homing feed rate</p>
</blockquote>
<p>in config.h as it looks like the given speed is to high.</p>
| <p>Looks like endstop signal for Z is inverted. In this case Z will move in manual mode but when homing it will try and stop as limit detected immediately. Change Z_MIN_ENDSTOP_INVERTING to opposite value.</p>
| 1,030 |
<p>In javascript how do I get a handle on the frame that I'm in based on an element in that frame?</p>
<pre><code>function myFunction(elementInFrame){
// here I want to get a handle on the frame that elementInFrame lives in
}
</code></pre>
| <p>elementInFrame.document.defaultView for non-IE browsers.</p>
<p>(It's not <em>quite</em> a standard part of the DOM; DOM Level 2 Views says the property exists but doesn't explicitly say it points to ‘window’, since the DOM standard currently known nothing about the window object.)</p>
| <p>In IE you can do <code>elementInFrame.document.parentWindow</code>
Doesn't work in Firefox unfortunately.</p>
<p>Edit: If you're using frames then in FF you could do it the long way... loop through all the frames until you find the element you're looking for.</p>
| 38,477 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.