input
stringlengths
51
42.3k
output
stringlengths
18
55k
Is there a c# library for wrapping multiple SCM provider's APIs? <p>The project I'm working on requires access to the users source control. To do this we are wrapping the Perforce API and the Subversion API ( using P4.NET and SubversionSharp respectively ). </p> <p>We would like to support as many as we can depending ...
<p>You propably search for Microsoft Source Code Control Provider ( MSSCCI ). I know, the Source Safe, Team Foundation Server, Subversion, Evolution, ( and some next others ) source control products has this interface implemented.</p>
What do 1.#INF00, -1.#IND00 and -1.#IND mean? <p>I'm messing around with some C code using floats and I'm getting 1.#INF00, -1.#IND00 and -1.#IND when I try to print floats in the screen. What does those values mean? I believe that 1.#INF00 means positive infinity, but what about -1.#IND00 and -1.#IND? I also saw somet...
<p>From <a href="http://www.johndcook.com/IEEE_exceptions_in_cpp.html">IEEE floating-point exceptions in C++</a> :</p> <blockquote> <p>This page will answer the following questions.</p> <ul> <li>My program just printed out 1.#IND or 1.#INF (on Windows) or nan or inf (on Linux). What happened?</li> <li>How c...
iPhone and OpenCV <p>I know that <a href="http://opencv.willowgarage.com/wiki/Mac_OS_X_OpenCV_Port">OpenCV was ported to Mac OS X</a>, however I did not find any info about a port to the iPhone.</p> <p>I am not a Mac developer, so that I do not know whether a Mac OS X port is enough for the iPhone.</p> <p>Does anyone...
<p>OpenCV does indeed work on the iphone. Use the configure script here to compile the library: <a href="http://lambdajive.wordpress.com/2008/12/20/cross-compiling-for-iphone/" rel="nofollow">cross compiling for iphone</a></p> <p>You just have to cross-compile just as you do your apps.</p>
Ensuring Users are Authenticated in Java Web App <p>My web app has a secure area which users log in to via a JSP. The JSP posts the user name and password to a servlet, which then checks to see if the users credentials are valid. If they are valid then the user is directed to the secure resource. How can I ensure th...
<p>A common approach is to set a token in the user's session i.e.,</p> <p><code>session.setAttribute("loggedIn", "true");</code></p> <p>or even</p> <p><code>session.setAttribute("loggedInUser", "someUserName");</code></p> <p>and check that on any page that should be secured. A good strategy is to perform the check ...
Reusing a connection while polling a database in JDBC? <p>Have a use case wherein need to maintain a connection open to a database open to execute queries periodically. </p> <p>Is it advisable to close connection after executing the query and then reopen it after the period interval (10 minutes). I would guess no sin...
<p>You should use connection pooling. Write your application code to request a connection from the pool, use the connection, then return the connection back to the pool. This keeps your code clean. Then you rely on the pool implementation to determine the most efficient way to manage the connections (for example, ke...
How to undo 'git add' before commit? <p>I mistakenly added files using the command:</p> <pre><code>git add myfile.txt </code></pre> <p>I have not yet run <code>git commit</code>. Is there a way to undo this, so these files won't be included in the commit?</p>
<p>You can undo <code>git add</code> before commit with</p> <pre><code>git reset &lt;file&gt; </code></pre> <p>which will remove it from the current index (the "about to be committed" list) without changing anything else.</p> <p>You can use</p> <pre><code>git reset </code></pre> <p>without any file name to unstage...
Essential Firefox Plugins/Extensions? <p>What firefox plugins could you not live without, as relates to webdev?</p> <p>My list would be:</p> <ul> <li><a href="https://addons.mozilla.org/en-US/firefox/addon/3227" rel="nofollow">DBGBar</a></li> <li><a href="https://addons.mozilla.org/nl/firefox/addon/6622" rel="nofollo...
<p><a href="http://getfirebug.com/">Firebug</a> is the main one I use.</p>
Fastest javascript page search <p>I am writing a Firefox extension. I would like to search the current webpage for a set of words, and count how many times each occurs. This activity is only performed when the user asks, but it must still happen reasonably quickly.</p> <p>I am currently using indexOf on the BODY tag's...
<p>I could not find hasItem, setItem or getItem in prototypes Hash like tvanfosson suggested, but used set and get and wrote a hasItem based on get. But profiling showed that it is slower to use prototypes Hash compared to javascripts native object.</p> <p>If you have an array with keywords, convert it to an hash obje...
In C++ is it possible to have a defined purely virtual function? <p>Here's the deal. I have a big class hierarchy and I have this one method that is extended all the way through. The method always has to look at one or two more variable at each new level and these variable depend on the actual class in the hierarchy. W...
<p>Actually you can declare a function as purely virtual and still define an implementation for it in the base class.</p> <pre><code>class Abstract { public: virtual void pure_virtual(int x) = 0; }; void Abstract::pure_virtual(int x) { // do something } class Child : public Abstract { virtual void pure_vi...
Domain Logic and Data Access of MVC at Remote API/Web Service Layer <p>In our system, we have a Remote API layer (e.g. SOAP, XML-RPC, REST, etc.) to handle the domain logic and data access for web application and any client applications that're developed on top of it. Unlike in the past, I do not have business logic co...
<p>If you use output caching in asp.net mvc properly then performance will be increased a lot.</p>
Sort an Array by keys based on another Array? <p>Is it possible in PHP to do something like this? How would you go about writing a function? Here is an example. The order is the most important thing.</p> <pre><code>$customer['address'] = '123 fake st'; $customer['name'] = 'Tim'; $customer['dob'] = '12/08/1986'; $custo...
<p>Just use <code>array_merge</code> or <code>array_replace</code>. <code>Array_merge</code> works by starting with the array you give it (in the proper order) and overwriting/adding the keys with data from your actual array:</p> <pre><code>$customer['address'] = '123 fake st'; $customer['name'] = 'Tim'; $customer['do...
Make enter key behave like tab key on form <p>Is there an easy way to move around controls on a form exactly the same way as the tab key? This includes moving around cells on a datagridview etc.</p>
<p>using winforms you should set the Form KeyPreview property to true</p> <p>and in the keypress event for the form you should have </p> <pre><code>private void Form1_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) GetNextControl(ActiveControl, true).Focus(); } </code></pre>
Show tooltip when selecting item on asp:DropDownList <p>I have an asp:DropDownList on a page that, due to the 1024x768 development standard can truncate some of the text values in the dropdown (not enough of them, apparently, to redesign the layout ), so I need to display a tooltip of the selected value <em>when</em> a...
<pre><code>foreach (ListItem _listItem in this.DropDownList1.Items) { _listItem.Attributes.Add("title", _listItem.Text); } </code></pre> <p>// add a tooltip for the selected item also</p> <pre><code>DropDownList1.Attributes.Add("onmouseover", this.title=this.options[this.selectedIndex].title"); </code></...
How can I download all emails with attachments from Gmail? <p>How do I connect to Gmail and determine which messages have attachments? I then want to download each attachment, printing out the Subject: and From: for each message as I process it.</p>
<p>Hard one :-)</p> <pre><code>import email, getpass, imaplib, os detach_dir = '.' # directory where to save attachments (default: current) user = raw_input("Enter your GMail username:") pwd = getpass.getpass("Enter your password: ") # connecting to the gmail imap server m = imaplib.IMAP4_SSL("imap.gmail.com") m.log...
Getting raw HTTP request from CFHTTPMessageRef <p>I am working with a wrapper class for <code>CFHTTPMessage</code>, which contains a <code>CFHTTPMessageRef</code> object to which is added the method (GET), the URL of the web application server, and a few custom headers containing the date and an authentication nonce.</...
<p>The following worked well:</p> <pre><code>NSData *d = (NSData *)CFHTTPMessageCopySerializedMessage(messageRef); NSLog(@"%@",[[[NSString alloc] initWithBytes:[d bytes] length:[d length] encoding:NSUTF8StringEncoding] autorelease]); </code></pre> <p>Hope this is helpful to others.</p>
Comparing dates in Lingo <p>How do I compare two dates in Lingo? To be specific, I want to know if today's date is after some fixed date. I know I can create the fixed date by using:</p> <pre><code>date("20090101") </code></pre> <p>and I can get the current date using:</p> <pre><code>_system.date() </code></pre> <p...
<p>Instead of _system.date(), try _movie.systemDate(), it will return a date object that you can safely compare with another one.</p> <p>if _movie.systemDate() > date("20090101") then</p> <pre><code>--do something </code></pre> <p>end if</p> <p>regards</p>
Why is there "class" in "template <class x>"? <p>What does the "class" part of a template statement do?</p> <p>Example:</p> <pre><code>template &lt;class T&gt; class Something { public: Something(const T &amp;something); } </code></pre> <p>And what else can go there? I usually only see "class".</p>
<p>The <code>class</code> keyword means the same thing as the <code>typename</code> keyword for the most part. They both indicates that T is a type.</p> <p>The only difference between the keywords <code>class</code> and <code>typename</code> is that <code>class</code> can be used to provide class template template arg...
Getting the time zone as a UTC offset on windows and linux <p>What is the simplest way to get the machine's time zone as a positive or negative UTC offset, preferably using some time of shell command?</p>
<p>For all Unix-ish operating systems, when using the GNU date command:</p> <p><code>date +%z</code></p> <p>Example, for Eastern European Time (my timezone):</p> <pre> [moocha@helium ~]$ date +%z +0200 </pre>
Code Coverage tools for PHP <p>Is there any code coverage tool available for PHP? I wish to check the code coverage of my code and API's written in PHP, but have not been able to lay my hands on any code coverage tool for PHP, as it is more of a server side language and dynamic in nature.</p> <p>Does anyone know of a ...
<p><a href="http://www.xdebug.org/" rel="nofollow">xdebug</a> has <a href="http://www.xdebug.org/docs/code_coverage" rel="nofollow">Code Coverage Analysis</a>.</p> <p>Check <a href="https://phpunit.de/manual/current/en/code-coverage-analysis.html" rel="nofollow">this chapter</a> of the PHPUnit Manual</p>
Getting week number off a date in MS SQL Server 2005? <p>Is it possible to create an sql statement that selects the week number (NOT the day of week - or the day number in a week). I'm creating a view to select this extra information along with a couple of other fields and thus can not use a stored procedure. I'm aware...
<p>Be aware that there are differences in what is regarded the correct week number, depending on the culture. Week numbers depend on a couple of assumptions that differ from country to country, see <a href="http://en.wikipedia.org/wiki/Week#Week_number" rel="nofollow">Wikipedia article on the matter</a>. There is an <a...
Another LINQ Pivot Problem - Convert SQL Script to LINQ <p>There are a few questions on SO already regarding LINQ pivots and while a couple of them outline my exact problem, I can't successfully translate them to a working solution. I feel that this is mostly due to a join in my tables.</p> <p>So for the benefit of a...
<p>Well, assuming that the foreign key has an object representation, something like:</p> <pre><code> int timesheetId = ... DateTime start = ..., end = ... var qry = from timeEntry in ctx.TimeEntries let date = timeEntry.StartTime.Date where timeEntry.TimesheetId == ti...
member control through admin account using php <p>I am new to php. I made a member registration on login page and adm too. So inside admin I wanted to get the list of the members and delete the members I dont want. So I took the a code from a sample code for phone book from <a href="http://localhost/xamp" rel="nofollow...
<ol> <li>This should be a POST via a FORM not a href link (GET).</li> <li>$TEXT is obviously an array holding the text you want printed.</li> <li>You need to replace <code>&amp;amp;member_1d</code> in the href with a real &amp; and a real i as <code>&amp;member_id</code>.</li> </ol>
I don't want a "close window" menu item in the task bar context menu for my WPF window <p>I don't want a "close window" menu item in the task bar context menu for my WPF window. My intention is to annoy the user.</p> <p>Thank you!</p>
<p>An easier option would be to do this:</p> <pre><code>&lt;Window ShowInTaskbar="False" ... /&gt; </code></pre>
Calculating a LookAt matrix <p>I'm in the midst of writing a 3d engine and I've come across the LookAt algorithm described in the DirectX documentation:</p> <pre><code>zaxis = normal(At - Eye) xaxis = normal(cross(Up, zaxis)) yaxis = cross(zaxis, xaxis) xaxis.x yaxis.x zaxis.x 0 xaxis.y...
<p><strong>Note the example given is a left-handed, row major matrix</strong>.</p> <p>So the operation is: Translate to the origin first (move by -<em>eye</em>), then rotate so that the vector from <em>eye</em> to <em>At</em> lines up with +z:</p> <p>Basically you get the same result if you pre-multiply the rotation ...
Report section style list numbering in CSS? <p>Now I know about the "normal" CSS list styles (roman, latin, etc) and certainly in years past they were somewhat inflexible in not allowing things like:</p> <p>(a)</p> <p>or </p> <p>a)</p> <p>only</p> <p>a.</p> <p>Now I believe that you can get an effect like the abo...
<p>See <a href="http://www.w3.org/TR/CSS2/generate.html">Generated content, automatic numbering, and lists</a>.</p> <blockquote> <p>This example shows a way to number chapters and sections with "Chapter 1", "1.1", "1.2", etc.</p> </blockquote> <pre><code>H1:before { content: "Chapter " counter(chapter) ". "; ...
How long before ASP.NET MVC becomes widely used in industry? <p>I am trying to decide whether to learn ASP.NET MVC (or to spend the time learning another technology that interests me). I know that it is an elegant framework, but I am trying to assess my future job opportunities if I invest in this skill. In your estima...
<p>For mainstream adoption, I wouldn't expect it will really take off until after RTM. Initially work will be limited to new projects, which I suspect there may be fewer of with the economy being as it is. The real increase in jobs will come when there are more established projects requiring maintenance. </p> <p>As fo...
how to display xml in javascript? <p>As the question says, it just escaped my memory how to display xml in javascript, I want to display some source xml within an div on a page, that sits next to the processed result of the xml in another div.</p> <p>Can't remember if there was an equivalent to javascript's escape to ...
<p>Fetch your XML using Ajax and simply put the result in a <code>textarea</code>. Style the textarea any way you want.</p>
MySQL tool or query that suggests table structure <p>I used a query a few weeks ago in MySQL that described a table and suggested possible improvements to its structure. For example, if I have an int field but only the numbers 1-3 in that field, it will suggest set(1,2,3) as the type.</p> <p>I think I was using phpMyA...
<p>This is what phpMyAdmin gives me:</p> <pre><code>SELECT * FROM `table_name` PROCEDURE ANALYSE ( ) </code></pre>
.net architecture: Creating a IRepository<T> generically <p>I am using a generic repository interface which allows me to add, find, update and delete objects of different types. I have then implemented two concrete repositories and can switch them around without changing the application. Everything is wonderfully disco...
<p>One common pattern is to use a dictionary from type to a function of the relevant type. For instance:</p> <pre><code>private static readonly IDictionary&lt;Type, Func&lt;object&gt;&gt; Fetchers = new Dictionary&lt;Type, Func&lt;object&gt;&gt;(); { (typeof(Object1), () =&gt; DataAccess.GetAllObject1(...
Version control of MDF files <p>I'm working on a web app (it is in asp.net mvc framework beta in visual studio 2008) and want to version control it. How do I version control the database files (*.mdf, binary) in the App_Data folder. </p> <p>Is there a way to just store the tables-and-whatever definition of the databa...
<p>Export the database structure as creation scripts, and potentially export some table (reference) data as insert scripts, then check those into source control.</p> <p>Definitely do NOT attempt to put the database binaries (*.mdf) into source control.</p>
How can I convert a REG_BINARY value from the registry into a string ? (vb.net) <p>I have a registry value which is stored as a binary value (REG_BINARY) holding information about a filepath. The value is read out into an byte array. But how can I transform it into a readable string?</p> <p>I have read about system.te...
<p>Well, it's not <em>arbitrary</em> binary data - it's text data in <em>some</em> kind of encoding. You need to find out what the encoding is.</p> <p>I wouldn't be surprised if <code>Encoding.Unicode.GetString(value)</code> worked - but if that doesn't, please post a sample (in hex) and I'll see what I can do. What d...
SQL statement problem <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 ...
<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;...
Is there an equivalent of ASF View for MP4 files? <p>I'm working on our encoding software, and have come across a strange issue where files in a 16:9 aspect ratio are being played in 4:3 in some players, post-transcode from WMV to MP4. Using ASF view I can see that the source WMV file appears to have incorrect data in ...
<p>After a bit of looking around I found MP4Box which can be used to retrieve this information using the <code>-info</code> switch, e.g.</p> <pre><code>mp4box.exe -info filename.mp4 </code></pre> <p>If anybody is interested, it turns out the problem was that the original WMV stream had the <code>AspectRatioX</code> a...
Built-in helper to parse User.Identity.Name into Domain\Username <p>Is there any built-in utility or helper to parse <code>HttpContext.Current.User.Identity.Name</code>, e.g. <code>domain\user</code> to get separately domain name if exists and user?</p> <p>Or is there any other class to do so?</p> <p>I understand tha...
<p>This is better (<em>easier to use, no opportunity of <code>NullReferenceExcpetion</code> and conforms MS coding guidelines about treating empty and null string equally</em>):</p> <pre><code>public static class Extensions { public static string GetDomain(this IIdentity identity) { string s = identity...
Sniffing queries to SQL Server <p>Is there a way to sniff SQL queries sent to a SQL Server db on any level (above transport level)? Perhaps there's some kind of a tracer in ASP.NET or built-in log in SQL Server ? </p>
<p>SQL Server Profiler perhaps? This will pick up what queries are executed. You can also get statistics, query plans and many other items of interest from this.</p>
Friendly Byte Formatting in Rails <p>I need to format an integer representation of bytes into something friendly, and I'm hoping that there's a utility function in Ruby or in Rails that will do that formatting for me (to perpetuate my laziness, of course.)</p> <p>I'm looking for something that would look like:</p> <p...
<p><a href="http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html">Number to human size</a> is what you're looking for.</p> <pre><code>require 'action_view' include ActionView::Helpers::NumberHelper number_to_human_size(123) # =&gt; 123 Bytes number_to_human_s...
How to dynamically invoke a chain of delegates in VB.NET <p>Does someone knows if it's possible to dynamically create a call chain and invoke it?</p> <p>Lets say I have two classes A &amp; B:</p> <pre><code>public class A public function Func() as B return new B() end function end class public class ...
<p>Are you using .NET 3.5? If so, it should be relatively straightforward to build an expression tree to represent this. I don't have enough expression-tree-fu to easily write the relevant tree without VS open, but if you confirm that it's an option, I'll get to work in notepad (from my Eee... hence the lack of VS).</p...
Vim: NERD_tree Plugin. Need help understanding a bloggers .vimrc addition to streamline this plugin <p>So I'm basically a beginner when it comes to Vim, nonetheless I do know the basic things (open files, edit, move around, basic grep, .vimrc, etc)</p> <p>I would submit this link first</p> <p><a href="http://weblog.j...
<p>I'd say <code>:help leader</code> will give you what you need, is an anti-slash by default.</p> <p>Thus, <code>map &lt;leader&gt;d</code> will be launched when you do <code>\d</code>.</p>
How do I set LC_ALL and LANG under IIS? <p>I am trying to run some Perl CGI scripts under IIS. I get the following message :</p> <pre> <code> CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: perl: warning: Setting locale failed. perl: w...
<p>The LANG and LC_ALL environment variables are set for your shell, but they aren't set for IIS. I'm not an IIS person, but the docs say that IIS is a service and you have to set those ahead of time then reboot.</p> <p>Alternatively, you can set these variables as soon your script starts to compile (and before you l...
Strange caching of .js file in firefox/tomcat/eclipse <p>I'm developing <code>.jsp</code> using eclipse and tomcat. </p> <p>My <code>.jsp</code> outputs html to pull in some javascript from a <code>.js</code> file. The <code>jsp</code> outputs the code which hooks up the function <code>mapTool</code> to the mousedow...
<p>try refreshing the page wile clearing cache: shift+click on refresh button, or clearing the cache under tools->clear private data</p>
Conway's Game Of Life <p>I am currently writting a programe about Conway's Game of life and I am really a beginner of python, I don't know how to start at all. Anybody can help me with it?</p>
<p><a href="http://plife.sourceforge.net/" rel="nofollow">http://plife.sourceforge.net/</a></p> <p>Send the 50 quid to me :)</p> <p>(I'm kidding, of course)</p>
How do I fix my output for floating-point imprecision? <p>I am doing some float manipulation and end up with the following numbers:</p> <pre><code>-0.5 -0.4 -0.3000000000000000004 -0.2000000000000000004 -0.1000000000000000003 1.10E-16 0.1 0.2 0.30000000000000000004 0.4 0.5 </code></pre> <p>The algorithm is the follow...
<p>A language agnostic solution would be to store your numbers as an integer number of steps, given that you know your step size, instead of as floats.</p> <p>A non-language agnostic solution would be to find out what your language's implementation of <a href="http://www.cplusplus.com/reference/clibrary/cstdio/printf....
RegEx for extracting HTML Image properties <p>I need a RegEx pattern for extracting all the properties of an image tag.</p> <p>As we all know, there are lots of malformed HTML out there, so the pattern has to cover those possibilities.</p> <p>I was looking at this solution <a href="http://stackoverflow.com/questions/...
<blockquote> <p>As we all know, there are lots of malformed HTML out there, so the pattern has to cover those possibilities.</p> </blockquote> <p>It won't. Use a HTML parser if you have to parse "evil" (from an unknown source) HTML.</p>
ASP.NET ViewState postback with page refresh and bookmarks <p>The ASP.NET ViewState feature can sometimes be a double edged sword. I rely on it on most of my projects and it speeds up development considerably.</p> <p>My problem is that sometimes users will try to refresh a page which will cause the viewstate to be los...
<p>My 2 cents: Instead of using the simplicity of <strong>ViewState</strong> sandbag use the simplicity of <strong>Session</strong> - which really is the same simplicity and you won't have to bother worrying about page refresh and stuff. Moreover session is way more flexible since you can use it to store more than jus...
Testing for whitespace in SQL Server <p>I've got some blank values in my table, and I can't seem to catch them in an IF statement. </p> <p>I've tried</p> <p><code>IF @value = ''</code> and <code>if @value = NULL</code> and neither one catches the blank values. Is there any way to test whether or not a varchar is enti...
<pre><code>ltrim(rtrim(isNull(@value,''))) = '' </code></pre>
Child controller updating a label for a cell in parent table view <p>I have a navigation view with a cell that has something as simple as a Date of Birth. When that particular row is clicked, a new controller get pushed into view with a UIDatePicker. Once a new date is selected, I'd imagine I need to do something in vi...
<p>First, the best place to reload data is in that particular UIViewController's viewWillAppear: method. That way you don't need to worry about references to the table in other controllers.</p> <p>Second, if I'm not misunderstanding, I think you need to brush up on objects. As long as what you change in the editing (c...
What tools do you recommend to profile Rails apps? <p>I've been looking for profiling tools for Rails for a while. I'm currently playing and testing ruby-prof and railsbench, but I kinda frustrated with the amount of tweaking and mangling required to make then work.</p> <p>Althought I don't mind (much) the tweaking, I...
<p>You can use the <a href="http://wiki.rubyonrails.org/rails/pages/ProfilerScript">built in profiler</a> as well:</p> <pre><code>$ ruby script/performance/profiler 'User.new' 5 % cumulative self self total time seconds seconds calls ms/call ms/call name 189.25 1.76 1.76 ...
How to convert a string to a Guid <p>I did not find the TryParse method for the Guid. I’m wondering how others handle converting a guid in string format into a guid type.</p> <pre><code>Guid Id; try { Id = new Guid(Request.QueryString["id"]); } catch { Id = Guid.Empty; } </code></pre>
<pre><code>new Guid(string) </code></pre> <p>You could also look at using a <code>TypeConverter</code>.</p>
Eclipse Custom Variable for Java Code Templates <p>How do you add a new variable to be inserted into a Java code template. How do I add a variable to the list in Window->Preferences->Java->Code Style->Code Templates->Code->New Java Files->Edit->Insert Variable... ?</p> <p>Currently my new files get created with:</p> ...
<p>Yes, you can indeed add a variable to this list. See the extension point called</p> <p>org.eclipse.ui.editors.templates</p> <p>and you'll find out how.</p>
How do I use a variable in a grep with groovy? <p>I need to grep for lines with bunch of names, say "clientLogin=a@yahoo.com", "clientLogin=b@gmail.com" from a file.txt file.txt has junk which is email=a@yahoo.com email=b@gmail.com. I need to filter these out</p> <p>Once I get these lines I need to grep for gmail and ...
<p>You're already using groovy, does using a regular expression that gives you your answer work?</p> <pre><code>def file = new File("file.txt") file.delete() // clear out old version for multiple runs file &lt;&lt; """ foobar clientLogin=a@yahoo.com baz quux # should match a@yahoo.com foobar email=a@yahoo.com b...
SQL Server Tool to script drop statements which have check existence statements before them? <p>I have tried SQL Server 2008 Management Studio and other third party tools to script all database objects (views, SPs &amp; tables) and I can't get anything to generate a one file script which has a drop statement preceded w...
<p>SQL 2008 Management Studio can do this. Right click on the database name and select Tasks->Generate Scripts...check the box that says 'All Database Objects' and then on the next screen set Include If NOT EXISTS to True (this will also do the If Exists...though it's not apparent) and Script Drop to True. I think th...
SQL query to calculate visit duration from log table <p>I have a MySQL table LOGIN_LOG with fields ID, PLAYER, TIMESTAMP and ACTION. ACTION can be either 'login' or 'logout'. Only around 20% of the logins have an accompanying logout row. For those that do, I want to calculate the average duration.</p> <p>I'm thinking ...
<p>Given the data you have, there probably isn't anything much faster you can do because you have to look at a LOGIN and a LOGOUT record, and ensure there is no other LOGIN (or LOGOUT?) record for the same user between the two.</p> <p>Alternatively, find a way to ensure that a disconnect records a logout, so that the ...
How bad is ignoring Oracle DUP_VAL_ON_INDEX exception? <p>I have a table where I'm recording if a user has viewed an object at least once, hence:</p> <pre><code> HasViewed ObjectID number (FK to Object table) UserId number (FK to Users table) </code></pre> <p>Both fields are NOT NULL and together form t...
<p>I would normally just insert and trap the DUP_VAL_ON_INDEX exception, as this is the simplest to code. This is more efficient than checking for existence before inserting. I don't consider doing this a "bad smell" (horrible phrase!) because the exception we handle is raised by Oracle - it's not like raising your o...
Can I have multiple php.ini files? <p>I want to set the <code>include_path</code> variable in my <em>php.ini</em> file (<code>C:\Windows\php.ini</code>).</p> <p>But, I want different <code>include_path</code> values for different sites hosted on the same Windows server. How can I do this?</p>
<p><a href="http://php.net/manual/en/configuration.file.php" rel="nofollow">http://php.net/manual/en/configuration.file.php</a> says:</p> <blockquote> <p>php.ini is searched for in these locations (in order):</p> <p>. . .</p> </blockquote> <p>You can review this list and see if one of the techniques helps in y...
PHP new operator returning reference <p>I'm working with some old PHP code that has a lot of the following:</p> <pre><code>$someVar =&amp; new SomeClass(); </code></pre> <p>Did the <strong>new</strong> operator ever return a value, um, not by reference? (That feels strange to type. I feel like I'm losing my mind.)<...
<p>It was one of those sort of optimization techniques taught in a lot of older books on OOP in PHP 4.</p> <p>Basically, the initial object created in memory is one the application can't access unless you return the instance by reference. Otherwise you get a copy of the object - the only catch is that the original ex...
Multi column primary keys? <p>For example I have 2 tables, <code>Users</code> and <code>UserRelations</code>, and it is a one to many relationship.</p> <p>For the <code>UserRelations</code> table, I can have an identity column and make it the primary key: </p> <pre><code>[RelationID] [int] IDENTITY(1,1) NOT NULL, [Us...
<p>If you use the former design, with the superfluous identity column, there's no constraint against inserting two rows with identical UserID and TargetID. You'd have to create a <code>UNIQUE</code> constraint over the other two columns, which creates a compound index anyway.</p> <p>On the other hand, some frameworks...
Four nodes with a width of 25% don't fit next to each other? <p>I have a header node in which four child nodes reside. None have borders, padding nor margins. All four of them have the width:25%; css rule. In Opera it works just fine, in IE the last block flips to the next line sometimes depending on the width of the w...
<p><a href="http://ejohn.org/blog/sub-pixel-problems-in-css/">http://ejohn.org/blog/sub-pixel-problems-in-css/</a></p> <p>This is a well-known issue in the CSS world, unfortunately. Likely the issue is that the 100% pixel-equivalent these fit into is an odd number, so there is a rounding error when calculating pixels....
Where can I find a list of SocketErrorCode and NativeErrorCode thrown by SocketException? <p>A SocketException has a SocketErrorCode and NativeErrorCode. I would like to find a list where these codes (or the common onces) are listed so I can respond in proper fasion.</p> <p>Does anybody know where to find such a list?...
<p>MSDN? <a href="http://msdn.microsoft.com/en-us/library/system.net.sockets.socketerror.aspx" rel="nofollow">SocketError</a>; or from the native ErrorCode, the <a href="http://msdn.microsoft.com/en-us/library/system.net.sockets.socketexception.errorcode.aspx" rel="nofollow">MSDN page</a> states: "For more information ...
.Net: Read properties of and disable the screensaver and other power schemes <p>I have a long-running GUI application that outputs various statuses to the user. The user wants to view every status but doesn't want to worry about the screensaver kicking in after the inactivity settings.</p> <p>Preferably in C#, how do...
<p>The screensaver timeout values are in the registry:</p> <p><a href="http://www.microsoft.com/technet/scriptcenter/resources/qanda/oct04/hey1027.mspx" rel="nofollow">How can I change the screensaver timeout values</a> (sample code in there should be easy enough to convert to C#)</p> <p>Not sure about the power sche...
Multiple Font/Language support in Flash <p>Greetings,</p> <p>I'm in the middle of writing a Flash application which has multilingual support. My initial choice of font for this was Tahoma, for its Unicode support. The client prefers a non-standard font such as Lucida Handwriting. Lucida Handwriting doesn't have the...
<p>Well, ultimately you have only two real choices: either you embed a font in your SWF, guaranteeing what your fonts will look like, or you don't, and use device fonts. (Or a mixture of the two, using embedded or device fonts depending on region.)</p> <p>If you don't embed any fonts, then whatever font you define for...
What's the shortest TSQL to concatenate a person's name which may contain nulls <p>3 fields: FirstName, MiddleName, LastName</p> <p>Any field can be null, but I don't want extra spaces. Format should be "First Middle Last", "First Last", "Last", etc.</p>
<pre><code> LTRIM(RTRIM( LTRIM(RTRIM(ISNULL(FirstName, ''))) + ' ' + LTRIM(RTRIM(ISNULL(MiddleName, ''))) + ' ' + LTRIM(ISNULL(LastName, '')) )) </code></pre> <p>NOTE: This won't leave trailing or leading spaces. That's why it's a little bit uglier than other solutions.</p>
An algorithm to get the next weekday set in a bitmask <p>I've got this small question - given a bitmask of weekdays (e.g., <code>Sunday = 0x01, Monday = 0x02, Tuesday = 0x04</code>, etc...) and today's day (in a form of <code>Sunday = 1, Monday = 2, Tuesday = 3</code>, etc...) - what's the most elegant way to find out ...
<pre><code>int getNextDay(int days_mask, int today) { if (!days_mask) return -1; // no days set days_mask |= days_mask &lt;&lt; 7; // duplicate days into next week mask = 1 &lt;&lt; (today % 7); // keep track of the day while (!(mask &amp; days_mask)) { mask &lt;&lt;= 1; ++today; } return ...
What are the problems associated with serving pages with Content: application/xhtml+xml <p>Starting recently, some of my new web pages (XHTML 1.1) are setup to do a regex of the request header <code>Accept</code> and send the right HTTP response headers if the user agent accepts XML (Firefox and Safari do).</p> <p>IE ...
<p>One problem with content negotiation (and with serving different content/headers to different user-agents) is proxy servers. Considering the following; I ran into this back in the Netscape 4 days and have been shy of server side sniffing ever since.</p> <p>User A downloads your page with Firefox, and gets a XHTML/X...
Have any vb applications migrated to delphi? <p>I would like to hear of the experiences of classic vb developers who migrated their applications to delphi rather than vb.net. How has it worked out? Are you glad or sorry that you didn't move to vb.net? </p>
<p>I am not really a vb developer but rather a Delphi developer who was forced to maintain some vb apps for a while. I tried to migrate one vb app to vb.net and after that experience I never tried it again. I successfully migrated several vb apps to Delphi. It wasn't easy and it became a pain in the lower back to find ...
Why are .Net programmers so afraid of exceptions? <p>First of all, I'm not trying to be critical of anyone here or saying that all .Net programmers are this way. But I'm definitely noticing a trend: .Net programmers seem to avoid exceptions like they're the plague.</p> <p>Of course, there's always the <a href="http:...
<p>Performance is the fear monger's buzzword when it comes to exceptions - but that really only applies to throwing them or handling them in tight loops, or for when relying on them for control flow. Personally I see exceptions as another tool in my toolbox; I'm not scared of them at all. Ideally when you use exception...
Quick Test Pro (Regression test scripts) - Cruisecontrol.net <p>Any one succeeded in integrating Quick Test Pro (QTP) automated test scripts in Cruisecontrol.net.</p> <p>if any one have an idea to run them unattended , in a schedule task or cruisecontrol.net </p> <p>will be more useful.#</p>
<p>I am sure this will be possible using the QTP Automation Object Model. See 'QuickTest Automation' in the 'QuickTest Advanced References' section of the on-line help. You should be able to create a simple batch file to run QTP which can then be invoked via NAnt and/or CruiseControl.</p>
Determine record in multi record html form <p>In a html form, I'm displaying multiple records from a table, ready for update.</p> <p>Right now I use: <code>name=&lt;column-name&gt;_&lt;pk-id&gt; value=&lt;value&gt;</code> for the fields. Then in my python-script I go for:</p> <pre><code>for key in form.keys(): if...
<p>In java apps, it's common to JSONify the name.</p> <pre><code>&lt;input name="records[pk].fieldName"/&gt; </code></pre> <p><code>pk</code> being the primary key of the row and <code>fieldName</code> the field. Of course most frameworks handle this transparently. Each record ends up as a instance of a class with a ...
How abstracted should MVC models be? <p>I'm in the process of extending and improving a website that has quite a few structural problems. It looks very much like the developers before me had heard of MVC but didn't understand the ideas of abstraction or modularity. So the MVC "framework" is a) bespoke b) broken c) patc...
<p><strong>But what about the Models? Are they intended to be re-usable amongst different pages?</strong></p> <p>Yes.</p> <p><strong>Should they care about just where the data is stored?</strong> </p> <p>No. They need not know it. All this kinda information is necessary for persistence layer or data layer.</p> <p><...
ASP.NET: Casting XPath to bool - Possible? <p>Greetings!</p> <p>I have an XML value that I'd like to use as a boolean value to toggle the visibility of a Panel. I have something like this:</p> <pre><code>&lt;asp:FormView id="MyFormView" runat="server" DataSourceID="MyXmlDataSource"&gt; &lt;ItemTemplate&gt; ...
<p>Try <code>&lt;%#(Convert.ToBoolean(XPath("Menu/Show"))) %&gt;</code></p>
How to install Hibernate Tools in Eclipse? <p>What is the proper way to install Hibernate Tools in Eclipse as a plugin? The <a href="http://www.hibernate.org/255.html">Hibernate site</a> doesn't really give any instructions.</p> <p>Looking at the Hibernate Tools binary <code>HibernateTools-3.2.4.Beta1-R200810311334.zi...
<p>Well, most convenient and safest way is to use JBoss update site within Eclipse software updates (Help -> Software Updates... -> Add Site...):</p> <p><a href="http://download.jboss.org/jbosstools/updates/stable/">The latest stable release update site for JBoss Tools</a></p> <p>There you can find Hibernate tools to...
How much of the compiler should we know? <p>In order to write better code, is it worth to know deeply what the compiler does? </p> <p>Just how much would be enough? I'm not a bit scrubber, but I was thinking that knowing how the compiler operates would make me a better programmer. Am I wrong? </p> <p>If so, what reso...
<p>Probably wouldn't hurt to know how the compiler will optimize your code, but <strong>don't write for the compiler, but write for people to read</strong>.</p> <p>Writing code in a way that is more optimized for the compiler may make it more difficult for people to read it, and these days the <strong>compiler probabl...
Sharing Views <p>Is it a good idea to share views between different controllers (using the Views/Shared folder)? I am creating my first MVC application and it requires some pieces of data that are similar to each other. They "explain" different things (and will therefore be stored in different tables) but they each hav...
<p>Personally, if the view is generic enough to be used for multiple scenarios then I would use it as so. DRY!</p>
Python method arguments with spaces <p>I would like to create a simple file format/DSL which would allow my users to input data. My system is in python and using python's parser is appealing. Syntax like this for defining a data element seems quite convenient.</p> <pre><code>Allocation(Param1 = Val1, Param2 = Val2 )...
<p>I'd imagine that there would be some way to do it. But I feel compelled to ask, is there really a big enough difference in readability from this</p> <pre><code>Allocation(Param1 = Val1, Param2 = Val2 ) </code></pre> <p>To this:</p> <pre><code>Allocation(Param 1 = Val1, Param 2 = Val2 ) </code></pre> <p>to make ...
How do you do inline delegates in vb.net like c#? <p>Is it possible to create an inline delegate in vb.net like you can in c#?</p> <p>For example, I would like to be able to do something inline like this:</p> <pre><code>myObjects.RemoveAll(delegate (MyObject m) { return m.X &gt;= 10; }); </code></pre> <p>only in VB ...
<pre><code>myObjects.RemoveAll(Function(m As MyObject) m.X &gt;= 10) </code></pre> <p>See <a href="http://msdn.microsoft.com/en-us/library/bb531253.aspx">Lambda Expressions on MSDN</a></p>
Problem with Recaptcha <p>I have a problem with the form I'm using in my webpage. </p> <p>It allows the recaptcha but It also sends the email without validating the fields in the recaptcha box. This form is using Ajax and PHP.</p> <p>I've pasted the code next:</p> <pre><code>&lt;br&gt; &lt;br&gt; &lt;div id="fields"...
<p>The problem is that you need to check the reCAPTCHA before you display the form again. The PHP code would go above the first line of the form, perferrably before any HTML is generated so the user can be redirected to a thank you page.</p>
How do you do an IN or CONTAINS in LINQ using LAMBDA expressions? <p>I have the following Transact-Sql that I am trying to convert to LINQ ... and struggling. </p> <pre><code>SELECT * FROM Project WHERE Project.ProjectId IN (SELECT ProjectId FROM ProjectMember Where MemberId = 'a45bd16d-9be0-421b-b5bf-143d334c8155') ...
<p>GFrizzle beat me to it. But here is a C# version</p> <pre><code>var projectsMemberWorkedOn = from p in Projects join projectMember in ProjectMembers on p.ProjectId equals projectMember.ProjectId where projectMember.MemberId == "a45bd16d-9be0-421b-b5bf-...
ASP.NET Web Setup <p>I have 3 web projects in a Visual studio solution.I want to create a single web setup project which should install all 3 web projects in their virtual directories.So how to create a single web setup project which supports multiple web application installation?</p>
<p>You can do this by creating a Web Setup Project. In the File System add as many Web Custom Folders as you need.</p> <p>Only the main Web Application Folder will have the installation dialog so if you want to customize the virtual directory names then you will need to add a screen and set the Property of the web cu...
Skipping a column in FileHelper <p>Using the <a href="http://www.filehelpers.net/" rel="nofollow">FileHelper</a> library for .Net, can I somehow skip a number of columns from the source file?</p> <p>According to docs and samples, I have to add fields for all columns. Alas, I have an excel sheet with 216 columns to im...
<p>I have the same situation, and question. Searching the forums at filehelpers.net, I found this <a href="http://www.filehelpers.net/forums/viewtopic.php?t=394" rel="nofollow">thread</a> (from 2007?!) with a response by Marcos himself:</p> <p>Question:</p> <blockquote> <p>In a delimited length layout, is it possi...
Is it true that the smallest memory allocation in .net is a byte? <p>Is it true that the smallest amount of memory that I can allocate in managed code is a byte? </p> <p>Do I understand correctly that a Boolean variable takes up much more than a bit of memory? </p> <p>Is there a way for me to allocate memory, in .net...
<p>This is correct, allocations are made on a granularity of byte (possibly rounded up to an even number of bytes or even higher). This is true of any OS I've worked with, so it's not specific to managed code. The memory manager works with bytes, not bits.</p> <p>On the other hand, it's not hard to pack booleans into ...
SQL Reporting Services - Restrict Export Formats <p>Is it possible to limit export formats only PDF and Excel ?</p>
<p>Comment out or remove the formats you want to exclude in the Render section of <strong>rsreportserver.config</strong> in </p> <pre><code>..\Program Files\Microsoft SQL Server\MSSQL.&lt;n&gt;\Reporting Services\ReportServer </code></pre>
Accessing calendar entries on the iPhone/iPod touch <p>is it possible to access calendar entries on the iPhone/iPod touch, i.e. reading, creating, changing, deleting appointments?</p> <p>I searched the iPhone SDK documentation but didn't find anything. Perhaps I missed something.</p>
<p>Currently this functionality is not supported by the SDK. If you need this, please consider filing a <a href="http://bugreport.apple.com" rel="nofollow">bug report</a> with Apple.</p>
How to cancel the 'system key down' state in Windows <p>In Windows, when you press Alt, and release it again, the menu bar gets activated. However, when you press Alt, then click, then release, the menu bar does not get activated because presumably you wanted to Alt+click, not activate the menu bar.</p> <p>I want to s...
<p>When you release the Alt key, the system generates a <code>WM_SYSCOMMAND</code>/<code>SC_KEYMENU</code> message. Futhermore, unless you press a key to open a specific popup menu, the lparam will be 0. DefWindowProc, upon receiving this, will enter the menu loop. So, all you have to do is detect this message and prev...
Return file from python module <p>Edit: How to return/serve a file from a python controller (back end) over a web server, with the file_name? as suggested by @JV</p>
<p>You can either pass back a reference to the file itself i.e. the full path to the file. Then you can open the file or otherwise manipulate it.</p> <p>Or, the more normal case is to pass back the file handle, and, use the standard read/write operations on the file handle.</p> <p>It is not recommended to pass the ac...
How to Create a Managed Path through SharePoint Object Model <p>This is a question for a WSS/SharePoint guru. </p> <p>Consider this scenario: I have an ASP.Net web service which links our corporate CRM system and WSS-based intranet together. What I am trying to do is provision a new WSS site collection whenever a new ...
<p><strong>Update</strong> I think you have proved that the issue is not with the code.</p> <p>SPSecurity.RunWithElevatedPrivileges: Normally the code in the SharePoint web application executes with the privileges of the user taking the action. The RunWithElevatedPrivileges runs the code in the context of the SharePoi...
what is the difference between stringstream clear and str <p>I just wanted to know what's the difference between clear() and str("");</p> <p>For example:</p> <pre><code>stringstream ss("Stack Overflow"); ss.clear(); ss.str(""); </code></pre> <p>I wanted to know the underlying technical difference.</p>
<p><code>clear()</code> clears the error state flags in the <code>stringstream</code>. That is to say it sets the error state to <code>goodbit</code>(which is equal to zero).</p> <p><code>str("")</code> sets the associated string object to the empty string.</p> <p>They actually do completely different things. The pec...
pubs database documentation <p>is there a documentation of the pubs database (it comes as a demo DB for SQL 2000)? for example, what is the roysched table? what represents lowqty and hightqty and discount columns from the discount table? minlvl and maxlvl from jobs table?</p> <p>Thanks</p>
<p>You can try <a href="http://msdn.microsoft.com/en-us/library/aa238305.aspx" rel="nofollow">here</a></p>
How to create an XPS document? <p>I'd like to create an XPS document for storing and printing.</p> <p>What is the easiest way to create an XPS document (for example with a simple grid with some data inside) in my program, and to pass it around?</p>
<p>Nothing easy about it. But it can be done. I've got some (sadly, still buggy) sample code and information on my blog for creating the document in memory.</p> <p>Here's some code I whipped up for testing that encapsulates everything (it writes a collection of FixedPages to an XPS document in memory). It includes ...
How to run MSVC++ 6.0 off a USB drive as a portable app <p>Without using any third party program to do this (i.e. without VMware ThinApp, U3 or MojoPac etc.) How to move MSVC++ 6.0 from from its install on C: over to a USB drive? So that it can be used on different PCs with no admin rights and without installing anythi...
<p>Move the two folders that install created under <code>c:\program files\</code> to the USB drive (e.g. to <code>e:\progs\msvc\msvc6</code> and <code>e:\progs\msvc\vc98</code>), and append to the file <code>e:\progs\msvc\vc98\bin\vcvars32.bat</code> to suit e.g.</p> <pre><code>prompt $g set path=e:\progs\uedit;e:\pr...
Weighted random selection with and without replacement <p>Recently I needed to do weighted random selection of elements from a list, both with and without replacement. While there are well known and good algorithms for unweighted selection, and some for weighted selection without replacement (such as modifications of t...
<p>One of the fastest ways to make many with replacement samples from an unchanging list is the alias method. The core intuition is that we can create a set of equal-sized bins for the weighted list that can be indexed very efficiently through bit operations, to avoid a binary search. It will turn out that, done corr...
Is it true that using "this." before the parameters in c# uses more memory? <p>than just to call the parameter as it is?</p>
<p>If you mean fields, then no. The compiler injects "this" (<a href="http://msdn.microsoft.com/en-us/library/system.reflection.emit.opcodes.ldarg_0(VS.95).aspx" rel="nofollow">ldarg.0</a>) whether you use it explicitly (this.foo) or implicitly (foo).</p> <p>It does, however, take 5 more characters in your source code...
Signal and slot connection in .ui <p>I have started to play a little with Qt 4. And then I have come across a problem with the Qt Designer. In the Signal/Slots editor I can only setup the connections that is listed there, and not all the slots is listed. If I try to add it manualy in the .ui file, the connection would ...
<p>By default not all signals/slots are shown. You could try checking the "show signals and slots inheritied from ...." checkbox in the lower left hand corder of the "Configure Connection" dialog that comes up when you try to create a signal.</p> <p>Beyond that, you can either do what Marcin said and use <a href="http...
When to catch java.lang.Error? <p>In what situations should one catch <code>java.lang.Error</code> on an application?</p>
<p>Generally, never. However, sometimes you need to catch specific Errors.</p> <p>If you're writing framework-ish code (loading 3rd party classes), it might be wise to catch LinkageErrors (no class def found, unsatisfied link, incompatible class change). I've also seen some stupid 3rd-party code throwing sublcasses o...
With XSLT/XPath, how can I match any element in the null namespace? <pre><code>&lt;xsl:template match="foo"&gt; </code></pre> <p>matches the foo element in the null namespace.</p> <pre><code>&lt;xsl:template match="*"&gt; </code></pre> <p>matches any element in <em>any</em> namespace.</p> <p>I tried:</p> <pre><cod...
<p>You could try:</p> <pre><code>&lt;xsl:template match='*[namespace-uri() = ""]'&gt; </code></pre> <p>If the node-set is empty or has no namespace URI, an empty string is returned by the <code>namespace-uri</code> function, which should achieve what you want.</p>
How can I prevent Windows from catching my Perl exceptions? <p>I have this Perl software that is supposed to run 24/7. It keeps open a connection to an IMAP server, checks for new mail and then classifies new messages.</p> <p>Now I have a user that is hibernating his XP laptop every once in a while. When this happens,...
<p>I think that you're dealing with an OS-level exception, not something thrown from Perl. The relevant Perl module is making a call to something in a DLL (I presume), and the exception is getting thrown. Your best bet would be to boil this down to a simple, replicable test case that triggers the exception (you might...
Clean document roles in a Doc Library <p>I have been developing an event handler to clean up the RolesAssignments of the new item of a document library in MOSS. I’ve searched for a method that could clean all the RolesAssignments efficiently, although the best way I found seams to be loop through the RolesAssignment...
<p>The example you've given within the body of your question is the most correct way to do this. ResetRoleInheritance and BreakRoleInheritance may do what you need, but this is the side-effect of the operations they perform. Their purpose is not to remove RoleAssignments, but rather operate on role inheritance. From MS...
Does a truststore need the sub-ca certificate? <p>I'm trying to setup a hierarchical PKI. Can I create a truststore containing only the root ca certificate, and will that mean my application trusts certificates signed by a sub-ca certificate which is in turn signed by the root ca?</p> <p>As an aside, it seems that you...
<p>The trust store should only contain the root CAs, not intermediates.</p> <p>An identity store should contain private keys, each associated with its certificate chain, except for the root.</p> <p>Many, many applications in the wild are misconfigured, and when trying to identify themselves (say, a server authenticat...
SQL - Temp Table: Storing all columns in temp table versus only Primary key <p>I would need to create a temp table for paging purposes. I would be selecting all records into a temp table and then do further processing with it.</p> <p>I am wondering which of the following is a better approach:</p> <p>1) Select all the...
<p>A Table Variable would be preferred over a temp table, if its within your constraints. </p> <p>Option 2 would use less resources, because there is less data duplication. </p> <p>Tony's points about this being a dirty read are really something you should be considering. </p> <p>Can you explain how you are 'paging...
SQL query (order by) <p>I want to list (a sorted list) all my entries from an attribute called streetNames in my table/relation Customers. eg. I want to achieve the following order: </p> <p>Street_1A<br /> Street_1B<br /> Street_2A<br /> Street_2B<br /> Street_12A<br /> Street_12B </p> <p>A simple order by streetNam...
<p>Select street_name from tablex order by udf_getStreetNumber(street_name)</p> <p>in your udf_getStreetNumber - write your business rule for stripping out the number</p> <p>EDIT</p> <p>I think you can use regex functionality in SQL Server now. I'd just strip out all non-number characters from the input.</p>
jQuery fadeIn, fadeOut effects in IE <p>The below <a href="http://docs.jquery.com/Effects/fadeIn" rel="nofollow">fadeIn</a>, <a href="http://docs.jquery.com/Effects/fadeOut" rel="nofollow">fadeOut</a> effect works fine in Firefox 3.0 but it doesn't work in IE 7 ... Whay is that and what's the trick? The idea is of cour...
<p>Weird.. couldn't tell you why you're getting that problem, but maybe try the pulsate effect plugin? <a href="http://docs.jquery.com/UI/Effects/Pulsate">http://docs.jquery.com/UI/Effects/Pulsate</a></p>
Exclude complete namespace from FxCop code analysis? <p>Is it possible to exclude a complete namespace from all FxCop analysis while still analyzing the rest of the assembly using the <code>SuppressMessageAttribute</code>?</p> <p>In my current case, I have a bunch of classes generated by LINQ to SQL which cause a lot ...
<p>If you tag your classes with the <code>[GeneratedCode]</code> attribute, you can use the /ignoregeneratedcode flag with FxCop as described in this MSDN post:</p> <p><a href="http://blogs.msdn.com/b/codeanalysis/archive/2008/02/28/faq-how-do-i-prevent-fxcop-1-36-from-firing-warnings-against-generated-code.aspx">FAQ:...