instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>Where do the type/member/parameter descriptions that you see in the Intellisense bubble come from? Are they stored in type attributes?</p> <p>EDIT: I'm specifically interested in the built-in types.</p>
<p>The .Net Framework provides an XML documentation file for the shipped assemblies. The IDE reads these documentation files in order to get the descriptions and tooltips for the built-in types. </p> <p>This documentation is typically, but not always, stored in a sub-directory of the framework intsall point. For in...
<p>Although if your classes are compiled and you don't want to publish the source code then you might need to create an XML schema file and place it here. Not to sure about the structure but have a poke around and you'll see what I mean.</p> <p>[install drive]\Program Files (x86)\Microsoft Visual Studio 9.0\Xml\Schema...
23,682
<p>All the recent VisualSVN Server posts made me want to check it out. I have SVN running right now through Apache, but I'd like to try out VisualSVN Server, mostly for the Active Directory integration. Their docs don't describe whether you can easily migrate an existing repository. </p> <p>Anyone done this before?</p...
<p><a href="http://www.visualsvn.com/server" rel="nofollow noreferrer">VisualSVN Server</a> will use your existing SVN repositories with no problems. I have successfully migrated repositories from SVN + Apache to VisualSVN Server on multiple occasions.</p>
<p>There is a VisualSVN Server Knowledge Base article about the case: </p> <p><a href="http://www.visualsvn.com/support/topic/00010/" rel="nofollow noreferrer"><strong>How can I import my existing repository into newly installed VisualSVN Server?</strong></a> </p> <p><img src="https://i.stack.imgur.com/GDcjy.png" wid...
3,386
<p>I have around 3500 flood control facilities that I would like to represent as a network to determine flow paths (essentially a directed graph). I'm currently using SqlServer and a CTE to recursively examine all the nodes and their upstream components and this works as long as the upstream path doesn't fork alot. How...
<p>I know nothing about flood control facilities. But I would take the first facility. And use a temp table and a while loop to generate the path.</p> <p><PRE> -- Pseudo Code TempTable (LastNode, CurrentNode, N)</p> <p>DECLARE @intN INT SET @intN = 1</p> <p>INSERT INTO TempTable(LastNode, CurrentNode, N) -- Inse...
<p>My experiences with storing something like you described in a SQL Server database:</p> <p>I was storing a distance matrix, telling how long does it take to travel from point A to point B. I have done the naive representation and stored them directly into a table called distances with columns A,B,distance,time. </p>...
23,312
<p>I'm currently running into some issues resizing images using GD.</p> <p>Everything works fine until i want to resize an animated gif, which delivers the first frame on a black background.</p> <p>I've tried using <code>getimagesize</code> but that only gives me dimensions and nothing to distinguish between just any...
<p>There is a brief snippet of code in the PHP manual page of the <code>imagecreatefromgif()</code> function that should be what you need:</p> <p><a href="https://php.net/manual/en/function.imagecreatefromgif.php#59787" rel="nofollow noreferrer"><code>imagecreatefromgif</code> comment #59787 by ZeBadger</a></p>
<p>Animated GIF must have the following string </p> <pre><code>"\x21\xFF\x0B\x4E\x45\x54\x53\x43\x41\x50\x45\x32\x2E\x30" </code></pre> <p>I've tested on a few animated gifs and it seem the string is at the pos 781 of a file (found with file_get_contents and strpos)</p>
35,494
<p>How can I remove those annoying Mac OS X <code>.DS_Store</code> files from a Git repository?</p>
<p>Remove existing <code>.DS_Store</code> files from the repository:</p> <pre><code>find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch </code></pre> <p>Add this line:</p> <pre><code>.DS_Store </code></pre> <p>to the file <code>.gitignore</code>, which can be found at the top level of your repository (...
<p>I made:</p> <pre><code>git checkout -- ../.DS_Store </code></pre> <p>(# Discarding local changes (permanently) to a file) And it worked ok!</p>
13,313
<p>For a certain Hibernate entity we have a requirement to store its creation time and the last time it was updated. How would you design this?</p> <ul> <li><p>What data types would you use in the database (assuming MySQL, possibly in a different timezone that the JVM)? Will the data types be timezone-aware?</p></li...
<p>If you are using the JPA annotations, you can use <code>@PrePersist</code> and <code>@PreUpdate</code> event hooks do this:</p> <pre><code>@Entity @Table(name = "entities") public class Entity { ... private Date created; private Date updated; @PrePersist protected void onCreate() { created = new...
<p>I think it is neater not doing this in Java code, you can simply set column default value in MySql table definition. <a href="https://i.stack.imgur.com/DwpZG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DwpZG.png" alt="enter image description here"></a></p>
27,324
<p>I have encapsulated a backup database command in a Try/Catch and it appears that the error message is being lost somewhere. For example:</p> <pre><code>BACKUP DATABASE NonExistantDB TO DISK = 'C:\TEMP\NonExistantDB.bak' </code></pre> <p>..gives error:<br> <strong><em>Could not locate entry in sysdatabases for dat...
<p>It's a limitation of try/catch.</p> <p>If you look carefully at the error generated by executing </p> <pre><code> BACKUP DATABASE NonExistantDB TO DISK = 'C:\TEMP\NonExistantDB.bak' </code></pre> <p>you'll find that there are two errors that get thrown. The first is msg 911, which states </p> <blockquote> <p>C...
<p>It is a limitation, that I just ran into myself, of the try/catch block in SQL 2005. I don't know if it still exists or not in 2008.</p> <p><a href="http://blogs.msdn.com/b/sqlprogrammability/archive/2006/04/03/567550.aspx" rel="nofollow noreferrer">SQL 2005 Error Handling</a></p>
27,398
<p>In MSBuild, I would like to call a task that extracts all the files in all the project in a specific solution and hold these files in a property that can be passed around to other tasks (for processing etc.)</p> <p>I was thinking something along the lines of:</p> <pre><code>&lt;ParseSolutionFile SolutionFile="$(Th...
<p>I don't know about tasks, but there are already properties that hold all items. Just look in your typical project file and you'll see which collection they're being added to.</p> <p>Note the properties <strong>Content</strong>, <strong>Compile</strong>, <strong>Folder</strong>... any time you add a file to a projec...
<p>I use the following for solutions with SSRS projects (which dont build under TFS w/o vs installed on the build box). Basically we require that the RDLs be bundled into a build output so we can mark a build for release.</p> <pre><code>&lt;Target Name="CopyArtifactstoDropLocation"&gt; &lt;CreateItem Include="$(So...
32,228
<p>How would I handle something like the below uri using ASP.NET MVC's routing capability:</p> <pre><code>http://localhost/users/{username}/bookmarks/ - GET http://localhost/users/{username}/bookmark/{bookmarkid} - PUT </code></pre> <p>Which lists the bookmarks for the user in {username}.</p> <p>Thanks</p>
<p>first you need to create a new route in global.aspx</p> <pre><code>routes.MapRoute("Bookmarks", "{controller}/{user}/{action}/{id}"); </code></pre> <p>then add a new action</p> <pre><code>public class UsersController : Controller { [AcceptVerbs("Post")] public void Bookmarks(string user, int? id) { ...
<p>first you need to create a new route in global.aspx</p> <pre><code>routes.MapRoute("Bookmarks", "{controller}/{user}/{action}/{id}"); </code></pre> <p>then add a new action</p> <pre><code>public class UsersController : Controller { [AcceptVerbs("Post")] public void Bookmarks(string user, int? id) { ...
45,246
<p>Do I risk losing sales by disabling SSL 2.0 and PCT 1.0 in IIS5?</p> <p>Clarification: Sales would be lost by client not being able to connect via SSL to complete ecommerce transaction because SSL 2.0 or PCT 1.0 is disabled on the web server. </p> <p>Microsoft kbase article: <a href="http://support.microsoft.com/k...
<p>Modern browsers either don't appear to support SSLv2 at all (Google Chrome, Opera 9.52, Firefox) or have it disabled by default (IE7, IE8).</p> <p>That said, are you concerned about losing business from people using much-less-than-modern web browsers?</p> <p>Possibly more importantly, are you concerned about your ...
<p>Presumably you use SSL to protect users from man-in-the-middle or other attacks, yes? SSLv2 is useless for this. Disable it -- the number of users who use a browser without SSLv3 or TLS support is vanishingly small, and it's easier to make them somebody else's problem than explain why somebody in Nigeria is using th...
9,020
<p>I have an application that imports large volumes of data daily, several 100 thousands records.<br> Data comes from different sources. The data is read using C#, then bulk inserted into the database. <br> <br> This data is then processed:</p> <ul> <li>different tables are linked</li> <li>new tables are generated</li...
<p>I would use SSIS or DTS (assuming you are talking about MSSQL). They are made for that purpose and work with SPs if you need them.</p> <p>Another option is to preprocess the data using Perl. Even though it sounds like a wierd suggestion, Perl is actually extremely fast in these scenarios. I've used it in the past t...
<p>Where you process data depends greatly on what you're doing. If you need, for example, to discard data which you don't want in your database, then you would process that in your C# code. However, data to process in the database should generally be data which should be "implementation agnostic". So if someone else...
9,646
<p>I'm writing a web application in Python, intended for use by teachers and pupils in a classroom. It'll run from a hosted website, but I also want people to be able to download a self-contained application they can install locally if they want more performance or they simply won't have an Internet connection availabl...
<p>Using NSIS is great (i use it too) but i would suggest using a "packager" like pyinstaller (my personal fav, alternatives bb_freeze, py2exe) to create an exe before the using NSIS</p> <p>The primary benefit you get by doing this is; Your download is smaller as you're not bundling the whole Python Standard Lib and e...
<p>You can try the <a href="http://bitnami.org/stack/djangostack" rel="nofollow noreferrer">Bitnami Stack for Django</a> that includes Apache, MySQL,Python, etc in an all-in-one installer. It is free/open source</p>
25,831
<p>Does anyone have a suggestions as to the best way to allow users to select which columns appear in a datagrid? I would like them to be able to set this up. It would be stored with the user in a profile and loaded each time the user loads the grid. I was thinking about something with ASP.NET personalization.</p>
<p>There are several options for you here.</p> <ol> <li><p>Add an 'X' image to the header for each column and with a javascript onclick event do a web method call to remove that column from the user's profile of what columns to load.</p></li> <li><p>Have a customization flyout page where by there would be a checkbox l...
<p>I would be inclined to have a flyout div or window for this, showing only unselected fields, with a remove facility on each header. Sorry if this does not add much to Avitus' idea, however I am suggesting a hybrid of the 2 suggested ideas, i.e the flyout list only contains unselected columns (like in Outlook say). T...
36,700
<p>I have a certain POJO which needs to be persisted on a database, current design specifies its field as a single string column, and adding additional fields to the table is not an option.</p> <p>Meaning, the objects need to be serialized in some way. So just for the basic implementation I went and designed my own se...
<p>Elliot Rusty Harold wrote up a <a href="http://xom.nu/designprinciples.xhtml#d0e323" rel="noreferrer">nice argument</a> against using Java Object serialization for the objects in his XOM library. The same principles apply to you. The built-in Java serialization is Java-specific, fragile, and slow, and so is best avo...
<blockquote> <p>I have a certain POJO which needs to be persisted on a database, current design specifies its field as a single string column, and adding additional fields to the table is not an option.</p> </blockquote> <p>Could you create a new table and put a foreign key into that column!?!? :) I suspect not, but...
30,321
<p>I'm trying to print to Dot Matrix printers (various models) out of C#, currently I'm using Win32 API (you can find alot of examples online) calls to send escape codes directly to the printer out of my C# application. This works great, but...</p> <p>My problem is because I'm generating the escape codes and not relyi...
<p>You should probably use a reporting tool to make templates that allow you or users to correctly position the fields with regards to the pre-printed stationery.</p> <p>Using dot-matrix printers, you basically have to work in either of 2 modes:</p> <ul> <li>simple type-writer mode of line/column text where you send ...
<p>If your printer has driver to install, then you can use normal Windows print system. Most printers, including POS ones, have working Windows drivers available. (Most dot-matrix printers are Epson compatible anyway.) Some POS printer drivers allow send escape codes directly to printer too (using special fonts); proba...
30,557
<p>Whenever I indent <code>HTML</code> in <code>PHP</code> mode, <code>emacs (22.1.1, basic install on Redaht Linux over Putty-SSH)</code> pops up a frame and tells me to get <code>MUMODE</code> or <code>somesuch</code> extra add-on. I installed <code>PHP</code> Mode without a big hassle, but I don't know how to get t...
<p>If you're running emacs 22, you should just be able to run:</p> <pre><code>M-x nxhtml-mumamo </code></pre> <p>when editing an html document. You might want to add it to your auto-mode-alist to get it to automatically load for html docs. See here for more info:</p> <p><a href="http://www.emacswiki.org/cgi-bin/wi...
<p>multi-mode and html-php-mode can be found here : <a href="http://www.loveshack.ukfsn.org/emacs/" rel="nofollow noreferrer">http://www.loveshack.ukfsn.org/emacs/</a></p> <p>It can be initialized with:</p> <pre><code>(require 'html-php) (add-to-list 'auto-mode-alist '("\\.php\\'" . html-php-mode)) </code></pre>
13,775
<p>Just this - How do you add a timer to a C# console application? It would be great if you could supply some example coding.</p>
<p>That's very nice, however in order to simulate some time passing we need to run a command that takes some time and that's very clear in second example.</p> <p>However, the style of using a for loop to do some functionality forever takes a lot of device resources and instead we can use the Garbage Collector to do som...
<p><a href="https://learn.microsoft.com/en-us/dotnet/api/system.timers.timer?view=netframework-4.8" rel="nofollow noreferrer">doc</a></p> <p>There you have it :)</p> <pre><code>public static void Main() { SetTimer(); Console.WriteLine("\nPress the Enter key to exit the application...\n"); Conso...
22,514
<p>I want to wrap a <a href="https://en.wikipedia.org/wiki/One-liner_program#Perl" rel="nofollow noreferrer">Perl one-liner</a> in a batch file. For a (trivial) example, in a Unix shell, I could quote up a command like this:</p> <pre><code>perl -e 'print localtime() . "\n"' </code></pre> <p>But DOS chokes on that wit...
<p>For Perl stuff on Windows, I try to use the generalized quoting as much as possible so I don't get leaning toothpick syndrome. I save the quotes for the stuff that DOS needs:</p> <pre><code>perl -e "print scalar localtime() . qq(\n)" </code></pre> <p>If you just need a newline at the end of the print, you can let ...
<p>In DOS, you use the "" around your Perl command. The DOS shell doesn't do single quotes like the normal Unix shell:</p> <pre><code>perl -e "print localtime();" </code></pre>
15,871
<p>There are hundreds of shopping cart solutions available for every platform, and all hosting plans come with several already installed. As a developer I understand that most of these are fairly similar from a user perspective. </p> <p>But which ones are built with the developer in mind? For example, which ones have ...
<p>osCommerce is one of those products that was badly designed from the beginning, and becomes basically unmaintainable as time moves forward. Addons are patches, and custom code modifies core. (Unless things have drastically changed since I last looked at it - judging by the version numbers, they have not). </p> <p>W...
<p><a href="http://www.oscommerce.com/solutions/oscommerce" rel="nofollow noreferrer">osCommerce</a> seems to be pretty popular, and advertises ease of integration as one of it's main features.</p>
9,508
<p>I have list store in mysql table file1=(1,2,3,4,6,7) and other list file2 = (3,2,4,8,9,10,12) is not stored in table, i want compare both and result should be like result=(6,7,8,9,10,12) then calculate the percentage. like 100*(result/file1+file2) in mysql data structure. i do not know how i will do it. please know...
<p>Create a temporary table to store the "other" list that is not already in a table, and then use a join or union to get the result you want.</p> <p>If you are wanting to select the values that are not in either list, then you can use <code>GROUP BY</code> and <code>COUNT</code> to count the occurrence of each number...
<p>I don't think you can easily do that in pure sql. you need a procedural language to get the result in the first list, merge, sort, unique with the second list and compute the result.</p>
35,001
<p>I have a library consisting of approx 100 source files. I want one of the sources to be always rebuilt if any of the other files have been compiled but I don't want it built every time I run the make/build.</p> <p>Basically I want this file to have the last build date/time built into it so any application linking t...
<p>Let the object file containing the build timestamp depend on all the other object files:</p> <pre><code>version.o: $(OBJECTS) </code></pre>
<p>Let the object file containing the build timestamp depend on all the other object files:</p> <pre><code>version.o: $(OBJECTS) </code></pre>
41,481
<p>I'm making a shell script to find bigrams, which works, sort of.</p> <pre><code>#tokenise words tr -sc 'a-zA-z0-9.' '\012' &lt; $1 &gt; out1 #create 2nd list offset by 1 word tail -n+2 out1 &gt; out2 #paste list together paste out1 out2 #clean up rm out1 out2 </code></pre> <p>The only problem is that it pairs wor...
<p>Java and Javascript are similar like Car and Carpet are similar.</p>
<p><a href="https://developer.mozilla.org/en/a_re-introduction_to_javascript" rel="nofollow noreferrer">A Re-Introduction to Javascript</a> by the Mozilla team (they make Firefox) should explain it.</p>
30,403
<p>I have a mobile .NET solution and decided to sign the assemblies. Compilation completes without errors but gives the warning</p> <p><strong>'CompactUI.Business.PocketPC.asmmeta, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not signed correctly.</strong></p> <p>The application is working fine but I can...
<p>Verify that the assembly wasn't generated with "delay sign" set. This would cause the assembly to advertise that it was signed, when it only has a <code>null</code> placeholder instead. This will cause strong-name verification to fail. For more information you can also check out this page on MSDN: "<a href="http:...
<p>Cause</p> <p>An assembly is not signed with a strong name, the strong name could not be verified, or the strong name would not be valid without the current registry settings of the computer. Rule Description</p> <p>This rule retrieves and verifies the strong name of an assembly. A violation occurs if any of the f...
25,887
<p>I've been banging my head against <code>SQL Server 2005</code> trying to get a lot of data out. I've been given a database with nearly 300 tables in it and I need to turn this into a MySQL database. My first call was to use bcp but unfortunately it doesn't produce valid CSV - strings aren't encapsulated, so you ca...
<p>The best way that I have found is the <a href="http://www.mysql.com/products/tools/migration-toolkit/" rel="noreferrer">MySQL Migration Toolkit</a> provided by MySQL. I have used it successfully for some large migration projects.</p>
<p>Rolling your own PHP solution will certainly work though I'm not sure if there is a good way to automatically duplicate the schema from one DB to the other (maybe this was your question).</p> <p>If you are just copying data, and/or you need custom code anyway to convert between modified schemas between the two DB's...
2,259
<p>Problem: I have an integer; this integer needs to be converted to a stl::string type. </p> <p>In the past, I've used <code>stringstream</code> to do a conversion, and that's just kind of cumbersome. I know the C way is to do a <code>sprintf</code>, but I'd much rather do a C++ method that is typesafe(er).</p> <p>I...
<p>Now in c++11 we have</p> <pre><code>#include &lt;string&gt; string s = std::to_string(123); </code></pre> <p>Link to reference: <a href="http://en.cppreference.com/w/cpp/string/basic_string/to_string">http://en.cppreference.com/w/cpp/string/basic_string/to_string</a></p>
<p>Not really, in the standard. Some implementations have a nonstandard itoa() function, and you could look up Boost's lexical_cast, but if you stick to the standard it's pretty much a choice between stringstream and sprintf() (snprintf() if you've got it).</p>
34,508
<p>Is anyone using Castle MonoRail and ELMAH with success?</p> <p>We are using a number of Resuces to present users with friendly error messages, but if we do this the exceptions never get as far as ELMAH as the MonoRail rescue intercepts them.</p> <p>Ideally we want the user to see the rescue, but for the exception ...
<p>After looking at the links Macka posted, I wrote this simple monorail exception handler:</p> <pre><code>public class ElmahExceptionHandler : AbstractExceptionHandler { public override void Process(IRailsEngineContext context) { ErrorSignal.FromCurrentContext().Raise(context.LastException); } } </cod...
<p>After also posting on <a href="http://groups.google.com/group/elmah/browse_thread/thread/c81280722a05602f" rel="nofollow noreferrer">Google Groups</a> it looks like Atif may have pointed me in the right direction.</p> <blockquote> <p>You might want to look into error signaling in ELMAH. It is designed for sce...
34,765
<p>Based on the answers to <a href="https://stackoverflow.com/questions/350081/how-do-i-supply-the-from-clause-of-a-select-statement-from-a-udf-parameter">this question about dynamically accessing tables</a>, I've decided to take a couple steps back and get some advice on the larger picture. </p> <p>I am revisiting th...
<p><a href="http://www.newrelic.com/ruby" rel="nofollow noreferrer">New Relic</a> offers Rails profiling including a <a href="http://www.newrelic.com/ruby" rel="nofollow noreferrer">free 'Lite'</a> version.</p>
<p>You should also take a look at FiveRuns' <a href="http://www.fiveruns.com/products/tuneup" rel="nofollow noreferrer">TuneUp</a>. It is completely free, installs as a plugin into your Rails application. Keep in mind that it does send data back to their server (mostly very harmless information), but that might bother ...
45,620
<p>I am working on a software development project that uses code written primarily in C and C#. Currently, the responsibility of testing falls mostly on developers as they change the code. </p> <p>I am interested in implementing an automated testing framework to help us improve the quality of our code. In particula...
<p>To be blunt, this sounds like you're looking for reasons not to do it. Just get NUnit and get going. Start with the smallest piece to get your feet wet.</p>
<p>We use TestComplete from AutomatedQA, and it's a decent platform for doing gui testing. We do all of our TestComplete code in Jscript, which isn't great, but it gets the job done. I'm not sure i'd recommend Automated GUI testing though, I think you'll get a much better return on unit testing.</p> <p>Nunit and rhino...
49,660
<p>Since I received no positives answers to my <a href="https://stackoverflow.com/questions/285237/does-a-javascriptable-ftp-upload-javaflash-applet-exist">last</a> question. I will try to write a Java FTP upload applet myself.</p> <p>My question is: "Can you recommend a Java FTP client library for me to use?"</p> <p...
<p>Check out Apache <a href="http://commons.apache.org/net/" rel="noreferrer">commons-net</a>, which contains FTP utilities. Off the top of my head I'm not sure if it meets all of your requirements, but it's certainly free!</p>
<p>You have also this <a href="http://www.nsftools.com/tips/JavaFtp.htm" rel="nofollow noreferrer">2006 article</a> which lists different options for FTP clients.</p> <p>commons-net is good, but <a href="https://web.archive.org/web/20081213000904/http://www.cellspark.com/ftp.html" rel="nofollow noreferrer">FTP-GO</a> ...
37,712
<p>I have a list of tuples eg. [{1,40},{2,45},{3,54}....{7,23}] where 1...7 are days of the week (calculated by finding calendar:day_of_the_week()). So now I want to change the list to [{Mon,40},{Tue,45},{Wed,54}...{Sun,23}]. Is there an easier way to do it than lists:keyreplace?</p>
<p>... or using a different syntax:</p> <pre><code>[{httpd_util:day(A), B} || {A,B} &lt;- L] </code></pre> <p>where:</p> <pre><code>L = [{1,40},{2,45},{3,54}....{7,23}] </code></pre> <p>The construct is called a <em><a href="http://www.erlang.org/doc/programming_examples/list_comprehensions.html#3" rel="nofollow no...
<p>Simple. Use map and a handy tool from the httpd module.</p> <pre><code>lists:map(fun({A,B}) -&gt; {httpd_util:day(A),B} end, [{1,40},{2,45},{3,54},{7,23}]). </code></pre>
19,008
<p>I have been coding exclusively for a while now on Linux with C++. In my current job, it's a Windows shop with C# as main language. I've retrained myself to use Visual Studio instead of emacs ( main reason is the integrated debugger in VC, emacs mode in VC helps ), setup Cygwin ( since I cannot live without a shell )...
<p>The first things to consider when switching from C++ to C# the fact that mostly share some of the surface syntax, but the difference of programming paradigms gets bigger and bigger as you dig in more into .Net. </p> <p>Get to know the C# core programming paradigms before starting to program else you might fall in t...
<p>Shouldn't be the base the CLR? And shouldn't it be unimportant which .NET language is used? If I look through the .NET docs I can decide if I'd like to see the stuff in VB.Net, C# or C++. So if you know C++ why shouldn't you use "managed C++"?</p> <p>Regards Friedrich</p>
15,966
<p>I'm refactoring some PHP code and discovered that certain nested combinations of </p> <pre><code>if () : </code></pre> <p>and </p> <pre><code>if () { </code></pre> <p>generate syntax errors. Not that I would normally mix the two, but I like to do frequent syntax checks as I'm writing code and I kept getting a s...
<p>This is a wild guess since I am not familiar with the grammar of PHP. But here goes:</p> <p>The problem is the second <code>else</code>. The parser can't see if this <code>else</code> is belonging to the first or the second if (counting from the beginning). In your second example there is an <code>endif</code> maki...
<p>The only thing I can say here is that the code is completely unreadable. Avoid : like plague. Use familiar, C-style curly brace syntax. </p> <p>The quality of the code is very much driven by its readability, so do make an effort to clean this up, you'll save yourself a bunch of surprising bugs. </p>
21,770
<p>Is it possible to have a file belong to multiple subpackages? For example:</p> <pre><code>/** * Name * * Desc * * @package Core * @subpackage Sub1 * @subpackage Sub2 */ </code></pre> <p>Thanks!</p>
<p>It appears that PHPDoc does not allow you to do it for namespacing reasons. From the <a href="http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_tags.subpackage.pkg.html" rel="nofollow noreferrer">PHPDoc Docs</a>:</p> <blockquote> <p>NOTE: The @subpackage tag is intended to help categorize ...
<p><a href="http://pear.php.net/package/PHP_UML/" rel="nofollow noreferrer">http://pear.php.net/package/PHP_UML/</a></p> <p>Seems to do a pretty good job with multiple @subpackage tags - it will even generate html- documentation just as phpDocumentor does - though it doesn't seem to be as style-able as phpDocumentor....
39,437
<p>How can I calculate the value of PI using C#?</p> <p>I was thinking it would be through a recursive function, if so, what would it look like and are there any math equations to back it up?</p> <p>I'm not too fussy about performance, mainly how to go about it from a learning point of view.</p>
<p>If you want recursion:</p> <pre><code>PI = 2 * (1 + 1/3 * (1 + 2/5 * (1 + 3/7 * (...)))) </code></pre> <p>This would become, after some rewriting:</p> <pre><code>PI = 2 * F(1); </code></pre> <p>with F(i):</p> <pre><code>double F (int i) { return 1 + i / (2.0 * i + 1) * F(i + 1); } </code></pre> <p>Isaac Ne...
<pre><code>public double PI = 22.0 / 7.0; </code></pre>
6,044
<p>Are there any good Eclipse plugins for creating smarty templates? I am using Europa with PDT on Ubuntu (though I doubt the OS will make a difference for this).</p> <p>I found <a href="http://code.google.com/p/smartypdt/" rel="nofollow noreferrer">SmartyPDT</a>, but it did not seem to install properly and some of th...
<p>You can find newer version of this plugin here : <a href="http://code.google.com/p/smartypdt/issues/detail?id=31" rel="nofollow noreferrer">http://code.google.com/p/smartypdt/issues/detail?id=31</a></p> <p>But I haven't installed it yet with my machine.</p>
<p>Answer posted on the <a href="https://stackoverflow.com/questions/2575142/still-need-smarty-syntax-highlighting-in-eclipse-pdt-no-accepted-answer/2756884#2756884" title="Question linked to from this page, answer included below for convenience">linked-to question</a>:</p> <blockquote> <p>I've used both SmartyPDT a...
45,234
<p>For my side job as programmer, I need Windows. It will be installed in VMWare Fusion. I will be writnig mostly C-code for Matlab-Mex-files, some DSP-development, some easy command-line tools in C and C++ for a tutorial and hopefully some easy GUIs using Visual Studio. I will be using VisualDSP++, Bloodshed Dev-Cpp, ...
<p>It's worth your time to try <a href="http://virtualbox.org/wiki/Downloads" rel="noreferrer">VirtualBox</a>. It's free and the speed of both Vista and XP under VirtualBox is astounding. I run both XP and Vista under VirtualBox on OS X and they seem to be at near-native speed. Perhaps because there are fewer driver...
<p>Well. You have 4gig of ram in that MacBook, then Vista should be okay - and maybe even be faster in VS, if you give it about 2gig of your ram.</p> <p>And about the version of Visual Studio, then the Express should be more fine. There is no GUI differences in the tools (that i know off, I only work in .NET, not in n...
26,405
<p>I'm new to the VxWorks Environment are there any good sources of information out there? </p>
<p>If your budget allows it, I would recommend taking one of the courses offered by WindRiver. My company brought in one of their trainers to teach a class on-site and it was excellent. They provided hands-on programming activities and a lot of information. If you are new to the concepts of real-time or embedded pro...
<p>If your budget allows it, I would recommend taking one of the courses offered by WindRiver. My company brought in one of their trainers to teach a class on-site and it was excellent. They provided hands-on programming activities and a lot of information. If you are new to the concepts of real-time or embedded pro...
31,912
<p>I'm creating a xml-file for display in Excel using &#95;di&#95;IXMLDocument. But for some tags I get an unwanted extra (empty) xmlns attribute witch makes the file unreadable for Excel... This is what i do:</p> <pre><code>... _di_IXMLNode worksheet = workbook-&gt;AddChild("Worksheet"); worksheet-&gt;SetAttribute("s...
<p>xmlns stands for xml name space, if an attribute does not receive an explicit name space, it possesses none. </p> <p><a href="http://www.w3.org/TR/REC-xml-names/" rel="nofollow noreferrer">http://www.w3.org/TR/REC-xml-names/</a></p>
<p>xmlns stands for xml name space, if an attribute does not receive an explicit name space, it possesses none. </p> <p><a href="http://www.w3.org/TR/REC-xml-names/" rel="nofollow noreferrer">http://www.w3.org/TR/REC-xml-names/</a></p>
46,812
<p>We are working on a winforms app in Visual Studio 2005 and the setup project we created output both an MSI and an EXE. We aren't sure what the EXE file is used for because we are able to install without the EXE.</p>
<p>It's a bootstrapper that checks to make sure that the .NET Framework is installed, before launching the MSI. It's pretty handy.</p> <p>I suggest using something like SFX Compiler to package the two together into one self-extracting .exe and then launch the extracted setup.exe. This way you retain the benefits of th...
<p>I think the EXE is just a wrapper/bootstrapper for the MSI in case you don't have Window Installer. If you have the requisite Windows Installer version installed then the MSI should work fine on its own.</p>
6,381
<p>I'm setting up my printer in a small room, and I thought I'd come up with a system for more easily swapping filaments, but I'm not yet sure it is feasible.</p> <p>Rather than physically replace the spool, I'd like to hang most of my spools on the wall, where they can rotate, and only swap filament leads in the (dir...
<p>I would say it's not the best approach. </p> <p>In the situation you've described I would rather install some kind of vertical ring a bit above your printer. This ring would organize your filament going from any direction. </p> <p>So let's assume you got one spool on the right and one on the left of your printer, ...
<p>Your idea is actually good, but i would add some edits to it. First of all, to keep your equipment clean, you would like to add little foam rubbers to clean the filament at the entrance of the tubes, to clean out the dust that will be accumulating over the rolls.</p> <p>Another thing that i would recommend is to ha...
314
<p>I'm trying to get good-quality thin wall prints with PLA on my Creality CR10s Pro V2 using Cura. After hours of calibration and testing, I'm getting quite good results. However, there is one issue I can't figure out. It seems that I'm getting uneven extrusion and blobs when the printer deaccelerates or accelerates. ...
<p>Look at the gcode for those curves either manually in a text editor, or with a gcode analyzer tool (e.g. <a href="https://gcode.ws" rel="nofollow noreferrer">gcode.ws</a>) and see if there's anything strange about them. Cura is notorious for numeric instability problems with high resolution curves, where it will end...
<p>If you haven't already, try rotating the object about the Z-axis to give a different orientation with respect to X and Y. May not correct the problem but if the effect changes it may shed some light on the cause.</p>
2,101
<p>I am trying to validate xml file against schema using <a href="http://search.cpan.org/~samtregar/XML-Validator-Schema/Schema.pm" rel="nofollow noreferrer">XML::Validator::Schema</a>.<br> But it gives me this error:</p> <pre><code>Found unexpected &lt;Submission&gt; inside &lt;&lt;&lt;&lt;ROOT&gt;&gt;&gt;&gt;. This...
<p>You have defined several types, but you have not defined any elements (except those defined as sub-components of the types you <em>have</em> defined). Not only is <code>&lt;Submission&gt;</code> not defined, neither is <code>&lt;Return&gt;</code> (which is its immediate child-element) nor any of <code>&lt;NR4&gt;</c...
<p>Looks like you don't have a submission element in your xsd. I also don't see a return element. You want to define that.</p> <p>On another note, Paul, thanks for getting me hired at my first job and taking me flying.</p>
41,579
<p>I would like to know if there are general rules for creating an index or not. How do I choose which fields I should include in this index or when not to include them?</p> <p>I know its always depends on the environment and the amount of data, but I was wondering if we could make some globally accepted rules about m...
<p>The Oracle documentation has an excellent set of considerations for indexing choices: <a href="http://download.oracle.com/docs/cd/B28359_01/server.111/b28274/data_acc.htm#PFGRF004" rel="nofollow noreferrer">http://download.oracle.com/docs/cd/B28359_01/server.111/b28274/data_acc.htm#PFGRF004</a></p> <p>Update for 19c...
<p>Usually one puts the ID columns up front and those usually identify the rows uniquely. A combination of columns can also do the same thing. As an example using cars... tags or license plates are unique and qualify for an index. They (the tags column) can qualify for the primary key. The owners name can qualify ...
26,092
<p>We currently have code like this:</p> <pre><code>Dim xDoc = XDocument.Load(myXMLFilePath) </code></pre> <p>The only way we know how to do it currently is by using a file path and impersonation (since this file is on a secured network path).</p> <p>I've looked at <a href="http://msdn.microsoft.com/en-us/library/sy...
<p>I would suggest using a WebRequest to get a stream and load the stream into the document.</p>
<pre><code>//Sample XML &lt;Product&gt; &lt;Name&gt;Product1&lt;/Name&gt; &lt;Price&gt;0.00&lt;/Price&gt; &lt;/Product&gt; //Reading XML XmlTextReader rdr = new XmlTextReader("http://your-url"); XDocument loaded = XDocument.Load(rdr); //View the loaded contents //Response.ClearHeaders(); ...
12,050
<p>I intend to use <strong>RADIX / MTRIE</strong> as my preferred data-structure for a routing implementation. </p> <p>Is there a decent open source implementation available (apart from freebsd-net) which I can use for my purpose, or do I need to write one myself?</p>
<p>There is a radix-tree implementation available under the GNU General Public License version 2, or (at your option) any later version: </p> <p><a href="http://www.gelato.unsw.edu.au/lxr/source/lib/radix-tree.c" rel="nofollow noreferrer">http://www.gelato.unsw.edu.au/lxr/source/lib/radix-tree.c</a></p>
<p>If you cant find anything else, you can always port this <a href="http://code.google.com/p/radixtree/" rel="nofollow noreferrer"><strong>java version from Google Code</strong>.</a> </p>
9,619
<p>This is a segment of code from an app I've inherited, a user got a Yellow screen of death:</p> <blockquote> <p>Object reference not set to an instance of an object</p> </blockquote> <p>on the line: </p> <pre><code>bool l_Success ... </code></pre> <p>Now I'm 95% sure the faulty argument is <code>ref l_Monitor<...
<p>You sure that one of the properties trying to be accessed on the l_Monitor instance isn't null?</p>
<p>Sprinkle in a few variables for all the property-queries on that (loooooongg) line temporarily. Run the debugger, Check values and Corner the little bug.</p>
7,886
<p>I generate a XMLDocument based on a dataset by binding the dataset to the XMLDocument object and then display it to user in vb.net. I have a requirement in which certain tags to contain cdata sections rather than text value. After generating the XMLDocument how to change only certain tag to cdata section and keeping...
<p>You could use the "XmlDocument.CreateCDataSection(string)" method. First search each text string for "&lt;" or ">" characters -- or for a full tag "" if known -- then use the appropriate method to output the data.</p>
<p>There is no difference between a text section and a CDATA, except how characters are quoted inside them. The parser that consumes the data won't see a difference. Are you sure you need to create a CDATA section?</p>
33,681
<p>I am working in a project where there are configuration files, one in number for each of the environments where the application would be deployed.</p> <p>When a developer modifies one of these files, the developer should not be allowed to check-in the file individually, but check-in all the files together or at lea...
<p>I would think you could write a pre-commit hook to do this - just have a list of files where if one is committed then they must all be committed.</p> <p>You can write hooks in any language that you can write a command-line application in. The only gotcha is that they run in the context of the SVN server, and (at l...
<p>No, To get information about the transaction your script can simply query svn about the details. And svn can provide that information, it need not be on the same server.</p> <p>What he means is that when subversion executes your hook it runs <em>w/o an environment</em> and by the <em>svn server itself</em>. Any e...
40,489
<p>I'm currently working with Groovy and Grails. While Groovy is pretty straight-forward since it's basically Java, I can't say I grok Grails. I read that Groovy is to Grails as Ruby is to Ruby on Rails, but what does that mean?</p>
<p>To address your confusion with the metaphor (though it has been answered in other words under your question):</p> <blockquote>Groovy is to Grails as Ruby is to Ruby on Rails, but what does that mean?</blockquote> <p>Grails was a web framework built on/with the Groovy programming language to do the same thing for G...
<p>It's a metaphor, and I'm almost said that needs explaining. Anyway, it's an extremely good metaphor for what Ruby on Rails does. It makes it extremely easy to do (go to) the common stuff, i. e. testing, validation, deployment, MVC.</p>
22,181
<p>Okay, so basically I want to be able to retrieve keyboard text. Like entering text into a text field or something. I'm only writing my game for windows. I've disregarded using Guide.BeginShowKeyboardInput because it breaks the feel of a self contained game, and the fact that the Guide always shows XBOX buttons doesn...
<p>For adding a windows hook in XNA</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; using System.Diagnostics; using System.Reflection; /* Author: Sekhat * * License: Public Domain. * * Usage: * * Inherit from this class...
<p>This page is on top of google result about WM_CHAR interception in xna, so i leave here some note. Maybe this will be useful for other (if they will be able to understand my English =)) ).</p> <p>I try code with windowshook from Sekhat, but seems there should be WH_GETMESSAGE passed to SetWindowsHookEx instead Wi...
49,111
<p>I want to do something like:</p> <pre><code>MyObject myObj = GetMyObj(); // Create and fill a new object MyObject newObj = myObj.Clone(); </code></pre> <p>And then make changes to the new object that are not reflected in the original object.</p> <p>I don't often need this functionality, so when it's been necessar...
<p>Whereas one approach is to implement the <a href="http://msdn.microsoft.com/en-us/library/system.icloneable.aspx" rel="noreferrer"><code>ICloneable</code></a> interface (described <a href="https://stackoverflow.com/questions/78536/cloning-objects-in-c/78568#78568">here</a>, so I won't regurgitate), here's a nice dee...
<p>I know that this question and <a href="https://stackoverflow.com/a/78612/1842492">answer</a> sits here for a while and following is not quite answer but rather observation, to which I came across recently when I was checking whether indeed privates are not being cloned (I wouldn't be myself if I have not ;) when I h...
10,398
<p>5, 100, 1000?</p> <p>I guess, "it depends", but on what?</p> <p>What is common in applications that run as server daemons / services?</p> <p>What are hard limits?</p> <p>Given that the machine can handle the overall workload, how do I determine at how many threads the overhead starts to have an impact on perform...
<p>I can't answer your question about "how much is many" but I agree that you should not use threads for every task possible.</p> <p>The <strong>optimal</strong> amount of threads for performance of application is (n+1), where n is the amount of processors/cores your computer/claster has.</p> <p>The more your actual ...
<p>Microsoft's <a href="http://msdn.microsoft.com/en-us/library/system.threading.threadpool.aspx" rel="nofollow noreferrer">ThreadPool</a> class limits you to 25 threads per processor. The limit is based on <a href="http://www.dotnetconsult.co.uk/weblog2/PermaLink,guid,29363d7e-79c1-432b-8ec1-5583ec5e9aa3.aspx" rel="no...
47,395
<p>Would it be using a Websphere Adaptor for SAP or webmethods or something else?? Does something else need to be considered while opting for one of these??? The final system needs to be synchronous between SAP and the WCS front end.No ques..no delays....</p>
<p>I recommend a combination of the SAP Business Connector (<a href="http://service.sap.com/sbc-download" rel="nofollow noreferrer">http://service.sap.com/sbc-download</a>), which provides an easy interface for receiving/sending RFC calls from/to the SAP side, and the IBM WebSphere Java library, which allows easy inter...
<p>Hmm... there is a white paper from IBM's website that shows the best way for you to do this. Depending on your IT strategy choose your integration pattern and integration technology. </p>
12,352
<p>This question is about "best use" scenarios in projects with ORMs like NHibernate, Subsonic, Linq2SQL, etc...</p> <p>All of these tools generate basic entity classes, some with attributes, others without. Do people use these classes as their business classes? Or is there wholesale copying of data from ORM generat...
<p>I tend to work the opposite way. I create the business objects the way I need them, and create NHibernate mappings from my objects to data. You can have NHibernate generate a schema for you based on your mappings, or you can create your own schema, and create the mappings to go between the two. Linq2Sql and Entit...
<p>There are a couple of solutions for all of the tools mentioned, the answer is it depends on the scope of your project.</p> <p>Here's <a href="https://stackoverflow.com/questions/222895/can-linq-to-sql-generated-objects-be-decoupled#229905">a similar question about LINQ to SQL</a> that I answered a little while ago....
43,003
<p>I want to start learning HTML and AJAX using a Linux distribution.</p> <p>Can anyone recommend a distribution that has these requirements:</p> <ul> <li>Local Host Admin interface (like PHPmyAdmin)</li> <li>IDE for Javascript... etc</li> </ul>
<p>There is no real best distro for web development. All tools you need will run on any linux distro.</p> <p>Pick something you have experience with. If you don't have any experience I'd recommend one of the 'user friendly' distros like Ubuntu or SuSe.</p>
<p>HTML and AJAx don't need to be on any particular distribution, Ubuntu makes it pretty easy to install all the required features. I like fedora personally.</p> <p>Try <a href="http://www.eclipse.org/webtools" rel="nofollow noreferrer">http://www.eclipse.org/webtools</a> and <a href="http://www.zend.com/phpide" rel=...
19,549
<p>I want to use a real IDE for editing javascript files in combination with Firebug. In the 'Add editor' dialog for Firebug I'm allowed to specify executable and arguments. So the question is really how do I open a file in Eclipse/Netbeans from the command line. </p> <p>Extra points for allowing me to choose between ...
<p>Not an exact answer I'm afraid, but this information might help.</p> <p><a href="http://help.eclipse.org/help21/index.jsp?topic=/org.eclipse.platform.doc.user/tasks/running_eclipse.htm" rel="nofollow noreferrer">Eclipse Help - Running Eclipse</a><br> <a href="http://ajaxian.com/archives/fireclipse-debug-from-ff-str...
<p>I havent tried this yet but looks interesting <a href="http://code.google.com/p/jsdt/wiki/newFeatures" rel="nofollow noreferrer">Javascript Debug Toolkit 2.0.0</a></p> <p>Also I have heard that <a href="http://www.aptana.com/" rel="nofollow noreferrer">aptana</a> is pretty good</p>
8,293
<p>Has anyone used the <a href="http://cmusphinx.sourceforge.net/html/cmusphinx.php" rel="nofollow noreferrer">Sphinx</a> speech recognition stack to build IVR applications? I am looking for open source alternatives to the expensive and somewhat limiting choices from MSFT and others. I have not been able to find a co...
<p>You could try integrating Sphinx with <a href="http://www.asterisk.org/" rel="nofollow noreferrer">Asterisk</a>:</p> <ul> <li><a href="http://www.syednetworks.com/asterisk-integration-with-sphinx-voice-recognition-system" rel="nofollow noreferrer">http://www.syednetworks.com/asterisk-integration-with-sphinx-voice-r...
<p>You could try integrating Sphinx with <a href="http://www.asterisk.org/" rel="nofollow noreferrer">Asterisk</a>:</p> <ul> <li><a href="http://www.syednetworks.com/asterisk-integration-with-sphinx-voice-recognition-system" rel="nofollow noreferrer">http://www.syednetworks.com/asterisk-integration-with-sphinx-voice-r...
5,667
<p>I'm having trouble figuring out how to access a cookie from a compiled object. I'm trying to make a compiled (DLL) object that will check the users cookie and then compare that to a database to confirm they have the correct access. </p> <p>I can pass in the cookie info fine and the component will work, but I'm tryi...
<p>Objects (App_Code/ compiled dlls) can only access Request via the static HttpContext.Current object</p> <pre><code>HttpCookie cookie = HttpContext.Current.Request.Cookies["CookieName"]; </code></pre> <p>(If it's not called from a web app, HttpContext.Current is null, so you may want to check for that when running ...
<p>If the component is a separate DLL from your web app you'd need to pass in a reference to the Request object.</p> <p>That said why not just read/check the cookie value in your ASP.NET code before calling into your DLL. It's not such a good idea to have your business logic coupled to your web tier like this.</p>
21,022
<p>In Visual Source Safe 6.0, you could "reset" a working folder by setting it to a blank string. This meant that the working folder would be determined by the working folder of the parent.</p> <p>How do I do this in Visual Source Safe 2005?</p>
<p>This can't be done in the normal VSS 2005 "Set Working Folder" dialog.</p> <p>However, if you <strong>hold the shift key while invoking the "Set Working Folder" dialog</strong>, it shows the old VSS 6.0 dialog. Here you can reset the working folder by deleting the string and pressing OK.</p>
<p>If VS2005 still uses the .ini files you can delete the working folder record from the file and it will inherit it from the parent.</p>
21,694
<p>Can I access spring bean that exposed using http invoker (server) from GWT application (client)?</p> <p>If so is there any example / tutorial for that?</p>
<p>There's an application template for Spring-GWT apps available <a href="http://bram.jteam.nl/index.php/2007/06/20/springone-2007-slides-sample-code/" rel="nofollow noreferrer">here</a>, that you may find useful. I haven't tried it out, but I believe it's implemented as a Maven archetype. </p> <p>For more background ...
<p>I have very good experience with Spring4GWT. Did the entire integration in a about 30 minutes. (including ORM). I used this link <a href="http://www.javacodegeeks.com/2010/05/gwt-2-spring-3-jpa-2-hibernate-35.html" rel="nofollow">http://www.javacodegeeks.com/2010/05/gwt-2-spring-3-jpa-2-hibernate-35.html</a> </p> <...
26,763
<p>At the beginning of each PHP page I open up the connection to MySQL, use it throughout the page and close it at the end of the page. However, I often redirect in the middle of the page to another page and so in those cases the connection does not be closed. I understand that this is not bad for performance of the we...
<p>From: <a href="http://us3.php.net/manual/en/mysqli.close.php" rel="noreferrer">http://us3.php.net/manual/en/mysqli.close.php</a></p> <blockquote> <p>"Open connections (and similar resources) are automatically destroyed at the end of script execution. However, you should still close or free all connections, result...
<p>There might be a limit of how many connections can be open at once, so if you have many user you might run out of SQL connections. In effect, users will see SQL errors instead of nice web pages.</p> <p>It's better to open a connection to read data, then close it, then display data and once the user clicks "submit" ...
12,884
<p>Let's say I have many-to-many relationship (using the ActiveRecord attribute HasAndBelongsToMany) between Posts and Tags (domain object names changed to protect the innocent), and I wanted a method like <pre>FindAllPostByTags(IList&lt;Tag&gt; tags)</pre> that returns all Posts that have all (not just some of) the Ta...
<p>You could also just use an <code>IN</code> statement</p> <pre><code>DetachedCriteria query = DetachedCriteria.For&lt;Post&gt;(); query.CreateCriteria("Post").Add(Expression.In("TagName", string.Join(",",tags.ToArray()) ); </code></pre> <p>I haven't compiled that so it could have errors</p>
<p>I don't have a system at hand with a Castle install right now, so I didn't test or compile this, but the code below should about do what you want.</p> <pre><code>Junction c = Expression.Conjunction(); foreach(Tag t in tags) c = c.Add( Expression.Eq("Tag", t); return sess.CreateCriteria(typeof(Post)).Add(c).Lis...
15,758
<p>You can, obviously, put a variable declaration in a for loop:</p> <pre><code>for (int i = 0; ... </code></pre> <p>and I've noticed that you can do the same thing in if and switch statements as well:</p> <pre><code>if ((int i = f()) != 0) ... switch (int ch = stream.get()) ... </code></pre> <p>But when I try to ...
<p>The grammar for a condition in the '03 standard is defined as follows:</p> <pre><code>condition: expression type-specifier-seq declarator = assignment-expression </code></pre> <p>The above will therefore only allow conditions such as:</p> <pre><code>if ( i &amp;&amp; j &amp;&amp; k ) {} if ( (i = j) ==0 ) {} ...
<p><strike>Try</strike> <strong>This doesn't work</strong></p> <pre><code>while (int ch = stream.get(), ch != -1) ... </code></pre> <p><strike>I've never tried it, but if the comment in your edit is correct, this should work.</strike><br> VS 2005 won't even compile it.</p>
23,154
<p>I am trying to create a new website on a remote server via msbuild (I like to call it "msdeploy"). I've downloaded and used the SDC tasks, the MSBuildExtension tasks and the MSBuildCommunity tasks but I simply can't get it right.</p> <p>I figure that WebDirectorySetting (from MSBuild.Community.Tasks.IIS) is my bes...
<p>thanks for your replies. I toyed around with doing both of these suggestions but neither is "exactly" what I was looking for - even if it gets the job done. I can't see us ever going back to 1.1 either so we did end up making it the default but i'm still holding out hope that there's a magic setting on some task ...
<p>None of this works simple as the following lines:</p> <p>First, create the website directory:</p> <pre><code>&lt;WebDirectoryCreate ServerName="$(DeployServerName)" VirtualDirectoryName="MyVirualSiteName" /&gt; </code></pre> <p>Second, Apply the ASP.NET version you want:</p> <pre><code>&lt;Instal...
46,103
<p>How do you rotate an image using <a href="http://code.google.com/p/jquery-rotate/" rel="nofollow noreferrer">jQuery-rotate</a> plugin?</p> <p>I have tried the following and it doesn't seem to work:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=windows-1252"...
<p>You've got a 404 on jQuery and the jQuery plugin. Because of that, your page is throwing a JavaScript error, that $ is not defined.</p> <p>You need to learn basic JavaScript debugging techniques. A quick search found this article that looks like a good place for you to start:</p> <ul> <li><a href="http://www.devel...
<p>Once you fix your jquery include issues, you can fix your script. Your syntax is wrong: Here is the fix:</p> <pre><code>&lt;script type="text/javascript"&gt; //&lt;![CDATA[ var angle = 1; $(document).ready(function(angle) { setInterval(function(angle) { $("#pic").rotate(angle); ...
47,757
<p>Basically I'm running some performance tests and don't want the external network to be the drag factor. I'm looking into ways of disabling network LAN. What is an effective way of doing it programmatically? I'm interested in c#. If anyone has a code snippet that can drive the point home that would be cool.</p>
<p>Found this thread while searching for the same thing, so, here is the answer :)</p> <p>The best method I tested in C# uses WMI.</p> <p><a href="http://www.codeproject.com/KB/cs/EverythingInWmi02.aspx" rel="noreferrer">http://www.codeproject.com/KB/cs/EverythingInWmi02.aspx</a></p> <p><a href="http://msdn.microsof...
<p>I modfied the <a href="https://stackoverflow.com/a/18761206/5941260">best voted solution</a> from <a href="https://stackoverflow.com/users/1557156/kamrul-hasan">Kamrul Hasan</a> to one methode and added to wait for the exit of the process, cause my Unit Test code run faster than the process disable the connection.</...
20,828
<p>I have a <code>n...n</code> structure for two tables, <strong><code>makes</code></strong> and <strong><code>models</code></strong>. So far no problem.</p> <p>In a third table (<strong><code>products</code></strong>) like:</p> <pre><code>id make_id model_id ... </code></pre> <p>My problem is creating a view for pr...
<p>Here's my hint: Try getting your query written in regular SQL before trying to reconstruct using the Cake library. In essence you're doing a lot of extra work that the DB can do for you. Your approach (just for show - not good SQL):</p> <pre><code>SELECT * FROM makes, models, products WHERE make_id = 5 </code></p...
<p>All your different Make->find() and Model->find() calls are completely independent of each other. Even Make->Model->find() is the same as Model->find(), Cake does not in any way remember or take into account what you have already found in other models. What you're looking for is something like:</p> <pre><code>$this...
13,778
<p>All of my completed prints come out with rough edges. What are some methods for removing rough edges from 3D prints? Also, are there any ways to reduce rough edges on prints? For reference, I use a FlashForge Adventurer 3 and PLA filament.</p>
<ol> <li>To remove unwanted residual material:</li> </ol> <ul> <li>You can scrape with a knife</li> <li>Use sand paper</li> <li>use files</li> <li>Very fine sandpaper or files can smooth out the rough surfaces left from filing or sanding.</li> <li>Dremel tools tend to be aggressive. They tend to melt the surface if to...
<p>There are several different ways you can go about doing this</p> <ol> <li>You could calibrate your printer/software better that way so the slicer can make better gcode files that are best fit for you printer</li> <li>Take a lighter to the edge and scrape everything off, this really helps for if your print gets reall...
1,932
<p>I often find myself writing simple for loops to perform an operation to many files, for example:</p> <pre><code>for i in `find . | grep ".xml$"`; do bzip2 $i; done </code></pre> <p>It seems a bit depressing that on my 4-core machine only one core is getting used.. is there an easy way I can add parallelism to my s...
<p><strong>Solution</strong>: Use <code>xargs</code> to run in parallel (don't forget the <code>-n</code> option!)</p> <pre><code>find -name \*.xml -print0 | xargs -0 -n 1 -P 3 bzip2 </code></pre>
<p>I think you could to the following</p> <blockquote> <pre><code>for i in `find . | grep ".xml$"`; do bzip2 $i&amp;; done </code></pre> </blockquote> <p>But that would spin off however many processes as you have files instantly and isn't an optimal as just running four processes at a time.</p>
35,689
<p>LEt's say I want to have a subfolder called- <a href="http://www.foo.com/news/" rel="noreferrer">http://www.foo.com/news/</a> but I actually want that news folder on a different server. I realize it can be done easily with subdomains, but I was really hoping for the subfolder thing.</p> <p>Is it possible? How?</p...
<p>The <strong>only</strong> real way to it is with a reverse proxy ( <em>Or a webserver acting as a reverse proxy</em> ) between you and the outside world that knows what IP address each folder is in. </p> <p>Its not possible to just make something, for example have google.com appear at <a href="http://foobar.com/go...
<p>DNS resolution happens at the domain level. DNS doesn't have any knowledge of URLs or folders so your name will always point to the same server. You can make that server actually retrieve the information from another one or redirect to another one but that's not very satisfactory I'd say.</p>
12,042
<p>How do I enable double-buffering of a control using C# (Windows forms)?</p> <p>I have a panel control which I am drawing stuff into and also an owner-drawn tab control. Both suffer from flicker, so how can I enable double-buffering?</p>
<p>In the constructor of your control, set the DoubleBuffered property, and/or ControlStyle appropriately.</p> <p>For example, I have a simple DoubleBufferedPanel whose constructor is the following:</p> <pre><code>this.DoubleBuffered = true; this.SetStyle(ControlStyles.UserPaint | ControlStyles.AllPain...
<p>Use the DoubleBuffered property, inherited from the System.Windows.Forms.Control.</p> <pre><code>System.Windows.Forms.Form myForm = new System.Windows.forms.Form(); myForm.DoubleBuffered = true; </code></pre>
27,094
<p>I use MySQL in a fairly complex web site (PHP driven).</p> <p>Ideally, there would be a tool I could use that would help me test the SQL queries I am using and suggest better table indexes that will improve performance and avoid table scans.</p> <p>Failing that, something that will tell me exactly what each query ...
<p>Here's some info about EXPLAIN (referenced from the High Performance MySQL book from O'Reilly):</p> <p>When you run an EXPLAIN on a query, it tells you everything MySQL knows about that query in the form of reports for each table involved in the query.</p> <p>Each of these reports will tell you...</p> <ul> <li>the I...
<p>The tool I use for the rest of my sql tweaking (<a href="http://www.webyog.com" rel="nofollow noreferrer">SQLyog</a>) has a new version that includes a profiler, which is awesome! (I don't work for them - I just use their product)</p> <p><img src="https://i.stack.imgur.com/csDfU.png" alt="enter image description he...
15,532
<p>I want to store a list of the following tuples in a compressed format and I was wondering which algorithm gives me</p> <ul> <li>smallest compressed size</li> <li>fastest de/compression</li> <li>tradeoff optimum ("knee" of the tradeoff curve)</li> </ul> <p>My data looks like this:</p> <pre><code>(&lt;int&gt;, &lt;...
<p>Since the "time" ints can be close to each other, try to only store the first and after that save the difference to the int before (delta-coding). You can try the same for the second int, too.</p> <p>Another thing you can try is to reorganize the data from [int1, int2, double], [int1, int2, double]... to [int1, int...
<p>Great answers, for the record, I'm going to merge those I upvoted into the approach I'm finally using:</p> <ol> <li><p>Sort and reorganize the data so that similar numbers are next to each other, i. e. sort by id first, then by timestamp and rearrange from <code>(&lt;int1&gt;, &lt;int2&gt;, &lt;double&gt;), ...</co...
35,004
<p>I'm working on an assignment that is telling me to assume that I have a singly linked list with a header and tail nodes. It wants me to insert an item y before position p. Can anybody please look over my code and tell me if I'm on the right track? If not, can you provide me with any tips or pointers (no pun inten...
<p>Just write it down if you get stuck with an algorithm:</p> <pre><code>// First we have a pointer to a node containing element (elm) // with possible a next element. // Graphically drawn as: // p -&gt; [elm] -&gt; ??? tmp = new Node(); // A new node is created. Variable tmp points to the new node which // current...
<p>What you are not doing is linking the element that was before p prior to insertion of y to y. So while y is inserted before p, no one is pointing to y now (at-least not in the code snipped you showed). </p> <p>You can only insert in constant time if you know the positions of the elements between which you have to i...
37,559
<p>I am using Eclipse for quite some time and I still haven't found how to configure the Problems View to display only the Errors and Warnings of interest. Is there an easy way to filter out warnings from a specific resource or from a specific path? For example, when I generate javadoc I get tons of irrelevant html war...
<p>I feel that filtering "On selected element and its children" is the best mode of Problems view filter, because it allows you to very quickly narrow down the scope of reported problems: click on Working Set (in Package Explorer), and it shows all problems in all projects in the set; click on a project - and only prob...
<p>Make sure you don't forget to uncheck "Show all items" on top left corner of Filters window. I was applying all these filters such as 'On selected elements and its children' but it doesn't seem to work out. Finally I unchecked the aforementioned checkbox, selected the required 'Configurations' and then it started wo...
18,965
<p>I'm looking for a way to get the size of an instance of a reference type. sizeof is only for value types. Is this possible?</p>
<p>You need <a href="http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshal.sizeof.aspx" rel="noreferrer">Marshal.SizeOf</a></p> <p><strong>Edit:</strong> This <em>is</em> for unsafe code, but then, so is sizeof().</p>
<p>Beware that Marshal.SizeOf is for unsafe code...</p> <p>I don't think it's possible for managed code though, maybe you can explain your problem, there may be another way to solve it</p>
4,614
<p>Anyone have a good resource or provide a sample of a natural order sort in C# for an <code>FileInfo</code> array? I am implementing the <code>IComparer</code> interface in my sorts.</p>
<p>The easiest thing to do is just P/Invoke the built-in function in Windows, and use it as the comparison function in your <code>IComparer</code>:</p> <pre><code>[DllImport("shlwapi.dll", CharSet = CharSet.Unicode)] private static extern int StrCmpLogicalW(string psz1, string psz2); </code></pre> <p>Michael Kaplan h...
<p>Let me explain my problem and how i was able to solve it. </p> <p>Problem:- Sort files based on FileName from FileInfo objects which are retrieved from a Directory.</p> <p>Solution:- I selected the file names from FileInfo and trimed the ".png" part of the file name. Now, just do List.Sort(), which sorts the filen...
30,895
<p>What is the difference between having</p> <pre class="lang-java prettyprint-override"><code>&lt;%# Eval("State") %&gt; </code></pre> <p>in your <code>aspx</code> page, versus having</p> <pre class="lang-java prettyprint-override"><code>&lt;%# DataBinder.Eval(Container.DataItem, "State") %&gt; </code></pre> <p>...
<p><code>Eval(&quot;State&quot;)</code> is a simplified form of the <code>DataBinder.Eval(Container.DataItem, &quot;State&quot;)</code> syntax. It only works inside of data-bound template controls.</p> <p>For more info, see <a href="http://msdn.microsoft.com/en-us/library/ms178366.aspx" rel="nofollow noreferrer">the MS...
<p>I have seen following code </p> <pre><code>&lt;%# (DataBinder.Eval(Container.DataItem, "ApplicationId").ToString() == "-1" ? "N/A" : Eval("ApplicationId").ToString()) %&gt; </code></pre> <p>So I guess they slightly different.</p>
33,957
<p>Specifically, I currently have a JPanel with a TitledBorder. I want to customize the look of the border. In my app's current state, the title is drawn, but not the line border itself.</p> <p>If I bind an imagePainter to the panelBorder method for Panel objects, I can put a custom image around panels -- however it o...
<p>Specify the name of the component you want to apply the special style to, not the region:</p> <pre><code>&lt;bind style="PanelStyle" type="name" key="mySpecialPanel" /&gt; </code></pre> <p>In your Java code, you'll need to set the component's name to match the name you supplied in the XML:</p> <pre><code>panel.se...
<p>We had the same problem. Of course your workaround (which you described above) works but it is not a solution.</p> <p>The workaround we used is:</p> <p>Instead of:</p> <pre><code>BorderFactory.createTitledBorder("title"); </code></pre> <p>You should use:</p> <pre><code>Border objBorder = BorderFactory.createLin...
28,903
<p>What is the best way to centralize and secure the connections strings used by applications? In my environment we have many internal applications. Each application requires one or more connection strings in order to access the database. We have a goal of centralizing all these connection strings (particularly SQL ...
<p>You can use Windows server to create users that are allowed to access your SQL Server database. Then you can use integrated windows login in connection strings. </p> <p>BTW Storing passwords in public MDB renders them irelevant. Same as they don't exist. </p>
<p>Is it not possible to move to Window Integrated Security in the connection strings, then you do not have to worry about the security aspect as much (unless you need to secure the actual location of the connection I guess). </p>
41,033
<p>In particular, I need a more full fledged version of Trac to support robust project management, and task tracking. I went through the plugins and literally found over 50 that looked promising. </p> <p>My question is to the admins/users of Trac: which ones are indespensible for making Trac feature complete and whi...
<p>Lots of Trac plugins look promising. Unfortunately only a handful really delivers and even then some of them are not properly supported or maintained. They also tend to conflict sometimes.</p> <p>I will not recommend anything for project management specifically but these are the ones which made our live so much eas...
<p><a href="http://bloodhound.apache.org/" rel="nofollow">Apache Bloodhound</a> is a collection of plugins bundled with Trac. It includes some of the individual plugins suggested in earlier answers, like the <a href="http://trac-hacks.org/wiki/AccountManagerPlugin" rel="nofollow">AccountManagerPlugin</a>.</p> <p>The m...
23,615
<p>When I'm in Windows, I use the <strong>excellent</strong> <a href="http://www.microolap.com/products/database/postgresql-designer/" rel="noreferrer">MicroOLAP</a> Database Designer for PostgreSQL, but its not open source or multiplataform.<br> Do you know or can recommend me an alternative to this software, that I c...
<p><a href="http://pgdesigner.sourceforge.net/" rel="noreferrer">pgDesigner</a> is a database design application for PostgreSQL, for versions 7.x and 8.x.</p> <p>pgDesigner provides the following features:</p> <ul> <li>Complete datamodel editor</li> <li>Support for PostgreSQL objects: tables, views, relations, table...
<p>I stopped using software database designers years ago, and reverted back to the trusty pen and paper which is just easier to use in my experience.</p> <p>To answer your question though, take a look at <a href="http://fabforce.net/dbdesigner4/" rel="nofollow noreferrer">dbDesigner4</a> which is what I used to use. I...
17,426
<p>I'm trying to upgrade my subversion server (I have it hosted with Dreamhost)</p> <p>This is what I run:</p> <ul> <li>wget <a href="http://subversion.tigris.org/downloads/subversion-1.5.2.tar.bz2" rel="nofollow noreferrer">http://subversion.tigris.org/downloads/subversion-1.5.2.tar.bz2</a></li> <li>wget <a href="ht...
<p>You'll need to build your own copy under your own account.</p> <pre><code>mkdir ~/src cd ~/src wget http://subversion.tigris.org/downloads/subversion-1.5.2.tar.bz2 wget http://subversion.tigris.org/downloads/subversion-deps-1.5.2.tar.bz2 tar -xjf subversion-1.5.2.tar.bz2 tar -xjf subversion-deps-1.5.2.tar.bz2 cd su...
<p>This might be a security measure, if the system is compromised it will theoretically be harder for the malicious user to build more attack code on the system to get more access.</p> <p>The solution to this is to cross compile the code on a local machine, then transfer it to the server. If you can't install to the s...
23,043
<p>Since XAML gets compiled, there should be no difference in execution of code like this.<br> Winforms (code like):</p> <pre><code>Form formPeter = new Form(); Textbox textbox = new Textbox(); Label l1 = new Label1(); </code></pre> <p>Xaml does not get parsed at runtime, as I thought... :-) </p> <p>But what about r...
<p>Which Technology is faster? I'm afraid your question doesn't really have a simple answer.</p> <p>Your comment about XAML not being parsed at runtime is both true and false. While the XAML is not parsed a normalized binary version of it (embedded as a resource in your application) called BAML <strong>is</strong> par...
<p>WPF vs Winforms performance is no longer a major criterion.</p> <p>I know this question has been asked before, but in view of .NET 4.x and the improvements that have gone into making WPF more performant, does the community think that performance is no longer a criteria for choosing one technology over another.</p> ...
48,091
<p>I'm trying to load an external swf movie then adding the ability to drag it around the stage, however whenever I try to do this I just hit a dead end. Are there any limitations on what you can set be draggable or clickable? An example of what I'm doing is below:</p> <pre><code>public function loadSwf(url:String, sw...
<p>If there is empty space in your content, Flash will treat it like you have clicked THROUGH the clip to the stage below. Try adding a transparent square to the bottom layer of the content you're loading.</p> <p>Also try setting:</p> <p><code>ldr.content.mouseChildren = false;</code></p>
<p>Something of a shot in the dark, but could you make a transparent movie clip on top of the movie that's loaded that is dragged around, which moves the swf underneath?</p>
35,347
<p>Is there a CSS style that IE7 and Firefox will obey that changes the behaviour of a TEXTAREA so that it behaves more like.... um..... more like the thing I'm typing into right now!</p>
<p>Word-wrapping is the default behaviour of &lt;textarea&gt;s. However, it will make a horizontal scrollbar if you write a bunch of text without any spaces. If you just mashed the keys on your keyboard to test your textarea, that's how you might have gotten a scrollbar and thought it wasn't wrapping.</p>
<p>Try typing then text without space and you will see a horizontal scrollbar.<br> Do the view source on this page to see what style applies to this textarea ;)</p>
28,213
<p>I want to programmatically create a new column in an MS Access table. I've tried many permutations of <code>ALTER TABLE MyTable Add MyField DECIMAL (9,4) NULL;</code> and got: </p> <blockquote> <p>Syntax Error in Field Definition</p> </blockquote> <p>I can easily create a number field that goes to a <code>Doub...
<p>The decimal data type isn't supported in the default Jet 4.0 mdb file. You have to use the SQL Server compatibility syntax (ANSI 92) setting to use the decimal data type in the SQL Window.</p> <p>Click on the menu, Tools > Options. Click on the Tables/Query tab. Mark the check box for "This database" in the SQL ...
<p>The ALTER TABLE syntax is only supported in Jet 4.0/ACE while in ANSI-92 Query Mode. Try an ADO connection e.g.</p> <p>CurrentProject.Connection.Execute "ALTER TABLE myTbl ADD COLUMN myColumn DECIMAL(9,4)"</p>
21,827
<p>I need to attach a file with mailx but at the moment I am not having success.</p> <p><strong>Here's my code:</strong></p> <pre><code>subject="Something happened" to="somebody@somewhere.com" body="Attachment Test" attachment=/path/to/somefile.csv uuencode $attachment | mailx -s "$subject" "$to" &lt;&lt; EOF The m...
<p>You have to concat both the text of your message and the uuencoded attachment:</p> <pre><code>$ subject="Something happened" $ to="somebody@somewhere.com" $ body="Attachment Test" $ attachment=/path/to/somefile.csv $ $ cat &gt;msg.txt &lt;&lt;EOF &gt; The message is ready to be sent with the following file or link ...
<p>Well, here are the first few problems you've got.</p> <ol> <li><p>You appear to be assuming that a mail client is going to handle uuencoded attachment without any headers. That won't happen.</p></li> <li><p>You're misusing I/O redirection: uuencode's output and the here-document are both being fed to mailx, which...
12,194
<p>One of the biggest challenges that I've encountered with SharePoint is that it doesn't lend itself nicely to the typical project environment, which, at minimum, contain development and production environments. The issues I've run into the most are that content and lists are so tightly coupled that it makes it diffi...
<p>There are really two (more?) levels to SharePoint "development". You have the code which gets deployed to the server, such as web parts, content types, workflow actions, etc. This works relatively well in terms of deployment and best practices.</p> <p>Then you have your example, which is more of a customization of ...
<p>Use FeatureActivation code to deploy changes to the lists' fields. After the code updates the fields then you deactivate the feature and remove it. This allows results to be tested in a QA environment before hand.</p>
29,017
<p>I want to use Oracle exception to handle errors that might happen in the code below. If a user provides the book ID and/or employee ID that doesn't exist in the database, NO_DATA_FOUND exception will be raised. Thus, how can I know which statement raises this exception.</p> <pre><code>CREATE OR REPLACE PROCEDURE T...
<p>There are various ways in which this can be done:</p> <h1>OPTION 1</h1> <p>The other option is to create multiple begin / end blocks</p> <pre><code>CREATE OR REPLACE PROCEDURE TEST_EXCEPTION ( book_id_in IN book.book_id%TYPE, emp_id_in IN emp.emp_id%TYPE ) IS v_book_desc book.description%TYPE; v_emp_na...
<p>You can set a variable before the given statements. Like;</p> <pre><code>CREATE OR REPLACE PROCEDURE TEST_EXCEPTION ( book_id_in IN book.book_id%TYPE, emp_id_in IN emp.emp_id%TYPE ) IS v_book_desc book.description%TYPE; v_emp_name emp.emp_name%TYPE; statementIndex number(1, 0); BEGIN statementIndex := 1; SELECT ...
36,875
<p><strong>Update:</strong> So, this turns out to have nothing to do with Tortoise SVN. I use Mozy.com for off-site backups and their new version includes these icon overlays. They can be disabled via the config options...or see here <a href="http://forum.pcmech.com/showthread.php?p=1385433" rel="nofollow noreferrer">h...
<p>Something like that happened to me a few days ago and it turns out it's not related to Tortoise... I'm using Mozy to backup files automatically and their latest update includes icons very similar to Tortoise to mark backed-up files.</p>
<p>agree with marxidad,</p> <p>you can also try to rebuild the tortoisesvn icon cache using </p> <blockquote> <p>TortoiseProc.exe /command:rebuildiconcache</p> </blockquote> <p>from the command line.</p>
28,787
<p>Trying to answer to another post whose solution deals with IP addresses and netmasks, I got stuck with plain bitwise arithmetic.</p> <p>Is there a standard way, in Python, to carry on bitwise AND, OR, XOR, NOT operations assuming that the inputs are "32 bit" (maybe negative) integers or longs, and that the result m...
<p>You can mask everything by <code>0xFFFFFFFF</code>:</p> <pre><code>&gt;&gt;&gt; m = 0xFFFFFF00 &gt;&gt;&gt; allf = 0xFFFFFFFF &gt;&gt;&gt; ~m &amp; allf 255L </code></pre>
<p>This is a module that I created a long time ago, and it might be of help to you:</p> <p><a href="http://pypi.python.org/pypi/IPv4_Utils/0.35" rel="nofollow noreferrer">IPv4Utils</a></p> <p>It provides at least a <code>CIDR</code> class with subnet arithmetic. Check the test cases at the end of the module for examp...
25,856
<p>I would like to access micro-state accounting timers programmatically on Linux. I guess the first part of the question is where are these available? Which kernel versions and distros? Which hardware platforms? The second part is how to actually go about accessing the timers? What is the system call?</p> <p>Here is ...
<p>Patches and user-space programs are available at <a href="http://www.gelato.unsw.edu.au/patches/" rel="nofollow noreferrer">http://www.gelato.unsw.edu.au/patches/</a>. As the patches did not migrate upstream, <a href="http://www.uwsg.iu.edu/hypermail/linux/kernel/0503.1/1190.html" rel="nofollow noreferrer">seemingly...
<p>Searching for MSA_SELF on google shows that it was last discussed years ago, and a quick look upstream shows that it isn't in the upstream kernel. So I think it's fair to say "this data isn't available".</p> <p>You might want to look at clock_getres() etc.</p>
23,121
<p>i know this is an age old question, but this is my scenario</p> <p>This is in C# 2.0</p> <p>Have a windows application which has a datagridview control. This needs to be populates by making a webservice call.</p> <p>I want to achive the same functionality on the data if i were to use a direct connection and if i ...
<p>I might look at <a href="http://msdn.microsoft.com/en-gb/magazine/cc748663.aspx" rel="nofollow noreferrer">ADO.NET Data Services</a>, aka Astoria, in VS2008 SP1.</p> <p>This allows you to expose data over a web-service (WCF exposing ATOM, IIRC) - but you don't need to know all these details: the tooling worries abo...
<p>fallen888 has it right - you will need to create a collection class of List or a DataTable, fill it with the output from the webservice data stream, and handle paging and filtering yourself yourself.</p>
25,268
<p>I have a website that is perfectely centered aligned. The CSS code works fine. The problem doesn't really have to do with CSS. I have headers for each page that perfectely match eachother.</p> <p>However, when the content gets larger, Opera and FireFox show a scrollbar at the left so you can scroll to the content n...
<p>I use </p> <pre><code>html { overflow-y: scroll; } </code></pre> <p>To standardize the scrollbar behavior in IE and FF</p>
<p>Are you aligning with percentage widths or fixed widths? I'm also guessing you're applying a background to the body - I've had this problem myself.</p> <p>It'll be much easier to help you if you upload the page so we can see the source code however.</p>
4,654
<p>Is it possible to assign a blank string (i.e. "") as a Default Value in the Entity Framework's EDMX designer? The only technique I've found is to edit the edmx file manually using a text editor</p>
<p>I realize that this is an extremely old question, but for posterity's sake, in the EF4 designer you can type a space in the properties window field, then hit backspace, leaving the field empty instead of the default value of (None). For strings, this seems to default to String.Empty.</p>
<p>Yes, the only way that I've found to set an empty string as the default value is to edit the EDMX. Editing the designer file doesn't work as the code is regenerated.</p> <p>This is really a bug in the entity framework that needs to be addressed.</p> <p>EDIT: Actually, setting an empty string in XML is quite pain...
44,632
<p>I have a first dialog with a simple button on it and while clicking the button, a second dialog is created using CDialog::Create(IDD,this). I would like the parent to be notified when the second dialog is destroyed but without adding any code to the second dialog i.e., without adding a m_pParent->Notify() line in On...
<p>Use a base class and have your parent refer to the modeless child by base class only. In the base PostNcDestroy have it post to the parent.</p> <p>It doesn't make sense to have the parent do a bunch of filtering / spying on all messages. It does make sense to implement behavior in a base class that you want to hav...
<p>How about posting a main parent form event to the message queue?</p>
36,896
<p>I'm searching for a <strong>PHP syntax highlighting engine</strong> that can be customized (i.e. I can provide my <strong>own tokenizers</strong> for new languages) and that can handle several languages <em>simultaneously</em> (i.e. on the same output page). This engine has to work well together with <strong>CSS cla...
<p>Since no existing tool satisfied my needs, I wrote my own. Lo and behold:</p> <h2><a href="https://github.com/klmr/hyperlight" rel="noreferrer">Hyperlight</a></h2> <p>Usage is extremely easy: just use</p> <pre><code> &lt;?php hyperlight($code, 'php'); ?&gt; </code></pre> <p>to highlight code. Writing new languag...
<p>Krijn Hoetmer's <a href="http://krijnhoetmer.nl/stuff/php/php-highlighter/" rel="nofollow noreferrer">PHP Highlighter</a> provides a completely customizable PHP class to highlight PHP syntax. The HTML it generates, validates under a strict doctype, and is completely stylable with CSS.</p>
28,506
<p>I've attempted to use the EstimatedSize value during creation of an uninstaller registry key for an app I've developed, unfortunately the value I specify does not appear in the Add/Remove Program list next to my program's entry. I've tried to find the proper procedure for using this value but to no avail. Anyone h...
<p>I figured out that changing the value of EstimatedSize under </p> <pre><code>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{my-guid-value} </code></pre> <p>does not have any direct effect. This value is cached in the following key:</p> <pre><code>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Wind...
<p>What kind of installer did you use? MSI? </p> <p>Windows Installer will determine and set this value during installation (see MSDN: <a href="http://msdn.microsoft.com/en-us/library/aa372105.aspx" rel="nofollow noreferrer">Uninstall Registry Key</a>)</p> <p>I think it is not possible to manually set this value. The...
41,035
<p>Is there a way to use sql-server like analytic functions in Hibernate?</p> <p>Something like </p> <pre><code>select foo from Foo foo where f.x = max(f.x) over (partition by f.y) </code></pre>
<p>You are after a native SQL query.</p> <p>If you are using JPA the syntax is:</p> <pre><code>Query q = em.createNativeQuery("select foo.* from Foo foo " + "where f.x = max(f.x) over " + "(partition by f.y)", Foo.class); </code></pre> <p>If you need to r...
<p>Another approach would be to use the mapping. Please see this article: <a href="https://forums.hibernate.org/viewtopic.php?f=1&amp;t=998482" rel="nofollow noreferrer">https://forums.hibernate.org/viewtopic.php?f=1&amp;t=998482</a></p> <p>I am against the usage of native SQL queries in Hibernate... you lose the bene...
9,976