instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>I have an Adventurer 3 printer from Flashforge and every time I unclog it, it gets clogged up again. I’ve done about 6 or 7 prints with it. So after I unclog it, I load the filament and it comes out of the nozzle like it should but once I start a 3D print, it’s clogged again. The process of what I do to unclog it is...
<p>I can see from the photo that filament melted and frozen thicker inside extruder. This is the problem and not the clogged extruder. This thick part produce a lot of friction and actually diameter grow until the print finally will stuck. Basically I had the same problem and I could guess that you are also using Bowde...
<p>The Flashforge documentation is not much help, so unless there's a way for you to connect with their user community (because, maybe what you're dealing with is a known issue related to firmware or the machine itself) or Flashforge's customer service folks, you've got some fun detective work ahead of you. Seriously--...
1,024
<p>Has Mono been ported to the iPhone yet? I'd love to write .NET apps for the iPhone, and learning Objective C isn't an option for me.</p>
<p>Mono today is available in two forms:</p> <ul> <li>Mono with bindings to iOS APIs per <a href="http://monotouch.net" rel="noreferrer">http://monotouch.net</a></li> <li>Mono as a scripting engine powering Unity3D</li> </ul>
<p>Sorry, kid, but Obj-C is the only way. Why is it "not an option"?</p> <p>Your app will be "not an option" to Apple for the App Store unless it's written in Obj-C on Xcode, and signed properly.</p>
49,377
<p>I am trying to access my WCF service on a server from my client console application for testing. I am getting the following error: </p> <blockquote> <p>The caller was not authenticated by the service</p> </blockquote> <p>I am using <code>wsHttpBinding</code>. I'm not sure what kind of authentication the serv...
<p>If you use basicHttpBinding, configure the endpoint security to "None" and transport clientCredintialType to "None."</p> <pre><code>&lt;bindings&gt; &lt;basicHttpBinding&gt; &lt;binding name="MyBasicHttpBinding"&gt; &lt;security mode="None"&gt; &lt;transport clientCredentialT...
<p>Why can't you just remove the security setting altogether for wsHttpBinding ("none" instead of "message" or "transport")?</p>
36,104
<p>Why won't my connection string to SQL server work with Windows authentication? A sql user works fine, acme\administrator or administrator@acme.com won't work. This is a Win Form app written in C#.</p> <pre><code> { OdbcConnection cn = null; String connectionString; connectionString = ...
<p>You are using SQL Server authentication.</p> <p>Windows authentication authenticates your connection with the Windows identity of the currently executing process or thread. You cannot set a username and password with Windows authentication. Instead, you set Integrated Security = SSPI.</p>
<p>You have to connect using a Trusted Connection.</p> <p>2005:</p> <pre><code>Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes; </code></pre> <p>2000:</p> <pre><code>Driver={SQL Server};Server=myServerAddress;Database=myDataBase;Trusted_Connection=Yes; </code></pre>
25,341
<p>One of the things that get me thoroughly confused is the use of <code>session.Flush</code>,in conjunction with <code>session.Commit</code>, and <code>session.Close</code>.</p> <p>Sometimes <code>session.Close</code> works, e.g., it commits all the changes that I need. I know I need to use commit when I have a trans...
<p>Briefly:</p> <ol> <li>Always use transactions</li> <li>Don't use <code>Close()</code>, instead wrap your calls on an <code>ISession</code> inside a <code>using</code> statement or <strong>manage the lifecycle of your ISession somewhere else</strong>.</li> </ol> <p>From <a href="http://nhibernate.info/doc/nh/en/index...
<p>Here are two examples of my code where it would fail without session.Flush():</p> <p><a href="http://www.lucidcoding.blogspot.co.uk/2012/05/changing-type-of-entity-persistence.html" rel="nofollow noreferrer">http://www.lucidcoding.blogspot.co.uk/2012/05/changing-type-of-entity-persistence.html</a></p> <p>at the en...
6,492
<p>Here's another problem with qt: I extend a QAbstractTableModel, but I get a compiling error ( I'm using cmake)</p> <pre><code>// file.h #ifndef TABLEMODEL_H #define TABLEMODEL_H #include &lt;QAbstractTableModel&gt; class TableModel : public QAbstractTableModel { Q_OBJECT public: TableModel(QObject *parent = 0); ...
<p>Make sure you're running your header through MOC, and are linking those MOC object files.</p>
<p>This is a fairly common bug when an <a href="http://doc.qt.io/archives/4.6/debug.html#common-bugs" rel="nofollow noreferrer">object isn't moc'ed</a>. I'd read the whole <a href="http://doc.qt.io/archives/4.6/debug.html" rel="nofollow noreferrer">debugging document</a> to save yourself some time down the road.</p>
41,703
<p>I'm running my first project that I'm compiling with flex builder. Before I used to compile with flash or flash develop.</p> <p>For a while it worked pretty neatly. But as soon as it start throwing typeerrors, I can't seem to compile the updated and saved actionscript files. It seems as if it keeps stuck in time an...
<p>Have you tried doing a Clean? In FlexBuilder, the Project menu, select Clean...</p> <p>It's possible Flex is building off of temp files, in which case doing a clean should clear them out.</p>
<p>Minimize Eclipse and see if any other windows are lurking behind the IDE, also try terminating all sessions, and like Herms suggested go to Project->Clean...->YourProject</p> <p>I'm sure Chris already moved on since '08 but for anyone else this solved the problem for me.</p>
27,525
<p>At what level of complexity is it mandatory to switch to an existing framework for web development?</p> <p>What measurement of complexity is practical for web development? Code length? Feature list? Database Size?</p>
<p>If you work on several different sites then by using a common framework across all of them you can spend time working on the code rather than trying to remember what is located where and why.</p> <p>I'd always use a framework of some sort, even if it's your own, as the uniformity will help you structure your projec...
<p>All factors matter. You should measure how much time you can save using 3rd party framework and compare it to the risks of using other's code</p>
9,385
<p>I am working on an ASP.NET web application that is required to bring up a popup on a roolover. I am using the "OnMouseOver" event and it works as expected. The problem is that the event is on a "hair trigger"; even a casual passage of the mouse over the control brings up the popup (which then must be manually dism...
<p>One solution that comes to mind, there may be better ways though:</p> <ol> <li>Make the <code>onmouseover</code> call the function via a <code>setTimeout</code> delay</li> <li>Inside the function, check the mouse is actually over that element.</li> </ol> <p>You could also use an <code>onmouseout</code> to clear th...
<p>What I ended up doing is as follows (oRow is a table row but it could be any control):</p> <pre><code>function ItemMouseOver(oRow, "parameters for the popup") { oRow.showTimer = window.setTimeout(function() { alert('popup'); }, 1000); } function ItemMouseOut(oRow) { if (oRow.s...
44,874
<p>I currentyl have no clue on how to sort an array which contains UTF-8 encoded strings in PHP. The array comes from a LDAP server so sorting via a database (would be no problem) is no solution. The following does not work on my windows development machine (although I'd think that this should be at least a possible s...
<pre><code>$a = array( 'Кръстев', 'Делян1', 'делян1', 'Делян2', 'делян3', 'кръстев' ); $col = new \Collator('bg_BG'); $col-&gt;asort( $a ); var_dump( $a ); </code></pre> <p>Prints:</p> <pre><code>array 2 =&gt; string 'делян1' (length=11) 1 =&gt; string 'Делян1' (length=11) 3 =&gt; string 'Делян2' (length=11) ...
<p>Your collation needs to match the character set. Since your data is UTF-8 encoded, you should use a UTF-8 collation. It could be named differently on different platforms, but a good guess would be <code>de_DE.utf8</code>.</p> <p>On UNIX systems, you can get a list of currently installed locales with the command</p>...
14,634
<p>An MXML component can be quite complex, containing many nested controls, including asynchronously loaded content such as Image/SWFLoader.</p> <p>Is there one event I can watch for on my component that will only be raised when every control and sub-component has loaded, including SWFs and Images?</p>
<p>CreationComplete will NOT do the trick if you are talking about loading swf content or anything really external like that. CreationComplete gets fired when the MXML components have been laid out as defined in MXML (IE nested components, buttons, boxes, canvasses, etc.), so content that needs to get loaded externall...
<p>The onApplicationComplete event?</p>
18,722
<p>What is reflection, and why is it useful?</p> <p>I'm particularly interested in Java, but I assume the principles are the same in any language.</p>
<p>The name reflection is used to describe code which is able to inspect other code in the same system (or itself).</p> <p>For example, say you have an object of an unknown type in Java, and you would like to call a 'doSomething' method on it if one exists. Java's static typing system isn't really designed to support ...
<p><strong>IMPORTANT</strong></p> <p>Starting from Java 9 you can no longer use reflection, unless the package-info.java <strong>opens</strong> the module to reflection access.</p> <p>By default, &quot;reflection&quot; access is denied to all packages in the module.</p> <p>See <a href="https://www.oracle.com/corporate/...
5,840
<p>I've written a script which takes the summary of an order and stores in into an XML file, except the problem is that I don't want people to be able to open the XML file in their browser, obviously.</p> <p>I'm hosted on a very dodgy shared server with limited abilities: no SSH, for starters.</p> <p><strong>Is there...
<p>You could create a directory containing a <code>.htaccess</code> file that looks something like the following:</p> <pre><code>Deny from all </code></pre> <p>This will instruct Apache not to serve files from that directory; any attempts to access the directory or its contents will be met with a "403 Forbidden" resp...
<p>Couldn't you ask the shared-hosting provider to create an outside-web-root folder <strong>for you</strong>? I've certainly done this in the past.</p>
39,106
<p>Typically when writing new code you discover that you are missing a #include because the file doesn't compile. Simple enough, you add the required #include. But later you refactor the code somehow and now a couple of #include directives are no longer needed. How do I discover which ones are no longer needed? </p> <...
<p>You can use <a href="http://www.gimpel.com/" rel="nofollow noreferrer">PC-Lint/FlexeLint</a> to do that.</p> <p>Unusually there isn't a free OS version of the tool available.</p> <p>You can remove #includes by passing by reference instead of passing by value and forward declaring. This is because the compiler does...
<p>Here is 'brute force' VC6 macro which works on single <strong><em>.cpp</strong> or <strong></em>.h</strong> file opened in editor by commenting include by include and running compile:</p> <pre><code>Sub RemoveNotUsedIncludes() 'Check if already processed; Exit if so ActiveDocument.Selection.FindText "//INCLUDE NOT...
7,467
<p>I have the following attributes in my DB.</p> <blockquote> <p>statistic id, devicename, value, timestamp.</p> </blockquote> <p>For a given statistic, I want to find the 2 most recent timestamps and corresopnding values for a every unique device.</p> <p>I am trying stuff like </p> <p>Trial 1)</p> <pre><code>se...
<p>This is how I solve this type of problem:</p> <pre><code>SELECT x.statistic, x.devicename, x.value, x.timestamp FROM X_STATSVALUE AS x LEFT OUTER JOIN X_STATSVALUE AS x2 ON (x.statistic = x2.statistic AND x.devicename = x2.devicename AND x.timestamp &lt; x2.timestamp) GROUP BY x.statistic, x.devicen...
<p>Try something like :</p> <pre><code>SELECT DISTINCT x.statistic, x.devicename, x.value, x.timestamp FROM X_STATSVALUE AS x WHERE x.timestamp IN (SELECT timestamp FROM X_STATSVALUE WHERE devicename = x.devicename AND statistic = x.statistic ORDER BY t...
46,206
<p>What's the best way to make a linked list in Java?</p>
<p>The obvious solution to developers familiar to Java is to use the <strong>LinkedList</strong> class already provided in <strong>java.util</strong>. Say, however, you wanted to make your own implementation for some reason. Here is a quick example of a linked list that inserts a new link at the beginning of the list, ...
<p>Its much better to use java.util.LinkedList, because it's probably much more optimized, than the one that you will write.</p>
3,131
<p>I am thinking about something like this:</p> <pre><code>public static &lt;T extends Comparable&lt;T&gt;&gt; T minOf(T...ts){ SortedSet&lt;T&gt; set = new TreeSet&lt;T&gt;(Arrays.asList(ts)); return set.first(); } public static &lt;T extends Comparable&lt;T&gt;&gt; T maxOf(T...ts){ SortedSet&lt;...
<p>What's wrong with <a href="http://java.sun.com/javase/6/docs/api/java/util/Collections.html#max(java.util.Collection)" rel="noreferrer">Collections.max</a>?</p> <p>And why do you care about null safety? Are you sure you want to allow nulls to be in your Collection?</p>
<p>You <em>should not</em> implement <code>Comparable</code> to accept null, as it breaks the interface's contract.</p> <p>From <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html" rel="nofollow noreferrer">https://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html</a> : </p> <blockq...
48,243
<p>A fellow maker has tried printing a 3D model in clear PLA (&lt;5% infill, 1 or 2 perimeters), burying it most of the way into casting sand, and then pouring molten aluminum. This melts and burns the PLA, and the aluminum takes the space that the printed model used to take.</p> <p>There's plenty of room for improvem...
<p>Print a two part negative (mold) of your objects. <a href="http://www.thingiverse.com/thing:31581" rel="nofollow">http://www.thingiverse.com/thing:31581</a></p> <p><a href="https://pinshape.com/blog/how-to-generate-a-3d-printed-mold-for-an-object/" rel="nofollow">https://pinshape.com/blog/how-to-generate-a-3d-print...
<p>I believe casting typically uses a wax for the positive when using casting sand. So, I would suggest using <a href="http://www.machinablewax.com/product.php?product=52" rel="nofollow">wax filament</a> in your 3D printer.</p> <p>I would try to shy away from hard polymers like PLA/ABS/Nylon (all typical 3D printing f...
128
<p>I've done many web apps where the first thing you do is make a user table with usernames, passwords, names, e-mails and all of the other usual flotsam. My current project presents a situation where non-users records need to function similarly to users, but do not need to the ability to be a first order user. </p> ...
<p>This is certainly a good idea, as you are normalizing the database. I have done a similar design in an app that I am writing, where I have an employee table and a user table. Users may a from an external company or an employee, so I have separate tables because an employee is always a user, but a user may not be an ...
<p>I always try to avoid as much data repetition as possible. If not all people need to login, you can have a generic <code>people</code> table with the information that applies to both people and users (eg. firstname, lastname, etc).</p> <p>Then for people that login, you can have a <code>users</code> table that has ...
11,841
<p>What would be the simplest way to daemonize a python script in Linux ? I need that this works with every flavor of Linux, so it should only use python based tools. </p>
<p>See <a href="http://www.kohala.com/start/" rel="noreferrer">Stevens</a> and also this <a href="http://code.activestate.com/recipes/278731/" rel="noreferrer">lengthy thread on activestate</a> which I found personally to be both mostly incorrect and much to verbose, and I came up with this:</p> <pre><code>from os imp...
<p>Use <a href="http://www.clapper.org/software/python/grizzled/" rel="nofollow noreferrer">grizzled.os.daemonize</a>:</p> <pre><code>$ easy_install grizzled &gt;&gt;&gt; from grizzled.os import daemonize &gt;&gt;&gt; daemon.daemonize() </code></pre> <p>To understand how this works or to do it yourself, read <a href...
14,134
<p>I have a rather large file (150 million lines of 10 chars). I need to split it in 150 files of 2 million lines, with each output line being alternatively the first 5 characters or the last 5 characters of the source line. I could do this in Perl rather quickly, but I was wondering if there was an easy solution using...
<p>Homework? :-)</p> <p>I would think that a simple pipe with sed (to split each line into two) and split (to split things up into multiple files) would be enough.</p> <p>The man command is your friend.</p> <hr> <p>Added after confirmation that it is not homework:</p> <p>How about</p> <pre><code>sed 's/\(.....\)...
<p>I think that something like this could work:</p> <pre><code>out_file=1 out_pairs=0 cat $in_file | while read line; do if [ $out_pairs -gt 1000000 ]; then out_file=$(($out_file + 1)) out_pairs=0 fi echo "${line%?????}" &gt;&gt; out${out_file} echo "${line#?????}" &gt;&gt; out${out_fil...
8,928
<p>If you have a Java object and an XML schema (XSD), what is the best way to take that object and convert it into an xml file in line with the schema. The object and the schema do not know about each other (in that the java classes weren't created from the schema).</p> <p>For example, in the class, there may be an in...
<p>I believe this can be achieved via JAXB using it's annotations. I've usually found it much easier to generate Objects from JAXB ( as defined in your schema) using XJC than to map an existing Java object to match my schema. YMMV.</p>
<p>I would say JAXB or Castor. I have found Castor to be easier to use and more reliable, but JAXB is the standard</p>
32,890
<pre><code>private static final GridLayout layout = new GridLayout( 3, 1, 1, 0 ); </code></pre> <p>in this line of code what do the numbers represent and how do you use them to arrange the checkboxes and buttons in the window?</p>
<p>I refer you to: <a href="http://java.sun.com/javase/6/docs/api/java/awt/GridLayout.html" rel="noreferrer">http://java.sun.com/javase/6/docs/api/java/awt/GridLayout.html</a></p>
<p>I refer you to: <a href="http://java.sun.com/javase/6/docs/api/java/awt/GridLayout.html" rel="noreferrer">http://java.sun.com/javase/6/docs/api/java/awt/GridLayout.html</a></p>
47,096
<p>I am trying to add a project reference or swc to papervision in FlashDevelop but intellisense isn't picking it up. I've done it before but i forgot how.</p> <p>Thanks.</p>
<p>Add your swc to the lib folder of your project. Then right-click it and mark "Add To Library".</p>
<p>In the menus:</p> <pre><code>Project -&gt; Properties -&gt; Compiler Options -&gt; SWC Libraries </code></pre> <p>(and then add the path or file to the list)</p>
13,547
<p>Visual studio is pretty good but doesn't create stored procedures automatically. Iron Speed designer does supposedly. But is it any good?</p>
<p>I have used Ironspeed extensively for the past two years for most of our ASP.NET forms over data projects. </p> <p>It works. Does several things well: stored procs, fast layout of table browse and CRUD screens, fast layout of single record CRUD screens. It manages the round-trip (or half-round trip) process decentl...
<p>Iron Speed Designer is great for simple CRUD type web applications. You can find some useful information on our web site <a href="http://www.dotnetarchitect.co.uk/" rel="nofollow">http://www.dotnetarchitect.co.uk/</a></p>
10,854
<p>I need to combine a VB web project and a C# web project and have them run alongside each other in the same web root. For instance, I need to be able to navigate to <code>localhost:1234/vbProjPage.aspx</code> and then redirect to <code>localhost:1234/cSharpProjPage.aspx</code>. Is this possible from within Visual S...
<p>You can do this using sub-web projects. This has been available in Visual Studio since 2005 and works with the Web Application Project style of web site. <a href="http://weblogs.asp.net/scottgu/archive/2006/08/16/tip_2f00_trick_3a00_-creating-sub_2d00_web-projects-using-the-vs-2005-web-application-project-option.asp...
<p>I don't think you'll be able to have two seperate projects but intermixing them within one project isn't a problem. You could always organize the files into folder to keep things seperate if you felt the need.</p>
12,971
<p>I printed this <a href="https://www.thingiverse.com/thing:4775702" rel="nofollow noreferrer">Curvy vase</a> from Thingiverse and it came out pretty well on my Chiron.</p> <p><a href="https://i.stack.imgur.com/AP0wQ.jpg" rel="nofollow noreferrer" title="Curvy vase print"><img src="https://i.stack.imgur.com/AP0wQ.jpg"...
<p>There is a <a href="https://support.ultimaker.com/hc/en-us/articles/360012512340-Shell-settings" rel="nofollow noreferrer">Cura option</a> to choose a random seam alignment in the shell menu:</p> <p><a href="https://i.stack.imgur.com/I6UXi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/I6UXi.png"...
<p>Use Cura's &quot;Vase Mode&quot; (known as <code>Spiralize Outer Contour</code>) for seamless printing.</p>
1,878
<p>I am trying to see what are the gotchas in using XmlHttpWebRequest such that it works for Safari, Firefox and IE?</p>
<p>probably the most obvious difference is how to get an XMLHttpRequest in the first place:</p> <pre><code>var xhr; if (window.XMLHttpRequest) { xhr = new XMLHttpRequest(); // Mozilla/Webkit/Opera } else if (window.ActiveXObject) { xhr = new ActiveXObject('Msxml2.XMLHTTP'); // IE } else { throw new Error('Aja...
<p>I know it's a bit of a cop-out answer, but this sort of thing will drive you insane if you use the built-in and inconsistent-across-browsers methods. Pick any javascript library and breathe a sigh of relief.</p>
35,830
<p>What would be the easiest way to view classes, methods, properties, etc. inside a jar file? I'm looking for something equivalent to the very useful <I> Lutz Roeder .NET Reflector </I> - for Java</p>
<p>Using the JDK, <code>jar -tf</code> will list the files in the jar. <code>javap</code> will give you more details from a particular class file.</p>
<p>You could try <a href="http://sourceforge.net/project/showfiles.php?group_id=42094" rel="nofollow noreferrer">JarSpy</a>. There is an IDEA plugin version of it that I use.</p>
41,465
<p>I am looking for a way to delete all files older than 7 days in a batch file. I've searched around the web, and found some examples with hundreds of lines of code, and others that required installing extra command line utilities to accomplish the task.</p> <p>Similar things can be <a href="https://stackoverflow.co...
<p>Enjoy:</p> <pre><code>forfiles -p "C:\what\ever" -s -m *.* -d &lt;number of days&gt; -c "cmd /c del @path" </code></pre> <p>See <a href="http://ss64.com/nt/forfiles.html" rel="noreferrer"><code>forfiles</code> documentation</a> for more details.</p> <p>For more goodies, refer to <em><a href="http://www.ss64.com/n...
<p>More flexible way is to use <a href="https://github.com/npocmaka/batch.scripts/blob/master/hybrids/jscript/FileTimeFilterJS.bat" rel="nofollow noreferrer"><code>FileTimeFilterJS.bat</code></a>:</p> <pre><code>@echo off :::::::::::::::::::::: set &quot;_DIR=C:\Users\npocmaka\Downloads&quot; set &quot;_DAYS=-5&quot; ...
7,393
<p>I would like to display a Drupal view without the page template that normally surrounds it - I want just the plain HTML content of the view's nodes.</p> <p>This view would be included in another, non-Drupal site.</p> <p>I expect to have to do this with a number of views, so a solution that lets me set these up rap...
<p>I was looking for a way to pull node data via ajax and came up with the following solution for Drupal 6. After implementing the changes below, if you add ajax=1 in the URL (e.g. mysite.com/node/1?ajax=1), you'll get just the content and no page layout.</p> <p>in the template.php file for your theme:</p> <pre><code...
<p>If I understand your question, you want to have nodes which contain all the HTML for a page, from DOCTYPE to &lt;/HTML&gt;. What I would do is create a content type for those nodes -- "fullhtml" as its machine-readable name -- and then create a node template for it called node-fullhtml.tpl.php. You can't just dump...
30,813
<p>I am wondering if it is possible to have a sort of thumbnail image gallery, in which clicking on a thumbnail would show the full image in a layer. I was wondering if it was possible to load all layers and respective images and use javascript to change the z index or something similar to avoid having to reload or lea...
<p>Yes, you can do it without a framework:</p> <pre><code>&lt;div id='big' style='width:500px;height:500px'&gt;&lt;/div&gt; &lt;a href="javascript://load big image" onclick="document.getElementById('big').style.backgroundImage='url(Big.gif)'"&gt;&lt;img border="0" src="images/Thumb.gif" /&gt;&lt;/a&gt; </code></pre> ...
<p><a href="http://jquery.com/" rel="nofollow noreferrer">JQuery</a> should be able to make what you want.</p> <p>You have multiple thumbnails developped with it, like:</p> <ul> <li><a href="http://www.robertnyman.com/picture-slides/" rel="nofollow noreferrer">Picture-slide</a></li> <li><a href="http://herr-schuessle...
41,444
<p>I have an Ubuntu Server (with all of LAMP and Subversion installed). I use Eclipse with Subclipse, PDT and a few other great addins and use those exclusively to develop applications. The problem I'm having is that I'm developing on a Windows Vista machine and transferring everything to the remote Linux server. </...
<p>You could use VMWare or Virtual PC to virtualise a linux build, or run the AMP stack up in <a href="http://www.cygwin.com/" rel="nofollow noreferrer">Cygwin</a>. Architecturally, Cygwin is a port of glibc adapted to sit on top of the Windows system call layer - it provides a unix-like system on top of Windows. The...
<p>I agree with NXC's answer (+1 ;) ), and here is a practical procedure to install a <a href="http://cmsproducer.com/Ubuntu-Linux-Windows-VMware-Server" rel="nofollow noreferrer">Linux on Windows XP using VMware Server</a>.</p> <p>That way, you will be able to deploy your server file directly on the target platform, ...
34,706
<p>What is the ideal code to logging ratio? I'm not used to writing logs as most of the applications I've developed have not had much logging.</p> <p>Recently though I've changed job, and I've noticed that you can't see the application code for the calls to log4net. I appreciate that this is useful but surely having t...
<p>Since log4net does a great job at not clogging up the resources, I tend to be a little verbose on logging because when you have to change to debug mode, the more info you have, the better. Here's what I typically log:</p> <p><strong>DEBUG Level</strong></p> <ul> <li>Any parameters passed into the method</li> <li>A...
<p>I think another factor is the toolset/platform being used and the conventions that come with it. For example, logging seems to be quite pervasive in the J(2)EE world, whereas I can't remember ever writing a log statement in a Ruby on Rails application.</p>
18,534
<p>I'm writing an app in C# (.net 3.5) and I have a question about class design: </p> <p>I'd like to create a class which accesses a file (read, write) and provides its content to the users (instanciators) of the class. The most common operation on an instance will be to retrieve a certain value from the file. The act...
<p>Firstly, make your class implement an appropriate interface. That way, clients can test their behaviour without needing real files at all.</p> <p>Testing the thread safety is hard - I've never seen anything which is really useful on that front, though that's not to say the tools aren't out there.</p> <p>For unit t...
<p>Regarding thread safety: Thread safety is not an issue unless multiple threads <em>within a single application</em> will be referring to the same instance of your class concurrently. Unless your class is contained within an out of process server, there is no way for multiple applications to refer to the same instan...
25,537
<p>I'm tasked with replicating a production environment to create many test/sit environments.</p> <p>One of the things I need to do is build up Perl, with all the modules which have been installed (including internal and external modules) over the years. I could just use CPAN.pm autobundle, but this will result in the...
<p>bdfoy has the best large scale solution, but if you just want to install a few modules you can ask the CPAN shell to install a specific distribution by referencing a path to a tarball (relative to the top of the CPAN tree).</p> <pre><code>cpan&gt; install MSCHWERN/Test-Simple-0.62.tar.gz </code></pre> <p>Throw a U...
<p><a href="https://stratopan.com" rel="nofollow noreferrer">Stratopan.com</a> is another alternative. Stratopan provides private CPANs in the cloud. You can fill your Stratopan repository with specific versions of modules (and their dependencies) and then install them using the standard Perl tool chain. The reposit...
32,579
<p>I have a directory on a linux box that I want to make publicly readable using Tomcat (5.5). I think this is easy to set up but can't find the appropriate documentation. Is there a simple way to accomplish this?</p>
<p>It is possible by defining that directory as an web application, but it's not really what Tomcat is designed to do, other servers are far better at serving static content.</p> <p>The way to define a directory as a webapp is to either</p> <ul> <li>put it into <code>$TOMCAT_HOME/webapps</code>,</li> <li>configure it...
<p>Although Tomcat is a good web server, it's not particularly made to list directories. </p> <p>You might want to look at a web server like the <a href="http://www.apache.org/" rel="nofollow noreferrer">Apache</a> web server instead, it's more designed for this type of thing.</p>
48,188
<p>Can I call a function from lisp from a library written in c or c++? How can I extend lisp? This is useful when you want to do some system calls or stuff like that.</p>
<p>It is unusual to call non-lisp code from lisp, and rarely necessary. CLX (the X11 client implementation for CL) doesn't link to the Xlib implementation but "speaks" X11 directly. On any system, your CL implementation is likely to already have excellent operating system hooks rendering this unnecessary.</p> <p>That ...
<p><a href="http://common-lisp.net/project/cffi/" rel="nofollow noreferrer">CFFI</a>!</p>
49,666
<p>I know that new-ing something in one module and delete-ing it in another can often cause problems in VC++. Problems with different runtimes. Mixing modules with staticly linked runtimes and/or dynamically linked versioning mismatches both can screw stuff up if I recall correctly.</p> <p><strong>However, is it safe ...
<p>Freeing the memory is safe, so long as it all came from the same <em>memory management</em> context. You've identified the most common issue (different C++ runtimes); having separate heaps is another less-common issue you can run into.</p> <p>Another issue which you didn't mention, but which can be exascerbated by...
<p>I'd guess it is as safe as to use any of the classes in <code>std</code> across modules.</p> <p>That is: It should be safe if the modules use exactly the same runtime library, and exactly the same compiler switches and options.</p> <p>Never use the static runtime library, as each module will get their own instance...
44,886
<p>I have a group of checkboxes that I only want to allow a set amount to be checked at any one time. If the newly checked checkbox pushes the count over the limit, I'd like the oldest checkbox to be automatically unchecked. The group of checkboxes all use the same event handler shown below.</p> <p>I have achieved the...
<p>I think you are looking for a <a href="http://msdn.microsoft.com/en-us/library/he2s3bh7.aspx" rel="nofollow noreferrer">LinkedList</a>.</p> <p>Use <code>AddLast</code> instead of <code>Enqueue</code> and <code>RemoveFirst</code> instead of <code>Dequeue</code> and for removing something in the middle, just use a no...
<p>If you ask a user to pick form a list of options and limit the number of choices it is likely that the first choice is there primary choice.</p> <p>e.g. Pick two, you will never have any of what you don't choose:</p> <ul> <li>Money</li> <li>Power</li> <li>Sex</li> <li>Excitement</li> <li>Gadgets</li> <li>Army of C...
13,565
<p>How do I open the default mail program with a Subject and Body in a cross-platform way?</p> <p>Unfortunately, this is for a a client app written in Java, not a website.</p> <p>I would like this to work in a cross-platform way (which means Windows and Mac, sorry Linux). I am happy to execute a VBScript in Windows, ...
<p>In Java 1.6 you have a stardard way to open the default mailer of the platform: <a href="http://java.sun.com/javase/6/docs/api/java/awt/Desktop.html" rel="noreferrer">the Desktop.mail(URI) method</a>.The URI can be used to set all the fields of the mail (sender, recipients, body, subject). You can check a full examp...
<p>I have implemented this, and it works well on OS X. (Ryan's mention of the max URL length has not been codified.)</p> <pre><code>public void email(String subject, String body) throws Exception { String cmd = "open mailto:"; cmd += "?subject=" + urlEncode(subject); cmd += "&amp;body=" + urlEncode...
3,804
<p>I'm trying to generate pairwise combinations of rows on based on their ids. SQLite version is 3.5.9. The table contents are the following:</p> <pre><code>id|name|val 1|A|20 2|B|21 3|C|22 </code></pre> <p>with table schema being:</p> <pre><code>CREATE TABLE mytable ( id INTEGER NOT NULL, name VARCHAR, ...
<p>Seems to be a bug in SQLite - the first result you posted is, as you suspected, wrong. I've tested it on both PG8.3 and sqlite3.6.4 on my workstation, couldn't reproduce. Got correct result in all cases. Might be linked to your sqlite version; try upgrading.</p>
<pre><code>SQLite version 3.6.2 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite&gt; create table mytable ( ...&gt; id integer not null, ...&gt; name varchar, ...&gt; val integer, ...&gt; primary key (id) ...&gt; ); sqlite&gt; insert into mytable values(null,'A',20); sqlit...
39,065
<p>I'd like to give my boyfriend a taste of programming. If it was up to me, I'd teach Scheme, Haskell or F# but since he'd rather learn something that can be useful in his job as a fiscal consultant, i.e. programming Excel.</p> <p>What are the options for programming Excel? Which one would you recommend for someone w...
<p>As a long time (business) Excel user and programmer, I recommend starting with a good VBA book that focuses on the key features of the Basic language, and how to communicate with the Excel objects (workbooks, sheets, etc). I wouldn't worry about userforms, initially - I haven't used those for years - and I wouldn't ...
<p>Macros are one way to program Excel. Check out this YouTube video: <a href="http://in.youtube.com/watch?v=k_fWcffRAG4" rel="nofollow noreferrer">http://in.youtube.com/watch?v=k_fWcffRAG4</a> It demonstrates how to Record and use Macro.</p>
35,013
<p>We have a file that has a 64 bit integer as a string in it. How do we scanf() or otherwise parse this numeric string into an unsigned 64 bit integer type in C++ ? </p> <p>We are aware of things like %lld etc., but a lot of ways to do this parse seem to break compiles under different compilers and stdlibs. The code ...
<p>GCC has long long, as will compilers for C++0x. MSVC++ doesn't (yet), but does have its __int64 you can use.</p> <pre><code>#if (__cplusplus &gt; 199711L) || defined(__GNUG__) typedef unsigned long long uint_64_t; #elif defined(_MSC_VER) || defined(__BORLANDC__) typedef unsigned __int64 uint_64_t; #else #e...
<p>Don't use <code>scanf()</code>, tokenize your input separately and then use <code>strtoull()</code> or similar.</p>
31,522
<p>I'm sick of remembering all the passwords for different logins. Lately I found the interesting tool <a href="http://www.xs4all.nl/~jlpoutre/BoT/Javascript/PasswordComposer/" rel="nofollow noreferrer">password composer</a> which lets you generate passwords base on the <strong>hostname</strong> and a secret <strong>ma...
<p>Why don't you just use the exact same algorithm as the password composer?</p> <ul> <li>Pick a master password</li> <li>Take the application/machine name for which you want a password</li> <li>Concatenate the two (or shuffle)</li> <li>Apply a code you can do in your head, like <a href="http://en.wikipedia.org/wiki/C...
<p>Something I used to do (before I started using <em>pwgen</em> to generate my passwords) was to find a nearby paper document and use the first and last character of each line. So long as you know which document goes with which account, regenerating the password is easy if you lose/forget it and no computer is requir...
16,618
<p>Is there a way to have % in vim find the next ([{ or whatever, even if it is not on the same line?</p> <p>Example:</p> <pre><code>int main(int argc, char ** argv) { #Your cursor is somewhere in this comment, I want #it to get to the ( after printf printf("Hello there.\n"); } </code></pre>
<p>If you want to find opening braces on subsequent lines, without plugins, just enter normal mode and type:</p> <pre><code>/{ [enter] </code></pre> <p>Where { is the type of brace your looking for.</p> <p>You can then browse them all with <kbd>n</kbd> and <kbd>N</kbd>.</p> <p>To map the <kbd>F12</kbd> key to turn ...
<p>That's puzzling... For me, % finds the matching close for any {[( no matter how many lines away the match is. I don't see anything in my .vimrc that would change this behaviour, offhand.</p>
33,076
<p>I've used several apps now that launch the itunes store directly from the app. I'm even using some on my 2.1 iPod 2G.</p> <p>I know there's a bug in 2.1 that prevents appstore links from working in safari, but somehow people are launching the appstore directly, not even through safari.</p> <p>How do you do this? I...
<p>From iTunes, drag the icon of your app to the desktop, this will give you a link you can use directly (for example, <a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=284036524&amp;mt=8" rel="noreferrer"><a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=284036524&amp;...
<p>If you are just releasing your app... you won't have an "app ID #" yet... so none of those methods will work.</p> <p>I had to insert a "non-working link" in my v1.0... and then later in my v1.1 update... added the actual link and app ID #.</p>
28,083
<p>When should I <strong>not</strong> use the ThreadPool in .Net?</p> <p>It looks like the best option is to use a ThreadPool, in which case, why is it not the only option?</p> <p>What are your experiences around this?</p>
<p>The only reason why I wouldn't use the <code>ThreadPool</code> for cheap multithreading is if I need to&hellip;</p> <ol> <li>interract with the method running (e.g., to kill it)</li> <li>run code on a <a href="http://msdn.microsoft.com/en-us/library/system.stathreadattribute.aspx" rel="nofollow noreferrer" title="S...
<p>@Eric</p> <blockquote> <p>@Derek, I don't exactly agree with the scenario you use as an example. If you don't know exactly what's running on your machine and exactly how many total threads, handles, CPU time, RAM, etc, that your app will use under a certain amount of load, you are in trouble.</p> </blockquote> <...
3,148
<p>I am adding membership-related schemas to an existing database (lets call it myDatabase) following <a href="https://web.archive.org/web/20210506052241/http://aspnet.4guysfromrolla.com/articles/040506-1.aspx" rel="nofollow noreferrer">those instructions</a>.</p> <p>As a results the number of tables, views and stored...
<p>I looked it up a bit, </p> <ol> <li>The standard connection can be used</li> <li>In terms of permissions it looks like it is a matter of assigning the database user to the aspnet_Membership_FullAccess role (<a href="http://msdn.microsoft.com/en-us/library/ms164596(VS.80).aspx" rel="nofollow noreferrer">other roles ...
<ol> <li>It's perfectly okay to use the same user/database as your application.</li> <li>I don't know, sorry. </li> </ol>
35,963
<p>I have converted one of my VS2006 projects into VS2008 and when trying to build the project in VS2008 I get the above error. What is .sbr file ? and how can I fix the compile error? Any help is hugely appreciated.</p>
<p>An .sbr file is used to keep the "browse information" for symbol browsing within the projects. It's created at the same time as its source .cpp file gets complied. </p> <p>If VS cannot find an .sbr file, it means that the source .cpp was not compiled properly. Try to "rebuild" the project (rather than just "build" ...
<p>I'm new to c++ and I'm using Visual Studio 2008. I was trying to add a new class to a large program and got the same error (BK1506). </p> <p>The problem for me was that I had not implemented my class correctly using: </p> <pre><code>namespace ns { class Name { }; } </code></pre> <p>Although this most...
13,456
<p>I know there is a command line syntax for adding custom stacks to the OSX Leopard dock besides the "Downloads" which comes by default. What is it?</p>
<p><a href="http://code.google.com/p/dockutil/" rel="nofollow noreferrer">http://code.google.com/p/dockutil/</a></p>
<p>While this doesn't completely answer your question, <a href="http://www.tuaw.com/2008/09/16/terminal-tips-add-recent-applications-as-a-stack-on-dock/" rel="nofollow noreferrer">this page</a> has some info on how to add a "recent items" stack to the Dock. Maybe that will help you to figure out what the generic syntax...
20,018
<p>I'm interested in making desktop widgets, similar to Apple's Dashboard or what Vista has. I'd like to make them cross-platform, if possible. Opera's widgets are cross-platform but require the user to have Opera installed, so that's a big limitation.</p> <p>I know most widgets are made with HTML/XML, CSS, and Javasc...
<p>You should take a look at what the guys at <a href="http://www.digsby.com/" rel="nofollow noreferrer">Digsby</a> are doing. Basically, they've written a port of <a href="http://wxwebkit.wxcommunity.com/" rel="nofollow noreferrer">WebKit to wxWidgets</a>, and then use WebKit to render the interface, and wxPython for ...
<p>You can check out <a href="http://www.pygtk.org/" rel="nofollow noreferrer">PyGTK</a>, which will allow you to create desktop widgets, but they won't be managed by OSX's Dashboard. If you'd like to <a href="http://developer.apple.com/macosx/dashboard.html" rel="nofollow noreferrer">develop an OSX widget</a>, you'll...
18,021
<p>Long ago, I wrote a style 'normalizer' program to scan the ASP/HTML code of a big pile of classic ASP pages (most of which were originally generated from MS-Word documents, so naturally they were littered with superflous stylesheets and massive one-off styles). The style normalizer generated a minimal set of stylesh...
<p>Well, I can't say definitively that this "works" for everything described, but Tidy does a bit more than clean up tags.</p> <p>See the <a href="http://tidy.sourceforge.net/docs/quickref.html" rel="nofollow noreferrer">HTML Tidy Configuration Options</a>, especially those relating to Microsoft Word (like <a href="ht...
<p>Don't forget beautiful soup</p> <p><a href="https://stackoverflow.com/questions/293482/how-do-i-fix-wrongly-nested-unclosed-html-tags">How do I fix wrongly nested / unclosed HTML tags?</a></p>
38,399
<p>The <code>System.Windows.Threading.DispatcherObject</code> class (which <code>DependencyObject</code> is based on) contains a useful function, called <code>CheckAccess()</code>, that determines whether or not the code is running on the UI thread.</p> <p>When I wanted to use it yesterday, I was puzzled to find out t...
<p>A Microsoft employee <a href="http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/bd0e6f6c-cadd-48f1-8e1a-163c2f17e4ca/" rel="noreferrer">recently stated</a> CheckAccess is used only for "advanced scenarios", so they hid it from Intellisense.</p> <blockquote> <p>"CheckAccess and VerifyAccess have always be...
<p>I can't find any documentation that says you shouldn't use those methods directly, but I haven't looked very long.</p> <p>Also you refer to the EditorVisibleAttribute, which doesn't exist. According to Reflector it's the <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.editorbrowsableattribute...
3,813
<p>In the following example should I expect that <code>values.size()</code> will be called every time around the loop? In which case it might make sense to introduce a temporary <code>vectorSize</code> variable. Or should a modern compiler be able to optimize the calls away by recognising that the vector size cannot ch...
<p>Here's one way to do it that makes it explicit - size() is called only once.</p> <pre><code>for (size_t ii = 0, count = values.size(); ii &lt; count; ++ii) </code></pre> <p><strong>Edit:</strong> I've been asked to actually answer the question, so here's my best shot.</p> <p>A compiler generally won't optimize ...
<p>Most, maybe even all, standard implementations of size() will be inlined by the compiler to what would be the equivalent of a temporary or at most a pointer dereference.</p> <p>However, you can never be sure. Inlining is about as hidden as these things get, and 3rd party containers may have virtual function tables ...
20,129
<p>How do I actually run a file on localhost? I know it is working, but how do I run a file on it, and how do I verify that the file is in fact running on localhost?</p> <p><strong>Server newbie here, additional questions (I have xampp running Apache 2.2):</strong> From your responses it sounds like I have to type in ...
<p>Ok, thanks for the more specific info, ppl may remove their downvotes now...</p> <p>What you are proposing is a very common thing to do! You want to run your web application locally without uploading it to your host yet. That's totally fine and that's what your Apache is there for. Your Apache is a web server meani...
<p>Looking at your other question I assume you are trying to run a php or asp file or something on your webserver and this is your first attempt in webdesign.</p> <p>Once you have installed php correctly (which you probably did when you got XAMPP) just place whatever file you want under your localhost (/www/var/html p...
40,325
<p>I need to loop through all the matches in say the following string:</p> <p><code>&lt;a href='/Product/Show/{ProductRowID}'&gt;{ProductName}&lt;/a&gt;</code></p> <p>I am looking to capture the values in the {} including them, so I want {ProductRowID} and {ProductName}</p> <p>Here is my code so far:</p> <pre><code...
<p>Your Pattern is missing a small detail:</p> <pre><code>\{\w*?\} </code></pre> <p>Curly braces must be escaped, and you want the non-greedy star, or your first (and only) match will be this: <code>"{ProductRowID}'&gt;{ProductName}"</code>.</p> <pre><code>Dim r As Regex = New Regex("\{\w*?\}") Dim input As String =...
<p>Change your RegEx pattern to <code>\{\w*\}</code> then it will match as you expect.</p> <p>You can test it with an <a href="http://www.dotnetcoders.com/web/Learning/Regex/RegexTester.aspx" rel="nofollow noreferrer">online .net RegEx tester</a>.</p>
42,228
<p>I'm using the RxTx library over usbserial on a Linux distro. The RxTx lib seems to behave quite differently (in a bad way) than how it works over serial.</p> <p>One of my biggest problems is that the <code>RxTx SerialPortEvent.OUTPUT_BUFFER_EMPTY</code> does not work on linux over usb serial.</p> <p>How do I know ...
<p><em>(perhaps slightly off-topic, but here goes)</em></p> <p>I'm not familiar with that particular library, but I can assure you from dire experience (I work in the security systems (as in: hardware security devices) business, where RS-232 is heavily used) that not all USB-serial converters are born equal. Many such...
<p>Using RxTx over usb-to-serial you can't set notifyOnOutput to true otherwise it locks up completely. </p> <p>I've learned this the hard way. This problem is documented on a few web sites over the internet.</p> <p>I'm running it on Linux and I believe that this is a Linux only issue, although I can't confirm that....
11,038
<p>My Web Application is split up in a WebGui and an WebService. The WebService is responsible for Business Logic and Database handling. From Javascript in the Browser I request data depending on a date and time that is an input from the Browser. This request gous to an .asmx Url in the WebGui and inside this function ...
<p>I would suspect this has to do with the DateTime.Kind property introduced in .NET 2.0. By default this is set to DateTimeKind.Unspecified, which is most of the time handled the same as DateTimeKind.Local, so when the date is serialized it will be converted to UTC. You could try to set the Kind to DateTimeKind.Utc u...
<p>Depending on the culture settings of the server the date will be interpreted differently. I.e. given the date: 01.05.2008 a culture of en-GB (British) will read the date as First of May, a system with the culture en-US will read it as 5th of January. </p> <p>To get around this you should ensure that dates are alway...
11,795
<p>A customer of ours has Quickbooks 2005 and is looking to have their web data (orders, customers, tax) sent as it is collected from the web in a format that can be imported into Quickbooks 2005 Pro. </p> <p>Does anyone have any experience with this? If so, what was your experience, and what component/method would ...
<p>I wrote the plugin mentioned by Till. The plugin is an implementation of the <a href="http://cometdproject.dojotoolkit.org/documentation/bayeux" rel="noreferrer">Bayeux</a> protocol and currently supports long-polling (local server via AJAX) and callback-polling (remote server via XSS). There is a <a href="http://co...
<p>Comet is a great solution, and there are all kinds of implementations. Which one depends on your needs.</p> <p>We've implemented a solution for IIS/ASP.NET, <a href="http://www.frozenmountain.com/websync" rel="nofollow noreferrer">WebSync</a>. It includes the javascript client, which plays nicely with jQuery. Techn...
16,465
<p>On Internet Explorer, the standard HTML file upload form also allows for direct input of the file name (instead of using the file selector dialog). This makes it possible to enter non-existing files. On other browsers (which do not let you do that) I suppose this case can still occur if you delete the file after hav...
<p>I think I figured it out.</p> <p>First of all, it seems to make a difference whether it is just the file that does not exist, or the whole path is incorrect. If only the file is missing, apparently a POST does take place.</p> <p>At least in the case I mentioned (FCKEditor's image upload dialog on WinXP and IE6), t...
<p>Really good question, in .net there is Request.IsClientConnected, but don't know if that will work for you in this case, or if you are even using .net in the first place. </p> <p>I would try running it through Fiddler on the client end and WireShark at the server end, and see if you get any insights by looking at ...
46,697
<p>I use VB6 for an application.</p> <p>Is it possible to force the compiler to inline a function?</p> <p>Or is there an add-in that achieves the same thing?</p> <p>There's a secure part of my code that I want to make difficult to hack, by repeating the code at every point where it is used instead of being listed on...
<p>IMO if this is what you're doing as a security measure, you have bigger problems than getting VB to inline your function. And I don't think there is any provision in VB6 to do this. AND I tend to think that this technique would make it easier to hack your code, since you'd see the same really important function re...
<p>As Dave said there is no support for that in the VB compiler. </p> <p>If you really want to this why not run a search &amp; replace on a copy of your code and build that copy. Doing that on the command line shouldn't be too difficult.</p>
45,067
<p>Are there any known hash algorithms which input a vector of int's and output a single int that work similarly to an inner product?</p> <p>In other words, I am thinking about a hash algorithm that might look like this in C++:</p> <pre><code>// For simplicity, I'm not worrying about overflow, and assuming |v| &lt; 7...
<p>I did some (unpublished, practical) experiments with testing a variety of string hash algorithms. (It turns out that Java's default hash function for Strings sucks.) </p> <p>The easy experiment is to hash the English dictionary and compare how many collisions you have on algorithm A vs algorithm B.</p> <p>You ca...
<p>While i might be totally misunderstanding you, maybe it's a good idea to treat a vector as a byte stream and do some know hash on it, i.e. <a href="http://en.wikipedia.org/wiki/SHA1" rel="nofollow noreferrer" title="SHA1">SHA1</a> or <a href="http://en.wikipedia.org/wiki/MD5" rel="nofollow noreferrer" title="MD5">MD...
35,881
<p>I can not figure out what all the parameters to the arc() function are (by experimentation) and I have not found any tutorial that seems to explain them. Where would a good explanation of the arc() function be?</p>
<pre><code>arc(x, y, radius, startAngle, endAngle, anticlockwise) </code></pre> <p>The first three parameters, x and y and radius, describe a circle, the arc drawn will be part of that circle. startAngle and endAngle are where along the circle to start and stop drawing. 0 is east, Math.PI/2 is south, Math.PI is west,...
<p>Check this simple example for a brief introduction to canvas and arc function of HTML5: <a href="http://pastebin.com/kxB7uJLD" rel="nofollow">http://pastebin.com/kxB7uJLD</a></p> <p>So long.</p>
41,276
<p>Do I have to restart IIS if I drop a new DLL in the bin of my virtual directory?</p>
<p>No you do not have to, the application will recycle, but an IISReset is NOT needed</p>
<p>If your application is an ASP.NET app, I believe the AppDomain will restart, but the worker process (w3wp.exe) will NOT. For most purposes, an AppDomain reset is sufficient to clear the state but for some (generally to do with unmanaged DLLs having been loaded in the process) this may not be sufficient. In these c...
15,010
<p>I am trying to draw a domain model or class diagram in UML for car dealership. I am stuck with how to present test drive in the model. One way is to have appointment class and then test-drive as sub class. A dealer also offers after-sale vehicle service so i could have appointment/booking class as super class and t...
<p>You can really only distinguish the right decision by having a good set of use cases or expected behaviors of the model.</p> <p>This will inform whether a particular sub-classing is really accurate.</p> <p>I can see that an appointment might contain several test-drives, which are themselves linked to individual ve...
<p>test-drive would contain the information relevant only to the test-drive:</p> <p>reference to the customer - even this might be debatable to include</p> <p>reference to the vehicle</p> <p>length of test drive</p> <p>location (perhaps the vehicle was driven at a different location than could be determined from th...
26,517
<p>Is there a free or open source library to read Excel files (.xls) directly from a C# program? </p> <p>It does not need to be too fancy, just to select a worksheet and read the data as strings. So far, I've been using Export to Unicode text function of Excel, and parsing the resulting (tab-delimited) file, but I'd l...
<pre><code>var fileName = string.Format("{0}\\fileNameHere", Directory.GetCurrentDirectory()); var connectionString = string.Format("Provider=Microsoft.Jet.OLEDB.4.0; data source={0}; Extended Properties=Excel 8.0;", fileName); var adapter = new OleDbDataAdapter("SELECT * FROM [workSheetNameHere$]", connectionString);...
<p>I just used <a href="http://code.google.com/p/excellibrary/" rel="nofollow noreferrer">ExcelLibrary</a> to load an .xls spreadsheet into a DataSet. Worked great for me.</p>
3,664
<p>How can my app get a list of the True Type Fonts that are available on Linux. </p> <p>Is there a standard directory where they are stored across different distributions? Or some other standard way to locate them?</p>
<p>I think fontconfig is the right way to do it. Take a look on the <a href="http://en.wikipedia.org/wiki/Fontconfig" rel="noreferrer">wikipedia article</a> or the <a href="http://fontconfig.org" rel="noreferrer">fontconfig hompage</a>.</p>
<p>If you aren't writing proprietary software, or any other licensed software that's incompatible with GPL, you could try looking at the code to xlsfonts to see how to query the font server. (The font server could be X itself, but it won't matter.)</p>
24,867
<p>I've discovered that cElementTree is about 30 times faster than <code>xml.dom.minidom</code> and I'm rewriting my XML encoding/decoding code. However, I need to output XML that contains CDATA sections and there doesn't seem to be a way to do that with ElementTree.</p> <p>Can it be done?</p>
<p>After a bit of work, I found the answer myself. Looking at the ElementTree.py source code, I found there was special handling of XML comments and preprocessing instructions. What they do is create a factory function for the special element type that uses a special (non-string) tag value to differentiate it from regu...
<p>Here's my version which is based on both gooli's and amaury's answers above. It works for both ElementTree 1.2.6 and 1.3.0, which use very different methods of doing this.</p> <p>Note that gooli's does not work with 1.3.0, which seems to be the current standard in Python 2.7.x.</p> <p>Also note that this version ...
21,088
<p>I'm tired of using: </p> <pre><code>tail -f development.log </code></pre> <p>To keep track of my rails logs. Instead I would like something that displays the info in a grid and allows my to sort, filter and look at stack traces per log message.</p> <p>Does anyone know of a GUI tool for displaying rails logs. Idea...
<p>FWIW I started <a href="http://github.com/SamSaffron/logviewer/tree/master" rel="nofollow noreferrer">this project</a> at GitHub to try and solve this problem, its far from functional.</p>
<p>You might be able to use <a href="http://logging.apache.org/chainsaw/index.html" rel="nofollow noreferrer">http://logging.apache.org/chainsaw/index.html</a> . Haven't used it in a long time but I think its log parser should be configurable</p>
15,118
<p>I'm trying to install RSpec as a gem after having it installed as a plugin. I've gone ahead and followed the directions found here <a href="http://github.com/dchelimsky/rspec-rails/wikis" rel="noreferrer">http://github.com/dchelimsky/rspec-rails/wikis</a> for the section titled <strong>rspec and rspec-rails gems</s...
<p>Have you installed both rspec and rspec-rails gems?</p> <pre><code>script/generate rspec </code></pre> <p>requires rspec-rails gem to be installed.</p>
<p>You'll need to do</p> <pre><code>sudo gem install cucumber-rails </code></pre>
34,366
<p>I have the following arrays in PHP (okay they are a bit bigger but the idea is what counts).</p> <pre><code>$array1 = array(1 =&gt; 'a', 2 =&gt; 'b'); $array2 = array(3 =&gt; 'c', 4 =&gt; 'd'); </code></pre> <p>Essentially I want to combine the two arrays as if it were something like this</p> <pre><code>$array3 =...
<p>Use</p> <pre><code>$array3 = $array1 + $array2; </code></pre> <p>See <a href="http://de3.php.net/manual/en/language.operators.array.php" rel="nofollow noreferrer">Array Operators</a></p> <p>By the way: <a href="http://de3.php.net/array_merge" rel="nofollow noreferrer">array_merge()</a> does something different wi...
<p>array_merge only keeps STRING keys. You have to wrote your function for doing this</p>
26,843
<p>It just happens to me about one code design question. Say, I have one "template" method that invokes some functions that may "alter". A intuitive design is to follow "Template Design Pattern". Define the altering functions to be "virtual" functions to be overridden in subclasses. Or, I can just use delegate function...
<p>Think about what's required in each case:</p> <p><strong>Virtual call</strong><br/></p> <ul> <li>Check for nullity</li> <li>Navigate from object pointer to type pointer</li> <li>Look up method address in instruction table</li> <li>(Not sure - even Richter doesn't cover this) Go to base type if method isn't overrid...
<p>virtual overrides have some sort of redirection table or something which is hardcoded and fully optimized at compile time. It's set in stone, very fast.</p> <p>Delegates are dynamic which will always have an overhead and they seem to be objects too so that adds up.</p> <p>You shouldn't worry about these small perf...
26,553
<p>I searched and found <a href="https://stackoverflow.com/questions/233441/svn-how-do-i-maintain-my-local-configblah-file">this question</a> but did not like the answer.</p> <p>Is there another way to get SVN to ignore config files that are checked in in-place (that you cannot check-in changed), but must be modified ...
<p>After messing around for a few hours I think I have an answer. Since it's my own question, I guess I'll make it community wiki...</p> <p>I created a branch of the entire repository and pointed the "Config" type files at the new branch, then checked them in.</p> <p>I'm not sure how this will play out, but it made ...
<p>After messing around for a few hours I think I have an answer. Since it's my own question, I guess I'll make it community wiki...</p> <p>I created a branch of the entire repository and pointed the "Config" type files at the new branch, then checked them in.</p> <p>I'm not sure how this will play out, but it made ...
38,414
<p>I would like to control options on the debugger without using the debugging GUI's, preferably from inside the code being debugged. I would think that would be quite difficult, but maybe my debugged code can request a service from independent code that will communicate with the debugger.</p> <p>This relates to <a h...
<p>You can write Visual Studio macros that can do anything the GUI can, but they can get rather involved. See the MSDN documentation on <a href="http://msdn.microsoft.com/en-us/library/xc52cke4(VS.80).aspx" rel="nofollow noreferrer">Automation and Extensibility for Visual Studio</a></p> <p>Doing this from the code bei...
<p>I know that you can do it with WinDBG and OutputDebugString, but for Visual Studio, I think you have to spool off another process, pipe commands to that, and have that manipulate the Debugger API.</p>
24,604
<p>Both ideas sound very similar to me, but there might be subtle differences or the exact same thing, explained in different ways. What is the relationship between TDD and Test First Development/Programming?</p>
<p>There's a difference in terms of what the driving factor is.</p> <p>Do you have a vague idea of what the class (or system - this can happen at different scales, of course) should look like, then think up tests which give it the actual shape? That's TDD.</p> <p>Do you know exactly what the public API of the class s...
<p>They are exactly the same thing. Both reference writing tests first, then writing the code that will pass the test</p>
43,414
<p>I've been searching for a library that can render organisation charts in either flash and/or javascript(preferably jQuery). I know of several javascript and/or flash chart libraries but none of them seem to be able to render an organisation chart such as this: <a href="http://www.fsai.ie/images/org_chart.gif" rel="n...
<p><a href="http://www.adobe.com/products/flex/ilogelixir/" rel="nofollow noreferrer">iLog Elixir</a> seems to have what you're looking for, in Flash/Flex. It's a commercial product and quite expensive, though. I Also found <a href="http://blogs.ilog.com/elixir/category/ilog-elixir/org-chart/" rel="nofollow noreferrer"...
<p>have you considered just embedding something like gliffy? it has it's own versioning and editing. Do you need to just render something already created or enable visio creation?</p>
24,008
<p>How do I forcefully unload a <code>ByteArray</code> from memory using ActionScript 3?</p> <p>I have tried the following:</p> <pre><code>// First non-working solution byteArray.length = 0; byteArray = new ByteArray(); // Second non-working solution for ( var i:int=0; i &lt; byteArray.length; i++ ) { byteArray[...
<p>(I'm not positive about this, but...)</p> <p>AS3 uses a non-deterministic garbage collection which means that dereferenced memory will be freed up whenever the runtime feels like it (typically not unless there's a reason to run, since it's an expensive operation to execute). This is the same approach used by most mo...
<p>Use <code>bytearray.clear()</code></p> <p>As per the <a href="https://airsdk.dev/reference/actionscript/3.0/" rel="nofollow noreferrer">Language Reference</a></p> <p>this</p> <blockquote> <p>Clears the contents of the byte array and resets the length and position properties to 0. Calling this method explicitly frees...
2,241
<p>I'm using <a href="http://www.khronos.org/opengles/" rel="nofollow noreferrer">OpenGL ES</a> on a <a href="http://www.apple.com/iphone/" rel="nofollow noreferrer">low-resolution, embedded device</a>.</p> <p>I've applied a vertical color gradient, using vertex coloring, to a large polygon serving as a backdrop to my...
<p>Have you tried glEnable(GL_DITHER)? It's normally initially enabled, but I've never worked with GL ES or on an embedded device. It may also depend on the color depth you're using in the frame buffer, you're going to get artifacts if you've only got 4 bits per channel.</p>
<p>I have never heard of the effect you describe being in the OGL pipe. My knowledge is a bit dated at this point, though, so I may be wrong. I'd give the render to texture a shot if you can.</p>
24,187
<p>I am trying to implement ajax back/forward button support and therefore writing variables after a # in my url. I would also like the user to be able to copy the url and then link back to it. Does anyone know how can I parse the url and grab my "querystrings" even though they are behind a #?</p>
<p>The value after the hash is not transmitted to the server. There's another SO question about that somewhere, but I'm having trouble finding it. Likewise it's taken me a while to find a decent reference to cite, but <a href="http://en.wikipedia.org/wiki/Fragment_identifier" rel="nofollow noreferrer">this Wikipedia ar...
<p><a href="http://msdn.microsoft.com/en-us/library/system.uri.fragment.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/system.uri.fragment.aspx</a></p>
44,310
<p>I'm working on a site which is at the core/ master of a number of sites. We are also responsible for handling the authentication across all the sites under the brand banner.</p> <p>The client has wanted a single-sign-on operation to be included, so if I was to sign into any of the sites I would be signed into all t...
<p>It looks like Safari (on my OS X, at least - which should be default settings) and, I assume Chrome, don't allow 3rd party cookies <em>by default</em>.</p> <p>Safari->Preferences->Security->Accept Cookies:</p> <p>o Always<br/> o Never<br/> + Only From Sites You Navigate To</p> <p>There's some <a href="http:...
<p>It looks like Safari (on my OS X, at least - which should be default settings) and, I assume Chrome, don't allow 3rd party cookies <em>by default</em>.</p> <p>Safari->Preferences->Security->Accept Cookies:</p> <p>o Always<br/> o Never<br/> + Only From Sites You Navigate To</p> <p>There's some <a href="http:...
29,909
<p>Problem: How can I tell if a selection of text in the CRichEditCtrl has multiple font sizes in it?</p> <hr> <p>Goal: I am sort of making my own RichEdit toolbar (bold, italic, font type, font size, etc). I want to emulate what MS Word does when a selection of text has more than a single font size spanning the sel...
<p>As the above answer notes, the easiest way I can think of to do this is to use the Text Object Model (TOM), which is accessed through the ITextDocument COM interface. To get at this from your rich edit control (note code not tested, but should work):</p> <pre><code>CComPtr&lt;IRichEditOle&gt; richOle; richOle.Attac...
<p>Been juggling a couple things, but I was finally able to work. This is how I finally was able to get everything to compile and run:</p> <pre><code>HWND hwnd; ITextDocument* pDoc; IUnknown* pUnk = NULL; float size = 0; hwnd = GetSafeHwnd(); ::SendMessage( hwnd, EM_GETOLEINTERFACE, 0, (LPARAM)&amp;pUnk ); if ( pUn...
33,023
<p>I'm looking at setting up a small company that hosts flash-based websites for artist portfolios. The customer control panel would be django-powered, and would provide the interface for uploading their images, managing galleries, selling prints, etc.</p> <p>Seeing as the majority of traffic to the hosted sites woul...
<p>Maybe. I don't think the built-in admin interface is really designed to corral admins into their own sites. The <code>sites</code> framework is more suited to publish the same content on multiple sites, not to constrain users to one site or another. You'd be better off writing your own admin interface that enforces ...
<p>Depending on the amount of sites you're going to host it might be easier to write a single Django app once, with admin, and to create a separate Django project for each new site. This is simple, it works for sure AND as an added bonus you can add features to newer sites without running the risk of causing problems i...
24,695
<p>In reading Haskell-related stuff I sometimes come across the expression “tying the knot”, I think I understand <em>what</em> it does, but not <em>how</em>.</p> <p>So, are there any good, basic, and simple to understand explanations of this concept?</p>
<p>Tying the knot is a solution to the problem of circular data structures. In imperative languages you construct a circular structure by first creating a non-circular structure, and then going back and fixing up the pointers to add the circularity.</p> <p>Say you wanted a two-element circular list with the elements ...
<p>It's not quite what you asked for, and it's not directly related to Haskell, but Bruce McAdam's paper <a href="http://www.lfcs.inf.ed.ac.uk/reports/97/ECS-LFCS-97-375/" rel="noreferrer">That About Wraps It Up</a> goes into this topic in substantial breadth and depth. Bruce's basic idea is to use an <strong>explicit...
46,678
<p>When we add a variable to ASP.NET Session, where are those variables actually stored on the client side?</p>
<p>If you are using the default session in ASP.NET then it is stored in memory inside the ASP.NET worker process. It is a server side cache, nothing at all to do with the client. There are other session store options available such as dedicated session state machine or sql server. You can also roll your own session pro...
<p>The session is stored on the web server and not the client. ASP.NET usually stores a key to the session in a cookie and uses this to identify your session next time you contact the web server.</p>
28,375
<p>How can I group by two different fields in a Crystal Report?</p> <p>Foe example :</p> <pre><code>val1|val2|val3|val6 val1|val12|val3|val7 val11|val2|val3|val8 val11|val12|val3|val9 </code></pre> <p>I want the report to look like </p> <pre><code>val1 : ======= val2 ---- val3|val6 val12 ------- val3|val7 val11 ...
<p>The generic data provided is rather vague, so I will provide my own to demonstrate (with field names on the first line)</p> <pre>"EmployeeName","WeekNumber","DayOfWeek","HoursWorked" "John Doe",20,"Monday",8 "John Doe",20,"Tuesday",8 "John Doe",20,"Wednesday",8 "John Doe",21,"Thursday",8 "John Doe",21,"Friday",8 "J...
<p>Not sure on best practices, but what I've used to do similar in the past was a sub report with it's own grouping, within the first group.</p> <p>So it would look something like this:</p> <p>MainReportHeader SubReport(?) SubreportHeader Values SubReportFooter MainReportFooter</p> <p>Again, not a crystal ...
28,846
<p>In crontab, I can use an asterisk to mean every value, or "*/2" to mean every even value.</p> <p>Is there a way to specify every <strong>odd</strong> value? (Would something like "1+*/2" work?)</p>
<p>Depending on your version of cron, you should be able to do (for hours, say):</p> <pre><code> 1-23/2 </code></pre> <p>Going by the EXTENSIONS section in the crontab(5) manpage:</p> <pre><code> Ranges can include "steps", so "1-9/2" is the same as "1,3,5,7,9". </code></pre> <p>For a more portable solution, I ...
<p>Works on Cronie Even with 5 minutes interval e.g.</p> <pre><code>3-58/5 * * * * /home/test/bin/do_some_thing_every_five_minute </code></pre>
14,900
<p>I'm a fan of extension methods in C#, but haven't had any success adding an extension method to a static class, such as <code>Console</code>.</p> <p>For example, if I want to add an extension to <code>Console</code>, called '<code>WriteBlueLine</code>', so that I can go:</p> <pre><code>Console.WriteBlueLine(&quot;Th...
<p>No. Extension methods require an instance variable (value) for an object. You can however, write a static wrapper around the <code>ConfigurationManager</code> interface. If you implement the wrapper, you don't need an extension method since you can just add the method directly.</p> <pre><code> public static clas...
<p>You CAN do this if you are willing to "frig" it a little by making a variable of the static class and assigning it to null. However, this method would not be available to static calls on the class, so not sure how much use it would be:</p> <pre><code>Console myConsole = null; myConsole.WriteBlueLine("my blue line")...
30,976
<p>What needs to be done to have your .NET application show up in Window's system tray as icon?</p> <p>And how do you handle mousebutton clicks on said icon?</p>
<p>First, add a <a href="https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.notifyicon" rel="nofollow noreferrer">NotifyIcon</a> control to the Form. Then wire up the Notify Icon to do what you want.</p> <p>If you want it to hide to tray on minimize, try this.</p> <pre class="lang-vb prettyprint-over...
<p>To extend <a href="https://stackoverflow.com/a/158927/7444103">Tom's answer</a>, I like to only make the icon visible if the application is minimized.<br> To do this, set <code>Visible = False</code> for <a href="https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.notifyicon" rel="nofollow noreferrer">...
19,223
<p>How do I hide the <strong>prev/today/next</strong> navigation in jQuery DatePicker?</p> <p>I'm happy with just the Month and Year drop down boxes.</p> <p>Also how do I disable the animations?</p> <p><a href="https://stackoverflow.com/questions/316147/how-do-i-hide-the-nexttodayprevious-navigation-in-jquery-datepi...
<p>You can find the options for the DatePicker control at <a href="http://docs.jquery.com/UI/Datepicker/datepicker#options" rel="noreferrer">http://docs.jquery.com/UI/Datepicker/datepicker#options</a>. Specifically, I think you want to set hideIfNoPrevNext to true and set duration to ''.</p> <pre><code> $('#cal').da...
<p>use this code, it will definitely work for stop navigation of next or prev button..</p> <pre><code>$("#cal").datepicker({ stepMonths: 0 )}; </code></pre>
40,818
<p>we have a template project we often copy. so we can costumize the copy and still have a common template.<br></p> <p>To optimize the "copy &amp; initial changes"-process, i though that i can write a little script, that does the following:</p> <ul> <li>copy the project-template (in svn) to another directory in the s...
<p>Here is something i put together with some information i found <a href="http://forums.devshed.com/unix-help-35/unix-find-and-replace-text-within-all-files-within-a-146179.html" rel="nofollow noreferrer">here</a>.</p> <pre><code>#!/bin/bash searchterm="&lt;ProjectName&gt;" replaceterm="New Project" srcsvnrepo="fil...
<p>Just a shell script would do.</p>
22,103
<p>I am not very good with Regex but I am learning.</p> <p>I would like to remove some html tag by the class name. This is what I have so far :</p> <pre><code>&lt;div class=&quot;footer&quot;.*?&gt;(.*?)&lt;/div&gt; </code></pre> <p>The first .*? is because it might contain other attribute and the second is it might co...
<p>You will also want to allow for other things before class in the div tag</p> <pre><code>&lt;div[^&gt;]*class="footer"[^&gt;]*&gt;(.*?)&lt;/div&gt; </code></pre> <p>Also, go case-insensitive. You may need to escape things like the quotes, or the slash in the closing tag. What context are you doing this in?</p> <...
<p>why not <code>&lt;div class="footer".*?&lt;/div&gt;</code> I'm not a regex guru either, but I don't think you need to specify that last bracket for your open div tag</p>
28,020
<p>I'm trying to generate customized xml files from a template xml file in python. </p> <p>Conceptually, I want to read in the template xml, remove some elements, change some text attributes, and write the new xml out to a file. I wanted it to work something like this:</p> <pre><code>conf_base = ConvertXmlToDict('co...
<p>I'm not sure if converting the info set to nested dicts first is easier. Using ElementTree, you can do this:</p> <pre><code>import xml.etree.ElementTree as ET doc = ET.parse("template.xml") lvl1 = doc.findall("level1-name")[0] lvl1.remove(lvl1.find("leaf1") lvl1.remove(lvl1.find("leaf2") # or use del lvl1[idx] doc....
<p>Have you tried this?</p> <pre><code>print xml.etree.ElementTree.tostring( conf_new ) </code></pre>
15,526
<p>I am looking for the best method to run a Java Application as a *NIX daemon or a Windows Service. I've looked in to the <a href="http://wrapper.tanukisoftware.org/" rel="noreferrer">Java Service Wrapper</a>, the <a href="http://commons.apache.org/daemon/jsvc.html" rel="noreferrer">Apache Commons project 'jsvc'</a>,...
<p>I've had great success with Java Service Wrapper myself. I haven't looked at the others, but the major strengths of ServiceWrapper are:</p> <ul> <li>Great x-platform support - I've used it on Windows and Linux, and found it easy on both</li> <li>Solid Documentation - The docs are clear and to the point, with great...
<p>Are there any special attributes that you need to apply (like OS guided resource management) that you need to support? Otherwise, for Unix you should be able to daemonize your application by writing an appropriate init.d script and setting your app to start automatically.</p>
4,514
<p>Hi i am encountering problems trying to post a WebRequest under Https. </p> <p>i received the following errors</p> <h1>1.-The underlying connection was closed: Unable to connect to the remote server.</h1> <h1>2.-the operation TimeOut</h1> <h1>3-The underlying connection was closed: Could not establish secure cha...
<p>There are a whole number of things that could be complicating things, as far as inconsistencies with the SSL certs, etc. But first, you should do some basic debugging to rule out the obvious things:</p> <p>-- Did you try sending a simple web request to other servers? Try both (unsecured) http and (secured) https<...
<p>The SSL certificate name probably doesn't match. This is often the case with selfsigned certificates.</p> <p>The solution is to write your own authentication routine where you either always return true or do the necessary authentication to make sure the certificate is valid.</p> <pre><code>// .NET 2.0+ ... Service...
36,390
<p>I created a class derived from System.Configuration.Install for my installer.<br> But the code in Uninstall() is being called when I try to update the application.<br> How can I detect that the user is trying to update instead of uninstall?</p> <p>Maybe <a href="http://www.microsoft.com/communities/newsgroups/en-us...
<p>There is a setting in your setup project that will "uninstall" previous versions by default, turn this flag OFF, then you will not have to worry!</p>
<p>Blind guess here, but I'd start out by checking the <a href="http://msdn.microsoft.com/en-us/library/system.configuration.install.installer.context.aspx" rel="nofollow noreferrer">Installer.Context</a> property for a <a href="http://msdn.microsoft.com/en-us/library/system.configuration.install.installcontext.paramet...
19,294
<p>For a given table 'foo', I need a query to generate a set of tables that have foreign keys that point to foo. I'm using Oracle 10G.</p>
<p>This should work (or something close):</p> <pre><code>select table_name from all_constraints where constraint_type='R' and r_constraint_name in (select constraint_name from all_constraints where constraint_type in ('P','U') and table_name='&lt;your table here&gt;'); </code></pre>
<p>Download the Oracle Reference Guide for 10G which explains the data dictionary tables.</p> <p>The answers above are good but check out the other tables which may relate to constraints.</p> <pre><code>SELECT * FROM DICT WHERE TABLE_NAME LIKE '%CONS%'; </code></pre> <p>Finally, get a tool like Toad or SQL Developer...
11,143
<p>What does the <code>volatile</code> keyword do? In C++ what problem does it solve?</p> <p>In my case, I have never knowingly needed it.</p>
<p><code>volatile</code> is needed if you are reading from a spot in memory that, say, a completely separate process/device/whatever may write to.</p> <p>I used to work with dual-port ram in a multiprocessor system in straight C. We used a hardware managed 16 bit value as a semaphore to know when the other guy was don...
<p>One use I should remind you is, in the signal handler function, if you want to access/modify a global variable (for example, mark it as exit = true) you have to declare that variable as 'volatile'.</p>
9,815
<p>How do SQL developers go about keeping up on current techniques and trends in the SQL world? Are there any blogs, books, articles, techniques, etc that are being used to keep up to date and in the know?</p> <p>There are a lot of opportunities out their for OO, procedural, and functional programmers to take part in...
<p>Find challenging questions that test your TRANSACT-SQL knowledge ... personally I enjoy <a href="https://rads.stackoverflow.com/amzn/click/com/0123735963" rel="noreferrer" rel="nofollow noreferrer">Joe Celko's SQL Puzzles and Answers</a>.</p> <p><a href="http://ecx.images-amazon.com/images/I/51DTJ099P7L._SL500_BO2,...
<p>To be honest, I don't see much a need for extreme SQL skills. Once I can create transactions (for DB consistency) and basic triggers (for cross-table consistency), I'm usually fine keeping program logic... in the program, and not putting it into whatever database I'm using. I've not found much depth to SQL worth ...
12,689
<p>I am researching companies that provide both SMS and voicemail services via an API call. I want to be able to contact users (most of whom are US-based) via both text-message and voicemail. The idea is that our web server would connect to the SMS/voicemail provider's server (e.g. using HTTP post) and then send the me...
<p>I've used <a href="http://web21c.bt.com/" rel="nofollow noreferrer">BT's phone/sms services</a> in the past. It's a great service for sending sms as well as automating calls. I particularly like the fact that everything is open sourced, and they have wrappers for a lot of main stream languages, plus the API is quite...
<p>Update: the following US-based providers have both voicemail (including text-to-speech) and SMS services that are accessible via an API (web service type of model). </p> <p><a href="http://www.west.com/" rel="nofollow noreferrer">West Corporation</a> (based in Omaha, NE) </p> <p><a href="http://www.premiereglobal....
25,156