input
stringlengths
51
42.3k
output
stringlengths
18
55k
How to remove a field from SQLServer2005 table <p>I tried this:</p> <pre><code>ALTER TABLE My.Table DROP MyField </code></pre> <p>and got this error:</p> <p>-MyField is not a constraint.</p> <p>-Could not drop constraint. See previous errors.</p> <p>There is just one row of data in the table and the field was just...
<p>I think you are just missing the COLUMN keyword:</p> <pre><code>ALTER TABLE TableName DROP COLUMN ColumnName </code></pre> <p>You will also need to make sure that any constraint that is depending on ColumnName is dropped first. </p> <p>You can do this by:</p> <pre><code>ALTER TABLE TableName DROP ConstraintName ...
Find the ip address of a remote object in .net remoting <p>I have a client-server application that uses .net remoting. The clients are in a LAN and i do not know their location in advance.</p> <p>Sometimes we do file transfers and as an optimization I want to determine if a client is in fact on the same machine as the...
<p>If you know the IP Address for the server you're calling the remote method from you can use this method to tell whether or not you're on the same machine:</p> <pre><code>using System.Net; private bool CheckIfServer(IPAddress serverIP) { // Get all addresses assigned to this machine List&lt;IPAddress&gt; ip...
Invoking JavaScript code in an iframe from the parent page <p>Basically, I have an iframe embedded in a page and the iframe has some <a href="http://en.wikipedia.org/wiki/JavaScript">JavaScript</a> routines I need to invoke from the parent page.</p> <p>Now the opposite is quite simple as you only need to call <code>pa...
<p>Assume your iFrame's id is "targetFrame" and the function you want to call is <code>targetFunction()</code>:</p> <pre><code>document.getElementById('targetFrame').contentWindow.targetFunction(); </code></pre> <p>You can also access the frame using <code>window.frames</code> instead of <code>document.getElementById...
Can I run Visual Studio 2008 x86 on Windows Vista x64? <p>Is it possible to run the 32-bit version of Visual Studio 2008 Professional on a Windows Vista 64-bit system? </p> <ul> <li>Are there any known caveats that I would need to be aware of?</li> <li>Would have to install the x64 version of the .NET Framework?</li> ...
<p>There is no x64 version of Visual Studio 2008. I'm running the standard 32-bit version on Vista x64 Ultimate and it works fine. There really are no day-to-day issues that I've run across. You just install it and go.</p>
How to shrink a SQL Server Log file with Mirroring enabled? <p>I have several databases for my applications that use SQL Server 2005 mirroring to keep a nice copy of the data somewhere else. Works like a charm, however, the log file just seems to be growing and growing, one is at 15GB for a 3GB database. </p> <p>No...
<p>I would look at why your logfile is growing, then you can define a strategy for solving your issue. It might be worth checking your mirroring state</p> <p>When a principal database is exposed, it is active with user connections and processing transactions. However, no log records are being sent to the mirror datab...
Add columns to an Access (Jet) table from .NET <p>Our app (already deployed) is using an Access/Jet database. The upcoming version of our software requires some additional columns in one of the tables. I need to first check if these columns exist, and then add them if they don't.</p> <p>Can someone provide a quick cod...
<p>Off the top of my head, but something like:</p> <pre><code>Dim conn as New AdoConnection(someConnStr) Dim cmd as New AdoCommand cmd.Connection = conn cmd.CommandText = "ALTER TABLE X ADD COLUMN y COLUMNTYPE" cmd.ComandType = CommandType.Text cmd.ExecuteNonQuery() </code></pre>
Why use a web service with Linq to SQL? <p>Can anyone tell me what the need/advantage is to using a web service with an asp.net gui and using Linq to SQL? The web service layer seems unnecessary. Linq to SQL is completely new to me and I am researching as I am setting up a new project. Does anyone have any experience w...
<p>You would expose services for those cases in which other applications may need to access your data (such as a smart client, another application, a winforms app, etc.). A lot of people will develop using web services to prevent themselves from having to restructure to web services in the future.</p> <p>In almost an...
Is there a way to separate long running (e.g. stress tests) out so they're not run by default in Maven 2? <p>We've had an ongoing need here that I can't figure out how to address using the stock Maven 2 tools and documentation.</p> <p>Some of our developers have some very long running JUnit tests (usually stress tests...
<p>Normally you would add a profile to your maven configuration that runs a different set of tests:</p> <p>run this with mvn -Pintegrationtest install</p> <pre><code> &lt;profile&gt; &lt;id&gt;integrationtest&lt;/id&gt; &lt;build&gt; &lt;plugins&gt; &lt;plugin&gt; ...
Odd issue with textbox and ASP.NET <p>This code was working properly before, basically I have a master page that has a single text box for searching, I named it <strong><code>searchBox</code></strong>. I have a method to pull the content of <strong><code>searchBox</code></strong> on form submit and set it to a variabl...
<p>I think because you are using PostBackUrl, you are going to be required to use the "<a href="http://msdn.microsoft.com/en-us/library/system.web.ui.page.previouspage.aspx" rel="nofollow">PreviousPage</a>" identifier to reference your variable.</p> <p>Another solution would to not use the PostBackUrl property and to ...
How do you check and see if a propel object has an i18n record? <p>I'm using symfony and propel, and I'm trying to invoke a specific culture on an object and output some fields of that object to the screen in that specific culture. However, if the object's mapped database record doesn't have those fields in that specif...
<p>You will have to overwrite symfony itself to make it default to another language. Theres a good working solution here <a href="http://www.codemassacre.com/2008/03/10/symfony-default-language-fallback/" rel="nofollow">http://www.codemassacre.com/2008/03/10/symfony-default-language-fallback/</a></p>
Displaying unit test results in VS 2008 <p>I am a rookie was using the Visual Studio 2008 built-in Unit Testing components, what would be the best way to record or display your results in a unit test?</p> <p>I want to test my service method when it returns a System.GUID and an empty System.GUID</p> <pre><code>[TestMe...
<p>For GetGUID()...</p> <pre><code>Assert.IsFalse(guid == Guid.Empty); </code></pre> <p>Similarly for GetEmptyGUID()...</p> <pre><code>Assert.IsTrue(guid == Guid.Empty); </code></pre>
Which SQL Read TRANSACTION ISOLATION LEVEL do I want for long running insert? <p>I have a long running insert transaction that inserts data into several related tables. </p> <p>When this insert is running, I cannot perform a select * from MainTable. The select just spins its wheels until the insert is done. </p> <...
<p>You may want to rethink your process before you use READ UNCOMMITTED. There are many good reasons for isolated transactions. If you use READ UNCOMMITTED you may still get duplicates because there is a chance both of the inserts will check for updates at the same time and both not finding them creating duplicates. Tr...
Cross Resolution Applications in .NET <p>We are developing a small in-house application that will run on monitor having multi resolutions. Now we want that the application should adjust itself and remain consistent over all monitors.</p> <p>I came from a Java background too where we used different layouts to accomplis...
<p>The layout controls in <a href="http://msdn.microsoft.com/en-us/library/ms754130.aspx" rel="nofollow">WPF</a> are vastly superior to those found in Windows Forms. It also features true resolution independent display using <a href="http://msdn.microsoft.com/en-us/library/ms748388.aspx" rel="nofollow">Fixed Documents<...
Code Signing Certificate Options <p>I've been assigned the task of buying a digital certificate for my company to sign our code. We develop applications in the Microsoft space - mostly WPF or Web Based.</p> <p>I've investigated options and found Comodo to be well priced and responsive, and we're ready to go ahead and ...
<p>For "most purposes" the following options are recommended:</p> <p>Microsoft Base Cryptographic Provider Key Size: 2048 Exportable: Yes User Protected: Yes</p> <p>To be honest, I'm not familiar with the different CSPs, but the Base does the job every time for me.</p> <p>Key Size makes the keys harder to crack, but...
Stored procedures or inline queries? <p>First of all there is a <a href="http://stackoverflow.com/questions/59880/are-stored-procedures-more-efficient-in-general-than-inline-statements-on-moder">partial question</a> regarding this, but it is not exactly what I'm asking, so, bear with me and go for it.</p> <p>My questi...
<p>It doesn't need to be one or the other. If it's a simple query, use the SubSonic query tool. If it's more complex, use a stored procedure and load up a collection or create a dataset from the results.</p> <p>See here: <a href="http://stackoverflow.com/questions/15142/what-are-the-pros-and-cons-to-keeping-sql-in-sto...
using Reflector.Invoke Method on functions wih optional parameters <p>I am trying to use reflector.InvokeMethod to invoke a function with an optional parameter. The function looks like this: </p> <pre><code>Private Function DoSomeStuff(ByVal blah1 as string, ByVal blah2 as string, Optional ByVal blah3 as string = "45"...
<p>The Visual Basic compiler actually substitutes the optional parameter values into the calling code. So if your actual code was:</p> <pre><code>DoSomeStuff(blah1, blah2)</code></pre> <p>Visual Basic would have emitted IL code equivalent to:</p> <pre><code>DoSomeStuff(blah1, blah2, "45")</code></pre> <p>To know w...
When is SqlConnection.RetrieveStatistics() useful? <p>What are the problems that calling this method can help with?<br /> Do you ever use it in debugging you data access?</p>
<p><a href="http://msdn.microsoft.com/en-us/library/7h2ahss8(VS.80).aspx" rel="nofollow">This page from MSDN has more information</a>. Seems like it contains useful debugging information but I must admit I've never used it.</p>
What is the difference between file and record in OS's view? <p>In terms of general operating system concepts, what is the difference between a file and a record?</p> <p>How the OS will manage them? I know what a file is and what a record is but how it is distinguished in an OS?</p>
<p>yeap <p>I got the answer <p>A file is a collection or set of records. </p> <p><p>Typically, In database sense, A Group of records makes a file. </p> <p><p>A group of attributes makes a record</p>
How can I delete my browser cookies using javascript? <p>How can I delete the session information from my browser by using javascript? Is it possible to do?</p>
<p>Session information is usually stored on the server. An HTTP request to a page that destroys the session would normally do the trick (using AJAX if you wish).</p> <p>For cookies you can set the cookie expiry date to the current date, this will expire the cookie and remove it.</p> <pre><code>var d = new Date(); doc...
Why should we typedef a struct so often in C? <p>I have seen many programs consisting of structures like the one below</p> <pre><code>typedef struct { int i; char k; } elem; elem user; </code></pre> <p>Why is it needed so often? Any specific reason or applicable area?</p>
<p>As Greg Hewgill said, the typedef means you no longer have to write <code>struct</code> all over the place. That not only saves keystrokes, it also can make the code cleaner since it provides a smidgen more abstraction.</p> <p>Stuff like</p> <pre><code>typedef struct { int x, y; } Point; Point point_new(int x, ...
Is it best practice to achieve recursion via a partial? <p>I have the need to display a nested set structure in HTML. I am doing it with the following partial:</p> <pre><code>&lt;ul&lt;%= ' id="tree"' if depth == 0 %&gt;&gt; &lt;% items.each do |item| %&gt; &lt;li id="node_&lt;%= item.id %&gt;"&gt;&lt;a&gt;&lt;%= it...
<p>I am not sure whether it is best practice but I used similar code for rendering project tree. </p> <p>Faster alternative is to create helper method doing the same job (recursively traversing tree and adding partial strings into result string). It is a little bit PHP style :( but for such a small amount of HTML is i...
Syntax colouring using Swing <p>Is it possible to have something like a JTextArea which will color some keywords based on some mappings I have ?</p>
<p>Here are a few other choices that you could try</p> <ol> <li><a href="http://ostermiller.org/syntax/editor.html">http://ostermiller.org/syntax/editor.html</a></li> <li><a href="http://java.sun.com/products/jfc/tsc/articles/text/editor_kit/index.html">http://java.sun.com/products/jfc/tsc/articles/text/editor_kit/ind...
Why is there a difference between the encoding of the Windows Command Prompt vs. a batch file? <p>For example, suppose I have a batch file called <code>'test.cmd'</code> and it simply contains:</p> <pre><code>echo %1 </code></pre> <p>I can call this directly from the command prompt with <code>'test.cmd some¬arg'</co...
<p>This is because your batch file is encoded in a different code page than cmd.exe is currently in.</p> <p>In western default configurations, cmd.exe starts in <a href="http://en.wikipedia.org/wiki/Codepage_850">CP850</a>, but text editors usually work in <a href="http://en.wikipedia.org/wiki/Codepage_1252">CP1252</a...
Best way to format if statement with multiple conditions <p>If you want to some code to execute based on two or more conditions which is the best way to format that if statement ?</p> <p>first example:-</p> <pre><code>if(ConditionOne &amp;&amp; ConditionTwo &amp;&amp; ConditionThree) { Code to execute } </code></p...
<p>I prefer Option A</p> <pre><code>bool a, b, c; if( a &amp;&amp; b &amp;&amp; c ) { //This is neat &amp; readable } </code></pre> <p>If you do have particularly long variables/method conditions you can just line break them</p> <pre><code>if( VeryLongConditionMethod(a) &amp;&amp; VeryLongConditionMethod(b) ...
Tips for using Vim as a Java IDE? <p>I'm addicted to Vim, it's now my de facto way of editing text files.</p> <p>Being that it's mainly a text editor and not an IDE, has anyone got tricks for me to make it easier when developing Java apps?</p> <p>Some questions I have:</p> <ul> <li>How do I invoke a maven task witho...
<p>Some tips:</p> <ul> <li>Make sure you use vim (vi improved). Linux and some versions of UNIX symlink vi to vim.</li> <li>You can get code completion with <a href="http://eclim.sourceforge.net/">eclim</a></li> <li>Or you can get vi functionality within Eclipse with <a href="http://viplugin.com/">viPlugin</a></li> <l...
how to write vb code for custom paging and custom sorting in sql and asp:repeater <p>pl give vb code for custom paging and sorting in asp:repeater using stored procedure</p>
<p>Here is step <a href="http://aspnet.4guysfromrolla.com/articles/031506-1.aspx" rel="nofollow">one</a> and <a href="http://aspnet.4guysfromrolla.com/articles/032206-1.aspx" rel="nofollow">two</a> from 4guys that gives a very clear explanation along with zip download available of all code in VB and sample t-sql too. ...
webservice.htc, moz-behaviors and Firefox 3 <p>Whilst trying to get our app working in Firefox (I'm a big proponent of X-Browser support but our lead dev is resisting me saying IE is good enough). So I'm doing a little side project to see how much work it is to convert.</p> <p>I've hit a problem straight away.</p> <p...
<p>I don't think that you are on the right way for achieving real cross-browser compatibility. Adding support for IE-specific features for Firefox is definitely <strong>not</strong> the way to go. What about Opera, Safari, Chrome...? If the app you're working on is used strictly on the intranet then supporting Firefox ...
How do I insert text at beginning of a multi-line selection in vi/Vim? <p>In <a href="http://en.wikipedia.org/wiki/Vim_%28text_editor%29">Vim</a>, how would I go about inserting characters at the beginning of each line in a selection?</p> <p>For instance, let's say I want to comment out a block of code by prepending '...
<ul> <li>Use <kbd>Ctrl</kbd>+<kbd>V</kbd> to enter visual block mode</li> <li>Move <kbd>Up</kbd>/<kbd>Down</kbd>to select the columns of text in the lines you want to comment.</li> <li>Then hit <kbd>Shift</kbd>+<kbd>i</kbd> and type the text you want to insert.</li> <li>Then hit <kbd>Esc</kbd>, wait 1 second and the in...
Fieldsets and legends <p>Alright, I know how the <code>fieldset</code>/<code>legend</code> works out in HTML. Say you have a form with some fields:</p> <pre><code>&lt;form&gt; &lt;fieldset&gt; &lt;legend&gt;legend&lt;/legend&gt; &lt;input name="input1" /&gt; &lt;/fieldset&gt; &lt;/form&gt; </co...
<p>Yes, the naming is ambiguous. It’s best to consider it as a caption for the fieldset.</p> <p>See <a href="http://www.w3.org/TR/html401/interact/forms.html#h-17.10" rel="nofollow">the HTML spec on <code>FIELDSET</code> and <code>LEGEND</code> elements</a> if you haven’t already:</p> <blockquote> <p>The <a hre...
What is the practical use of "dynamic" variable in C# 4.0? <p>What is their use if when you call the method, it might not exist?</p> <p>Does that mean that you would be able to dynamically create a method on a dynamic object?</p> <p>What are the practical use of this?</p>
<p>You won't really be able to dynamically create the method - but you can get an implementation of <code>IDynamicMetaObject</code> (often by extending <code>DynamicObject</code>) to respond <em>as if the method existed</em>.</p> <p>Uses:</p> <ul> <li>Programming against COM objects with a weak API (e.g. office)</li>...
Hidden FreeTextBox bug on Firefox <p>I have a problem with the <a href="http://freetextbox.com/" rel="nofollow">FreeTextBox</a> rich Text Editor in my ASP.NET site. The problem occurs when I access the site with firefox, and I have a freetextbox instance in a hidden div. The hidden div might also be an AJAX Tab Panel. ...
<p>I recently met a similar problem with jQuery UI tabs. What you need to do is to change the CSS for hidden tabs to something like:</p> <pre><code>.hiddentab { position: absolute; left: -99999999999999; } </code></pre> <p>This puts hidden tabs far to the left, and in absolute position mode this does not ca...
Weird #include problem <p>I have a problem with a simple included file.</p> <p>The file being included is in two MFC programs - one of which is a dll, and it also compiles itself into a non-mfc dll.</p> <p>Recently I was using the larger dll which wraps around the <em>source</em> of the smaller dll when I wanted acce...
<p>Build using the /P option, which will create a preprocessed file (usually with the .i extension).</p> <p>In Visual Studio, the option will be on the properties for the project under something like:</p> <pre><code>C/C++ - Preprocessor - Generate Preprocessed File </code></pre> <p>With that you can see exactly...
Have you used the Perl 5.10 backtracking control verbs in your regexes yet? <p>Have you used the Perl 5.10 backtracking control verbs in your regexes yet? And what problems did they help you accomplish? </p> <hr> <p>Just as background: I have done some fiddling, but I can't get any really useful results.</p> <p>As a...
<p>It's been years since I did any Perl programming, so I didn't even know about this feature until you mentioned it. It looks like one of those hardcore feature that only regex gurus would use (of course, the Perl community has plenty of those). Perl 6 Grammars, on the other hand, look like they'll be a lot fun to p...
How can I return a joined table as an enumerable on an anonymous return type in linq to sql? <p>I'd like to return an object with the following signature</p> <pre><code>class AnonClass{ string Name {get;} IEnumerable&lt;Group&gt; Groups {get;} } </code></pre> <p>I have tried the following query, but g only re...
<p>I think you want "join into" instead of just "join":</p> <pre><code>var q = from t in dc.Themes join g in dc.Groups on t.K equals g.ThemeK into groups select new { t.Name, Groups=groups }; </code></pre> <p>(That's completely untested, however - worth a try, but please verify carefully!)</p>
MSI Bootstrapping: External URLs <p>Much searching has lead me to find several descriptions of how to create a bootstrapping msi, but these solutions all assume the msi is local or a standard Windows component. Is there a way to make an msi that downloads an installer (which is also an msi) with normal MSI or Wix code...
<p>My experience with msi's has been it's not possible to run 2 at the same time. (could be wrong though)</p> <p>What I ended up doing was to instead make an installer exe using Inno Setup (<a href="http://www.jrsoftware.org" rel="nofollow">http://www.jrsoftware.org</a>) and ISTool (<a href="http://www.istool.org" rel...
Colemak keyboards with Emacs or VIM <p>I've been crossing things out on my TODO list. I've recently picked up Colemak. Next I wanted to learn Vim or Emacs. I was leaning towards Vim, however one of its benefits are sticking to the home row. With Colemak, the home row has been changed. I realize that I could remap ...
<p>I'm using a similar set up to <a href="http://stackoverflow.com/a/2190106/383793">Graham</a> (up, down, left, right, is hkjl (Qwerty hnyu)) but instead of using noremap, remap using langmap in my .vimrc:</p> <pre><code>set langmap=hk,jh,kj </code></pre> <p>This has the added advantage of changing other commands th...
Design Pattern to apply conversion to multiple properties in multiple classes <p>I am using the WMD markdown editor in a project for a large number of fields that correspond to a large number of properties in a large number of Entity classes. Some classes may have multiple properties that require the markdown.</p> <p>...
<blockquote> <p>The classes that require this are not part of a single inheritance hierarchy.</p> </blockquote> <p>They should at least implement a common interface, otherwise coming up with a clean generic solution is going to be cumbersome.</p> <blockquote> <p>The other option I am considering is doing this in ...
Converting audio to CAF format for playback on iPhone using OpenAL <p>I am using the SoundEngine sample code from Apple in the CrashLanding sample to play back multiple audio files. Using the sample caf files included with CrashLanding everything works fine but when I try and use my own samplesconverted to CAF using af...
<pre><code>afconvert -f caff -d LEI16@44100 -c 1 in.wav out.caf </code></pre> <p>References:</p> <ul> <li>Apple's <a href="https://developer.apple.com/library/ios/documentation/audiovideo/conceptual/multimediapg/usingaudio/usingaudio.html#//apple_ref/doc/uid/TP40009767-CH2-SW28">Multimedia Programming Guide: Using Au...
Best approach for maintaining a quality assurance server for several mid tier clients <p>We are getting to the point where we have several mid tier clients that could benefit from a QA server, but none can afford to pay for a dedicated QA box as well as a dedicated production box. I've been toying with the idea of a vi...
<p>All of our QA/Test environments are hosted on virtual boxes. We have exact replicas of our production server made into virtual servers for testing purposes. Just make sure when you set up the test environments you make them as close to the production box as you possibly can. This will give make your test results mor...
Access parent property in jQuery callback <p>Unsure if I've phrased this correctly, but in the callback how do I reference the controls property of the base class?</p> <p>This has been bugging me for some time and I usually work around it, but I'd be grateful if anybody can enlighten me on how I should do this properl...
<p>Use the power of closures:</p> <pre><code>var base = function() { var controls = {}; return { init: function(c) { this.controls = c }, foo: function(args) { var self = this; this.init(args.controls); $(this.controls.Dr...
Should javac find methods outside of an anonymous class of the same name? <p>This question is a follow up to: <a href="http://stackoverflow.com/questions/252267/why-cant-i-call-a-method-outside-of-an-anonymous-class-of-the-same-name">Why can’t I call a method outside of an anonymous class of the same name</a></p> <p...
<p>This behavior of javac conforms to the spec. See <a href="http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#20448" rel="nofollow">§15.12 Method Invocation Expressions</a> in the Java Language Specification, specifically the paragraph under "Compile Time Step 1" explaining the meaning of an unqu...
How do you pass commands to a Cygwin console in Windows using Inno Setup <p>I've tried variations of this, but had no luck other than the ability to start a cygwin window. (wrapped on <strong>;</strong> for clarity)</p> <pre><code>Filename: "c:\cygwin\bin\bash.exe"; Parameters: "-c c:/scripts/step1.sh paramX"; Fla...
<p>Your problem is that <code>-c</code> tells bash to read instructions from the next parameter: e.g.</p> <pre><code>c:\cygwin\bin\bash.exe -c 'for NUM in 1 2 3 4 5 6 7 8 9 10; do echo $NUM; done' </code></pre> <p>you just need:</p> <pre><code>c:\cygwin\bin\bash.exe "/scripts/step1.sh paramX" </code></pre> <p>So yo...
In Python, is there a concise way of comparing whether the contents of two text files are the same? <p>I don't care what the differences are. I just want to know whether the contents are different.</p>
<p>The low level way:</p> <pre><code>from __future__ import with_statement with open(filename1) as f1: with open(filename2) as f2: if f1.read() == f2.read(): ... </code></pre> <p>The high level way:</p> <pre><code>import filecmp if filecmp.cmp(filename1, filename2, shallow=False): ... </code></p...
Storing video duration time in sql server <p>What's the most appropriate type used to store the duration time information of a video in sql server?</p>
<p>It depends on how granular you need and if you have any constraints on a maximum time. For example, would you need to know down to the millisecond of time duration or is 1 second granular enough? The other thing to consider is how much data do you (or can you) store.</p> <p>For SQL Server 2005, you have these con...
User Access Checking for Rights on Particular Database Objects or Records <p>I'm having a friendly debate with a developer about a situation where users are logging in and accessing documents in a web application. When we load the document for the user to view, we have the userID in session and the documentID that may ...
<blockquote> <p>I propose that the stored procedure that loads the document take the UserId as a parameter to validate rights to the document.</p> </blockquote> <p>I think this is the way to go. If for no other reason than it's safer. If you reuse this proc, and then forget to check the access - you've opene...
Is it possible to get line numbers for stack traces on .Net CF 2.0 or 3.5 <p>I have a .Net CF 2.0 application and am using log4net to log errors. I get a stack trace, but it doesn't have any line numbers. I noticed that it doesn't appear to deploy the pdb file to the device, so I tried to manually place it in the sam...
<p>I'm not sure if .Net CF will open pdbs. Also I'm not sure you want to deploy those to a device. If you are industrious you can make a tool to transform a callstack with il offsets into one with line #'s. I'd suggest this <a href="http://blogs.msdn.com/jmstall/archive/2005/08/25/pdb2xml.aspx" rel="nofollow">post</...
Question SpeechSynthesizer.SetOutputToAudioStream audio format problem <p>I'm currently working on an application which requires transmission of speech encoded to a specific audio format.</p> <pre><code>System.Speech.AudioFormat.SpeechAudioFormatInfo synthFormat = new System.Speech.AudioFormat...
<p>I have created some classes in my <a href="http://www.codeplex.com/naudio" rel="nofollow">NAudio</a> library to allow you to convert your audio data to a different sample rate, if you are stuck with 11025 from the synthesizer. Have a look at <code>WaveFormatConversionStream</code> (which uses ACM) or <code>Resampler...
Why don't more .NET applications use MySQL or a DAO that allows for the use of MySQL? <p>I suppose this question could just as easily be applied to PHP with regard to MSSQL. However, with some versions of MSSQL being so expensive, I always wondered, what is the real advantage of choosing it over MySQL for .NET developm...
<p>Typically, the fact MySQL came so late to the stored procedure party has kept many away from the database. However, I do like the database and use it with some regularity in my "outside the office" time. Did you know the BO ships Crystal with MySQL as its choice datasource?</p> <p>As for .NET and what to do? If ...
Help with CredEnumerate <p>As a follow-up to <a href="http://stackoverflow.com/questions/199518/how-to-programatically-add-mapped-network-passwords-winxp">this</a> question I am hoping someone can help with the <a href="http://msdn.microsoft.com/en-us/library/aa374794(VS.85).aspx" rel="nofollow">CredEnumerate</a> API. ...
<p>You need to dereference the pointer to the array to get the array, then for each item in the array you will need to dereference the item to get the <code>PCREDENTIALS</code> instance.</p> <p>I found <a href="http://www.msnewsgroups.net/group/microsoft.public.dotnet.languages.csharp/topic33651.aspx" rel="nofollow">t...
Forking open source PHP code, project classloader strategy <p>I've been looking for a good PHP ORM tool to use, and I recently found a good ORM class in Kohana. It has a fairly good and simple ORM implementation. The problem is, the code is unreusable outside of the Kohana framework without a rewrite/refactor. It relie...
<p>If you think what you are doing will be a marked improvement to the Kohana project you should make your changes and submit a patch to be considered by the project's maintainers. You probably aren't the first person to appreciate a part of their framework and component-izing their framework into smaller bits may be ...
Markdown and image alignment <p>I'm helping out a friend with a non-profit site that publishes articles in issues each month. They are mostly straightforward, and I think using a markdown editor (like the wmd one here in SO) would be perfect. However, they do need the ability to have images right-aligned in a given par...
<p>You can embed HTML in Markdown, so you can do something like this:</p> <pre><code>&lt;img style="float: right;" src="whatever.jpg"&gt; Continue markdown text... </code></pre>
Can you recommend a free Task Board/Burndown tool for Windows? <p>There's not a lot to add to the subject really.</p> <p>I am after a free task board/ burndown reporting tool for Windows.</p>
<p>If you're willing to host your tool, </p> <ul> <li>TargetProcess (<a href="http://www.targetprocess.com/Product/agile_tour.aspx" rel="nofollow">http://www.targetprocess.com/</a>)</li> <li>XPlanner(<a href="http://xplanner.codehaus.org/" rel="nofollow">http://xplanner.codehaus.org/</a>)</li> </ul> <p>If not,</p> <...
Automating unit tests (junit) for Eclipse Plugin development <p>I am developing Eclipse plugins, and I need to be able to automate the building and execution of the test suite for each plugin. (Using Junit)</p> <p>Test are working within Eclipse, and I can break the plugins into the actual plugin and a fragment plugi...
<p>I have just got JUnit testing working as part of the headless build for our RCP application. </p> <p>I found this article - <a href="http://www.eclipse.org/articles/article.php?file=Article-PDEJUnitAntAutomation/index.html">Automating Eclipse PDE Unit Tests using Ant</a> incredibly helpful. It provides code and app...
Serializing Name/Value Pairs in a Custom Object via Web Service <p>This is a very complicated question concerning how to serialize data via a web service call, when the data is not-strongly typed. I'll try to lay it out as best possible.</p> <p><strong>Sample Storage Object:</strong></p> <pre><code>[Serializable] pu...
<p>This is like dynamic properties for a object. C# is not quite a dynamic language unlike javascript or maybe PHP can parse the object properties on the fly. The following two methods are what I can think of. The second one might fit into your requirements.</p> <p><strong>The KISS Way</strong> </p> <p>The Keep It S...
What are the different doctypes in html and what do they mean? <p>As the title describes, what are the different doctypes available and what do they mean? I notice that the layout looks a little different in IE7 when I switch from </p> <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" &gt; </...
<p>A <strong>Doctype</strong>, or <strong>Document Type Declaration</strong> associates the document with a <strong>Document Type Definition</strong>.</p> <p>The <strong>Document Type Definition</strong> is a standard for an XML document. There are many DTDs, for both XML and XHTML documents. XML itself doesn't have...
Configuring SQL Server 2005 with both server replication and client replication <p>I need to set up this scenario: </p> <blockquote> <p>A SQL Server 2005 database will create a transactional replication subscription from another database to populate a set of lookup tables. These lookup tables will then be published ...
<p>Okay, I managed to get the answers I needed at the <a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=4093478&amp;SiteID=1&amp;mode=1" rel="nofollow">MSDN SQL Server Replication forum</a>.<br /> The article I was looking for is called: <a href="http://msdn.microsoft.com/en-us/library/ms152553(SQL.90).asp...
How to implement Google Suggest in your own web application (e.g. using Python) <p>In my website, users have the possibility to store links.</p> <p>During typing the internet address into the designated field I would like to display a suggest/autocomplete box similar to Google Suggest or the Chrome Omnibar.</p> <p>Ex...
<p>You could try with <a href="http://google.com/complete/search?output=toolbar&amp;q=keyword">http://google.com/complete/search?output=toolbar&amp;q=keyword</a></p> <p>and then parse the xml result.</p>
Data structure used for directory structure? <p>I'm making a program which the user build directories (not in windows, in my app) and in these folders there are subfolders and so on; every folder must contain either folders or documents. What is the best data structure to use? Notice that the user may select a subfolde...
<p>This is what I do:</p> <p>Every record in the database has two fields: ID and ParentID. IDs are 4-5 characters (Base36, a-z:0-9 or something similar). Parent IDs are a concatenation of the parent's complete structure...</p> <p>So...</p> <p>This structure:</p> <pre><code>Root Folder1 Folder2 Folder3 ...
Javascript Drag and drop <p>I'm looking for someone to explain how to drag and drop in javascript, I want a horizontal line with some customizable images in it.</p> <p>I've had a look at the online tutorials for these but find them very hard to use.</p>
<p>I would recommend that you look into one of the Javascript Frameworks out there. We use <a href="http://www.prototypejs.org/" rel="nofollow">prototype</a> with scriptaculous. </p> <p>You can look at a demo for Drag and Drop in Scriptaculous <a href="http://github.com/madrobby/scriptaculous/wikis/puzzle-demo" rel="n...
Where can I find a good documentation about the core concept of REST? <p>I found a good description on <a href="http://en.wikipedia.org/wiki/Representational_State_Transfer" rel="nofollow">wikipedia</a> with a few reference links, but there may be better ones, please help me to find these!</p> <p>To be clear, I am not...
<p><a href="http://www.25hoursaday.com/weblog/2007/11/19/GuidelinesForBuildingRESTfulWebServices.aspx" rel="nofollow">Guidelines for Building RESTful Web Services</a> has all the info on the resources you need.</p> <p>This is another useful <a href="http://www.25hoursaday.com/weblog/2008/08/17/ExplainingRESTToDamienKa...
Register allocation rules in code generated by major C/C++ compilers <p>I remember some rules from a time ago (pre-32bit Intel processors), when was quite frequent (at least for me) having to analyze the assembly output generated by C/C++ compilers (in my case, Borland/Turbo at that time) to find performance bottleneck...
<p>You are asking about "application binary interface" (ABI) and calling conventions. These are typically set by operating systems and libraries, and enforced by compilers and linkers. Google for "ABI" or "calling convention." Some starting points from <a href="http://en.wikipedia.org/wiki/Calling_convention" rel="nofo...
Tunneling proxy on VS 2008 <p>Is there a way to tunnel a proxy to access a remote sql server database on visual studio 2008? I'm working in a project at college that uses a sql server database but the access is restricted to the internal network. I'd like to access the database from my home too. Thanks in advance.</p>
<p>You can <a href="http://stackoverflow.com/questions/68799/setting-up-a-vpn">setup a VPN</a> easily...</p> <p>Take a look to <a href="http://secure.logmein.com/products/hamachi/vpn.asp?lang=es" rel="nofollow">Hamachi</a> and <a href="http://www.remobo.com/" rel="nofollow">Rebombo</a>, very easy 0 configuration vpn.....
Fatal CLR Error 80004005 <p>Today, everytime I try to open any <strong>.Net application</strong> I get:</p> <pre><code>CLR error: 80004005 The program will now terminate. </code></pre> <p>Any suggestions?</p>
<p>I'd start with <a href="http://msdn.microsoft.com/en-us/netframework/aa569263.aspx">downloading</a> and re-installing the .NET framework.</p>
Is there an easy way to plot Polyline Area, i.e. service coverage area, and also check to see if visitor's address lies within that area using Google Maps API and PHP? <p>I am the owner of a business that is building a new website application. My partner is the programmer who is doing the development and neither one of...
<p><strong>Draw polygon on map</strong></p> <p>You can draw polygons that covering your service area on google map. Those polygons are defined by a set of latlongs that you can collect from a google earth and sasve them somewhere. Once you had all the coordinates that can cover your each service area, you can see the...
NSString indexOf in Objective-C <p>Are there anything similar to an <code>indexOf</code> function in the NSString objects?</p>
<p>Use <code>-[NSString rangeOfString:]</code>:</p> <pre><code>- (NSRange)rangeOfString:(NSString *)aString; </code></pre> <blockquote> <p>Finds and returns the range of the first occurrence of a given string within the receiver.</p> </blockquote>
Where to get more information on Dictionary ADT and Skip List for Java? <p>I'm trying to go deep into Dictionary ADT and Skip List for Java. My textbook doesn't cover a lot about this and whatever it has covered is very complicated. Which is the best online site to get more information on Dictionary ADT and Skip List f...
<p>Since it sounds like you're in an algorithms class, I would separate the implementation of a dictionary and a skip list from what is provided by the Java API. At this point, it's more important that you understand the concept of what these abstract data types are, because they can be implemented in any language (C#,...
How to get rid of stupid "pad" labels produced by RTML functions? <p>I am unlucky to be in charge of maintaining some old Yahoo! Store built using their RTML-based platform.</p> <p>Recently I've noticed that HTML code generated by some RTML functions is sprinkled all over with "padding images" (or whatever is the conv...
<p>The only way I see is to have your own website front-end that will filter whatever you want from the RTML site....</p> <p>for example, your rtml site is at <a href="http://rtmlusglysite.yahoo.com/store/XYZ01134" rel="nofollow">http://rtmlusglysite.yahoo.com/store/XYZ01134</a> , you could host a simple PHP front-end...
What is a View in Oracle? <p>What is a view in Oracle?</p>
<p>A <strong>View in Oracle</strong> and in other database systems is simply the representation of a SQL statement that is stored in memory so that it can easily be re-used. For example, if we frequently issue the following query</p> <pre><code>SELECT customerid, customername FROM customers WHERE countryid='US'; </cod...
JSTL forEach tag: problems with enumeration, and with understanding how it should work <p><br /> I've experienced rather strange behavior of JSTL forEach tag.</p> <p>I have some bean called SessionBean:</p> <pre><code>public class SessionBean { private Collection&lt;MyObject&gt; objects; public Collection&lt;MyOb...
<p>This <a href="http://today.java.net/pub/a/today/2006/03/07/unified-jsp-jsf-expression-language.html" rel="nofollow">article</a> explains the difference between the unified EL and the EL. Here is a snippet</p> <blockquote> <p>Evaluation of EL</p> <p>Evaluation of EL is categorized as immediate evaluation and ...
How do I create an nullary Functor in C++ (using the loki library) <p>Writing something like this using the <a href="http://loki-lib.sourceforge.net/" rel="nofollow">loki library</a>,</p> <pre><code>typedef Functor&lt;void&gt; BitButtonPushHandler; </code></pre> <p>throws a compiler error, but this works</p> <pre><c...
<p>Looking at the source code, the Functor template definition is as follows:</p> <pre><code>template &lt;typename R = void, class TList = NullType, template&lt;class, class&gt; class ThreadingModel = LOKI_DEFAULT_THREADING_NO_OBJ_LEVEL&gt; class Functor{...}; </code></pre> <p>As commented below, there ar...
What is a good design for an extensible query interface? <p>Our application exposes queries by way of web services, and what we've found is that our clients often want custom queries, either by way of further limiting the results returned by specifying additional criteria, or by asking for things that we don't already ...
<p>I would also recommend to consider the "Specification Pattern" in this type of applications as a design decision for your backend. Check the following posts about "Specification Pattern":</p> <p><a href="http://www.mattberther.com/2005/03/25/the-specification-pattern-a-primer/" rel="nofollow">http://www.mattberther...
How do I get a particular word from a string in PHP? <p>Say you have a string, but you don't know what it contains. And you want to replace all occurences of a particular word or part of a word with a formatted version of the same word. For example, I have a string that contains "lorem ipsum" and i want to replace the ...
<pre><code>$str = preg_replace('/(\blo[a-z]+\b)/', '$1 can', $str); </code></pre> <p>The problem with RoBorg's answer are:</p> <ol> <li><code>\w</code> matches digits and underscores, which aren't <em>really</em> word characters in human language, so it would match 'lo_fi' or '__lo__'.</li> <li>it would also match wo...
How can I get the TNMHTTP Get method to respond on a redirect <p>I'm using TNMHTTP in Delphi to retrieve the code from a webpage. The code is relatively simple:</p> <pre><code>NMHTTP1 := TNMHTTP.Create(Self); NMHTTP1.InputFileMode := FALSE; NMHTTP1.OutputFileMode := FALSE; NMHTTP1.ReportLevel := Status_Basic; NMHTTP1....
<p>I can advice you to switch to Indy. They are great for a lot of network protocols (with the exception of the IRC protocol). There are nice examples included so you can examine the working examples yourself.</p> <p>Also have a look at <a href="http://www.indyproject.org/index.en.aspx" rel="nofollow">http://www.indyp...
Change journal operations in .NET? <p>I'm looking for the .NET/C# way of performing <a href="http://msdn.microsoft.com/en-us/library/aa363801%28VS.85%29.aspx">Change Journal Operations</a> (without importing unmanaged code).</p> <p>Any hints or RTFM-links?</p>
<p>This looks promising (and in C#):</p> <p><a href="http://mchangejournal.codeplex.com/" rel="nofollow">http://mchangejournal.codeplex.com/</a></p> <p>You have to download the Source code as there are no official Releases. I was able to run the demo (on Windows 7), but not able to see which Files were changed. Thi...
MySQL: get differences of each sorted column in set of rows <p>Here is a simple scenario with table characters:</p> <pre><code>CharacterName GameTime Gold Live Foo 10 100 3 Foo 20 100 2 Foo 30 95 2 </code></pre> <p>How do I get this output for the query <code>SELECT Gold, Live FROM characters WHERE name = 'Foo' ORD...
<p>Do you have an ID on your Table.</p> <pre><code>GameID CharacterName GameTime Gold Live ----------- ------------- ----------- ----------- ----------- 1 Foo 10 100 3 2 Foo 20 100 2 3 Foo 30 95 ...
Why does adding a project reference break my build? <h2>solution structure [Plain Winforms + VS 2008 Express Edition]</h2> <ul> <li>CoffeeMakerInterface (NS CoffeeMaker)</li> <li>CoffeeMakerSoftware (NS CoffeeMakerSoftware)</li> <li>TestCoffeeMaker (NS TestCoffeeMaker)</li> </ul> <p>CoffeeMakerSoftware proj reference...
<p>I broke my 'Don't code when you're tired' dictum. I zipped it up, went to sleep and looked at it today.. found the issue by looking at the output window. <em>(FWIW everything was CopyLocal=True and nothing in GAC. This is Bob Martin's OOD problem from the Agile PPnP book.. coming up with good names was particularly ...
What is the simplest jQuery way to have a 'position:fixed' (always at top) div? <p>I'm relatively new to jQuery, but so far what I've seen I like. What I want is for a div (or any element) to be across the top of the page as if "position: fixed" worked in every browser.</p> <p>I do not want something complicated. I do...
<p>Using this HTML:</p> <pre><code>&lt;div id="myElement" style="position: absolute"&gt;This stays at the top&lt;/div&gt; </code></pre> <p>This is the javascript you want to use. It attaches an event to the window's scroll and moves the element down as far as you've scrolled.</p> <pre><code>$(window).scroll(function...
form layout with CSS <p>I need to create a form with, half linear view (textboxes and dropdownlists in separate line) and the other half, non linear view i.e. the textboxes will appear next to each other, like first name and last name will be next to each other. </p> <p>I am aware how to acomplish the linear view with...
<p>if you also float:left, set a width and display:inline the other input fields, the should appear on the same line</p>
NSData and UIImage <p>I am trying to load <code>UIImage</code> object from <code>NSData</code>, and the sample code was to <code>NSImage</code>, I guess they should be the same. But just now loading the image, I am wondering what's the best to troubleshoot the <code>UIImage</code> loading <code>NSData</code> issue.</p>...
<p>I didn't try <code>UIImageJPEGRepresentation()</code> before, but <code>UIImagePNGRepresentation</code> works fine for me, and conversion between <code>NSData</code> and <code>UIImage</code> is dead simple:</p> <pre><code>NSData *imageData = UIImagePNGRepresentation(image); UIImage *image=[UIImage imageWithData:ima...
php/Ajax - Best practice for pre-loading images <p>I have put together a script which is very much like the flickr photostream feature. Two thumbnails next to each other, and when you click the next or prev links the next (or previous) two images slide in. Cool!</p> <p>Currently when the page loads it loads the two im...
<p>To preload an image from Javascript, you don't need to do anything that sounds like AJAX or JSON. All you need is this:</p> <pre><code>var img = new Image(); img.src = "http://example.com/new/image.jpg"; </code></pre> <p>The browser will quite happily load the image in the background, even though it's not displaye...
SharePoint Visual Studio document upload Web Test fails with Connot close stream until all bytes are written <p>I have created a Visual Studio 2008 sp1 test suite web test that uploads a document to a document library in SharePoint. The test is a lot like the one described <a href="http://www.helloitsliam.com/Lists/Pos...
<p>You can also use the Deployment settings in the testrunconfig. It's more sophisticated.</p>
Python vs Groovy vs Ruby? (based on criteria listed in question) <p>Considering the criteria listed below, which of Python, Groovy or Ruby would you use?</p> <ul> <li><em>Criteria (Importance out of 10, 10 being most important)</em></li> <li>Richness of API/libraries available (eg. maths, plotting, networking) (9)</li...
<p>I think it's going to be difficult to get an objective comparison. I personally prefer Python. To address one of your criteria, Python was designed from the start to be an embeddable language. It has a very rich C API, and the interpreter is modularized to make it easy to call from C. If Java is your host enviro...
How do you access an attached property of a Silverlight object in C#? <p>Basically I'm trying to change the <code>Canvas.Left</code> property of an Ellipse Silverlight control in C#. Here is how I'm accessing the control:</p> <pre><code>Ellipse c1 = this.FindName("Circle1") as Ellipse; </code></pre> <p>How would I t...
<p>The answer lies in Silverlights use of Dependancy Properties</p> <p>c1.SetValue(Canvas.LeftProperty, value);</p>
Is it possible to perform arbitrary data analysis in Erlang? <p>I want to answer questions about data in Erlang: count things, correlate messages, provide arbitrary statistics. I had thought about resorting to Hadoop for this but is it possible to build a solution in raw Erlang to do rather arbitrary data analysis no...
<p>Yes.</p> <p>For general-purpose computation and statistics, Erlang works just fine. It isn't optimized heavily for such work, so it will have trouble keeping up with similar numeric code in, say MatLab, ForTran, or any of the major C package for this work -- but for most uses it will do just fine. And of course i...
.NET training suggestion for an average developer <p>Some devs in our office need training. They're working on .NET projects and just aren't picking it up very well. (Their backgrounds are in VB6. Yes. In 2008. Go figure.) I've been to a couple training courses in the past, and they've fortunately been very goo...
<p>I'd say that things like DevelopMentor are fine. Re your distinction between the "enthusiastic" versus "average" developer... in many ways the "enthusiastic" developer can accomplish nearly as much from blogs/trying-it/books/RTFM. So in many ways courses are <em>more</em> useful for the (in your words) "average" de...
"Functionoids"? <p>I've read the description of "functionoids" <a href="http://www.parashift.com/c++-faq-lite/pointers-to-members.html#faq-33.10" rel="nofollow">here</a>. They look like a poor-man's version of Boost::function and Boost::bind. Am I missing something? Is there a good reason to use them if you're already ...
<p>My vote goes to tr1::function. </p> <p><em>Functors</em> or <em>functionoids</em> represent the base from which <code>tr1/boost::function</code> has evolved. The limit with common-interface functors is that they break the OO-paradigm since they represent different types and can only passed to template functions (un...
How to convert CString and ::std::string ::std::wstring to each other? <p><code>CString</code> is quite handy, while <code>std::string</code> is more compatible with STL container. I am using <code>hash_map</code>. However, <code>hash_map</code> does not support <code>CString</code> as key, so I want to convert <code>...
<p>According to <a href="http://www.codeguru.com/forum/archive/index.php/t-231155.html">CodeGuru</a>:</p> <p><code>CString</code> to <code>std::string</code>:</p> <pre><code>CString cs("Hello"); std::string s((LPCTSTR)cs); </code></pre> <p><strong>BUT:</strong> <code>std::string</code> cannot always construct from a...
What is the memory consumption of an object in Java? <p>Is the memory space consumed by one object with 100 attributes the same as that of 100 objects, with one attribute each?</p> <p>How much memory is allocated for an object?<br /> How much additional space is used when adding an attribute?</p>
<p><a href="http://mindprod.com/jgloss/sizeof.html">Mindprod</a> points out that this is not a straightforward question to answer:</p> <blockquote> <p>A JVM is free to store data any way it pleases internally, big or little endian, with any amount of padding or overhead, though primitives must behave as if they had ...
Sqlite Optimization: Read only scenario <p>I use SQLite for a number of application on the desktop and PDA. Most operations are readonly, as SQLite functions as a data store for reference material in my applications.</p> <p>Basically, I am looking for suggestions on improving performance in a scenario where you know t...
<p>The standard database performance tips still apply:</p> <ul> <li>Make sure your queries use indexes rather than full table scans</li> <li>Be as selective as you can in your queries so you aren't pulling unneeded rows from the db</li> <li>Select only the columns you want</li> </ul>
Ribbon UI for Visual Studio 2010 or beyond? <p>One of the PDC2008 presentations showed off the new VS2010 UI (not the same as the current beta) that was built with WPF. Some of the new code effects looked fairly nice (comment xml parsed and styled within the code editor).</p> <p>It got me wondering if Microsoft would...
<p>It all depends on how it would be implemented.<br>It could be a good thing, but just in case I would like it to be optional:)</p>
Better way to implement an Html Helper method? <p>I created an html helper </p> <pre><code>Html.BreadCrumb(IDictionary&lt;string, string&gt; crumbs) </code></pre> <p>Where the first string is the label and the second string is the URL. The helper creates the html required (an unordered list, some classes for first el...
<p>BTW we have a naming pattern in ASP.NET MVC for the various rendering techniques.</p> <p>Helpers that return a string of what they are should be named what they are. For example, Url.Action() and Html.TextBox() return those exact items. Thus, these helpers should be used with the &lt;%= %> syntax.</p> <p>Helpers t...
How to get On Focus CWindow handle? <p>Is there any way to get the handle to the control that has focus? I am looking for a way to get the ID of control on focus in my app. </p> <p>After that it would be easy to get the id with GetDlgCtrlID.</p> <pre><code>CWnd *pwnd = GetWindowOnFocus(); int wID = pwnd-&gt;GetDlgCt...
<p>Have a look at the static <a href="http://msdn.microsoft.com/en-us/library/f9fd0z3x(VS.80).aspx" rel="nofollow">CWnd::GetFocus</a> method.</p>
Python filter/remove URLs from a list <p>I have a text file of URLs, about 14000. Below is a couple of examples:</p> <p><a href="http://www.domainname.com/pagename?CONTENT_ITEM_ID=100&amp;param2=123" rel="nofollow">http://www.domainname.com/pagename?CONTENT_ITEM_ID=100&amp;param2=123</a><br /> <a href="http://www.dom...
<p>Here's another alternative to Graeme's, using the newer list comprehension syntax:</p> <pre><code>list2= [line for line in file if 'CONTENT_ITEM_ID' in line] </code></pre> <p>Which you prefer is a matter of taste!</p>
Browser back button - does it delete session data? <p>Does hitting the back button in a web browser cause the session data set in the preceding call to be deleted?</p>
<p>No, it does not.</p> <p>Well, if the user arrived to the previous page by POST (as opposed to GET) and reposts the page, the server is going to process the request again. It won't delete the data in the session though. It is possible to achieve this behaviour with some code, but that's not how it works by default.<...
Can you get SkinID Autocompletion in ASCX Controls <p>Working in VS 2008</p> <p>When working on on ASPX file in <code>Source</code> mode, if i've specified a StyleSheetTheme in the page directive of the file, then Visual Studio will provide me with AutoCompletion lists of the possible skinID values for a control </p> ...
<p>Yes you can. If you specify a default theme in your web.config, then the available skins will also be listed by intellsense in user controls.</p> <p>To define a default theme, edit the following entry in web.config:</p> <pre><code>... &lt;system.web&gt; ... &lt;pages styleSheetTheme="MyTheme"&gt; ... </code></p...
ASP.NET Web site/service hosting <p>Are there other possibilities besides IIS for hosting web sites and web services based on ASP.NET, which are recommended by Microsoft for small-scale environments?</p>
<p>You can host your own web server in-process within your own application using <a href="http://blogs.msdn.com/carlosag/archive/2008/04/14/HostYourOwnWebServerUsingIIS7.aspx">IIS 7's Hostable Web Core.</a> And, of course, you can create your own app that listens to port 80. However, the complexities involved probabl...
How do I import svn branches rooted in different directories into git using git-svn? <p>I have an SVN repository structure like below. We are using multiple levels under branches for various release maintenance branches, plus a directory for feature branches.</p> <p>git-svn init seems to work with a single --branches ...
<p>In your config file, set the svn-remotes section to something like:</p> <pre><code>[svn-remote "svn"] url = svn://svnserver/repo fetch = trunk:refs/remotes/trunk branches = branches/*/*:refs/remotes/* tags = tags/*:refs/remotes/tags/* </code></pre> <p>This should let you grab the nested branches.</...
How do I integrate Filenet and Outlook? <p>How do I integrate Filenet and Outlook?</p>
<p>Assuming that you are talking about FileNet P8, then I can provide some information. I had to do a similar thing a couple of years ago.</p> <p>First of all you need to get good with MS Office VSTO. More information <a href="http://www.outlookcode.com/article.aspx?ID=42" rel="nofollow">here</a>.</p> <p>Second you h...
htaccess request forwarding if internal ip <p>Is there a possible htaccess directive that can transparently forward request from index.php to index_internal.php if the request is coming from an internal ip range?</p>
<pre><code>RewriteEngine on RewriteCond %{REMOTE_ADDR} ^192\.168\.1\. [OR] RewriteCond %{REMOTE_ADDR} ^10\.15\. RewriteRule ^index\.php$ index_internal.php [R,NC,QSA,L] </code></pre> <p>What this does: </p> <p>start mod_rewrite engine (you may have that already)</p> <p>if (client IP address starts with "192.168.1."...
What tools are built using themselves? <p>I am curious about what tools are used to build the next version of themselves.</p> <p>For example, Delphi has long claimed that "<a href="http://en.wikipedia.org/wiki/Borland_Delphi#Products_developed_with_Delphi" rel="nofollow">Delphi is written in Delphi</a>".</p> <p>I ass...
<p>Interestingly, the VB.NET &amp; C# compilers themselves are written in unmanaged C++ (leading to the C++ team's T-Shirt: "My compiler compiled yours"). The C# team hopes to have a fully managed-C# hosted C# compiler for VS2010.</p>