instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>I have some string s that is locale specific (eg, 0.01 or 0,01). I want to convert this string to a NSDecimalNumber. From the <a href="http://developer.apple.com/documentation/Cocoa/Conceptual/DataFormatting/Articles/dfNumberFormatting10_4.html" rel="noreferrer">examples I've seen thus far on the interwebs</a>, th... | <p>Based on Boaz Stuller's answer, I logged a bug to Apple for this issue. Until that is resolved, here are the workarounds I've decided upon as being the best approach to take. These workarounds simply rely upon rounding the decimal number to the appropriate precision, which is a simple approach that can supplement ... | <p>See also <a href="https://stackoverflow.com/questions/149033/best-way-to-store-currency-values-in-c">Best way to store currency values in C++</a></p>
<p>The best way to handle currency is to use an integer value for the smallest unit of the currency, i.e. cents for dollars/euros, etc. You'll avoid any floating poin... | 40,985 |
<p>OK here's some background of the problem:</p>
<p>Symptoms:</p>
<ul>
<li><p>All retracts on the extruder produce a screeching noise. The extruder extrudes normally all other times.</p>
</li>
<li><p>Any fast move on the Z-axis also produces a screeching noise and the Z-axis will move normally at all other times.</p>
<... | <p>If you have an empty spool of the same brand, you could weigh the empty spool and the one you're trying to "measure" to get an approximate weight of the remaining filament. Divide by the (presumably available from manufacturer) weight per meter to get a rough length in meters, if that's more useful to you... | <p>Besides using the window on a spool that estimates the amount of filament left, I've used large calipers to measure the diameter of an empty spool and the diameter of the filament left on the spool.</p>
| 2,110 |
<p>I've recently come to maintain a large amount of scientific calculation-intensive FORTRAN code. I'm having difficulties getting a handle on all of the, say, nuances, of a forty year old language, despite google & two introductory level books. The code is rife with "performance enhancing improvements". Does an... | <p>You kind of have to get a "feel" for what programmers had to do back in the day. The vast majority of the code I work with is older than I am and ran on machines that were "new" when my parents were in high school.</p>
<p>Common FORTRAN-isms I deal with, that hurt readability are:</p>
<ul>
<li>Common blocks</li>
<... | <p>Here's another one that has bit me from time to time. When you are working on FORTRAN code make sure you skip all six initial columns. Every once and a while, I'll only get the code indented five spaces and nothing works. At first glance everything seems okay and then I finally realize that all the lines are star... | 5,160 |
<p>Can anyone recommend a framework for templating/formatting messages in a standalone application along the lines of the JSP EL (Expression Language)?</p>
<p>I would expect to be able to instantiate a an object of some sort, give it a template along the lines of</p>
<pre><code>Dear ${customer.firstName}. You order w... | <p>You can just use the Universal Expression Language itself. You need an implementation (but there are a few to choose from). After that, you need to implement three classes: ELResolver, FunctionMapper and VariableMapper.</p>
<p>This blog post describes how to do it: <a href="http://illegalargumentexception.blogspot.... | <p>Freemarker would do exactly what you need. This is a template engine with a syntax very similar to JSP :</p>
<p><a href="http://freemarker.org/" rel="nofollow noreferrer">http://freemarker.org/</a></p>
| 11,710 |
<p>The ASP page gets data uses that to draw a graph, I then need to save the image created to JPEG to be displayed on the browser and also used in PDF and other format. What is the best way to compress the image? I am currently porting a JPEG compression library to ASP but I think it will be too slow on this ARM device... | <p>Take a look at the Imaging APIs (start your traversal at the <a href="http://msdn.microsoft.com/en-us/library/aa452202.aspx" rel="nofollow noreferrer">IImagingFactory interface</a>). If your device has a JPG compression codec installed (remember that CE is modular, so it may or may not be present) you can use it to... | <p>I'm confused... </p>
<p>The images from ASP would be compressed on the server side--not client side. </p>
<p>I'm sure your web server is not running on Windows CE, so I don't think your concern is warranted.</p>
<p><strong>EDIT:</strong> Seems as though you can run a web server on Windows CE: <a href="http://ww... | 6,141 |
<p>We recently bought a new rack and set of servers for it, we want to be able to redeploy these boxes as build servers, QA regression test servers, lab re-correlation servers, simulation servers, etc.</p>
<p>We have played a bit with VMWare, VirtualPC, VirtualBox etc, creating a virtual build server, but we came acro... | <p>The problem you're running into is the machine SID must be unique for each machine in a domain. Of course by copying an image you now break that unique constraint.</p>
<p>I'd suggest that you read the documentation for <a href="http://technet.microsoft.com/en-us/library/bb457073.aspx" rel="nofollow noreferrer">Sys... | <p>Another option for dealing with the SID probelm is <a href="http://technet.microsoft.com/en-us/sysinternals/bb897418.aspx" rel="nofollow noreferrer" title="NewSID">NewSID</a>. This is a simpler tool than sysprep, in that all it does is rename the machine and reassign the SID; if you don't need all the other feature... | 13,298 |
<p>This one has me kind of stumped. I want to make the first word of all the paragraphs in my #content div at 14pt instead of the default for the paragraphs (12pt). Is there a way to do this in straight CSS or am I left wrapping the first word in a span to accomplish this?</p>
| <p>What you are looking for is a pseudo-element that doesn't exist. There is <code>:first-letter</code> and <code>:first-line</code>, but no <code>:first-word</code>.</p>
<p>You can of course do this with JavaScript. Here's some code I found that does this: <a href="http://www.dynamicsitesolutions.com/javascript/first-... | <p>Insert Span Tag in your paragraph text. For Example-
<code><p><span>Hello</span>My Name Is Dot</p</code>
and then style the first letter.</p>
| 7,943 |
<p>How are assertions done in c++? Example code is appreciated.</p>
| <p>Asserts are a way of explicitly checking the assumptions that your code makes, which helps you track down lots of bugs by narrowing down what the possible problems could be. They are typically only evaluated in a special "debug" build of your application, so they won't slow down the final release version.</p>
<p>Le... | <p>Here is a <a href="http://en.wikipedia.org/wiki/Assert" rel="nofollow noreferrer">definition</a> of what an assertion is and <a href="http://www.cplusplus.com/reference/clibrary/cassert/assert.html" rel="nofollow noreferrer">here</a> is some sample code. In a nutshell an assertion is a way for a developer to test h... | 31,563 |
<p>Hibernate has a handful of methods that, one way or another, takes your object and puts it into the database. What are the differences between them, when to use which, and why isn't there just one intelligent method that knows when to use what?</p>
<p>The methods that I have identified thus far are:</p>
<ul>
<li><... | <p>Here's my understanding of the methods. Mainly these are based on the <a href="http://www.hibernate.org/hib_docs/v3/api/org/hibernate/Session.html" rel="noreferrer">API</a> though as I don't use all of these in practice.</p>
<p><strong>saveOrUpdate</strong>
Calls either save or update depending on some checks. E.... | <p>None of the answers above are complete. Although Leo Theobald answer looks nearest answer.</p>
<p>The basic point is how hibernate is dealing with states of entities and how it handles them when there is a state change. Everything must be seen with respect to flushes and commits as well, which everyone seems to hav... | 19,488 |
<p>I have a little c# console program that outputs some text using Console.WriteLine. I then pipe this output into a textfile like:</p>
<p><code>c:myprogram > textfile.txt</code></p>
<p>However, the file is always an ansi text file, even when I start cmd with the /u switch.
cmd /? says about the /u switch:</p>
<... | <p>The /U switch, as the documentation says, affects whether <em>internal</em> commands generate Unicode output. Your program is not one of cmd.exe's internal commands, so the /U option does not affect it.</p>
<p>To create a Unicode text file, you need to make sure your program is generating Unicode text.</p>
<p>Even... | <p>I had a look how mscorlib implements Console.WriteLine, and it seems to decide on which text output encoding to use based on a call to <a href="http://msdn.microsoft.com/en-us/library/ms683169(VS.85).aspx" rel="nofollow noreferrer">GetConsoleOutPutCP</a>. So I'm guessing (but have not yet confimed) that the codepage... | 36,242 |
<p>I made a torus that was 1 on the x and y axes, and 3 on the z axis in Blender. It is supposed to be a bead for a beaded necklace. It was exported to Cura as an .stl, then printed on a Lulzbot Mini. It worked fine in plastic, but when we tried it with bronze filament the nozzle clogged and it didn't start printing.<b... | <p>We print a lot of stuff in a variety of materials, and I think it is likely what you are experiencing is a problem caused by some combination of the following: Object size overall, object detail size, wall thickness, or span width/thickness.</p>
<p>Blender gives pretty clean stls, but the last-mile needed to get ou... | <p>We print a lot of stuff in a variety of materials, and I think it is likely what you are experiencing is a problem caused by some combination of the following: Object size overall, object detail size, wall thickness, or span width/thickness.</p>
<p>Blender gives pretty clean stls, but the last-mile needed to get ou... | 260 |
<p>Curious to get people's thoughts. I conduct frequent interviews, and have had enough in my career to reflect on them, and I've noticed a broad array of questions. I made this c++ specific, but it's worth noting that I have had people ask me algorithmic complexity questions over the phone, and I don't even mean what ... | <p>I'd ask about resource/memory management, because it's an important subject in C++, and it doesn't require concrete code. Just sketch a simple hypothetical scenario, and ask how they'd ensure some vital resource gets freed even in the face of errors/exceptions. Say they're developing a network app, how do they ensur... | <ul>
<li>Design Patterns</li>
<li>Basics of C/C++</li>
<li>Virtual Functions</li>
<li>Poly morphism</li>
<li>Concepts from Scott Mayer's series</li>
<li>About templates.
(Not in particular order)</li>
</ul>
<p>Last but not the least. I will give some sample problem I tell them to design the classes. Just the interface... | 47,758 |
<p>Are there any "Alert" (or Notification) frameworks in Java out there.</p>
<p>In my web application I would like our users to be able to configure which (of the available alerts) they would like to receive and in which (e.g via email) form.</p>
<p>As a simple example, a user chooses to be alerted only via email whe... | <p>Nothing comes by default in Java/J2EE. However, it does NOT take much to implement. Your order processor and other processors can have listeners /observers on the processORder method. These can process the email/other notifications.</p>
<p>You can even have a jms message coming out of the OrderProcessor with some i... | <p>We can use JMS for sending notifications to users.
JMS producers puts the alerts in queue and producers will process the message and send to notifications to user via. email / sms and/or store in database to show the messages in user dashboards.</p>
| 37,221 |
<p>I'm trying to build a proxy module for .NET, but I'm having trouble copying the Headers from the current request to the new request. I am setting the headers of the new request, because I want the proxy to support SOAP requests. Here is a portion of my code. I can post everything if need, but this is the only par... | <p>Some of the headers are actually exposed as properties directly on the HttpWebRequest object. These headers you are not allowed to set directly. e.g HttpWebRequest,ContentType and HttpWebRequest.UserAgent</p>
<p>You will need to update these properties directly and avoid setting them via the Headers property.</p>
| <p>So I am understanding your response as "It's not possible to set the collection explicitly." I was hoping there was a way to add names and values to the NameValueDictionary, but I guess I'll need to just determine which fields I need to set and use the properties to access specific name/value objects. I guess I co... | 21,291 |
<p>There is a limitation on Windows Server 2003 that prevents you from copying extremely large files, in proportion to the amount of RAM you have. The limitation is in the CopyFile and CopyFileEx functions, which are used by xcopy, Explorer, Robocopy, and the .NET FileInfo class.</p>
<p>Here is the error that you get... | <p>The best option is to just open the original file for reading, the destination file for writing and then loop copying it block by block. In pseudocode :</p>
<pre><code>f1 = open(filename1);
f2 = open(filename2, "w");
while( !f1.eof() ) {
buffer = f1.read(buffersize);
err = f2.write(buffer, buffersize);
if err... | <p>If you want to write code, one way you can optimize is sending the file in chunks (like using <a href="http://www.codeproject.com/KB/XML/MTOMWebServices.aspx" rel="nofollow noreferrer">MTOM</a>). I used this approach for sending down huge files from a DataCenter down to our office for printing..</p>
<p>Also, check ... | 11,766 |
<p>I'm trying to remember how the math is worked out to compute the remainder of an XOR algorithm in Cyclical Redundancy Checks to verify the remainder bits of a network message.</p>
<p>I shouldn't have tossed that text book.</p>
<p>This is easily done in code, but how is it worked out by hand?</p>
<p>I know it look... | <pre><code>1010 | 101101000
1010
0001 this result is 1011 XOR 1010 = 0001
1010
1010
0000 thus no remainder.
</code></pre>
<p>Thus 101101000 is perfect and no error has occurred in transmission/reception</p>
| <p>Let's assume that we want to divide 101110000 to 1001.</p>
<pre><code>101110000
1001
--------- XOR the 1011 and 1001
0010
</code></pre>
<p>Now we will <strong>remove the zeros at the beginning of our XOR result</strong> which is 0010 and <strong>slide numbers from the top</strong>.</p>
<pre><code>101110000
1001
----... | 44,876 |
<p>I want that list, because if something horrible happens, and I'll have to reinstall Visual Studio - I'll need this list, so that I can recreate the same development environment. This also makes it hard to search for updates - I can not see the versions of currently installed plug-ins.</p>
<p>So, is there a single p... | <p>The reason that exceptions on non-test threads (i.e. other spawned threads) do not cause tests to fail is that NUnit is configured by default to use <a href="http://msdn.microsoft.com/en-us/library/ms228965.aspx" rel="nofollow noreferrer">legacyUnhandledExceptionPolicy</a> which is a .Net process level setting which... | <p>I solved the problem by creating an addin for nunit, which "installs" an ITestDecorator.</p>
| 45,937 |
<p>I want to call a function from a .NET DLL (coded in C#) from an Inno Setup script.</p>
<p>I have:</p>
<ol>
<li>marked the <em>Register for COM interop</em> option in the project properties,</li>
<li>changed the <em>ComVisible</em> setting in the <em>AssemblyInfo.cs</em> file,</li>
<li>added these lines to the ISS ... | <p>Oops, my bad, it's been too long since I've read pascal! So, if you need to get the value then there are a couple of possibilities:</p>
<ol>
<li>Write the functionality in C/C++ and export the function, that's definitely supported.</li>
<li>Use a Managed C++ dll to shim to your .NET dll, and expose the call as a C ... | <p>A .NET dll can be best called from any other programming language by exposing it as a COM object. Take a look at this example: <a href="http://support.microsoft.com/kb/828736" rel="nofollow noreferrer">http://support.microsoft.com/kb/828736</a>. This shows how to call a ".NET dll" from "unmanaged C++". You can repla... | 6,741 |
<p>Let's say I have some code like this </p>
<pre><code>if(isset($_GET['foo']))
//do something
if(isset($_GET['bar']))
//do something else
</code></pre>
<p>If a user is at example.com/?foo=abc and clicks on a link to set bar=xyz, I want to easily take them to example.com/?foo=abc&bar=xyz, rather than example... | <p>Here's one way....</p>
<pre><code>//get passed params
//(you might do some sanitizing at this point)
$params=$_GET;
//morph the params with new values
$params['bar']='xyz';
//build new query string
$query='';
$sep='?';
foreach($params as $name=>$value)
{
$query.=$sep.$name.'='.urlencode($value);
$sep='... | <p>Just set the link that changes bar to xyz to also have foo=abc if foo is already set.</p>
<pre><code>$link = ($_GET['foo'] == 'abc') ? 'foo=abc&bar=xyz' : 'bar=xyz';
?>
<a href="whatever.php?<?= $link ?>">Click Me</a>
</code></pre>
| 47,154 |
<p>I have an Access DB that I would like to extract the source code from so I can put it into Source control. </p>
<p>I have tried to extract the data using the Primary Interop Assemblies(PIA), but I am getting issues as it is not picking up all of the modules and forms. </p>
<p>There are 140 Forms and Modules in the... | <p>There is a better way. You can use Visual Sourcesafe (and possibly other SCCs) to version control code and objects in place: see this <a href="http://msdn.microsoft.com/en-us/library/ms181088(VS.80).aspx" rel="nofollow noreferrer">MSDN article</a></p>
| <p>You might also want to take a look at his Q&A:</p>
<p><a href="https://stackoverflow.com/questions/247292/working-with-multiple-programmers-on-ms-access">Working with multiple programmers on MS Access</a></p>
| 24,075 |
<p>I need to figure out what div is visible out of four possible divs using jQuery. Only one of those div's will be visible at any given time.</p>
<p>This is what I have that works so far:</p>
<pre><code>$("#FeatureImage1:visible, #FeatureImage2:visible, #FeatureImage3:visible, #FeatureImage4:visible").attr("id");
<... | <p>Assign the same class to each div then:</p>
<pre><code>$("div.myClass:visible").attr("id");
</code></pre>
| <p>When applicable, it's better to use contextual selectors rather than add spurious classes. For instance, if the <code><div></code> elements are the only children of an element with <code>id="foo"</code>, then using <code>$("#foo > div:visible").attr("id")</code> would better reflect the purpose of the code... | 8,673 |
<p>I've inherited a BizTalk 2006 application that uses several SOAP ports to request data from a 3rd party web service. The web service is secured by "basic" authentication - username / password. After making a few enhancements to the application I deployed to an integration test server which has access to the 3rd part... | <p>I've been bit by something like this in the past. The password is either put in as '****'. This is ok. I wouldn't want all of my secrets exported with the binding file. What does get you is when you export the bindings and you leave the password NULL. The Variable Type (vt) attribute on the XML element for the ... | <p>I've never seen this problem before - I'm doing exactly what you are trying to do and it works perfectly.</p>
<p>I've included the <TransportTypeData> element from one of my BizTalk bindings that works. Hopefully having something to compare against helps.</p>
<pre><code><TransportTypeData>
&lt;Cust... | 42,219 |
<p>I've already written a generator that does the trick, but I'd like to know the best possible way to implement the off-side rule.</p>
<p>Shortly: <a href="http://en.wikipedia.org/wiki/Off-side_rule" rel="noreferrer">Off-side rule</a> means in this context that indentation is getting recognized as a syntactic element... | <p>I've written tokenizers and parsers for a couple of little indentation-centric domain-specific languages in the past couple of years, and what you have there looks pretty reasonable to me, for whatever that's worth. If I'm not mistaken, your method is quite similar to what Python does, for example, which seems like... | <p>Tokenizer in ruby for fun:</p>
<pre><code>def tokenize(input)
result, prev_indent, curr_indent, line = [""], 0, 0, ""
line_started = false
input.each_char do |char|
case char
when ' '
if line_started
# Content already started, add it.
line << char
else
# No ... | 28,795 |
<p>I'm trying to fix a non-responsive USB device that's masquerading as a virtual COM port. Manual replugging works, but there may be up to 12 of these units. Is there an API command to do the programmatic equivalent of the unplug/replug cycle?</p>
| <p>What about using Devcon.exe to "remove" and then "rescan"?</p>
<p>DR</p>
| <p>Programmatically <a href="https://stackoverflow.com/questions/85649/safe-remove-usb-drive-using-win32-api">unmounting a USB drive</a> can be done, however, I don't know if remounting can be done via code.</p>
| 16,756 |
<p>Is there a command within the bash shell of fedora that will give me the currently assigned IP address?</p>
| <p><a href="http://linux.die.net/man/8/ifconfig" rel="nofollow noreferrer">ifconfig</a> is what you're looking for</p>
| <p>Try the following command:</p>
<pre><code>ipconfig getifaddr eth0
</code></pre>
| 21,882 |
<p>I am wanting to access a website from a different port than 80 or 8080. Is this possible? I just want to view the website but through a different port. I do not have a router. I know this can be done because I have a browser that accessing websites through different ports, Called XB Browser by Xero Bank.</p>
<hr>
... | <p>If your question is about IIS(or other server) configuration - yes, it's possible. All you need is to create ports mapping under your Default Site or Virtual Directory and assign specific ports to the site you need. For example it is sometimes very useful for web services, when default port is assigned to some UI fr... | <p>when viewing a website it gets assigned a random port, it will always come from port 80 (usually always, unless the server admin has changed the port) there's no way for someone to change that port unless you have control of the server.</p>
| 10,473 |
<p>Suppose I want to count the lines of code in a project. If all of the files are in the same directory I can execute:</p>
<pre><code>cat * | wc -l
</code></pre>
<p>However, if there are sub-directories, this doesn't work. For this to work cat would have to have a recursive mode. I suspect this might be a job for xa... | <p>First you do not need to use <code>cat</code> to count lines. This is an <a href="http://en.wikipedia.org/wiki/Cat_(Unix)#Useless_use_of_cat" rel="noreferrer">antipattern called Useless Use of Cat</a> (UUoC). To count lines in files in the current directory, use <a href="https://en.wikipedia.org/wiki/Wc_(Unix)" rel=... | <p>Here's a Bash script that counts the lines of code in a project. It traverses a source tree recursively, and it excludes blank lines and single line comments that use "//".</p>
<pre><code># $excluded is a regex for paths to exclude from line counting
excluded="spec\|node_modules\|README\|lib\|docs\|csv\|XLS\|json\|... | 40,880 |
<p>What property in Netbeans to I need to change to set the name of my java swing app in the OS X menubar and dock? I found info.plist, but changing @PROJECTNAMEASIDENTIFIEER@ in multiple keys here had no effect.</p>
<p>Thanks,
hating netbeans.</p>
| <p>The answer depends on how you run your application. If you run it from the command line, use '-Xdock:name=appname' in the JVM arguments. See the section "More tinkering with the menu bar" in the article linked to by Dan Dyer.</p>
<p>If you are making a bundled, double-clickable application, however, you just need t... | <p>This is not NetBeans-specific, but <a href="http://java.sun.com/developer/technicalArticles/JavaLP/JavaToMac/" rel="nofollow noreferrer">this article</a> has some useful tips about tweaking your Swing apps so that they fit in on OS X.</p>
| 15,778 |
<p>I have a DTS package with a data transformation task (data pump). I’d like to source the data with the results of a stored procedure that takes parameters, but DTS won’t preview the result set and can’t define the columns in the data transformation task.</p>
<p>Has anyone gotten this to work?</p>
<p>Caveat: The ... | <p>Enter some valid values for the stored procedure parameters so it runs and returns some data (or even no data, you just need the columns). Then you should be able to do the mapping/etc.. Then do a disconnected edit and change to the actual parameter values (I assume you are getting them from a global variable).</p... | <p>You would need to actually load them into a table, then you can use a SQL task to move it from that table into the perm location if you must make a translation.</p>
<p>however, I have found that if working with a stored procedure to source the data, it is almost just as fast and easy to move it to its destination a... | 11,320 |
<p>I can't seem to find Developer Express' version of the <code>LinkButton</code>. (The Windows Forms linkbutton, not the <code>ASP.NET</code> linkbutton.) <code>HyperLinkEdit</code> doesn't seem to be what I'm looking for since it looks like a TextEdit/TextBox.</p>
<p>Anyone know what their version of it is? I'm u... | <p>The control is called the HyperLinkEdit. You have to adjust the properties to get it to behave like the System.Windows.Forms control like so:</p>
<pre><code> control.BorderStyle = BorderStyles.NoBorder;
control.Properties.Appearance.BackColor = Color.Transparent;
control.Properties.AppearanceFocused.Bac... | <p>You should probably just use the standard ASP.Net LinkButton, unless it's really missing something you need.</p>
| 2,571 |
<p>I have a project that has the following line in the additional includes section:</p>
<p>"$(SOMEPATH_SHORTNAME)\include"</p>
<p>Can someone tell me where I can find $(SOMEPATH) defined? I can't find it by simply searching in Visual Studio</p>
| <p>If it's not an environment variable, the place to look is the macros. In the property sheets, click the (...) button beside the "Addition Include Directories" line, and expand the "Macros>>" button in the dialog that pops up. </p>
| <ul>
<li>Right-click My Computer, and then click Properties.</li>
<li>Click the Advanced tab.</li>
<li>Click Environment variables.</li>
<li>Click one the following options, for either a user or a system variable:</li>
<li>Click New to add a new variable name and value.</li>
<li>Click an existing variable, and then cli... | 35,621 |
<p><strong>Problem Statement:</strong>
I would like to create an offline database to lookup prices/info on the n most useful books to sell in the United States (where n is probably 3 million or so). </p>
<p><strong>Question:</strong>
So, my question is (and I am open to other approaches here as well), I am trying to f... | <p>Amazon has a data feed service you can use which contains GZipped xml files of all their products based on top level categories. It's updated once a day and totals about 20GB/110GB of compressed/uncompressed data. Since you only need books it's more in the area of 4GB/31GB. The only thing is I'm not sure who's able ... | <p>I was wondering which one of Amazon AWS services you want to use? Or you don't know?</p>
<p>And why you need offline database? Why not make requests on everything you need and make some temporary cache?</p>
| 39,951 |
<p>I am using Team Foundation Server (TFS) for Visual Studio 2005.</p>
<p>Whenever i wish to compare two file's versions TFS displays a window with the differences.</p>
<p><strong>The problem is that it is always split vertically.</strong></p>
<p>In fact, almost every time, <strong>i would prefer to have it split ho... | <p>I've found the built in differencing tool in TFS woefully lacking so I set up WinMerge (<a href="http://www.winmerge.org/" rel="noreferrer">http://www.winmerge.org/</a>) in my environment in Tools -> Options -> Source COntrol -> Visual Studio Team Foundation.</p>
<p>A nice blog post exists below:</p>
<p><a href="h... | <p>I have Visual Studio 2012 and I get to choose between side - by - side options and inline mode. With inline mode, the before and after appear one below the other so that I have the full window for editing.</p>
<p><a href="https://stackoverflow.com/questions/18316799/visual-studio-2012-code-review-difference-window"... | 22,806 |
<p>I am in a process of designing a custom SharePoint application. On a previous project, all the data was kept in SharePoint lists and that's the way I've been trying now. But, I'm getting to the point where the data model grows and I feel a need to normalize it and split one logical entity into several physical lists... | <p>It depends on your requirements, but from my experience here are the cases when you should use database instead of lists:</p>
<p>1) When you have a many-to-many relationship in your database model</p>
<p>2) When you have two or more entities linked together (e.g. Customer > Invoice > Invoice Product). </p>
<p>Sha... | <p>In addition to Maxim's answer, I would also advise that you take searching into consideration. OTB Search is really nice if this data is going to be something you will need to dig into.</p>
| 31,246 |
<p>I have a Server 2003 box with about 6 sites that each have about 15-20 host headers.</p>
<p>Is there a tool out there that will copy all the host header records and automatically move them to the new server so I don't have to manually enter each host header again in the new server?</p>
<p>Thanks.</p>
| <p>If you save the configuration via the IIS Manager (right-click All Tasks -> Save Configuration to a file) this will export all the host header information along with everything else about the website. Then on the new server you can import this configuration to recreate the website.</p>
| <p>You can try the Web Deployment Tool, which can sync settings between IIS servers:
<a href="http://www.iis.net/downloads/default.aspx?tabid=34&g=6&i=1602" rel="nofollow noreferrer">http://www.iis.net/downloads/default.aspx?tabid=34&g=6&i=1602</a></p>
<p>You should also be able to export the settings ... | 29,741 |
<p>I've been experiencing the good and the bad sides of messaging systems in <strong>real production environments</strong>, and I must admit that a well organized table or schema of tables simply beats every time any other form of messaging queue, because:</p>
<ol>
<li>Data are permanently stored on a table. I've seen... | <p>The phrase <em>beats every time</em> totally depends on what your requirements were to begin with. Certainly its not going to beat every time for everyone.</p>
<p>If you are building a single system which is already using a database, you don't have very high performance throughput requirements and you don't have to... | <p>Queues provide reliable messaging. The store-and-forward, disconnected nature of queueing make it much more scalable than databases, not to mention more robust.</p>
<p>And queues shouldn't really be used for permanent storage of information - it is best to think of them as temporary inboxes, unlike databases.</p>
| 31,916 |
<p>I'm looking at the code for a phase accumulator, and I must be a simpleton because I don't get it.
The code is simple enough:</p>
<pre>
Every Clock Tick do:
accum = accum + NCO_param;
return accum;
</pre>
<p>accum is a 32-bit register. Obviously, at some point it will roll-over.</p>
<p>My question real... | <p><a href="http://en.wikipedia.org/wiki/Direct_digital_synthesis" rel="nofollow noreferrer">This article</a> may help. </p>
<p>In the running step, the counter (properly called the phase accumulator) is instructed to advance by a certain increment on each pulse from the frequency reference. The output of the phase ac... | <p>The formula is this: </p>
<p>Example using oscillors that have a period of waveform(x) period = x(0-1) rather than x(0-2Pi)</p>
<p>One variable per audio stream called acc/accumulator,</p>
<p>Every sample, accumulate it by accadd:</p>
<pre><code> var accadd = 1.0/( sampleRate / p2freq( note ) ) ;
acc+= ac... | 26,195 |
<p>I only just recently discovered that Visual C++ 2008 (and perhaps earlier versions as well?) supports <code>for each</code> syntax on stl lists et al to facilitate iteration.
For example:</p>
<pre><code>list<Object> myList;
for each (Object o in myList)
{
o.foo();
}
</code></pre>
<p>I was very happy to di... | <p>For each is not standard C or C++ syntax. If you want to be able to compile this code in gcc or g++, you will need to create an iterator and use a standard for loop.</p>
<p>QuantumPete</p>
<p>[edit]
This seems to be a new feature introduced into MS Visual C++, so this is definitely not portable. Ref: <a href="http... | <p>My vote goes for Luc, </p>
<p>Stick to the standard STL algorithms and you will be better off by far. STL algorithms can make your life very easy, efficient and safe. Take a look at the off the shelve algorithms like find_if, count, count_if, sort, transform, etc... </p>
<p>Point 5 onwards...
<a href="http://www... | 24,014 |
<p>What do you use as a test client for your stateful web services? Is it possible to use SoapUI? Are there best practices in this area?</p>
| <p>You can do what's called a "Property Transfer" in SoapUI. For example, all our web services have to first call an authentication web service and obtain an authentication token.</p>
<p>I've set this up in SoapUI so that the returned auth token from the auth service is passed on to subsequent requests. It seems to wo... | <p>I don't know whether it's practical to do this with SoapUI, but I've done things like this with both iTKO LISA and Parasoft SOATest. It wasn't for testing stateful web services, but simply executing multiple testing steps, storing results that are used in following steps. Both LISA and SOATest have the ability to ... | 36,989 |
<p>VC++ makes functions which are implemented within the class declaration inline functions.</p>
<p>If I declare a class <code>Foo</code> as follows, then are the CONSTRUCTOR and DESTRUCTOR inline functions?</p>
<pre><code>class Foo
{
int* p;
public:
Foo() { p = new char[0x00100000]; }
~Foo() { delete []... | <p>Defining the body of the constructor INSIDE the class has the same effect as placing the function OUTSIDE the class with the "inline" keyword.</p>
<p>In both cases it's a hint to the compiler. An "inline" function doesn't necessarily mean the function will be inlined. That depends on the complexi... | <p>To the same extent that we can make any other function inline, yes.</p>
| 4,154 |
<p><a href="http://resharper.blogspot.com/2008/03/varification-using-implicitly-typed.html" rel="noreferrer">Resharper</a> certainly thinks so, and out of the box it will nag you to convert</p>
<pre><code>Dooberry dooberry = new Dooberry();
</code></pre>
<p>to</p>
<pre><code>var dooberry = new Dooberry();
</code></p... | <p>It's of course a matter of style, but I agree with Dare: <a href="http://www.25hoursaday.com/weblog/2008/05/21/C30ImplicitTypeDeclarationsToVarOrNotToVar.aspx" rel="noreferrer">C# 3.0 Implicit Type Declarations: To var or not to var?</a>. I think using var instead of an explicit type makes your code less readable.In... | <p>"Best style" is subjective and varies depending on context.</p>
<p>Sometimes it is way easier to use 'var' instead of typing out some hugely long class name, or if you're unsure of the return type of a given function. I find I use 'var' more when mucking about with Linq, or in for loop declarations.</p>
<p>Other t... | 3,774 |
<p>When would you use a bigtabe/simpledb database vs a Relational database?</p>
| <p>Relational databases give you a lot more layout and query flexibility, and are easier to use, but you also end up with more pain if you later need to partition your data if it won't fit on a single database server/cluster. BigTable and similar things scale essentially infinitely, but do so by not offering a bunch o... | <p>Size, redundancy and performance are all key words that pop up in my head.</p>
<p>It's fairly easy to create a little database that does its job but when you need to do significant scaling and redundancy, while keeping it performing at the speed of light, it's cheaper for lots of people to ship the job off to Amazo... | 17,371 |
<p>How can I access the apache basic-auth username in a PHP script?</p>
| <p>Simply access this variable:</p>
<pre><code>$_SERVER['PHP_AUTH_USER']
</code></pre>
| <p>At my clients hoster <code>$_SERVER['PHP_AUTH_USER']</code> and <code>$_SERVER["HTTP_AUTHORIZATION"]</code> were empty but <code>$_SERVER["REMOTE_USER"]</code> was set!</p>
<pre class="lang-php prettyprint-override"><code>if ($_SERVER["REMOTE_USER"] == "admin")
echo "... | 40,915 |
<p>Can anyone recommend a library for chart generation (bar charts, pie charts etc.) which runs on both Java and .Net?</p>
| <p><a href="http://www.advsofteng.com/" rel="noreferrer">ChartDirector</a> is fantastic and supports more than just Java and .NET.</p>
| <p>Flash Charts.<br>
<a href="http://www.fusioncharts.com/free/Gallery.asp" rel="nofollow noreferrer">http://www.fusioncharts.com/free/Gallery.asp</a></p>
| 4,677 |
<p>I want to make a copy of an ActiveRecord object, changing a single field in the process (in addition to the <strong>id</strong>). What is the simplest way to accomplish this?</p>
<p>I realize I could create a new record, and then iterate over each of the fields copying the data field-by-field - but I figured there ... | <p>To get a copy, use the <a href="https://api.rubyonrails.org/classes/ActiveRecord/Core.html#method-i-dup" rel="noreferrer">dup</a> (or clone for < rails 3.1+) method:</p>
<pre><code>#rails >= 3.1
new_record = old_record.dup
# rails < 3.1
new_record = old_record.clone
</code></pre>
<p>Then you can change whi... | <p>You can also check the <a href="https://github.com/esbanarango/acts_as_inheritable" rel="nofollow">acts_as_inheritable</a> gem.</p>
<p>"Acts As Inheritable is a Ruby Gem specifically written for Rails/ActiveRecord models. It is meant to be used with the <a href="https://github.com/esbanarango/acts_as_inheritable#se... | 8,482 |
<p>Is <em>CompileAssemblyFromDom</em> faster than <em>CompileAssemblyFromSource</em>?</p>
<p>It <em>should</em> be as it presumably bypasses the compiler front-end.</p>
| <p>CompileAssemblyFromDom compiles to a .cs file which is then run through the normal C# compiler.</p>
<p>Example:</p>
<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.CSharp;
using System.CodeDom;
using System.IO;
using System.CodeDom.Compiler;
using Syst... | <p>I've tried finding the ultimate compiler call earlier and I gave up. There's quite a number of layers of interfaces and virtual classes for my patience.</p>
<p>I don't think the source reader part of the compiler ends up with a DOM tree, but intuitively I would agree with you. The work necessary to transform the DO... | 2,659 |
<p>I'll admit that I don't know the inner workings of the unix operating system, so I was hoping someone could shed some light on this topic.</p>
<p>Why is the Unix file system better than the windows file system?</p>
<p>Would grep work just as well on Windows, or is there something fundamentally different that makes... | <p>One of the fundamental differences in filesystem semantics between Unix and Windows is the idea of inodes.</p>
<p>On Windows, a file name is directly attached to the file data. This means that the OS prevents somebody from deleting a file that is currently open. On some versions of Windows you can rename a file tha... | <p>The answer turns out to have very little to do with the filesystem and everything to do with the filesystem access drivers.</p>
<p>In particular, the implementation of NTFS on Windows is very slow compared to ext2/ext3. Also on Windows, "can't delete file in use" even though NTFS should be able to support it.</p>
| 5,614 |
<p>Can I convert a bitmap to PNG in memory (i.e. without writing to a file) using only the Platform SDK? (i.e. no libpng, etc.).</p>
<p>I also want to be able to define a transparent color (not alpha channel) for this image.</p>
<p><strong>The GdiPlus solution seems to be limited to images of width divisible by 4</st... | <p>I read and write PNGs using <a href="http://www.libpng.org/pub/png/libpng.html" rel="noreferrer">libpng</a> and it seems to deal with everthing I throw at it (I've used it in unit-tests with things like 257x255 images and they cause no trouble). I believe the <a href="http://www.libpng.org/pub/png/libpng-1.2.5-manu... | <p>It would probably be better to use a library instead of reinventing the wheel yourself.</p>
<p>Look into <a href="http://freeimage.sourceforge.net/" rel="nofollow noreferrer">freeImage</a></p>
| 47,868 |
<p>I recently encountered an odd problem with <a href="http://msdn.microsoft.com/en-us/library/system.security.cryptography.rsacryptoserviceprovider.verifyhash.aspx" rel="noreferrer"><code>RSACryptoServiceProvider.VerifyHash</code></a>. </p>
<p>I have a web application using it for decryption. When users running the w... | <p>From this KB it looks like a 'wrinkle' in the code that needs sorting:</p>
<p><a href="http://support.microsoft.com/kb/948080" rel="noreferrer">http://support.microsoft.com/kb/948080</a></p>
| <p>Thanks (+1 & ans)</p>
<p>Tested and works.</p>
<p>From the KB article:</p>
<blockquote>
<p>The SignData or VerifyData methods
always perform an OID lookup query
which is sent to the domain
controller, even when the application
is running in a local user account.
This may cause slowness while sign... | 21,017 |
<p>With the age of text messages and things like that, what's a good way to store phone numbers in a database?</p>
<p>In the USA, text messages are handled by phone numbers but in other countries I hear they use email addresses so I guess there needs to be a way to differentiate between countries that use cell phone n... | <p>I would primarily use a text field, or a series of text fields, even if you are using a numerical phone number for the following reasons. </p>
<ol>
<li>Phone numbers have a great range of values, including extension numbers which may result in numerical columns losing precision.</li>
<li>Losing precision in a phone... | <p>I don't know if you have read these two questions, but they might help you a little.</p>
<ul>
<li><a href="https://stackoverflow.com/questions/290597/phone-number-columns-in-a-database">Phone Number Columns in a Database</a></li>
<li><a href="https://stackoverflow.com/questions/41925/is-there-a-standard-for-storing... | 40,616 |
<p>Trying to use a guid as a resource id in a rest url but cant find any resource on how to.
My best right now (not working though) is:
<a href="http://localhost:49157/PhotogalleryDS.svc/gallery" rel="nofollow noreferrer">http://localhost:49157/PhotogalleryDS.svc/gallery</a>('1d03beb3-6d63-498b-aad7-fab0b1480996')
(I'v... | <p>I figured it out!</p>
<p><a href="http://localhost:49157/PhotogalleryDS.svc/photo(guid" rel="nofollow noreferrer">http://localhost:49157/PhotogalleryDS.svc/photo(guid</a>'01231cc7-1e26-4f33-9fdf-fdf7015267dd')</p>
<p>This is the way</p>
| <p>My best guess based on what you've written is that you're wrapping that URL in double quotes. The position 0 in that error message probably refers to the character directly before http</p>
| 4,648 |
<p>I'm generating a menu with a Repeater control bound to an XmlDataSource. </p>
<pre><code><asp:Repeater ID="myRepeater" runat="server"
DataSourceID="myDataSource"
onitemdatabound="myRepeater_ItemDataBound"
onitemcreated="myRepeater_ItemCreated">
<HeaderTemplate>
<ul class="... | <p>The style property is a collection. Do this:</p>
<pre><code>l_genericControl.Style.Add("css-name", "css-value")
</code></pre>
<p>Or if you are using CSS classes, then change the CssClass property:</p>
<pre><code>l_genericControl.CssClass = "on-nav";
</code></pre>
<p>If you're trying to toggle the CSS class with ... | <p>at the basic level, you could do:</p>
<pre><code>l_genericControl.Attributes["class"] = "on-nav";
</code></pre>
| 43,991 |
<p>Does anyone know how to get IntelliSense to work reliably when working in C/C++ projects? It seems to work for about 1 in 10 files. Visual Studio 2005 seems to be a lot better than 2008.</p>
<p>Edit: Whilst not necessarily a solution, the work-around provided here: </p>
<p><a href="https://stackoverflow.com/questi... | <p>I've also realized than Intellisense is sometime 'lost', on some big project. Why? No idea.</p>
<p>This is why we have bought <a href="http://www.wholetomato.com/" rel="noreferrer">Visual Assist</a> (from <a href="http://www.wholetomato.com/" rel="noreferrer">Tomato software</a>) and disabled Intellisense by deleti... | <p>About this problem i've notice something interesting (on Visual Studio 2010):
to solve this problem i've changed <code>#include</code> sintax in my header files, before was (old project done with VS 2005 and reopened using VS 2010):</p>
<pre><code>#include <myfile.h>
</code></pre>
<p>and i fix this with:</p... | 6,054 |
<p>I've been doing c# for a long time, and have never come across an easy way to just new up a hash.</p>
<p>I've recently become acquainted with the ruby syntax of hashes and wonder, does anyone know of a simple way to declare a hash as a literal, without doing all the add calls.</p>
<pre><code>{ "whatever" => {i ... | <p>If you're using C# 3.0 (.NET 3.5) then you can use collection initializers. They're not quite as terse as in Ruby but still an improvement.</p>
<p>This example is based on the <a href="http://msdn.microsoft.com/en-us/library/bb531208.aspx" rel="noreferrer">MSDN Example</a></p>
<pre><code>var students = new Diction... | <pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Dictionary
{
class Program
{
static void Main(string[] args)
{
Program p = new Program();
Dictionary<object, object > d = p.Dic<object, obj... | 7,568 |
<p>Notice how the default domain for stackoverflow is <a href="http://stackoverflow.com">http://stackoverflow.com</a> and if you try to goto <a href="http://www.stackoverflow.com">http://www.stackoverflow.com</a> it bounces you to <a href="http://stackoverflow.com">http://stackoverflow.com</a> ?</p>
<p>What is the reas... | <p>Jeff Atwood has written a great article about the <a href="https://blog.codinghorror.com/the-great-dub-dub-dub-debate/" rel="nofollow noreferrer">The Great Dub-Dub-Dub Debate</a>. There is also a blog entry in the Stackoverflow blog on why and how Stackoverflow has <a href="https://stackoverflow.blog/2008/06/14/drop... | <p>actually you can use both of them. So it's better to find user your address or some. I mean actually it doesn't really matter tho :)</p>
<p>But putting www as a prefix is more common in public so I guess I'd prefer to use www behind it.</p>
| 46,297 |
<p>I'm using Windows XP Service Pack 3 and have Command Extensions enabled by default in the Windows Registry.
Somehow, the following command does not work on this version of Windows but if I run it in Windows Server 2003 or Windows Vista Business, it works just fine. Any clue?</p>
<p>The problem is that on Windows XP... | <p>That's because <code>tasklist.exe</code> outputs to <code>STDERR</code> when no task is found. The <code>for /f</code> loop gets to see <code>STDOUT</code> only, so in case <code>python.exe</code> is not running, it has nothing to loop on.</p>
<p>Redirecting <code>STDERR</code> into <code>STDOUT</code> (<code>2>... | <p>This will work and not display the</p>
<blockquote>
<p>INFO: No tasks running with the
specified criteria</p>
</blockquote>
<p>message:</p>
<pre><code>@echo off
set found=0
for /f "tokens=1 delims=: " %%A in ('tasklist /NH') do (
If /i "%%A" equ "python.exe" (
set found=1
)
)
if %found%==1 ... | 46,850 |
<p>Suppose that you have two huge files (several GB) that you want to concatenate together, but that you have very little spare disk space (let's say a couple hundred MB). That is, given <code>file1</code> and <code>file2</code>, you want to end up with a single file which is the result of concatenating <code>file1</c... | <p>I think the difficulty is determining how the space can be recovered from the original files.</p>
<p>I think the following might work:</p>
<ol>
<li>Allocate a sparse file of the
combined size.</li>
<li>Copy 100Mb from the end of the second file to the end of the new file.</li>
<li>Truncate 100Mb of the end of the ... | <p>"fiemap"</p>
<p><a href="http://www.mjmwired.net/kernel/Documentation/filesystems/fiemap.txt" rel="nofollow noreferrer">http://www.mjmwired.net/kernel/Documentation/filesystems/fiemap.txt</a></p>
| 37,068 |
<p>I have a UL that looks like this:</p>
<pre><code><ul class="popular-pages">
<li><a href="region/us/california/">California</a></li>
<li><a href="region/us/michigan/">Michigan</a></li>
<li><a href="region/us/missouri/">Missouri</a>&l... | <p>The reason for your layout is probably because you have the float on the anchor, move it to the list-item instead.</p>
<pre>
ul.popular-pages li {
float: left;
}
</pre>
<p>Since you're not setting any width in your LI's, I suggest skipping the float and set display: inline on your LI's instead, if you want them... | <p>What DOCTYPE are you using? DOCTYPE has an impact on how browsers render.</p>
| 35,591 |
<p>I need to know about Epoll On linux System.</p>
<p>Could you recommend manual or guides about epoll library?</p>
<p>need more detailed guides. it's better to have some examples.</p>
<p>help me. and Thank you for reading.</p>
| <p>Here's an introduction to Epoll, a pretty basic tutorial: <a href="https://kovyrin.net/2006/04/13/epoll-asynchronous-network-programming/" rel="nofollow noreferrer">http://blog.kovyrin.net/2006/04/13/epoll-asynchronous-network-programming/</a></p>
<p>A more complete example can be found here: <a href="https://web.a... | <pre><code>#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/epoll.h>
#define PORT 1500
#define MAX_CON (1200)
static struct ... | 4,689 |
<p>Unmanaged languages notwithstanding, is F# really better than C# for implementing math? And if that's the case, why?</p>
| <p>I think most of the important points were already mentioned by someone else:</p>
<ol>
<li>F# lets you solve problems in a way mathematicians think about them</li>
<li>Thanks to higher-order functions, you can use simpler concepts to solve difficult problems</li>
<li>Everything is immutable by default, which makes t... | <p>One of the great advantages of functional languages is the fact they they can run on multi-processor or multi-core systems, in parallel without requiring you to change any code.
That means you can speed up your algorithms by simply adding cores.</p>
| 49,755 |
<p>Say I have 2 tables: Customers and Orders. A Customer can have many Orders.</p>
<p>Now, I need to show any Customers with his latest Order. This means if a Customer has more than one Orders, show only the Order with the latest Entry Time.</p>
<p>This is how far I managed on my own:</p>
<pre><code>SELECT a.*, b.Id... | <p>I don't think you do want to use MAX() as you don't want to group the OrderID. What you need is an ordered sub query with a SELECT TOP 1.</p>
<pre><code>select *
from Customers
inner join Orders
on Customers.CustomerID = Orders.CustomerID
and OrderID = (
SELECT TOP 1 subOrders.Orde... | <p>Something like:</p>
<pre><code>SELECT
a.*
FROM
Customer a
INNER JOIN Order b
ON a.OrderID = b.Id
INNER JOIN (SELECT Id, max(EntryTime) as EntryTime FROM Order b GROUP BY Id) met
ON
b.EntryTime = met.EntryTime and b.Id = met.Id
</code></pre>
| 42,931 |
<p>I open a connection like this:</p>
<pre><code>Using conn as New OdbcConnection(connectionString)
conn.Open()
//do stuff
End Using
</code></pre>
<p>If connection pooling is enabled, the connection is not physically closed but released to the pool and will get reused. If it is disabled, it will be physically... | <p>MSDN as <a href="http://msdn.microsoft.com/en-us/library/ms810829.aspx" rel="nofollow noreferrer">in-depth guidelines on this</a></p>
<blockquote>
<p><strong>Configuring Connection Pooling from
the Data Source Administrator</strong></p>
<p>[snip]</p>
<p>Alternatively, you can start the ODBC
Data Source Administrator... | <p>To determine the number of open connections on each db, try this sql - I got it from a document on internet</p>
<pre><code>select db_name(dbid) , count(*) 'connections count'
from master..sysprocesses
where spid > 50 and spid @@spid
group by db_name(dbid)
order by count(*) desc
</code></pre>
<p>Spids... | 15,265 |
<p><em>It is a messy question, hopefully you can figure out what I want :)</em></p>
<p><strong>What is the best way to use Win32 functionality in a Qt Open Source Edition project?</strong></p>
<p>Currently I have included the necessary Windows SDK libraries and include directories to qmake project file by hand. It wo... | <p>You could build an interface layer to wrap the Win32 functionality and provide it in a DLL or static library. The DLL would minimize the need for linking directly to the Win32 libraries with your qmake project. It would be more in keeping with the portability of Qt to create generic interfaces like this and then hid... | <p>LPCWSTR should not be a problem; that's just a stupid name for <code>wchar_t const*</code>. LPARAM is not a problem either, you can store them in a long. Sure, those are just C++ types, not Qt. But Qt can still handle them.</p>
<p>VS integration, as I understand it is related to the Visual Studio IDE, not the (V)C+... | 48,011 |
<p>I have checked with the <a href="http://en.wikipedia.org/wiki/Facade_pattern" rel="noreferrer">wikipedia article</a>, and it seems like it is missing the c++ version of a code example. I am not able to fully appreciate the Facade pattern without this, can you please help explain it to me using C++?</p>
| <p><strong>Facade pattern: provides a unified - simplified interface to a complex subsystem or set of interfaces. It provides a higher level interface simultaneously decoupling the client from the complex subsystem.</strong></p>
<p>An example to help you understand .. a cab driver. You tell the cab driver 'Take me to ... | <pre><code>class A {
private B b; // Class A uses Class B, the "interface"
public int f() { return b.g(); }
};
class B {
private C c; // class B uses class C, a "subsystem"
private ... ...; // other subsystems can be added
public int g() { c.h(); return c.i(); }
};
class C { // a subsystem
pub... | 31,034 |
<p>I have a column that has fields such as C5, C6, C3, CC, CA, CD, etc. </p>
<p>I want to be able to find all the columns that have a letter and then a number such as C5 and C6.</p>
<p>I know if I do:</p>
<pre><code>SELECT * FROM TABLE WHERE FIELD LIKE 'C%'
</code></pre>
<p>It will return CC,CA,CD as well, but I d... | <p>The query would be <code>SELECT * FROM TABLE WHERE FIELD LIKE 'C[0-9]%'</code> </p>
| <p>Use any of these</p>
<pre><code>select LEFT(col,1) from @t where col like 'c[0-9]%'
select substring(col,1,1) from @t where col like 'c[0-9]%'
</code></pre>
| 49,983 |
<p>A have the document with 23 figures and 46 tables (appendix to journal article). There are 23 sections created in the exactly same manner. When viewing compiled dvi everything is in order, but after creating ps file from the dvi one of the section title is missing. Producing pdf from dvi doesn't help. What may be th... | <p><a href="http://sectools.org/web-scanners.html" rel="noreferrer">Top 10 Web Vulnerability Scanners</a> from Insecure.org (listing from 2006). Their number one, Nikto2, can be found <a href="http://www.cirt.net/nikto2" rel="noreferrer">here</a>.</p>
| <p>I'm a little late to the party, but since you specifically asked for easy to use and not-too-technical scanners, take a look at <a href="https://www.golemtechnologies.com" rel="nofollow">Golem Technologies website security scanner</a> - the full scan isn't free, but they have a demo scan which checks about 10% of a ... | 44,102 |
<p>I have several tables whose only unique data is a uniqueidentifier (a Guid) column. Because guids are non-sequential (and they're client-side generated so I can't use newsequentialid()), I have made a non-primary, non-clustered index on this ID field rather than giving the tables a clustered primary key.</p>
<p>I'm... | <p>When dealing with indexes, you have to determine what your table is going to be used for. If you are primarily inserting 1000 rows a second and not doing any querying, then a clustered index is a hit to performance. If you are doing 1000 queries a second, then not having an index will lead to very bad performance.... | <p>I too have always heard having an auto-incrementing int is good for performance even if you don't actually use it.</p>
| 2,746 |
<p>When you use the WebBrowser control in .NET you can "embed" an instance of IE in your application, essentially making your own IE-based Web Browser.</p>
<p>Does anyone know how to make any new windows created (like when the user selects "Open in New Window" from the context menu) open up in another Window of Your W... | <p>Maybe the Source Code from this CodeProject article can help:</p>
<p><a href="http://www.codeproject.com/KB/cpp/ExtendedWebBrowser.aspx" rel="noreferrer">Extended .NET 2.0 WebBrowser Control</a></p>
| <p>There's a code sample here that contains code for adding the NewWindow2 event to the WebBrowser control. It sure would be nice if they added this event to the WebBrowser control itself.</p>
<p><a href="http://zerosandtheone.com/media/p/277.aspx" rel="nofollow noreferrer">http://zerosandtheone.com/media/p/277.aspx</... | 14,387 |
<p>I am using msbuild to build a C++ project and I want to suppress the 'Post-Build Event'. I have tried the following properties with no success:</p>
<pre><code>/property:PostBuildEvent=
/property:VCPostBuildEventTool=
</code></pre>
<p>Neither will make any difference and the post build events are still executed.</... | <p>I just figured out how to do this. There's 2 steps involved:</p>
<p>First, if you're not starting the msbuild process using a batch file already, create a batch file that calls the msbuild process. Then add a variable in the batch file before you call the msbuild process. Something like this:</p>
<pre><code>set... | <p>Have you tried setting the build event to something other than blank? If you overwrite it with something superfluous, like a "dir" or something, does it still execute the original post-build steps?</p>
<p>It's not the most elegant solution, but it might work.</p>
| 33,174 |
<p>In java, does <code>file.delete()</code> return <code>true</code> or <code>false</code> where <code>File file</code> refers to a non-existent file?</p>
<p>I realize this is kind of a basic question, and easy to very through test, but I'm getting strange results and would appreciate confirmation.</p>
| <p>Doesn't that result in a FileNotFoundException?</p>
<p>EDIT:</p>
<p>Indeed it does result in false:</p>
<pre><code>import java.io.File;
public class FileDoesNotExistTest {
public static void main( String[] args ) {
final boolean result = new File( "test" ).delete();
System.out.println( "result: |" + ... | <p>The official javadoc:</p>
<pre><code>Deletes the file or directory denoted by this abstract pathname. If this pathname denotes a directory, then the directory must be empty in order to be deleted.
Returns:
true if and only if the file or directory is successfully deleted; false otherwise
Throws:
SecurityE... | 39,651 |
<p>I am wondering what directory structure are commonly used in development projects. I mean with the idea of facilitating builds, deploys release, and etc.</p>
<p>I recently used a <a href="http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html" rel="nofollow noreferrer">Maven... | <p>After a couple years working with different structures I recently found a structure that hols most variations for me:</p>
<pre><code>/project_name (everything goes here)
/web (htdocs)
/img
/css
/app (usually some framework or sensitive code)
/lib (externa libs)
... | <p>I just found a interesting document about Directory structures on Zend website:<br>
<a href="http://framework.zend.com/wiki/display/ZFDEV/Choosing+Your+Application%27s+Directory+Layout" rel="nofollow noreferrer">http://framework.zend.com/wiki/display/ZFDEV/Choosing+Your+Application%27s+Directory+Layout</a></p>
| 8,609 |
<p>I am considering converting a project that I've inherited from .net 1.1 to .net 2.0. The main warning I'm concerned about is that it wants me to switch from <code>System.Web.Mail</code> to using <code>System.Net.Mail</code>.</p>
<p>I'm not ready to re-write all the components using the obsolete <code>System.Web.Ma... | <p>System.Web.Mail is not a full .NET native implementation of the SMTP protocol. Instead, it uses the pre-existing COM functionality in CDONTS. System.Net.Mail, in contrast, is a fully managed implementation of an SMTP client.</p>
<p>I've had far fewer problems with System.Net.Mail as it avoids COM hell.</p>
| <p>Yes, we had the same issue, and we decided not to upgrade either. We haven't seen any problems, so you're OK ignoring the warnings.</p>
| 9,017 |
<p>Has anyone used the <a href="http://www.cs.tufts.edu/~nr/noweb/" rel="noreferrer">noweb</a> literate programming tool on a large Java project, where several source code files must be generated in different subdirectories? How did you manage this with noweb? Are there any resources and/or best practices out there?</p... | <p>Noweb will dump out files relative to the current working directory, or at the absolute path you specify. Just don't use * at the end of your filename (to avoid inserting the # preprocessor directives). I would recommend using %def with @ to show where you define and use names.</p>
<pre><code><</path/to/file... | <p>Literate Programming works its best if the generated intermediate code can point back to the original source file to allow debugging, and analyzing compiler errors. This usually means pre processor support, which Java doesn't support.</p>
<p>Additionally Literate Programming is really not necessary for Java, as th... | 18,353 |
<p>I researched this a while ago and can't remember how to do it. I want to be able to prevent Firefox from running it's spell-checking functionality on certain input fields from within the page. I know it's possible but can't remember how to set it up.</p>
| <p>Talk about having a big "duh" moment! I found the answer after some trial & error:</p>
<pre><code><textarea spellcheck="false"></textarea>
</code></pre>
| <p>The downside of this is that the W3 strict validator gives - Attribute "spellcheck" is not a valid attribute. Bad news for those of us with OCD that love to see 0 errors in validating our sites.</p>
| 27,659 |
<p>Is there a (portable) way to rotate text in a HTML table cell by 90°?</p>
<p>(I have a table with many columns and much text for the headings, so I'd like to write it vertically to save space.)</p>
| <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-css lang-css prettyprint-override"><code>.box_rotate {
-moz-transform: rotate(7.5deg); /* FF3.5+ */
-o-transform: rotate(7.5deg); /* Opera 10.5 */
-w... | <pre class="lang-css prettyprint-override"><code>-moz-transform: rotate(7.5deg); /* FF3.5+ */
-o-transform: rotate(7.5deg); /* Opera 10.5 */
-webkit-transform: rotate(7.5deg); /* Saf3.1+, Chrome */
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); /* IE6,IE7 allows only 1, 2, 3 */
-ms-filter: "prog... | 34,352 |
<p>Consider the following code:</p>
<pre><code>Public Class Animal
Public Overridable Function Speak() As String
Return "Hello"
End Function
End Class
Public Class Dog
Inherits Animal
Public Overrides Function Speak() As String
Return "Ruff"
End Function
End Class
Dim dog As New Dog
Dim a... | <p>You don't; the subclass's method overrides the superclass's method, by definition of inheritance.</p>
<p>If you want the overridden method to be available, expose it in the subclass, e.g.</p>
<pre><code>Public Class Dog
Inherits Animal
Public Overrides Function Speak() As String
Return "Ruff"
... | <p>I don't think you can. </p>
<p>The thing is that the object is still a dog. the behavior you're describing (getting "ruff" from the casted object rather than "hello") is standard because you want to be able to use the animal class to let a bunch of different type of animals speak.</p>
<p>For example, if you had a ... | 30,375 |
<p>I've been reading about thread-safe singleton patterns here:</p>
<p><a href="http://en.wikipedia.org/wiki/Singleton_pattern#C.2B.2B_.28using_pthreads.29" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/Singleton_pattern#C.2B.2B_.28using_pthreads.29</a></p>
<p>And it says at the bottom that the only safe way... | <p>If you are are using Visual C++ 2005/2008 you can use the double checked locking pattern, since "<a href="http://en.wikipedia.org/wiki/Double-checked_locking#Usage_in_Microsoft_Visual_C.2B.2B" rel="noreferrer">volatile variables behave as fences</a>". This is the most efficient way to implement a lazy-initialized s... | <p>There are many ways to do thread safe Singleton* initialization on windows. In fact some of them are even cross-platform. In the SO thread that you linked to, they were looking for a Singleton that is lazily constructed in C, which is a bit more specific, and can be a bit trickier to do right, given the intricacies ... | 19,888 |
<p>I have multiple processes monitoring an MSMQ queue. I want to do multi-step operations like first peek the message and then based on some criteria receive the message. A single message may pass the receiving criteria of multiple processes so that more than one process may try to receive the same message. Will these ... | <p>The operations themselves are thread safe. However, if you perform a multi-step operation you may find that the results are not consistent (for example, peeking to see if data is in the queue, then calling to receive the data, only to discover it's not there any longer).</p>
| <p>You may be interested in a <a href="http://msmq.spaces.live.com/blog/cns!393534E869CE55B7!293.entry" rel="noreferrer">blog entry</a> I wrote on this subject.</p>
<p>In short, MSMQ C++ API is thread safe, but not all System.Messaging methods are thread safe. In the blog entry I discuss how to call MessageQueue.Send ... | 27,756 |
<p>What are the best places to find out everything there is to know about Domain-Driven Design, from beginner to advanced.</p>
<ul>
<li>Books </li>
<li>Websites </li>
<li>Mailing lists </li>
<li>User groups</li>
<li>Conferences</li>
<li>etc</li>
</ul>
| <p>Here are some interesting sources:</p>
<ul>
<li>the <a href="http://dddcommunity.org/books/index.html#DDD" rel="noreferrer">DDD</a> book by Eric Evans</li>
<li>the free <a href="http://dddcommunity.org/books/index.html#DDD_quickly" rel="noreferrer">DDD Quickly</a> book</li>
<li>the <a href="http://groups.yahoo.com/... | <p><a href="https://rads.stackoverflow.com/amzn/click/com/0321268202" rel="nofollow noreferrer" rel="nofollow noreferrer">Applying Domain-Driven Design and Patterns</a> is a very good book on the subject. Lots of good examples as well as discussion of related subjects like test driven development and how they apply.</p... | 15,067 |
<p>Say I have:</p>
<pre><code><ul>
<li id="x">
<a href="x">x</a>
</li>
<li id="y">
<a href="y">y</a>
<ul>
<li id="z">
<a href="z">z</a>
</li>
</ul>
... | <p>I would use XSLT. You can specify to search for nodes that are ancestors of z .</p>
| <p>I suggest you parse it into a DOM and recurse backwards like you were thinking. Regular expressions don't work very well for nested structures with arbitrary nesting levels.</p>
| 8,110 |
<p>Is an opensource/commercial tool/framework, available for automated web app testing in Google Chrome browser on Windows XP / Vista? ( An alpha/beta Tool is also OK)</p>
<p>Thanks</p>
| <p>Selenium supports Chrome pretty much out of the box because it works by injecting javascript in the web page. <a href="http://selenium-rc.openqa.org/" rel="nofollow noreferrer">http://selenium-rc.openqa.org/</a></p>
<p>Webdriver has an early version of Chrome driver. <a href="http://code.google.com/p/webdriver/" re... | <p>For those who are not developers you could try <a href="https://www.frontendtest.org" rel="nofollow noreferrer">FRET</a> for automated web testing with Chrome. It's still in beta and even though it states that no programming is needed a basic understanding of HTML / CSS etc. is recommended.</p>
| 11,355 |
<p>A colleague recently asked me how to deep-clone a Map and I realized that I probably have never used the clone() method- which worries me.</p>
<p>What are the most common scenarios you have found where you need to clone an object?</p>
| <p>I assume you are referring to <code>Object.clone()</code> in Java. If yes, be advised that <code>Object.clone()</code> has some major problems, and its use is discouraged in most cases. Please see Item 11, from <a href="http://java.sun.com/docs/books/effective/" rel="noreferrer">"Effective Java"</a> by Joshua Bloch ... | <p>I have used Object.clone() in a Spring webflow application to check what has changed when a user edits / enters data on a form for auditing purposes.</p>
<p>At the beginning of the flow, I call the clone method which was implemented on the form backing object used in the spring webflow and save the instance of the ... | 33,976 |
<p>I've been testing out <a href="http://www.automatedqa.com/products/aqtime/" rel="noreferrer">the performance and memory profiler AQTime</a> to see if it's worthwhile spending those big $$$ for it for my Delphi application. </p>
<p>What amazes me is how it can give you source line level performance tracing (which in... | <p>This is just speculation, but perhaps AQtime is based on a technology that is similar to <a href="http://research.microsoft.com/sn/detours/" rel="noreferrer">Microsoft Detours</a>? </p>
<blockquote>
<p>Detours is a library for instrumenting
arbitrary Win32 functions on x86, x64,
and IA64 machines. Detours int... | <p>I don't know about Delphi in particular, but a C application debugger can do line-by-line profiling relatively easily - it can load the code and associate every code path with a block of code. Then it can break on all the conditional jump instructions and just watch and see what code path is taken. Debuggers like gd... | 41,724 |
<p>I have been asked to develop some usercontrols in ASP.NET that will at a later point be pulled into a SharePoint site as web parts. I am new to SharePoint and will not have access to a SharePoint server during the time I need to prototype these parts.</p>
<p>Does anyone know of any reasons that this approach will n... | <p>If it's a very short-term thing, Microsoft has a time-limited WSS evaluation VPC image:</p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?familyid=1beeac6f-2ea1-4769-9948-74a74bd604fa&displaylang=en&tm" rel="nofollow noreferrer">WSS3 SP1 Developer Evaluation VPC image</a></p>
<p>That will get... | <p>you need to have access to a sharepoint server because you can't simulate your webpart without it, you have to deploy it to your sharepoint site to test if it's working. debugging would also be a pain. or you can use SmartPart, it's a webpart that acts like a wrapper for your user controls to display in a sharepoint... | 16,141 |
<p>I have almost the worst spec in the world. An application that exists and used to work. My aim is to recreate this app and make it work. </p>
<p>It's a <em>very</em> simple util that just displays the following information to screen:</p>
<ul>
<li>ARFCN - Absolute Radio Frequency Channel Number</li>
<li>LAC - Loca... | <p>OpenNETCF's NetworkInformation namespace is not going to help - it's a wrapper around NDIS and WZC, which is not of much use for telephony. What is probebly relevent here is the <a href="http://msdn.microsoft.com/en-us/library/aa450239.aspx" rel="nofollow noreferrer">Telephony API (TAPI)</a>, though I have doubts w... | <p>OpenNETCF's NetworkInformation namespace is not going to help - it's a wrapper around NDIS and WZC, which is not of much use for telephony. What is probebly relevent here is the <a href="http://msdn.microsoft.com/en-us/library/aa450239.aspx" rel="nofollow noreferrer">Telephony API (TAPI)</a>, though I have doubts w... | 34,392 |
<p>I have two threads, one needs to poll a bunch of separate static resources looking for updates. The other one needs to get the data and store it in the database. How can thread 1 tell thread 2 that there is something to process?</p>
| <p>If the pieces of data are independant then treat the pieces of data as work items to be processed by a pool of threads. Use the thread pool and <code>QueueUserWorkItem</code> to post the data to the thread(s). You should get better scalability using a pool of symmetric threads and limiting the amount of synchronisat... | <p>Does the "store in the DB" thread always need to be running? It seems like perhaps the best option (if possible) would be to have the polling thread spin up another thread to do the save. Depending on the number of threads being created though, it could be that having the first polling thread use ThreadPool.QueueUse... | 13,255 |
<p>e.g, Is the user playing a movie full screen, or looking at powerpoint in full screen mode?</p>
<p>I could have sworn I saw a IsFullScreenInteractive API before, but can't find it now</p>
| <p>Here's how I've solved this problem:</p>
<pre><code>using System;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace Test
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(IsForegroun... | <p>The preferred way of detecting the state of a window is by calling <a href="http://msdn.microsoft.com/en-us/library/ms633518(VS.85).aspx" rel="nofollow noreferrer">GetWindowPlacement</a>. If you do that in conjunction with GetForegroundWindow, you can easily check if the user sees a fullscreen window or not.</p>
| 24,782 |
<p>Similar to <a href="https://stackoverflow.com/questions/5415/convert-bytes-to-floating-point-numbers-in-python">this</a> question, I am trying to read in an ID3v2 tag header and am having trouble figuring out how to get individual bytes in python.</p>
<p>I first read all ten bytes into a string. I then want to par... | <p>If you have a string, with 2 bytes that you wish to interpret as a 16 bit integer, you can do so by:</p>
<pre><code>>>> s = '\0\x02'
>>> struct.unpack('>H', s)
(2,)
</code></pre>
<p>Note that the > is for big-endian (the largest part of the integer comes first). This is the format id3 tags us... | <p>I was going to recommend the <code>struct</code> package but then you said you had tried it. Try this:</p>
<pre><code>self.major_version = struct.unpack('H', self.whole_string[3:5])
</code></pre>
<p>The <code>pack()</code> function convers Python data types to bits, and the <code>unpack()</code> function converts ... | 18,144 |
<p>I know how to do a HEAD request with httplib, but I have to use mechanize for this site. </p>
<p>Essentially, what I need to do is grab a value from the header (filename) without actually downloading the file.</p>
<p>Any suggestions how I could accomplish this?</p>
| <p>Mechanize itself only sends GETs and POSTs, but you can easily extend the Request class to send HEAD. Example:</p>
<pre><code>import mechanize
class HeadRequest(mechanize.Request):
def get_method(self):
return "HEAD"
request = HeadRequest("http://www.example.com/")
response = mechanize.urlopen(request... | <p>In mechanize there is no need to do HeadRequest class etc.</p>
<p>Simply</p>
<pre><code>
import mechanize
br = mechanize.Browser()
r = br.open("http://www.example.com/")
print r.info()
</code></pre>
<p>That's all.</p>
| 16,639 |
<p>I need to, preferably in C# - but c++ will do, find a way to filter the list of printers in the windows print dialog for any windows printing.</p>
<p>I have come across WinAPIOverride and have figured I am going to have to write my own dll which overrides the method to get the printers list, then filter it and retu... | <p>I don't think that (re)writing a DLL is the easiest method. Why not use <a href="http://msdn.microsoft.com/en-us/library/aa393964(VS.85).aspx" rel="nofollow noreferrer">WMI</a> to retrieve the wanted <a href="http://msdn.microsoft.com/en-us/library/aa394363.aspx" rel="nofollow noreferrer">information (printers in th... | <p>Thanks for the interesting code.</p>
<p>The idea is to apply a filtered printer list to the system as globally as possible without interfering with the user. This means the filtered list has to apply to the standard windows print dialogs unfortunately...</p>
<p>So your WMI code, albeit kind of cool, would not be ... | 19,235 |
<p>I have a current system which is build as a Windows Application, and does certain tasks in very close to real time. There are nodes in a network that communicate with our custom server, communicating status, and sending and receiving commands.</p>
<p>We are looking to move to a web deployed platform. The nodes, s... | <p>If you're talking about a near-realtime application such as a messaging program and not actual realtime then it can be done. The technique is called 'long-polling' or <a href="http://en.wikipedia.org/wiki/Comet_(programming)" rel="nofollow noreferrer">comet</a> and has been used successfully by several major web sta... | <p>The AJAX part of this is fine. Products like Lightstreamer and other Comet (Http server push) servers can provide near real time communication.</p>
<p>The LAMP part of the equation is the one that worries me. You'll probably need a custom back end of sorts in order to achieve high performance. The LA parts are fine... | 47,149 |
<p>Is there a detailed guide which explains how to host a website on your own server on linux.
I have currently hosted it on one of the commerical web-hosts.
Also the domain is registered to a different vendor.</p>
<p>Thanks</p>
| <p><a href="http://gentoo-wiki.com/HOWTO_setup_a_home-server" rel="noreferrer">This guide</a> is probably more info than you really requested, but webserver information is in there. It's Gentoo-specific, but you can apply the same information with minor translations to any other distro.</p>
| <p>I think it depends on how familiar you are with linux. Certainly, many people do this for hobbyist websites.</p>
<p>There are many aspects involved - you should begin with something simple like getting apache running and visible to the outside world.</p>
| 10,817 |
<p>I have a web application which provides Excel files via IE 7. It requests the files with an HTTP GET from a URL which returns the data with a content type of 'application/vnd.ms-excel'. It then opens the spreadsheets in an IFrame.</p>
<p>This all works fine unless Excel is already open when a spreadsheet is downloa... | <p>Further to <a href="https://stackoverflow.com/questions/201355/how-can-i-stop-excel-2003-from-hanging-after-opening-a-spreadsheet-in-ie/497100#497100">Robert's answer</a>, the following line of (Java) code fixes this problem, in that it prevents Excel from hanging:</p>
<pre><code>response.setHeader("Content-Disposi... | <p>Unfortunately, this is completely out of your hands. It really depends on what version of excel they have and what updates have been applied.</p>
| 24,582 |
<p>I would like to know if there is a jQuery event that I can use to determine when a particular DIV's <code>top</code> property has changed.</p>
<p>For instance, I have invisible content above a DIV. When that content becomes visible, the DIV is shifted down. I would like to capture that event and then use the <code>... | <p>The easy answer is that there are no events in the DOM for detecting layout updates.</p>
<p>You have a couple options the way I see it:</p>
<ol>
<li><p>Poll, nasty but it may work depending on your update frequency requirements.</p></li>
<li><p>Tap into whatever event causes the invisible DIV to change size and do... | <pre><code>$("#someId").resize(function () {
// your code
});
</code></pre>
| 46,263 |
<p>Can anyone recommend a ready-to-use class/library compatible with C/C++/MFC/ATL that would parse iCal/vCal/Google calendar files (with recurrences)? It can be free or commercial.</p>
| <p>there is a <a href="http://www.phpclasses.org/browse/package/3278.html" rel="nofollow noreferrer">parser in PHP for iCal</a>, you can downloaded and check the code to suit your language.</p>
<p>for vCal/vCard parsing <a href="http://sourceforge.net/projects/ccard" rel="nofollow noreferrer">there's a C Library</a>.<... | <p>The only problem with the CCard project is that it's a generic parser (similar to what I already have implemented myself) - what would be really valuable to me is something that "understands" all varieties of recurrences and such. Those differ between vCal and iCal as well, adding to the complexity.</p>
| 24,769 |
<p>I am running a series of JUnits using Apache ANT using JDK 1.5.</p>
<p>All JUnits that use an Oracle JDBC driver give the UnsatisfiedLinkError shown below.</p>
<p>What native library is it looking for and how do I solve this? What should the PATH variable contain?</p>
<pre><code>java.lang.UnsatisfiedLinkError: or... | <p>Resolved!</p>
<p>It was actually an out-of-date ojdbc14.jar file causing this issue. All I did was update it and the problem is fixed now. The classes file </p>
<p>Thanks</p>
| <p>Had this one, you should add classes12.jar or classes13.jar to your classpath (not sure about the name, it's been over a year, google these...)</p>
| 21,105 |
<p>Is there a way to reuse a 3rd party control reference?</p>
<p>For example, I have this referenced in my App.xaml</p>
<pre><code>xmlns:cust="clr-namespace:ThirdParty.Controls;assembly=ThirdParty.Controls"
</code></pre>
<p>I don't want to repeat this 3rd party control xml namespace on each page/control that needs a... | <p>Two options I am thinking </p>
<p>1) Wrap that control into a UserControl and then use your UserControl in all the places.</p>
<p>2) Declare the third party control as a Resource somewhere and then use DynamicResource reference to that on your other places.</p>
<p>The second option can be implemented as bellow.</... | <p>Take an example from the built-in control template for a Label:</p>
<pre><code><ControlTemplate TargetType="Label"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:s="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
</code></... | 39,469 |
<p>I'm using System.Reflection.Emit for a while now, and find it (who don't?) as painful as bug prone.</p>
<p>Do you know if there is a good wrapper around the IL Generator, something that I can rely on to emit IL in a more safe and easier manner than with playing directly with SRE?</p>
<p><strong>Edit:</strong></p>
... | <p>If you're using .NET 3.5, you may find using Expression Trees to be more reasonable. It entirely depends on what you're doing - and it can still be quite painful - but it's certainly another option to be aware of.</p>
| <p>[updated]: I thought of the name ;-p <a href="http://www.codeproject.com/KB/dotnet/runsharp.aspx" rel="nofollow noreferrer">RunSharp</a>. I can't vouch for it, but it might be what you need.</p>
<p>However; what do you need to generate? <a href="http://msdn.microsoft.com/en-us/library/y2k85ax6.aspx" rel="nofollow n... | 23,945 |
<p>I've been using:</p>
<p><a href="http://www.webmin.com" rel="nofollow noreferrer">Webmin</a> Free, Apache only</p>
<p><a href="http://www.cpanel.net" rel="nofollow noreferrer">Cpanel</a> Paid, Apache only I believe</p>
<p><a href="http://www.parallels.com/plesk/" rel="nofollow noreferrer">Plesk</a> Paid, supports... | <p>It's not quite what you're after (I think), but if you virtualized your Windows/IIS environments, and ran them on Microsoft Virtual Server, that would give you a remote, web-based interface for administration. </p>
<p>Not quite in the vein of the examples you listed, but still...</p>
| <p>I've never come across one. Never thought to ask about one either, so I'm glad I came across your question. Hope someone knows of something.</p>
<p>A few of the companies that I've worked for / with have had the same issues: many web servers, outdated documentation (or no documentation) and little time to get any... | 14,806 |
<p>I've been given the task of doing some work customizing an artist's space in MySpace. It seems that you sort of hack the HTML you want into your edit profile page (which has several empty boxes). The MySpace page, it seems, is already HTML so you can only hack into that. Suggested "tweaks" include incomplete HTML co... | <p>This shouldn't be too hard if you whip out Firebug and do a bunch of "Inspect > click on page > edit CSS in Firebug's editor" work to see what you can learn about the structure of the page. Then mock it up to roughly how you want it and note down which elements and which styles need work and figure out how to get th... | <p>Your fears are correct. MySpace "customization" is a bunch of hacks. Good luck.</p>
| 14,206 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.