instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>What is a good way to perform animation using .NET?</p>
<p>I would prefer not to use Flash if possible, so am looking for suggestions of ways which will work to implement different types of animation on a new site I am producing.</p>
<p>The new site is for a magician, so I want to provide animated buttons (Cards t... | <p><a href="http://silverlight.net/Default.aspx" rel="nofollow noreferrer">Silverlight</a> springs to mind as an obvious choice if you want to do animation using .NET on the web. It may not cover all platforms but will work in IE and FireFox and on the Mac.</p>
| <p>JavaScript is probably the way to go if you want to avoid Flash. Check this: <a href="http://www.webreference.com/programming/javascript/java_anim/" rel="nofollow noreferrer">http://www.webreference.com/programming/javascript/java_anim/</a></p>
<p>It won't work for embedded video, though, so you're stuck with Flash... | 2,878 |
<p>Pretty new to this scene and trying to find some documentation to adopt best practices. We're building a fairly large content site which will consist of various media catalogs and I'm trying to find some comparable data / architectural models so that we can get a better idea of the approach we should use using a fr... | <p>"data / architectural models so that we can get a better idea of the approach we should use using a framework we've never made use of before"</p>
<p>Django imposes best practices on you. You don't have a lot of choices and can't make a lot of mistakes.</p>
<p>MVC (while a noble aspiration) is implemented as follo... | <p>To understand django fundementals and the django take on MVC, consult the following:
<a href="http://www.djangobook.com/" rel="nofollow noreferrer">http://www.djangobook.com/</a></p>
<p>As a starting point to getting your hands dirty with ...
"...trying to find some comparable data / architectural models"</p>
<p>... | 47,518 |
<p>What is the maximum number of threads that can be created by a process under Linux?</p>
<p>How (if possible) can this value be modified?</p>
| <p>Linux doesn't have a separate threads per process limit, just a limit on the total number of processes on the system (threads are essentially just processes with a shared address space on Linux) which you can view like this:</p>
<pre><code>cat /proc/sys/kernel/threads-max
</code></pre>
<p>The default is the number... | <p>You can see the current value by the following command-
cat /proc/sys/kernel/threads-max</p>
<p>You can also set the value like</p>
<p>echo 100500 > /proc/sys/kernel/threads-max</p>
<p>The value you set would be checked against the available RAM pages. If the thread structures occupies more than 1/8th) of the ava... | 44,769 |
<p>If I modify or add an environment variable I have to restart the command prompt. Is there a command I could execute that would do this without restarting CMD?</p>
| <p>You can capture the system environment variables with a vbs script, but you need a bat script to actually change the current environment variables, so this is a combined solution.</p>
<p>Create a file named <code>resetvars.vbs</code> containing this code, and save it on the path:</p>
<pre class="lang-vb prettypr... | <p>Edit: this only works if the environment changes you're doing are as a result of running a batch file.</p>
<p>If a batch file begins with <code>SETLOCAL</code> then it will always unravel back to your original environment on exit even if you forget to call <code>ENDLOCAL</code> before the batch exits, or if it abor... | 20,686 |
<p>I read a little of the help for my advanced installer 6.5.1 and couldn't find a way to change the version string except by hand.</p>
| <p>Here is a snippet from one of our push scripts. Rob, maybe you'll find this useful too- Advanced installer provides the ability to set the ProductVersion of your installation package based on an existing compiled EXE. We use a custom build task in TFS to increment our build number and set our AssemblyInfo.cs files,... | <p>The files for creating an MSI are usually in XML format, we've created a little tool that runs as part of our build process that goes and changes the build number manually, try openning the advanced installer file in notepad and look for the "ProductVersion" string.</p>
<p>Cheers,
Rob.</p>
| 35,452 |
<p>I find myself writing delegates occasionally for really simple functions (take no arguments and return void for example) and am wondering if anyone knows someplace that has compiled a list of all the predefined delegates already available in the .NET framework so I can reuse them?</p>
<p>To be clear I am looking fo... | <p>Just look in the msdn database for (T) delegate.</p>
<p>Here you got a direct link: <a href="http://social.msdn.microsoft.com/Search/en-us/?Query=(T)%20delegate" rel="noreferrer">List of delegates</a></p>
<p>That should get you started.</p>
| <p>In .NET 2.0 and later, use EventHandler if you have no arguments at all, and EventHandler<T> if you want to provide some custom data (you will need to derive a class from EventArgs with your additional data in it). If you have no EventArgs to use, pass EventArgs.Empty.</p>
<p>Because EventArgs is a reference ... | 9,163 |
<p>A few months back I was tasked with implementing a unique and random code for our web application. The code would have to be user friendly and as small as possible, but still be essentially random (so users couldn't easily predict the next code in the sequence).</p>
<p>It ended up generating values that looked som... | <p>In .NET you can use the RNGCryptoServiceProvider method GetBytes() which will "fill an array of bytes with a cryptographically strong sequence of random values" (from ms documentation).</p>
<pre><code>byte[] randomBytes = new byte[4];
RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider();
rng.GetBytes(rando... | <p>If by user friendly, you mean that a user could type the answer in then I think you would want to look in a different direction. I've seen and done implementations for initial random passwords that pick random words and numbers as an easier and less error prone string. </p>
<p>If though you're looking for a way to ... | 5,504 |
<p>Is it possible to automatically launch an application from a USB flash drive (bypassing windows prompt asking user what he wants to do)? on windows XP or vista.</p>
<p>I looked into "autorun.inf" and "open" entry seems to work only for CD drives for Windows XP SP2+ and Vista. Is it possible to launch program automa... | <p>First of all, some people choose to disable autorun for security reasons; but Windows computers up to Vista have it enabled. Edit: <strong>Apparently the functionality was removed from Windows 7 onwards.</strong></p>
<p>Put a file named autorun.inf in the root of your USB flash drive. This is what's in mine:</p>
<... | <p>there are also U3 usb sticks arround, they will be reconised as cdrom drives in windows.
if you put an a autorun.inf on one of those, it will get executed without the user being questioned.</p>
<p>regards morla</p>
| 31,817 |
<p>I would like to pass an argument(s) to a method being defined using define_method, how would I do that?</p>
| <p>The block that you pass to define_method can include some parameters. That's how your defined method accepts arguments. When you define a method you're really just nicknaming the block and keeping a reference to it in the class. The parameters come with the block. So:</p>
<pre><code>define_method(:say_hi) { |ot... | <p>With 2.2 you can now use keyword arguments:
<a href="https://robots.thoughtbot.com/ruby-2-keyword-arguments" rel="noreferrer">https://robots.thoughtbot.com/ruby-2-keyword-arguments</a></p>
<pre><code>define_method(:method) do |refresh: false|
..........
end
</code></pre>
| 11,514 |
<p>I am trying to load Linq on my .Net 3.5 enabled web server by adding the following to my .aspx page:</p>
<pre><code><%@ Import Namespace="System.Query" %>
</code></pre>
<p>However, this fails and tells me it cannot find the namespace.</p>
<blockquote>
<p>The type or namespace name 'Query' does not exist i... | <blockquote>
<p>I have version 2 selected in IIS and I</p>
</blockquote>
<p>Well, surely that's your problem? Select 3.5.</p>
<p>Actually, here's the real info:</p>
<p><a href="http://www.hanselman.com/blog/HowToSetAnIISApplicationOrAppPoolToUseASPNET35RatherThan20.aspx" rel="noreferrer">http://www.hanselman.com/... | <p>The <code>var hello</code> stuff is compiler magic and will work without Linq.</p>
<p>Try adding a reference to <code>System.Core</code></p>
<hr>
<p>Sorry, I wasn't clear. I meant add <code>System.Core</code> to the web project's references, not to the page.</p>
<p>The <code>Import</code> on the page are basical... | 3,010 |
<p>Is it less efficient to use TEXT than varchar in an SQL database?</p>
<p>If so why?</p>
<p>If not why would you not just always use TEXT?</p>
<p>I'm not targetting a specific database here but oracle is probably the most relevant, although I'm testing on MySQL for the time being as part of a proof of concept.</p>... | <p>From Microsoft <a href="http://msdn.microsoft.com/en-us/library/ms187993.aspx" rel="nofollow noreferrer">here</a></p>
<blockquote>
<p>ntext, text, and image data types will
be removed in a future version of
Microsoft SQL Server. Avoid using
these data types in new development
work, and plan to modify appl... | <p>The short answer is: Yes, they are less efficient.</p>
<p>The longer, more convoluted answer is:</p>
<p>Yes, they are probably less efficient. It depends on which DBMS you are using and the size of your table, etc, etc. TEXT fields are variable width, and as such the DBMS has to do more work when trying to find re... | 25,481 |
<p>say I have an asynchronous library, written in native C++, with an interface similar to this:</p>
<pre><code>class connection {
public:
boost::signal< void() > sig_connection_made;
boost::signal< void(const std::string&) > sig_error;
void connect(const std::string& host, const std::... | <p>I found this explanation: <code>http://www.astahost.com/info.php/max_allowed_packet-mysql_t2725.html</code></p>
<blockquote>
<p>It's safe to increase the value of
this variable because the extra memory
is allocated only when needed. For
example, mysqld allocates more memory
only when you issue a long quer... | <p>I suggest not touching this variable, instead adjusting your storage implementation to handle any size files using the default settings.</p>
<p>Can you see <a href="http://www.dreamwerx.net/phpforum/?id=1" rel="nofollow noreferrer">here</a> for an example.</p>
| 37,770 |
<p>It appears that Directory.GetFiles() in C# modifies the Last access date of a file.
I've googled for hours and can't seem to find a work around for this issue. Is there anyway to keep all the MAC (Modified, Accessed, Created) attributes of a file?
I'm using Directory.GetDirectories(), Directory.GetFiles(), and File... | <p>I know this is far from ideal, but u can use fsutil (provided with Windows) to disable last access time writing:</p>
<pre><code>fsutil behavior set disablelastaccess 1
</code></pre>
<p>Presumably you'd set it back to 0 once done. You can invoke this using Process.Start from C#, but there must be a better programma... | <p>Not sure if this is related or not, but from MSDN:</p>
<blockquote>
<p>When first called, FileSystemInfo
calls Refresh and returns the cached
information on APIs to get attributes
and so on. On subsequent calls, you
must call Refresh to get the latest
copy of the information.</p>
</blockquote>
<p>BTW, ... | 31,593 |
<p>I want to find out all the subdomains of a given domain. I found a hint which tells me to dig the authoritative Nameserver with the following option:</p>
<pre><code>dig @ns1.foo.example example.com axfr
</code></pre>
<p>But this never works. Has anyone a better idea/approach</p>
| <p>The hint (using axfr) only works if the NS you're querying (<code>ns1.foo.example</code> in your example) is configured to allow AXFR requests from the IP you're using; this is unlikely, unless your IP is configured as a secondary for the domain in question.</p>
<p>Basically, there's no easy way to do it if you're n... | <p>If the DNS server is configured properly, you won't be able to get the entire domain. If for some reason is allows zone transfers from any host, you'll have to send it the correct packet to make that request. I suspect that's what the dig statement you included does.</p>
| 16,007 |
<p>I have a PHP file, Test.php, and it has two functions:</p>
<pre><code><?php
echo displayInfo();
echo displayDetails();
?>
</code></pre>
<p>JavaScript:</p>
<pre><code><html>
...
<script type="text/javascript">
$.ajax({
type:'POST',
url: 'display.ph... | <p>If I understand correctly, you'd like for the <code>a</code> link to cancel navigation, but fire the AJAX function?</p>
<p>In that case:</p>
<pre><code>$("#mylink").click(function() {
$.ajax({ type: "POST", url: "another.php", data: {id: "somedata"}, function(data) {
$("#response").html(data);
});
... | <p>You could just use <a href="http://en.wikipedia.org/wiki/MooTools" rel="nofollow noreferrer">MooTools</a> and class <a href="http://mootools.net/docs/Request/Request.HTML" rel="nofollow noreferrer">Request.HTML</a>.</p>
| 48,461 |
<p>I've almost completely installed Boost, but I have a problem with how to set my path to Boost in <em>Tools->options->projects->VC++ Directories</em>.</p>
<p>I've written the path to include files and libraries (my folder contains two subfolders, <code>lib</code> and <code>include</code>), but when I try to use Boos... | <p>Use the <a href="http://www.boostpro.com/download/" rel="nofollow noreferrer">Boost Installer</a> by the Boost consulting group.</p>
| <p>You might be interested in the Visual Studio 2008 Feature pack. It adds many of the features that have only been available from Boost until now, the features that are part of the C++ TR1.</p>
| 31,958 |
<h3>Question</h3>
<p>My question is how can you teach the methods and importance of tidying-up and refactoring code?</p>
<h3>Background</h3>
<p>I was recently working on a code review for a colleague. They had made some modifications to a long-gone colleagues work. During the new changes, my colleague had tried to r... | <p>Like most programming, refactoring skill comes with practice and experience. It would be nice to think it can be taught, but it has to be learned - and there is a significant difference in the amount of learning that can be accomplished in different environments.</p>
<p>To answer your question, you can teach refac... | <p>Pair Programming seems to be the best way for me to get this across. This way, as we're working on real, production code, and we both encounter some code that doesn't smell right, we tackle a code refactoring together. The pair acts as the driver's conscience saying to do the right thing instead of the quick fix, an... | 28,558 |
<p>I haven't been able to find an understandable explanation of how to actually use Python's <code>itertools.groupby()</code> function. What I'm trying to do is this:</p>
<ul>
<li>Take a list - in this case, the children of an objectified <code>lxml</code> element</li>
<li>Divide it into groups based on some criteria<... | <p><strong>IMPORTANT NOTE:</strong> You have to <strong>sort your data</strong> first.</p>
<hr />
<p>The part I didn't get is that in the example construction</p>
<pre><code>groups = []
uniquekeys = []
for k, g in groupby(data, keyfunc):
groups.append(list(g)) # Store group iterator as a list
uniquekeys.append... | <p>One useful example that I came across may be helpful:</p>
<pre><code>from itertools import groupby
#user input
myinput = input()
#creating empty list to store output
myoutput = []
for k,g in groupby(myinput):
myoutput.append((len(list(g)),int(k)))
print(*myoutput)
</code></pre>
<p>Sample input: 14445221... | 2,321 |
<p>I would like to know the best way to use a datagrid control linked to a combination (join) of data tables in a way that both simply allows both display, creation of new rows in underlying tables and deletion.</p>
<p>The datagrid appears to offer the latter capabilities but I have not found a way that I am happy wit... | <p>CSharpAtl is correct, use a Master-Detail control. An example of using one in a WinForm app is at <a href="http://msdn.microsoft.com/en-us/library/y8c0cxey.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/y8c0cxey.aspx</a>.</p>
<p>WinForm DataGrids support add, edit, and delete of both Master... | <p>If the relationship is 1 to many you can go the route of using Master Detail. [link text][1]</p>
<p>[1]: <a href="http://msdn.microsoft.com/en-us/library/aa479344.aspx/" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/aa479344.aspx/</a>"Master Detail"</p>
| 16,319 |
<p>LINQ simplifies database programming no doubt, but does it have a downside? Inline SQL requires one to communicate with the database in a certain way that opens the database to injections. Inline SQL must also be syntax-checked, have a plan built, and then executed, which takes precious cycles. Stored procedures ... | <p>LINQ to SQL actually presents some alarming performance problems in the database. Basically, it creates multiple execution plans based on the length of the parameter you are using. I posted about it a while back on my blog <a href="http://facility9.com/2008/08/28/linq-to-sql-may-cause-performance-problems/" rel="n... | <p>It depends on what you're doing. LINQ is going to be less efficient at the actual data/set manipulation than a real database. But you'll save a lot in not having to connect to the database over a network.</p>
<p>If your database is on the same machine or is formally 'well-connected', you're probably better off us... | 9,778 |
<p>Currently i am developing sites using DNN framework. Currently my development and staging environment is same. Client is vewing same site which I am using for development.</p>
<p>I have started using tortoise svn (subversion) for maintaining versions and backup. I am using file based svn repository for it.</p>
<p>... | <p>Do you have to have the same environment for development and staging? I would really recommend against it. Even if you have them on the same server, I think you should have them at least in separate virtual directories.</p>
<p>Assuming you have then done that, it is simple to keep the '.' directories hidden, you si... | <p>You can hide the .svn folders in DNN but you'll have to modify the core. </p>
<p>Probably an easier solution is to exclude the folder Portals/[PortalID] from your repository, but that depends on what you're developing. Do you need the Portal's files in your repository?</p>
| 13,893 |
<p>I'd like to be able to introspect a C++ class for its name, contents (i.e. members and their types) etc. I'm talking native C++ here, not managed C++, which has reflection. I realise C++ supplies some limited information using RTTI. Which additional libraries (or other techniques) could supply this information?</p>
| <p>What you need to do is have the preprocessor generate reflection data about the fields. This data can be stored as nested classes. </p>
<p>First, to make it easier and cleaner to write it in the preprocessor we will use typed expression. A typed expression is just an expression that puts the type in parenthesis. So... | <p>If you declare a pointer to a function like this:</p>
<pre><code>int (*func)(int a, int b);
</code></pre>
<p>You can assign a place in memory to that function like this (requires <code>libdl</code> and <code>dlopen</code>)</p>
<pre><code>#include <dlfcn.h>
int main(void)
{
void *handle;
char *func_... | 6,275 |
<pre><code>class Child
{
private override void Check_CheckedChanged(object sender, EventArgs e)
{
if (Check.Checked)
{
this.addName(this.FirstName);
this.disableControls();
}
else
{
this.addAddress(this.address);
//this.ac... | <p>A very simple solution would be to make the ActivateControls protected virtual on Parent and override it on the child, then you can call base.activatecontrols in the child method if not Check.Checked.</p>
| <p>A very simple solution would be to make the ActivateControls protected virtual on Parent and override it on the child, then you can call base.activatecontrols in the child method if not Check.Checked.</p>
| 45,758 |
<p>I would like to know if I can install say Visual Studio 2008 Pro and Visual Studio 2008 standard on the same machine. I have tried to install the pro (trial edition available on MSDN) after the express, and it seems to require them to be installed in the same directory. Is this specific to the express edition ?</p>
... | <p>I wouldn't recommend installing multiple editions of the same version side-by-side. I can imagine it playing havoc with the registry. If you just need to have all the different editions available for testing, I'd use VMs.</p>
<p>You can, however, install multiple editions (e.g. 2003, 2005 and 2008) side-by-side.</p... | <p>I know I have installed the express version and the professional version on the same machine.</p>
<p>You could also use <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=04D26402-3199-48A3-AFA2-2DC0B40A73B6&displaylang=en" rel="nofollow noreferrer">Microsoft Virtual PC</a> and install other vers... | 28,854 |
<p>If the amount of data stored within a given field of a database is unknown, and could be very large, should I store it in an external file rather than within a field in the database?</p>
| <p>You should choose a database management system which has the capability to handle large data efficiently. The database system might store it within the database file or in an external file linked to from within the database. SQL Server 2008 can do both, transparently; not sure what other systems offer.</p>
| <p>It depends on your task. There are pluses and minuses of storing large data on the FS instead of the DB. As for the size, you can limit it in the field definition of most databases.</p>
| 23,853 |
<p>I'd be interested in some before-and-after c# examples, some non-idiomatic vs idiomatic examples. Non-c# examples would be fine as well if they get the idea across. Thanks.</p>
| <p>Idiomatic means following the conventions of the language. You want to find the easiest and most common ways of accomplishing a task rather than porting your knowledge from a different language.</p>
<p>non-idiomatic python using a loop with append:</p>
<pre><code>mylist = [1, 2, 3, 4]
newlist = []
for i in mylist... | <p>Practically speaking, it means writing code in a consistent way, i.e. all developers who work on your code base should follow the same conventions when writing similar code constructs.</p>
<p>So the idiomatic way is the way that matches the style of the other code, non-idiomatic way means you are writing the kind o... | 10,962 |
<p>I set up 404 handler page in web.config, but it works ONLY when extension of URL is .aspx (or other which is handled by ASP.NET).
I know I can setup static HTML page in website options, but I want to have a page.
Is there any options to assign ASPX handler page for all request extensions in IIS?</p>
| <p>The direct question was whether or not there are options to assign the ASPX handler to all request extensions: Yes, there is. I'll discuss how to do that shortly.</p>
<p>First, I think the "hidden" question -- the answer you really want -- is whether or not there's a way to redirect all 404 errors for pages other t... | <ol>
<li><p>You can setup wild card mapping in IIS (Application configuration/Mappings/Wildcard mappings/ - just set aspnet_isapi.dll as executable and uncheck the Verify that file exists box) that will route all incoming requests to your app - so you can control the behavior directly from it.</p></li>
<li><p>You don't... | 16,126 |
<p>There are all sorts of advantages to using Emacs, but for someone comfortable with the usual Win32 applications it comes with a wall-like learning curve. With most other editors it’s possible to just start using them and then learn about their other features and enhancements as you go along. </p>
<p>How to just get... | <p>The biggest thing about learning how to use <a href="http://en.wikipedia.org/wiki/Emacs" rel="noreferrer">Emacs</a> is ... (drumroll please) learning how to use Emacs.</p>
<p>Okay, okay, okay. It's a silly answer, and it's a tautology, but it's true. If you start up Emacs, and think to yourself "How could I find e... | <p>My advice is:</p>
<ul>
<li>Learn the very basics (how to type, save a document, turn on syntax highlighting, maybe copy and paste). You can look up how to do these online (google "emacs tutorial" maybe)</li>
<li>Start using it.</li>
</ul>
<p>Whenever you wish you knew how to do something, then look up how to do it... | 33,906 |
<p>I have heard the 'shard' technique mentioned several times with regard to solving scaling problems for large websites. What is this 'shard' technique and why is it so good?</p>
| <p>Karl Seguin has a <a href="http://codebetter.com/blogs/karlseguin/archive/2008/06/30/scale-cheaply-sharding.aspx" rel="nofollow noreferrer">good blog</a> post about sharding.</p>
<p>From the post:</p>
<blockquote>
<p>Sharding is the separation of your
data across multiple servers. How you
separate your data ... | <p>In brief, imagine seperating your users_tbl across several servers. So Users 1-5000 and on Server 1, Users 5000-10000 on Server 2; etc. If your data model is sufficiently abstract in code, it's often not a huge change in code. </p>
<p>Of course this approach becomes difficult if all your queries are similar to "... | 11,713 |
<p>I want to programmatically edit file content using windows command line (<a href="http://en.wikipedia.org/wiki/Windows_command_line" rel="noreferrer">cmd.exe</a>). In *nix there is <a href="http://en.wikipedia.org/wiki/Sed" rel="noreferrer">sed</a> for this tasks. Is there any useful native equivalent in windows?</p... | <p>Today powershell saved me.</p>
<p>For <code>grep</code> there is:</p>
<pre><code>get-content somefile.txt | where { $_ -match "expression"}
</code></pre>
<p>or</p>
<pre><code>select-string somefile.txt -pattern "expression"
</code></pre>
<p>and for <code>sed</code> there is:</p>
<pre><code>get-co... | <p>I needed a sed tool that worked for the Windows cmd.exe prompt. <a href="http://www.pement.org/sed/" rel="nofollow">Eric Pement's port of <strong>sed</strong> to a single DOS .exe</a> worked great for me.</p>
<p>It's pretty well <a href="http://www.pement.org/sed/sedfaq.html" rel="nofollow">documented</a>.</p>
| 15,493 |
<p>How are callbacks written in PHP?</p>
| <p>The manual uses the terms "callback" and "callable" interchangeably, however, "callback" traditionally refers to a string or array value that acts like a <a href="http://en.wikipedia.org/wiki/Function_pointer" rel="noreferrer">function pointer</a>, referencing a function or class method for future invocation. This h... | <p>I cringe every time I use <code>create_function()</code> in php. </p>
<p>Parameters are a coma separated string, the whole function body in a string... Argh... I think they could not have made it uglier even if they tried.</p>
<p>Unfortunately, it is the only choice when creating a named function is not worth the ... | 7,139 |
<p>I want to be able to get an estimate of how much code & static data is used by my C++ program?</p>
<p>Is there a way to find this out by looking at the executable or object files? Or perhaps something I can do at runtime?</p>
<p>Will objdump & readelf help?</p>
| <p>"size" is the traditional tool. "readelf" has a lot of options.</p>
<pre><code>$ size /bin/sh
text data bss dec hex filename
712739 37524 21832 772095 bc7ff /bin/sh
</code></pre>
| <p><code>readelf</code> will indeed help. You can use the <code>-S</code> option; that will show the sizes of all sections. <code>.text</code> is (the bulk of) your executable code. <code>.data</code> and <code>.rodata</code> is your static data. There are other sections too, some of which are used at runtime, others o... | 5,596 |
<p>I'm building some functional tests for a web site using Selenium, and I'm stuck on a bizarre browser issue where the page never seems to finish loading. The status bar reads either "Transferring data from..." or "Read...".</p>
<p>Since the page never finishes loading, my selenium tests timeout.</p>
<p><em>The iss... | <p>Hate to answer my own question, but the problem went away on its own after developers started to strip out invalid markup, unclosed tables or TR's without tables are generally bad.</p>
| <p>Try the <a href="http://livehttpheaders.mozdev.org/" rel="nofollow noreferrer">Live HTTP Headers</a> extension. With this extension you can grab the request and response headers off the wire. You might also try starting Firefox in safe mode for testing. This will disable all installed extensions. Run firefox -h in a... | 39,126 |
<p>I have a set of WCF web services connected to dynamically by a desktop application.</p>
<p>My problem is the really detailed config settings that WCF requires to work. Getting SSL to work involves custom settings. Getting MTOM or anything else to work requires more. You want compression? Here we go again...</p>
<p... | <p>All information about the endpoint is available in metadata of a service, you can write a client what will explore the meta data of the service and will configure the client. For a code example you can look into this excellent <a href="http://www.idesign.net/idesign/DesktopDefault.aspx?tabindex=-1&tabid=19&d... | <p>Thanks, that was useful code (+1).</p>
<p>It's more than a little bit messy though, has some bugs (case sensitive checks that shouldn't be, for instance), has a load of UI functionality that I don't need and repeats a lot of code.</p>
<p>I've taken from it the actual discovery mechanism, re-wrote it and almost got... | 11,311 |
<p>Being a application developer, do I need to know Unicode?</p>
| <p>Unicode is a standard that defines numeric codes for glyphs used in written communication. Or, as they say it themselves:</p>
<blockquote>
<p>The standard for digital
representation of the characters used
in writing all of the world's
languages. Unicode provides a uniform
means for storing, searching, and... | <p>Unicode is a standard that enumerates characters, and gives them unique numeric IDs (called "code points"). It includes a very large, and growing, set of characters for most modern written languages, and also a lot of exotic things like ancient Greek musical notation.</p>
<p>Unlike other character encoding schemes... | 27,435 |
<p>I have a client who had to rebuild his automated build server. He checked out his project folder from my subversion server but is now no longer able to commit - he gets this error:</p>
<pre><code>Error: Commit failed (details follow):
Error: Cannot write to the prototype revision file of transaction
'551-1' becau... | <p>You can clear this error w/out a reboot:</p>
<ol>
<li><p>Identify (or create) a directory in the root SVN repository that was not a part of the failed commit.</p></li>
<li><p>Create a new file in the directory from step 1.</p></li>
<li><p>Commit the new file (and directory if created in step 1). Because the file is... | <p>Mount Point for SubVersion repository was full in our case, adding more space.</p>
| 44,042 |
<p>I am planning a mechanical 40% keyboard build and are coincidentally on the home stretch of a homemade CNC project.</p>
<p>The only thing the CNC needs to do for the keyboard project is to drill 7*48 holes. So what I need to do now is layout those holes in SVG. Therein lies the question. What resolution should I us... | <p><strike>I found one of those printer things that puts ink on dead trees and tested to print a simple SVG file.</p>
<pre><code><svg xmlns="http://www.w3.org/2000/svg"
width="400px" height="800px">
<rect x="10" y="10" width="72" height="72" fill="#999999" />
<rect x="10" y="100" width="378" he... | <p>SVG is a vector-graphics format, there's no particular reason it can't scale arbitrarily. Presumably the CNC software will allow you to select the scale of a pixel? If so, pick a scale that makes the math work out easily (so some integer number of pixels per millimeter). If not, it's probably documented somewhere fo... | 446 |
<p>I'm printing a model on my Ender 3 in Mika3D Silk PLA, which (just for reference, this is not atypical) has a stated temperature of 200 °C to 235 °C. I have used this filament before and found it works best for me around 200 °C, but was not the case with this print, and I'm wondering what ... | <p>Stringing may depend on sub-optimal retraction settings: when retraction is fast and high enough, the string may be cut and disappear.</p>
<p>You may want to at least try to optimise retraction, at least to exclude that parameter.</p>
<p>There is a tool designed to properly tune retraction:
<a href="http://retractio... | <p>It's because the nozzle has nowhere to wipe itself, like when you don't use Z hop the nozzle wipes itself off in the inside of the print. When you have Z hop enabled the nozzle has nowhere to wipe the string off, which leaves a string when it goes over to the next print. This happens to me all the time.</p>
| 1,532 |
<blockquote>
<p><strong>Possible Duplicates:</strong><br>
<a href="https://stackoverflow.com/questions/370427/learn-obj-c-memory-management">Learn Obj-C Memory Management</a><br>
<a href="https://stackoverflow.com/questions/710288/where-are-the-best-explanations-of-memory-management-for-iphone">Where are the best... | <p><a href="http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/index.html" rel="nofollow noreferrer">Here you go</a>:</p>
<blockquote>
<p>Application memory management is the process of allocating memory during your program’s runtime, using it, and freeing it when you are done with it. A well-writt... | <p>It's probably also useful to note that for class messages like NSString + (NSString *)stringWithFormat: (basically, helper messages that allocate an object for you rather than requiring you to allocate the object yourself), the resulting object is auto-released unless you explicitly retain it. </p>
| 13,222 |
<p>Is there a trade off in respect to performance, trade off in respect to memory consumption?</p>
| <p>Yes, absolutely a DataTable consumes more memory than a List.</p>
<p>The DataTable class has lots of objects for column definitions, the table info (name, etc), collections of row objects, the "item arrays" for each row (which is basically all the List would have), etc.</p>
<p>EDIT: Also, List is more performant f... | <p>Oh yeah, it's fat. It can be much more efficient than List<> though. It creates an index so lookups can be O(1). Rows are stored in a red-black tree so inserts and deletes can be O(log n). All these operations are O(n) for List<>. To get this kind of perf, you'll have to choose your columns and queries wi... | 34,695 |
<p>I recently wrote a DLL in C# (.Net 2.0) which contains a class that requires an IP address. A co-worker of mine altered the class to retrieve the IP from a ".dll.config" (XML) file -- This apparently is automatically generated by the "Application Settings" file he created (Settings1.settings). The benefit of this wa... | <p>I use this technique all time time. Often I have a library assembly that requires certain settings, and I need them set both by testing projects as well as the primary "executable" assemblies -- be they web projects or Windows service projects.</p>
<p>You're correct in that when you create a settings file for any ... | <p>The mistake I think you all make is that you apparently make referece to the DLL Settings via <code>Settings1.Default.IPAddress</code> while you are simply suppossed to do this <code>Settings1.IPAddress</code>.</p>
<p>The difference is that when you use <code>Settings1.Default.IPAddress</code> the values are gotten... | 23,406 |
<p>There's Windows SharePoint Services (WSS) and then there is Microsoft Office SharePoint Server (MOSS). MOSS considerably more expensive than WSS (which ships as part of Microsoft Server licensing).</p>
<p>My question is: what does MOSS do that makes it <i>worth</i> the extra cost? </p>
<p>..and does <a href="htt... | <p>About WSS vs MOSS:</p>
<ul>
<li>WSS in not a portal, it's only a collaborative plateform (there are no publishing features in WSS)</li>
<li>MOSS allows you to use user profils, not WSS</li>
<li>Search functionalities are cheap in WSS compare to MOSS (but you can extend them using Search Server Express)</li>
<li>Man... | <p>There is a lot built in to WSS but MOSS has a ton of extra stuff as referenced in the other answer.</p>
<p>On the second part of your question.. Search server and Business Data Connector are quite different.. Search server is about finding things... BDC is about merging datasources to be able to use them easily in ... | 21,972 |
<p>What is the difference between creating one index across multiple columns versus creating multiple indexes, one <em>per</em> column?</p>
<p>Are there reasons why one should be used over the other?</p>
<p>For example:</p>
<pre><code>Create NonClustered Index IX_IndexName On TableName
(Column1 Asc, Column2 Asc, Column... | <p>I agree with <a href="https://stackoverflow.com/a/179109/50776">Cade Roux</a>.</p>
<p>This article should get you on the right track:</p>
<ul>
<li><a href="http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=19f0ce1c-0d2f-4ad5-9b13-a615418422e0" rel="noreferrer">Indexes in SQL Server 2005/2008 – Best Practices, P... | <p>If you have queries that will be frequently using a relatively static set of columns, creating a single covering index that includes them all will improve performance dramatically. </p>
<p>By putting multiple columns in your index, the optimizer will only have to access the table directly if a column is not in the... | 21,595 |
<p>I have been researching options for printing report-like data via a web application. Some options that are viable are writing PDFs, Excel XML, dumping HTML to Excel, or using a tool like activePDF webGrabber. I suppose the question is, what are some solution that give control over print from a browser (IE in my cas... | <p>As I've <a href="https://stackoverflow.com/questions/164197/printing-labels-from-aspnet-page">asked about here already</a> and found out the hard way, you aren't going to get reliable and accurate printing results purely within the browser. Even if it is an intranet application that you've been promised must only wo... | <p>It depends on whether your expected client base is known or unknown. If you want to allow 'anyone' to generate printable documents, then I concur with others that the PDF route is a good one to go down.</p>
<p>We've had good success using <a href="http://www.pdflib.com/" rel="nofollow noreferrer">PDFLib</a> to easi... | 28,716 |
<p>I'm making a webform using a <code>LoginView</code>, the problem is that because the control includes a grey bar telling you what type of control it is it throws of correctly formatting the page (it has <code>LoginView1</code> at the top).</p>
<p>Is there a way to hide this on the <code>LoginView</code> as the <cod... | <p>I may have misunderstood your question but.... </p>
<p>The 'grey bar telling you what type of control it is' only shows up if you are looking at the page in 'design view' in your IDE (are you using Visual Studio?).<br>
Once you run the page this label is not visible. </p>
<p>It is very common for pages that h... | <p>I don't know that there is a property to control this (can't find one on MSDN), but I'd think you could just iterate through the Controls property of the LoginView and hide that panel/label/whatever.</p>
| 2,942 |
<p>I want to use magnets to hold the lid of a box down tight enough to keep it relatively airtight (along with a rubber seal etc.), but I am not sure what strength of magnet to use, that will still allow it to be opened without causing damage either by having to be pried open or by crushing the print layers. I cannot s... | <p>You can vary the “strength” of the magnet by making a membrane of 3D printed plastic in between the magnets. The strength of the attraction is something like a logarithmic relationship to distance- small changes in thickness of material in between the magnets have a large effect on how strong they stick to each othe... | <p>I had a similar experience using magnets to hold two plates together. Currently also building a device (3d-printed) that clamps together with magnets. For both of these scenarios, I typically start by looking at what size and force you need. I would look into maybe 3 options of different magnets to start with. It co... | 2,103 |
<p>I am trying to use a class from a C# assembly in vb.net. The class has ambiguous members because vb.net is case insensitive. The class is something like this:</p>
<pre>
public class Foo {
public enum FORMAT {ONE, TWO, THREE};
public FORMAT Format {
get {...}
set {...}
}
}
</pre>
<p>I try to access... | <p>I don't think you can get around this. Get in touch with the author of the C# component you are trying to use and convince them to fix their code.</p>
<p>Incidentally, this is the primary reason behind the <code>CLSCompliant(true)</code> attribute, which if you are writing APIs or other code that has a high probabi... | <p>There are a couple of ways you can work around it, but neither one is really a good option.</p>
<p>One is to create a C# project and completely wrap the class, changing the ambiguous members into unambiguous ones. Depending on how big the class is, it could be a lot of work, though you only have to wrap the member... | 25,293 |
<p>I want to write a small program that should print something like</p>
<blockquote>
<p>testing CPU... done<br>
testing RAM... done</p>
</blockquote>
<p>and so on.</p>
<p>I wrote the following program in C:</p>
<pre><code>printf( "testing RAM...\t\t" );
sleep( sleep_time );
printf( "done\n\n" );
printf( ... | <p>The issue is that your printings are buffered. immediately before sleeping, call fflush(stdout); to flush the buffer</p>
| <p>Just using \n or an endl at the end of the first printf should suffice</p>
| 36,171 |
<p>I have 28,000 images I need to convert into a movie.
I tried </p>
<pre><code>mencoder mf://*.jpg -mf w=640:h=480:fps=30:type=jpg -ovc lavc -lavcopts vcodec=msmpeg4v2 -nosound -o ../output-msmpeg4v2.avi
</code></pre>
<p>But it seems to crap out at 7500 frames.</p>
<p>The files are named
webcam_2007-04-16_070804.jp... | <p>Shove the list of images in a file, one per line. Then use <code>mf://@filename</code></p>
| <p>another alternative is to bypass mencoder and use ffmpeg directly</p>
| 10,115 |
<p>Unix.....>>netstat -al | grep 8787 (will see packets on port 8787)</p>
| <p>What is the nature of the question here? Are you trying to see packets on port 8787? Are you looking for services listening on port 8787? Most importantly, how is this a programming-related question?</p>
| <p>If you want to see the actual packets then you need to use tcpdump.</p>
<p>Use the <code>-s</code> option to specify how much of the packet you want to see (<code>0</code> means the whole packet) and the <code>-X</code> option to get a Hex and ASCII dump.</p>
| 11,246 |
<p>The short version of my question is:</p>
<blockquote>
<p><em>Are 3D printed parts made of ABS likely to survive for <strong>one year</strong> in an incubator at <strong>80℃</strong>?</em></p>
</blockquote>
<p>Please read on for more details.</p>
<p>I am printing some parts that will be used inside an incubator ... | <p>To answer your question briefly: <strong>No, ABS will not survive for a duration of at least one year at 80-100°C</strong>.</p>
<p><img src="https://i.stack.imgur.com/6X0uY.png" alt="1]">
If you look at the chart above (from Tiganis/Burn), you'll notice, that the blue line (ABS 90°C) is decreasing. I did an eyeball... | <p>I would recommend <a href="http://taulman3d.com/bluprint-spec.html" rel="nofollow noreferrer">Taulman Bluprint</a>, which has a T<sub>g</sub> of 100 °C and prints around 250 °C. </p>
<p>I got a small sample and it printed well with the recommended settings. I didn't do any thermal testing with my print (I... | 753 |
<p>I'm trying out ASP.NET MVC routing and have of course stumbled across a problem. I have a section, /Admin/Pages/, and this is also accessible through /Pages/, which it shouldn't. What could I be missing?</p>
<p>The routing code in global.asax:</p>
<pre><code>public static void RegisterRoutes(RouteCollection routes... | <p>I'd suggest adding an explicit route for /Pages/ at the beginning.</p>
<p>The problem is that it's being handled by the Default route and deriving:</p>
<p>controller = "Pages"
action = "Index"
id = ""</p>
<p>which are exactly the same as the parameters for your Admin route.</p>
| <p>You have in you first route {action} token/parameter which gets in conflict with setting of default action. Try changing parameter name in your route, or remove default action name.</p>
| 9,573 |
<p>Can anyone tell the function to sort the columns of a gridview in c# asp.net.</p>
<p>The databound to gridview is from datacontext created using linq. I wanted to click the header of the column to sort the data.</p>
<p>Thanks!</p>
| <p>There are 2 things you need to do to get this right.</p>
<ol>
<li>Keep the sorting state is viewstate(SortDirection and SortExpression)</li>
<li>You generate the correct linq expression based on the current sorting state.</li>
</ol>
<p>Manually handle the <strong>Sorting</strong> event in the grid and use this hel... | <p>more information on sorting in a gridview can be found here: <a href="http://msdn.microsoft.com/en-us/library/hwf94875.aspx" rel="nofollow noreferrer">MSDN Gridview sorting</a> the methodology used to get the data should not matter, you can use the same sorting.</p>
| 26,191 |
<p>I need a simple table with a user name and password field in MySQL. Since user names must be unique, it makes sense to me to make them the primary key.</p>
<p>Is it better to use <code>CHAR()</code> or <code>VARCHAR()</code> as a primary key? </p>
| <p>may as well just use a user ID index, it's much faster for joins vs char/varchar. the two seconds it takes to add that now could save you a lot of time later if you accidently have to expand the functionality of your schema.</p>
<p>some pitfalls to think about:</p>
<ul>
<li>say we add a few tables at a future date... | <p>I don't see CHAR used much in any MySQL databases i've worked on. I would go with the VARCHAR</p>
<p>For a CHAR(30) for example, the entire 30 characters are stored in the table meaning every entry will take up the same space, even if your username is only 10 characters long.</p>
<p>Using VARCHAR(30) it will only ... | 19,942 |
<p>I've been tasked (by my wife) with creating a program to allow her to track the family trees on both sides of our family.</p>
<p>Does anyone know of a cost-effective (free) control to represent this type of information?</p>
<p>What I'm looking for is a modified org-chart type chart/tree. The modification is that ... | <p><a href="http://www.geni.com/" rel="noreferrer">Geni</a> is probably what your looking for.</p>
| <p>I haven't thought too hard about this, but I reckon you could get a Custom Treeview in WPF to do what you want. I was reading an <a href="http://www.codeproject.com/KB/WPF/CustomTreeViewLayout.aspx" rel="nofollow noreferrer">article on code project a while back that implemented an org chart</a> this way...</p>
| 2,776 |
<p>I've created a simple HttpModule to log the uses of my existing webservice. There's a dll containing a single class </p>
<pre><code>public class TrackingModule : System.Web.IHttpModule
{
public TrackingModule(){}
public void Init(System.Web.HttpApplication context)
{
context.BeginRequest+=new E... | <p>I believe I have found a better solution. Attach the module at runtime instead of in the web config. Check out <a href="http://www.west-wind.com/weblog/posts/44979.aspx" rel="nofollow noreferrer">Rick Strahl's blog post</a> for the details.</p>
| <p>Does this work?</p>
<pre><code><add name="TrackingModule" type="WebserviceTrackingModule.TrackingModule" />
</code></pre>
<p>And is the context_BeginRequest method definitely being called for each request?</p>
| 49,518 |
<p>I want to use a timer in my simple <a href="http://en.wikipedia.org/wiki/.NET_Framework" rel="nofollow noreferrer">.NET</a> application written in C#. The only one I can find is the Windows.Forms.Timer class. I don't want to reference this namespace just for my console application. </p>
<p>Is there a C# timer (or ... | <p>System.Timers.Timer</p>
<p>And as MagicKat says:</p>
<p>System.Threading.Timer</p>
<p>You can see the differences here:
<a href="http://intellitect.com/system-windows-forms-timer-vs-system-threading-timer-vs-system-timers-timer/" rel="noreferrer">http://intellitect.com/system-windows-forms-timer-vs-system-threadi... | <p><a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx" rel="nofollow noreferrer">System.Diagnostics.Stopwatch</a> if your goal is to time how long something takes to run</p>
| 20,441 |
<p>a lot of websites like twitter, facebook and others let the users enter their email id and pwd and 'extract' the contacts based on that. </p>
<p>Anyone know how this is done? </p>
| <p>They login to your account and scrape the contents, or use a public API. Either way, it's not a method that I would implement or use myself because I wouldn't trust anyone else with my credentials. And I think it teaches users to be careless with the secrecy of their credentials.</p>
| <p>For gmail:</p>
<p><a href="http://sourceforge.net/projects/gmail-api" rel="nofollow noreferrer">http://sourceforge.net/projects/gmail-api</a></p>
<p><a href="http://johnvey.com/features/gmailapi/" rel="nofollow noreferrer">http://johnvey.com/features/gmailapi/</a></p>
| 11,298 |
<p>This is a pretty simple question, at least it seems like it should be, about sudo permissions in Linux.</p>
<p>There are a lot of times when I just want to append something to <code>/etc/hosts</code> or a similar file but end up not being able to because both <code>></code> and <code>>></code> are not allo... | <p>Use <code>tee --append</code> or <code>tee -a</code>.</p>
<pre><code>echo 'deb blah ... blah' | sudo tee -a /etc/apt/sources.list
</code></pre>
<p>Make sure to avoid quotes inside quotes.</p>
<p>To avoid printing data back to the console, redirect the output to /dev/null.</p>
<pre><code>echo 'deb blah ... blah' ... | <p>Can you change the ownership of the file then change it back after using <code>cat >></code> to append?</p>
<pre><code>sudo chown youruser /etc/hosts
sudo cat /downloaded/hostsadditions >> /etc/hosts
sudo chown root /etc/hosts
</code></pre>
<p>Something like this work for you? </p>
| 11,041 |
<p>I want to generate a list in C#. I am missing python's list comprehensions. Is there a C# way to create collections on the fly like list comprehensions or generator expressions do in python?</p>
| <p>If you are using C# 3.0 (VS2008) then LINQ to Objects can do very similar things:</p>
<pre><code>List<Foo> fooList = new List<Foo>();
IEnumerable<Foo> extract = from foo in fooList where foo.Bar > 10 select Foo.Name.ToUpper();
</code></pre>
| <p>There's this:</p>
<pre class="lang-cs prettyprint-override"><code>new List<FooBar> { new Foo(), new Bar() }
</code></pre>
<p>which is only a little longer than its python equivalent:</p>
<pre class="lang-py prettyprint-override"><code>[Foo(), Bar()]
</code></pre>
<p>And then there is this:</p>
<pre class=... | 41,805 |
<p>I want to do this in code, not with ALT+F1.</p>
| <p>You can also do it this way:</p>
<pre><code>select columnproperty(object_id('mytable'),'mycolumn','IsIdentity')
</code></pre>
<p>Returns 1 if it's an identity, 0 if not.</p>
| <p>As expansion on @Blogbeard's answer</p>
<p>If you like pure query and not inbuilt functions</p>
<pre><code>select col_name(sys.all_objects.object_id, column_id) as id from sys.identity_columns
join sys.all_objects on sys.identity_columns.object_id = sys.all_objects.object_id
where sys.all_objects.name = 'system_f... | 22,920 |
<p>I'm making a study on refactoring limitations on improving existing software architecture and I would be interested to hear your experiences where you have found refactoring to be not enough or still too immature to accomplish your goals.</p>
| <p>Refactoring can be risky</p>
<p>Refactoring is often difficult because the refactorer often isn't the same person as the original designer. Therefore, he or she doesn't have the same background in the system and the decisions that went behind the original design. You always run the risk that bugs avoided in the ori... | <p>To Kev's excellent Answer - "Working Effectively with Legacy Code" by Michael Feathers should be required reading for people working in Software Engineering.</p>
| 17,602 |
<p>I have an external variable coming in as a string and I would like to do a switch/case on it. How do I do that in xquery?</p>
| <p>Starting with XQuery 1.1, use switch:</p>
<p><a href="http://www.w3.org/TR/xquery-11/#id-switch" rel="noreferrer">http://www.w3.org/TR/xquery-11/#id-switch</a></p>
<pre class="lang-xquery prettyprint-override"><code>switch ($animal)
case "Cow" return "Moo"
case "Cat" return "Meow"
case "Duck" return "Q... | <p>For Saxon, you can use something like this:</p>
<pre class="lang-saxon prettyprint-override"><code>declare function a:fn($i) {
typeswitch ($i)
case element(a:elemen1, xs:untyped) return 'a'
case element(a:elemen2, xs:untyped) return 'b'
default return "error;"
};
</code></pre>
<p><a href="https://rrusin.blo... | 11,127 |
<p>I need to write a program used internally where different users will have different abilities within the program.</p>
<p>Rather than making users have a new username and password, how do I tie into an existing domain server's login system?</p>
<p>Assume .NET (C#, VB, ASP, etc)</p>
<p>-Adam</p>
| <p>For WinForms, use System.Threading.Thread.CurrentPrincipal with the IsInRole() method to check which groups they are a member of. You do need to set the principal policy of the AppDomain to WindowsPrincipal first.</p>
<p>Use this to get the current user name:</p>
<pre><code>private string getWindowsUsername()
{
... | <p>Assuming this is served through IIS, I would tell IIS to authenticate via the domain, but I would keep authorization (what roles a user is associated with, accessible functionality, etc) within the application itself. </p>
<p>You can retreive the username used to authenticate via </p>
<pre><code>Trim(Request.Serv... | 10,917 |
<p>I'm having a bit of a problem. I have a datatable in the parent form. I open a dialogbox form that gets the datatable property and creates a checkboxlist. This will be used to export those columns. But when I run the application the parentform property is null. I've tried setting it in the parent and dialogbox form ... | <p>I have a Listbox bound to an object property which is of type <code>List<MyCustomType>()</code> and I verified that the following code updates the listbox when the List is updated.</p>
<pre><code>void On_MyObjProperty_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
MyList... | <p>If you have an ObservableList of objects, and you're changing properties inside those objects, the notification doesn't apply since the collection is not changing directly. I have been forcing notification after changing my object properties by using Insert() to re-add my changed object to the collection, then Remo... | 31,538 |
<p>I'm starting a new project using Flex3 for a reasonably intricate UI getting its data from a collection of RESTful web services. I wondering what experiences others have had in structuring a moderately complex Flex project. The issues I'm thinking about include:</p>
<ul>
<li>I want to use our FlexBuilder licenses f... | <p>I don't know Flex development but I know CI so I'll comment on that aspect.</p>
<p>I work on <a href="http://cruisecontrol.sourceforge.net/" rel="nofollow noreferrer">CruiseControl</a>, so that's what I use (when not being paid to setup something else). And there are blog entries that describe setting up Flex proje... | <p>Well we are using maven. With some help of a lot of different web sties I have an enterprise application being built using maven.</p>
<p>This article via adobe has really help a lot.<br>
<a href="http://www.adobe.com/devnet/flex/articles/fullstack_pt1.html" rel="nofollow noreferrer">http://www.adobe.com/devnet/flex... | 40,109 |
<p>I have a bunch (hundreds) of files that are supposed to have Unix line endings. I strongly suspect that some of them have Windows line endings, and I want to programmatically figure out which ones do.</p>
<p>I know I can just run <pre>flip -u</pre> or something similar in a script to convert everything, but I want ... | <p>You can use the <a href="http://en.wikipedia.org/wiki/File_(Unix)" rel="noreferrer"><code>file</code></a> tool, which will tell you the type of line ending. Or, you could just use <code>dos2unix -U</code> which will convert everything to Unix line endings, regardless of what it started with.</p>
| <p>Windows use char 13 & 10 for line ending, unix only one of them ( i don't rememeber which one ). So you can replace char 13 & 10 for char 13 or 10 ( the one, which use unix ).</p>
| 14,766 |
<p>Let's say I'm creating a chess program. I have a function</p>
<pre><code>void foreachMove( void (*action)(chess_move*), chess_game* game);
</code></pre>
<p>which will call the function pointer action on each valid move. This is all well and good, but what if I need to pass more parameters to the action function? ... | <p>Ah, if only C supported closures...</p>
<p>Antonio is right; if you need to pass extra parameters, you'll need to redefine your function pointer to accept the additional arguments. If you don't know exactly what parameters you'll need, then you have at least three choices:</p>
<ol>
<li>Have the last argument in yo... | <p>+1 to Antonio. You need to change your function pointer declaration to accept additional parameters.</p>
<p>Also, please don't start passing around void pointers or (especially) arrays of void pointers. That's just asking for trouble. If you start passing void pointers, you're going to also have to pass some kin... | 3,248 |
<p>What is the state of native SVG support in the most popular browsers in their latest releases?</p>
<ul>
<li>Internet explorer</li>
<li>Firefox</li>
<li>Opera</li>
<li>Safari</li>
<li>Chrome</li>
<li>Konqueror</li>
<li>Camino</li>
</ul>
| <ul>
<li>IE has SVG support in IE9 but not in IE8 and below. The alternative is <a href="http://msdn.microsoft.com/en-us/library/bb250524.aspx" rel="nofollow noreferrer">VML</a></li>
<li><a href="http://www.mozilla.org/projects/svg/" rel="nofollow noreferrer">Mozilla claims to support it on its latest version</a></li>
... | <p>It should be noted that not only does IE natively lack support but the major plugin (from Adobe) was end of lifed. While many of the browsers above offser support it is highly, highly uneven. </p>
| 26,515 |
<blockquote>
<p><strong>Edit:</strong> The code here still has some bugs in it, and it could do better in the performance department, but instead of trying to fix this, for the record I took the problem over to the Intel discussion groups and got lots of great feedback, and if all goes well a polished version of Atom... | <p>I would seriously advise against public inheritance. I don't know what the atomic implementation is like, but im assuming it has overloaded operators that use it as the integral type, which means that those promotions will be used instead of your float in many (maybe most?) cases.</p>
<p>I don't see any reason why ... | <p>From my reading of that code, I would be really mad at such a compiler as to put out assembly for this that wasn't atomic.</p>
| 29,976 |
<p>Anyone know how to do this without using a third party program? If there no way to do it with a add-on someone can recommend one?</p>
<p>EDIT: I need to add this in the server so all users have the same signature.</p>
<p>Thanks</p>
| <p>You need to create your own exchange message sink to do this. Here's a classic VB example from MS KB:</p>
<p><a href="http://support.microsoft.com/kb/317327" rel="nofollow noreferrer">http://support.microsoft.com/kb/317327</a></p>
<p>and a VB Script one:</p>
<p><a href="http://support.microsoft.com/kb/317680" rel... | <p>We used <a href="http://codetwo.com/" rel="nofollow noreferrer">CodeTwo-s</a> Exchange rules for a while on Exchange 2003.</p>
<p>However there is a known problem with it: if the messages stay in the queue for 2-3 minutes, the Exchange itself sends out the message without the footer. Most of the times it's not a pr... | 3,241 |
<p>While cross-site scripting is generally regarded as negative, I've run into several situations where it's necessary.</p>
<p>I was recently working within the confines of a very limiting content management system. I needed to include database code within the page, but the hosting server didn't have anything usable ... | <p>You've got three choices:</p>
<ol>
<li>Create a <a href="http://developer.yahoo.com/javascript/howto-proxy.html" rel="noreferrer">server side proxy script</a>.</li>
<li><p>Create a remote script to read in remote dynamic HTML. Use a library like <a href="http://www.jquery.com" rel="noreferrer">jQuery</a> to make th... | <p>I've come across that <a href="http://developer.yahoo.com/javascript/howto-proxy.html" rel="nofollow noreferrer">YDN server side proxy script</a> before. It says it's built to work with Yahoo's Search APIs. </p>
<p>Will it work with any domain, if you simply trim the Yahoo API code out? Or do you need to replace... | 7,588 |
<p>When building projects in C++, I've found debugging linking errors to be tricky, especially when picking up other people's code. What strategies do people use for debugging and fixing linking errors?</p>
| <p>Not sure what your level of expertise is, but here are the basics. </p>
<p>Below is a linker error from VS 2005 - yes, it's a giant mess if you're not familiar with it.</p>
<pre><code>ByteComparator.obj : error LNK2019: unresolved external symbol "int __cdecl does_not_exist(void)" (?does_not_exist@@YAHXZ) referenc... | <p>One of the common linking errors I've run into is when a function is used differently from how it's defined. If you see such an error you should make sure that every function you use is properly declared in some .h file.<br>
You should also make sure that all the relevant source files are compiled into the same lib... | 5,535 |
<p>I want a method of the class: "<code>One</code>" ("<code>AccessibleWithinSameNamespace</code>") to be accessible by the class: "<code>Two</code>", without having "<code>Two</code>" extending "<code>One</code>".</p>
<p>Both classes are in the same namespace, so I'm thinking that maybe there's an access-modifier that... | <p>You can use the <a href="http://msdn.microsoft.com/en-us/library/7c5ka91b.aspx" rel="nofollow noreferrer">internal</a> modifier if both classes are in the same assembly.</p>
<p>With your example:</p>
<pre><code>namespace Test
{
class One
{
public void AccessibleToAll()
{
}
... | <p>C# and .NET have no concept of "within the same namespace". Internal is the closest equivalent.</p>
| 27,064 |
<p>I need to invoke a c# application within my c# control, as I do not feel like rewriting the application as a control. </p>
<p>I am able to launch the application using System.Diagnostics.Process.Start.</p>
<p>Now how do I call the methods in my application from/via the c# control as this is where I invoked the app... | <p>The easiest way is to change the application from .exe to .dll and then just reference the application in your project like a normal library.</p>
| <p>You can't call "methods" of another process because its running in an entirely different OS process. You would have to essentially ask the process to execute a method for you, wait for the result, and then marshall the information back into your process. Of course, you would have to have to expose the methods thro... | 30,827 |
<p>I thought this was asked before, but 15 minutes of searching on Google and the site search didn't turn anything up...so:</p>
<p>Where can I obtain free (as in beer and/or as in speech) dictionary files? I'm mainly interested in English, but if you know of any dictionary files, please point them out.</p>
<p>Note: T... | <p>I have found a <a href="http://wordlist.sourceforge.net/" rel="nofollow noreferrer">SourceForge project called Word List</a>, which appears to have a number of dictionaries. I have downloaded a couple and am currently checking them out.</p>
| <p>I don't know what your target platform is but here is a solution that is for VB.NET. It uses the Office libraries which Office in itself isn't free but if your users are all internal and have Office then you could leverage these libs. There is a zip file with the example source code you can download as well.</p>
... | 32,358 |
<p>How can I split long commands over multiple lines in a batch file?</p>
| <p>You can break up long lines with the caret <code>^</code> as long as you remember that the caret and the newline following it are completely removed. So, if there should be a space where you're breaking the line, include a space. <em>(<a href="https://stackoverflow.com/a/21000752/157247">More on that below.</a>)</em... | <p>Though the carret will be preferable way to do this here's one more approach using macro that constructs a command by the passed arguments:</p>
<pre><code>@echo off
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set "{{=setlocal enableDelayedExpansion&... | 9,452 |
<p>How do I check the type of a value on runtime?</p>
<p>I'd like to find out where I'm creating doubles.</p>
| <p>If you're using Objective-C classes, then the <code>[myObject isKindOfClass: [InterestingClass class]]</code> test is available. If you're using primitive types (which your question, quoting the "double" type, suggests), then you can't. However unless you're doing some very funky stuff, the compiler can tell you whe... | <p>With very few exceptions, you never need to check type at runtime. Typed variables can only hold their assigned types, and type promotion is determined at compile time.</p>
| 46,197 |
<p>I am trying to write a unix command line utility that will extract the "application" icon from a Windows Mobile executable. When I look inside the .exe with <a href="http://www.nongnu.org/icoutils/" rel="nofollow noreferrer">wrestool</a> from the icoutils package, I see multiple icon and group_icon resources. I am... | <p>MySQL doesn't support milliseconds in any of the time / date columns, or return it in <code>NOW()</code> so unfortunately, no.</p>
<p>If you have a string in a date / time + microseconds format you can use <code>SELECT MICROSECOND('1997-12-31 23:59:59.000010');</code> to extract the microseconds.</p>
| <p>Just wanted to share it since I recently needed milliseconds for a MySQL project as well.</p>
<p>You can write a UDF - <a href="http://dev.mysql.com/doc/refman/5.5/en/adding-udf.html" rel="nofollow noreferrer">User Defined Function</a> - to get you the system time down to a fairly small fraction of a second:</p>
<... | 40,164 |
<p>I've noticed that a few Wordpress blogs have query statistics present in their footer that simply state the number of queries and the total time required to process them for the particular page, reading something like:</p>
<blockquote>
<p>23 queries. 0.448 seconds</p>
</blockquote>
<p>I was wondering how this is... | <p>Try adding this to the bottom of the footer in your template:</p>
<pre><code><?php echo $wpdb->num_queries; ?> <?php _e('queries'); ?>. <?php timer_stop(1); ?> <?php _e('seconds'); ?>
</code></pre>
| <p>wordpress has a easy solution now</p>
<p>There is a function called <a href="http://codex.wordpress.org/Function_Reference/get_num_queries" rel="nofollow"><code>get_num_queries()</code></a> and as specified in other answers <a href="http://codex.wordpress.org/Function_Reference/timer_stop" rel="nofollow"><code>time... | 3,565 |
<p>I'd like to make it easy for users to forward a port on their NAT to their local machine for my C++ app. I'd like to make this work on OSX & Windows. Linux would be a great bonus, but Linux users are probably more comfortable forwarding ports manually, so it is less of a concern. LGPL type code is OK, but I c... | <p>MiniUPNP is used by at least one bittorrent client (Transmission) and should work fine.</p>
| <p>Bonjour on both OS X and Windows can be used to do port mappings with routers that support uPNP or NAT-PMP. I haven't used the <a href="http://developer.apple.com/DOCUMENTATION/Networking/Reference/DNSServiceDiscovery_CRef/dns_sd/CompositePage.html#//apple_ref/c/func/DNSServiceNATPortMappingCreate" rel="nofollow nor... | 19,786 |
<p>The second question is: When do I use what of these two?</p>
| <p>When not specified, C++ is unmanaged C++, compiled to machine code. In unmanaged C++ you must manage memory allocation manually.</p>
<p>Managed C++ is a language invented by Microsoft, that compiles to bytecode run by the .NET Framework. It uses mostly the same syntax as C++ (hence the name) but is compiled in the ... | <p>Managed C++ means that memory allocation, management, garbage collection is handled by the virtual machine. Whereas in "regular" C++ you would have to allocate and deallocate memory.</p>
| 13,953 |
<p>When trying to link some well established tools to my company's active directory, I hit a roadblock. I was told that:</p>
<blockquote>
<p>"Sorry, I cannot trust our domain admin password to [F/OSS] software...".</p>
</blockquote>
<p>This question deals specifically with <strong>how to convince IT that F/OSS soft... | <p>Any IT person worth their salt will be well aware of the benefits of open source software.</p>
<p>The answer that has been given sounds to me like a palm off answer, some possibilities of why they don't want to implement it could be:</p>
<ul>
<li>Possible lack of enterprise level support for that specific software... | <p>You're talking about Windows admins. Just point out how MSFT has handled recent security issues (like the recent IE holes that have mainstream media telling people to use alternate browsers) and ask how OSS can be any worse.</p>
| 49,167 |
<p>Is it possible to close parent window in Firefox 2.0 using JavaScript. I have a parent page which opens another window, i need to close the parent window after say 10 seconds.
I have tried Firefox tweaks "dom.allow_scripts_to_close_windows", tried delay but nothing seems to work.</p>
<p>Any help will be really appr... | <p>Scissored from <a href="http://www.quirksmode.org/js/croswin.html" rel="nofollow noreferrer">quirksmode</a> (EDIT: added a bit of context, as suggested by Diodeus):</p>
<p>Theoretically</p>
<pre><code>opener.close()
</code></pre>
<p>should be the code from the popup: close the window that has opened this popup.</... | <p>Generally, you can't close a window which you didn't open yourself using javascript.</p>
| 44,708 |
<p>I'm trying to configure an ejabberd installation, using LDAP authentication, but I just can't login, even with the admin user.
This is part of my ejabberd.cfg file:</p>
<pre><code>%...
{auth_method, ldap}.
{ldap_servers, ["server2000.tek2000.local"]}.
{ldap_port,389}.
{ldap_uidattr, "uid"}.
{ldap_base, "dc=server20... | <p>Use a <a href="http://java.sun.com/javase/6/docs/api/java/io/ByteArrayOutputStream.html" rel="noreferrer">ByteArrayOutputStream</a> and then get the data out of that using <a href="http://java.sun.com/javase/6/docs/api/java/io/ByteArrayOutputStream.html#toByteArray()" rel="noreferrer">toByteArray()</a>. This won't t... | <p>If you can pass a Writer to XmlWriter, I would pass it a <code>StringWriter</code>. You can query the <code>StringWriter</code>'s contents using <code>toString()</code> on it.</p>
<p>If you have to pass an <code>OutputStream</code>, you can pass a <code>ByteArrayOutputStream</code> and you can also call <code>toStr... | 27,820 |
<p>I'm supposed to learn how to use <a href="http://www.ni.com/labview/" rel="nofollow noreferrer">LabVIEW</a> for my new job, and I'm wondering if anybody can recommend some good books or reference/tutorial web sites.</p>
<p>I'm a senior developer with lots of Java/C#/C++ experience.</p>
<p>I realize that this quest... | <p><strong>It will take some <em>training</em> and some <em>time</em> to learn the style needed to develop maintainable code</strong>.</p>
<p>Coming from Java/C#/C++, you probably have a good idea of good software architecture. Now you just need to learn the peculiarities of LabView and the common pitfalls.</p>
<p>Fo... | <p>When I started with LabVIEW a few years ago I was given a link to the <a href="http://cnx.rice.edu/content/col10241/latest/" rel="nofollow noreferrer">LabVIEW Graphical Programming Course</a>. It covers the basics and having a sound knowledge of other programming languages I think helped me pick things up quickly.</... | 6,912 |
<p>Do you know of any .NET library which can decode several types of audio files? Ideally, it should be platform agnostic, so it can be used with .NET and Mono - on Windows and *NIX.</p>
<p>I already tortured Google searching for a library which meets my needs, but unfortunately I could not find anything. So before wr... | <p>There is the <a href="http://ffmpeg.mplayerhq.hu/" rel="nofollow noreferrer">ffmpeg</a> library and utilities that converts audio and video formats. Then, couple with the <a href="http://www.codeplex.com/ffmpegdotnet" rel="nofollow noreferrer">FFmpeg.NET</a> library, you can do the encoding/decoding in .NET. All t... | <p>If you are talking about decoding the files to play them (i.e. for listening), I'd suggest jumping into the Windows Media Player SDK.</p>
<p>It will play anything that has a codec installed and doesn't cost anything.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/aa969732.aspx" rel="nofollow noreferrer">h... | 17,360 |
<p>All I want is to be able to change the color of a bullet in a list to a light gray. It defaults to black, and I can't figure out how to change it.</p>
<p>I know I could just use an image; I'd rather not do that if I can help it.</p>
| <p>The bullet gets its color from the text. So if you want to have a different color bullet than text in your list you'll have to add some markup.</p>
<p>Wrap the list text in a span:</p>
<pre><code><ul>
<li><span>item #1</span></li>
<li><span>item #2</span></li... | <p>You'll want to set a "list-style" via CSS, and give it a color: value. Example:</p>
<pre><code>ul.colored {list-style: color: green;}
</code></pre>
| 10,219 |
<p>Has anyone found a way to get around this? Or a better technique to conglomerate logging from multiple web servers reliably?</p>
<p>Any ideas on good log4net log file analysis tools too (plain text not XML) - apart from good 'ol grep of course :)</p>
| <p>The 1024 byte limit is part of the syslog <a href="http://www.ietf.org/rfc/rfc3164.txt" rel="nofollow noreferrer">RFC</a> (section 4.1), as is UDP transport which doesn't have guaranteed delivery (in case you worry about log lines lost in the ether). I think syslog-ng can solve both these issues, but I'm not a sysl... | <p>The limitation is imposed by the syslog itself, not the appender.</p>
<p>I do not know about log4net, but <a href="http://www.nlog-project.org/" rel="nofollow noreferrer">NLog</a> works perfectly ok with "shared" file target - i.e. multiple processes can write in one and the same <a href="http://www.nlog-project.or... | 10,951 |
<p>I have a working LINQ to SQL model. I want to be able to use the same model but with a connection to a DataSet object, instead of SQL Server.</p>
<p>I need to be able to query the model, modify fields, as well as do insert and delete operations. Is there an easy way to accomplish this?</p>
<p>I noticed <a href="... | <p>You can use <a href="http://msdn.microsoft.com/en-us/library/bb386977.aspx" rel="nofollow noreferrer">LINQ to DataSet</a> directly but the LINQ to SQL query translator converts expression trees into SQL statements and that can't be changed.</p>
<p>For lists of inserts/updates/deletes for a given DataContext, you ca... | <p>You want a DataContext that is backed by a DataSet. No, this does not exist unless you build it.</p>
| 19,174 |
<p>I would like to enable/disable some code based on a custom solution configuration I added in Visual Studio. How do I check this value at runtime?</p>
| <p>You can use <a href="http://msdn.microsoft.com/en-us/library/ed8yd1ha.aspx" rel="noreferrer">precompiler directives</a> within Visual Studio. The #if directive will allow you to determine if you are going to include code or not based on your custom solution configuration.</p>
| <p>I'm not sure if you can figure out the exact name of the build configuration. Howerver, if you use Debug.Assert(...), that code will only be run when you compile in debug mode. Not sure it that helps you at all.</p>
| 5,144 |
<p>Microsoft's new <a href="http://msdn.microsoft.com/en-us/library/cc305108.aspx" rel="nofollow noreferrer">Windows Live Application Based Storage API</a> is a RESTful API.</p>
<p>More info is <a href="http://msdn.microsoft.com/en-us/library/cc305108.aspx" rel="nofollow noreferrer">here</a>.</p>
<p>Why did they choo... | <p>WebDAV is for managing files on a remote server, but perhaps is not generic enough for what Microsoft was trying to accomplish.</p>
<p>There's also a lot of hype around REST lately and they are probably in competition with S3 from Amazon which offers a REST API.</p>
<p>It would have been good of them to provide th... | <p>Im been using WebDav on some other project like android and see all kind of scenario compare from REST Api.</p>
<p>Using WebDav, when you had multiple files like 5 thousand files or more and getting there value from the webdav server, open the file take time because of streaming or reading each of them, using REST ... | 31,877 |
<p>When an Event is triggered by a user in IE, it is set to the <code>window.event</code> object. The only way to see what triggered the event is by accessing the <code>window.event</code> object (as far as I know)</p>
<p>This causes a problem in ASP.NET validators if an event is triggered programmatically, like when ... | <p>I had the same problem. Solved by using this function:</p>
<pre><code>jQuery.fn.extend({
fire: function(evttype){
el = this.get(0);
if (document.createEvent) {
var evt = document.createEvent('HTMLEvents');
evt.initEvent(evttype, false, false);
el.dispatchEv... | <p>This is how I solved a simlar issue.
Wrote an onSelect() handler for the datepicker.
<a href="http://docs.jquery.com/UI/Datepicker/datepicker#options" rel="nofollow noreferrer">link text</a>
In that function, called __doPostBack('textboxcontrolid','').
This triggered a partial postback for the textbox to the server,... | 20,355 |
<p>In a .NET Win console application, I would like to access an App.config file in a location different from the console application binary. For example, how can C:\bin\Text.exe get its settings from C:\Test.exe.config?</p>
| <pre><code>using System.Configuration;
Configuration config =
ConfigurationManager.OpenExeConfiguration("C:\Test.exe");
</code></pre>
<p>You can then access the app settings, connection strings, etc from the config instance. This assumes of course that the config file is properly formatted and your app has read ... | <pre><code>AppDomainSetup domainSetup = new AppDomainSetup();
domainSetup.ConfigurationFile = @"D:\Mine\Company\";
string browserName = ConfigurationManager.AppSettings["browser"];
</code></pre>
| 10,163 |
<p>Quite often in ANSI C code I can see parenthesis sorrounding a single return value. </p>
<p>Like this:-</p>
<pre><code>int foo(int x) {
if (x)
return (-1);
else
return (0);
}
</code></pre>
<p>Why use () around the return value in those cases? Any ideas? I can see no reason for that.</p>
| <p>There really isn't a reason...it's just old convention.</p>
<p>To save space, programmers would often do the final math in the return line instead of on it's own line and the parens ensure are mostly there to make it easier to see that it is a single statement that is returned, like this:</p>
<pre><code>return (x+... | <p>Using parentheses in a return statement shows a deficient grasp of <code>C/C++</code> syntax. It's as simple as that. But it's not as bad as putting everything in curly braces:</p>
<pre><code>int foo(int x) {
if (x) {
return (-1);
}
else {
return (0);
}
}
</code></pre>
<p>So many programmers do thi... | 19,575 |
<p>I have windows 2003 terminal servers, multi-core. I'm looking for a way to monitor individual CPU core usage on these servers. It is possible for an end-user to have a run-away process (e.g. Internet Explorer or Outlook). The core for that process may spike to near 100% leaving the other cores 'normal'. Thus, t... | <p>Individual CPU usage is available through the standard windows performance counters. You can monitor this in perfmon.</p>
<p>However, it won't give you the result you are looking for. Unless a thread/process has been explicitly bound to a single CPU then a run-away process will not spike one core to 100% while al... | <p>perfmon from Microsoft can monitor each individual CPU. perfmon also works remote and you can monitor farious aspects of Windows.</p>
<p>I'm not sure if it helps to find run-away processes because the Windows scheduler dos not execute a process always on the same CPU -> on your 8 CPU machine you will see 12.5 % usa... | 7,051 |
<p>When I changed the rankdir of my graph from LR to TD, my record nodes also changed their layout direction so they no longer look like a 'record'. I tried applying a separate rankdir to the nodes, but this had no effect.</p>
<p>How does one keep the record nodes with the correct layout?</p>
<pre><code>digraph sampl... | <p>Taking into account that rankdir effectively replaces the notion of "top" and "bottom" for the given graph, that's not surprising. </p>
<p>I am afraid that there is no easy remedy for this, save hacking the source (and that would not be easy at all). You can surround your labels in "{}" with some kind of mass searc... | <p>You can use html table like labels instead of records. IIRC the table based labels do not rotate with the rank direction. See <a href="http://www.graphviz.org/doc/info/shapes.html#html" rel="noreferrer">http://www.graphviz.org/doc/info/shapes.html#html</a></p>
| 32,408 |
<p>I'm trying to learn about Expression trees, and I've created a method that takes an</p>
<pre><code>Expression<Func<bool>>
</code></pre>
<p>and executes it if it satisfies some conditions - see the code below.</p>
<pre><code> private static void TryCommand(Expression<Func<bool>> exp... | <p>The target of the method call is an instance of MyClass, but the delegate itself isn't the method call. It's something which will perform the method call when it's executed.</p>
<p>If you look at func.Target, you'll see it's a <a href="http://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.executio... | <p>The target is null because the method is static. In reflection Invoke(..) on a static MethodInfo will ignore the target. This is likely an extension method, in which case the first argument is the inferred target.</p>
<p>Since most of LINQ is based on extension methods you'll see this quite often going forward wi... | 44,245 |
<p>I am currently using Windows Server 2008 Standard and have several Hyper V machines. These are development VM's and I want to now switch back Vista x64 because I am missing Aero.</p>
<p>I know Windows Server 2008 can have aero but the host performance is very very bad when I run VM in Hyper V.</p>
<p>I want to exp... | <p>VPC to Hyper-V is one way.</p>
| <p>You should review Windows 2008 R2 SP1 upgrade with RemoteFX, it comes with a new video driver for VM's that allow 3D, extended desktops and more. It will help resolve some of the issues you are seeing today.</p>
<p>Both the Host server and VM need to be running SP1 of Windows 2008 R2.</p>
<p><a href="http://blogs.... | 6,477 |
<p>We need to programatically burn files to CD in a C\C++ Windows XP/Vista application we are developing using Borlands Turbo C++.</p>
<p>What is the simplest and best way to do this? We would prefer a native windows API (that doesnt rely on MFC) so as not to rely on any third party software/drivers if one is availabl... | <p>We used the following: </p>
<p>Store files in the directory returned by GetBurnPath, then write using Burn. GetCDRecordableInfo is used to check when the CD is ready.</p>
<pre><code>#include <stdio.h>
#include <imapi.h>
#include <windows.h>
struct MEDIAINFO {
BYTE nSessions;
BYTE nLastT... | <p>You should be able to use the shell's ICDBurn interface. Back in the XP day MFC didn't even have any classes for cd burning. I'll see if I can find some examples for you, but it's been a while since I looked at this.</p>
| 10,867 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.