instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>I am using Visual Studio 2005 with Team Foundation Server.</p> <p>When I right click a file under the source control and choose "compare" VS appears to freeze until I hit escape. My guess is that the window that is supposed to be popping up is somewhere I can't get to. I tried minimizing all the windows that I ca...
<p>Try the keyboard shortcut to get to the window's main menu () then hit 'M' for move and hit an arrow key to attach the window to the mouse - then at the next move of the mouse it should jump to it.</p> <p>Experiment with a window you can see first.</p>
<p>I had to disable my Second Screen as well. Now the check-in screen where you can add a comment <em>IS</em> visible.</p>
15,058
<p>Does anyone know how to calculate time difference in C++ in milliseconds? I used <a href="http://linux.die.net/man/3/difftime" rel="noreferrer"><code>difftime</code></a> but it doesn't have enough precision for what I'm trying to measure.</p>
<p>I know this is an old question, but there's an updated answer for C++0x. There is a new header called <code>&lt;chrono&gt;</code> which contains modern time utilities. Example use:</p> <pre><code>#include &lt;iostream&gt; #include &lt;thread&gt; #include &lt;chrono&gt; int main() { typedef std::chrono::high_...
<p>I think you will have to use something platform-specific. Hopefully that won't matter? eg. On Windows, look at <code>QueryPerformanceCounter()</code> which will give you something much better than milliseconds.</p>
39,589
<p>I like to keep my source files on a USB drive for the portability. To date I have been using Visual SourceSafe for this purpose. What is a good alternative to VSS that fulfils these criteria:</p> <ul> <li>Entire database can be held on a USB &quot;pen&quot; drive</li> <li>Code / documentation duplicated on local dri...
<p>I would use SVN (Subversion). </p> <p>You can use SVN in "file" mode (w/o using the network). combine this with tortoiseSVN, which integrates to explorer, and you have a nice little portable repository.</p> <p>For Visual Studio integration, there is the commercial($49) VisualSVN (which I believe is the setup used...
<p>There are two common free front-ends <a href="http://ankhsvn.open.collab.net/" rel="nofollow noreferrer">Ankhsvn</a> integrates into visual studio and <a href="http://tortoisesvn.tigris.org/" rel="nofollow noreferrer">TortoiseSVN</a> integrates with explorer ( my preference). There is also sliksvn a self contained ...
16,345
<p>I'm presenting information from a DataTable on my page and would like to add some sorting functionality which goes a bit beyond a straight forward column sort. As such I have been trying to place LinkButtons in the HeaderItems of my GridView which post-back to functions that change session information before reloadi...
<p>You're on the right track but try working with the Command Name/Argument of the LinkButton. Try something like this:</p> <p>In the HeaderTemplate of the the TemplateField, add a LinkButton and set the CommandName and CommandArgument</p> <pre><code>&lt;HeaderTemplate&gt; &lt;asp:LinkButton ID="LinkButton1" ru...
<p>Two things to keep in mind when using events on dynamically generated controls in ASP.Net:</p> <ul> <li>Firstly, the controls should ideally be created in the Page.Init event handler. This is to ensure that the controls have already been created before the event handling code is ran.</li> <li>Secondly, you must ass...
6,735
<p>I might be an exception here but I have never worked on a team with more than three developers and / or five people. Still we could manage to get the job done (somehow).</p> <p>Is there a software development process which fits this "extreme" scenario? And, if you work as a standalone programmer is there something ...
<p>The <a href="http://en.wikipedia.org/wiki/Agile_software_development" rel="noreferrer">agile methodologies</a> are a good starting point because, imho, they are better suited for small groups. </p> <p>As for keeping your personal working pace I'd recommend a method based on TODO lists and some tool like <a href="ht...
<p>Not a direct answer to your question, but Steve McConnell has an article named <a href="http://www.stevemcconnell.com/articles/art06.htm" rel="nofollow noreferrer">Less is More</a> written more than a decade ago about why small teams are more productive.</p>
20,072
<p>I'm fresh out of college and have been working in C++ for some time now. I understand all the basics of C++ and use them, but I'm having a hard time grasping more advanced topics like pointers and classes. I've read some books and tutorials and I understand the examples in them, but then when I look at some advanc...
<p>Pointers and classes aren't really advanced topics in C++. They are pretty fundamental.</p> <p>For me, pointers solidified when I started drawing boxes with arrows. Draw a box for an int. And int* is now a separate box with an arrow pointing to the int box. </p> <p>So:</p> <pre><code>int foo = 3; // ...
<p>Pretend a pointer is an array address.</p> <pre><code>x = 500; // memory address for hello; MEMORY[x] = "hello"; print MEMORY[x]; </code></pre> <p>its a graphic oversimplification, but for the most part as long as you never want to know what that number is or set it by hand you should be fine. </p> <p>Back whe...
12,190
<p>When the print head changes direction, the printer must accelerate and decelerate the print head. When calibrated correctly, the printer is able to do this quickly and without causing the printer to shake too much, without drastically slowing down the print process.</p> <p>If I set it too high, my printer shakes vi...
<p>As Tom pointed out, binary search is the best way. In case that term isn't familiar to all readers, here's a little more detail:</p> <ol> <li><p>Establish an acceleration value that you're sure is too low (call it <span class="math-container">$L$</span>), and one that you're sure is too high (<span class="math-cont...
<p>Most printers use between 2000 and 5000 mm/s<sup>2</sup>.... extrusion moves are usually 2000 (on average, between different printers), travel is normally seen at 3000-5000, though for most lower end or duel direct drive extruder (heavy) printers, this value should be lower (some as low as 500-1000, some as high as ...
131
<p>I want to scrape some information off a football (soccer) web page using simple python regexp's. The problem is that players such as the first chap, ÄÄRITALO, comes out as &amp;#196;&amp;#196;RITALO!<br> That is, html uses escaped markup for the special characters, such as &amp;#196;</p> <p>Is there a simple way o...
<p>I would recommend <a href="http://www.crummy.com/software/BeautifulSoup/" rel="nofollow noreferrer">BeautifulSoup</a> for HTML scraping. You also need to tell it to convert HTML entities to the corresponding Unicode characters, like so:</p> <pre><code>&gt;&gt;&gt; from BeautifulSoup import BeautifulSoup &gt;&gt...
<p>I haven't tried it myself, but have you tried</p> <p><a href="http://zesty.ca/python/scrape.html" rel="nofollow noreferrer">http://zesty.ca/python/scrape.html</a> ?</p> <p>It seems to have a method htmldecode(text) which would do what you want.</p>
7,665
<p>I recently started Erlang, and I notice I constantly get "Warning: variable X is unused" while compiling. For example, take the following function, which finds the maximum element in a list:</p> <pre><code> max([Head|Tail]) -&gt; max(Head,Tail). max(Element,[Head | Tail]) when Element &lt; Head -&gt...
<p>This should suppress the warning without being confusing:</p> <pre><code>max(Element,[_Head | Tail]) -&gt; max(Element, Tail); </code></pre>
<pre><code> max([Head|Tail]) -&gt; max(Head,Tail). max(Element,[Head | Tail]) when Element &lt; Head -&gt; max(Head,Tail); max(Element,[_| Tail]) -&gt; max(Element, Tail); max(Element,[]) -&gt; Element. </code></pre> <p>Should do the trick. The reason being that replacing 'H...
44,992
<p>I'm trying to write a blog post which includes a code segment inside a <code>&lt;pre&gt;</code> tag. The code segment includes a generic type and uses <code>&lt;&gt;</code> to define that type. This is what the segment looks like:</p> <pre><code>&lt;pre&gt; PrimeCalc calc = new PrimeCalc(); Func&lt;int, int...
<pre><code>&lt;pre&gt; PrimeCalc calc = new PrimeCalc(); Func&amp;lt;int, int&amp;gt; del = calc.GetNextPrime; &lt;/pre&gt; </code></pre>
<p>It's probably something specific to your blog software, but you might want to give the following strings a try (remove the underscore character): &amp;_lt; &amp;_gt;</p>
6,359
<p>I'm using an hierarchical FSM for an embedded C++ application interface. I'd like to use small functions to determine whether certain inter-state events can be triggered, as well as use them to effect changes in the database: however, making a new class with different event functions for each state is daunting, as w...
<p>Actually, if you use the Boost/TR1 library, there is support for <a href="http://www.boost.org/doc/libs/1_37_0/doc/html/lambda.html" rel="nofollow noreferrer">Lambda functions</a>. Details can be found on the <a href="http://www.boost.org/" rel="nofollow noreferrer">Boost web site</a>.</p>
<p>The new <a href="http://en.wikipedia.org/wiki/C%2B%2B0x" rel="nofollow noreferrer">C++0x standard</a> is coming close to finalization and acceptance. It should end up being C++09 when introduced next year. This standard will include <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" re...
43,407
<p>Say I have this simple form:</p> <pre><code>class ContactForm(forms.Form): first_name = forms.CharField(required=True) last_name = forms.CharField(required=True) </code></pre> <p>And I have a default value for one field but not the other. So I set it up like this:</p> <pre><code>default_data = {'first_na...
<p>Form constructor has <code>initial</code> param that allows to provide default values for fields.</p>
<p>From the django docs is this:</p> <pre><code>from django import forms class ContactForm(forms.Form): subject = forms.CharField(max_length=100) message = forms.CharField() sender = forms.EmailField() cc_myself = forms.BooleanField(required=False) </code></pre> <p>The "required=False" should produce ...
37,093
<p>While printing a <a href="https://www.thingiverse.com/thing:3932302" rel="nofollow noreferrer">paint rack from thingiverse</a> I keep getting jams. Other prints (shorter) work fine. Can anyone give me a clue?</p> <p>Here's a <a href="https://photos.app.goo.gl/PQuJwqNdYWSMTiwm6" rel="nofollow noreferrer">video of the...
<p>When I started printing ABS with my Prusa i3 MK3 MMU2+ printer, I started experiencing jams on some longer prints, which was heat creap, possibly combined with old filament.</p> <p>I improved the cooling by filling the gap between the sides of the heat sink and the plastic extruder body. I think I stuffed it with so...
<p>The maker geeks formulation of PLA requires much hotter temperatures. The plastic was not melted enough for good flow.</p>
1,804
<p>When you search in Google (i'm almost sure that Altavista did the same thing) it says "Results 1-10 of about xxxx"...</p> <p>This has always amazed me... What does it mean "about"?<br> How can they count roughly?<br> I do understand why they can't come up with a precise figure in a reasonable time, but how do they ...
<p>Most likely it's similar to the sort of estimated row counts used by most SQL systems in their query planning; a number of rows in the table (known exactly as of the last time statistics were collected, but generally not up-to-date), multiplied by an estimated selectivity (usually based on a sort of statistical dist...
<p>Returning an exact number of results is not worth the overhead to accurately calculate. Since there's not much of a value add from knowing there was 1,004,345 results rather than 'about 1,000,000', it's more important from an end user experience perspective to return the results faster rather than the additional tim...
17,696
<p>I'm looking for a relativity cheap .NET Micro Framework development board for use on a personal robotics project. I'd don't need much for I/O, but I want at least one serial port and one Ethernet port. </p> <p>I would prefer not to have to spend more than US$300 on the board, but if there is an obvious reason to ge...
<p>Here are two different boards that I have been researching. Both of these are around $100.00 and are meant for the hobbyist. Neither of these boards has ethernet on the board, but is relatively easy to add by adding an external ethernet module</p> <p><a href="http://devicesolutions.net/Products/MeridianP.aspx" rel...
<p>Soon, the Microsoft Gadgeteer will be produced. </p> <p>See this link for more info: <a href="http://research.microsoft.com/en-us/projects/gadgeteer/default.aspx" rel="nofollow">http://research.microsoft.com/en-us/projects/gadgeteer/default.aspx</a></p> <p><a href="http://channel9.msdn.com/Blogs/Clint/NET-Gadgete...
30,975
<p>We want to allow "normal" href links to other webpages, but we don't want to allow anyone to sneak in client-side scripting.</p> <p>Is searching for "javascript:" within the HREF and onclick/onmouseover/etc. events good enough? Or are there other things to check?</p>
<p>It sounds like you're allowing users to submit content with markup. As such, I would recommend taking a look at a few articles about preventing cross-site scripting which would cover a bit more than simply preventing javascript from being inserted into an HREF tag. Below is one I found that might be useful:</p> <...
<p>You have to be extremely careful when taking user input. You'll want to do a whitelist as mentioned, but not just with the href. Example:</p> <pre><code>&lt;img src="nosuchimage.blahblah" onerror="alert('Haxored!!!');" /&gt; </code></pre> <p>or</p> <pre><code>&lt;a href="about:blank;" onclick="alert('Haxored agai...
43,043
<p>I have a site with over 100 pages. We need to go live with products that are soon available, however, many site pages will not be prepared at the time of release.</p> <p>In order to move forward, I would like to reference a "coming soon" page with links to pages that are current and available.</p> <p>Is there an e...
<p>Perhaps a better or "more correct way" would be to do the redirection at the header level. Using PHP, you would call</p> <pre><code>&lt;?php header("Location: http://www.yourdomain.com/index.html"); </code></pre> <p>There's also ways to do this in Apache (assuming you are using it) and <code>.htaccess</code>-files...
<p>Perhaps a better or "more correct way" would be to do the redirection at the header level. Using PHP, you would call</p> <pre><code>&lt;?php header("Location: http://www.yourdomain.com/index.html"); </code></pre> <p>There's also ways to do this in Apache (assuming you are using it) and <code>.htaccess</code>-files...
41,822
<p>Is it possbile to execute linux commands with java? I am trying to create a web servlet to allow ftp users to change their passwords without ssh login access. I would like to execute the next commands: </p> <pre><code># adduser -s /sbin/nologin clientA -d /home/mainclient/clientA # passwd clientA # cd /home/maincl...
<p>Check out <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ProcessBuilder.html" rel="nofollow noreferrer">this</a>.</p> <p>However, doing what you are talking about is way outside spec, and I wouldnt reccommend it. To get it to work you are going to either run your app server as root, or use some other me...
<p>The java <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Runtime.html" rel="nofollow noreferrer">RunTime</a> object has exec methods to run commands in a separate process</p>
15,336
<p>This is the code I wrote:</p> <pre><code> MailMessage mail = new MailMessage("test@gmail.com", "me@myurl.com"); mail.Subject = "This is a test!!"; mail.Body = "testing..."; SmtpPermission connectAccess = new SmtpPermission(SmtpAccess.Connect); System.Console.WriteLine("Acces...
<p>@ Michael: thanks for the link. It's very helpful.</p> <p>I <em>think</em> I figured out my problem. I did need to add the login credentials after I created my "client" object. I added the following line:</p> <pre><code> client.Credentials = new System.Net.NetworkCredential("myloginat+myurl.com", "mypassword")...
<p>Check your firewall. Is 2525 post open?</p>
47,849
<p>I am binding an SPGridView to a SPList. As code samples suggest, I am using the following code to create a dataview based on the list. </p> <pre><code>dim data as DataView = myList.Items.GetDataTable.DefaultView grid.DataSource = data etc... </code></pre> <p>What I am finding is that the column names in the result...
<p>The <code>GetDataTable</code> method is returning the <code>internalName</code> (or <code>staticName</code> -- I can't remember for sure which but they are frequently the same) representation of the columns, rather than the <code>Title</code> representation, which is what you see in the Web interface. I believe <cod...
<p>What you also could do (if you´re using .NET 3.5) is to use an anonymous type and bind against that. If you´re doing this you might wanna go with a Linq DataSource as well. I have made a post that explains this <a href="http://johanleino.spaces.live.com/blog/cns!6BE273C70C45B5D1!328.entry" rel="nofollow noreferrer">...
36,243
<p>AKA - What's this obsession with pointers?</p> <p>Having only really used modern, object oriented languages like ActionScript, Java and C#, I don't really understand the importance of pointers and what you use them for. What am I missing out on here?</p>
<p>It's all just indirection: The ability to not deal with data, but say "I'll direct you to some data, over there". You have the same concept in Java and C#, but only in reference format.</p> <p>The key differences are that references are effectively immutable signposts - they always point to something. This is usefu...
<p>Write more than 2 lines of c or c++ and you'll find out.</p> <p>They are "pointers" to the memory location of a variable. It is like passing a variable by reference kinda.</p>
11,747
<p>Example</p> <p>G76 I0.4779 J270 K7 C90</p> <p>X20 Y30 </p> <p>If a number begins with I J K C X Y and it doesn't have a decimal then add decimal. Above example should look like:</p> <p>G76 I0.4779 J270 K7. C90.</p> <p>X20. Y30.</p> <p>Purpose of this code is to convert CNC code for an older Fanuc OPC controlle...
<p><pre><code><code>Set RegEx = New RegExp RegEx.Global = True RegEx.Pattern = "([IJKCXY]\d+)([^\.]|$)" newVar = RegEx.Replace (oldString, "$1.$2") </code></pre></code></p> <p>Where oldString is the original string, and newVar is the string with the decimals added.</p>
<pre><code>function convert(str) Set RegEx = New RegExp RegEx.Global = True RegEx.Pattern = "([IJKCXY]\d*\.?\d*)" Set Matches = regEx.Execute(str) For Each Match in Matches if instr(Match.value, ".") = 0 then str = Replace(str, Match.value, Match.value &amp; ".") end if ...
20,222
<p>I would like to be able to use the <kbd>Tab</kbd> key within a text box to tab over four spaces. The way it is now, the Tab key jumps my cursor to the next input.</p> <p>Is there some JavaScript that will capture the Tab key in the text box before it bubbles up to the UI?</p> <p>I understand some browsers (i.e. Fi...
<p>Even if you capture the <code>keydown</code>/<code>keyup</code> event, those are the only events that the tab key fires, you still need some way to prevent the default action, moving to the next item in the tab order, from occurring.</p> <p>In Firefox you can call the <code>preventDefault()</code> method on the eve...
<p>In Chrome on the Mac, alt-tab inserts a tab character into a <code>&lt;textarea&gt;</code> field.</p> <p>Here’s one: . Wee!</p>
2,550
<p>I know this will be a difficult question, so I am not necessarily looking for a direct answer but maybe a tutorial or a point in the right direction.</p> <p>What I am doing is programing a robot that will be controlled by a remote operator. We have a 3D rendering of the robot in SolidWorks. What I am looking to do ...
<p>Sounds like a tough idea to implement. Well, for VB you are stuck with <a href="http://en.wikipedia.org/wiki/Managed_DirectX" rel="nofollow noreferrer">MDX</a> 1.1(Comes with DirectX SDK) or <a href="http://slimdx.mdxinfo.com/wiki/index.php?title=Main_Page" rel="nofollow noreferrer">SlimDX</a> (or other 3rd party Ma...
<p>I'm not sure what the real question is but what I suspect that you are trying to do is to be able to manipulate a SW model of a robot with some sort of a manual input. Assuming that this is the correct question, there are two aspects that need to be dwelt with:</p> <p>1) The Solidworks module: Once the model of ...
45,022
<p>Given a date how can I add a number of days to it, but exclude weekends. For example, given 11/12/2008 (Wednesday) and adding five will result in 11/19/2008 (Wednesday) rather than 11/17/2008 (Monday).</p> <p>I can think of a simple solution like looping through each day to add and checking to see if it is a weeken...
<p>using Fluent DateTime <a href="https://github.com/FluentDateTime/FluentDateTime" rel="noreferrer">https://github.com/FluentDateTime/FluentDateTime</a></p> <pre><code>var dateTime = DateTime.Now.AddBusinessDays(4); </code></pre>
<p>Given the number of the original day in the year D and original day in the week W and the number of workdays to add N, the next weekday number is </p> <pre><code>W + N % 5. </code></pre> <p>The next day in the year (with no wraparound check) is </p> <pre><code>D + ((N / 5) * 7) + N % 5). </code></pre> <p>This is...
35,281
<p>Can Apache HTTP Server serve only static content? Tomcat is used to serve Servlets/JSP. Can Tomcat serve other dynamic contents like perl, PHP etc? </p>
<p>Apache HTTP Server (<a href="http://httpd.apache.org" rel="nofollow noreferrer">http://httpd.apache.org</a>) has:</p> <ul> <li><p>CGI support: <a href="http://httpd.apache.org/docs/2.0/mod/mod_cgi.html" rel="nofollow noreferrer">mod_cgi</a>. This will run almost any dynamic content, you can even write a CGI in Bas...
<p>Of course Apache is able to serve dynamic content! mod_perl, mod_php, and so are the modules you plug to Apache to give him the ability to serve them.</p>
26,578
<p>Pretty much what the title says really.</p> <p>We have some code that is .NET 1.1 based and no real desire to up-convert it. However, we are looking to add developers to the team and they will need copies of Visual Studio.</p> <p>My understanding is that they will need VS 2003 - as this is the only IDE that suppo...
<p>Visual Studio 2003 is still available to download for MSDN subscribers.</p> <p>The EULA for Visual Studio includes a 'downgrade' clause, which appears, IMNAL, to allow you to buy Visual Studio 2008 and then install 2003 under the same license.</p> <blockquote> <p>DOWNGRADE. You may install and use this version...
<p>Supported: Yes<br> Available: Not through normal channels. You might still find a boxed copy on Amazon or somewhere.</p>
7,266
<p>I am trying to specify an alternative jre (my default is 1.6 and i need to run with jdk 1.4.2) in Eclipse, for an application that i shall launch from eclipse. I am not sure if I am doing the right thing in the following code:</p> <pre><code>Path jreContainerPath = new Path("/usr/lib/jvm/j2sdk1.4.2_18/"); IVMInstal...
<p><a href="http://kickjava.com/src/org/eclipse/jdt/launching/JavaRuntime.java.htm" rel="nofollow noreferrer"><code>getVMInstall</code></a> returns <a href="http://kickjava.com/src/org/eclipse/jdt/internal/launching/JREContainerInitializer.java.htm" rel="nofollow noreferrer"><code>JREContainerInitializer</code></a><cod...
<p>Do you necessarily want to specify it in the program itself? Otherwise you could just go to the build path of the project and specify the alternative jre that you want to use. (right click on project -> java build path -> select jre -> click edit -> select alternate jre there)</p>
42,468
<p>I would like to return all rows from <code>TableA</code> table that does not exists in another table.</p> <p>e.g. </p> <pre><code>select bench_id from TableA where bench_id not in (select bench_id from TableB ) </code></pre> <p>can you please help me write equivalent LINQ query. Here <code>TableA</code> is from...
<p>So if table A is from Excel, are you loading the data into memory first? If so (i.e. you're using LINQ to Objects) then I suggest you load the IDs in table B into a set and then use:</p> <pre><code>var query = tableA.Where(entry =&gt; !tableBIdSet.Contains(entry.Id)); </code></pre> <p>If this isn't appropriate, pl...
<pre><code>From a in TableA Group Join b in TableB on a.bench_id Equalsb.bench_id into g = Group Where g.Count = 0 Select a </code></pre>
41,625
<p>I use URLLoader to load data into my Flex app (mostly XML) and my buddy who is doing the same thing mostly uses HTTPService. Is there a specific or valid reason to use on over the other?</p>
<p>HTTPService inherits AbstractInvoker which allows you to use tokens and responders which you cannot use with URLLoader. Tokens are good when you need to pass specific variables that are relevant to the request, which you want returned with the response.</p> <p>Other than that, using URLLoader or HttpService to load...
<p>There really is no difference between using the two. Both implementations could be considered "correct".</p>
35,230
<p>Someone within my organization has started pushing for us to pilot the CMU SEI's TSP process (see website <a href="http://www.sei.cmu.edu/tsp/" rel="nofollow noreferrer">here</a>). I have an instinctual aversion to any attempts to cure software development illnesses with alphabet soup, but I would like to know if an...
<p>Ruby on Rails uses <code>application/x-yaml</code> with an alternative of <code>text/yaml</code> (<a href="https://github.com/rails/rails/blob/d41d586/actionpack/lib/action_dispatch/http/mime_types.rb#L39" rel="noreferrer">source</a>).</p> <p>I think it's just a matter of convention, there is no <em>technical</em> ...
<p>As per <a href="https://www.freeformatter.com/mime-types-list.html" rel="nofollow noreferrer">MIME Types list</a> it's <code>text/yaml</code>, even though it's not in official <a href="https://www.iana.org/assignments/media-types/media-types.xhtml#text" rel="nofollow noreferrer">IANA MIME list </a></p>
43,028
<p><a href="http://en.wikipedia.org/wiki/Diamond_problem" rel="noreferrer">http://en.wikipedia.org/wiki/Diamond_problem</a></p> <p>I know what it means, but what steps can I take to avoid it?</p>
<p>A practical example:</p> <pre><code>class A {}; class B : public A {}; class C : public A {}; class D : public B, public C {}; </code></pre> <p>Notice how class D inherits from both B &amp; C. But both B &amp; C inherit from A. That will result in 2 copies of the class A being included in the vtable.</p> <p>To so...
<p>Use inheritance by delegation. Then both classes will point to a base A, but have to implement methods that redirect to A. It has the side effect of turning protected members of A into "private" members in B,C, and D, but now you don't need virtual, and you don't have a diamond.</p>
16,605
<p>I'm working on a Java web application that integrates with a few other external applications that are deployed along with it. Authentication information must be synchronized across everything and the other applications want to authenticate against LDAP. The application will be deployed in environments where there wi...
<p>As this question has been unanswered for quite some time, I'd like to suggest that you also take the commercial license of Penrose into account - it's got a dual license for people just like you, when the GPL implications are prohibitive. I don't know their prices and model, but it might be easier and cheaper to go ...
<p>I've just spent a couple of days looking into exposing our internal application user db as an LDAP service. I looked initially at apache-ds, while it seems to be a very powerful directory service extending it to expose a relational db is mind numbingly complex. </p> <p>Have settled on penrose as it seems to offer a...
43,832
<p>We have an application that will be collecting data and storing it in local WinXP PCs using Microsoft SQL Server Compact. We want to aggregate that data up to a single full-blown SQL Server for reporting and archival. The data transport needs to be fairly continuous (i.e. not batched) though some latency is accept...
<p>I have used Microsoft Sync Services before it was fully released. I liked it and it seems like a perfect fit for your application.</p> <p>I recommend, if you want to make life easy for yourself, is to use a GUID (SQL Server uniqueidentifier) as primary keys on all tables you want to synchronize up to the main serv...
<p>Try the sync and tell us how it goes :) I saw a MSFT event and this guys says: "I added these 3 lines of code and everything just syncs up...wooohhooo". </p> <p>Sounds like the way to go to me. </p>
38,938
<p>Is there a firefox plugin or something similar I can use to validate that my html output has properly closed tags?</p>
<p>You can use either the <a href="http://validator.w3.org/" rel="nofollow noreferrer">W3 HTML Validator</a> or <a href="http://infohound.net/tidy/" rel="nofollow noreferrer">HTML Tidy online</a>.</p>
<p>The best is to install web developer tabs: <a href="https://addons.mozilla.org/en-US/firefox/addon/60" rel="nofollow noreferrer">https://addons.mozilla.org/en-US/firefox/addon/60</a></p> <p>There you can find the link for validator and many other things.</p>
39,560
<p>This is one of the minor CSS problems that plague me constantly.</p> <p>How do folks around Stack Overflow vertically align <em><strong><code>checkboxes</code></strong></em> and their <em><strong><code>labels</code></strong></em> consistently <strong>cross-browser</strong>?</p> <p>Whenever I align them correctly in ...
<h1>Warning! This answer is <em><strong>too old</strong></em> and <em><strong>doesn't work</strong></em> on modern browsers.</h1> <p><sub> I'm not the poster of this answer, but at the time of writing this, this is the most voted answer by far in both positive and negative votes (+1035 -17), and it's still marked as a...
<p></p> <pre><code>input { margin: 0; } </code></pre> <p>actually does the trick</p>
39,396
<p>I know it's possible to place a PyCairo surface inside a Gtk Drawing Area. But I think Qt is a lot better to work with, so I've been wondering if there's anyway to place a PyCairo surface inside some Qt component?</p>
<p>Qt's own OpenGL based surfaces (using QPainter) are known to be much faster than Cairo. Might you explain why you want specifically Cairo in Qt?</p> <p>For the basics of using QPainter see <a href="http://www.informit.com/articles/article.aspx?p=1174421" rel="noreferrer">this excerpt</a> from the book "C++ GUI Prog...
<p>For plotting with you should also consider matplotlib, which provides a higher level API and integrates well with PyQT.</p>
10,787
<p>I am trying to migrate my .net remoting code to wcf but I'm finding it difficult. Can someone help me migrate this simple Remoting based program below to use WCF? The program implements a simple publisher/subscriber pattern where we have a single TemperatureProviderProgram that publishers to many TemperatureSubcrib...
<p>You will need to modify your logic a bit. If you want to migrate this app to <code>WCF</code>. You will need to have clients pull data from the service at regular intervals.</p> <p>You will also need a Windows service or application to host the <code>WCF</code> like the console you are using in the previous code.</...
<p>Well I build real time systems so polling is not an option - I need to push data.</p> <p>Also I am finding there is no WCF equivalent of System.Runtime.Remoting.ObjRef! This is an extremely useful type that encapsulates a service endpoint and can be serialise and passed around the network to other remoting service....
34,875
<p>I have webservice which is passed an array of ints. I'd like to do the select statement as follows but keep getting errors. Do I need to change the array to a string?</p> <pre><code>[WebMethod] public MiniEvent[] getAdminEvents(int buildingID, DateTime startDate) { command.CommandText = @"SELECT id, ...
<p>You can't (unfortunately) do that. A Sql Parameter can only be a single value, so you'd have to do:</p> <pre><code>WHERE buildingID IN (@buildingID1, @buildingID2, @buildingID3...) </code></pre> <p>Which, of course, requires you to know how many building ids there are, or to dynamically construct the query.</p> <...
<blockquote> <p>[WebMethod]</p> <p>public MiniEvent[] getAdminEvents(int <b>buildingID</b>, DateTime startDate)</p> <p>...</p> <p>SqlParameter buildID= new SqlParameter(&quot;@buildingIDs&quot;, <b>buildingIDs</b>);</p> </blockquote> <p>Perhaps I'm being over detailed, but this method accepts a single int, not an array...
21,999
<p>How can I convert a bitmap to a byte array in c++ WITHOUT the .net framework?</p>
<p>If you’re using Windows, you can use <a href="http://msdn.microsoft.com/en-us/library/ms532334(VS.85).aspx" rel="noreferrer"><code>GetDIBits</code></a> to retrieve the bitmap data.</p>
<p>If your bitmap is a device independent bitmap, you can access the pixel data using GetObject and passing in a BITMAP. This avoids making a copy of the pixel data.</p>
46,196
<p>I see parallels between MEF and Lua. Both allow you to register methods and deploy as you need. Are both MEF and Lua forms of IoC / Dependency Injection? </p>
<p>I'll assume you're aware of the huge differences between these technologies and focus on the question:</p> <blockquote> <p>"Are both MEF and Lua forms of IoC / Dependency Injection?"</p> </blockquote> <p>Also, I'll assume you're talking about embedded Lua versus Lua as a language.</p> <p>First, let's separate...
<p>MEF has nothing to do with Lua, and is nothing like Lua.</p> <p>MEF is a framework for extending (basically, an awesome plugin framework).</p> <p>Lua is a very cool scripting language.</p> <p>"Both allow you to register methods and deploy as you need." That sentence applies to C, C++, C#, VB, SQL, DI Frameworks, ...
42,311
<p>I have a bunch of rows in Excel that I want to paste into a new table in MS SQL. Is there a simple way ?</p>
<p>I have used this technique successfully in the past:</p> <p><strong><a href="http://tgrignon.wordpress.com/2007/03/07/using-excel-to-generate-inserts-for-sql-server/" rel="noreferrer">Using Excel to generate Inserts for SQL Server</a></strong></p> <blockquote> <p>(...) Skip a column (or use it for notes) and then ty...
<p>Can't you use VBA code to do the copy from excel and paste into SSMS operations?</p>
40,937
<p>Is there a good way to see what format an image is, without having to read the entire file into memory? </p> <p>Obviously this would vary from format to format (I'm particularly interested in TIFF files) but what sort of procedure would be useful to determine what kind of image format a file is without having to re...
<p>Most image file formats have unique bytes at the start. The unix <code>file</code> command looks at the start of the file to see what type of data it contains. See the Wikipedia article on <a href="http://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_numbers_in_files" rel="noreferrer">Magic numbers in files...
<p>TIFFs will begin with either II or MM (Intel byte ordering or Motorolla).<br> The TIFF 6 specification can be downloaded <a href="http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf" rel="nofollow noreferrer">here</a> and isn't too hard to follow</p>
7,604
<p>Are there, in the canonical Gang of Four list, any design patterns that you often find misused, misunderstood or overused (other than the highly debated Singleton)? In other words, is there a design pattern you would advise to think twice before using? (And why?)</p>
<p>Factory Patterns... </p> <p>I was parachuted into a project before where every single <code>MyObject</code> in the system had an equivalent <code>MyObjectFactory</code> for generating new instances. There was no concept of abstraction or extended classes... just plain old ClassX &amp; ClassXFactory.</p> <p>And no-...
<p>First, "it depends" on the language - some structures in some languages lessen the need for certain design patterns.</p> <p>Second, part of the template for the concept of a <a href="http://en.wikipedia.org/wiki/Design_pattern_(computer_science)#Documentation" rel="nofollow noreferrer">Design Pattern</a> from the s...
31,367
<p>We have a page that lets users upload a file using the asp:FileUpload control. When the user tries to submit the form the get a client side javascript error "htmlFile: access denied".</p> <p>This only happens in IE 7 (not sure about 6) and FF is OK.</p> <p>Apparently this is due to a security setting that was int...
<p>Thanks guys. I managed to work back through 20 days of changesets until I found the culprit - an onload event handler on the body tag. Ive blogged about it here: <a href="http://jonesie.net.nz/htmlFileAccessDeniedADefenceForMurder.aspx" rel="nofollow noreferrer">http://jonesie.net.nz/htmlFileAccessDeniedADefenceFo...
<p>The only solution I have discovered it to write custom client side JavaScript to validate the the user didn't enter/choose a relative path. There is a Microsoft KB article about it <a href="http://support.microsoft.com/kb/892442" rel="nofollow noreferrer">here</a>.</p>
35,866
<p>We currently have a heated internal debate as to whether the actual .NET assembly name should include the code's version number (e.g. CodeName02.exe or CompanyName.CodeName02.dll). Does anyone know of an authoritative source, like Microsoft, that provides guidance on this issue?</p>
<p>This is what the Properties/AssemblyInfo.cs file is for.</p> <p>There are two versions within that file, the file version and the assembly version:</p> <pre><code>[assembly: AssemblyVersion("1.1.0.256"] [assembly: AssemblyFileVersion("1.1.0.256")] </code></pre> <p>Once these are set you can use them to track the ...
<p>The version information can be contained in assemblyInfo file and can then be queried via reflection etc.</p> <p>Some vendors include the version number in the name to make it easier to see at a glance what it is. The Microsoft dll names dont contain a version number in framework directory.</p>
39,971
<p>Let's say, I want to print a box for putting game tokens in.</p> <p>It is an empty cube, but the top layer is missing.</p> <p>I do not need full walls. It could have holes in it resulting in a mesh structured wall, like a fence or a shopping cart.</p> <p>What pattern should I use for the best object stability and pr...
<p>Holes in vertical walls will make it take significantly <em>more</em> time to print, not less. Rather than being able to make a continuous path around the box on each layer, keeping the print head at the desired speed the whole time, the printer will have to run around each connected component of the layer separatel...
<p>Definitely the speed will be worse after adding holes (or the quality otherwise, if object's skin is printed fast), though some filament savings may appear.</p> <p>But regarding &quot;object stability&quot;: because adding holes will normally cause the slower printing (because of &quot;skin structures&quot; around h...
1,828
<p>There's been a cluster of Perl-hate on Stack Overflow lately, so I thought I'd bring my "<a href="http://use.perl.org/~brian_d_foy/journal/32556" rel="nofollow noreferrer">Five things you hate about your favorite language</a>" question to Stack Overflow. Take your favorite language and tell me five things you hate a...
<p>Five things I hate about Java:</p> <ul> <li>No first-class functions.</li> <li>No type inference.</li> <li>Lack of sane defaults in eg graphics.</li> <li>NullPointerException not containing more information about what is null.</li> <li>The proliferation of pointlessly "configurable" frameworks/service provider inte...
<p>Perl represents a horrid language.</p> <ol> <li>No "public" or "private" or "protected" declarations/definitions.</li> <li>The "my $variable_name;" does not declare a global outside of a subroutine.</li> <li>The "my $variable_name;" gets accessed by subroutines but "use strict;" or other "use " creates warnings.</l...
35,753
<p>We have a .NET object that does a lot of reading/writing with the database. Throughout the life cycle of this object (or the asp page that uses it), it may hit the database with a query/update anywhere from 1 to 10 times. </p> <p>Instead of opening and closing a database connection every time the object needs to hi...
<p>Open an close the connection as needed. ADO.NET has built in connection pooling that works. You will not notice any performance issues unless you are doing this in a loop with thousands of open/closes.</p> <p><em>edit</em> See <a href="https://stackoverflow.com/questions/247247/should-i-persist-a-sqlconnection-in...
<p>Even when ado.net does NOT actually close the connection, when you do: Conn.Close() it executes "sp_reset_connection" at the server, even when sp_reset_connection is a lightweight store procedure, it generate some network traffic. So for example, i would not recommend closing and opening the connection inside a loop...
43,405
<p>I guess this is an odd one, and the answer is most likely it is not possible since it would represent a security breach; but I am looking for a way - if any - to get a screendump of content inside the browser. I don't need the entire window, but actually just need to dump the rendered state of an tag. It need to be...
<p>It cannot be done (yet) in pure JavaScript.</p> <p>As a side-note, if your goal is to make rendering tests, you could try instantiating the target browsers within a hosted environment (i.e. host Internet Explorer in a WinForms application and get a screenshot of the rendered content) - this will show the Silverligh...
<p>If you don't need an actual screen shot, you can grab the innerHTML of your content and send it back to the server via Ajax, stash it somewhere and view it remotely.</p>
21,926
<p>In .net frameworks 1.1, I use </p> <pre><code>System.Configuration.ConfigurationSettings.AppSettings["name"]; </code></pre> <p>for application settings. But in .Net 2.0, it says ConfigurationSettings is obsolete and to use ConfigurationManager instead. So I swapped it out with this:</p> <pre><code>System.Configu...
<p>You have to reference the System.configuration assembly (note the lowercase)</p> <p>I don't know why this assembly is not added by default to new projects on Visual Studio, but I find myself having the same problem every time I start a new project. I always forget to add the reference.</p>
<p>You are missing the reference to System.Configuration.</p>
5,167
<p>I'm learning about DDD, and have come across the statement that "value-objects" should be immutable. I understand that this means that the objects state should not change after it has been created. This is kind of a new way of thinking for me, but it makes sense in many cases.</p> <p>Ok, so I start creating immutab...
<p>Use a builder:</p> <pre><code>public class Entity { public class Builder { private int _field1; private int _field2; private int _field3; public Builder WithField1(int value) { _field1 = value; return this; } public Builder WithField2(int value) { _field2 = value; return this; } ...
<p>I have been boggled with the same question as complex constructors is also bad design to me. I am also not a big fan of the builder concept as it seems like too much extra code to maintain. What we need is popsicle immutability, which means that an object starts out as mutable where you are allowed to use the proper...
46,291
<p>I am implementing a Comment box facility in my application which user can resize using mouse. This comment box contains a scrollpane which instead contains a <code>JEditorPane</code> in which user can insert comment. I have added the editor pane inside a scroll pane for the following reason:</p> <p><a href="https:/...
<p>I realise this is long since answered, but for future reference all you need to do is override the <code>getScrollableTracksViewportWidth()</code> to always return true, eg.</p> <pre><code>JEditorPane pane = new JEditorPane() { public boolean getScrollableTracksViewportWidth() { return true; } }; pa...
<p>Decreasing the size of a JEditorPane in a JScrollPane and then reducing it, is not possible. You may want to use a JTextArea instead.</p>
35,407
<p>When you create a new web user control in visual studio it by default adds the Page_Load event. What is the advantage to using this rather than overriding the base <code>OnLoad</code> event on the control? Is it just that the <code>Page_Load</code> event fires before <code>OnLoad</code>?</p>
<p>The <code>OnLoad</code> method should be the place where the <code>Load</code> event is raised. I personally always try to handle the event unless I need to do extra processing around raising the event.</p> <p>I recommend handling the event itself under normal circumstances.</p>
<p>Even though you're inheriting from <code>UserControl</code>, I think you should stay away from overriding the protected methods if you don't have to. The <code>Page_Load</code> is there to make it easier for you to add the code that's specific to your <code>UserControl</code>.</p> <p>Only override <code>OnLoad</cod...
17,701
<p>I've downloaded the source for SubSonic via SVN. When I try to open the project in Visual Studio 2008, it converts the solution, loads all the projects then disappears without an error message. Subsequent loads of the solution do the same. If I run devenv /safemode and then open the project it works fine, but I can'...
<p>This was a conflict with PowerCommands (see <a href="https://stackoverflow.com/questions/134131/aspnet-mvc-ctp5-crashing-ide">ASP.NET MVC CTP5 Crashing IDE</a>)</p>
<p>This was a conflict with PowerCommands (see <a href="https://stackoverflow.com/questions/134131/aspnet-mvc-ctp5-crashing-ide">ASP.NET MVC CTP5 Crashing IDE</a>)</p>
28,672
<p>For a new project with Flash I was looking for something along the lines of standard libraries for basic programming needs, along the lines of Python or Ruby standard libraries. But the only thing I found was a dead project on Sourceforge.</p> <p>Thus is there no standard library for flash? Does everyone reinvent t...
<p>The basic libraries are <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/" rel="nofollow noreferrer">built into flash</a>. Then on top of that there is <a href="http://www.adobe.com/products/flex/" rel="nofollow noreferrer">flex</a>, which gives you an entire RIA framework. Then there are 3rd party...
<p>Assuming I understand your question correctly, <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/" rel="nofollow noreferrer">the Flash Player API</a> is the "standard library" for Flash applications (the <code>flash.*</code> packages).</p> <p>For more application programming -oriented libraries, th...
23,165
<p>Is the edit control I'm typing in now, with all its buttons and rules freely available for use? </p> <p>My web project is also .Net based.</p>
<p>It's the <a href="http://wmd-editor.com/" rel="nofollow noreferrer">WMD</a> Markdown editor which is free and seems to be pretty easy to use. Just include the javascript for it and (in the easiest case), it just attaches to the first textarea it finds.</p> <p>Here's some info about the <a href="http://daringfireba...
<p>The <a href="http://wmd-editor.com/" rel="nofollow noreferrer">WMD editor</a> is completely free (in the speech and beer senses of the word). It's available under an MIT-style license.</p>
7,502
<p>I have an account on WHM for a PHP web app that's over 50GB in size on a dedicated server, the company decided to move it to a new server, and I was assigned the task.</p> <p>I would like to know what is the best way to do it, built-in WHM <strong>copy account</strong> function, or creating full backup and restore ...
<p>I assume these 50GB are mostly data, am I right?. So I would first create a backup of the application scripts and deploy them in the new site and make sure everything is running smoothly. Then I see no problem in using the copy account function, since the data transfer between servers is usually way faster than you ...
<p>As far as I remember, the account copy function just gzips up your account folder and everything inside, so you might as well use this method as it is likely the same as what you would do manually.</p> <p>Do make sure you check everything works fine after moving though. It is sometimes a good idea to restrict acces...
49,253
<p>Has anybody used a good obfuscator for PHP? I've tried some but they don't work for very big projects. They can't handle variables that are included in one file and used in another, for instance.</p> <p>Or do you have any other tricks for stopping the spread of your code?</p>
<p><strike>You can try <a href="http://www.phpprotect.info/" rel="noreferrer">PHP protect</a> which is a free PHP obfuscator to obfuscate your PHP code.<br> It is very nice, easy to use and also free.</strike> <em>EDIT: This service is not live anymore.</em></p> <p>As for what others have written here about not using ...
<p>Obfuscation is only adding another layer of potential bugs and security vulnerabilities to your program. Please don't do it.</p> <p>The kind of people who write obfuscation software usually seem very sketchy and non-skilled anyway.</p> <p>If your code is "great", crackers will go through great lengths to spread it...
28,803
<p>How do you combine two jQuery search results? eg:</p> <pre><code>var $allFoos = $('.foo'), $allBars = $('.bar') $allFoosAndBars = $allFoos + $allBars; </code></pre> <p>Obviously, I just made up that last line, but I hope it makes it sorta clear what I mean. To be clear, the example is greatly simplified, a...
<p>You can use <a href="https://api.jquery.com/add/" rel="noreferrer">add()</a>;</p> <pre><code>var $foos = $('.foo'); var $foosAndBars = $foos.add('.bar'); </code></pre> <p>or</p> <pre><code>var $allFoosAndBars = $allFoos.add($allBars); </code></pre>
<p>Another solution is to use <a href="https://api.jquery.com/jquery.merge/" rel="noreferrer">jQuery.merge()</a> <em>(jQuery &gt; 1.0)</em></p> <blockquote> <p>Description: Merge the contents of two arrays together into the first array.</p> </blockquote> <p>So you could simply use it to merge both result :</p> <pre><co...
41,941
<p>Is there a difference (performance, overhead) between these two ways of merging data sets?</p> <pre><code>MyTypedDataSet aDataSet = new MyTypedDataSet(); aDataSet .Merge(anotherDataSet); aDataSet .Merge(yetAnotherDataSet); </code></pre> <p>and</p> <pre><code>MyTypedDataSet aDataSet = anotherDataSet; aDataSet .Merge(...
<p>Those two lines do different things.</p> <p>The first one creates a new set, and then merges a second set into it.</p> <p>The second one sets the ds reference to point to the second set, so:</p> <pre><code>MyTypedDataSet ds1 = new MyTypedDataSet(); ds1.Merge(anotherDataSet); //ds1 is a copy of anotherDataSet ds1....
<p>Your second example does <strong>not</strong> create a new dataset. It's just a second <em>reference</em> to an existing dataset.</p>
8,085
<h3>(ANSWER) How to export some Geography data from a Microsoft Sql Server 2008.</h3> <p>You'll need to use the command line argument BCP to dump the data in it's original (native) format to a binary file. Then on the other server you can bulk insert this binary data back into a table of the same strucutre.</p> <p>he...
<p>I originally removed the question in the opening post, to replace it with the answer (at the end of '08) ... and make it a wiki.</p> <p>So yeah .. the OP is the answer :P</p>
<p>bulk insert error!!! Msg 6522, Level 16, State 1, Line 1 A .NET Framework error occurred during execution of user-defined routine or aggregate "geometry": </p>
35,792
<p>Is accessing a <strong>bool</strong> field atomic in C#? In particular, do I need to put a lock around:</p> <pre><code>class Foo { private bool _bar; //... in some function on any thread (or many threads) _bar = true; //... same for a read if (_bar) { ... } } </code></pre>
<p><strong>Yes.</strong></p> <blockquote> <p>Reads and writes of the following data types are atomic: bool, char, byte, sbyte, short, ushort, uint, int, float, and reference types. </p> </blockquote> <p>as found in <a href="https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/va...
<p>the approach I have used, and I think is correct, is</p> <pre><code>volatile bool b = false; .. rarely signal an update with a large state change... lock b_lock { b = true; //other; } ... another thread ... if(b) { lock b_lock { if(b) { //other stuff b = false; ...
8,398
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/219594/net-whats-the-best-way-to-implement-a-catch-all-exceptions-handler">.NET - What’s the best way to implement a “catch all exceptions handler”</a> </p> </blockquote> <p>I have a .NET console app app that i...
<p>Contrary to what some others have posted, there's nothing wrong catching all exceptions. The important thing is to handle them all appropriately. If you have a stack overflow or out of memory condition, the app should shut down for them. Also, keep in mind that OOM conditions can prevent your exception handler from ...
<p>it doesn't hurt to use both AppDomain.CurrentDomain.UnhandledException Application.ThreadException</p> <p>but keep in mind that exceptions on secondary threads are not caught by these handlers; use <a href="http://www.codeproject.com/KB/threads/SafeThread.aspx" rel="nofollow noreferrer">SafeThread</a> for ...
10,823
<p>My WinForms application has a tab with a <code>System.Windows.Forms.WebBrowser</code> control. There are several controls that set the WebBrowser's <code>.Url</code> property, and when the form repaints it calls the WebBrowser's <code>.Refresh(WebBrowserRefreshOption.Completely)</code> method.</p> <p>Occasionally, ...
<p>Unless you're doing something very special, it doesn't make sense to force the WB to repaint itself. Since it is its own control and has its own Handle, it is quite capable of repainting itself whenever it deems necessary. Since you are forcing it to repaint at a moment that's completely out of sync with its Ready...
<p>Try adding an event handler to your code that runs when the "DocumentCompleted" event fires. Then add your refresh code in there. There are some examples of code here in MSDN. If you do it this way you won't lose any time guessing if the page has loaded, and can continue processing as soon as it is ready.</p> <p><a...
29,177
<p>I have a list of objects implementing an interface, and a list of that interface:</p> <pre><code>public interface IAM { int ID { get; set; } void Save(); } public class concreteIAM : IAM { public int ID { get; set; } internal void Save(){ //save the object } //other staff for this ...
<p>I think you don't understand what an interface is for. Interface is a <strong>contract</strong>. It specifies that an object behaves in a certain way. If an object implements an interface, it means that you can rely on it that it has all the interface's methods implemented.</p> <p>Now, consider what would happen if...
<p>I was wondering on the same issue here, and stumbled upon this question...</p> <p>As i thought on this, i understood i don't need the <em>internal</em> method in the Interface in the first place.</p> <p>I can access it through my Concrete Class, and leave the Contract for the Out-Side code.</p> <p>In your exampl...
47,960
<p>Can somebody suggest a good <strong>free</strong> tool for analyzing .Net memory dumps other than Adplus/windbg/sos ?</p>
<p>You can <a href="http://blogs.msdn.com/vijaysk/archive/2007/11/15/sos-your-visual-studio.aspx" rel="nofollow noreferrer">load sos</a> and your memory dump into Visual Studio to at least insulate you from the 'interesting' ui that WinDbg presents. </p>
<p>I fully recommend .Net Memory Profiler. Beside being a great live memory profiler for .Net applications, it can also load memory dumps, and let you traverse the objects in the dump in a very intuitive an easy way.</p> <p>Opening big dump (> 1 GB) can take a few hours though, but for us it's worth the wait. I don't ...
7,053
<p>I have a user account 'member center' that shows all of a customer's subscriptions and memberships that they have with my company. This is at <code>https://secure.1.example/membercenter/</code>.</p> <p>I have another site which is the actual member site. This is at <code>http://www.2.example/</code>. ( each site on ...
<p>All someone needs to do is intercept the URL with the hash and they have access to your system. You really should pass the hash over SSL using HTTP POST.</p>
<p>If the attacker knows that the user is about to log in, the attacker can generate the hash (or a series of hashes with slightly different timestamps) and log in before the user does so. A slightly better solution is to replace the hash with a randomly generated token. Then the attacker will have to intercept the use...
28,285
<p>After trying to setup my site for Google Webmaster Tools I found that my Custom ASP.NET 404 page was not returning the 404 status code. It displayed the correct custom page and told the browser that everything is OK. This is consider a soft 404 or false 404. Google doesn't like this. So I found many articles on the ...
<p><strong>Solution:</strong></p> <p>The problem, it turned out, was the use of the master page. I got it to work by setting the status code later in the pages lifecycle, obviously the rendering of the master page was resetting it, so I overrode the render method and set it after the render was complete.</p> <pre><co...
<p>You can use the below code:</p> <pre><code> Response.TrySkipIisCustomErrors = True Response.Status = "404 Not Found" Response.AddHeader("Location", "{your-path-to-your-404-page}") </code></pre>
45,186
<p>Normally I would just use:</p> <pre><code>HttpContext.Current.Server.UrlEncode("url"); </code></pre> <p>But since this is a console application, <code>HttpContext.Current</code> is always going to be <code>null</code>.</p> <p>Is there another method that does the same thing that I could use?</p>
<p>Try this!</p> <pre><code>Uri.EscapeUriString(url); </code></pre> <p>Or</p> <pre><code>Uri.EscapeDataString(data) </code></pre> <p>No need to reference System.Web.</p> <p><strong>Edit:</strong> Please see <a href="https://stackoverflow.com/a/34189188/7391">another</a> SO answer for more...</p>
<p>Best thing is to Add Reference to System.web..dll</p> <p>and use var EncodedUrl=System.Web.HttpUtility.UrlEncode("URL_TEXT");</p> <p>You can find the File at <a href="http://originaldll.com/download/11019.dll" rel="nofollow noreferrer">System.web.dll</a></p>
3,553
<p>I'm trying to make a BEA Portal website XHTML compliant, because this has been written in the contract with the client, and I'm stuck on this problem: BEA renders <code>&lt;meta&gt;</code> and <code>&lt;link&gt;</code> tags without the closing slash, i.e. <code>&lt;link/&gt;</code> and <code>&lt;meta/&gt;</code> as ...
<p>When starting any tests, Rails first loads any fixtures you have (in test/fixtures) and recreates the database with them.</p> <p>20-30 seconds sounds <em>very</em> slow though. Do you have a lot of fixtures that need to be loaded before your tests run, or is your database running slow?</p>
<p>It seems like Test::Unit is the simplest, but also one of the slowest ways to do unit testing with Ruby. One of alternatives is <a href="http://rubyforge.org/projects/zentest/" rel="nofollow noreferrer">ZenTest</a>.</p>
41,855
<p>Is there any way to edit column names in a DataGridView?</p>
<p>You can also change the column name by using:</p> <pre><code>myDataGrid.Columns[0].HeaderText = "My Header" </code></pre> <p>but the <code>myDataGrid</code> will need to have been bound to a <code>DataSource</code>.</p>
<p>Try this</p> <pre><code>myDataGrid.Columns[0].HeaderText = "My Header" myDataGrid.Bind() ; </code></pre>
15,287
<p>In Ruby:</p> <pre><code>for i in A do # some code end </code></pre> <p>is the same as: </p> <pre><code>A.each do |i| # some code end </code></pre> <p><code>for</code> is not a kernel method:</p> <ul> <li>What exactly is "<code>for</code>" in ruby</li> <li>Is there a way to use other keywords to do simila...
<p>It's almost syntax sugar. One difference is that, while <code>for</code> would use the scope of the code around it, <code>each</code> creates a separate scope within its block. Compare the following:</p> <pre><code>for i in (1..3) x = i end p x # =&gt; 3 </code></pre> <p>versus</p> <pre><code>(1..3).each do |i|...
<p>For is just syntactic sugar.</p> <p>From <a href="http://www.rubycentral.com/pickaxe/tut_expressions.html#UK" rel="noreferrer">the pickaxe</a>:</p> <blockquote> <p><strong>For ... In</strong></p> <p>Earlier we said that the only built-in Ruby looping primitives were while and until. What's this ``for'' thin...
18,805
<p>The page <em><a href="http://www.codinghorror.com/blog/archives/001167.html" rel="noreferrer">Protecting Your Cookies: HttpOnly</a></em> explains why making HttpOnly cookies is a good idea.</p> <p>How do I set this property in Ruby on Rails?</p>
<p>Set the 'http_only' option in the hash used to set a cookie</p> <p>e.g. <pre>cookies["user_name"] = { :value => "david", :httponly => true }</pre></p> <p>or, in Rails 2:</p> <p>e.g. <pre>cookies["user_name"] = { :value => "david", :http_only => true }</pre></p>
<p>I also wrote a patch that is included in Rails 2.2, which defaults the CookieStore session to be http_only. </p> <p>Unfortunately session cookies are still by default regular cookies.</p>
9,788
<h1>Problem</h1> <p>At work we have a department wiki (running <a href="http://www.mediawiki.org/" rel="noreferrer">Mediawiki</a>). Unfortunately several persons edit without logging in, and that makes it very difficult to track down editors to ask questions about the content.</p> <p>There are two strategies to impro...
<p>You can <a href="http://www.thejackol.com/2007/02/16/disable-anonymous-editing-in-mediawiki/" rel="noreferrer">Turn off Anonymous Editing</a> in Mediawiki like so:</p> <ul> <li><p>Edit LocalSettings.php and add the following setting:</p> <pre><code>$wgDisableAnonEdit = true; </code></pre></li> <li><p>Edit includes...
<p>You said this is in a departmental situation. Can't you add a feature to the wiki where it makes an educated guess as to who is editing based on the IP address, and annotates the edit accordingly?</p>
49,960
<p>I have the same problem as described in the posts listed below. That is, certain keys don't work at all when I type them into my combobox until I first hit the spacebar. One of the keys is ".", but another is the letter "Q", and there are others: "$", "%". </p> <p><a href="http://forums.microsoft.com/msdn/Show...
<p>By any chance, have you already solved your problem?</p> <p>I have the same problem as yours, my custom control for DataGridView cannot receive letter Q, period, dollar, single quote, percent, etc.</p> <p>I was able to solve the problem by changing the "switch .. default: return false" to "switch .. default: retur...
<p>Partial answer to my question. In the Combobox I handle the KeyDown, TextChanged, and KeyUp events, which fire in that order. If I go from KeyDown to KeyUp with TextChanged skipped, I check whether the character was a Keys.Q or Keys.OemPeriod. (I'm not sure it's safe to others, like shift/D1, shift/D2, etc...). ...
24,665
<p>I try to fetch a Wikipedia article with Python's urllib:</p> <pre><code>f = urllib.urlopen("http://en.wikipedia.org/w/index.php?title=Albert_Einstein&amp;printable=yes") s = f.read() f.close() </code></pre> <p>However instead of the html page I get the following response: Error - Wikimedia Foundation:</...
<p>You need to use the <a href="http://docs.python.org/lib/module-urllib2.html" rel="nofollow noreferrer">urllib2</a> that superseedes <a href="http://docs.python.org/lib/module-urllib.html" rel="nofollow noreferrer">urllib</a> in the <a href="http://docs.python.org/lib/" rel="nofollow noreferrer">python std library</a...
<pre><code>import urllib s = urllib.urlopen('http://en.wikipedia.org/w/index.php?action=raw&amp;title=Albert_Einstein').read() </code></pre> <p>This seems to work for me without changing the user agent. Without the "action=raw" it does not work for me.</p>
14,602
<p>I am a complete beginner so I apologise ahead for probably an obvious question. From what I understand up to now, slicer software basically takes a 3D model and turns it into instructions that say move your print head to this and this position and extrude up to this position and so forth. If that is correct then eac...
<p>Your printer will stop printing. So no.</p>
<p>Disconnecting the USB or connecting it triggers a reboot in the printer. As a result, you can not disconnect or turn off the print server running OctoPrint.</p>
1,817
<p>I want to create an Ant buildfile, that includes some files as a sort of plugin.</p> <p>So if I want to activate a feature in a project - say pmd-checking - I copy a pmd.xml in a directory and the build.xml get on the start the idea, that pmd.xml exists and imports it, so that new targets can be available to the bu...
<p>It's not explicitly stated in the import task documentation, but the task accepts a fileset as an alternative to a single file. Hence this, at the top level, should do the trick, and targets created are listed by <code>ant -p</code>:</p> <pre><code>&lt;property name="plugins.dir" value="plugins" /&gt; &lt;fileset i...
<p>I'm not sure want you want is conceptually possible. The <code>-p</code> command-line argument doesn't execute any tasks, it just parses the file. What you want would require something to be executed.</p> <p>But, I'd give the <a href="http://ant-contrib.sourceforge.net/" rel="nofollow noreferrer">ant-contrib</a> pr...
36,312
<p>Mac OS X ships with apache pre-installed, but the files are in non-standard locations. This question is a place to collect information about where configuration files live, and how to tweak the apache installation to do things like serve php pages.</p>
<p>Apache Config file is: /private/etc/apache2/httpd.conf</p> <p>Default DocumentRoot is: /Library/Webserver/Documents/</p> <p>To enable PHP, at around line 114 (maybe) in the /private/etc/apache2/httpd.conf file is the following line:</p> <pre><code>#LoadModule php5_module libexec/apache2/libphp5.so </code></pr...
<p>httpd.conf is in /private/etc/apache2</p> <p>Enable PHP by uncommenting line:</p> <pre><code> LoadModule php5_module libexec/apache2/libphp5.so </code></pre>
9,518
<p>I'm specifically interested in tools that can be plugged into Vim to allow CScope-style source browsing (1-2 keystroke commands to locate function definitions, callers, global symbols and so on) for languages besides C/C++ such as Java and C# (since Vim and Cscope already integrate very well for browsing C/C++). I'm...
<p>CScope does work for Java.</p> <p>From <a href="http://cscope.sourceforge.net/cscope_vim_tutorial.html" rel="nofollow noreferrer">http://cscope.sourceforge.net/cscope_vim_tutorial.html</a>:</p> <blockquote> <p>Although Cscope was originally intended only for use with C code, it's actually a very flexible tool ...
<p>This may be what you're looking for:</p> <p><a href="http://www.vim.org/scripts/script.php?script_id=1783" rel="nofollow noreferrer">http://www.vim.org/scripts/script.php?script_id=1783</a></p> <p>You can also mimic some CScope functionality in your own .vimrc file by using the various flavors of <a href="http://v...
9,118
<p>I'm trying to figure out how to restrict access to a page unless the page is navigated to from a specific "gate" page. Essentially I want the page to be unaccessible unless you're coming from the page that comes before it in my sitemap. I'm not certain this is even possible. If possible, can you limit your suggestio...
<blockquote> <p>If possible, can you limit your suggestions to using either html or javascript?</p> </blockquote> <p>No. <strong>Because there is no secure way</strong> using only these two techniques. Everything that goes on on the client side may be manipulated (trivially easy). If you want to be sure, you have to...
<p>With javascript name a variable called "previous" and set its value to document.referrer. Then execute a condition to determine if the referrer is the proper page, and if not, redirect them</p>
31,803
<p>I need to take production data with real customer info (names, address, phone numbers, etc) and move it into a dev environment, but I'd like to remove any semblance of <em>real</em> customer info.</p> <p>Some of the answers to <a href="https://stackoverflow.com/questions/157600/data-generators-for-sql-server">this ...
<p>Anonymizing data can be tricky and if not done correctly can lead you to trouble, like what happened to <a href="http://en.wikipedia.org/wiki/AOL_search_data_scandal" rel="noreferrer">AOL when they released search data a while back</a>. I would attempt to create test data from scratch at all costs before I tried to ...
<p>There are a couple of tools out there to remove sensitive data from databases that I've found. Note that I haven't tried any of them myself:</p> <ul> <li><a href="https://github.com/sunitparekh/data-anonymization" rel="nofollow noreferrer">Data::Anonymization</a>, a RubyGem.</li> <li><a href="https://github.com/dav...
32,535
<p>Hopefully I haven't misunderstood the meaning of "duck typing", but from what I've read, it means that I should write code based on how an object responds to methods rather than what type/class it is.</p> <p>Here's the code:</p> <pre><code>def convert_hash(hash) if hash.keys.all? { |k| k.is_a?(Integer) } ret...
<p>How you write this method should depend on whether you expect an exception to be thrown during the course of normal program execution. If you want a readable exception message because an end-user might see it, then throwing one manually makes sense. Otherwise, I'd just do something like this:</p> <pre><code>def c...
<blockquote> <p>What I want is to make sure that I end up with a hash where the keys are an integer representing the ID of an ActiveRecord object.</p> </blockquote> <p>You should probably check for that when you're creating/inserting into the hash. You could try something like this:</p> <pre> h = {} def h.put obj ...
25,708
<p>I have an issue with Visual Studio 2005 w/ TFS where, from time to time, the Solution Explorer will stop responding to interaction. Instead it does the beep, like I'm trying to click on a parent window with a modal dialog visible, but there isn't one. The only thing I've found to do so far, is to restart VS, but t...
<p>If VS Editor lockdown is accompanied by creation of <strong>Setup.exe</strong> process that never finishes (visible in the task manager), then this is an issue with Microsoft Office 2007 components.</p> <p>The solution that has worked for me - reinstalling Microsoft Office 2007. <a href="http://abdullin.com/journal...
<p>Try unbinding your solution from source control. You can use the command line TFS tool ("tf") to do the same actions and it should prevent VS from freezing up due to high latency connections / drops, to TFS.</p>
28,117
<p>I just installed my (v3) BLTouch with a vanilla version of Marlin (1.1.9) on my Ender 3 and everything seems to work fine (including auto home) except the probing. It repeatedly does the first three probes (successfully) but then tries the fourth and fails. Even when disabling the axis movement (X/Y stepper motors) ...
<p>Is your BL Touch a v3 (likely if you've only just purchased it)? If so, make sure you're using the bugfix version of Marlin 1.1.9, which supposedly fixes the compatibility issues. I say supposedly because there's also a capacitor on the mainboard that can be removed to fix the issue, and once I removed it (and comme...
<p>I've been through the <a href="/q/6959">same sort of issues</a> and eventually found that it was attributed by the cable and connector. Re-check or re-wire the sensor, this helped me out.</p>
1,371
<p>I've been interacting with Amazon S3 through <a href="https://addons.mozilla.org/en-US/firefox/addon/3247" rel="noreferrer">S3Fox</a> and I can't seem to delete my buckets. I select a bucket, hit delete, confirm the delete in a popup, and... nothing happens. Is there another tool that I should use?</p>
<p>It is finally possible to delete all the files in one go using the new Lifecycle (expiration) rules feature. You can even do it from the AWS console.</p> <p>Simply right click on the bucket name in AWS console, select "Properties" and then in the row of tabs at the bottom of the page select "lifecycle" and "add rul...
<p>Use the amazon web managment console. With Google chrome for speed. Deleted the objects a lot faster than firefox (about 10 times faster). Had 60 000 objects to delete.</p>
4,693
<p>Working with Mircosoft Office Sharepoint Server 2007 (standard edition) what is the best way to place a site collection being developed under version control? We're using Subversion for all our other (non-sharepoint) projects but I'm just not sure how to approach MOSS.</p> <p>What needs to be placed under version ...
<p>Source control isn't just backup and source control isn't necessarily meant to be a backup solution. It's all about being able to do diffs of text files, collaborative development, branching and merging.</p> <p>If the goal is disaster recovery, then get an empty server and start enumerating all the bits you had to...
<p>The question is sort of vague has you do not mention how you develop it. If you're just doing out of the box modifications on a site collection via the interface you have available in sharepoint it sounds like you need to do some kind of "backup". I don't think you can export a site collection as a template :P</p> ...
25,943
<p>I have a desktop (winforms) application that uses a Firebird database as a data store (in embedded mode) and I use NHibernate for ORM. One of the functions we need to support is to be able to import / export groups of data to/from an external file. Currently, this external file is also a database with the same sch...
<p>I found the answer to my own question: The key is the ISession.Replicate method. This allows you to copy object graphs between data stores and keep the same identifier. To create new identifiers, I think I can use ISession.Merge, but I still have to verify this.</p> <p>There are a few caveats though: my test clas...
<p>You can use <a href="http://www.firebirdfaq.org/fbcopy.php" rel="nofollow noreferrer">FBCopy</a> for this. Just define which tables and columns you want copied and I'll do the job. You can also add optional WHERE clause for each table, so it only copies the rows you want.</p> <p>While copying it makes sure the orde...
31,723
<h2>Background</h2> <p>I am writing and using a very simple CGI-based (Perl) content management tool for two pro-bono websites. It provides the website administrator with HTML forms for events where they fill the fields (date, place, title, description, links, etc.) and save it. On that form I allow the administrator ...
<p>Armin Ronacher has the correct idea. The problem is random strings can collide. I would use:</p> <pre><code>&lt;img src="picture.jpg?1222259157.415" alt=""&gt; </code></pre> <p>Where "1222259157.415" is the current time on the server.<br> Generate time by Javascript with <code>performance.now()</code> or by Python...
<p>I made a PHP script that automatically appends the timestamps on all images and also on links. You just need to include this script in your pages. Enjoy!</p> <p><a href="http://alv90.altervista.org/how-to-force-the-browser-not-to-cache-images/" rel="nofollow noreferrer">http://alv90.altervista.org/how-to-force-the-b...
15,421
<p>I am working on a project that uses the asp.net ajax control toolkit and all my callback requests are hanging till the request times out. When I step through the code all my code executes then the hanging occures. Right now I am looking for possible reasons why this might happen.</p>
<p>If the request takes significant time, it is possible that the client-side AJAX request is timing out before your server-side code completes. At that point the client has dropped the connection and the server can no longer communicate with it. Can you look into increasing the timeout value on the client to somethi...
<p>Firewall or NAT? Something on the network might be blocking return calls from getting back to you.</p>
46,224
<p>We would like to have several internal web applications which use the same master page. Is there a way to store a master page in a common library referenced by all projects?</p>
<p>You can do this, but it is difficult and has quite a few drawbacks.</p> <p>This process is similar to packaging up user controls as well. Basically you have a web application project that contains your master page. You can precompile this into a set of dlls using aspnet_compiler.</p> <p>then you can use ilmerge....
<p>I've heard this works, I haven't tested it.</p> <p>Create a separate project to house your master pages, since all master pages are like user controls and built into their own separate assembly. Run the build and try referencing the assembly of the master page.</p> <p>Again, not tested, just something I've read be...
30,659
<p>Where I work, the design and development departments are totally separated, however we (the design department) are responsible for managing the CSS for our sites. Typically, new CSS needs to be released to the production server far more often than new website code. Because of this, we are deploying the CSS separatel...
<p>I'll advocate the use of source control here. Especially if the development team uses branching to deal with structured releases. That way, whatever CSS is checked into the production branch is what should be deployed ... and if it is updated mid-stream, it's the responsibility of the person (designer?) that updat...
<p>The fancy name is "Content Delivery Network" <a href="http://en.wikipedia.org/wiki/Content_Delivery_Network" rel="nofollow noreferrer">(Wikipedia)</a>.</p> <p>We store our CSS files in a database, and then have a separate website that does nothing but serve CSS resources. We implemented this in May 2007 for 1000+ w...
7,625
<p>How do you stop race conditions in MySQL? the problem at hand is caused by a simple algorithm:</p> <ol> <li>select a row from table</li> <li>if it doesn't exist, insert it</li> </ol> <p>and then either you get a duplicate row, or if you prevent it via unique/primary keys, an error.</p> <p>Now normally I'd think t...
<p>what you want is <a href="http://dev.mysql.com/doc/refman/5.0/en/lock-tables.html" rel="noreferrer">LOCK TABLES</a></p> <p>or if that seems excessive how about <a href="http://dev.mysql.com/doc/refman/5.0/en/insert.html" rel="noreferrer">INSERT IGNORE</a> with a check that the row was actually inserted.</p> <block...
<p>I ran into the same problem and searched the Net for a moment :)</p> <p>Finally I came up with solution similar to method to <a href="http://www.dwheeler.com/secure-programs/Secure-Programs-HOWTO/avoid-race.html" rel="nofollow noreferrer">creating filesystem objects in shared (temporary) directories to securely ope...
33,178
<p>I got embroiled in a discussion about DOM implementation quirks yesterday, with gave rise to an interesting question regarding Text.splitText and Element.normalise behaviours, and how they should behave.</p> <p>In <a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html" rel="nofollow norefer...
<p>I was on the DOM Working Group in the early days; I'm sure we <em>meant</em> for textNode to contain the new joined value, but if we didn't <em>say</em> it in the spec, it's possible that <em>some</em> implementation <em>might</em> create a new node instead of reusing textNode, though that would require more work fo...
<p>While it would seem like a reasonable assumption, I agree that it is not explicityly made clear in the specification. All I can add is that the way I read it, one of either <code>textNode</code> or it's new sibling (i.e. return value from <code>splitText</code>) would contain the new joined value - the statement spe...
4,989
<p>I have my main GUI thread, and a second thread running inside it's own ApplicationContext (to keep it alive, even when there is no work to be done). I want to call a method on my 2nd thread from my GUI thread, but if I just call thread.Method(); it seems to be running on my main GUI thread and causes my GUI to becom...
<p>.Net already comes with a <code><a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx" rel="noreferrer">System.ComponentModel.BackgroundWorker</a></code> class specifically to handle performing background tasks and communicating with a GUI. Use it.</p>
<p>Use a synchronization object to signal the thread that it needs to process the new data (or the GUI's new state). One relatively simple way to do this is to use an event object. Here's a run-down of how that would work:</p> <ol> <li>GUI thread an 2nd thread share an event object (so they both know about it)</li> ...
43,429
<p>I'm a member of ACM, and I have limited access to both Books 24x7 and Safari Books Online, however if I was interested in moving up to a full account for greater access to other books what online book service would you recommend?</p>
<p>Safari Books Online is my choice, here's a related post: <a href="https://stackoverflow.com/questions/179447/which-online-ebook-reference-library-do-you-use">Which Online eBook Reference Library Do You Use?</a></p>
<p><a href="http://www.audible.com" rel="nofollow noreferrer">Audible</a> - Self Development, Business and Education sections!</p>
13,449
<p>I develop C++ applications in a Linux environment. The tools I use every day include Eclipse with the CDT plugin, gdb and valgrind.<br> What tools do other people use? Is there anything out there for Linux that rivals the slickness of Microsoft Visual Studio?</p>
<p>I use a bunch of terminal windows. I have vim running on interesting source files, make and g++ output on another for compiler errors or a gdb session for runtime errors. If I need help finding definitions I run cscope and use vim's cscope support to jump around.</p> <p>Eclipse CDT is my second choice. It's nice ...
<p><a href="http://anjuta.sourceforge.net/" rel="nofollow noreferrer">Anjuta</a> is a nice idea that makes Linux C++ dev quite enjoyable as well.</p>
3,792
<p>I'm looking to write a small proxy server for kicks and giggles.</p> <p>Apart from the options in libWWW, can anyone recommend any opensource options for the HTTP server and client code? Thinking of a library of some kind similar to libWWW.</p> <p>Chosen language is C/C++ but open to Java, C#, Python... etc. :-)</...
<p>The ToolStripDropDown control has this functionallity so by inheriting from it we can make a simple PopupWindow.</p> <pre><code>/// &lt;summary&gt; /// A simple popup window that can host any System.Windows.Forms.Control /// &lt;/summary&gt; public class PopupWindow : System.Windows.Forms.ToolStripDropDown { pr...
<p>The reason that your control gets chopped off is because it is a child control of the form that you reside on. Any control on the form must be contained by the form, hence it gets chopped off.</p> <p>I haven't done this in .Net, but had a similar problem in VB6. The solution then was to set the parent of the popup ...
35,530
<p>When using the ObsoleteAtribute in .Net it gives you compiler warnings telling you that the object/method/property is obsolete and somthing else should be used. I'm currently working on a project that requires a lot of refactoring an ex-employees code. I want to write a custom attribute that I can use to mark method...
<p>This is worth a try.</p> <p>You can't extend Obsolete, because it's final, but maybe you can create your own attribute, and mark that class as obsolete like this:</p> <pre><code>[Obsolete("Should be refactored")] public class MustRefactor: System.Attribute{} </code></pre> <p>Then when you mark your methods with t...
<p>There are several comments that suggest to insert warnings or pragma. Obsolete works in a very different way! Marking obsolete a function of a library L, the obsolete message raises when a program calls the function even if the caller program is not in the library L. Warning raises the message ONLY when L is compile...
18,619