instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>i am working on a Sharepoint Server 2007 Statemachine Workflow. Until now i have a few states and an custom Association/InitiationForm which i created with InfoPath 2007. At the moment i have a Problem with Modification forms. The modification link in the state page of my workflow is shown and leads on click to my I...
<p>Thank you very much. I found the following Error Message in the Logfile:</p> <p>"Form load failed with a validation error"</p> <p>I searched in the web for solutions for this problem and fount this site:</p> <p><a href="http://social.msdn.microsoft.com/forums/en-US/sharepointworkflow/thread/83264f93-ebe3-49ec-bd6...
<p>Look in your ULS logs for the error message. It will be listed there 100%. The category is "Forms Services" - the logs are located under the 12 hive in LOGS\</p>
15,566
<p>I have to put an excel file online on a web server (Apache) with some basic password protection (basic http auth). User, however, should be able to open the file from within excel and save their changes back to the server. </p> <p>Is there any simple and effective solution for it? I am not very experienced with web...
<p>Maybe use <a href="http://docs.google.com/" rel="nofollow noreferrer">Google Docs</a> to share the document. That would be as turn-key as it gets. :)</p>
<p>Webdav can do this. Might be a hassle to set it up.</p>
18,725
<p>We are designing a survey application with the following features</p> <ol> <li>The users will be able to select questions from a set of predefined questions.</li> <li>Each question has a question type defined which dictates the type of answer (multiple choice, DB look up, free text etc) </li> <li>The user can creat...
<p>This may not be an exact fit, but worth looking at: <a href="http://www.surveymonkey.com/" rel="nofollow noreferrer">Surveymonkey</a>.</p>
<p><a href="http://www.nsurvey.org/" rel="nofollow noreferrer">NSurvey</a> used to exist for this, but I think they've gone solely commercial. If you can dig up the last open source release, it might be a good starting point.</p> <p>Otherwise, don't build it. Subscribe to <a href="http://wufoo.com" rel="nofollow noref...
21,173
<p>The MSDN states that the method returns</p> <blockquote> <p>true if the method is successfully queued; NotSupportedException is thrown if the work item is not queued.</p> </blockquote> <p>For testing purposes how to get the method to return <code>false</code>? Or it is just a "suboptimal" class design?</p>
<p>In looking at the source code in Reflector, it seems the only part of the code that could return "false" is a call to the following:</p> <pre><code>[MethodImpl(MethodImplOptions.InternalCall)] private static extern bool AdjustThreadsInPool(uint QueueLength); </code></pre>
<p>This is probably a case of "reserved for future use". You may want to treat it as failure, but it'll be hard to test.</p> <p>I pretty much treat this method as a void/Sub.</p>
18,160
<p>What is the return value of the <code>WaitForObject()</code> function?</p> <p>I do not mean the type of return value (int).</p> <p>What does it return if the event is signalled and what does it return if the event is not signalled?</p>
<p>There is no <code>WaitForObject</code> function. I assume that you mean either <code>WaitForSingleObject</code> or <code>WaitForMultipleObjects</code>.</p> <p><code>WaitForSingleObject</code> will return <code>WAIT_TIMEOUT</code>, <code>WAIT_OBJECT_0</code> or <code>WAIT_ERROR</code>. <code>WaitForMultipleObjects</c...
<p>This question isn't C++. C++ has no API called <code>WaitForObject</code>. The Windows API has a function called <code>WaitForSingleObject</code> and another called <code>WaitForMultipleObjects</code>.</p> <p>These functions return -1 on failure, 0 if the first object in the array is signalled, and a number &gt;= ...
25,613
<p>How do I find the name of the namespace or module 'Foo' in the filter below?</p> <pre><code>class ApplicationController &lt; ActionController::Base def get_module_name @module_name = ??? end end class Foo::BarController &lt; ApplicationController before_filter :get_module_name end </code></pre>
<p>None of these solutions consider a constant with multiple parent modules. For instance:</p> <pre><code>A::B::C </code></pre> <p>As of Rails 3.2.x you can simply:</p> <pre><code>"A::B::C".deconstantize #=&gt; "A::B" </code></pre> <p>As of Rails 3.1.x you can:</p> <pre><code>constant_name = "A::B::C" constant_na...
<p>I don't think there is a <em>cleaner</em> way, and I've seen this somewhere else</p> <pre><code>class ApplicationController &lt; ActionController::Base def get_module_name @module_name = self.class.name.split("::").first end end </code></pre>
16,144
<p>What is the best method to parse multiple, discrete, custom XML documents with Java?</p>
<p>I would use <a href="http://jcp.org/en/jsr/detail?id=173" rel="noreferrer">Stax</a> to parse XML, it's fast and easy to use. I've been using it on my last project to parse XML files up to 24MB. There's a nice introduction on <a href="http://today.java.net/pub/a/today/2006/07/20/introduction-to-stax.html" rel="norefe...
<p>Below is the code of extracting some value value using <a href="http://vtd-xml.sf.net" rel="nofollow">vtd-xml</a>.</p> <pre><code>import com.ximpleware.*; public class extractValue{ public static void main(String s[]) throws VTDException, IOException{ VTDGen vg = new VTDGen(); if (!vg.parseFil...
4,311
<p>After "check-in" of a <code>.docx</code> file to <code>SharePoint</code> and editing it the <code>RevNum</code> property is set to <code>2</code>.</p> <p>This does not make sense, can someone explain why this is?</p>
<p>Well, first of all, you're wasting memory with the new <code>HashMap</code> creation call. Your second line completely disregards the reference to this created hashmap, making it then available to the garbage collector. So, don't do that, use:</p> <pre><code>private Map&lt;String, String&gt; someMap = (HashMap&lt;S...
<p>Another solution, if you find yourself casting the same object a lot and you don't want to litter your code with <code>@SupressWarnings("unchecked")</code>, would be to create a method with the annotation. This way you're centralizing the cast, and hopefully reducing the possibility for error.</p> <pre><code>@Suppr...
32,835
<p>I have a spreadsheet with a dataset of a number of transactions, each of which is composed of substeps, each of which has the time that it occurred. There can be a variable number and order of steps.</p> <p>I'd like to find the duration of each transaction. If I can do this in Excel then great, as it's already in...
<p>You were on the right lines with pivot tables. Drag in TransID as a row field then drag in two copies of Time as data fields in the pivot table; right click on each and specify Min as the summarization function for one and Max for the other. To the right of the pivot table add a formula to calculate the difference.<...
<p>Sometimes it is possible to do something once in Excel far more easily than it is to do something repeatably.</p> <p>Assuming you are just trying to get the answer once or twice, and then throw away the spreadsheet (as opposed to run it every night, or give it to someone else to run), here's how I would do it.</p> ...
43,038
<pre><code>const static int foo = 42; </code></pre> <p>I saw this in some code here on StackOverflow and I couldn't figure out what it does. Then I saw some confused answers on other forums. My best guess is that it's used in C to hide the constant <code>foo</code> from other modules. Is this correct? If so, why would...
<p>It has uses in both C and C++.</p> <p>As you guessed, the <code>static</code> part limits its scope to that <a href="https://stackoverflow.com/questions/1106149/what-is-a-translation-unit-in-c">compilation unit</a>. It also provides for static initialization. <code>const</code> just tells the compiler to not let an...
<p>Making it private would still mean it appears in the header. I tend to use "the weakest" way that works. See this classic article by Scott Meyers: <a href="http://www.ddj.com/cpp/184401197" rel="nofollow noreferrer">http://www.ddj.com/cpp/184401197</a> (it's about functions, but can be applied here as well).</p>
21,374
<p>I have created a report in MS Access report and write some VBA code to retrive data and show the report in MS-Word format. But while generate the report on runtime, the report first show or flash the report design view for few seconds and the report will get generated. </p> <p>I would like to find a solution to av...
<p>It seems you are opening the report in design view in order to change some property. It may be possible to avoid this, but you would need to post the code that opens the report to say for sure.</p>
<p>How are you exporting the report to MS-Word? What's the code?</p> <p>Have you tried the same thing with a simple report (with a table data source) instead of using VBA code? Maybe the VBA is taking so long to run that it's holding the Report open in design mode long enough to be perceptible.</p>
32,666
<p>I tried this step:</p> <p>Select the menu options "Project > New Build Phase > New Run Script Build Phase", and enter the following script (don't forget to replace /Users/youruser/bin by the correct path to gen_entitlements.py) :</p> <pre><code>export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Develo...
<p>Select the Run Script phase in your target and delete it.</p> <p><img src="https://i.stack.imgur.com/pQ9uu.png" alt="Delete"></p>
<ol> <li>In the Project Navigator go to the upper left hand corner and select the blue icon</li> </ol> <p><a href="https://i.stack.imgur.com/PGLfm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PGLfm.png" alt="enter image description here"></a></p> <ol start="2"> <li>In the top center of the scree...
31,502
<p>I would like to be able to monitor my major system health indicators from inside our Java-based system. Major points of interest include CPU temperature, motherboard temperature, fan speed, etc. </p> <p>Is there a package available that:</p> <ol> <li>Makes this sort of data available to Java?</li> <li>Works on W...
<p>The closest thing you'll find is the Hyperic Sigar library:</p> <p><a href="http://www.hyperic.com/products/sigar.html" rel="noreferrer">http://www.hyperic.com/products/sigar.html</a></p> <p>It doesn't get down to temperatures AFAIK but does show you a number of native stats like CPU, memory, disk I/O, network I/O...
<p>A few months ago I looked for such a library and I found nothing interesting. It is not impossible to create one, so I would recommend doing so. You'll probably need to access native libraries, to do that use <a href="https://github.com/twall/jna" rel="nofollow noreferrer">JNA</a> (it's easier than JNI). Start by ad...
14,260
<p>I'm new to this SCM, but since SVN is gaining popularity I was going to give it a try.</p> <p>Things I noticed:</p> <ol> <li>SVN is only the backbone of the SCM, no front-end?</li> <li>Why is there several versions of Windows Binaries? Tigris? SlikSVN? VisualSVN?</li> <li>Do I need a Web Server like Apache in orde...
<p><a href="http://blog.excastle.com/2007/04/09/subversion-in-delphis-tools-menu/" rel="nofollow noreferrer">Here's a great guide</a> for integrating TortoiseSVN with Delphi's "Tools" menu.</p> <p>This site shows how to add the following into the IDE:</p> <ol> <li><p><code>svn Commit</code>: Opens the TortoiseSVN com...
<p>Set up svn on a windows or linux box somewhere and enable the SVN: protocol. This pretty simple to install and configure. The documentation is pretty clear.</p> <p>Then use TortoiseSVN to check in/update your code. It's really easy to use.</p> <p>1) SVN is only the backbone of the SCM, no front-end? It's command ...
48,404
<p>Right now, I am trying to create a plug-in of Eclipse which depends on other jar; therefore, I created a plug-in base on the jar and deployed it under my Eclipses' plugin foler. It works well when I start it from my working environment via an Eclipse. However, as soon as I have exported it into a jar and have deploy...
<p>The MANIFEST.MF has a Tab called "Dependencies" in which alle plugins should placed the current plugin depends on. At runtime you have to place the "dependencies" plugins in the same folder as the one you want to start or you want to work with.</p> <p>When a plugin has jars it should use, you have to put the jars t...
<p>The working behavior out of Eclipse is normal, since the dependent jar is in the classpath of the project.</p> <p>Have you had a look at the plugin folder you deployed? I suspect, that the dependency isn't contained in the plugin folder.</p>
43,186
<p>After selecting "Safe Remove" option in windows system tray, is there any way that I can re-detect my Flash by a code, without plug it out and again inserting it to the computer USB port?</p>
<p>You can look at re-scanning the system for devices. Test this with Microsoft's <a href="http://support.microsoft.com/kb/311272" rel="nofollow noreferrer">devcon</a> tool (this demonstrates SetupAPI and CfgMgr32 functionality). The source code for the tool is available in the <a href="http://www.microsoft.com/whdc/...
<p>The program "USB Safely Remove" do that and more. But is shareware.</p>
44,746
<p>Sounds easy, but I can't find where this built in class and others exists in the documentation. I use functions but want to know what there is on the OO side.</p>
<p>It's not a URL or anything, but you can get a fair idea using Reflection:</p> <pre><code>Reflection::export(new ReflectionClass('DateTime')); Class [ class DateTime ] { - Constants [11] { Constant [ string ATOM ] { Y-m-d\TH:i:sP } Constant [ string COOKIE ] { l, d-M-y H:i:s T } Constant [ string IS...
<p>There is a list of new classes in PHP 5.2.0 here:</p> <p><a href="http://www.php.net/manual/en/migration52.classes.php" rel="nofollow noreferrer">http://www.php.net/manual/en/migration52.classes.php</a></p> <p>..which links to the new DateTime class info here:</p> <p><a href="http://www.php.net/manual/en/ref.date...
40,872
<p>I imagine there are many of you out there who have developed an application online which automates a lot of processes and saves people at your company time and money.</p> <p>The question is, what are your experiences with developing that application, having it all set in place, then "spicing" it up with some Ajax, ...
<p>My preferred way of building Ajax-enabled applications is to build it the old-fashioned way where every button, link, etc. posts to the server, and then hijack all those button, link, etc. clicks to the Ajax functionality.</p> <p>This ensures that my app is down-browser compatible, which is good.</p>
<p>If you are using ASP.NET to write your applications, adding AJAX using ASP.NET AJAX is very straightforward and in many places will not require you to change any code at all except add two controls to the pages you want to modify.</p> <p>This works using partial page loads. The controls you have to add (off the top...
25,801
<p>I created an ASMX file with a code behind file. It's working fine, but it is outputting XML.</p> <p>However, I need it to output JSON. The ResponseFormat configuration doesn't seem to work. My code-behind is:</p> <pre><code>[System.Web.Script.Services.ScriptService] public class _default : System.Web.Services.WebS...
<p>From <a href="http://forums.asp.net/p/1327142/2652827.aspx" rel="noreferrer">WebService returns XML even when ResponseFormat set to JSON</a>:</p> <blockquote> <p>Make sure that the request is a POST request, not a GET. Scott Guthrie has a <a href="http://weblogs.asp.net/scottgu/archive/2007/04/04/json-hijacking-an...
<p>Are you calling the web service from client script or on the server side?</p> <p>You may find sending a content type header to the server will help, e.g. </p> <p>'application/json; charset=utf-8'</p> <p>On the client side, I use prototype client side library and there is a contentType parameter when making an Aja...
25,968
<p>I've done most of my work on VisualStudio and don't have much experience with gcc or g++. When I tried to compile a (ex. aprogram.cpp) this morning on my pc using cygwin, I got (aprogram.exe) when I tried to compile the same thing on my Ubuntu box I got (aprogram) w/o any extension. I am just wondering if someone be...
<p>It's just a naming convention. On Unix/Linux, executables don't have an extension, just an executable bit.</p>
<p>ls /bin There are lot's of programs and all of them without extension :)</p> <p>ls -l /bin you will see that all of them has +x flag to mark them as an executable.</p>
46,925
<p>How do I write a cpp macro which expands to include newlines?</p>
<p>I am working on a large project that involves a lot of preprocessor macro functions to synthesize any code that cannot be replaced by templates. Believe me, I am familiar with all sorts of template tricks, but as long as there is no standardized, type safe metaprogramming language that can directly create code, we w...
<p>Use <code>\</code>, like so:</p> <pre><code>#define my_multiline_macro(a, b, c) \ if (a) { \ b += c; \ } </code></pre>
12,425
<p>I use a axis to auto-generate webservice artifacts which I then convert into objects used within our application. Is there a sensible pattern for doing this ? We have written transform methods to output our objects from the axis created objects, at other times we have written an intermediate set of transformer class...
<p>If I understand correctly, you want to use Axis WSDL2Java feature to generate code from a WSDL and then map that to your existing application object model. In that case, you might want to consider to use Axis with <a href="http://jibx.sourceforge.net/" rel="nofollow noreferrer">JiBX</a> binding.</p>
<p>We have run into similar issues in the past. Recently, for a complex web service that we had Axis generate artifacts for, we wound up with 157 Java classes with names like "MaintainOffersRequestTypeReqReqDataMaintEnhancementCancellationReason".</p> <p>We wound up writing classes that transform these Axis-generated...
29,774
<p>Let's say we have <code>0.33</code>, we need to output <code>1/3</code>. <br /> If we have <code>0.4</code>, we need to output <code>2/5</code>.</p> <p>The idea is to make it human-readable to make the user understand "<strong>x parts out of y</strong>" as a better way of understanding data.</p> <p>I know that per...
<p>I have found David Eppstein's <a href="http://www.ics.uci.edu/%7Eeppstein/numth/frap.c" rel="nofollow noreferrer">find rational approximation to given real number</a> C code to be exactly what you are asking for. Its based on the theory of continued fractions and very fast and fairly compact.</p> <p>I have used ver...
<p>As many people have stated you really can't convert a floating point back to a fraction (unless its extremely exact like .25). Of course you could create some type of look up for a large array of fractions and use some sort of fuzzy logic to produce the result you are looking for. Again this wouldn't be exact thou...
12,126
<p>My question is, which version-naming scheme should be used for what type of project.</p> <p>Very common is major.minor.fix, but even this can lead to 4 number (i.e. Firefox 2.0.0.16). Some have a model that odd numbers indicate developer-versions and even numbers stable releases. And all sorts of additions can ente...
<p>There are <strong>two</strong> good answers for this (plus a lot of personal preferences; see gizmo's comment on religious wars).</p> <p>For <strong>public</strong> applications, the standard <code>Major.Minor.Revision.Build</code> works best IMO - public users can easily tell what version of the program they have a...
<p>The difference between a close and open-source version number policy can also come from a <strong>commercial aspect</strong>, when the major version can reflect the year of the release for instance.</p>
14,809
<p>I'm building a <a href="https://en.wikipedia.org/wiki/Windows_Forms" rel="nofollow noreferrer">Windows Forms</a> form in C# with various elements in a panel that starts out either invisible, disabled, or set to null (labels, combo boxes, grids, etc.). As the user goes through and makes choices, these elements are po...
<p>Simply remove the panel from the form and create the new one.</p> <p>Sample:</p> <pre><code>Panel CreatePanelWithDynamicControls() { Panel ret = new Panel(); ret.Dock = DockStyle.Fill; // Some logic, which initializes content of panel return ret; } void InitializeDynamicControls() { this.Contro...
<p>You could try calling this.InitializeComponent(), which may do the trick. Alternately, if your application has a 'Directory Select' form and a 'Process Files' form, you could have the Directory Select form do a "new" on the Process Files form, which should return it to its original state (not while its open, though...
43,814
<p>I'd like to be able to run my aliases from my .bashrc in the "Run Application" dialog that comes up when you hit Alt+F2 in Ubuntu/Gnome.</p> <p>Does anyone know how to do this?</p>
<p><a href="http://www.freedesktop.org/wiki/Specifications" rel="nofollow noreferrer">http://www.freedesktop.org/wiki/Specifications</a> is probably a good place to start. I find these quite hard to follow most of the time, but sometimes you can figure it out. Specifically, the "Desktop Entry Specification".</p> <p>Al...
<p>Instead of using alt-f2 to run commands outside the terminal, I use gnome-do instead; it is much more convenient &amp; flexible (once it's set up). You're still not going to be able to run shell "aliases", but you can configure gnome-do to use the "files and folders" plugin, and then any "*.desktop" applications you...
22,712
<p>I have a friend that has a little bit of a holiday coming up and they want ideas on what they should do during the holiday, I plan to suggest programming to them, what are the pros and cons that I need to mention?</p> <p>I'll add to the list below as people reply, I apologise if I duplicate any entries.</p> <p><st...
<h2>I do it for the ladies :D</h2> <p>Seriously though, for me</p> <h3>Pro's</h3> <ul> <li>Great challenge, every day really is a fresh challenge in some way, shape or form. Not many jobs can truly offer that.</li> <li>I like the way it makes me think.. I look at EVERYTHING more logically as my skills improve.. This he...
<p>You could tell him how into programmers girls are.. you know, lie.</p>
3,205
<p>Imagine I have the following:</p> <pre><code>inFile = "/adda/adas/sdas/hello.txt" # that instruction give me hello.txt Name = inFile.name.split("/") [-1] # that one give me the name I want - just hello Name1 = Name.split(".") [0] </code></pre> <p>Is there any chance to simplify that doing the same job in just on...
<p>You can get what you want platform independently by using <a href="http://docs.python.org/library/os.path.html#os.path.basename" rel="nofollow noreferrer">os.path.basename</a> to get the last part of a path and then use <a href="http://docs.python.org/library/os.path.html#os.path.splitext" rel="nofollow noreferrer">...
<p>I'm pretty sure some Regex-Ninja*, would give you a more or less sane way to do that (or as I now see others have posted: ways to write two expressions on one line...)</p> <p>But I'm wondering why you want to do split it with just one expression? For such a simple split, it's probably faster to do two than to crea...
41,972
<p>How do I get the directory where the rakefile.rb is located?</p> <p>I want to use this as my root directory to locate everything off.</p>
<p>use <code>__FILE__</code> to get the file name then you can get the directory from there:</p> <p>in <code>test.rb</code></p> <pre><code>puts __FILE__ </code></pre> <p>output:</p> <pre><code>/users/foo/test.rb </code></pre> <p><code>__FILE__</code> resolves to the full path of the file it is in. </p> <p>Use thi...
<p>If this is a RoR app your Rakefile.rb should be in your RAILS_ROOT directory. So in any script you can specify file location like </p> <pre><code> config.load_paths += %W( #{RAILS_ROOT}/extras ) </code></pre>
29,274
<p>I'm trying to extend some "base" classes in Python:</p> <pre><code>class xlist (list): def len(self): return len(self) def add(self, *args): self.extend(args) return None class xint (int): def add(self, value): self += value return self x = xlist([1,2,3]) pri...
<p>Your two <code>xint</code> examples don't work for two different reasons.</p> <p>The first doesn't work because <code>self += value</code> is equivalent to <code>self = self + value</code> which just reassigns the local variable <code>self</code> to a different object (an integer) but doesn't change the original ob...
<p>Ints are immutable and you can't modify them in place, so you should go with option #2 (because option #1 is impossible without some trickery).</p>
5,363
<p>I feel like I have a very basic/stupid question, yet I never saw/read/heard anything in this direction.</p> <p>Say I have a table <em>users(userId, name)</em> and a table <em>preferences(id, userId, language)</em>. The example is trivial but could be extended to a situation with multi-level relations and way more t...
<p>What I would do is this:</p> <ol> <li>The constraint is CASCADE</li> <li>The application checks if preferences exist.</li> <li>If they do, show the warning.</li> <li>If no preferences exist, or the warning is accepted, delete the client.</li> </ol> <p>Changing database relationships on the fly is not going to be a...
<p>If you are worried about the user not realising the full impact of their delete, you might want to consider not actually deleting the data - instead you could simply set a flag on a column called say "<code>marked_for_deletion</code>". (the entries could then be deleted a safe time later)<br> The downside is that yo...
10,728
<p>How would you programmacially abbreviate <code>XHTML</code> to an arbitrary number of words without leaving unclosed or corrupted tags?</p> <p>i.e.</p> <pre><code>&lt;p&gt; Proin tristique dapibus neque. Nam eget purus sit amet leo tincidunt accumsan. &lt;/p&gt; &lt;p&gt; Proin semper, orci at mattis b...
<p>Here's what I did:</p> <pre><code>&lt;link rel="Stylesheet" type="text/css" href="Stylesheet.css" id="style" runat="server" visible="false" /&gt; </code></pre> <p>It fools Visual Studio into thinking you've added a stylesheet to the page but it doesn't get rendered.</p> <hr> <p>Here's an even more concise way to...
<p>You Can use <code>CSS</code> direct in <code>userControl</code>.</p> <p>Use this in <code>UserControl</code>:</p> <pre><code> &lt;head&gt; &lt;title&gt;&lt;/title&gt; &lt;style type="text/css"&gt; .wrapper { margin: 0 auto -142px; /* the bottom margin is the negative value of the...
5,460
<p>Is there an API call in .NET or a native DLL that I can use to create similar behaviour as Windows Live Messenger when a response comes from someone I chat with?</p>
<p>FlashWindowEx is the way to go. See <a href="http://msdn.microsoft.com/en-us/library/ms679347%28VS.85%29.aspx" rel="noreferrer">here for MSDN documentation</a></p> <pre><code>[DllImport("user32.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool FlashWindowEx(ref FLASHWINFO pwfi); [StructLayout(Layou...
<p>I believe you're looking for <a href="http://msdn.microsoft.com/en-us/library/ms633539.aspx" rel="nofollow noreferrer"><code>SetForegroundWindow</code></a>.</p>
9,885
<p>I'm trying to add an header file to dev-C++ but when I compile it it doesn't work. Here are my exact steps (for my example, I'm trying to get mysql.h to work):</p> <ol> <li>copy "mysql.h" into c:\dev-c++\includes</li> <li>check that in dev-C++ tools > compiler options > directories > c includes and c++ includes hav...
<p>Dev-C++ is a port of GCC, so try this page: <a href="http://gcc.gnu.org/onlinedocs/cpp/Search-Path.html#Search-Path" rel="nofollow noreferrer">http://gcc.gnu.org/onlinedocs/cpp/Search-Path.html</a>. </p> <p>Note that you probably have to tinkle with the Makefile.</p>
<p>On the left side, right click the Project and choose "Add to Project", and then select the header file.</p>
32,171
<p>I spent the last days trying to make the best gears I could but they are not "smooth" nor good. I searched at thingverse with "gear" but I see no set of gears. I would like someone to point me a good set of gears (with 5, 10, 15... teeth for example) so I can use this STL file with Google Sketchup.</p> <p>Do you gu...
<p>This type of gear is known as a "herringbone" gear. A traditional straight-cut gear is strong, but can cause more vibration as each tooth engages and disengages. A helical gear (slanted tooth) reduces that vibration as the tooth engagement is more uniform. However the angle of the teeth causes a sideways force that ...
<p>As for high speed gear ideas why don't you design your own if there aren't any good ones. I will admit sometimes there will be surprising lack of content in some areas and I dont know what you expect, sometimes you do have to do some things your self to bridge the gaps. Maybe try looking into automobile transmission...
558
<p>While Scrum is easy in theory and hard in practice, I wanted to hear your definition of Done; i.e. what are the gates (unit test, code coverage > 80%, code reviews, load tests, perf.test, functional tests, etc.) your product has to go through before you can label the product "Done"</p>
<p>I'd say it is up to your team to decide. Talk with the product owner. Ideally done would be when a story is in Production and being used. However, there is a time gap between when a story is development complete and in Live. Makes it hard to track how long a story took to develop.</p> <p>In my team, our definition ...
<p>Everything that will make your "stabilization period" (ie work required between the code freeze and the release to the client) shorter.</p>
20,520
<p>So I have an Oracle instance, and I know it's running on this system, I've su'd to the oracle user, and I'm trying to connect using "/ as sysdba". However, when I do connect, it says the instance is idle. I know the database is up and opened, because my application's talking to it. My paths (ORACLE_HOME, etc.) mi...
<p>make sure you have your ORACLE_HOME setup exactly the same as when the server was started, I've seen this problem with oracle 9.2.0.5.0 on solaris, </p> <pre><code>ORACLE_HOME=/opt/oracle ORACLE_HOME=/opt/oracle/ </code></pre> <p>is two different things, and will result in issues connecting locally.</p>
<p>The problem can be if the session could not be opened due to extremally busy database. in this case connection using any user even dummy one</p> <p>sqlplus dummy/dummy</p> <p>would give you actual problem but not idle instance.</p>
45,529
<p>We've been using the 32bit linux version of the <a href="http://wrapper.tanukisoftware.org/" rel="nofollow noreferrer">JavaServiceWrapper</a> for quite a while now and it's working perfectly. We are now considering also using it on 64bit linux systems. There are downloads for 64bit binaries on the website, but looki...
<p>I've had it running in production on 64-bit red hat without any trouble for the last year or so. </p>
<p>Take a look at <a href="http://yajsw.sourceforge.net/" rel="nofollow">http://yajsw.sourceforge.net/</a>. </p> <p>It's free and rather compatible reimplementation of TanukiSoftware Java Service Wrapper featuring free 64-bit support.</p>
4,719
<p>I've create a WinForms control that inherits from System.Windows.Forms.UserControl...I've got some custom events on the control that I would like the consumer of my control to be able to see. I'm unable to actually get my events to show up in the Events tab of the Properties window during design time. This means the...
<p>Make sure your events are exposed as public. For example...</p> <pre><code>[Browsable(true)] public event EventHandler MyCustomEvent; </code></pre>
<p>A solution using delegate. For example i used for a custom ListView which handle item added event : Declare your delegate :</p> <pre><code> public delegate void ItemAddedHandler(object sender, ItemEventArgs e) </code></pre> <p>then declare the event which use the delegate :</p> <pre><code> [Browsable(true)] ...
17,258
<p>I am just looking at the using statement, I have always known what it does but until now not tried using it, I have come up with the below code:</p> <pre><code> using (SqlCommand cmd = new SqlCommand(reportDataSource, new SqlConnection(Settings.Default.qlsdat_extensionsConnectionString))) { cm...
<p>When doing IO work I code to <em>expect</em> an exception.</p> <pre><code>SqlConnection conn = null; SqlCommand cmd = null; try { conn = new SqlConnection(Settings.Default.qlsdat_extensionsConnectionString) cmd = new SqlCommand(reportDataSource, conn); cmd.CommandType = CommandType.StoredProcedure; ...
<p>If the caller of your function is responsible for dealing with any exceptions the using statement is a nice way of ensuring resources are cleaned up no matter the outcome. </p> <p>It allows you to place exception handling code at layer/assembly boundaries and helps prevent other functions becoming too cluttered.</p...
30,941
<p>I have an abstract base class called Shape from which both Circle and Rectangle are derived, but when I execute the following code in VS 2005 I get the error Debug assertion failed. At the same time I have not overloaded == operator in any class</p> <p>Expression:Vector iterator not dereferencable, what is the reas...
<p>Simple :</p> <ul> <li>find fails since your newly created Circle can't be found in the vector with comparing Shape *</li> <li>a failed find returns the end iterator which is not deferencable as caught by a Debug assertion</li> </ul> <p>For it to work like you want, you do need to compare Shape, not Shape*</p> <p>...
<p>This is a good reason to use boost::ptr_vector.</p> <p>It not only handles the fact that your objects need to be destroyed.<br> xtofl@: You forgot the virtual destructor.</p> <p>But it also makes the members look like objects by returning references rather than pointers. This allows you to use the standard algorit...
38,756
<p>Has anyone come up with a good way of performing full text searches (<code>FREETEXT() CONTAINS()</code>) for any number of arbitrary keywords using standard LinqToSql query syntax?</p> <p>I'd obviously like to avoid having to use a Stored Proc or have to generate a Dynamic SQL calls.</p> <p>Obviously I could just ...
<p>Unfortunately LINQ to SQL does not support Full Text Search. </p> <p>There are a bunch of products out there that I think could: Lucene.NET, NHibernate Search comes to mind. LINQ for NHibernate combined with NHibernate Search would probably give that functionality, but both are still way deep in beta.</p>
<p>Unfortunately LINQ to SQL does not support Full Text Search. </p> <p>There are a bunch of products out there that I think could: Lucene.NET, NHibernate Search comes to mind. LINQ for NHibernate combined with NHibernate Search would probably give that functionality, but both are still way deep in beta.</p>
9,326
<p>I have been trying to include a file in a included file e.g</p> <p><strong>main.cpp file</strong></p> <pre><code>#include &lt;includedfile.cpp&gt; int main(){ cout&lt;&lt;name&lt;&lt;endl; } </code></pre> <p><strong>includedfile.cpp</strong></p> <pre><code>#include &lt;iostream&gt; using namespace std; stri...
<p>You cannot have statements exist outside of a method!</p> <pre><code>name = "jim"; // This is outside of any method, so it is an error. </code></pre> <p>You could refactor your code so the variable declaration is also an initial assignment, which should be valid (my C++ is a bit rusty, so I might be wrong on this ...
<p>You have to have a very good reason to include a .cpp file, however. It happens, but it's rare! What exactly are you trying to achieve? Or are you just experimenting?</p>
33,634
<p>I have Oracle SQL Developer already installed and am able to connect to and query Oracle databases.</p> <p>Using Help -> Check for Updates I was able to install the Oracle MySQL Browser extension but there are no connection options for MySQL databases.</p>
<p>Under Tools > Preferences > Databases there is a third party JDBC driver path that must be setup. Once the driver path is setup a separate 'MySQL' tab should appear on the New Connections dialog.</p> <p>Note: This is the same jdbc connector that is available as a JAR download from the MySQL website.</p>
<p>You may find the following relevant as well:</p> <p><a href="https://stackoverflow.com/questions/23797585/oracle-sql-developer-connection-to-microsoft-sql-server/26598722#26598722">Oracle SQL Developer connection to Microsoft SQL Server</a></p> <p>In my case I had to place the <code>ntlmauth.dll</code> in the sql-...
11,517
<p>When I first started using revision control systems like <a href="http://en.wikipedia.org/wiki/Concurrent_Versions_System" rel="nofollow noreferrer">CVS</a> and <a href="http://en.wikipedia.org/wiki/Apache_Subversion" rel="nofollow noreferrer">SVN</a>, I didn't really understand the concepts of the "trunk", branchin...
<p>See these two questions on SO for more information:</p> <ul> <li><a href="https://stackoverflow.com/questions/16142/what-does-branch-tag-and-trunk-really-mean">What does branch, tag and trunk really mean?</a></li> <li><a href="https://stackoverflow.com/questions/15621/subversion-question">Subversion question</a></l...
<p>Eric has an excellent series of articles on Source Control use and organisational best practices. <a href="http://www.ericsink.com/scm/scm_branches.html" rel="nofollow noreferrer">Chapter 7 deals with branches</a> (and yes, it recommends the /trunk/ and /branches/ directories you suggest).</p>
3,833
<p>I need to send packets from one host to another over a <strong>potentially lossy</strong> network. In order to minimize packet latency, I'm not considering TCP/IP. But, I wish to maximize the throughput uisng UDP. What should be the optimal size of UDP packet to use?</p> <p>Here are some of my considerations:</p> ...
<p>The best way to find the ideal datagram size is to do exactly what TCP itself does to find the ideal packet size: <a href="http://en.wikipedia.org/wiki/Path_MTU_discovery" rel="noreferrer">Path MTU discovery</a>.</p> <p>TCP also has a widely used option where both sides tell the other what their MSS (basically, MTU...
<p>Even though the MTU at the switch is 1500, you can have situations (like tunneling through a VPN) that wrap a few extra headers around the packet- you may do better to reduce them slightly, and go at 1450 or so.</p> <p>Can you simulate the network and test performance with different packet sizes?</p>
34,804
<p>I have an application that I'm trying to debug a crash in. However, it is difficult to detect the problem for a few reasons:</p> <ul> <li>The crash happens at shutdown, meaning the offending code isn't on the stack</li> <li>The crash only happens in release builds, meaning symbols aren't available</li> </ul> <p>By...
<p>You can make the symbol files even for the release build. Do that, run your program, attach the debugger, close it, and see the cause of the crash in the debugger.</p>
<p>You seem to have something reading a null pointer - never good.</p> <p>I'm not sure what platform you are on. Under Linux, you could consider using <code>valgrind</code>.</p> <p>What is different about your release builds from your debug builds apart from the presence or absence of the debug information?</p> <p>...
49,734
<p>I am refactoring some CSS on a website. I have been working on, and noticed the absence of traditional HTML IDs in the code. </p> <p>There is heavy use of <code>CssClass='&amp;hellip;'</code>, or sometimes just <code>class='&amp;hellip;'</code>, but I can't seem to find a way to say id='&hellip;' and not have it sw...
<p>The 'crap' placed in front of the id is related to the container(s) of the control and there is no way (as far as I know) to prevent this behavior, other than not putting it in any container. </p> <p>If you need to refer to the id in script, you can use the ClientID of the control, like so:</p> <pre><code>&lt;scri...
<p>.Net will always replace your id values with some mangled (every so slightly predictable, but still don't count on it) value. Do you really NEED to have that id runat=server? If you don't put in runat=server, then it won't mangle it...</p> <p>ADDED: Like leddt said, you can reference the span (or any runat=server...
9,076
<p>I have this:</p> <pre><code>public string Log { get { return log; } protected set { if (log != value) { MarkModified(PropertyNames.Log, log); log = value; } } } </...
<p>You need to use the <a href="http://msdn.microsoft.com/en-us/library/system.reflection.bindingflags.aspx" rel="nofollow noreferrer">BindingFlags</a>. Something like </p> <pre><code>PropertyInfo property = type.GetProperty("MyProperty", BindingFlags.Public | BindingFlags.SetProperty | BindingFlags.Instance); </code>...
<p>Inside your ReflectionHelper.GetPropertyInfo(), you presumably to a boundObjectType.GetType().GetProperties(), where the BindingFlags parameter apparently includes BindingFlags.NonPublic. You want to specify just BindingFlags.Public</p>
22,747
<p>I am interested in calling <a href="http://sourceforge.net/projects/sox" rel="nofollow noreferrer">SoX</a>, an open source console application, from another Windows GUI program (written in Delphi naturally). Instead of dealing with scraping and hiding the console window, I would like to just convert the application...
<p>For the specific topic of turning a console executable into a library by modifying the C source code, it depends on how the command-line application is factored. If it's written in such a way that I/O is funneled through a small set of functions or even better function pointers, then obviously it will be trivial.</p...
<p>You don't mention what your toolchain is, but if you configure gcc in Windows, you can use the normal config;make;make install to just compile sox. In the process, it will create a dll file, and the console app. Or, you can just specify the make target to only make the dll. This will compile a windows native libr...
15,933
<p><code>select max(DELIVERY_TIMESTAMP) from DOCUMENTS;</code> will return the time that the latest document was delivered. How do I return <strong>the other columns</strong> for the latest document? For example I want <code>DOC_NAME</code> for the document that was most recently delivered?</p> <p>I'm not sure how to ...
<p>You have a few options</p> <pre><code>SELECT DOC_NAME FROM DOCUMENTS WHERE DELIVERY_TIMESTAMP IN ( SELECT MAX(DELIVERY_TIMESTAMP) FROM DOCUMENTS ) </code></pre> <p>Or with joins</p> <pre><code>SELECT DOC_NAME FROM DOCUMENTS INNER JOIN ( SELECT MAX(DELIVERY_TIMESTAMP) AS MAX_DELIVERY_TIMESTAMP FROM...
<pre><code>Select Max(DELIVERY_TIMESTAMP), Doc_Name From TableName Group By Doc_Name </code></pre> <p>That should do it, unless I missed something in the question.</p>
31,667
<p>i m developing a little tool on my Pocket PC using WM6 SDK but i would like to implement a finger friendly user interface (iphone-like). So i m looking for a free .NET framework that offers the possibility to easily integrate a finger friendly interface for Windows Mobile 6 Pro .</p> <p>Any ideas ?</p> <p>EDIT :...
<p>I know of no such interface API.</p> <p>I would code such an interface from scratch, overriding Paint and mouse events. If you need more fancy drawing tools that compact framework provides, you should look for pinvoke to access GDI+.</p>
<p>I'm not entirely sure what you're asking here... Windows Mobile 6.0 Pro <em>is</em> touch-screen enabled, so you should simply have to create your project targeting the Windows Mobile 6.0 Pro (note, however, that your application will not be compatible with Windows Mobile 6.0 Standard devices).</p>
15,570
<p>I would like to have something like this:</p> <pre><code>class Foo { private: int bar; public: void setBar(int bar); int getBar() const; } class MyDialog : public CDialogImpl&lt;MyDialog&gt; { BEGIN_MODEL_MAPPING() MAP_INT_EDITOR(m_editBar, m_model, getBar, setBar); END_MODEL_MAPPING() // other met...
<p>The DDX map is just a series of <code>if</code> statements, so you can easily write your own DDX macro.</p> <pre><code>#define DDX_MAP_VALIDATED_INT_EDITOR(control, variable, getter, setter, validator)\ if(nCtlID==control.GetDlgCtrlID())\ {\ if(bSaveAndValidate)\ {\ int const val...
<p>The <a href="http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaBindings/CocoaBindings.html" rel="nofollow noreferrer">Cocoa Bindings</a> provide exactly what you want, but they are only available in the Mac / Objective-C word. <a href="http://www.mail-archive.com/help-gnustep@gnu.org/msg01423.html" rel=...
14,155
<p><a href="https://3dprinting.stackexchange.com/a/4642/233">This post</a> has been up for 4-5 days now. I flagged it originally when it was first posted and that flag aged away, I have now flagged it again and it's still here. We have one <a href="https://3dprinting.stackexchange.com/users/1263/szymon-b%C4%99czkowsk...
<p>The post has now been deleted and the user destroyed due to spam, so thank you for bringing this up.</p> <p>It either must have come up after I cleaned out the inbox or I must have overlooked it.</p> <p>Yes, we do need another moderator. I would have loved to be at a point by now that we could have had elections a...
<p>Seeing as I'm 20 days late to this question, you probably understand that I'm not very active at the moment myself. (At least, I'm inactive for longer periods of time.) With Ryan gone for almost a year now, that often leaves @tbm0115 as the only moderator on this site.</p> <p>In other words, we could do with anothe...
45
<p>How does TCP/IP report errors when packet delivery fails permanently? All Socket.write() APIs I've seen simply pass bytes to the underlying TCP/IP output buffer and transfer the data asynchronously. How then is TCP/IP supposed to notify the developer if packet delivery fails permanently (i.e. the destination host is...
<p>TCP/IP is a reliable byte stream protocol. All your bytes will get to the receiver or you'll get an error indication.</p> <p>The error indication will come in the form of a closed socket. Regardless of what the communication pattern (who does the sending), if the bytes can't be delivered, the socket will close.</...
<p>In C, if you write to a socket that has failed with send(), you will get back the number of bytes that were sent. If this does not match the number of bytes you meant to send, then you have a problem. But also, when you write to a failed socket, you get SIGPIPE back. Before you start socket handling, you need to hav...
21,878
<p>We have a client (who has a client, who has a client) who is driving us mad with change requests to a code base (in PHP). Our first response was to just work in a main trunk in SVN, but the client often comes back and requests that a certain change needs to get pushed to the live servers ASAP. On the other hand, oth...
<p>Perhaps Subversion here is not the best tool for the job. Although creating all these branches is cheap in SVN, re-merging them can become time-consuming and painfull.</p> <p>If you have a look at GIT instead of SVN, you will find a version control system which is more powerfull at merging in general. Added to that...
<p>When doing lot of rapid changes in the "live" branch of a project, you need to have a solid code review process to reduce the chance of breaking it. The code review must be done before doing the check-in; and keep away the core development from that branch.</p> <p>Once the change is approved, you can check-in the c...
37,876
<p><a href="http://www.php.net/features.safe-mode" rel="noreferrer">open_basedir</a> limits the files that can be opened by PHP within a directory-tree.</p> <p>I am storing several class libraries and configuration files outside of my web root directory. This way the web server does not make them publicly accessible....
<p>You can also do this easily on a per-directory basis using the Apache (assuming this is your web server) configuration file (e.g. httpd.conf)</p> <pre><code>&lt;Directory /var/www/vhosts/domain.tld/httpdocs&gt; php_admin_value open_basedir "/var/www/vhosts/domain.tld/httpdocs:/var/www/vhosts/domain.tld/zend" &lt;/D...
<p>In Parallels Plesk Panel (e.g. 1and1) you can do it in the PHP panel settings:</p> <p><img src="https://i.stack.imgur.com/gcRFS.png" alt="enter image description here"></p> <p>here:</p> <p><img src="https://i.stack.imgur.com/c2AJK.png" alt="enter image description here"></p>
27,639
<p>I understand the following elements :</p> <ul> <li>there is some sort of crawling (configured in central administration)</li> <li>when the crawling is done, there is a slight delay, after which you can have your search results displayed.</li> </ul> <p>But, in a document library with publishing enabled, documents t...
<p>All contents are crawled using the default content access account. Most of the time, this is a dedicated account, and SharePoint give it "Full Read" permissions. </p> <p>Unfortunately, non approved items are not visible for "read users". So it will index the latest published version.</p> <p>However, you can't real...
<p>I have had similar search issues, I assigned a domain service account to the content access account and resolved the items that serach could not find, I think it is due to users administrating a page and taking away all rights. </p>
35,921
<p>Say I have a table called myTable. What is the SQL command to return all of the field names of this table? If the answer is database specific then I need SQL Server right now but would be interested in seeing the solution for other database systems as well.</p>
<p>MySQL 3 and 4 (and 5):</p> <pre><code>desc tablename </code></pre> <p>which is an alias for</p> <pre><code>show fields from tablename </code></pre> <p>SQL Server (from 2000) and MySQL 5:</p> <pre><code>select COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'tablename' </code></pre> <p>Completin...
<p>MySQL</p> <pre><code>describe tablename </code></pre>
12,580
<p>I lost my installation of Dave Gillespie's calc.el by reinstalling Cygwin. It is not included with the default Cygwin install of Emacs. Who is considered the master maintainer these days? Is version 2.02f still most current?</p>
<p>In the Emacs CVS tree. See <a href="http://www.gnu.org/software/emacs/calc.html" rel="nofollow noreferrer">the calc page</a> and the <a href="http://savannah.gnu.org/projects/emacs/" rel="nofollow noreferrer">Emacs project page</a>. The root of the calc subtree is <a href="http://cvs.savannah.gnu.org/viewvc/emacs/li...
<p>Thanks to Jouni making it clear that GNU does maintain Emacs Calc, I have figured out that there is a Cygwin install of Emacs that does include Calc. The necessary step is forcing Cygwin Setup to install Emacs 22.1-3 instead of the default 21.2-13. I have sent a report to the cygwin@cygwin.com mailing list to get ...
39,657
<p>Any sugestions?</p> <p>Currently I'm using Squirell but it consumes quiet a bit of memory... I just use the sql client to run some queries and get the result but i absolutely need auto-complete of tables, columns, etc</p>
<p>RedGate who makes SQLCompare has a tool called SQL Prompt that provides:</p> <ul> <li>Intelligent code completion for fast, accurate script building </li> <li>Script layout for easy code readability </li> <li>Cross-database and linked-server query support </li> <li>Integrates with SSMS, SSMS Express, Query Analyzer...
<p>RedGate who makes SQLCompare has a tool called SQL Prompt that provides:</p> <ul> <li>Intelligent code completion for fast, accurate script building </li> <li>Script layout for easy code readability </li> <li>Cross-database and linked-server query support </li> <li>Integrates with SSMS, SSMS Express, Query Analyzer...
47,146
<p>is there an easy way of importing data from a mysql/odbc datasource into an excel spreadsheet? </p> <p>The user should be able to select some values from drop downs (e..g date range, branch name etc.) and the values from the dropdown should be used to populate (prepared) SQL statements. The results should be displa...
<p>You can download an <a href="http://dev.mysql.com/downloads/connector/odbc/5.1.html" rel="nofollow noreferrer">ODBC driver for MySQL</a>, create a data source, and use <a href="http://office.microsoft.com/en-us/excel/HA100996641033.aspx" rel="nofollow noreferrer">MS Query</a> to create a custom SQL query that you ca...
<p><a href="http://sqlexcel.net/" rel="nofollow noreferrer">http://sqlexcel.net/</a></p>
48,280
<p>I have data from MySQL showing all organisations a customer got, with all details of employess in each organisation. I want to list each organisation name only once i.e. in a single cell ( row span) and all employees in that organisation against this name like:</p> <pre><code>Org1 Emp1 Name, Emp1 Phone, Emp1 Ad...
<p>Classic.</p> <p>Workaround: only display the name if different than the previous one. You can even not bother about the rowspan (you keep an empty cell).</p> <pre><code>$currentOrg = ''; while ($row = mysql_fetch_object($query)) { if ($row-&gt;org != $currentOrg) { echo "$row-&gt;org". } $currentorg...
<p>To make a correct <code>rowspan</code>, you need to know the number in advance.</p> <p>That leaves you with:</p> <ul> <li>iterating the query result twice, counting the values until they change</li> <li>asking the DB server for the count</li> </ul> <p>Personally, I would go with method number two. DB servers are ...
26,936
<p>I am developing a web app that will be hit frequently by mobile browsers. I am wondering if there is a way to get enough information from the browser request to lookup position data (triangulation or GPS) <strong>Not from the request directly, of course.</strong> A colleague suggested there some carriers supply a un...
<p>Google has <a href="http://code.google.com/apis/ajax/documentation/#ClientLocation" rel="noreferrer">ClientLocation</a> as part of their AJAX APIs. You'll need to load Google's AJAX API (requires an API key) and it'll try to resolve the user's location data for you.</p>
<p>I know that some providers in Japan have a tracking service for location of cellphones. I also know that the information is not public. I think you need to have a very good reason before the provider gives that information free as it is in my opinion sensitive personal data. Of course they will give the information ...
12,335
<p>I need to store products for an e-commerce solution in a database. Each product should have descriptive information, such as name, description etc.</p> <p>I need any product to be localized to x number of languages.</p> <p>What I've done so far, is to make any column that should be localized and <code>nvarchar(MAX...
<p>You should store the current language somewhere (in a <a href="http://www.yoda.arachsys.com/csharp/singleton.html" rel="nofollow noreferrer">singleton</a>, for instance) and in the product.Name property use the language setting to get the correct string. This way you only have to write the language specific code on...
<p>This is basically the approach we took with Microsoft Commerce Server 2002. Yeah indexed views will help your performance.</p>
4,818
<p>I am retrieving Japanese characters from a data source and I want to return this data to Excel in an XLOPER. I am using a Japanese version of Excel 2003 (hence XLOPERs and not XLOPER12s).</p> <pre><code>wchar_t* pszW = OLE2W(bstrResult); //I have the data I am trying to copy in a CComBSTR ULONG ulSize = ::WideCha...
<p><strong><em>User Error!</em></strong></p> <p>The above code is good. The problem is that Excel was using the wrong code page. I hadn't set the language for non-unicode programs to Japanese in Control Panel.</p> <p>The code now works for the English version of Excel too.</p> <p>That was a day and a half well spe...
<p>A char* is a sequence of bytes, interpreted using the current charset. To be precose, that is the charset used by the party doing the interpretation. In this case, Execl is receiving a charset that <em>should</em> be interpreted using codepage 932, but instead Excel is using another codepage.</p> <p>The solution, a...
49,007
<p>I've used the <a href="http://msdn.microsoft.com/en-us/library/8bch7bkk.aspx" rel="nofollow noreferrer"><code>setargv.obj</code> linking for Expanding Wildcard Arguments</a> in the past for a number of C and C++ apps, but I can't find any similar mention for .net applications.</p> <p><strong>Is there a standard way ...
<p>Here us my rough hack. I'd love for it to be recursive. And having experienced the shortcoming of Windows wildcards I might decide to use regular expressions rather than letting GetFiles() do it for me.</p> <pre><code>using System.IO; public static string[] ExpandFilePaths(string[] args) { var fileList = new...
<p>I'm not sure exactly what you're after... but if I get where you're going with the Directory.GetFiles() "hack" you mentioned, then something like this might work:</p> <pre><code>var Dirs = Directory.GetDirectories(@"C:\Windows", "sys*", SearchOption.TopDirectoryOnly).ToList(); var Files = new List&lt;String&gt;();...
49,986
<p>I am looking for a way to display a modal window in WPF the same way as a window in Cocoa can be displayed as a sheet, i.e. it slides down from the titlebar in front of the main parent window.</p> <p>My guess is that this would be accomplished by having the modal window as a user control which is loaded into a pane...
<p>Don't. It's not the expected user experience on Windows. Use modal dialogs or in-window navigation instead.</p>
<p>Thanks for the answers guys.</p> <p>My main objective for this was to have a shared window for the two windows, but I do not want to make it break any expected UX either so I'll take your answers into consideration and try to make up another idea for this.</p>
26,480
<p>I just want to see what files were modded/added/deleted between 2 arbitrary revisions. How do I do this?</p> <p>Can I do this in tortoise as well?</p>
<pre><code>svn log -v -rX:Y . </code></pre> <p>The -v for "verbose" switch will give you detailed output on which files were affected on that revision.</p> <p>Note that "." assumes you are currently in a working copy directory, but you can also use a URL such as "<a href="http://svn.myawesomesoftwareproject.com/trunk...
<p>This worked for me on windows</p> <ol> <li>Go to your folder where you have the repository,</li> <li>right click and select SVN Show log,</li> <li>In the dialog box there is a "Show Range" button, click it and fill <em>Start Revision</em> = {your revision} and <em>End Revision</em> = {your revision}</li> <li>Sele...
20,212
<p>What is the scope of Runtime Callable Wrapper (RCW), when referencing unmanaged COM objects? According to the docs:</p> <blockquote> <p>The runtime creates exactly one RCW for each COM object, regardless of the number of references that exist on that object.</p> </blockquote> <p>If I had to "guess" - this ...
<blockquote> <p>In managed, we have a per app domain cache mapping canonical IUnknowns back to RCWs. When an IUnknown enters the system (through a marshal call, through activation, as a return parameter from a method call, etc.), we check the cache to see if an RCW already exists for the COM object. I...
<p>According to the same docs:</p> <blockquote> <p>The runtime maintains a single RCW <strong>per process</strong> for each object.</p> </blockquote> <p>I think we can safely assume that <em>object</em> = <em>instance</em>, so if the addins/AppDomains doesn't hold references to the same instance, the call to <code>...
19,273
<p>I'd like to extract the text from an HTML file using Python. I want essentially the same output I would get if I copied the text from a browser and pasted it into notepad. </p> <p>I'd like something more robust than using regular expressions that may fail on poorly formed HTML. I've seen many people recommend Be...
<p><a href="https://github.com/Alir3z4/html2text" rel="noreferrer">html2text</a> is a Python program that does a pretty good job at this.</p>
<p>I am achieving it something like this. </p> <pre><code>&gt;&gt;&gt; import requests &gt;&gt;&gt; url = "http://news.bbc.co.uk/2/hi/health/2284783.stm" &gt;&gt;&gt; res = requests.get(url) &gt;&gt;&gt; text = res.text </code></pre>
42,546
<p>I'm currently developing a PHP application that's using an Access database as a backend. Not by choice you understand... the database is what the client used originally and using it is part of the requirements.<br><br> One of the problems with this database is that the column names have the most insane naming conven...
<p>Absolutely you are on the right track. If you don't abstract away the madness you will eventually succumb to the madness yourself.</p> <p>Your colleague has a valid point though, so I suggest you also code an easy way to determine the data to column mapping in PHP. </p> <p>This isn't about keeping it simple, it'...
<p>Use a ORM, you will be changing the db soon...</p>
41,896
<p>Let me explain: this is path to this folder: > <code>www.my_site.com/images</code></p> <p>And images are created by <code>user_id</code>, and for example, images of <code>user_id = 27</code> are, <code>27_1.jpg</code>, <code>27_2.jpg</code>, <code>27_3.jpg</code>! How to list and print images which start with <code...
<p>Environment variables are inherited by processes in Unix. The files in /etc/profile.d are only executed (in the current shell, not in a subshell) when you log in. Just changing the value there and then restarting a process will not update the environment. </p> <p>Possible Fixes:</p> <ul> <li>log out/log in, then s...
<p>You can use <a href="http://httpd.apache.org/docs/2.2/mod/mod_env.html#setenv" rel="nofollow noreferrer">SetEnv</a> in your config files (/etc/httpd/conf.d/*.conf, .htaccess ...). Additionally you should be able to define them in /etc/sysconfig/httpd (on RPM-based distribs) and <em>export</em> them (note: not tested...
13,946
<p>WPF doesn't provide the ability to have a window that allows resize but doesn't have maximize or minimize buttons. I'd like to able to make such a window so I can have resizable dialog boxes.</p> <p>I'm aware the solution will mean using pinvoke but I'm not sure what to call and how. A search of pinvoke.net didn't ...
<p>I've stolen some code I found on the MSDN forums and made an extension method on the Window class, like this:</p> <pre><code>internal static class WindowExtensions { // from winuser.h private const int GWL_STYLE = -16, WS_MAXIMIZEBOX = 0x10000, WS_MINIMIZEBOX...
<p>Just use</p> <pre><code>WindowStyle=&quot;ToolWindow&quot; </code></pre> <p>It hides the maximize and minimize buttons, but the window can still be resized by dragging the window borders and minimize using the hide button in the bottom right corner of the taskbar.</p> <p><a href="https://learn.microsoft.com/en-us/do...
44,106
<p>Here's the code that I'm attempting to do:</p> <pre><code>public IList&lt;IOperator&gt; GetAll() { using (var c = new MyDataContext()) { return c.Operators.ToList(); } } </code></pre> <p>Operator implements IOperator, but I'm getting the following compilation error:</p> <pre><code>Cann...
<p>Try the <code>Cast&lt;&gt;()</code> method:</p> <pre><code>return c.Operators.Cast&lt;IOperator&gt;().ToList(); </code></pre>
<p>Edit: Actually,</p> <p>return (List&lt; IOperator >)c.Operators.ToList();</p> <p>would <em>not</em> do the trick. Sorry</p>
16,246
<p>From <a href="http://en.wikipedia.org/wiki/AJAX" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/AJAX</a>, I get a fairly good grasp of what AJAX is. However, it looks like in order to learn it, I'd have to delve into multiple technologies at the same time to get any benefit out of it. So two questions:</p> ...
<p>If you aren't interested in the nitty gritty, you could use a higher-level library like <a href="http://jquery.com/" rel="nofollow noreferrer">JQuery</a> or <a href="http://www.prototypejs.org/" rel="nofollow noreferrer">Prototype</a> to create the underlying Javascript for you. The main benefit is a vastly more re...
<p>The Mozilla <a href="http://developer.mozilla.org/En/AJAX" rel="nofollow noreferrer">documentation</a> is good. Sites that benefit from it the most are ones that behave almost like a desktop application and need high interactivity. You can usually improve usability on almost any site by using it, however.</p>
12,853
<p><em>Problem:</em> There are a bunch of .lnk files on the C drive that point to the J: drive, but the J: drive is gone, and the P: drive has replaced it. Various tricks have been done to get the .lnk files to still work anyway, but it's getting annoying, and it's time to just fix the things.</p> <p>Using Ruby, Pytho...
<p>In the WindowsNT Resource Kit there's a command line utility called Shortcut.exe that I'm reliably informed will run under XP/2000/2003 as well. You can use a variety of command line switches to modify existing LNK files to point to new shortcuts.</p> <p>I found information about it here: <a href="http://www.ss64....
<p>We found this VB Script which works fine.</p> <p><a href="http://www.enterpriseitplanet.com/resources/scripts_win/article.php/3081941" rel="nofollow noreferrer">http://www.enterpriseitplanet.com/resources/scripts_win/article.php/3081941</a></p> <p>Some warnings:</p> <p>Careful! It runs from the root of the drive....
44,529
<p>Before I write my own I will ask all y'all.</p> <p>I'm looking for a C++ class that is almost exactly like a STL vector but stores data into an array on the stack. Some kind of STL allocator class would work also, but I am trying to avoid any kind of heap, even static allocated per-thread heaps (although one of th...
<p>You don't have to write a completely new container class. You can stick with your STL containers, but change the second parameter of for example <code>std::vector</code> to give it your custom allocator which allocates from a stack-buffer. The chromium authors wrote an allocator just for this:</p> <p><a href="https...
<p>Boost have this. Its called <a href="http://www.boost.org/doc/libs/1_60_0/doc/html/container/non_standard_containers.html#container.non_standard_containers.small_vector" rel="nofollow">small_vector</a></p> <blockquote> <p>small_vector is a vector-like container optimized for the case when it contains few elemen...
46,174
<p>What is the difference, what is the official terms, are any terms obsolete in ASP.NET 3.5?</p>
<p><strong>UserControl</strong>: A custom control, ending in .ascx, that is composed of other web controls. Its almost like a small version of an aspx webpage. It consists of a UI (the ascx) and codebehind. Cannot be reused in other projects by referencing a DLL.</p> <p><strong>WebControl</strong>: A control host...
<p>Since I don't have enough reputation yet to comment, I'll add this as an answer, but it refers to Will's answer above.</p> <p>From the <a href="http://msdn.microsoft.com/en-us/library/aa479016.aspx" rel="nofollow noreferrer">link</a> you included:</p> <blockquote> <p>Composite controls are the right tool to arch...
9,653
<p>In C#, if I want to deterministically clean up non-managed resources, I can use the "using" keyword. But for multiple dependent objects, this ends up nesting further and further:</p> <pre><code>using (FileStream fs = new FileStream("c:\file.txt", FileMode.Open)) { using (BufferedStream bs = new BufferedStream(...
<p>You don't have to nest with multiple usings:</p> <pre><code>using (FileStream fs = new FileStream("c:\file.txt", FileMode.Open)) using (BufferedStream bs = new BufferedStream(fs)) using (StreamReader sr = new StreamReader(bs)) { // all three get disposed when you're done } </code></pre>
<p>The using statement is syntactic sugar that converts to:</p> <pre><code> try { obj declaration ... } finally { obj.Dispose(); } </code></pre> <p>You can explicitly call Dispose on your objects, but it won't be as safe, since if one of them throws an exception, the resources won't...
10,136
<p>I have thus far avoided the nightmare that is testing multi-threaded code since it just seems like too much of a minefield. I'd like to ask how people have gone about testing code that relies on threads for successful execution, or just how people have gone about testing those kinds of issues that only show up when...
<p>Look, there's no easy way to do this. I'm working on a project that is inherently multithreaded. Events come in from the operating system and I have to process them concurrently.</p> <p>The simplest way to deal with testing complex, multithreaded application code is this: If it's too complex to test, you're doing...
<p>(if possible) don't use threads, use actors / active objects. Easy to test.</p>
3,326
<p>Has anybody managed to get the Android Emulator working behind a proxy that requires authentication?</p> <p>I've tried setting the -http-proxy argument to</p> <pre><code>http://DOMAIN/USERNAME:PASSWORD@IP:PORT </code></pre> <p>but am having no success.</p> <p>I've tried following the docs to no avail. I've also trie...
<p>I Managed to do it in the Adndroid 2.2 Emulator.</p> <pre><code>Go to "Settings" -&gt; "Wireless &amp; Networks" -&gt; "Mobile Networks" -&gt; "Access Point Names" -&gt; "Telkila" </code></pre> <p>Over there set the proxy host name in the property "Proxy" and the Proxy port in the property "Port"</p>
<p>I had the same problem when i use the following command:</p> <pre><code>emulator-x86.exe -http-proxy domain\user:password@proxyIP:port -avd MyAVD </code></pre> <p>I got the proxy authentication error.</p> <p>Finally, I had to bypass the proxy NTLM authentication by using the Cntlm here:</p> <p><a href="http://so...
4,804
<p>I usually never see test for new in C++ and I was wondering why.</p> <p><code>Foo *f = new Foo;</code></p> <p><code>// f is assumed as allocated, why usually, nobody test the return of new?</code></p>
<p>As per the current standard, <em>new</em> never returns <em>NULL</em>, it throws a std::bad_alloc instead. If you don't want new to throw(as per the old standard) but rather return NULL you should call it by postfixing it with "<em>(std::nothrow)</em>". i.e.</p> <pre><code>Foo* foo = new (std::nothrow) Foo; </code>...
<p>Usually no one tests the return of new in new code because Visual Studio now throws the way the standard says.</p> <p>In old code if a hack has been done to avoid throwing then you'd still better test.</p>
29,608
<p>I have been reading the <a href="http://msdn.microsoft.com/en-us/library/ms997565.aspx" rel="nofollow noreferrer">MSDN</a> documentation on subclassing and I have been successful in handling events in a subclass</p> <p>My issue is with passing messages back to the original WndProc.</p> <p>As an example, if I have...
<p>The button notifications are sent to the button's parent, which is the group box. Because you've subclassed the group box, your <code>SubClassFunc</code> receives these messages, which then passes them to the group box's original window procedure using <code>CallWindowProc</code>.</p> <p>If you want the button noti...
<p>I suspect if you remove the subclass all together the button events will still not reach the original window procedure as you expect.</p> <p>Since you have an subclass procedure doing nothing more than calling <strong>CallWindowProc</strong> the window is effectively not subclasses.</p> <p>My suggestion would be t...
27,606
<p>The Emacs cperl-mode seems to get confused less than perl-mode, but the Skittles effect makes the thing unusable for me. Does anyone have or know of an example of a .emacs block that causes cperl-mode to use the colorization from perl-mode, ideally in a form readable enough that I can go back and turn back on the d...
<p>Press M-x customize-group RET cperl-faces RET and change coloring to your liking.</p>
<p>You can change the <a href="http://www.emacswiki.org/emacs/ColorTheme" rel="nofollow noreferrer">color theme</a> if you don't like the particular default colors.</p>
34,040
<p>I have a large set of files, some of which contain special characters in the filename (e.g. ä,ö,%, and others). I'd like a script file to iterate over these files and rename them removing the special characters. I don't really mind what it does, but it could replace them with underscores for example e.g.</p> <p>Stö...
<p>Have you tried setting cmd.exe into another codepage before you feed the file names to gnupg? Issue <code>chcp 65001</code> to set cmd.exe to Unicode beforehand and try again.</p> <p>If that fails, the following VBScript would do it:</p> <pre class="lang-vb prettyprint-override"><code>Option Explicit Dim fso: Set...
<p>I'm using this batch to rename folders and seems to work fine so far... In my case codepage is 1252, yours might be different.</p> <pre><code>mode con codepage select=1252 @echo off Setlocal enabledelayedexpansion ::folder only (/D option) for /R /D %%d in (*) do ( set an=%%~nd set bn=!an:.=_! set cn=!bn:-=_! set ...
32,698
<p>Has anyone here given the <a href="http://www.fandev.org" rel="nofollow noreferrer">Fantom programming language</a> a whirl? (pun intended).</p> <p>My first impression:</p> <ul> <li>I like the ability to have the code run on either the .NET or Java VM.</li> <li>The syntax is nice and clean and does not try anythin...
<p>It looks very inspired by Ruby. It says that it's RESTful but I don't see how exactly. Compare with <a href="http://en.wikipedia.org/wiki/Boo_(programming_language)" rel="nofollow noreferrer">boo</a>, which is more mature yet similar in many ways (its syntax is Python inspired, though).</p> <p>The design decisions ...
<p>This is very interesting.</p> <p>Java (or C#) was created in order to eliminate Platform dependency by creating a JVM (or CLR) that will compile the code into a specific machine code at run time.</p> <p>Now , There is a languege which is <strong>Virtual Machine independent</strong>? umm .... what the hell?!?!</p> ...
16,162
<p>I got ahead of myself and downloaded and installed the OSX Python 2.6 package from www.python.org/download/ on my OSX 10.5.5 Intel Mac and installed the full package contents. Only after this did I come across <a href="http://wiki.python.org/moin/MacPython/Leopard" rel="nofollow noreferrer">http://wiki.python.org/mo...
<p>You may have overwritten the system framework but it is more likely that you just overwrote the symlinks in <code>/usr/bin</code> to point to the new version. Try going to <code>/usr/bin</code> and seeing (with something like <code>ls -alsh</code>) where the <code>python</code> symlink points to. It may be <code>p...
<p>Restore from a recent Time Machine backup or somehow from DVD?</p>
40,156
<p>Is there a way to create a Zip archive that contains multiple files, when the files are currently in memory? The files I want to save are really just text only and are stored in a string class in my application. But I would like to save multiple files in a single self-contained archive. They can all be in the roo...
<p>Use <code>ZipEntry</code> and <code>PutNextEntry()</code> for this. The following shows how to do it for a file, but for an in-memory object just use a MemoryStream</p> <pre><code>FileStream fZip = File.Create(compressedOutputFile); ZipOutputStream zipOStream = new ZipOutputStream(fZip); foreach (FileInfo fi in al...
<p>Use a <a href="http://msdn.microsoft.com/en-us/library/system.io.stringreader.aspx" rel="nofollow noreferrer">StringReader</a> to read from your string objects and expose them as Stream s.</p> <p>That should make it easy to feed them to your zip-building code.</p>
34,841
<p>Given a handle of type <code>HWND</code> is it possible to confirm that the handle represents a real window?</p>
<p>There is a function <code>IsWindow</code> which does exactly what you asked for.</p> <pre><code>BOOL isRealHandle = IsWindow(unknwodnHandle); </code></pre> <p>Look at <a href="http://msdn.microsoft.com/en-us/library/ms633528(VS.85).aspx" rel="nofollow noreferrer">this link</a> for more information.</p>
<p>Generally no. By the time you've got confirmation that a Window is valid another process/thread my come along and remove it for you.</p>
3,105
<p>In XAML I can declare a DataTemplate so that the template is used whenever a specific type is displayed. For example, this DataTemplate will use a TextBlock to display the name of a customer:</p> <pre><code>&lt;DataTemplate DataType="{x:Type my:Customer}"&gt; &lt;TextBlock Text="{Binding Name}" /&gt; &lt;/DataT...
<p>Not out of the box, no; but there are enterprising developers out there who have done so.</p> <p>Mike Hillberg at Microsoft played with it in <a href="https://learn.microsoft.com/en-us/archive/blogs/mikehillberg/limited-generics-support-in-xaml" rel="nofollow noreferrer">this post</a>, for example. Google has others...
<p>Quite defeats the purpose of a generic, but you could define a class that derives from the generic like so, with the sole purpose of being able to use that type in XAML.</p> <pre><code>public class MyType : List&lt;int&gt; { } </code></pre> <p>And use it in xaml e.g. like</p> <pre><code>&lt;DataTemplate DataType=...
22,413
<p>When I adjust the probe offset to get the proper layer height and adhesion, one side is set right but the other doesn't work. If I decrease the probe offset (say -1.100 to -1.050) the right side seems to print better; if I increase the probe offset (-1.050 to -1.125) the left side will adhere to the plate properly.<...
<p>I have had exactly the same experiences as you did with a inductive sensor on a Prusa i3 clone. It looks as though the bed leveling is not executed, or the level/mesh tilted. Please do note that automatic bed leveling is <strong><em>not magic</em></strong>, you still need to provide a <strong><em>build platform as l...
<p>From the looks of your test print, this is unlikely all or only due to levelling unless the glass plate is abnormally uneven. You may have to check your extrusion (speed, temp, feed) parameters and/or adhesion (clean with aceton and/or prepare with hairspray or glue stck)</p>
1,088
<p>I want to put "random" output from my result set (about 1.5 mil rows) in a file in a sorted manner. I know i can use sort by command in my query but that command is "expensive". Can you tell me is there any algorithm for writing result set rows in a file so the content would be sorted in the end and can i gain in p...
<p>Define an index for the sort criteria in your table, then you can use the order by clause without problems and write the file as it comes from the resultset.</p> <p>If your query has multiple joins, create the proper indexes for the joins and for the sort criteria. You can sort the data on your program but you'd be...
<p>If you're reading from a database, getting sorted output shouldn't be so 'expensive' if you have appropriate indexes.</p> <p>But, sometimes with complex queries it's very hard for the SQL optimiser to apply indexes. In that case, the DB simply accumulates the results in a temporary table and sorts it for you, tran...
21,993
<p>Is there a good way to debug errors in the Visual Studio Designer?</p> <p>In our project we have tons of UserControls and many complex forms. For the complex ones, the Designer often throws various exceptions which doesn't help much, and I was wondering if there's some nice way to figure out what has gone wrong.</p...
<p>I've been able to debug some control designer issues by running a second instance of VS, then from your first VS instance do a "Debug -> Attach to Process" and pick "devenv".</p> <p>The first VS instance is where you'll set your breakpoints. Use the second instance to load up the designer to cause the "designer" co...
<p>Each one is different and they can sometimes be obscure. As a first step, I would do the following: </p> <ul> <li>Use source control and save often. When a designer error occurs, get a list of all changes to the affected controls that have occurred recently and test each one until you find the culprit</li> <li>Be s...
6,074
<p>I'm trying to implement Drag &amp; Drop functionality with source being a TreeView control. When I initiate a drag on a node, I'm getting:</p> <p><em>Invalid FORMATETC structure (Exception from HRESULT: 0x80040064 (DV_E_FORMATETC))</em></p> <p>The ItemDrag handler (where the exception takes place), looks like:</p>...
<p>In case it helps anyone else - I encountered this problem with the WPF TreeView (not Windows Forms as listed in the question) and the solution was simply to make sure to mark the event as handled in the drop event handler.</p> <pre><code> private void OnDrop(object sender, DragEventArgs e) { // Other...
<p><strong><code>FORMATETC</code></strong> is a type of application clipboard, for lack of a better term. In order to pull off some of the visual tricks of draging around the tree node, it has to be copied into this clipboard with its source description. The source control loads its info into the <code>FORMATETC</cod...
7,310
<p>Is there another way to render graphics in C# beyond <a href="https://en.wikipedia.org/wiki/Graphics_Device_Interface#Windows_XP" rel="nofollow noreferrer">GDI+</a> and <a href="http://en.wikipedia.org/wiki/Microsoft_XNA" rel="nofollow noreferrer">XNA</a>? </p> <p>(For the development of a tile map editor.)</p>
<p><a href="http://cs-sdl.sourceforge.net/" rel="nofollow noreferrer">SDL.NET</a> is the solution I've come to love. If you need 3D on top of it, you can use Tao.OpenGL to render inside it. It's fast, industry standard (<a href="http://en.wikipedia.org/wiki/Simple_DirectMedia_Layer" rel="nofollow noreferrer">SDL</a>, t...
<p>You could try looking into WPF, using Visual Studio and/or Expression Blend. I'm not sure how sophisticated you're trying to get, but it should be able to handle a simple editor. Check out this <a href="http://msdn.microsoft.com/en-us/library/ms742562.aspx" rel="nofollow noreferrer">MSDN Article</a> for more info.<...
8,261
<p>So what's the best way to create new tables in a Sqlite database in Rails 2. I have created the database using rake db:migrate command. So should I write individual sql scripts to create a database or use rake somehow. I don't need scaffolding.</p>
<p>Basically use migrations.</p> <p>Some useful help on how to use migrations is available at <a href="http://wiki.rubyonrails.org/rails/pages/understandingmigrations" rel="nofollow noreferrer">http://wiki.rubyonrails.org/rails/pages/understandingmigrations</a> and <a href="http://wiki.rubyonrails.org/rails/pages/Usin...
<p>If you are not using scaffolding then you should use <code>script/generate migration</code> to create a migration file for each table. There is no need to use sql scripts. After creating some migrations you can apply them to your database using rake db:migrate.</p>
24,410
<p>I cannot correctly position the div <code>form</code> in my layout.</p> <p>By looking at my div placement and css below, does anyone have an idea what I could be doing wrong?</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class...
<p>The form <code>div</code>'s top is in line with the top of the <code>div</code> that precedes it. The <code>clear:left;</code> on <code>#projects</code> moves <code>#projects</code> to the next line (good), along with the following content (bad). Try a negative top margin, or consider restructuring your HTML to put ...
<p>Because you have two blocks (FLOORPLANS and DEVELOPMENT INFO) each with a border, they're now too wide to sit next to the form block. Test this by removing one or both borders and seeing if the form then pops back up there.</p> <p>Note, negative margin often has issues in IE6, be sure and check any solution against...
27,518
<p>Say I have three files (template_*.txt):</p> <ul> <li>template_x.txt</li> <li>template_y.txt</li> <li>template_z.txt</li> </ul> <p>I want to copy them to three new files (foo_*.txt). </p> <ul> <li>foo_x.txt </li> <li>foo_y.txt </li> <li>foo_z.txt</li> </ul> <p>Is there some simple way to do that with one command...
<pre> for f in template_*.txt; do cp $f foo_${f#template_}; done </pre>
<p>Yet another way to do it:</p> <pre><code>$ ls template_*.txt | sed -e 's/^template\(.*\)$/cp template\1 foo\1/' | ksh -sx </code></pre> <p>I've always been impressed with the ImageMagick <a href="http://www.imagemagick.org/script/convert.php" rel="nofollow noreferrer">convert</a> program that does what you expect ...
4,598
<p>We @ <a href="http://www.medicware.com.br" rel="nofollow noreferrer">medicware.com.br</a> are thinking about making our <strong>web application offline-capable</strong> with <a href="http://gears.google.com/" rel="nofollow noreferrer">Gears</a>. Our main goal is to <strong>keep basic functionality running</strong> w...
<p><a href="http://www.rememberthemilk.com" rel="nofollow noreferrer">Remember the Milk</a> has done a nice job of using Gears -- you might see what you can find out about their implementation. I'd start at <a href="http://code.google.com/apis/gears/articles/take_app_offline.html" rel="nofollow noreferrer">http://code...
<p>I've had good experiences with Adobe Air. It's not gears and it was nothing more than a look to see how it worked, but it was so simple that i'd think it would be easy to port any large scale application over. </p>
22,982