instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>Omnicompletion is working, but it automatically inserts the first result.</p> <p>What I'd like to do is open the omnicomplete menu, then be able to type to narrow down the results, then hit enter or tab or space or something to insert the selected menu item.</p> <p>Is this possible?</p>
<p>The command you are looking for is:</p> <pre><code>:set completeopt+=longest </code></pre> <p>It will insert the longest common prefix of all the suggestions, then you can type and delete to narrow down or expand results.</p>
<p>This plugin might do what you are after: <strong><a href="http://www.vim.org/scripts/script.php?script_id=1879" rel="nofollow noreferrer">autocomplpop</a></strong></p> <p>Or you can try and make Vim completion popup menu <a href="http://vim.wikia.com/wiki/Make_Vim_completion_popup_menu_work_just_like_in_an_IDE" rel...
40,011
<p>Anyone visiting a torrent tracker is sure to find droves of "cracked" programs ranging from simple shareware to software suites costing thousands of dollars. It seems that as long as the program does not rely on a remote service (e.g. an MMORPG) that any built-in copy protection or user authentication is useless.</...
<p>Copy-protection is like security -- it's impossible to achieve 100% perfection but you can add layers that make it successively more difficult to crack.</p> <p>Most applications have some point where they ask (themselves), "Is the license valid?" The hacker just needs to find that point and alter the compiled code...
<p>This is one occasion where quality software is a bad thing, because if no one whats your software then they will not spend time trying to crack it, on the other hand things like Adobe's Master Collection CS3, were available just days after release.</p> <p>So the moral of this story is if you don't want someone to s...
24,864
<p>I'm using nhibernate to store some user settings for an app in a SQL Server Compact Edition table.</p> <p>This is an excerpt the mapping file:</p> <pre><code>&lt;property name="Name" type="string" /&gt; &lt;property name="Value" type="string" /&gt; </code></pre> <p>Name is a regular string/nvarchar(50), and Value...
<p>Okay, with many thanks to Artur in <a href="http://groups.google.com/group/nhusers/browse_thread/thread/4f865f0f516234ca" rel="nofollow noreferrer">this thread</a>, here's the solution: Inherit from the SqlServerCeDriver with a new one, and override the InitializeParamter method:</p> <pre><code>using System.Data; u...
<pre><code>&lt;property name="Value" type="string" /&gt; &lt;column name="Value" sql-type="StringClob" /&gt; &lt;/property&gt; </code></pre> <p>I'm assuming this is a small typo, since you've closed the property tag twice. Just pointing this out, in case it wasn't a typo.</p>
14,648
<p>I've read a couple of things about MVCs but I still don't understand when they should be used and when they shouldn't be used. I am looking for clear examples that say things like "<i>if you're developing this then you should use MVC, like this</i>" and "<i>if you're developing this, you shouldn't use MVC.</i>" Most...
<p>IMO, the best examples are with code and/or starter kits. </p> <p><a href="http://blog.wekeroad.com/" rel="noreferrer">Rob Conery</a> has a <a href="http://blog.wekeroad.com/mvc-storefront/" rel="noreferrer" title="Mvc posts by Rob">great number of posts</a> that explain how to to create an MVC site with ASP.NET MV...
<p>Its often hard to clearly separate your view logic with your business logic. If you read up abit on JSF &amp; JSP examples you can see clear examples of MVC in use. Completely seperating the view from the business logic.</p> <p>If your looking for good information about MVC I can suggest <a href="http://en.wikiped...
39,188
<p>I'm writing a Perl script and would like to use a n-ary tree data structure.</p> <p>Is there a good implementation that is available as source code (rather than part of a Perl library) ?</p>
<p>Adding to what Matthew already said, it looks like the following modules would be suitable:</p> <p><a href="http://search.cpan.org/perldoc?Tree::Nary" rel="nofollow noreferrer">Tree::Nary</a><br> <a href="http://search.cpan.org/perldoc?Tree::Simple" rel="nofollow noreferrer">Tree::Simple</a><br> <a href="http://sea...
<p>I don't really understand why you want it was "source" rather than as a perl library, but you can download the source for any CPAN module. </p> <p>I haven't used it, but <a href="http://search.cpan.org/~rkinyon/Tree-1.01/lib/Tree.pm" rel="nofollow noreferrer">Tree</a> looks to fill your requirements.</p>
5,844
<p>I'm used to work with Java where large amounts of examples are available. For various reasons I had to switch to C# and trying to do the following in SharpDevelop:</p> <pre><code>// Form has a menu containing a combobox added via SharpDevelop's GUI // --- Variables languages = new string[2]; languages[0] = "Englis...
<p>You need to set the binding context of the ToolStripComboBox.ComboBox.</p> <p>Here is a slightly modified version of the code that I have just recreated using Visual Studio. The menu item combo box is called toolStripComboBox1 in my case. Note the last line of code to set the binding context.</p> <p>I noticed that...
<p>This line</p> <pre><code>mnuActionLanguage.ComboBox.DisplayMember = "Lang.Language"; </code></pre> <p>is wrong. Change it to</p> <pre><code>mnuActionLanguage.ComboBox.DisplayMember = "Language"; </code></pre> <p>and it will work (even without DataBind()).</p>
32,046
<p>I have written a small ASP.NET application. It runs fine when running it with the small IIS installation that comes with Visual Studio 2005, but not when trying with IIS. I created the virtual directory in IIS where the application is located (done it though both IIS and VS 2005), but it does not work. In the beginn...
<p>Have you run <a href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/187d0e2c-8e89-49ad-a89d-e26e4d76ee68.mspx?mfr=true" rel="nofollow noreferrer">aspnet_regiis</a>?</p> <p>Here's an <a href="http://msdn.microsoft.com/en-us/library/ms178477.aspx" rel="nofollow noreferrer">overview site f...
<p>The site won't load at all or you can't debug remotely?</p>
19,160
<p>When I asked for tools to profile Rails apps, someone <a href="https://stackoverflow.com/questions/350470/what-tools-do-you-recommend-to-profile-rails-apps#351842">pointed at DTrace</a>. Since I work on MacOSX stations and deploy on OpenSolaris, it is a valid way to go. But I have little knowledge of DTrace.</p> <p...
<p>I did a 35 min video and showed some DTrace starter examples that you can find here: <a href="http://cocoasamurai.blogspot.com/2008/05/dtrace-for-cocoa-developers.html" rel="noreferrer">http://cocoasamurai.blogspot.com/2008/05/dtrace-for-cocoa-developers.html</a> which were intended for introducing DTrace to Cocoa D...
<p>I found that reading dtrace version of the usual admin monitoring tools of Mac OS X was a great help <code>truss</code> -> <code>dtruss</code>. There are at least a dozen different scripts that you can read. (Most begining by "d".)</p> <p>There also is <code>/Developer/Applications/Instruments.app</code> which is a...
45,953
<p>I have a MasterPage and a Content Page</p> <p>My Content Page has a number of controls, - dropdownlist, text boxes, radio buttons.</p> <p>I want to loop through all the control and if its one of the controls above then i want to obtain the selectedvalue, text etc</p> <p>I know I can access the control directly by...
<p>The Controls are in a heirarchy. The only control in the page is usually a Form (but not always). The form contains controls that appear in the <code>&lt;form&gt;</code> tag. If the form has for example a <code>&lt;p runat="server"&gt;</code> in it, the <code>&lt;p&gt;</code> will contains all controls that appear i...
<p>If you are trying to access the content page controls from the master page, you need to access the controls through the appropriate ContentPlaceHolder (on the master page). something like this:</p> <pre><code>foreach (Control c in ContentPlaceHolder1.Controls) { Response.Write(c.ID ); } </code></pre>
40,574
<p>I received an error when an referenced .NET Framework 2.0 assembly tried to execute the following line of code in an IIS hosted WCF service:</p> <p>Error Message:</p> <blockquote> <p>exePath must be specified when not running inside a stand alone exe.</p> </blockquote> <p>Source Code:</p> <pre><code>Configur...
<p>I was able to resolve the configuration issue by removing the existing code from my provious answer and replacing it with the following ConfigurationManager implementation:</p> <pre><code>string MySetting = ConfigurationManager.AppSettings.Get("MyAppSetting"); </code></pre> <p>If works for ASP.NET applications, Wi...
<p>It depends on what you're trying to accomplish. On ASP.NET, you'd normally wouldn't use ConfigurationManager for stuff like this, but WebConfigurationManager instead. That said, there's no exact equivalent, since, in reality, the user/roaming/etc stuff that OpenExeConfiguration allows doesn't make sense on a web app...
29,166
<p>Ideally something that will work with Oracle, MS SQL Server, MySQL and Posgress.</p>
<p>if you mean common lisp by lisp, then there's <strong><a href="http://common-lisp.net/project/cl-rdbms/" rel="noreferrer">cl-rdbms</a></strong>. it is heavily tested on postgres (uses <a href="http://common-lisp.net/project/postmodern/" rel="noreferrer">postmodern</a> as the backend lib), it has a toy sqlite backend...
<p>Allegro Common Lisp has an <a href="http://www.franz.com/support/documentation/8.1/doc/aodbc.htm" rel="nofollow noreferrer">ODBC</a> library and a <a href="http://franz.com/support/documentation/8.1/doc/mysql.htm" rel="nofollow noreferrer">MySQL-specific</a> library, both exhaustively documented. I've used the MySQL...
14,995
<p>I distribute my application using a VS2008 install package, which normally works great. When I create new versions of the app, I go in and increment the <code>Version</code> property on the install package and verify the <code>RemovePreviousVersions</code> property is set to True.</p> <p>This works just fine most ...
<p>Not a direct answer, but the key difference between an upgrade and an uninstall+ a reinstall is that any custom uninstall steps are not called in 2k8 but are in 2k5.</p> <p>This is referenced in <a href="https://stackoverflow.com/questions/370940/visual-studio-2008-service-installer-project-upgrade-issue">Visual St...
<p>We need to set REINSTALLMODE property of our msi file to amus.</p> <p>Following is the link to know more about the meaning of 'amus' <a href="http://msdn.microsoft.com/en-us/library/aa371182%28VS.85%29.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/aa371182%28VS.85%29.aspx</a></p> <p>There...
36,954
<p>I work on an application that has a both a GUI (graphical) and API (scripting) interface. Our product has a very large installed base. Many customers have invested a lot of time and effort into writing scripts that use our product.</p> <p>In all of our designs and implementation, we (understandably) have a very s...
<p>As far is my programming experience is concerned, if I'm going to fundamentally change something that will prevent past incoming data to be used correctly, I need to create an abstraction layer for the old data where it can be converted for use in the new format.</p> <p>Basically I set the &quot;improved&quot; way a...
<p>You could alawys look for innovative ways to maintain backwards compatibilty.</p>
19,453
<p>I'm trying to design a data model that denotes one user being the friend of another user. This is what i've come up with so far, but it seems clunky, is there a better solution?</p> <pre><code>User ===== Id Name etc... UserFriend =========== UserId FriendId IsMutual IsBlocked </code></pre>
<pre><code>UserRelationship ==== RelatingUserID RelatedUserID Type[friend, block, etc] </code></pre> <p>Agree that mutuality doesn't belong as a column; breaks normalization.</p>
<p>I think you should be create two table:<br></p> <p> 1. user<br> u_id int<br> u_username string<br> balahhh............<br> </p> <p> 2. friendship<br> fs_id int<br> relating_id int<br> related_id int<br> </p>
49,680
<p>I am working on C++ and COM/ATL in Windows from last few years. Now I want to shift to Linux Programming. I know basic architecture of Linux. I did some of the projects which are using ncurses, sockets and audio libraries(Terminal Applications). On which tool I should be familiar to start with projects. In windows I...
<p>Depends what you're trying to do...</p> <p>Are you going to be doing GUI apps? Learn Qt or GTK or wxWidgets. Are you going to be doing device driver development? Learn straight C, not just C++. A lot of the exciting software development under Linux happens in Python and Perl (and other dynamic languages to a le...
<p>I would recommend you to start by using Gentoo, it should be hard the first weeks, but after a while (say 2 months and less if you have basic linux understand ) you will be able to use every distribution and you will know exactly what will happen and how on your system when you press/digit something, I think that yo...
25,689
<p>I'm using PHP's PDO layer for data access in a project, and I've been reading up on it and seeing that it has good innate support for persistent DB connections. I'm wondering when/if I should use them. Would I see performance benefits in a CRUD-heavy app? Are there downsides to consider, perhaps related to security?...
<p>You could use this as a rough "ruleset":</p> <p><strong>YES</strong>, use persistent connections, if:</p> <ul> <li>There are only few applications/users accessing the database, i.e. you will not result in 200 open (but probably idle) connections, because there are 200 different users shared on the same host.</li> ...
<p>I was going to ask this same question but rather than ask the same question again I'll just add some information that I've found.</p> <ul> <li><a href="http://www.mysqlperformanceblog.com/2006/11/12/are-php-persistent-connections-evil/" rel="nofollow noreferrer">Are PHP persistent connections evil ?</a></li> <li><a...
7,301
<p>I need to be able to get at the full URL of the page I am on from a user control. Is it just a matter of concatenating a bunch of Request variables together? If so which ones? Or is there a more simpiler way?</p>
<p>I usually use <code>Request.Url.ToString()</code> to get the full url (including querystring), no concatenation required.</p>
<p>If you need the port number also, you can use</p> <pre><code>Request.Url.Authority </code></pre> <p>Example:</p> <pre><code>string url = Request.Url.Authority + HttpContext.Current.Request.RawUrl.ToString(); if (Request.ServerVariables["HTTPS"] == "on") { url = "https://" + url; } else { url = "http://"...
6,191
<p>Delphi strings use single quotes, for example '<code>a valid string</code>'. How does one specify the <code>'</code> character within a literal string? How would one refer to the null byte (Unicode code point <code>U+0000</code>)? </p>
<p>To add a single quote to a string, you include two <code>'</code> marks e.g. </p> <pre><code>str := '''test string'''; Writeln(str) </code></pre> <p>In the string above, you have the normal single quotation to start a string and then two for the single quote. Same goes for the end of the string. </p> <p>You can ...
<p>For <code>'</code> character put it twice. For example: <code>'Don''t'</code>. Null byte type as #0.</p>
38,829
<p>I have a couple of buttons of which I modified how they look. I have set them as flat buttons with a background and a custom border so they look all pretty and nothing like normal buttons anymore (actually, they look like Office 2003 buttons now ;-). The buttons have a border of one pixel.</p> <p>However when the b...
<p>Is this the effect you are looking for?</p> <pre><code>public class NoFocusCueButton : Button { protected override bool ShowFocusCues { get { return false; } } } </code></pre> <p>You can use this custom button class just like a regular button, but it won't give you a...
<p>I've had good luck merely setting the Focusable property of the button to be false:</p> <pre><code>&lt;Button HorizontalAlignment="Left" Margin="0,2" Command="{Binding OpenSuspendedJobCommand, Mode=OneWay}" Focusable="False" Style="{StaticResource ActionButton}" Content="Open Job..." /&gt...
17,916
<p>This is in C#, I have a class that I am using from some else's DLL. It does not implement IEnumerable but has 2 methods that pass back a IEnumerator. Is there a way I can use a foreach loop on these. The class I am using is sealed.</p>
<p><code>foreach</code> does <em>not</em> require <code>IEnumerable</code>, contrary to popular belief. All it requires is a method <code>GetEnumerator</code> that returns any object that has the method <code>MoveNext</code> and the get-property <code>Current</code> with the appropriate signatures.</p> <p>/EDIT: In yo...
<p>You could always wrap it, and as an aside to be "foreachable" you only need to have a method called "GetEnumerator" with the proper signature. </p> <pre><code> class EnumerableAdapter { ExternalSillyClass _target; public EnumerableAdapter(ExternalSillyClass target) { _target = target; } public IEnum...
15,481
<p>What is actually the difference between these two casts?</p> <pre><code>SomeClass sc = (SomeClass)SomeObject; SomeClass sc2 = SomeObject as SomeClass; </code></pre> <p>Normally, shouldn't they both be explicit casts to the specified type?</p>
<p>The former will throw an exception if the source type can't be cast to the target type. The latter will result in sc2 being a null reference, but no exception.</p> <p>[Edit]</p> <p>My original answer is certainly the most pronounced difference, but as Eric Lippert <a href="http://blogs.msdn.com/ericlippert/archive...
<p>The parenthetical cast throws an exception if the cast attempt fails. The "as" cast returns null if the cast attempt fails.</p>
2,458
<p>I have a SQL Server 2000 install on a server that I am having weird connection issues with. </p> <p>Using SSMS I can't connect to it using an Alias I have setup on Configuration Manager. The Alias is set to use TCPIP which is the first protocol in the order below shared memory. If I use the exact same server nam...
<p>Using the server name will use the default connection protocol for the client. This may be named pipes or tcp/ip (MDAC version, upgrade vs install etc).</p> <blockquote> <p>The Alias is set to use TCPIP which is the first protocol in the order below shared memory</p> </blockquote> <p>I assume that if the cli...
<p>Does the alias specify a protocol? Is that protocol accepted by the server? Is that the protocol being used when you are connecting by name? (i.e. what is the order of client protocols)</p>
36,123
<p>I have an email subject of the form:</p> <pre><code>=?utf-8?B?T3.....?= </code></pre> <p>The body of the email is utf-8 base64 encoded - and has decoded fine. I am current using Perl's Email::MIME module to decode the email.</p> <p>What is the meaning of the =?utf-8 delimiter and how do I extract information from...
<p>The <a href="http://en.wikipedia.org/wiki/MIME#Encoded-Word" rel="noreferrer"><code>encoded-word</code></a> tokens (as per <a href="http://www.faqs.org/rfcs/rfc2047.html" rel="noreferrer">RFC 2047</a>) can occur in values of some headers. They are parsed as follows:</p> <pre><code>=?&lt;charset&gt;?&lt;encoding&g...
<p>This is a standard extension for charset labeling of headers, specified in <a href="http://www.rfc-archive.org/getrfc.php?rfc=2047" rel="nofollow noreferrer">RFC2047</a>.</p>
15,329
<p>In my project I have functionality that is being used as a web application and as a console application (to be started from the task scheduler). To do that I put the common code in a DLL that is being used by both the web application and the console application. This works fine.</p> <p>However, the console and web ...
<p>Yes, you can and should put the common configuration settings in the config file for your DLL. Just add an app.config file to the DLL project, and make sure you read the configuration settings from inside the DLL. When deployed, your config file needs to have the name "MyDLL.dll.config" (assuming your DLL is named...
<p>you could put the common configuration under the windows registry, accessible wherever you like</p>
19,558
<p>Let X be the set of all sets that do not contain themselves. Is X a member of X?</p>
<p>In <strong>ZFC</strong>, either the axiom of foundation [as mentioned] or the axiom (scheme) of comprehension will prohibit this. The first, for obvious reasons; the second, since it basically says that for given <em>z</em> and first-order property <em>P</em>, you can construct { <em>x</em> ∈ <em>z</em> : <em>P</em>...
<p>The question is ill-posed in the standard <a href="http://en.wikipedia.org/wiki/Zermelo-Fraenkel_set_theory" rel="nofollow noreferrer">ZFC</a> (Zermelo-Fraenkel + axiom of Choice) set theory because the object thus defined is not a set.</p> <p>Since (again, assuming standard ZFC) your <em>class</em> {x : x\not\in x...
5,580
<p>I have seen <a href="https://stackoverflow.com/questions/87030/where-to-find-java-6-jssejce-source-code">Where to find Java 6 JSSE/JCE Source Code?</a> and asked the question myself <a href="https://stackoverflow.com/questions/150849/how-to-get-jrejdk-with-matching-source">How to get JRE/JDK with matching source?<...
<p>You can get the source code of JSSE lib (Open JDK implementation) here - <a href="http://hg.openjdk.java.net/jdk8u/jdk8u-dev/jdk/file/4d6c03fb1039/src/share/classes/sun/security/ssl" rel="noreferrer">http://hg.openjdk.java.net/jdk8u/jdk8u-dev/jdk/file/4d6c03fb1039/src/share/classes/sun/security/ssl</a></p> <p>Steps...
<p>The Sun implementation is not open source as far as I know. You can download an open source JCE here:</p> <p><a href="http://www.bouncycastle.org/java.html" rel="nofollow noreferrer">http://www.bouncycastle.org/java.html</a></p>
19,773
<p>I got a little curious after reading <a href="http://it.slashdot.org/it/08/09/09/1558218.shtml" rel="noreferrer">this /. article</a> over hijacking HTTPS cookies. I tracked it down a bit, and a good resource I stumbled across lists a few ways to secure cookies <a href="http://casabasecurity.com/content/using-aspnet-...
<p>Typically I have always done this using a 3rd party aggregator. The messages are compiled into SMIL, which is the description language for the MMS messages. These are then sent on to the aggregator who will then send them through the MMS gateway of the Network Operator. They are typically charged on a per message...
<p>You could use Twilio to accomplish this. You can <a href="https://www.twilio.com/docs/quickstart/csharp/sms/sending-via-rest" rel="nofollow">dive into the docs</a> for specific implementation details but using the <a href="https://www.twilio.com/docs/csharp/install" rel="nofollow">C# helper library</a> the code to s...
7,770
<p>We had a discussion here at work regarding why <em>fread()</em> and <em>fwrite()</em> take a size per member and count and return the number of members read/written rather than just taking a buffer and size. The only use for it we could come up with is if you want to read/write an array of structures which aren't ev...
<p>The difference in <code>fread(buf, 1000, 1, stream)</code> and <code>fread(buf, 1, 1000, stream)</code> is, that in the first case you get only one chunk of 1000 bytes or nothing, if the file is smaller and in the second case you get everything in the file less than and up to 1000 bytes.</p>
<p>I think it is because C lacks function overloading. If there was some, size would be redundant. But in C you can't determine a size of an array element, you have to specify one.</p> <p>Consider this:</p> <pre><code>int intArray[10]; fwrite(intArray, sizeof(int), 10, fd); </code></pre> <p>If fwrite accepted number...
37,852
<p>I have an MSI file that I have created using a Visual Studio Setup Project. The installed generates an .InstallState file in the application directory. Is there a way to have this file generated in a different location rather than the default location?</p>
<p>You need to set the value of InstallStateDir.<br> You need to override the Commit/Install/Rollback/Uninstall and set the value of InstallStateDir (I.E. Context["InstallStateDir"] = @"c:\mydir") . </p>
<p>This should also work by specifying /InstallStateDir="c:\myfolder" from the commandline (see KB946503). However, InstallContext is converting all parameter names to lowercase which breaks the following code from AssemblyInstaller, expecting to find the mixed case parameter name:</p> <pre><code>private string GetIns...
33,779
<p>Is it possible to initialize an array of pointers to structs? Something like:</p> <pre><code>struct country_t *countries[] = { {"United States of America", "America"}, {"England", "Europe"}, {"Ethiopia", "Africa"} } </code></pre> <p>I want to do that in order to get the entities in no...
<p>Well, your code uses structures rather than pointers to structures. There are ways to do what you seek, including:</p> <pre><code>static struct country_t us = { "United States of America", "America" }; static struct country_t uk = { "England", "Europe" }; static struct country_t et = { "Ethiopia"...
<p>This works for me:</p> <pre><code> struct country_t { char *fullname; char *shortname; }; struct country_t countries[] = { {"United States of America", "America"}, {"England", "Europe"}, {"Ethiopia", "Africa"} }; int main(int argc, char *argv[]) { return 0; } </code></pre> <p>...
23,672
<p>Has anyone else seen people do this:</p> <pre><code>private string _name; public string Name{ get{ return _name; } set{ _name = value;}}</code></pre> <p>I understand using accessors if you are going to exercise some sort of control over how it gets set or perform some sort of function on it when there is a get. B...
<p>If you make the member a public field, then you can't later refactor it into a property without changing the interface to your class. If you expose it as a property from the very beginning, you can make whatever changes to the property accessor functions that you need and the class's interface remains unchanged.</p...
<p>Preparation. You never know when you'll want to removed the set accessor down the road, perform additional operations in the setter, or change the data source for the get.</p>
20,307
<p>I've got an app on the iTunes store, and Apple provides daily (and weekly) sales reports. I'd like to download these in an automated fashion (say, via script attached to a cron job), but I'm not sure how to get around all their https-forms, Web-objects controls, session-IDs, etc.</p> <p>Does anyone have a plug &am...
<p>There's a thread in the Dev Forums about this: https://devforums.apple.com/thread/1253?start=0&amp;tstart=0'>Sales Reports Script</p> <p>Link: <a href="https://devforums.apple.com/thread/1253?start=0&amp;tstart=0" rel="nofollow noreferrer">https://devforums.apple.com/thread/1253?start=0&amp;tstart=0</a></p>
<p>There's no API but you cant "scrape" it, there are various open source scripts online.</p> <p>Instead though you can use <a href="http://www.appfigures.com" rel="nofollow noreferrer">www.appfigures.com</a> which downloads reports automatically, turns them into interactive sales/downloads reports and sends parsed re...
41,284
<p>I am getting ready to completely overhaul my web server. I use it for both development and to present product to clients. It also hosts my company website. I will be loading MS Server 2008 and MS SQL 2008. I want it to have the latest .NET Framework as well as the latest MVC templates. I want it to use SubSonic. I ...
<p>Well, sounds like you've already got a good list going. Though I'd recommend against SourceSafe. <a href="http://www.highprogrammer.com/alan/windev/sourcesafe.html" rel="nofollow noreferrer">See here for details</a>. SubVersion is a free alternative. Or perhaps git or something like that if you're up for a challenge...
<p>I would recommend to not use the same machine to host apps and develop on. You should at least make a VM to develop in so that there is no accidental interference between dev and live content. </p> <p>Make sure you have all of the known vulerabilites (sp) patched, with all that software there are going to be severa...
23,302
<p>What are your best usability testing tips? I need quick &amp; cheap. </p>
<p>While aimed at web design, Steve Krug's excellent "<a href="http://www.amazon.co.uk/Dont-Make-Me-Think-Usability/dp/0321344758/ref=sr_1_3?ie=UTF8&amp;s=books&amp;qid=1221780772&amp;sr=8-3" rel="nofollow noreferrer">Don't Make Me Think: A Common Sense Approach To Web Usability</a>" features (in the second edition, at...
<p>If you don't know where to begin, start small. Sit a friend down at your computer. Explain that you want them to accomplish a task using software, and watch everything they do.</p> <p>It helps to remain silent while they are actually working. Write everything down. <code>"John spent 15 seconds looking at the sc...
12,338
<p>I've generated a pdf using iTextSharp and I can preview it very well in ASP.Net but I need to send it directly to printer without a preview. I want the user to click the print button and automatically the document prints.</p> <p>I know that a page can be sent directly to printer using the javascript window.print() ...
<p>Finally I made it, but I had to use an IFRAME, I defined an IFrame in the aspx and didn't set the src property, in the cs file I made generated the pdf file and set the src property of the iFrame as the generated pdf file name, like this;</p> <pre><code>Document pdf = new Document(PageSize.LETTER); PdfWriter writer...
<p>ALso, try this gem:</p> <pre><code>&lt;link ref="mypdf" media="print" href="mypdf.pdf"&gt; </code></pre> <p>I havent tested it, but what I have read about it, it can be used in this way to let the mypdf.pdf be printed instead of page content whatever method you are using to print the page.</p> <p>Search for media...
34,030
<p>What is a good complete <a href="http://en.wikipedia.org/wiki/Regular_expression" rel="noreferrer">regular expression</a> or some other process that would take the title:</p> <blockquote> <p>How do you change a title to be part of the URL like Stack Overflow?</p> </blockquote> <p>and turn it into </p> <pre clas...
<p>Here's how we do it. Note that there are probably more edge conditions than you realize at first glance.</p> <p>This is the second version, unrolled for 5x more performance (and yes, I benchmarked it). I figured I'd optimize it because this function can be called hundreds of times per page.</p> <pre><code>/// &lt;...
<p>Rewrite of Jeff's code to be more concise</p> <pre><code> public static string RemapInternationalCharToAscii(char c) { var s = c.ToString().ToLowerInvariant(); var mappings = new Dictionary&lt;string, string&gt; { { &quot;a&quot;, &quot;àåáâäãåą&quot; }, { &quo...
4,490
<p>I use <a href="http://www.thekelleys.org.uk/dnsmasq/doc.html" rel="nofollow noreferrer">dnsmasq</a> to resolve DNS queries on my home network. Unfortunately, if a domain name is not known, it will append my own domain name to the request which means that I always end up viewing my own site in a browser.</p> <p>For ...
<p>try querying with a trailing dot to explicitly set the root:</p> <pre><code>host dlksfhoiahdsfiuhsdf.com. </code></pre>
<p>I tried removing <em>domain-needed</em> from my own configuration to replicate your issue and it did not produce this behaviour. It's the only other parameter I could find that might be close to relevant.</p> <p>What does your hosts file look like? Maybe something weird is going on there that makes it think all we...
2,773
<p>I am making a Color class, and provide a standard constructor like</p> <pre><code>Color(int red, int green, int blue) </code></pre> <p>And then I want to provide an easy way to get the most common colors, like Color.Blue, Color.Red. I see two possible options:</p> <pre><code>public static readonly Color Red = new...
<p>I'm guessing that you're probably already aware that the framework provides a <code>Color</code> struct. I'm guessing that you're creating a <code>Color</code> class just for practice.</p> <p>You expressed uncertainty about the meaning of the <code>static</code> keyword, although you've used it correctly. When <c...
<p>It is as you say the first will create create only one instance of the color:</p> <pre><code>public static readonly Color RED = new Color(255, 0, 0); </code></pre> <p>Under the hood I believe that in runtime it will only be instanciated on when it is called for the first time. But I haven't checked it for myself i...
40,135
<p>I need to repeatedly remove the first line from a huge text file using a bash script.</p> <p>Right now I am using <code>sed -i -e "1d" $FILE</code> - but it takes around a minute to do the deletion.</p> <p>Is there a more efficient way to accomplish this?</p>
<p>Try <a href="http://man7.org/linux/man-pages/man1/tail.1.html" rel="noreferrer">tail</a>:</p> <pre><code>tail -n +2 "$FILE" </code></pre> <p><code>-n x</code>: Just print the last <code>x</code> lines. <code>tail -n 5</code> would give you the last 5 lines of the input. The <code>+</code> sign kind of inverts the ...
<p>Would using tail on N-1 lines and directing that into a file, followed by removing the old file, and renaming the new file to the old name do the job?</p> <p>If i were doing this programatically, i would read through the file, and remember the file offset, after reading each line, so i could seek back to that posit...
44,084
<p>I know Windows Vista (and XP) cache recently loaded DLL's in memory...</p> <p>How can this be disabled via the command prompt?</p>
<p>The only thing you can do is disable SuperFetch, which can be done from the command prompt with this command (there has to be a space between the = sign and disabled).</p> <pre><code>sc config Superfetch start= disabled </code></pre> <p>There is a myth out there that you can disable DLL caching, but that only work...
<p>Perhaps it would be helpful to know why you want to do this and then try to help solve the original problem...</p>
5,709
<p>In a recent sharepoint project, I implemented an authentication webpart which should replace the NTLM authentication dialog box. It works fine as long as the user provides valid credentials. Whenever the user provides invalid credentials, the NTLM dialog box pops up in Internet Explorer.</p> <p>My Javascript code w...
<p><a href="https://stackoverflow.com/users/2199/mark-brackett">Mark</a>'s comment is correct; The NTLM auth prompt is triggered by a 401 response code and the presence of NTLM as the first mechanism offered in the WWW-Authenticate header (Ref: <a href="http://curl.haxx.se/rfc/ntlm.html" rel="nofollow noreferrer">The N...
<p>I was able to get this working for all browsers except firefox. See my blog post below from a few years ago. My post is aimed at IE only but with some small code changes it should work in Chrome and safari. </p> <p><a href="http://steve.thelineberrys.com/ntlm-login-with-anonymous-fallback-2/" rel="nofollow">http...
4,939
<p>I've been having tons of problems getting the non-xml configuration for Castle Windsor set up working properly. In the meantime I've seen more and more people giving advice via the Windsor Container fluent interface. I've been Gooogling about for the last day and I cannot find this API anywhere.</p> <p>I am talki...
<p>The Fluent interfaces were introduced a while ago - but are only available on Trunk (after RC3) either grab the castles sources (from the projects subversion repository) and build the IoC projects yourself from <a href="http://svn.castleproject.org:8080/svn/castle/trunk" rel="nofollow noreferrer">here</a>, or easier...
<p>Ok, so just for reference. Official, complete documentation for the API is on <a href="http://stw.castleproject.org/Windsor.Fluent-Registration-API.ashx" rel="nofollow noreferrer">Castle Windsor Documentation Wiki</a></p>
14,439
<p>So if I'm using branches that are remote (tracked) branches, and I want to get the lastest, I'm still unclear if I should be doing <code>git pull</code> or <code>git rebase</code>. I thought I had read that doing <code>git rebase</code> when working on a branch with other users, it can screw them up when they pull o...
<p>Git pull is a combination of 2 commands</p> <ul> <li>git fetch (syncs your local repo with the newest stuff on the remote)</li> <li>git merge (merges the changes from the distant branch, if any, into your local tracking branch)</li> </ul> <p>git rebase is only a rough equivalent to git merge. It doesn't fetch anyt...
<p>If you want to pull source without affecting remote branches and without any changes in your local copy, it's best to use git pull.</p> <p>I believe if you have a working branch that you have made changes to, use git rebase to change the base of that branch to be latest remote master, you will keep all of your bran...
12,218
<p>I have a dataset that I have modified into an xml document and then used a xsl sheet to transform into an Excel xml format in order to allow the data to be opened programatically from my application. I have run into two problems with this:</p> <ol> <li><p>Excel is not the default Windows application to open Excel ...
<pre><code>Process.Start(@"C:\Program Files\Microsoft Office\Officexx\excel.exe", "yourfile.xml"); </code></pre> <p>That being said, you will still get the message box. I suppose that you could use the Interop, but I am not sure how well it will work for you.</p>
<p>As Sam mentioned, the xlsx file extension is probably a good route to go. However, there is more involved than just saving the xml file as xlsx. An xlsx is actually a zip file with a bunch of xml files inside folders. I found some good sample code <a href="http://www.gemboxsoftware.com/Excel2007/DemoApp.htm" rel="no...
10,369
<p>I have a self built JSP webapp and at the moment I'm using tomcats built in admin pannel to manage user accounts (that are stored in tomcats config xml files) but this is limited because i can not create new accounts from within the web-app (eg. I can not have a sign up website) and need to manually create the accou...
<p>Set up a <a href="http://tomcat.apache.org/tomcat-5.5-doc/realm-howto.html" rel="nofollow noreferrer">database realm in Tomcat</a>, either a simple JDBC realm or a DataSource realm that will allow for connection pooling. Then adding users is a very simple CRUD web application, possibly combined with some confirmatio...
<p>If you are on Windows (not specified in the question) and want to use a windows logon to authenticate you might want to check out <a href="http://jcifs.samba.org/" rel="nofollow noreferrer">JCIFS</a>. JCIFS allows you to obtain the user name of an authenticated windows logon in Java. It is easy to install and relati...
17,747
<p>I have a simple table comments <code>(id INT, revision INT, comment VARCHAR(140))</code> with some content like this:</p> <pre><code>1|1|hallo1| 1|2|hallo2| 1|3|hallo3| 2|1|hallo1| 2|2|hallo2| </code></pre> <p>I'm searching for an SQL statement which will return each comment with the highest revision:</p> <pre><...
<p>Here's one way that with appropriate indexing will not be heinously slow and it doesn't use a subselect:</p> <pre><code>SELECT comments.ID, comments.revision, comments.comment FROM comments LEFT OUTER JOIN comments AS maxcomments ON maxcomments.ID= comments.ID AND maxcomments.revision &gt; comments.revision WHERE...
<p>Idea from left field, but what about adding an extra field to the table:</p> <pre><code>CurrentRevision bit not null </code></pre> <p>Then when you make a change, set the flag on the new revision and remove it on all previous ones.</p> <p>Your query would then simply become:</p> <pre><code>select Id, Co...
12,141
<p>So we are building an application with a</p> <ul> <li>UI Layer (web, mobile, Ajax client, etc)</li> <li>Service/API Layer</li> <li>Business Logic Layer </li> <li>Data Access Layer</li> </ul> <p>Our goal is to have an Entity Framework dependency from the Service Layer on down to the DAL. That means the Sevice laye...
<p>You should be performing business logic on POCOs. The entire purpose of ORM is that it is an implementation detail. The business logic should be implemented in the domain model and in the domain services - in a business application, "domain" means "business". The DAL should be there to take a POCO and persist it - i...
<p>Can you stand having a dependency in the service layer on the EF <em>interfaces?</em> You could <a href="http://www.sitechno.com/Blog/IntroducingEntityFrameworkContribEasyIPocoImplementationV01.aspx" rel="nofollow noreferrer">implement IPOCO</a>.</p> <p>There's even <a href="http://www.codeplex.com/efcontrib/Wiki/V...
23,508
<p>I know that it's said the PLA becomes brittle when kept in a humid environment, but my case is slightly weirder:</p> <p>I have rolls of 1.75 mm PLA that I bought years ago and they are fine. But if I leave my spool fed inside the PTFE (Teflon) tube of my 3D printer, that part that is inside the PTFE tube, and only t...
<p>I have this exact problem as well. I am feeding filament from the dry box through the tube into the top of the hot end. After approximately 2 days I would notice that the filament is broken somewhere close to the hot end. I don't believe that it's just humidity.</p> <p>I suspect that the filament being brittle and b...
<p>I'm having the exact same problem - it is enough to leave the filament inside the PTFE tube for an overnight and the next day the filament inside the tube is so brittle that I'm not even able to eject the filament without disconnecting the tube and getting out all small pieces of filament manually... but from my exp...
1,990
<p>What is the equivalent of the extended procedure 'xp_dirscan' in SQL Server 2005?</p>
<p>It's not native shipped code in SQL Server. It's a 3rd party extenfed stored proc (which is a DLL).</p> <p>You can register on <a href="http://www.sqlservercentral.com/articles/Administering/sql2000dbatoolkitpart4/2364/" rel="nofollow noreferrer">SQL Server Central and see this article</a> with download and instruc...
<p><code>xp_dirscan</code> seems to be an extended stored proc that performs a recursive directory search. If you have access to the DLL you could register it as an extended stored proc in SQL 2005. </p> <p>Alternatively, you could code something that performs the same action using <code>xp_cmdshell</code> or a manage...
24,876
<p>What's a simple way to combine <strong>feed</strong> and <strong>feed2</strong>? I want the items from <strong>feed2</strong> to be added to <strong>feed</strong>. Also I want to avoid duplicates as <strong>feed</strong> might already have items when a question is tagged with both WPF and Silverlight.</p> <pre><cod...
<p>You can use LINQ to simplify the code to join two lists (don't forget to put System.Linq in your usings and if necessary reference System.Core in your project) Here's a Main that does the union and prints them to console (with proper cleanup of the Reader).</p> <pre><code>using System; using System.Collections.Gene...
<p>If it's solely for stackoverflow, you can use this :<br> <a href="https://stackoverflow.com/feeds/tag/silverlight%20wpf">https://stackoverflow.com/feeds/tag/silverlight%20wpf</a><br> This <strong>will</strong> do an union of the two tags.</p> <p>For a more general solution, I don't know. You'd probably have to manu...
10,455
<p>I've looked for some other articles on this problem and even tried some of the ideas in <a href="https://stackoverflow.com/questions/8440/visual-studio-optimizations#8539">this thread</a>; however, nothing has solved the issue yet. So, on to the issue.</p> <p>Something happens when working in Visual Studio (usually...
<p>I've had a problem similar to this happen before. Are you using an plugins like ReSharper or DevExpress?</p>
<p>I had similar problem with Visual Studio 2005. </p> <p>I read through several posts (sorry I could not post the links because of: sorry, new users can only post a maximum of one hyperlink).</p> <p>I ran FileMon and discovered that on save the IDE keeps querying C:\Documents and Settings\iguigova\Local Settings\Ap...
12,920
<p>Although I don't have an iPhone to test this out, my colleague told me that embedded media files such as the one in the snippet below, only works when the iphone is connected over the WLAN connection or 3G, and does not work when connecting via GPRS.</p> <pre><code>&lt;html&gt;&lt;body&gt; &lt;object data="http://j...
<p>The iPhone YouTube application automatically downloads lower quality video when connected via EDGE than when connected via Wi-Fi, because the network is much slower. That fact leads me to believe Apple would make the design decision to not bother downloading an MP3 over EDGE. The browser has no way to know in adva...
<p>I wasn't aware of that limitation. Although it does make sense to disable potentially data-hefty OBJECT or EMBED tags when on the cellular data service for which your provider may be charging by the byte, if that were the reason it wouldn't make sense that it would still work on 3G and only not on GPRS.<br /> Perha...
11,279
<p>I have a Jar file, which contains other nested Jars. When I invoke the new <code>JarFile()</code> constructor on this file, I get an exception which says:</p> <blockquote> <p>java.util.zip.ZipException: error in opening zip file</p> </blockquote> <p>When I manually unzip the contents of this Jar file and zip it ...
<p>Make sure your jar file is not corrupted. If it's corrupted or not able to unzip, this error will occur.</p>
<p>Liquibase was getting this error for me. I resolved this after I debugged and watched liquibase try to load the libraries and found that it was erroring on the manifest files for commons-codec-1.6.jar. Essentially, there is either a corrupt zip file somewhere in your path or there is a incompatible version being use...
42,106
<p>Using Vim I often want to replace a block of code with a block that I just yanked.</p> <p>But when I delete the block of code that is to be replaced, that block itself goes into the register which erases the block I just yanked. So I've got in the habit of yanking, then inserting, then deleting what I didn't want, ...
<p>To delete something without saving it in a register, you can use the "black hole register":</p> <pre><code>"_d </code></pre> <p>Of course you could also use any of the other registers that don't hold anything you are interested in.</p>
<p>You can make a simple macro with: <code>q&quot;_dwq</code></p> <p>Now to delete the next word without overwriting the register, you can use <code>@d</code></p>
7,789
<p>It is obviously possible to hide individual data points in an Excel line chart.</p> <ul> <li>Select a data point. </li> <li>Right click -> Format Data Point... </li> <li>Select Patterns</li> <li>Tab Set Line to None</li> </ul> <p>How do you accomplish the same thing in VBA? Intuition tells me there should be a pro...
<p>"Describe it to the teddy bear" works almost every time...</p> <p>You have to go to the Border child object of the Point object and set its LineStyle to xlNone.</p>
<p>I tried "#N/A" with quotes in Excel 207 and as a result the data point is shown like a zero in the graph. It Works without the quotes.</p>
7,726
<p>I have a user reporting that when they use the back button to return to a web page that they come back as a different person. It seems like they may be accessing a different users profile.</p> <p>Here are the important parts of the code:</p> <pre><code>//here's the code on the web page public static WebProfile p ...
<p>In Perl:</p> <pre><code>#!/usr/local/bin/perl -w if (@ARGV != 2) { print "Usage: watchit.pl &lt;cmd&gt; &lt;str&gt;\n"; exit(1); } $cmd = $ARGV[0]; $str = $ARGV[1]; while (1) { my $output = `$cmd`; print $output; # or dump to file if desired if ($output =~ /$str/) { exit(0); }...
<pre><code>while (/bin/true); do OUTPUT=`/some/command` if [[ "x$OUTPUT" != "x" ]]; then echo $OUTPUT break fi sleep 1 done </code></pre>
15,670
<p>I am developing iPhone application and In that application I've one <code>TableViewController</code>, and that <code>TableViewController</code> made up of Custom table cell.<br> into those cell I am loading image from URL, but the <code>scrolling</code> is not that smooth, (because each cell load images every time w...
<p>Storing the images on the device may improve things somewhat, but it will not make scrolling really smooth. The reason scrolling tends to become choppy is that a synchronous function in your cell code means that you are blocking the run loop, which prevents animation. If you want to speed up scrolling you need to ge...
<p>You could use <code>NSFileManager</code> 's <code>createFileAtPath</code> to save any <code>NSData</code> into a file.</p> <p>To get the Documents directory, use this:</p> <pre><code>NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [pa...
29,999
<p>I am creating a WordML document from an xml file whose elements sometimes contain html-formatted text. </p> <pre><code>&lt;w:p&gt; &lt;w:r&gt; &lt;w:t&gt; html formatted content is in here taken from xml file! &lt;/w:t&gt; &lt;/w:r&gt; &lt;/w:p&gt; </code></pre> <p>This is how my templates are sort of set...
<p>Working with WordML is tricky. One tip when converting arbitrary XML to WordML using XSLT is to not worry about the text runs when processing blocks, but to instead create a template that matches text() nodes directly, and create the text runs there. It turns out that Word doesn't care if you nest text runs, which...
<p>I can most probably help you if only I understood your problem... Is the html in a CDATA section or is it parsed as part of the input doc (and thus well-formed XML)? Since you talk about 'text replacement' I'll assume that you treat the 'html formatted content' as a single string (CDATA) and therefor need a recursiv...
28,987
<p>I would like to use an add-in like simple-modal or the dialog add-in in the UI kit. However, how do I use these or any other and get a result back. Basically I want the modal to do some AJAX interaction with the server and return the result for the calling code to do some stuff with.</p>
<p>Here is how the confirm window works on simpleModal:</p> <pre><code>$(document).ready(function () { $('#confirmDialog input:eq(0)').click(function (e) { e.preventDefault(); // example of calling the confirm function // you must use a callback function to perform the "yes" action confirm("Continue...
<p>Since the modal dialog is on the page, you're free to set any document variable you want. However all of the modal dialog scripts I've seen included a demo using the return value, so it's likely on that page.</p> <p>(the site is blocked for me otherwise I'd look)</p>
7,272
<p>Is there anything we can do either in code (ASP/JavaScript) or in Excel so that the comma separated values end up in separate columns in Excel?</p>
<p>once it is imported, you can go to 'Tools' -> 'Text to Columns...' menu and specify a delimiting character.</p>
<p>If you open the file via Excel's 'File --> Open' menu, then it will separate the values in the cells.</p>
36,959
<p>If I go to www.paypal.com, Firefox displays a huge icon in the location bar. Is it possible to get my web site to do this without paying $2700 to Verisign? Where is the best place to buy SSL certificates and not break the bank?</p>
<p>You're talking about EV (extended validation) SSL. <a href="http://www.digicert.com/ev-ssl-certification.htm" rel="nofollow noreferrer">Digicert</a> are very competitive for this ($488 per year) and also standard SSL certificates. Whoever you go for though, make sure you check what browser compatibility they have as...
<p>To get the green bar, your CA needs to pass an audit. Be sure that you're buying an Extended Validation cert, and using https.</p>
12,350
<p>I've got my brand new VS2008 and decided to convert my main solution from VS2005. One of the projects is a SQL2005 reporting services project. Now that I've converted I cannot load it in VS2008. Is there anyway around this? </p> <p>My problem is that my solution is a hybrid and has websites libraries and reports in...
<p>As you have guessed, the baseAddresses element is completely ignored when hosting in IIS. The service's base address is determined by the web site &amp; virtual directory into which your wcf service is placed.</p> <p>Even when self-hosting, baseAddresses is not required. It is merely a convenience that avoids you ...
<p>base address required for selfhosting. IIS/WAS hosts ignores the base address.</p>
8,014
<p>I'm using freemarker, SiteMesh and Spring framework. For the pages I use ${requestContext.getMessage()} to get the message from message.properties. But for the decorators this doesn't work. How should I do to get the internationalization working for sitemesh?</p>
<p>You have to use the <strong><em>fmt</em></strong> taglib.</p> <p>First, add the taglib for sitemesh and fmt on the fisrt line of the decorator.</p> <pre><code>&lt;%@ taglib prefix="decorator" uri="http://www.opensymphony.com/sitemesh/decorator"%&gt; &lt;%@ taglib prefix="page" uri="http://www.opensymphony.com/site...
<p>If you prefer templates and the freemarker servlet instead you can enter the following in your templates:</p> <pre><code>&lt;#assign fmt=JspTaglibs["http://java.sun.com/jstl/fmt"]&gt; &lt;@fmt.message key="webapp.name" /&gt; </code></pre> <p>and in your <code>web.xml</code>:</p> <pre><code>&lt;context-param&gt; ...
12,262
<p>Can dynamic variables in C# 4.0 be members on a class or passed into or returned from methods? var from C# 3.0 couldn't but I haven't seen any mention anywhere of whether it is possible or not with dynamic.</p>
<p>All of the above. I tried them out in the VPC and was able to do all of these. See the <a href="http://code.msdn.microsoft.com/csharpfuture" rel="noreferrer">'New Features in C#' document here</a></p>
<p>This code snippet from the book "CLR via C#, 3rd Ed" shows dynamic in action :</p> <pre><code>using System; using System.Dynamic; static class DyanmicDemo { public static void Main() { for(Int32 demo =0; demo &lt; 2; demo++) { dynamic arg = (demo == 0) ? (dynamic) 5 : (dynamic) "A"; dynamic result = Plu...
30,372
<p>How can I bind arguments to a Python function so that I can call it later without arguments (or with fewer additional arguments)?</p> <p>For example:</p> <pre><code>def add(x, y): return x + y add_5 = magic_function(add, 5) assert add_5(3) == 8 </code></pre> <p>What is the <code>magic_function</code> I need her...
<p><a href="http://docs.python.org/2/library/functools.html#functools.partial" rel="noreferrer" title="Python 2 Documentation: functools module: partial function"><code>functools.partial</code></a> returns a callable wrapping a function with some or all of the arguments frozen.</p> <pre class="lang-py prettyprint-over...
<p>Functors can be defined this way in Python. They're callable objects. The "binding" merely sets argument values.</p> <pre><code>class SomeFunctor( object ): def __init__( self, arg1, arg2=None ): self.arg1= arg1 self.arg2= arg2 def __call___( self, arg1=None, arg2=None ): a1= arg1 ...
35,075
<p>I need to create an access (mdb) database without using the ADOX interop assembly. </p> <p>How can this be done?</p>
<p>Before I throw away this code, it might as well live on stackoverflow </p> <p>Something along these lines seems to do the trick: </p> <pre><code>if (!File.Exists(DB_FILENAME)) { var cnnStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + DB_FILENAME; // Use a late bound COM object to create a new catal...
<p>You don't need Jet(major headache) installed, if you use this connection string in .net 3.5 </p> <pre><code>Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccess2007file.accdb;Persist Security Info=False; </code></pre> <p>This should work on access 2007 and below</p>
18,850
<p>I had an odd problem today when I was trying to serialize an object. The object was generated via "Add service reference" from a web service (svcutil.exe). </p> <p>The problem was that the below property (agencyId) was not being serialized with the rest of the object. Out of desperation I commented the property ...
<p>There is a pattern (for XmlSerializer), that a property Foo will also look for either "bool FooSpecified", or "bool ShouldSerializeFoo()" - and if found, only serialize Foo if this other member returns true. So I assume that agencyIdSpecified had never been set to true? Removing this member would make it always seri...
<p>The purpose of XmlIgnoreAttribute is to tell the XmlSerializer that you don't want to serialize that property: it's the whole point. So what you're seeing is the designed behavior of that code. A much better question would be why the class implementor chose to decorate that property in that way.</p>
25,602
<p>I'm really stumped on this one. I want to output a list and have the tag file take care of commas, singular versus plural, etc. but when I display the list it completely ignores whitespace so everythingrunstogetherlikethis. I tried using the HTML entities "thinsp", "ensp" and "emsp" (I can't use "nbsp", these have t...
<p>It's actually a bug in the EL parser which causes spaces in between EL expressions to be eaten. E.g.</p> <pre><code>${bean.foo} ${bean.bar} ${bean.waa} </code></pre> <p>would get printed as (assuming that they returns the very same String value as its property name is):</p> <pre><code>foobarwaa </code></pre> <p>...
<p>So you are saying your <em>tag</em> doesn't print out white space at all? Is there any whitespace for it to print out?</p> <p>Can you post the code, and a short example of how you use it?</p>
30,374
<p>Has anyone found a useful solution to the DesignMode problem when developing controls?</p> <p>The issue is that if you nest controls then DesignMode only works for the first level. The second and lower levels DesignMode will always return FALSE.</p> <p>The standard hack has been to look at the name of the process...
<p>Revisiting this question, I have now 'discovered' 5 different ways of doing this, which are as follows:</p> <pre><code>System.ComponentModel.DesignMode property System.ComponentModel.LicenseManager.UsageMode property private string ServiceString() { if (GetService(typeof(System.ComponentModel.Design.IDesigner...
<p>I had to fight this problem recently in Visual Studio 2017 when using nested UserControls. I combine several of the approaches mentioned above and elsewhere, then tweaked the code until I had a decent extension method which works acceptably so far. It performs a sequence of checks, storing the result in static boo...
5,498
<p>I want to do something like this:</p> <pre><code>const MyFirstConstArray: array[0..1] of string = ('Hi', 'Foo'); MySecondConstArrayWhichIncludesTheFirstOne: array[0..2] of string = MyFirstConstArray + ('Bar'); </code></pre> <p>Basically I want the following result:</p> <pre><code>MyFirstConstArray -&gt;...
<p>AFAIK, you can't do that.<br> But if the goal is to ensure you declare your actual constant string only once, I suggest you declare the individual strings and then group them in arrays: </p> <pre><code>const MyConst1 = 'Hi'; MyConst2 = 'Foo'; MyConst3 = 'Bar'; MyFirstConstArray: array[0..1] of string = (My...
<p>I don't think so. You'll have to do it in code. If these are global constants, you can do the initialization in the 'initialization' section of the unit.</p>
30,668
<p>I was shocked to learn that OpenMosix is <a href="http://openmosix.sourceforge.net/" rel="nofollow noreferrer">closed</a>. Can you suggest any similar free tool for linux. </p> <p>For those who don't know, OpenMosix is</p> <blockquote> <p>a software package that turns networked computers running GNU/Linux into a...
<p>I'm not sure how it compares feature-wise to OpenMosix, but <a href="http://www.rocksclusters.org/" rel="nofollow noreferrer">Rocks</a> is an open source cluster Linux distro.</p> <p><a href="http://www.rocksclusters.org/wordpress/?page_id=57" rel="nofollow noreferrer">From the website</a>:</p> <blockquote> <p>R...
<p>I looked here to get an update as I have not used openmosix since graduating, but there is now a new tech called "Mesh Computing", and also the ether of bitcoin, so processes must transport the means of getting their data to a suitable node in a secure manner, and then try to run in a fault tolerant manner. I think ...
35,111
<p>I am currently validating a client's HTML Source and I am getting a lot of validation errors for images and input files which do not have the Omittag. I would do it manually but this client literally has thousands of files, with a lot of instances where the is not .</p> <p>This client has validated some img tags (...
<p>Try this. It'll go through your files, make a <code>.orig</code> backup of each file (perl's <code>-i</code> operator), and replace <code>&lt;img&gt;</code> and <code>&lt;input&gt;</code> tags with <code>&lt;img /&gt;</code> and <code>&lt;input &gt;</code>.</p> <pre><code>find . \! -path '*.svn*' -type f -exec perl...
<p>See questions I asked in comment at top.</p> <p>Assuming you're using GNU sed, and that you're trying to <strong>add</strong> the trailing <code>/</code> to your tags to make XML-compliant <code>&lt;img /&gt;</code> and <code>&lt;input /&gt;</code>, then replace the sed expression in your command with this one, and...
29,965
<p>What do folks here see as the relative strengths and weaknesses of Git, Mercurial, and Bazaar?</p> <p>In considering each of them with one another and against version control systems like SVN and Perforce, what issues should be considered?</p> <p>In planning a migration from SVN to one of these distributed version...
<p>Git is very fast, scales very well, and is very transparent about its concepts. The down side of this is that it has a relatively steep learning curve. A Win32 port is available, but not quite a first-class citizen. Git exposes hashes as version numbers to users; this provides guarantees (in that a single hash alway...
<p>Distributed version control systems (DVCSs) solve different problems than Centralized VCSs. Comparing them is like comparing hammers and screwdrivers.</p> <p><a href="http://en.wikipedia.org/wiki/Revision_control" rel="nofollow noreferrer">Centralized VCS</a> systems are designed with the intent that there is One ...
10,297
<p>What is .net dynamic data and why would I use it?</p>
<p>From <a href="http://weblogs.asp.net/scottgu/archive/2007/12/14/new-asp-net-dynamic-data-support.aspx" rel="nofollow noreferrer">ScottGu's Blog</a> a great article on how to use Dynamic Data.</p> <blockquote> <p>One of the cool new features is something we call "ASP.NET Dynamic Data Support". In a nutshell this e...
<p>ASP.NET DDS is the drag and drop change here and there and you have a data Driven web application ready to go kind'a thing.</p> <p><a href="http://mattberseth.com/" rel="nofollow noreferrer">Matt Berseth</a> has a <a href="http://mattberseth.com/blog/dynamic_data/" rel="nofollow noreferrer">few good posts about thi...
24,790
<p>Null or empty string -- is one better than the other to represent no data in a table column? (I specifically use MySQL, but I'm thinking this is system-independent.) Are there major advantages/disadvantages to using one over the other, or is it simply programmer preference?</p>
<p>I strongly disagree with everyone who says to unconditionally use NULL. Allowing a column to be NULL introduces an additional state that you wouldn't have if you set the column up as NOT NULL. Do not do this if you don't need the additional state. That is, if you can't come up with a difference between the meanin...
<p>There is one important exception. Bill Karwin stated "CONCAT(NULL, 'foo') yields NULL" which is true for most RDBMSs but NOT for Oracle.</p> <p>As suggested by James Curran above, Oracle chose this rather critical juncture to depart from standard SQL by treating NULLs and empty strings exactly the same. Worse tha...
20,287
<p>Has anyone worked out how to get PowerShell to use <code>app.config</code> files? I have a couple of .NET DLL's I'd like to use in one of my scripts but they expect their own config sections to be present in <code>app.config</code>/<code>web.config</code>.</p>
<p>Cross-referencing with this thread, which helped me with the same question: <a href="https://stackoverflow.com/questions/2789920/subsonic-access-to-app-config-connection-strings-from-referenced-dll-in-powershel">Subsonic Access To App.Config Connection Strings From Referenced DLL in Powershell Script</a></p> <p>I a...
<p><em>Attempting a new answer to an old question.</em></p> <p>I think the modern answer would be: don't do that. PowerShell is a shell. The normal way of passing information between parts of the shell are shell variables. For powershell that would look like:</p> <pre><code>$global:MyComponent_MySetting = '12' # i....
3,858
<p>HI, I am new to the scrum methodology and looking for some help to get comfortable with the environment and wondering if there needs to be a bucket to track Developers and QA hours spent on deployments and bug fixes and retests. Seems like it could have major impact on the graph.</p>
<p>My team is supporting a number of legacy apps, so there's quite a bit of unplanned bug fixing that occurs during each sprint. We've adopted the following practice:</p> <ul> <li>If the bug is easy/quick to fix (one liner, etc), then just fix it.</li> <li>If the bug is not trivial, and not a blocker, then add it to ...
<p>In each sprint I have two 'tasks' - one for bugs found in the current sprint (i.e. on unshipped code), and one for issues found in anything else (any shipped release). This helps me keep track of how much time is lost (per developer) fixing bugs.</p> <p>Any time logged in the latter category is regarded as waste an...
21,141
<p>I'm using two different libraries in my project, and both of them supply a basic rectangle <code>struct</code>. The problem with this is that there seems to be no way to insert a conversion between the types, so I can't call a function in one library with the result from a function in the other. If I was the author ...
<p>If you can't modify the structures then you have no alternative to writing a manual conversion function because overloading conversion operators only works within the class body. There's no other way.</p>
<p>Maybe you could try it with operator overloading ? (Maybe a = operator which is not a method of your class) ?</p> <p>Rect operator= (const Rect&amp;,const rectangle&amp;)</p> <p>More about this in the C++ programming language by Bjarne Stroustrup or maybe on this page: <a href="http://www.cs.caltech.edu/courses/cs...
4,786
<p>As the question states - is there a good tool out there which lists methods an unmanaged DLL exports? I would like it to list COM methods and interfaces too.</p>
<p>For DLLs, use the Dependency Viewer (<a href="http://technet.microsoft.com/en-us/library/cc738370.aspx" rel="noreferrer">depends.exe</a>).</p> <p>For COM objects, use <a href="http://www.microsoft.com/downloads/details.aspx?familyid=5233b70d-d9b2-4cb5-aeb6-45664be858b6&amp;displaylang=en" rel="noreferrer">oleview.e...
<p>As an application packager we use a utility that monitors (or dumps) the registration information - WiseComCapture.exe - this is part of Wise Package Studio however which isn't free. It spits out a .reg file of all it's registration information. </p> <p>A bit of noodling around with google may 'expose' it</p>
23,759
<p>How can I generate a report in access with the data from a recordset (instead of a query or table). I have updates to the recordset that also must be shown in the report.</p>
<p>From <a href="http://www.mvps.org/access/reports/rpt0014.htm" rel="nofollow noreferrer">Access Web</a> you can use the "name" property of a recordset. You resulting code would look something like this:</p> <p><em>In the report</em> </p> <pre><code>Private Sub Report_Open(Cancel As Integer) Me.RecordSource = ...
<p>Please explain in more detail. For example, do you wish to show what the field was and what it is now? If so, you will need an audit trail. Here is an example from Microsoft: <a href="http://support.microsoft.com/kb/q197592/" rel="nofollow noreferrer">http://support.microsoft.com/kb/q197592/</a></p> <p>What do you ...
30,017
<p>Should i stay out of rails if a client has a cheap hosting service with a provider that do not support mod_rails? Will rails + fast.cgi provide a good experience for a user or should I choose, in this scenario, php + my-favorite-framework as platform ?</p> <p>Regards,</p> <p>Victor</p>
<p>I have three clients on inexpensive hosting plans using FastCGI and have not run into any issues due to FastCGI itself. These are all low traffic sites where Mongrel was not necessary.</p> <blockquote> <p>Will rails + fast.cgi provide a good experience for a user</p> </blockquote> <p>It all depends on what you'r...
<p>I would tend to avoid FastCGI. I haven't used it myself but I've read enough horror stories about it to never want to.</p> <p>If the hosting company is going to be completely responsible for managing the server instance and you can trust them to be the ones who will make sure the app is always up and running, then...
25,651
<p>Is there currently a way to host a shared Git repository in Windows? I understand that you can configure the Git service in Linux with:</p> <pre><code>git daemon </code></pre> <p>Is there a native Windows option, short of sharing folders, to host a Git service?</p> <p>EDIT: I am currently using the cygwin instal...
<p>Here are some steps you can follow to get the git daemon running under Windows:</p> <p><em>(Prerequisites: A default Cygwin installation and a git client that supports git daemon)</em></p> <p><strong>Step 1</strong>: Open a bash shell</p> <p><strong>Step 2</strong>: In the directory /cygdrive/c/cygwin64/usr/local...
<p>I think what Henk is saying is that you can create a shared repository on a drive and then copy it to some common location that both of you have access to. If there is some company server or something that you both have ssh access to, you can put the repository someplace where you can SCP it back to your own compute...
28,892
<p>Is there a way of changing/adding to the windows Open/Save common dialog to add extra functionality?</p> <p>At work we have an area on a server with hundreds of 'jobfolders'- just ordinary windows folders created/managed automatically by the database application to house information about a job (emails/scanned faxe...
<p>Like Mark Ransom said, you can do it with the OFN&nbsp;ENABLETEMPLATE and OFN&nbsp;ENABLEHOOK flags. You then specify a Dialog Resource to the lpTemplateName data member of the OPENFILENAME structure. Getting the placement of your controls right takes a bit of trial and error.</p> <p>The hook procedure that you wri...
<p>Your program can set the starting folder, so if you know the job number (and therefor the name of the folder), you can set the dialog to start out with the correct folder already opened. Beyond that I don't think you can do much without writing an entire shell extension for it.</p>
17,972
<p>I have this code:</p> <pre><code>SELECT idcallhistory3, callid, starttime, answertime, endtime, duration, is_answ, is_fail, is_compl, is_fromoutside, mediatype, from_no, to_no, callerid, dialednumber, lastcallerid, lastdialednumber, group_no, line_no FROM "public".callhistory3 ...
<pre><code>WHERE (@start is null OR starttime &gt;= @start) AND (@end is null OR endtime &lt;= @end) AND (@fromOutside is null OR is_fromoutside = @fromOutside) AND (@fromNo is null OR from_no = @fromNo) AND (@toNo is null OR to_no = @toNo) </code></pre> <p>Pass nulls for all parameters (dang sql nulls;...
<p>I agree with Jamal Hansen. COALESCE is by far the best performing way to go, at least on SQL Server</p>
45,471
<p>I'm mostly a .Net person at the moment, but I've been playing with Java some lately-- exploring what's out there.</p> <p>Now I'm looking for the Java equivalent for WPF. I know I could find an OpenGL library or two out there, but that's not really as rich or simple as the WPF system.</p>
<p>I think a combination of JavaFX, Swing, Java2D, and Java's browser-based JRE comprise the solutions that WPF provides:</p> <ul> <li>JavaFX applications (actually, any Java app) can run in the browser or on a desktop</li> <li>JavaFX provides high-end video support</li> <li>JavaFX provides for scripted animations and...
<p>Feature-wise WPF is more comprehensive than any of the JavaFX, Swing, AWT or Java2D. That was the design goal after all, to bring everything related to the presentation in a single library. Performance-wise they are about the same with the exception of the memory usage where Java is a <a href="http://www.codeproject...
36,193
<p>My company develops several types of applications. A lot of our business comes from doing multimedia-type apps, typically done in Flash. However, now that side of the house is starting to migrate towards doing Flex development.</p> <p>Most of our other development is done using .NET. I'm trying to make a push to...
<p>I think you should look at Silverlight as a long-term play, just as Microsoft seems to be doing. There's an obvious balance on when to use Silverlight vs. Flash when you're concerned about reach and install base, but here are some reasons Silverlight is a good direction to move in:</p> <ol> <li><p>Second mover adva...
<p>Flash Player is available &amp; supported officially in almost all desktop platforms (Windows, Linux, Mac) whereas Silverlight will be supported mainly in Windows.</p> <p>the following <a href="http://www.brighthub.com/internet/web-development/articles/33696.aspx" rel="nofollow noreferrer">article</a> provides compa...
4,127
<p>As you develop an application database changes inevitably pop up. The trick I find is keeping your database build in step with your code. In the past I have added a build step that executed SQL scripts against the target database but that is dangerous in so much as you could inadvertanly add bogus data or worse. ...
<p>Version numbers embedded in the database are helpful. You have two choices, embedding values into a table (allows versioning multiple items) that can be queried, or having an explictly named object (such as a table or somesuch) you can test for.</p> <p>When you release to production, do you have a rollback plan in...
<p>I like the way that Django does it. You build models and the when you run a syncdb it applies the models that you have created. If you add a model you just need to run syncdb again. This would be easy to have your build script do every time you made a push. </p> <p>The problem comes when you need to alter a table t...
5,372
<p>I was recommeded a book called: </p> <p>Accelerated C++ Practical Programming by Example by Andrew Koenig and Barbara E. Moo Addison-Wesley, 2000 ISBN 0-201-70353-X </p> <p>The basis of this book is that Object Oriented Programming is highly wasteful memory-wise, and that most source-code should not be written t...
<p>I haven't read the book, but I have trouble believe that they wrote a book whose "basis ...is that Object Oriented Programming is highly wasteful memory-wise" (Full disclosure: Andy &amp; Barbara are friends of mine). </p> <p>Andy would never say the OOP is wasteful of memory. He WOULD say that a particular algor...
<p>Some of the answers are totally missing the point. OOP in C++ has many opportunities to be much faster than their C counterparts. I'll give the example from I think Effective C++ by Scott Meyers, which is that quicksort runs slower than C++ sort because the compiler is able to inline the function call easily in C++ ...
26,137
<p>I am experimenting for the first time with css layouts and my experience with CSS is very basic. What I want to achieve is a 2 column layout: left panel and content.<br> I have found this:</p> <pre><code>#leftcontent { position: absolute; left: 10px; top: 10px; width: 170px; border: 1px solid #C...
<p>I'd advise floating the #leftcontent element to the left, and then setting the margin of the #centercontent element to compensate:</p> <pre><code>#leftcontent { float: left; width:170px; border:1px solid #C0C0C0; padding: 2px; } #centercontent { margin-left: 181px; b...
<p>Use a table. It is more suited to the task, way easier to implement and far more reliable across different browsers.</p>
32,540
<p>I have a database that stores events in it and a page with a calendar object on it. When rendering the days it looks through the months events and if any match the current day being rendered it creates a linkbutton to represent the event in the day on the calendar and adds it to that cell. I add some javascript to t...
<p>Your session vars are controlled by the server, JS runs client side, and as such cannot modify the vars directly.</p> <p>You need to make server requests using POST or GET and hidden iframes, or XMLHTTPRequest() calls to send data from the JS to the server, and then have your server side code handle the vars.</p> ...
<pre><code>var page1 = document.getElementById("textbox").value; sessionStorage.setItem("page1content", page1); </code></pre> <p>in other page use this value as like session variable </p> <pre><code>document.getElementById("textbox2").value=sessionStorage.getItem("page1content"); </code></pre>
15,776
<p>We are developing a Visual Basic 6.0 project. We have written a library, which we were testing using vbunit and vbmock. But soon found that the tests were not maintainable. So, we decided to write tests using MBunit. Now, we want to know the test coverage. How can we do it? thanks</p>
<p>The only VB6 test coverage tool I know is <a href="http://www.aivosto.com/vbwatch.html" rel="nofollow noreferrer">http://www.aivosto.com/vbwatch.html</a> Aivisto seems to have a generally good reputation for their VB tools.</p>
<p>Look into NCover</p>
10,575
<p>Can someone explain why there is the need to add an out or in parameter to indicate that a generic type is Co or Contra variant in C# 4.0?</p> <p>I've been trying to understand why this is important and why the compiler can't just figure it out..</p> <p>Thanks,</p> <p>Josh</p>
<p>Eric Lippert, who works on the langauge, has a series of posts on msdn that should help clarify the issues involved:<br> <a href="http://blogs.msdn.com/ericlippert/archive/tags/Covariance+and+Contravariance/default.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/ericlippert/archive/tags/Covariance+and+Contrava...
<p>The <code>in</code> and <code>out</code> keywords have been keywords since C# 1.0, and have been used in the context of <code>in</code>- and <code>out</code>- parameters to methods.</p> <p>Covariance and contravariance are constraints on how one can implement an interface. There is no good way to infer them - the o...
33,746
<p>How can I get the current system status (current CPU, RAM, free disk space, etc.) in Python? Ideally, it would work for both Unix and Windows platforms.</p> <p>There seems to be a few possible ways of extracting that from my search:</p> <ol> <li><p>Using a library such as <a href="http://www.psychofx.com/psi/trac/wi...
<p><a href="https://pypi.python.org/pypi/psutil" rel="noreferrer">The psutil library</a> gives you information about CPU, RAM, etc., on a variety of platforms:</p> <blockquote> <p>psutil is a module providing an interface for retrieving information on running processes and system utilization (CPU, memory) in a portable...
<p>I don't believe that there is a well-supported multi-platform library available. Remember that Python itself is written in C so any library is simply going to make a smart decision about which OS-specific code snippet to run, as you suggested above. </p>
34,803
<p>Python is quite cool, but unfortunately, its debugger is not as good as perl -d. </p> <p>One thing that I do very commonly when experimenting with code is to call a function from within the debugger, and step into that function, like so:</p> <pre><code># NOTE THAT THIS PROGRAM EXITS IMMEDIATELY WITHOUT CALLING FO...
<p>And I've answered my own question! It's the "debug" command in pydb:</p> <pre><code>~&gt; cat -n /tmp/test_python.py 1 #!/usr/local/bin/python 2 3 def foo(): 4 print "hi" 5 print "bye" 6 7 exit(0) 8 ~&gt; pydb /tmp/test_python.py (/tmp/test_python.py:7): &lt;m...
<p>There is a python debugger that is part of the core distribution of python called 'pdb'. I rarely use it myself, but find it useful sometimes.</p> <p>Given this program:</p> <pre><code>def foo(): a = 0 print "hi" a += 1 print "bye" foo() </code></pre> <p>Here is a session debugging it:</p> <pr...
28,294
<p>I'd like to implement a UITableView which displays say 20 rows at a time. But given the fact that I might actually have say 120 items to present, I'd like to handle this using some sort of paging:</p> <p>Populate table with first 20 items. When the user does a right-to-left swipe, reload the UITableView with the ne...
<p>A horizontal swipe on a table row is already a standard UI behavior that causes that row to be deleted. Don't go changing standard UI paradigms -- it confuses users and makes them dislike your app.</p>
<p>Just call a touch cancel method there check the swipe is occured ir not with touch points.Then do your functionality</p>
44,564
<p>Every time I create an object that has a collection property I go back and forth on the best way to do it?</p> <ol> <li>public property with a getter that returns a reference to private variable</li> <li>explicit get_ObjList and set_ObjList methods that return and create new or cloned objects every time</li> <li>ex...
<p>How you expose a collection depends entirely on how users are intended to interact with it.</p> <p><strong>1)</strong> If users will be adding and removing items from an object's collection, then a simple get-only collection property is best (option #1 from the original question):</p> <pre><code>private readonly C...
<p>If you're simply looking to expose a collection on your instance, then using a getter/setter to a private member variable seems like the most sensible solution to me (your first proposed option).</p>
5,543
<p>I have a database full of customer data. It's so big that it's really cumbersome to operate on, and I'd rather just slim it down to 10% of the customers, which is plenty for development. I have an awful lot of tables and I don't want to alter them all with "ON DELETE CASCADE", especially because this is a one-time...
<p>Combining your advice and a script I found online, I made a procedure that will produce SQL you can run to perform a cascaded delete regardless of <code>ON DELETE CASCADE</code>. It was probably a big waste of time, but I had a good time writing it. An advantage of doing it this way is, you can put a <code>GO</cod...
<p>This script has two issues: 1. You must indicate the condition 1=1 in order to delete all table base. 2. This creates the direct relations with the base table only. If the final table has another table parent relation, the the delete fail</p> <p>DELETE FROM [dbo].[table2] WHERE TableID in (select [ID] from [dbo].[t...
14,252
<p>I am trying to run a java based tool using a command line syntax as the following: java -cp archive.jar archiveFolder.theMainClassName.Although the class I am searching for, a main class, "theMainClassName" is in the archive.jar and in the archiveFolder given at input, I keep getting the error that my class is not s...
<p>Here's a concrete example of what <em>does</em> work, so you can compare your own situation.</p> <p>Take this code and put it anywhere, in a file called <code>MainClass.java</code>. (I've assumed a directory called <code>src</code> later. Normally you'd arrange the source to match the package, of course.)</p> <pre...
<p>I think others have covered some common stuff here. I'd jar tf the jar and make sure the class is listed. I'd also double-check that the class is public and the method is "public static void main(String[] arg)".</p>
37,407
<p>What is the difference between <code>find-grep</code> and <code>grep-find</code> in Emacs?</p>
<p>You can use <code>M-x describe-function</code> (or <code>C-h f</code> with default keybindings) to answer this question, here's the output for <code>find-grep</code>:</p> <pre><code>find-grep is an alias for `grep-find' in `progmodes/grep.el'. (find-grep COMMAND-ARGS) ... </code></pre>
<p>They seem the same. See <a href="http://www.impernix.org/Manuals/emacs/Grep-Searching.html" rel="nofollow noreferrer">the manual</a></p>
42,423
<p>how can i create an application to read all my browser (firefox) history? i noticed that i have in </p> <p>C:\Users\user.name\AppData\Local\Mozilla\Firefox\Profiles\646vwtnu.default</p> <p>what looks like a sqlite database (urlclassifier3.sqlite) but i don't know if its really what is used to store de history inf...
<p>I believe <code>places.sqlite</code> is the one you should be looking into for history (Firefox 3). Below are a couple of Mozilla wiki entries that have some info on the subject.</p> <ul> <li><a href="https://wiki.mozilla.org/Mozilla2:Unified_Storage" rel="noreferrer">Mozilla 2: Unified Storage</a></li> <li><a href...
<p>The <a href="https://addons.mozilla.org/en-US/firefox/addon/5817" rel="nofollow noreferrer">Firefox SQLite Manager Addon</a> is a great tool. If you wish to learn about the Firefox Places design and DB schema visit <a href="https://developer.mozilla.org/en/Places" rel="nofollow noreferrer">Mozilla Places</a>.</p>
7,760