instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>If not, is <a href="http://en.wikipedia.org/wiki/Smoke_test#Smoke_testing_in_software_development" rel="nofollow noreferrer">smoke testing</a> still used?</p>
| <p>It's sort of a Venn Diagram. Some Automated tests are Smoke tests, and some smoke tests are Automated (inasfar as they are ran by a computer program). A Smoke test is a take off (if I recall correctly) on the term "Where there's smoke, there's usually fire." It's a set of preliminary tests that the program must p... | <p>My understanding of "smoke testing" is different than the wikipedia article. I understand smoke testing to be the developer opening the app and testing the basic functionality to verify that the app looks right & is doing the basics. So I always thought it was a manual process, not an automated one.</p>
| 28,539 |
<p>I have 2 tables (A and B) with the same primary keys. I want to select all row that are in A and not in B. The following works:</p>
<pre><code>select * from A where not exists (select * from B where A.pk=B.pk);
</code></pre>
<p>however it seems quite bad (~2 sec on only 100k rows in A and 3-10k less in B)</p>
<p>... | <p>I think your last statement is the best way. You can also try</p>
<pre><code>SELECT A.*
from A left join B on
A.x = B.y
where B.y is null
</code></pre>
| <p>This helped me a lot. <code>Joins</code> are always faster than Sub Queries to give results:</p>
<pre><code>SELECT tbl1.id FROM tbl1 t1
LEFT OUTER JOIN tbl2 t2 ON t1.id = t2.id
WHERE t1.id>=100 AND t2.id IS NULL ;
</code></pre>
| 46,106 |
<p>What are the correct version numbers for C#? What came out when? Why can't I find any answers about <strong><em>C# 3.5</em></strong>?</p>
<p>This question is primarily to aid those who are searching for an answer using an incorrect version number, e.g. <strong><em>C# 3.5</em></strong>. The hope is that anyone faili... | <h1>C# language version history:</h1>
<p>These are the <a href="https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-version-history" rel="noreferrer">versions of C#</a> known about at the time of this writing:</p>
<ul>
<li><strong>C# 1.0</strong> released with .NET 1.0 and VS2002 (January 2002)</li>
<li><s... | <h2>Preview: C# 11.0 .NET Core 7.0 Visual Studio 2022 Update 1</h2>
<p><a href="https://devblogs.microsoft.com/dotnet/early-peek-at-csharp-11-features/" rel="nofollow noreferrer"><strong><code>READ MORE</code></strong></a></p>
<ul>
<li>Allow newlines in the “holes” of interpolated strings</li>
<li>List patterns</li>
<l... | 30,756 |
<p>In my environment here I use Java to serialize the result set to XML.
It happens basically like this:</p>
<pre><code>//foreach column of each row
xmlHandler.startElement(uri, lname, "column", attributes);
String chars = rs.getString(i);
xmlHandler.characters(chars.toCharArray(), 0, chars.length());
xmlHandler.endEl... | <p>I found an interesting list in the <a href="http://www.w3.org/TR/2006/REC-xml11-20060816/#charsets" rel="noreferrer">Xml Spec</a>:
According to that List its discouraged to use the Character #26 (Hex: <em>#x1A</em>).</p>
<blockquote>
<p>The characters defined in the
following ranges are also discouraged.
They... | <p>Which version of JRE are you running? <a href="http://www.saxproject.org/faq.html" rel="nofollow noreferrer">Sax Project</a> says: </p>
<blockquote>
<p>J2SE 1.4 bundles an old version of
SAX2. How do I make SAX2 r2 or later available?</p>
</blockquote>
| 18,959 |
<p>I mostly use lambda functions but sometimes use nested functions that seem to provide the same behavior.</p>
<p>Here are some trivial examples where they functionally do the same thing if either were found within another function:</p>
<p><strong>Lambda function</strong></p>
<pre><code>>>> a = lambda x : 1 +... | <p>If you need to assign the <code>lambda</code> to a name, use a <code>def</code> instead. <code>def</code>s are just syntactic sugar for an assignment, so the result is the same, and they are a lot more flexible and readable.</p>
<p><code>lambda</code>s can be used for <em>use once, throw away</em> functions which w... | <p>lambda is useful for generating new functions:</p>
<pre><code>>>> def somefunc(x): return lambda y: x+y
>>> f = somefunc(10)
>>> f(2)
12
>>> f(4)
14
</code></pre>
| 16,297 |
<p>I am looking for an open-source project involving c++ GUI(s) working with a database. I have not done it before, and am looking for a way to get my feet wet. Which can I work on?</p>
| <p>How about this one <a href="http://sourceforge.net/projects/sqlitebrowser/" rel="nofollow noreferrer">http://sourceforge.net/projects/sqlitebrowser/</a>:</p>
<blockquote>
<p>SQLite Database browser is a light GUI editor for SQLite databases, built on top of QT. The main goal of the project is to allow non-technic... | <p>Sourceforge has a help wanted page: <a href="http://sourceforge.net/people/" rel="nofollow noreferrer">http://sourceforge.net/people/</a></p>
<p>browse the postings to see if a project is in your expertise or find one that sound interesting...</p>
<p>And let me be the first to say thank you for being willing to co... | 10,264 |
<p><strong>EDIT:</strong> See <a href="https://stackoverflow.com/questions/218909/returning-a-pdf-file-from-a-java-bean-to-a-jsp#221252">my working code</a> in the answers below.</p>
<hr>
<p><strong>In brief:</strong> I have a JSP file which calls a method in a Java Bean. This method creates a PDF file and in theory,... | <p>The way I have implemented this type of feature in the past is to make a servlet write the contents of the PDF file out to the response as a stream. I don't have the source code with me any longer (and it's been at least a year since I did any servlet/jsp work), but here is what you might want to try:</p>
<p>In a ... | <p>I agree with <a href="https://stackoverflow.com/questions/218909/returning-a-pdf-file-from-a-java-bean-to-a-jsp#218942">matt b</a>, maybe its the spaces between JSP tags. Try putting the directive</p>
<pre><code><%@ page trimDirectiveWhitespaces="true" %>
</code></pre>
| 26,942 |
<p>I am trying to connect to simple webparts in my sharepoint team site, i need one of the webparts to filter its information based on what it recieves from another webpart</p>
<p>I am using the query string filter webpart and the a list view webpart but no matter how i connect them always i am getting this error </p>... | <p>There is an issue with creating QueryString filter webparts in sharepoint, when you're not using the Web UI (I'm making an assumption that you aren't).</p>
<p>This fella here has a post about it and how he hacked around the issue.</p>
<p><a href="http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/... | <p>The page 'DispForm.aspx' usually is a form of a SharePoint list and different rules apply to list-form pages than on pages that do not belong to a Sharepoint list (and the differences are hardly documented). I solved the problem by workarounds; you could use not a ListViewWebPart, but a DataViewWebPart (<a href="htt... | 26,429 |
<p>I'm designing a web site navigation hierarchy. It's a tree of nodes. Nodes represent web pages.</p>
<p>Some nodes on the tree are special. I need a name for them.</p>
<p>There are multiple such nodes. Each is the "root" of a sub-tree with pages that have a distinct logo, style sheet, or layout. Think of differen... | <p>How about Root (node with children, but no parent), Node (node with children and parent) and Leaf (node with no children and parent)?</p>
<p>You can then distinguish by name and position within the tree structure (E.g. DepartmentRoot, DepartmentNode, DepartmentLeaf) if need be..</p>
<h2>Update Following Comment from... | <p>How about <em>PageTemplate</em> to embody the fact that its children have their own layout, CSS etc?</p>
| 11,231 |
<p>The ReSharper reformat code feature is very handy and flexible, particularly with the new code layout templating flexibility JetBrains have added in version 3.0.</p>
<p>Is there a standard set of code style settings for ReSharper which match the rules enforced by <a href="http://code.msdn.microsoft.com/sourceanalys... | <p>Try the ReSharper StyleCop plugin at: <a href="http://www.codeplex.com/StyleCopForReSharper" rel="noreferrer">http://www.codeplex.com/StyleCopForReSharper</a></p>
| <p>I am looking for the same things.</p>
<p>Here is a Custom Type member layout:</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<Patterns xmlns="urn:shemas-jetbrains-com:member-reordering-patterns">
<!--Do not reorder COM interfaces and structs marked by
StructLayout attribute-->
... | 8,229 |
<p>I am writing a search application specifically for music playlists.</p>
<p>The genre and file format differs from playlist to playlist, and sometimes within the playlist there are differences too. There is also a concept of "synonymous" tags (e.g. urban would cover both hiphop and r&b, but not the other way ar... | <p>If you try to think too hard on how to structure your data for searching, there is a good chance you will miss an important search that you could have really used in your app. </p>
<p>Alternatively (and this is from experience) you end up re-inventing all sorts of indexing techniques. </p>
<p>I have some experienc... | <p>I don't see how database software would play a role in your solution.</p>
<p>If I were to be the one implementing this, I would first ensure all related data is captured in a normalized way. This would include things like category, artwork, lyrics, etc. </p>
<p>The main advantage of this is your idea of 'complex' ... | 22,452 |
<p>I want to pass an integer value to a form in .Net so that it can load the right data. I'm using this so that when I double click on a record in a list, a form opens with the data from that record loaded so it can be edited. What is the best way to do this? Should I create a property and set it before calling the Sho... | <p>I'd suggest something else.</p>
<p>create a static method (to the form you want to open) - pass the parameter to the static method. </p>
<p>leave it up to the static method to new up the form, load the data and call the Show method.</p>
<p>this way the calling form doesn't have to mess with the form to much (cto... | <p>Make it obligatory in the constructor. It wouldn't make sense to have one of these forms anyway if you don't have something to edit.</p>
| 40,337 |
<p>In coding a traditional MVC application, what is the best practice for coding server-side form validations? Does the code belong in the controller, or the model layer? And why?</p>
| <p>From Wikipedia:</p>
<blockquote>
<p><a href="http://en.wikipedia.org/wiki/Model_View_Controller" rel="nofollow noreferrer">Model-view-controller</a> (MVC) is an architectural pattern used in software engineering. Successful use of the pattern isolates business logic from user interface considerations, resulting i... | <p>My experience with MVC thus far consists of entirely rails.</p>
<p>Rails does it's validation 100% in the Model.<br>
For the most part this works very well. I'd say 9 out of 10 times it's all you need.</p>
<p>There are some areas however where what you're submitting from a form doesn't match up with your model pro... | 4,530 |
<p>This code is from <em>Prototype.js</em>. I've looked at probably 20 different tutorials, and I can't figure out why this is not working. The response I get is null.</p>
<pre><code>new Ajax.Request(/path/to / xml / file.xml, {
method: "get",
contentType: "application/xml",
onSuccess: function(transport) {
... | <p>If transport.responseXML is null but you have a value for transport.responseText then I believe it's because it's not a valid XML file.</p>
<p><strong>Edit:</strong> I just noticed that in our code here whenever we request an XML file we set the content type to 'text/xml'. I have no idea if that makes a differenc... | <p>Just want to share my afternoon working on the issue with a NULL result for <strong>responseXML</strong> responses. My results were exactly as described in the question: responseText was filled with the XML file, responseXML was NULL. As i was totally sure my file is in valid XML format, the error must be somewhere ... | 7,824 |
<p>I have a problem in my project with the .designer which as everyone know is autogenerated and I ahvent changed at all. One day I was working fine, I did a back up and next day boom! the project suddenly stops working and sends a message that the designer cant procees a code line... and due to this I get more errores... | <p>I would back up the designer.cs file associated with it (like copy it to the desktop), then edit the designer.cs file and remove the offending lines (keeping track of what they do) and then I'd try to redo those lines via the design mode of that form.</p>
| <p>I do an easy way; Right Click on the report then choose Run Custom Tool.</p>
<p>Automatically it fixes all problems and working for me, i solve 52 crystal ReportViewer errors.</p>
| 11,113 |
<p>I'm have written an msi file that offers a choice of "per-user" or "for all" installation in the UI phase, and now find that the installer fails on Vista:</p>
<ul>
<li>if I just reuse the installer that works for XP, Vista will trigger a UAC prompt even for the "per-user" installation, making that installation poin... | <p>Unfortunately, the Windows Installer does not provide a way to create a single package that can install per-machine and per-user but only prompt for UAC on the per-machine case. The issue is that the bit that can suppress the UAC prompt is stored in the SummaryInformation stream and is not modifiable while the pack... | <p>I turned off UAC by setting the bit 3 of PID_WORDCOUNT in my MSI package. I can able to install it for "ALLUSERS" and "PER-USER", and also write in for HKLM in both the modes on VISTA machines.
Is it mandatory for you to get UAC popup for privileged user during installation?</p>
| 31,508 |
<p>I know you can do a trick of putting an HTML element on top of a Silverlight app, but that will not work full screen. Is there anyway to show an html page inside a Silverlight application?</p>
| <p>The answer is, you can't. At least right now you can't - in the future it might be added but that's certainly not going to occur for a number of years (2.0 RTW was released today).</p>
<p>However, this link may be of some interest:</p>
<p><a href="http://blogs.msdn.com/delay/archive/2007/09/10/bringing-a-bit-of-ht... | <p>The answer is, you can't. At least right now you can't - in the future it might be added but that's certainly not going to occur for a number of years (2.0 RTW was released today).</p>
<p>However, this link may be of some interest:</p>
<p><a href="http://blogs.msdn.com/delay/archive/2007/09/10/bringing-a-bit-of-ht... | 24,741 |
<p>I'm trying to select a column from a single table (no joins) and I need the count of the number of rows, ideally before I begin retrieving the rows. I have come to two approaches that provide the information I need.</p>
<p><strong>Approach 1:</strong></p>
<pre><code>SELECT COUNT( my_table.my_col ) AS row_count
... | <p>There are only two ways to be 100% certain that the <code>COUNT(*)</code> and the actual query will give consistent results:</p>
<ul>
<li>Combined the <code>COUNT(*)</code> with the query, as in your Approach 2. I recommend the form you show in your example, not the correlated subquery form shown in the comment fr... | <p>Why don't you put your results into a vector? That way you don't have to know the size before hand.</p>
| 30,202 |
<p>If I create a test suite for a development project, should those classes be kept under version control with the rest of the project code?</p>
| <p>Yes, there is no reason not to put them in source control. What if the tests change? What if the interfaces change, necessitating that the tests change?</p>
| <p>Yes they should. People checking out the latest release should be able to unit test the code on their machine. This will help to identify missing dependencies and can also provide them with unofficial documentation on how the code works.</p>
| 14,041 |
<p>Running into a problem where on certain servers we get an error that the directory name is invalid when using Path.GetTempFileName. Further investigation shows that it is trying to write a file to c:\Documents and Setting\computername\aspnet\local settings\temp (found by using Path.GetTempPath). This folder exists... | <p>This is probably a combination of impersonation and a mismatch of different authentication methods occurring.</p>
<p>There are many pieces; I'll try to go over them one by one.</p>
<p><strong>Impersonation</strong> is a technique to "temporarily" switch the user account under which a thread is running. Essentially... | <p>You can use <strong>Path.GetTempPath()</strong> to find out which directory to which it's trying to write.</p>
| 7,916 |
<p>I want to discover at run-time ONLY the static Methods of a class, how can I do this?
Or, how to differentiate between static and non-static methods.</p>
| <p>Use <code>Modifier.isStatic(method.getModifiers())</code>.</p>
<pre><code>/**
* Returns the public static methods of a class or interface,
* including those declared in super classes and interfaces.
*/
public static List<Method> getStaticMethods(Class<?> clazz) {
List<Method> methods = ne... | <p>To flesh out the previous (correct) answer, here is a full code snippet which does what you want (exceptions ignored):</p>
<pre><code>public Method[] getStatics(Class<?> c) {
Method[] all = c.getDeclaredMethods()
List<Method> back = new ArrayList<Method>();
for (Method m : all) {
... | 36,600 |
<p>Once again a very beginner-ish question, but here I go:</p>
<p>I would like to use a servlet or similar to copy an uploaded file (from an html file select) to a permanent location. This is all I need to do with the file. I am currently going with using the Apache Commons FileUpload and IO libraries. Is there no eas... | <p>The Apache commons FileUpload is probably the best way if you are using pure JSP and servlets. If you use a framework like struts2 you will have some more options since they have file upload components built in and are very easy to use. </p>
| <p>The Servlet API has no way to extract the file from the POST (PUT?) data. </p>
<p>Just like Vincent said, Apache commons FileUpload is the best free way to do this.</p>
<p>You might also consider using a signed applet if you don't want to use the Apache libs.</p>
| 27,101 |
<p>Lets say you need to attach some JavaScript functionality to an ASP.NET User Control of which there might be multiple instances on any given page. Because JavaScript has shared global state, what techniques can you use to keep the client state and behavior for each instance of a control separate?</p>
| <p>Well, the main thing you can do is make sure your JavaScript functions are abstract enough that they are not coupled to specific instances of HTML controls - have them accept parameters that allow you to pass various instances of objects in. </p>
<p>The JavaScript that does whatever magic you need to be done should... | <pre><code>function <%=this.ClientID %>_myButton_onclick()
{
DoSomething();
}
</code></pre>
<p>and</p>
<pre><code><button id="myButton" onclick="<%=this.ClientID %>_myButton_onclick()">
</code></pre>
<p>Notice in this case the control is a regular HTML control.</p>
| 43,064 |
<p>Is <a href="http://bouncycastle.org/java.html" rel="nofollow noreferrer">Bouncy Castle API</a> Thread Safe ? Especially,</p>
<pre><code>org.bouncycastle.crypto.paddings.PaddedBufferedBlockCipher
org.bouncycastle.crypto.paddings.PKCS7Padding
org.bouncycastle.crypto.engines.AESFastEngine
org.bouncycastle.crypto.modes... | <p>It really does not matter if the API/Code is thread safe. CBC encryption in itself is not thread safe.
Some terminology -</p>
<pre><code>E(X) = Enctrypt message X
D(X) = Dectrypt X. (Note that D(E(X)) = X)
IV = Initialization vector. A random sequence to bootstrap the CBC algorithm
CBC = Cipher block chaining.
</c... | <p>The J2ME version is not thread safe.</p>
| 7,208 |
<p>I have a network C++ program in Windows that I'd like to test for network disconnects at various times. What are my options?</p>
<p>Currently I am:</p>
<ol>
<li>Actually disconnecting the network wire from the back of my computer</li>
<li>using ipconfig /release</li>
<li>Using the <a href="http://www.nirsoft.net/... | <p>You might want to abstract the network layer, and then you can have unit tests that inject interesting failure events at appropriate points.</p>
| <p>You can subclass whatever library class you are using to manage your sockets (presumably CAsyncSocket or CSocket if you are using MFC), override the methods whose failure you want to test, and insert appropriate test code in your overrides.</p>
| 8,677 |
<p>How would I write a Perl CGI script that receives a file via a HTTP post and saves that to the file system?</p>
| <p>Just a note: however you will write it, <strong>don't</strong> save it in a place accessible from your web-server.</p>
<p>And now to the point: below is a script which I was using for some time for photo-uploading. It might need some tweaking, but should show you the way.</p>
<p>As the image isnt uploaded to web-a... | <p>I'd start by using <a href="http://search.cpan.org/dist/CGI" rel="nofollow noreferrer">CGI</a> and reading <a href="http://search.cpan.org/perldoc/CGI#CREATING_A_FILE_UPLOAD_FIELD" rel="nofollow noreferrer">CREATING A FILE UPLOAD FIELD</a>, and using <a href="http://perldoc.perl.org/functions/open.html" rel="nofollo... | 19,670 |
<p>I've switched over to a Mac recently and, although things have been going quite well, the very different text-editing behaviours across applications is driving me insane.</p>
<p><kbd>Home</kbd>, <kbd>End</kbd>, <kbd>Page Up</kbd>, <kbd>Page Down</kbd>, <kbd>Apple-arrow</kbd>, <kbd>Ctrl-arrow</kbd>, <kbd>alt-arrow</... | <p>There are standards, but they are not based around what you're used to from windows. It drove me mad until I got over myself and decided to learn what the actual standards were. Since then I've been sold.</p>
<p>The ones I use:</p>
<ul>
<li><kbd>Command</kbd>-<kbd>Left</kbd>/<kbd>Right</kbd> - Jump to start/end of... | <p>And what's funny (and frustrating!) is that the Microsoft <strong>OS X</strong> apps (e.g. Entourage) use the <strong>Windows</strong> standards.</p>
<p>I develop on WinXP during the day but have an iMac at home, so it's confusing enough trying to switch modes between work and home. But then I have to remember if ... | 5,413 |
<p>So, I can create an input button with an image using</p>
<pre><code><INPUT type="image" src="/images/Btn.PNG" value="">
</code></pre>
<p>But, I can't get the same behavior using CSS. For instance, I've tried</p>
<pre><code><INPUT type="image" class="myButton"... | <p>If you're wanting to style the button using CSS, make it a type="submit" button instead of type="image". type="image" expects a SRC, which you can't set in CSS.</p>
<p>Note that Safari won't let you style any button in the manner you're looking for. If you need Safari support, you'll need to place an image and have... | <p>Perhaps you could just import a .js file as well and have the image replacement there, in JavaScript.</p>
| 23,768 |
<p>I have a script for OS X 10.5 that focuses the Search box in the Help menu of any application. I have it on a key combination and, much like Spotlight, I want it to toggle when I run the script. So, I want to detect if the search box is already focused for typing, and if so, type Esc instead of clicking the Help m... | <p>Using /Developer/Applications/Utilities/Accessibility Tools/Accessibility Inspector.app you can use the built-in accessibility system to look at properties of the UI element under the mouse. Take special note of the cmd-F7 action to lock focus on an element and the Refresh button. Sadly the element and property na... | <p>This worked for me to toggle between two menu items, based on which one is selected, using the "selected" property:</p>
<pre><code>tell application "System Preferences"
reveal anchor "keyboardTab" of pane "com.apple.preference.keyboard"
end tell
tell application "Syst... | 9,448 |
<p>I find way too many projects to get involved in, way to many languages to play with (and way too many cool features within those languages), and way too many books to read...</p>
<p>How do you guys stay focused and actually get anything done, rather than leaving a trail of partially complete "experiments?"</p>
| <p>Seems like there are two types of developers: Tinkerers and Entrepreneurs. </p>
<p>Tinkerers want to know how every little thing works. Once they get the hang of something, they're distracted by everything they don't know. The tech world is brutal for a Tinkerer because there's so much to learn and each new year cr... | <p>1) I leave a utterly MASIVE trail of unfinished stuff, all side projects of course.<br />
2) When I need motivation to work I open my wallet... That usually does it for me.</p>
| 20,860 |
<p>I cannot get my extruder to work on my Creality Ender-4 printer. I have heated the nozzle but the extruder does not move.</p>
<p>I tested the motor and cable on another system and they work just fine.</p>
<p>Could it be the board or what could it be?</p>
| <p>Most filaments you can leave in the extruder indefinitely without any ill effects.</p>
<p>There are some filaments that need to be stored away from moisture, particularly Nylon, because they absorb moisture from the air and don't print well if they contain a lot of absorbed moisture. However, this isn't an inherent... | <p>If you "planing" to leave the filament there for months, then it would be a good idea to store it away, but for most filaments it is not a big deal to be stay loaded... provided that the humidity is not high (e.g. a shower or kitchen next to it would be not so good). </p>
<p>My experiences with "moistured" filament... | 929 |
<p>Castle Active Record?
Plain NHibernate?
Subsonic?
Entity?
Something like Nettiers?</p>
<p>I'd like to use one, but I don't know enough to decide. Nhibernate seems over kill and complex, but widely used. Subsonic seems neat and easy. But is it stable? I have CodeSmith, and I was pointed to Nettiers, which seems ... | <p>I like NHibernate. It's actually not that complicated, it's surprisingly flexible and it doesn't pollute your object model with attributes and other funky stuff that shouldn't be there.</p>
<p>I find that the active record pattern doesn't fit that well into a statically typed language like C# as much as the domain... | <p>Since the question is "how do I pick" and not "what should I pick"...:</p>
<p>I'd pick the one that seems easiest to use first.
Then I'd research a bit on google to see if it seems stable.
Then I'd stress-test it myself, with some multithreaded goodness and a domain structure that has different types of relations ... | 32,849 |
<p>Flex uses by default UTF-8. I have not fount a way to specify a different encoding/charset on the actionscript WebService class.</p>
| <p>Ummm, look here:</p>
<p><a href="http://www.adobe.com/devnet/flex/articles/struts_06.html" rel="nofollow noreferrer">http://www.adobe.com/devnet/flex/articles/struts_06.html</a></p>
<p>I think that sample implies that declaring your mxml file as iso-8859-1 might do the trick, but I really don't think so.</p>
<p>I... | <p>There is also a way to specify an encoding to the flex compiler but that does not seem to work.
Right now the only solution I have found is to re-encode the incomming requests on the server side.
I am surprised this limitation is not written black on white in the flex reference documentation.</p>
| 10,243 |
<p>What is the best way to replace all '&lt' with <code>&lt;</code> in a given database column? Basically perform <code>s/&lt[^;]/&lt;/gi</code></p>
<p>Notes:</p>
<ul>
<li>must work in <a href="http://en.wikipedia.org/wiki/Microsoft_SQL_Server#SQL_Server_2005" rel="noreferrer">MS SQL Server</a> 2000</... | <p>Some hacking required but we can do this with <strong>LIKE</strong>, <strong>PATINDEX</strong>, <strong>LEFT</strong> AND <strong>RIGHT</strong> and good old string concatenation.</p>
<pre><code>create table test
(
id int identity(1, 1) not null,
val varchar(25) not null
)
insert into test values ('&lt... | <p>If MSSQL's regex flavor supports negative lookahead, that would be The Right Way to approach this.</p>
<pre><code>s/&lt(?!;)/&lt;/gi
</code></pre>
<p>will catch all instances of <strong>&lt</strong> which are not followed by a <strong>;</strong> (even if they're followed by nothing, which <strong>[^;]<... | 18,201 |
<p>Suppose I have a base class B, and a derived class D. I wish to have a method foo() within my base class that returns a new object of whatever type the instance is. So, for example, if I call B.foo() it returns an object of type B, while if I call D.foo() it returns an object of type D; meanwhile, the implementati... | <p>Don't. Make the "foo" method abstract.</p>
<pre><code>abstract class B {
public abstract B foo();
}
</code></pre>
<p>Or receive an abstract factory through the base class constructor:</p>
<pre><code>abstract class B {
private final BFactory factory;
protected B(BFactory factory) {
this.factory... | <p>@Rik</p>
<p>Well, the real problem is that I have a abstract base class Thing. And Thing has a method called getNextThing() which returns a new instance of Thing.</p>
<p>Then, I have a number of subclasses like BigThing, LittleThing, SomethingThing, and I don't want to keep rewriting the getNextThing() method for... | 20,147 |
<p>When you create a procedure (or a function) in Oracle PL/SQL, you cannot specify the maximum length of the varchar2 arguments, only the datatype. For example</p>
<pre><code>create or replace procedure testproc(arg1 in varchar2) is
begin
null;
end;
</code></pre>
<p>Do you know the maximum length of a string that ... | <p>In PL/SQL procedure it may be up to 32KB</p>
<p>Futher information here:
<a href="http://it.toolbox.com/blogs/oracle-guide/learn-oracle-sql-and-plsql-datatypes-strings-10804" rel="noreferrer">http://it.toolbox.com/blogs/oracle-guide/learn-oracle-sql-and-plsql-datatypes-strings-10804</a></p>
| <p>In PL/SQL the maximum size of <code>VARCHAR2</code> datatype is <strong>32767 bytes</strong> since 10gR2 (and probably earlier but I just checked the documentation upto that release).</p>
<p>The documentation references:</p>
<ul>
<li>Oracle 12cR1: <a href="http://docs.oracle.com/cd/E16655_01/appdev.121/e17622/data... | 22,551 |
<p>I have a site on my webhotel I would like to run some scheduled tasks on. What methods of achieving this would you recommend?</p>
<p>What I’ve thought out so far is having a script included in the top of every page and then let this script check whether it’s time to run this job or not.</p>
<p>This is just a quick... | <p>That's what cronjobs are made for. <code>man crontab</code> assuming you are running a linux server. If you don't have shell access or no way to setup cronjobs, there are free services that setup cronjobs on external servers and ping one of your URLs.</p>
| <p>Command line PHP + cron would be the way I would go. It's simple and should fit the bill. It is usually installed with PHP as a matter of course.</p>
| 14,624 |
<p>If I am setting up a site how would I go about ensuring that the person who gives me a credit card number (for instance) is the person who is authorized to use it? Maybe more generally how would I go about reducing the opportunity for fraud and stolen ID usage whether it be for a purchase or system access. </p>
<p>... | <p>I would say just stick with the industry standard methods.</p>
<p>Someone is assumed to have posession of the card if they can supply information which verifies with the card payment gateway. As part of that, for example is the <a href="http://www.advansys.com/default.asp/p=87" rel="nofollow noreferrer">Mastercard/... | <p>Another common method is the <a href="http://en.wikipedia.org/wiki/Address_Verification_System" rel="nofollow noreferrer">address verification system</a>, used by lots of online vendors. </p>
| 47,729 |
<p>This is the way I read file:</p>
<pre><code> public static string readFile(string path)
{
StringBuilder stringFromFile = new StringBuilder();
StreamReader SR;
string S;
SR = File.OpenText(path);
S = SR.ReadLine();
while (S != null)
{
stringF... | <p>Leaving aside the horrible variable names and the lack of a using statement (you won't close the file if there are any exceptions) that should be okay, and <em>certainly</em> shouldn't take 5 minutes to read 2.5 megs.</p>
<p>Where does the file live? Is it on a flaky network share?</p>
<p>By the way, the only diff... | <p>To read a text file fastest you can use something like this</p>
<pre><code>public static string ReadFileAndFetchStringInSingleLine(string file)
{
StringBuilder sb;
try
{
sb = new StringBuilder();
using (FileStream fs = File.Open(file, FileMode.Open))
{... | 26,065 |
<p>Because windows is case-insensitive and because SVN is case-sensitive and because VS2005 tends to rename files giving them the lower-case form which messes my repositories' history, I've tried to add the pre-commit hook script from <a href="http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/case-insensitive.... | <p>The Tigris.org's pre-complied python bindings for libsvn are a separate download. The latest as of Oct 27 could be found <a href="http://subversion.tigris.org/files/documents/15/44104/svn-win32-1.5.4_py25.zip" rel="nofollow noreferrer">here</a>.</p>
<p>There are other binary SVN distributions listed <a href="http:/... | <p>There are two alternative Python bindings for libsvn:</p>
<ul>
<li><a href="http://pysvn.tigris.org/" rel="nofollow noreferrer">pysvn</a>.</li>
<li><a href="https://launchpad.net/subvertpy" rel="nofollow noreferrer">subvertpy</a>. </li>
</ul>
<p>Subvertpy is quite new and is written by the author of <a href="http:... | 29,457 |
<p>I have looked at NHibernate and EntitySpaces and they both seem to work differently.</p>
<p>In EntitySpaces, you define the database tables and table relationships and the classes are generated for you.</p>
<p>In NHibernate, you define the classes and the table relationships are generated for you. This is what I a... | <p>Linq to SQL can create the database table structures and relationships from the classes, with the <a href="http://msdn.microsoft.com/en-us/library/system.data.linq.datacontext.createdatabase.aspx" rel="nofollow noreferrer">dataContext.CreateDatabase()</a> method.</p>
| <p>I had fairly good success working with Genome ORM. It does many jobs for you. You can first design your domain model and then generate the DB scripts out of that. Beside this Genome generates DTOs for you. It is pretty good at that and saves a lot of time of developers.</p>
<p><a href="http://www.genom-e.com" rel="... | 49,333 |
<p>I am using OpenOffice.org for most of my not so very frequent Office Suite needs and most of the time it is more than adequate replacement for it's commercial alternative.</p>
<p>Where it falls short though is the scripting API. I am yet to find the documentation that would make sense of the API in a way that would... | <p>If you're specifically talking about working with text documents, that section of the OO.org Dev Guide really is the way to go:</p>
<p><a href="http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Text/Working_with_Text_Documents" rel="noreferrer">http://wiki.services.openoffice.org/wiki/Documentation/De... | <p>I would start with the <a href="http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/OpenOffice.org_Developers_Guide" rel="nofollow noreferrer">OpenOffice.org Developer's Guide</a></p>
| 32,667 |
<p>I saw many questions asking 'how' to unit test in a specific language, but no question asking 'what', 'why', and 'when'.</p>
<ul>
<li>What is it?</li>
<li>What does it do for me?</li>
<li>Why should I use it?</li>
<li>When should I use it (also when not)?</li>
<li>What are some common pitfalls and misconceptions</l... | <p>Unit testing is, roughly speaking, testing bits of your code in isolation with test code. The immediate advantages that come to mind are:</p>
<ul>
<li>Running the tests becomes automate-able and repeatable</li>
<li>You can test at a much more granular level than point-and-click testing via a GUI</li>
</ul>
<p>Note... | <p>Unit-testing and TDD in general enables you to have shorter feedback cycles about the software you are writing. Instead of having a large test phase at the very end of the implementation, you incrementally test everything you write. This increases code quality very much, as you immediately see, where you might have ... | 2,377 |
<p>I've been trying to print anything for the past few days. Every time I go to print something the printer stops pushing plastic out and usually the motor makes a knocking sound.</p>
<p>My original thought was that my E-steps were off (because they were) but I solved that and I still have a problem. Then I noticed th... | <p>A knocking or clicking sound does not imply you <strong>have a problem</strong>, it implies that you <strong>could have a problem</strong>; it can be the characteristic of the extruder. </p>
<hr>
<p><em>My own designed 2.85 mm filament, 1:4 speed reducing <a href="https://www.thingiverse.com/thing:2897762" re... | <p>I had a bad connection at my motor that was causing the problem. I soldered direct to the motor and no more problems.</p>
| 1,559 |
<p>Ok, I know this is a strange question, but there is a "standard" (fan-wise at least) Unicode support for the Klingon alphabet, and since code can be written in Unicode with no problem, that means it is possible to write Kode with Klingon tokens( vars, function names, etc...).</p>
<p>For the record I've written C++ ... | <p>Not likely, especially when you consider rule 9 of the <a href="http://www.aumha.org/a/klingon.php" rel="nofollow noreferrer">KLINGON GUIDE To Writing Perfect Code</a></p>
<blockquote>
<p>“Indentation?! I will show you how to indent when I indent your skull!”</p>
</blockquote>
<p>and number 7 does not bode well ... | <p><a href="http://ttp://code.google.com/p/googleappengine/issues/detail?id=2134" rel="nofollow noreferrer">important</a> obviously support: Klingon</p>
<blockquote>
<p>(to no use rejected by unicode 2000
in favor of comets,snowmen,4 scissors
and so) Comment 1 by gra...@gmail.com,
Sep 22, 2009 How can we use a... | 39,142 |
<p>I have just started using QPixmapCache and I was wondering, since there is not much documentation, about how to adjust the size based on the system the application is running on.</p>
<p>Some users might have lots of free memory while others have very little. I have no idea what the best setting would be. </p>
<p... | <p>To detect free RAM in Windows, you can use the <a href="http://msdn.microsoft.com/en-us/library/aa366586.aspx" rel="nofollow noreferrer">GlobalMemoryStatus</a> function.</p>
<p>I'm not sure if this will help you size the pixmap cache; perhaps you will need to do some performance measurements and create a lookup tab... | <p>Note that QPixmap is window-system specific. This means that QPixmap likely corresponds to graphics card memory more than the general RAM. Just like any other cache, the size of it should "as much as it needs to be, but not more".</p>
<p>The best way to tune the cache is to profile your application running on a typ... | 47,409 |
<p>Waiting for a heatbed to get up to 85˚C for a relatively small part got me wondering why beds aren't hardware/G-code configurable for what area is heated? I'm sure it would be an increase in parts costs and electronics, but it seems that being able to just heat an area a little larger than the part(s) being built wo... | <p>I've wondered that myself a while ago and fact is that such beds or silicone heating pads do <a href="http://www.formbot3d.com/dual-zone-heated-build-plate-and-digital-controller-for-t-rex-2_p0015.html" rel="nofollow noreferrer">exist</a>. Usually these are quite large (and expensive) and usually referred to as "dua... | <p>it is probably too late for the party but i thought about grid heated bed recently. about controlling which zone to turn on and off, i think we can treat the grid as Led matrix, the matrix led signal can be used to drive mosfets to power the heat pads.</p>
| 953 |
<p>Does anyone know of a decent UML standards guide?</p>
<p>My company currently relies on UML 2.0 (rightly or wrongly) to do the majority (read <em>all</em>) of their design work. I have been asked to come up with a draft 'best practice' guide to help other developers develop better models. The main problem I face is... | <p><a href="https://rads.stackoverflow.com/amzn/click/com/0321193687" rel="noreferrer" rel="nofollow noreferrer">UML Distilled</a> by Martin Fowler</p>
| <p>I know you probably want an easy to read book for this but from what you are describing I would suggest going with the specs found on <a href="http://www.uml.org/" rel="nofollow noreferrer">OMG</a> itself. They are a bit much to read but would be as complete as you could hope for. They also have lonks to articles an... | 30,316 |
<p>I have a simple function in which an array is declared with size
depending on the parameter which is int.</p>
<pre><code> void f(int n){
char a[n];
};
int main() {
return 0;
}
</code></pre>
<p>This piece of code compiles fine on <a href="http://en.wikipedia.org/wiki/G%2B%2B" rel="no... | <p>What you have found it one of the Gnu compiler's extensions to the C++ language. In this case, Visual C++ is completely correct. Arrays in C++ must be defined with a size that is a compile-time constant expression.</p>
<p>There was a feature added to C in the 1999 update to that language called variable length ar... | <p>Typically in C (excepting C99 compilers as others have pointed out) and C++, if you want to allocate memory on the stack, the size of what you want to allocate has to be known at compile time. Local variables are allocated on the stack, so an array whose length depends on a function parameter at run time violates th... | 40,224 |
<p>I have an XML document with un-namespaced elements, and I want to use XSLT to add namespaces to them. Most elements will be in namespace A; a few will be in namespace B. How do I do this?</p>
| <p>With foo.xml</p>
<pre><code><foo x="1">
<bar y="2">
<baz z="3"/>
</bar>
<a-special-element n="8"/>
</foo>
</code></pre>
<p>and foo.xsl</p>
<pre><code> <xsl:template match="*">
<xsl:element name="{local-name()}" namespace="A" >
... | <p>Here's what I have so far:</p>
<pre><code><xsl:template match="*">
<xsl:element name="{local-name()}" namespace="A" >
<xsl:apply-templates />
</xsl:element>
</xsl:template>
<xsl:template match="a-special-element">
<B:a-special-element xmlns:B="B">
... | 17,452 |
<p>I'm using selenium to run some functional tests on the UI for our current application. </p>
<p>I want to ensure that strings from the resource files in the Web project are being displayed at the correct time and place.</p>
<p>Simple (I thought) all I have to do is reference the assembly of the web application and ... | <p>Concatenation is (significantly) faster according to my machine. But stylistically, I'm willing to pay the price of substitution if performance is not critical. Well, and if I need formatting, there's no need to even ask the question... there's no option but to use interpolation/templating.</p>
<pre><code>>>&... | <p>Actually the correct thing to do, in this case (building paths) is to use <code>os.path.join</code>. Not string concatenation or interpolation</p>
| 49,280 |
<p>I have a site where I use CustomErrors in the web.config to specify a custom error page, and that's working just fine. The custom 404 page is also specified in the IIS configuration (because if it's not, I don't get my custom 404 page).</p>
<p>But I have some logic that kicks in if a user gets a 404 that looks at ... | <p>The aspxerrorpath parameter is passed if the error was caught by .NET (and the error page specified in web.config is used). This happens if you're using the development web server, or if IIS is configured not to check that the file exists.</p>
<p>If IIS checks that the file exists, then the custom error configured ... | <p>You may have to add the below to web.config</p>
<pre><code><customErrors mode="On">
<error statusCode="404" redirect="~/error404.aspx" />
</customErrors>
</code></pre>
<p>For more information check : <a href="https://web.archive.org/web/20200221100823/http://geekswit... | 33,499 |
<p>I'm attempting to learn basic Win32 programming and running into a frustrating problem. I wish to convert a variable (Call it NumClicks) and display it as the application name (as part of a string).
From what I've seen, going from int + some block of text to a char* is problematic, because converting it to the requi... | <p>use <a href="http://msdn.microsoft.com/en-us/library/ms647550(VS.85).aspx" rel="nofollow noreferrer">wsprintf</a><br>
It allows you to compose a string the same way printf allows you to print a line of text.</p>
| <p>rather than use wsprintf i would use sprinf(buf, "%S", "plain old string");</p>
| 40,322 |
<p><code>Monitor.Pulse/All</code> and <code>Monitor.Wait</code> are useful methods, but I'm getting complaints that when using them in large quantities (I have a DSL designer that spits them out by the dozen), the resulting code becomes unreadable. What do you think?</p>
| <p>If it's sprinkled all over code that you actually have to read, that could be a problem. Why does it come up so often in the first place? Could the functionality actually be encapsulated somewhere else?</p>
<p>Fundamentally there's nothing wrong with Wait/Pulse - but like everything else in life, if it's used inapp... | <p>Sounds like something that should be coded by injection as an aspect. However, my knowledge of the support of AOP in C# is negligible, so I can't offer any more than that.</p>
| 46,971 |
<p>Was wondering if anyone knows, or has pointers to good documentation that discusses, the low-level implementation details of Cocoa's 'performSelectorOnMainThread:' method.</p>
<p>My best guess, and one I think is probably pretty close, is that it uses mach ports or an abstraction on top of them to provide intra-thr... | <p>Yes, it does use Mach ports. What happens is this:</p>
<ol>
<li>A block of data encapsulating the perform info (the target object, the selector, the optional object argument to the selector, etc.) is enqueued in the thread's run loop info. This is done using <code>@synchronized</code>, which ultimately uses <code>p... | <p>As Mecki said, a more general mechanism that could be used to implement <code>-performSelectorOn…</code> is <code>NSTimer</code>.</p>
<p><code>NSTimer</code> is toll-free bridged to <code>CFRunLoopTimer</code>. An implementation of <code>CFRunLoopTimer</code> – although not necessarily the one actually used for nor... | 18,003 |
<p>I have a Crystal Report which is viewed via a CrystalReportViewer control on an .aspx page (using VS2008). </p>
<p>The report has two data-driven FieldObjects (which can contain a variable number of chars) which I would like to display on the same line beside each other. </p>
<p>Problem is when the text in the f... | <p>you can add a text object to the report. And while editing the text of the text object, drag the field you want to show from the object explorer into the text box. Then hit space, then drag the second field in to the same text box. Your two fields will always be one space a part. You could, of course, add more space... | <p>Or you can create a function which returns field1 + " " + field2 and add the function to the report.</p>
| 5,407 |
<p>I have been getting an error in <strong>VB .Net</strong> </p>
<blockquote>
<p>object reference not set to an instance of object.</p>
</blockquote>
<p>Can you tell me what are the causes of this error ?</p>
| <p>sef,
If the problem is with Database return results, I presume it is in this scenario:</p>
<pre><code> dsData = getSQLData(conn,sql, blah,blah....)
dt = dsData.Tables(0) 'Perhaps the obj ref not set is occurring here
</code></pre>
<p>To fix that:</p>
<pre><code> dsData = getSQLData(conn,sql, blah,blah....)... | <p>Well, Error is explaining itself. Since You haven't provided any code sample, we can only say somewhere in your code, you are using a Null object for some task. I got same Error for below code sample.</p>
<pre><code>Dim cmd As IDbCommand
cmd.Parameters.Clear()
</code></pre>
<p>As You can see I am going to Clear a ... | 15,916 |
<p>I'm working with DotNetNuke's scheduler to schedule tasks and I'm looking to get the physical file path of a email template that I created. The problem is that HttpContext is NULL because the scheduled task is on a different thread and there is not http request. How would you go about getting the file's physical pat... | <p><a href="http://msdn.microsoft.com/en-us/library/system.web.hosting.hostingenvironment.mappath.aspx" rel="noreferrer">System.Web.Hosting.HostingEnvironment.MapPath</a> is what you're looking for. Whenever you're using the Server or HttpContext.Current objects, check first to see if <a href="http://msdn.microsoft.co... | <p>Since this process is really out-of-band in relation to the web site, maybe you can just put the path in a config file. </p>
<p>May not be the best idea, but it is an alternative.</p>
| 13,455 |
<p>How do you delete all the cookies for the current domain using JavaScript?</p>
| <pre><code>function deleteAllCookies() {
var cookies = document.cookie.split(";");
for (var i = 0; i < cookies.length; i++) {
var cookie = cookies[i];
var eqPos = cookie.indexOf("=");
var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
document.cookie = name + "=;exp... | <p>I found a problem in IE and Edge. Webkit browsers (Chrome, safari) seem to be more forgiving. When setting cookies, always set the "path" to something, because the default will be the page that set the cookie. So if you try to expire it on a different page without specifying the "path", the path won't match and it w... | 21,627 |
<p>I have a Git repository I store random things in. Mostly random scripts, text files, websites I've designed and so on.</p>
<p>There are some large binary files I have deleted over time (generally 1-5MB), which are sitting around increasing the size of the repository, which I don't need in the revision history.</p>
... | <p>This is an adaptation of <a href="https://stackoverflow.com/questions/223678/git-which-commit-has-this-blob#223890">the <code>git-find-blob</code> script I posted previously</a>:</p>
<pre class="lang-perl prettyprint-override"><code>#!/usr/bin/perl
use 5.008;
use strict;
use Memoize;
sub usage { die "usage: git-la... | <p>A little late to the party, but <a href="https://github.com/cyaninc/git-fat" rel="nofollow">git-fat</a> has this functionality built in.</p>
<p>Just install it with pip and run <code>git fat -a find 100000</code> where the number at the end is in Bytes.</p>
| 38,183 |
<p>I've got a minidump file from a crash in one of our apps. It's a 32-bit native app, and it was running on 64-bit Windows.</p>
<p>If I load the minidump file into WinDbg, WinDbg won't load the symbols for the system DLLs. I've got my symbol paths configured correctly:</p>
<pre><code>_NT_SYMBOL_PATH=SRV*C:\WebSymbol... | <p>Are you debugging on a 32-bit or 64-bit system, and with the 32 or 64-bit version of WinDBG? You typically have to debug on the same architecture package you took the dump from:</p>
<p><a href="http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx" rel="noreferrer"><a href="http://www.microsoft.com/whdc/... | <p>Consider the workaround mentionned here where syswo64\ntdll.dll is copied to Syswow64\ntdll32.dll</p>
<p><a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=98781&wa=wsignin1.0" rel="nofollow noreferrer">https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?... | 33,271 |
<p>I'm doing some experiments with Microsoft Dynamics CRM. You interact with it through web services and I have added a Web Reference to my project. The web service interface is very rich, and the generated "Reference.cs" is some 90k loc. </p>
<p>I'm using the web reference in a console application. I often change som... | <p>The following is ripped from <a href="http://communities.vmware.com/thread/47063" rel="noreferrer">this</a> thread on the VMWare forums:</p>
<p>Hi folks,</p>
<p>We've found that sgen.exe does work. It'just that there is a couple of additional steps beyond pre-generating the serializer dll's that we missed in this ... | <p>I came across this thread when trying to find out why my initial <code>SoapHttpClientProtocol</code> calls were taking so long. </p>
<p>I found that setting the Proxy to null/Empty stopped the Proxy AutoDetect from occurring - This was taking up to 7 seconds on the initial call:</p>
<pre><code>this.Proxy = GlobalP... | 20,740 |
<p>I have a Queue object that I need to ensure is thread-safe. Would it be better to use a lock object like this:</p>
<pre><code>lock(myLockObject)
{
//do stuff with the queue
}
</code></pre>
<p>Or is it recommended to use Queue.Synchronized like this:</p>
<pre><code>Queue.Synchronized(myQueue).whatever_i_want_to_do... | <p>Personally I always prefer locking. It means that <em>you</em> get to decide the granularity. If you just rely on the Synchronized wrapper, each individual operation is synchronized but if you ever need to do more than one thing (e.g. iterating over the whole collection) you need to lock anyway. In the interests of ... | <p>It seems clear to me that using a lock(...) {...} lock is the right answer.</p>
<blockquote>
<p><strong>To guarantee the thread safety of the Queue, all operations must be done through this wrapper only.</strong></p>
</blockquote>
<p>If other threads access the queue without using .Synchronized(), then you'll be... | 43,975 |
<p>I have two tables Organisation and Employee having one to many relation i.e one organisation can have multiple employees. Now I want to select all information of a particular organisation plus first name of all employees for this organisation. What’s the best way to do it? Can I get all of this in single record set ... | <p>The original question was database specific, but perhaps this is a good place to include a more generic answer. It's a common question. The concept that you are describing is often referred to as 'Group Concatenation'. There's no standard solution in SQL-92 or SQL-99. So you'll need a vendor-specific solution.</p>
<... | <p>If you use Oracle you can create a PL/SQL function you can use in your query that accepts an organization_id as input, and returns the first name of all employees belonging to that org as a string. For example:-</p>
<pre><code>select
o.org_id,
o.org_address,
o.org_otherdetails,
org_employees( o.org_id )... | 12,786 |
<p>Can anyone recommend any Ad Management components for .NET? I have a customer who would like to sell his own advertising through his own site. This rules out using packaged ad providers such as Google Ads.</p>
<p>I've googled several packages, but I'd like to see if anyone has any first hand experience with a par... | <p>If there is going to be any size or complexity to the ad system, I wouldn't roll your own. Focus on your core competencies and outsource the rest, because ad people can be crazy and it's nearly impossible to implement all the features they would want. Frequency capping, geotargeting, failover reporting, inventory ... | <p>If there is going to be any size or complexity to the ad system, I wouldn't roll your own. Focus on your core competencies and outsource the rest, because ad people can be crazy and it's nearly impossible to implement all the features they would want. Frequency capping, geotargeting, failover reporting, inventory ... | 28,057 |
<p>You're stepping through C/C++ code and have just called a Win32 API that has failed (typically by returning some unhelpful generic error code, like 0). Your code doesn't make a subsequent GetLastError() call whose return value you could inspect for further error information.</p>
<p>How can you get the error value ... | <p>As mentioned a couple times, the <code>@err</code> pseudo-register will show the last error value, and <code>@err,hr</code> will show the error as a string (if it can). </p>
<p>According to Andy Pennell, a member of the Visual Studio team, starting with VS 7 (Visual Studio .NET 2002), using the '@' character to in... | <p>"edit and continue" add the code so you can see the error (just don't create a new global variable to store it). It works really well if you can quickly put a call to a pre-existing function that executes this kind of error handling code.</p>
<p>As a bonus, you can leave the new code there for the future too.</p>
... | 19,337 |
<p>Should I use a hand-written schema for my projected developed in a high-level language (such as Python, Ruby) or should I let my ORM solution auto-generate it?
Eventually I will need to migrate without destroying all the data. It's okay to be tied to a specific RDBMS but it would be nice if features such as constrai... | <p>I never go with ORM-generated schema.</p>
<p>I find that the ways in which the ORM wants to generate the schema are often at total odds with how I want my database to be structured. Also, and I know this is trivial, the nomenclature scheme is usually poor.</p>
<p>Database structure has its own constraints, that I... | <p>Let your ORM solution generate it, but don't just blindly use it; read through it and sanity-check it.</p>
| 15,449 |
<p>I've got an MDI application written in Delphi 2006 which runs XP with the default theme. </p>
<p>Is there a way of controlling the appearance of the MDI Children to avoid the large XP-style title bar on each window? </p>
<p>I've tried setting the <code>BorderStyle</code> of the <code>MDIChildren</code> to <code>bs... | <p>All your need - overload procedure CreateWindowHandle, like this:</p>
<pre><code>unit CHILDWIN;
interface
uses Windows, Classes, Graphics, Forms, Controls, StdCtrls;
type
TMDIChild = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
procedure CreateWindowHandle(const Pa... | <p>I don't think there is; in my experience, MDI in Delphi is very strictly limited and controlled by its implementation in the VCL (and perhaps also by the Windows API?). For example, don't try hiding an MDI child (you'll get an exception if you try, and you'll have to jump through a couple of API hoops to work around... | 3,022 |
<p>I've been trying to display text using a Quartz context, but no matter what I've tried I simply haven't had luck getting the text to display (I'm able to display all sorts of other Quartz objects though). Anybody knows what I might be doing wrong?</p>
<p>example:</p>
<pre><code>-(void)drawRect:(CGRect)rect
{
... | <p>Here is a fragment of code that I'm using.</p>
<pre><code>UIColor *mainTextColor = [UIColor whiteColor];
[mainTextColor set];
drawTextLjust(@"Sample Text", 8, 50, 185, 18, 16);
</code></pre>
<p>And:</p>
<pre><code>static void drawTextLjust(NSString* text, CGFloat y, CGFloat left, CGFloat right,
... | <p>OK, I got it. First off, change your encoding mode to kCGEncodingMacRoman. Secondly, insert this line underneath it:</p>
<pre><code>CGContextSetTextMatrix(canvas, CGAffineTransformMake(1, 0, 0, -1, 0, 0));
</code></pre>
<p>This sets the conversion matrix for text so that it is drawn correctly. If you don't put tha... | 17,300 |
<p>What I am looking for is a way to call a method after another method has been invoked but before it is entered. Example:</p>
<pre><code>public class Test {
public void Tracer ( ... )
{
}
public int SomeFunction( string str )
{
return 0;
}
public void TestFun()
{
SomeFunction( "" );
}
}... | <p>You can use a dynamic proxy (<a href="http://www.castleproject.org/dynamicproxy/index.html" rel="nofollow noreferrer">Castle's DynamicProxy</a> for example) to intercept the call, run whatever code you wish, and then either invoke your method or not, depending on your needs.</p>
| <p>You would have to use some form of AOP framework like <a href="http://www.springframework.net/doc-latest/reference/html/aop-quickstart.html" rel="nofollow noreferrer">SpringFramework.NET</a> to do that.</p>
| 23,376 |
<p>Google results on this one are a bit thin, but suggest that it is not easily possible.</p>
<p>My specific problem is that I need to renumber the IDs in two tables that are related to each other such that table B has an "table_a_id" column in it. I can't renumber table A first because then its children in B point to... | <p>There are two things you can do (these are complementary, not alternatives):</p>
<ul>
<li>Create your foreign key constraints as DEFERRABLE. Then, call "SET CONSTRAINTS DEFERRED;", which will cause foreign key constraints not to be checked until the end of the transaction. Note that the default if you don't specify... | <p>I think that an easear solution would be to create "temporary" columns associating where you want them to be.</p>
<p>update the values with the foreign keys to the new columns</p>
<p>drop the inicial columns</p>
<p>rename to the new "temporary" columns to the same names then the inicial ones.</p>
| 16,921 |
<p>So I have a function that looks something like this:</p>
<pre><code>float function(){
float x = SomeValue;
return x / SomeOtherValue;
}
</code></pre>
<p>At some point, this function overflows and returns a really large negative value. To try and track down exactly where this was happening, I added a cout ... | <p>Welcome to the wonderful world of floating point. The answer you get will likely depend on the floating point model you compiled the code with. </p>
<p>This happens because of the difference between the IEEE spec and the hardware the code is running on. Your CPU likely has 80 bit floating point registers that ge... | <p>I dont think the cout has any effect on the variable, the problem would have to be somewhere else.</p>
| 7,151 |
<p>Hello is there a way to prevent bend on print with M3D printer? </p>
<p><a href="https://i.stack.imgur.com/j2IRe.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/j2IRe.jpg" alt="enter image description here"></a></p>
| <p>You can to print a brim, a thin layer on the bottom connected to the model. This will help hold it in place. Since it is thin (one or two layers) it will not warp itself.</p>
<p>The brim is not the same thing as a raft. A raft is under the model. The brim is on the same layer as the models bottom layer but outside ... | <p>Try using an adhesive before you print. This could be <a href="http://airwolf3d.com/shop/wolfbite-prevents-3d-printed-parts-from-warping" rel="nofollow noreferrer">http://airwolf3d.com/shop/wolfbite-prevents-3d-printed-parts-from-warping</a> ... What is the temperature of the room you are printing in like?</p>
| 469 |
<p>Is there an Open Source Free Graph Control for Windows Forms .NET 2.0?</p>
| <p>I have been using <a href="http://zedgraph.org/wiki/index.php?title=Main_Page" rel="nofollow noreferrer">ZedGraph</a> for a while. You can generate various types of graphs that look very professional. </p>
| <p>I would recommend <a href="http://www.nplot.com/" rel="nofollow noreferrer">nPlot</a></p>
| 26,630 |
<p>Is there a better, more elegant (and/or possibly faster) way than</p>
<pre><code>boolean isNumber = false;
try{
Double.valueOf(myNumber);
isNumber = true;
} catch (NumberFormatException e) {
}
</code></pre>
<p>...?</p>
<hr>
<p><strong>Edit</strong>:
Since I can't pick two answers I'm going with the regex o... | <p>I don't believe there's anything built into Java to do it faster and still reliably, assuming that later on you'll want to actually parse it with Double.valueOf (or similar).</p>
<p>I'd use Double.parseDouble instead of Double.valueOf to avoid creating a Double unnecessarily, <em>and</em> you can also get rid of bl... | <p>If you want something that's blisteringly fast, and you have a very clear idea of what formats you want to accept, you can build a state machine <a href="http://en.wikipedia.org/wiki/Deterministic_finite-state_machine" rel="nofollow noreferrer">DFA</a> by hand. This is essentially how regexes work under the hood any... | 46,912 |
<p>I have a database in single user mode and I am trying to drop it so I can re-run the creation scripts on it, but I'm being locked out from it.</p>
<ol>
<li>How do I figure out who has the lock on it?</li>
<li>How do I disable that lock?</li>
</ol>
| <p>run sp_who, find the spid with the database name you require, kill the spid.</p>
| <p>From SQL Server Management Studio:</p>
<ol>
<li>open the object explorer</li>
<li>expand the database server</li>
<li>expand "Management"</li>
<li>double-click on "Activity Monitor"</li>
<li>locate the process using the desired database</li>
<li>right-click on process</li>
<li>click "Kill Process"</li>
</ol>
| 12,868 |
<p>Has anybody got any real world stories build mobile web sites with NetBiscuits?</p>
<p>Someone told me it was the next big thing in mobile development (<a href="http://www.netbiscuits.com/home" rel="nofollow noreferrer">http://www.netbiscuits.com/home</a>) and it looks pretty good from their site. Just wondered if ... | <p>In addition to what @JohnIdol says correctly, I've found that you need to setup a number VS environment variables. I don't have the name of the batch file in front of me, but you can modify or 'I think' use it. It is in VS program files tree somewhere. Also, as I remember you don't want to be in a standard shell but... | <p>You can start msbuild from the command line. msbuild understands .sln (solution) files. You can specify the .sln file and the build configuration (debug, release etc.) from the command line.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms164311.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en... | 35,481 |
<p>I'm trying to register an atl service using</p>
<p>ExeName.exe /service</p>
<p>as described here: <a href="http://msdn.microsoft.com/en-us/library/74y2334x(VS.80).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/74y2334x(VS.80).aspx</a></p>
<p>After doing so though, it's not appearing in my... | <p>Running with the CAtlServiceModule::Install method out of the box, you must use the correct capitals on each argument - "/Service", "/UnregServer", etc. </p>
| <p>Shot in the dark: Are you running on Vista? If so make sure you are running with full admin privleges. Otherwise it's possible you're registering this app via virtualization. </p>
| 33,796 |
<p>I have a project that has a makefile with broken dependencies. Is there any best known way to generate a list of dependencies for the project that I can use in the makefile, other than examining each source file by hand or with a hand written perl script?</p>
| <p><a href="https://make.mad-scientist.net/papers/advanced-auto-dependency-generation/#combine" rel="noreferrer">GNU make</a>'s documentation provides a good solution.</p>
<p>Absolutely. <code>g++ -MM <your file></code> will generate a GMake compatible list of dependencies. I use something like this:</p>
<pre><... | <p>The Digital Mars C/C++ compiler comes with a <a href="http://www.digitalmars.com/ctg/makedep.html" rel="nofollow noreferrer">makedep</a> tool.</p>
| 40,458 |
<p>I know I can edit each individual DTS package and save it as a Visual Basic script, but with hundreds of packages on the server, that will take forever. How can I script them all at once? I'd like to be able to create one file per package so that I can check them into source control, search them to see which one r... | <p>I ended up digging through the SQL 2000 documentation (Building SQL Server Applications / DTS Programming / Programming DTS Applications / DTS Object Model) and creating a VBS script to read the packages and write XML files. It's not complete, and it could be improved in several ways, but it's a big start:</p>
<p>... | <p>You might try working with the system table sysdtspackages as demonstrated on sqldts.com in <a href="http://www.sqldts.com/204.aspx" rel="nofollow noreferrer">Transferring DTS Packages</a>.<br>
Also, there used to be many tools available for MS SQL 2000 before the new versions proliferated. I found one, called <a hr... | 11,282 |
<p>I'm trying to subclass NSCell for use in a NSTableView. The cell I want to create is fairly complicated so it would be very useful if I could design it in Interface Builder and then load the NSCell from a nib.</p>
<p>Is this possible? How do I do it?</p>
| <p>The question was about a subclass of NSCell; the other answers seem to be doing something else, likely taking advantage of UITableViewCell being a view.</p>
<p>NSCell is not a view. While laying a custom cell out in IB would be a useful thing to be able to do, I think the answer is basically "no, this is not possi... | <p>Add your <code>UITableViewCell</code> to your <code>tableviewcontroller</code> and declare an <code>IBOutlet</code> property:</p>
<pre><code>@interface KuguTableViewController : UITableViewController {
IBOutlet UITableViewCell *customTypeCell;
}
@property (readonly) UITableViewCell *customTypeCell;
</code></p... | 24,760 |
<p>So I have a "large" number of "very large" ASCII files of numerical data (gigabytes altogether), and my program will need to process the entirety of it sequentially at least once.</p>
<p>Any advice on storing/loading the data? I've thought of converting the files to binary to make them smaller and for faster loadi... | <blockquote>
<p>So then what if the processing requires jumping around in the data for multiple files and multiple buffers? Is constant opening and closing of binary files going to become expensive?</p>
</blockquote>
<p>I'm a big fan of <em>'memory mapped i/o'</em>, aka <em>'direct byte buffers'</em>. In Java they ... | <p>You really haven't given us enough info to help you. Do you need to load each file in its entiretly in order to process it? Or can you process it line by line?</p>
<p>Loading an entire file at a time is likely to result in poor performance even for files that aren't terribly large. Your best bet is to define a buff... | 11,323 |
<p>So my project has a trunk where we make all development changes to. We also have a branch with slightly modified parameters to accommodate another department. We work in batches, and once we are done with a set of changes to the trunk, switch over to the branch and merge all appropriate revisions. This has been goin... | <p>A common culprit is line endings. Are some of your development machines windows and the others *nix-based? The different line endings, if not accounted for or translated, will cause files to not exactly match.</p>
| <p>Well, what I'd recommend trying is using some other merging software. Not sure if Tortoise SVNCompare highlights whitespace changes as obviously as WinMerge does, for example.</p>
| 30,179 |
<p>I have a collection of classes that I want to serialize out to an XML file. It looks something like this:</p>
<pre><code>public class Foo
{
public List<Bar> BarList { get; set; }
}
</code></pre>
<p>Where a bar is just a wrapper for a collection of properties, like this:</p>
<pre><code>public class Bar
{
... | <p>Just to check, have you marked Bar as [Serializable]?</p>
<p>Also, you need a parameter-less ctor on Bar, to deserialize</p>
<p>Hmm, I used:</p>
<pre><code>public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
... | <p>It has been over 5 years since this item was posted. I give my experience from July 2013 (.NET Framework 4.5). For what it's worth and to whom it may concern:</p>
<p>When I define a class like so: (VB.Net code)</p>
<pre><code><Serializable> Public Class MyClass
Public Property Children as List(of ChildCL... | 21,568 |
<p>I have a list of objects, each containing an Id, Code and Description.</p>
<p>I need to convert this list into a Hashtable, using <strong>Description</strong> as the key and <strong>Id</strong> as the value.</p>
<p>This is so the Hashtable can then be serialised to JSON.</p>
<p>Is there a way to convert from List... | <p>Let's assume that your List contains objects of type Foo (with an int Id and a string Description).</p>
<p>You can use Linq to turn that list into a Dictionary like this:</p>
<pre><code>var dict = myList.Cast<Foo>().ToDictionary(o => o.Description, o => o.Id);
</code></pre>
| <p>Also look at the <code>System.Collections.ObjectModel.KeyedCollection<TKey, TItem></code>. It seems like a better match for what you want to do.</p>
| 20,067 |
<p>I'm using a MSSQL database and would like to create a column that only has 4 possible values. Is there any way to define a 2-bit column? I see the bit datatype and then the next smallest is tinyint which is 1 full byte.</p>
<p>If there is no such field, I'd be interesting in finding out why not.</p>
<p>Thanks.... | <p>I don't see the reason for such a field.</p>
<p>It definately cannot be space - that's cheap today, and an economy of 6 bits is really negligible unless you have lots of rows. But in that case it will take up much space anyway, and extra 6 bits per row will again hardly make a difference.</p>
<p>Speed is also not ... | <p>Unless your database is being stored on a floppy disk, I wouldn't sweat it. Take the advice of the rest here and move on with building the rest of the database.</p>
| 42,292 |
<p>I have a very standard <code>Gridview</code>, with Edit and Delete buttons auto-generated.
It is bound to a <code>tableadapter</code> which is linked to my <code>RelationshipTypes</code> table.</p>
<pre><code>dbo.RelationshipTypes:
ID, Name, OriginConfigTypeID, DestinationConfigTypeID
</code></pre>
<p>I wish to us... | <p>You'll have to skip the deferred execution with a call to ToList, which probably won't hurt your performance in large documents as you're just going to be iterating and replacing at a much lower big-O than the original search. As @jacob_c pointed out, I should be using element.Nodes() to replace it properly, and as ... | <p>I would recommend either doing XSLT as Trull recommended as the best solution.</p>
<p>Or you might look at using a string builder and regex matching to remove the items.</p>
<p>You could look at walking through the document, and working with nodes and parent nodes to effectively move the code from inside the node ... | 32,474 |
<p>What's the simplest way to add a click event handler to a canvas element that will return the x and y coordinates of the click (relative to the canvas element)?</p>
<p>No legacy browser compatibility required, Safari, Opera and Firefox will do.</p>
| <p>If you like simplicity but still want cross-browser functionality I found this solution worked best for me. This is a simplification of @Aldekein´s solution but <strong>without jQuery</strong>.</p>
<pre><code>function getCursorPosition(canvas, event) {
const rect = canvas.getBoundingClientRect()
const x = e... | <p>Hey, this is in dojo, just cause it's what I had the code in already for a project.</p>
<p>It should be fairly Obvious how to convert it back to non dojo vanilla JavaScript. </p>
<pre><code> function onMouseClick(e) {
var x = e.clientX;
var y = e.clientY;
}
var canvas = dojo.byId(canvasId);
dojo... | 7,949 |
<p><strong>Keep in mind that I'm not looking for a list of current browsers to support, I'm looking for logical ways to make that list, backed by some kind of hard statistics.</strong> </p>
<p>Since it's been a while since my last web job, I decided to do this latest site up from scratch. Now I have to decide <em>agai... | <p>Browsers don't die out completely for about a decade. The first thing you must realise is that you <em>will</em> have some visitors that are using a browser you don't support. The question is not which browsers are not dead, but which browsers are worth supporting (the benefit) relative to the work it takes to do ... | <p>My opinion (has always been) build it to the standards and leave it to the browsers to render it correctly.</p>
| 11,414 |
<p>I'm working on a Zend Framework (1.7) project with a structure loosely based on the structure of the quickstart application - front controller, action controllers, views & models that use Zend_Db_Table to get to the database. One of my main models relies on some expensive joins to pull up its primary listing, s... | <p>You can provide an interface on your models that accepts <code>$current_page</code> and <code>$per_page</code> parameters and returns the current page's data set as well as a paginator object.</p>
<p>This way all your pagination code is contained within the model and you are free to use the Db adapters without feel... | <p>Well, I can't give you an answer to your concerns with using DbSelect but I did come across this bit of code (in the comments of the ibuildings blog) relating to the issue of reducing the number of rows pulled. Might be useful to some readers. </p>
<pre><code>$select = $db->from('users')->order('name');
$... | 44,568 |
<p>I've got such a simple code:</p>
<pre><code><div class="div1">
<div class="div2">Foo</div>
<div class="div3">
<div class="div4">
<div class="div5">
Bar
</div>
</div>
</div>
</div>
</code></pre>
<p>and this CSS:</p... | <p>IE7 won't allow you to apply <code>:hover</code> pseudo-classes to non-anchor elements unless you explicitly specify a doctype. Just add a doctype declaration to your page and it should work perfectly.</p>
<pre><code><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">... | <p>I found that this solution worked better and was a bit cleaner:</p>
<pre><code> <style type="text/css">
* {
color: #fff;
}
.wrapper {
}
.trigger {
background: #223;
}
.appear {
background: #334;
displ... | 17,308 |
<p>I've been using Lisp on and off for a while but I'm starting to get more serious about doing some "real" work in Lisp. I'm a huge Vim fan and was wondering how I can be most productive using Vim as my editor for Lisp development. Plugins, work flow suggestions, etc. are all welcome.</p>
<p>Please don't say "use ema... | <p>Limp aims to be a fully featured Common Lisp IDE for Vim. It defaults to SBCL, but can be changed to support most other implementations by replacing "sbcl" for your favourite lisp, in the file /usr/local/limp/latest/bin/lisp.sh</p>
<p>When discussing Lisp these days, it is commonly assumed to be Common Lisp, the la... | <p>I know you said not to tell you to use Emacs.</p>
<p>Use Emacs.</p>
<p>Serious, the <a href="http://common-lisp.net/project/slime/" rel="nofollow noreferrer">SLIME</a> setup for Emacs is pretty much <em>the</em> standard development platform for Lisp, and for very good reason.</p>
| 12,039 |
<p>Are there any Web page designing software out there that allow me to drag and drop controls just like desktop applications. I found it quite difficult to design a web page using the designer in Visual Studio 2008 as it constrains me to a flow or grid layout. (I am not an accomplished designer but there should be som... | <p>You should have no problem with using Dreamweaver and then transferring it to Visual Studio.</p>
<p>After all, they both spit out HTML and CSS.</p>
<p>Be aware though, the HTML and CSS they spit out is very bloated and a maintenance nightmare if you decide to jump into the markup.</p>
<p>You may also want to have... | <p>Are you looking for something like <a href="http://www.adobe.com/products/dreamweaver/" rel="nofollow noreferrer">Dreamweaver?</a></p>
| 37,661 |
<pre><code>LRESULT result = ::SendMessage(hWnd, s_MaxGetTaskInterface, (WPARAM)&pUnkReturn, 0);
</code></pre>
<p>The value of result after the call is 0</p>
<p>I expect it to return with a valid value of pUnkReturn , but it returns with a NULL value .</p>
<p>Necessary Information before this call :</p>
<pre><c... | <p>I think the & in &pUnkReturn is needed, based on the hungarian prefix. I expect pUnkReturn to have type IUnknown*. The message receiver will provide the IUnknown*. The address where it will store that IUnknown* is an IUnknown**. Hence, this code passes in &pUnkReturn and the message receiver writes to *(... | <p>When I Googled for <code>NI:Max:GetTaskInterface</code> I couldn't find anything. In general, how a window will handle a given message depends entirely on the window concerned. Does the window (specified by <code>hWnd</code>) even support the <code>NI:Max:GetTaskInterface</code> message?</p>
| 12,595 |
<p>I'm trying to write some SQL that will delete files of type '.7z' that are older than 7 days.</p>
<p>Here's what I've got that's not working:</p>
<pre><code>DECLARE @DateString CHAR(8)
SET @DateString = CONVERT(CHAR(8), DATEADD(d, -7, GETDATE()), 1)
EXECUTE master.dbo.xp_delete_file 0,
N'e:\Databa... | <p>Had a similar problem, found various answers. Here's what I found.</p>
<p>You can't delete 7z files with xp_delete_file. This is an undocumented extended stored procedure that's a holdover from SQL 2000. It checks the first line of the file to be deleted to verify that it is either a SQL backup file or a SQL report... | <p>Try changing the first parameter from 0 to 1.</p>
<p>Here is a small <a href="http://nikeshikari.blogspot.com/2008/05/tech-mssql-xpdeletefile.html" rel="nofollow noreferrer">summary on <code>xp_delete_file</code></a> I just found. Sounds a bit like you'd be out of luck with this procedure.</p>
| 26,129 |
<p>I set my ASP.NET State service to automatic start the other day on a hosted VSP Win 2003 server. I came back today and the service has gone completely missing!?</p>
<p>Any ideas why it has gone and how to get it back? Thanks!</p>
| <p>You should ask your hosting service provider, they may have removed it (for some reason).</p>
| <p>I have had the same problem, that the ASP.NET State service disappeared from the Administrative Tools / Services list. And the command "net start aspnet_state" didn't work either.</p>
<p>For me it worked fine after doing a repair on the currently latest .net version. Net 4.0 in my case.</p>
| 17,811 |
<p>I have a big red button and I'm trying to use javascript to perform the following: -</p>
<ol>
<li>OnMouseDown change image so the button looks depressed</li>
<li>OnMouseUp return to the initial image AND reveal a hidden div</li>
</ol>
<p>I can get the onMouse Down and onMouseUp image changes part to work.</p>
<p>... | <p>You can use semicolons to separate multiple script statements in an event:</p>
<pre><code><img src="..." alt="..."
onmousedown="depressed();"
onmouseup="undepressed(); revealDiv();" />
</code></pre>
<p>Also, I believe most browsers support the onclick event:</p>
<pre><code><img src="..." alt="..."
... | <p>Without seeing your code, it's hard to say, but I suspect a missing 'return true;' statement at the end of either the onclick or onmouseup event handlers.</p>
| 46,328 |
<p>I have a javascript heavy app which has widgets like autocomplete dropdowns and tabs and so forth. Sometimes when dropdowns appear and disappear, or when you switch between tabs, it changes the height of the document. This can cause annoyances if the scrollbar appears and disappears rapidly, because it shifts the pa... | <p>I belive this question has already been answered on stackoverflow here:
<a href="https://stackoverflow.com/questions/14866775/detect-document-height-change">Detect Document Height Change</a></p>
<p>Basically you have to store the current document height and keep checking for a change via a timeoutcall</p>
<p>The e... | <p>One idea would be to use the watch() method on the clientHeight property:</p>
<pre><code>document.body.watch("clientHeight", function(property, oldHeight, newHeight) {
// what you want to do when the height changes
});
</code></pre>
<p>The function you specify will get executed whenever the specified property ch... | 46,692 |
<p>I'm working with my ASP.NET development team to try and create "better" <em>(i.e. cleaner)</em> HTML when rendering pages. At the moment, .NET has a nasty tendency to do things like dump JavaScript into the page, making it a mandatory requirement on form controls and not allowing forms to work when JS isn't availab... | <p>The ASP.NET MVC Framework would give you a much more familiar separation. Because there is no viewstate, etc in the MVC Framework you won't have to worry about JavaScript being dumped into your pages. The only JavaScript calls you see will be ones that you manually add.</p>
<p>You can, for the most part, separate H... | <p>Asp.Net MVC will help you keep html/css/js separate in that it will present fewer features that would prevent you from keeping them separate.</p>
<p>For example Html helpers typically return just that: Html. From that point you are free to choose to keep all style information associated only by class attributes. </... | 8,043 |
<p>Does anyone know why when using BindingUtils on the selectedItem property of a ComboBox you get the following warning? Any ideas how to resolve the issue?</p>
<p>The binding still works properly, but it would be nice to get rid of the warning.</p>
<pre><code>warning: multiple describeType entries for 'selectedItem... | <p>It is better to override the property in question and declare it final.</p>
| <p>Here is the code. It is basically a copy of BindingUtils.bindProperty that is setup for a ComboBox so that both the combo box and the model are updated when either of the two change.</p>
<pre><code>public static function bindProperty2(site:Object, prop:String, host:Object, chain:Object, commitOnly:Boolean = false):C... | 2,784 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.