input
stringlengths
51
42.3k
output
stringlengths
18
55k
Why don't my HtmlHelper extensions work? <p>I'm building an ASP.Net MVC website. Rather than have everything in one project, I've decided to separate the Web, Model and Controller out into different projects in the same solution, that reference each-other.</p> <p>The referencing goes like this:</p> <blockquote> <p>...
<p>Check to make sure that the namespace of your extensions is accessible to our view. You need either this in your view:</p> <pre><code>&lt;%@ Import Namespace="MyRootNamespace.NamespaceForMyHtmlHelperExtensions"%&gt; </code></pre> <p>or this in your web config namespaces section:</p> <pre><code>&lt;add namespace=...
Ideal PHP Session Size? <p>I have a PHP form (mortgage app) that is about 400 fields, traffic on the site will be low.</p> <p>What is the ideal Session size for 400 fields going into a MySQL db?</p> <p>In <code>php.ini</code> what do I set?</p> <p>Anything I should set that I am missing?</p>
<p>There is no limit to the size of the session, BUT there is a limit to the memory PHP can take: <a href="http://ca.php.net/manual/en/ini.core.php#ini.memory-limit">http://ca.php.net/manual/en/ini.core.php#ini.memory-limit</a></p>
Formatting an if statement for readability <p>What's the best way to format this for readability?</p> <pre><code>if (strpos($file, '.jpg',1) &amp;&amp; file_exists("$thumbsdir/$file") == false || strpos($file, '.gif',1) &amp;&amp; file_exists("$thumbsdir/$file") == false || strpos($file, '.png',1) &amp;&amp; file_exis...
<p>I'd extract the "is an image" logic into its own function, which makes the <code>if</code> more readable and also allows you to centralize the logic.</p> <pre><code>function is_image($filename) { $image_extensions = array('png', 'gif', 'jpg'); foreach ($image_extensions as $extension) if (strrpos(...
silverlight blogs? <p>With the asp.net MVC framework the blogs of the team members (Rob Conery, Phil Haack etc) really helped me on my way and made me feel comfortable the development was going in the right direction. Is there something similar for Silverlight?</p> <p>-Edit: I would like to mention that I would like t...
<p>Method ~ of ~ failed by Tim Heuer: <a href="http://feeds.timheuer.com/timheuer-silverlight" rel="nofollow">http://feeds.timheuer.com/timheuer-silverlight</a></p> <p>Jesse Liberty - Silverlight Geek: <a href="http://feeds.feedburner.com/JesseLiberty-SilverlightGeek" rel="nofollow">http://feeds.feedburner.com/JesseLi...
Using C# to display powerpoint <p>Is there any good way to use a windows application written in C# to display/control a powerpoint slideshow? Ultimately I would like to show thumbnails in a form and clicking these thumbnails would advance the slides shown on a second monitor (similar to using Powerpoint itself to show ...
<p>This kb lays out the basics for working with the powerpoint presentation viewer object model. I'd suggest you include the viewer when you distribute your application.</p> <p><a href="http://support.microsoft.com/kb/265385" rel="nofollow">http://support.microsoft.com/kb/265385</a></p> <p>Once you get a reference to...
how to generate unit test code for methods <p>i want to write code for unit test to test my application code. I have different methods and now want to test these methods one by one in python script. but i do not how to i write. can any one give me example of small code for unit testing in python. i am thankful </p>
<p>Read the <a href="http://www.python.org/doc/2.5.2/lib/module-unittest.html" rel="nofollow">unit testing framework section</a> of the <a href="http://www.python.org/doc/2.5.2/lib/lib.html" rel="nofollow">Python Library Reference</a>.</p> <p>A <a href="http://www.python.org/doc/2.5.2/lib/minimal-example.html" rel="no...
WCF Unknown Message Received Event <p>Does anywone know when a UnknownMessageReceived event on a WCF ServiceHost will be fired?</p> <p>I have some code where I capture the Faulted en UnknownMessageReceived event but even when I post a wrong message to a particular service I never get the event.</p> <p>Jochen</p>
<p>I ran into this event when I, incorrectly specified an address like this: <a href="http://localhost:4000/SomeService//mex" rel="nofollow">http://localhost:4000/SomeService//mex</a></p> <p><strong>Note the double forward slash</strong></p> <p>The service was hosted in a WPF application. Because of that I also found...
How can I create a friendly URL in ASP.NET MVC? <p>How do I generate friendly URLs within the ASP.NET MVC Framework? For example, we've got a URL that looks like this:</p> <pre>http://site/catalogue/BrowseByStyleLevel/1</pre> <p>The 1 is Id of the study level (Higher in this case) to browse, but I'l like to reformat ...
<p>There are two steps to solve this problem. First, create a new route or change the default route to accept an additional parameter:</p> <pre><code>routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}/{ignoreThisBit}", new { controller = "Home", ...
C# little endian or big endian? <p>In the documentation of hardware that allows us to control it via UDP/IP, I found the following fragment:</p> <blockquote> <p>In this communication protocol, DWORD is a 4 bytes data, WORD is a 2 bytes data, BYTE is a single byte data. The storage format is little endian, namely 4...
<p>C# itself doesn't define the endianness. Whenever you convert to bytes, however, you're making a choice. The <a href="http://msdn.microsoft.com/en-us/library/system.bitconverter.aspx">BitConverter</a> class has an <a href="http://msdn.microsoft.com/en-us/library/system.bitconverter.islittleendian.aspx">IsLittleEndia...
Random Gaussian Variables <p>Is there a class in the standard library of .NET that gives me the functionality to create random variables that follow Gaussian distribution? </p>
<p>Jarrett's suggestion of using a Box-Muller transform is good for a quick-and-dirty solution. A simple implementation:</p> <pre><code>Random rand = new Random(); //reuse this if you are generating many double u1 = rand.NextDouble(); //these are uniform(0,1) random doubles double u2 = rand.NextDouble(); double randS...
Best Database With ColdFusion on OS X <p>ColdFusion 8 Standard Edition on OS X Leopard.</p> <p>Developing a new website.</p> <p>What is the best database to use in conjunction with ColdFusion?</p> <p>Will be storing simple Credit Card operations, registration information, CRM info for an indie software company</p>
<p>I would look into MySQL and/or PostgreSQL. </p> <p>I'm more familiar with MySQL. I rather like it a lot. It is solid, with good administration tools. I've used it on OSX servers (years ago) with PHP, and it delivered performance that was more than adequate for our small operation. Definitely worth looking in t...
ORM support for compound primary keys <p>I've read that compound primary keys will <a href="http://stackoverflow.com/questions/107404/what-are-the-down-sides-of-using-a-compositecompound-primary-key#108337">confuse the hell out of typical ORM code generators</a>. Which ORMs work best with compound PKs and which to avoi...
<p>I'm using NHibernate successfully with compound keys.</p> <pre><code>&lt;class name="UserProfileField" table="UserProfileFields"&gt; &lt;composite-id&gt; &lt;key-many-to-one name="Parent" column="UserId" lazy="false"/&gt; &lt;key-property name="FieldName"/&gt; &lt;/composite-id&gt; ... </cod...
Xaml not WPF <p>I am interested in using Xaml with expression blend for creating user interfaces in an application. However, because of the limitations of the target architecture, I cannot use WPF or C#.</p> <p>So, what I am interested in is in any examples / existing projects or advice from anyone who has experiance ...
<p>Does Silverlight help you in anyway?. Now there is an Eclipse plug-in available for you to use Silverlight with eclispe. So you will be able to use Expression blend to design your UI and use Java for the backend coding(Future plan I think). Check out this link for more details. <a href="http://www.eclipse4sl.org/" r...
Which built-in .NET exceptions can I throw from my application? <p>If I need to throw an exception from within my application which of the built-in .NET exception classes can I use? Are they all fair game? When should I derive my own?</p>
<p>See <a href="http://msdn.microsoft.com/en-us/library/ms173163.aspx" rel="nofollow">Creating and Throwing Exceptions</a>.</p> <p>On throwing built-in exceptions, it says:</p> <blockquote> <p>Do not throw System.Exception, System.SystemException, System.NullReferenceException, or System.IndexOutOfRangeException in...
Can Rhino Mocks Write My Expect Statements For Me? <p>I have a set of Visual Studio Team System unit (integration really) tests that talk to a remote database. The tests are getting too slow and unwieldy. I'd like to replace the entire set of tests with mocked out versions. The problem is it's painful to write all t...
<p>Ok, I ended up writing it myself. Here is the blog post overview:</p> <p><a href="http://rapidapplicationdevelopment.blogspot.com/2008/11/write-my-rhino-mocks-expect-statement.html" rel="nofollow">Write My Rhino Mocks Expect Statement</a></p> <p>And here is the CodePlex project:</p> <p><a href="http://www.codepl...
Is Functional to Relational mapping easier than Object to Relational? <p>Object-relational mapping has been well discussed, including on here. I have experience with a few approaches and the pitfalls and compromises. True resolution seems like it requires changes to the OO or relational models themselves.</p> <p>If ...
<p>The hard problems of extending the relational database are extended transactions, data-type mismatches, automated query translation and things like <a href="http://ayende.com/Blog/archive/2006/05/02/CombatingTheSelectN1ProblemInNHibernate.aspx">N+1 Select</a> that are fundamental problems of leaving the relational s...
Does Java Connection.close rollback? <p>Does Java Connection.close rollback into a finally block?.</p> <p>I know .Net SqlConnection.close does it.</p> <p>With this I could make try/finally blocks without catch...</p> <p>Example:</p> <pre><code>try { conn.setAutoCommit(false); ResultSet rs = executeQuery(con...
<p>According to <a href="http://java.sun.com/javase/6/docs/api/java/sql/Connection.html#close()">the javadoc</a>, you should try to either commit or roll back before calling the close method. The results otherwise are implementation-defined.</p>
How to reverse engineer undocumented legacy application? <p>Once I was assigned to a project which was about adding couple new features to the existing Java based web application. Because it was a matter of just couple simple features there was no chance for rewrite. </p> <p>Unfortunately, the code base came from a cl...
<p>I did this a couple of times. </p> <p>What really helped was to create a graphical representation of the datamodel. You can use tools, but sometimes creating it by hand is suitable because you will learn a lot while browsing through the code.</p> <p>I tried sequence diagrams but those are not very helpful because ...
Loading custom framework in iPhone <p>I'm trying to use an <a href="http://www.cybergarage.org/net/upnp/c/index.html" rel="nofollow">external framework</a> for UPnP browsing on the iPhone. The framework works perfectly on the Mac, But when I copy it to the iPhone app, it wouldn't run even if there's no code using the f...
<p>Dynamic linking of any kind is not supported on the iPhone. I think the fact you're trying to do dynamic linking is confusing the simulator's careful library loading thingamagig (which if I'm not mistaken it's the source of the errors above).</p> <p>If the license allows this, link the external UPnP code statically...
Ocx control in win form <p>How to create instance of AxHost abstract class</p>
<p><a href="http://msdn.microsoft.com/en-us/library/sf985hc5(VS.71).aspx" rel="nofollow">You cannot create an instance of an abstract class.</a></p> <p><em>You typically do not use the AxHost class directly. You can use the Windows Forms ActiveX Control Importer (Aximp.exe) to generate the wrappers that extend AxHost....
Can I test if a regex is valid in C# without throwing exception <p>I allow users to enter a regular expression to match IP addresses, for doing an IP filtration in a related system. I would like to validate if the entered regular expressions are valid as a lot of userse will mess op, with good intentions though.</p> <...
<p>As long as you catch very specific exceptions, just do the try/catch.</p> <p>Exceptions are not evil if used correctly.</p>
How do you keep parents of floated elements from collapsing? <p>Although elements like <code>&lt;div&gt;</code>s normally grow to fit their contents, using the <code>float</code> property can cause a startling problem for CSS newbies: <strong>if floated elements have non-floated parent elements, the parent will collaps...
<h2>Solution 1:</h2> <p>The most reliable and unobtrusive method appears to be this:</p> <p>Demo: <a href="http://jsfiddle.net/SO_AMK/wXaEH/">http://jsfiddle.net/SO_AMK/wXaEH/</a></p> <p>HTML: </p> <pre><code>&lt;div class="clearfix"&gt; &lt;div style="float: left;"&gt;Div 1&lt;/div&gt; &lt;div style="float...
How can I open a port in iptables for RMI access <p>I'm trying to connect from my Java application to a development server that has port 8088 closed which is used for RMI. I appreciate any help on how to open that port.</p>
<p>Assuming </p> <ul> <li>you want to allow access from everywhere</li> <li>you want to allow access via the first ethernet device (eth0) </li> <li>you want to allow access to port 8088 using tcp</li> </ul> <p>then you could try running</p> <blockquote> <p>iptables -I INPUT -i eth0 -p tcp --dport 8088 -j ACCEPT</p...
Detecting Virus Scanners <p>We've had problems with a virus scanner murdering the performance of our app by slowing down writes to an <a href="http://en.wikipedia.org/wiki/H2_(DBMS)" rel="nofollow">H2 db</a>. So we'd like to be able to detect the presence of any virus scanner and alert the user of the potential problem...
<p>On Windows Vista, MS added some API calls to allow you to query the status of the Windows Security Centre, which should tell you if A/V software is installed. Obviously this is not a particularly generic solution, nor a Java-based one, but it's the only way I can think of, short of attempting to install a virus. Um ...
How Python web frameworks, WSGI and CGI fit together <p>I have a <a href="http://en.wikipedia.org/wiki/Bluehost">Bluehost</a> account where I can run Python scripts as CGI. I guess it's the simplest CGI, because to run I have to define the following in <code>.htaccess</code>:</p> <pre><code>Options +ExecCGI AddType te...
<p><strong>How WSGI, CGI, and the frameworks are all connected ?</strong></p> <p>Apache listens on port 80. It gets an HTTP request. It parses the request to find a way to respond. Apache has a LOT of choices for responding. One way to respond is to use CGI to run a script. Another way to respond is to simply se...
Protected Mode Keyboard Access on x86 Assembly <p>I'm working on keyboard input for a very basic kernel that I'm developing and I'm completely stuck. I can't seem to find any information online that can show me the information I need to know.</p> <p>My kernel is running in protected mode right now, so I can't use the ...
<p>The <a href="http://course.mit.edu/6.828">MIT operating systems class</a> has lots of good references. In particular, check out <a href="http://www.computer-engineering.org/index.html">Adam Chapweske's resources</a> on keyboard and mouse programming.</p> <p>In short, yes, you will be using the raw in/out ports, wh...
How do you change the colors of the text when doing a Schema Compare in Visual Studio 2008 Database Edition? <p>I am trying to find out how to modify the <code>Colors/Fonts</code> used in the Schema Compare "<code>Object Definitions</code>" window that appears after a comparison is done between two databases.</p> <p>T...
<p>I think this may help you...</p> <p><a href="http://msdn.microsoft.com/en-us/library/kw7t0545%28v=VS.90%29.aspx" rel="nofollow">Fonts and Colors, Environment, Options Dialog Box</a></p>
Rake db:migration aborted <p>I've got a unfinished project that a developer just didn't finish and didn't leave any documentation about the installation process. I've downloaded the production directory to my windows machine (running InstantRails 2), I created the databases as required in the <code>database.yml</code> ...
<p>Sometimes Rails will throw this error if there's a syntax error where Admin is defined.</p> <p>Try looking for admin.rb and make sure that it parses.</p> <p>Also, you may want to try running the migrations one at a time (<code>rake db:migrate VERSION=1</code>, etc.) to see if that helps you track down which migrat...
How do you upgrade a web site that uses #include files to a Web Application <p>I've recently inherited a fairly large web site. The project is set up as a web site in Visual studio, and not a Web Application. For a number of reasons, I would like to convert it to a web application.</p> <p>I started converting the appl...
<ul> <li>You should convert included aspx files to classes, if they are used as code libraries in the old situation</li> <li>You should convert aspx files, which contain html, server- and/or HTML-controls to usercontrols (ascx files)</li> </ul> <p>This should be a good starter for now. Later on you could refactor to y...
How would you improve this algorithm? (c string reversal) <p>Working through some programming interview challenges I found online, I had to write an algorithm to reverse a const char * and return a pointer to a new char *. I think I have it, but to make it work properly I had to do some wonky stuff - basically having t...
<p><a href="http://cppreference.com/wiki/stl/algorithm/reverse"><code>std::reverse</code></a> from <code>&lt;algorithm&gt;</code> works for strings and <code>char</code> arrays:</p> <pre><code>string str = "Hello"; char chx[] = "Hello"; reverse(str.begin(), str.end()); reverse(chx, chx + strlen(chx)); cout &lt;&lt; ...
Is it possible to view the history of a line in SVN? <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/53629/history-of-changes-to-a-particular-line-of-code-in-subversion">History of changes to a particular line of code in Subversion?</a> </p> </blockquote> <p>...
<p>I am not sure blame alone does what the asker needs.</p> <p>I have found the TortoiseSVN command "blame changes" to be handy. It runs a blame on two revisions and compares them together in the diff tool. </p> <p>The result gives you what the line currently is, what it was at the targeted revision, and who modified...
Cross-Platform Way of Creating Safari Webarchives <p>I've been searching around and haven't found any reference to tools that can create Safari's webarchive format.</p> <p>Does anyone have pointers to code for creating this format, or at least a format reference documentation?</p> <p>Ideally I'd like to build a tool ...
<p>I believe the format for .webarchives is officially undocumented, but it's just a plist. You can open it in the Property List Editor and examine its contents. Shouldn't be to hard to replicate most, if not all, of what's in there.</p>
Should you collect the young generation first in a full garbage collection? <p>I'm writing a program that contains a generational garbage collector. There are just two generations. What I wonder is: When doing a full collection, do I gain anything (performance-wise) by first collecting the younger objects, promoting th...
<p>It depends on how often you promote survivors. If you promote them often, then it looks like you'll do a lot better by doing GC in one sweep. If you don't, then it looks like they'll be pretty similar. </p> <p>Either way, it seems as if you do a little bit of redundant work by doing it in two phases. For example, a...
How do I calculate the SIZE of stored procedures in SQL Server 2005? <p>I was asked for a comprehensive breakdown on space used within a specific database. I know I can use *sys.dm_db_partition_stats* in SQL Server 2005 to figure out how much space each <em>table</em> in a database is using, but is there any way to de...
<pre><code>;WITH ROUTINES AS ( -- CANNOT use INFORMATION_SCHEMA.ROUTINES because of 4000 character limit SELECT o.type_desc AS ROUTINE_TYPE ,o.[name] AS ROUTINE_NAME ,m.definition AS ROUTINE_DEFINITION FROM sys.sql_modules AS m INNER JOIN sys.objects AS o ON m.object_id =...
What is the best way to localize an IEnumerable? <p>What is the best way to localize a collection (IEnumerable)? From the BL I retrieve a collection of entities which still need to localized, I figured I write a method which extends the IEnumerable and returns the localized list. </p> <p>How can i get the code underne...
<p>have you tried something where you <a href="http://msdn.microsoft.com/en-us/library/9k7k7cf0.aspx" rel="nofollow">yield</a> the item?</p> <pre><code>public static IEnumerable&lt;string&gt; Localize(this IEnumerable&lt;string&gt; items, CultureInfo culture) { foreach (string item in items) { yield re...
Dealing with C++ "initialized but not referenced" warning for destruction of scope helpers? <p>In Visual Studio, I often use objects only for RAII purposes. For example:</p> <pre><code>ScopeGuard close_guard = MakeGuard( &amp;close_file, file ); </code></pre> <p>The whole purpose of *close_guard* is to make sure tha...
<p>If your object has a non-trivial destructor, Visual Studio should <em>not</em> be giving you that warning. The following code does not generate any warnings in VS2005 with warnings turned all the way up (/W4):</p> <pre><code> class Test { public: ~Test(void) { printf("destructor\n"); } }; Test foo(void) { ret...
Convert memory address range in running Linux process to symbols in object file? <p>Here is a snippet of the file <em>/proc/self/smaps</em>:</p> <pre><code>00af8000-00b14000 r-xp 00000000 fd:00 16417 /lib/ld-2.8.so Size: 112 kB Rss: 88 kB Pss: 1 kB Shared_Clean: ...
<p>The format of smaps is: </p> <p>[BOTTOM]-[TOP] [PERM] [FILE OFFSET]</p> <p>b80e9000-b80ea000 rw-p 0001b000 08:05 605294 /lib/ld-2.8.90.so</p> <p>So there the actual content of the file '/lib/ld-2.8.90.so' at file offset 0x0001b000 is mapped at 0xb80e9000 in that program's memory.</p> <p>To extract the line n...
WordPress: I got rid of the second "home" page, but it's not good enough <p>I have a WordPress site (2.6.2) in which I have set the Home page to a static page instead of the normal posts page. The ID of this page is 2, so in the WordPress template I have changed the <code>wp_list_pages</code> to look like this:</p> <p...
<p>You can set a static page as the front page in the Administration > Settings > Reading panel after logging in as the administrator.</p> <p>The Wordpress manual entry on this subject can be found <a href="http://codex.wordpress.org/Creating_a_Static_Front_Page" rel="nofollow">here</a>.</p>
Does a Poco to DataSet project exist? <p>I have a <code>POCO</code> object that goes 4 levels deep contained objects (like <code>Invoice</code> has line items that have taxes that have gl entries), and I want to turn the entire thing into a <code>DataSet</code>. So there would be 4 tables, each with constraints being a...
<p>How do you populate this object? If it's from the database, there are two methods to structure your query such that the dataset is populated with separate, automatically related DataTable-s. Old and probably not supported anymore is the <a href="http://support.microsoft.com/kb/189657" rel="nofollow">SHAPE command</a...
Where do you put program scope variables in UI driven application? <p>Ok, so I know that global variables are considered bad, and the singleton pattern is overused. And I have read in many places that a class should do only one task and contain only those variables that allow it to accomplish that one task. However, w...
<p>I find that storing singletons as public data attributes of the main dialog class of an MFC dialog application works OK for a quick and dirty program. However, as the program becomes larger and more complex, things begin to get untidy.</p> <p>The point where storing singletons in the dialog class needs to be refac...
How to handle checkboxes in ASP.NET MVC forms? <h2>Caution: This question is over five years old!</h2> <p>Your best option is to search for newer questions, or to search the answers below looking for your specific version of MVC, as many answers here are obsolete now. </p> <p>If you do find an answer that works for...
<p>Html.CheckBox is doing something weird - if you view source on the resulting page, you'll see there's an <code>&lt;input type="hidden" /&gt;</code> being generated alongside each checkbox, which explains the "true false" values you're seeing for each form element.</p> <p>Try this, which definitely works on ASP.NET ...
how to get as much as possible from dbx <p>I do TDD on a daily basis for my C++ development on Solaris10. It has greatly reduced the time I have to spend using my debugger but sometime this is the only option.</p> <p>DBX is pretty powerful but not that user friendly. Note that I'm talking about console DBX not the Sun...
<p>I have bookmarked a few sites related to dbx. Here they are, in no particular order in case they might be useful to you:</p> <ul> <li><a href="http://developers.sun.com/solaris/articles/dbxerr.html" rel="nofollow">Why Can't dbx Find My Function?</a></li> <li><a href="http://blogs.oracle.com/quenelle/resource/dbxhel...
How do I enable double-buffering of a control using C# (Windows forms)? <p>How do I enable double-buffering of a control using C# (Windows forms)?</p> <p>I have a panel control which I am drawing stuff into and also an owner-drawn tab control. Both suffer from flicker, so how can I enable double-buffering?</p>
<p>In the constructor of your control, set the DoubleBuffered property, and/or ControlStyle appropriately.</p> <p>For example, I have a simple DoubleBufferedPanel whose constructor is the following:</p> <pre><code>this.DoubleBuffered = true; this.SetStyle(ControlStyles.UserPaint | ControlStyles.AllPain...
A good Java library for network math <p>I'm looking for a Java library that is geared towards network math and already tested. Nothing particularly fancy, just something to hold ips and subnets, and do things like print a subnet mask or calculate whether an IP is within a given subnet. </p> <p>Should I roll my own, ...
<p>We developed a Java IPv4 arithmetic library ourselves. See it here: <a href="http://tufar.com/ipcalculator/">http://tufar.com/ipcalculator/</a> It is under BSD license. </p>
In C# why can't a conditional operator implicitly cast to a nullable type <p>I am curious as to why an implicit cast fails in...</p> <pre><code>int? someValue = SomeCondition ? ResultOfSomeCalc() : null; </code></pre> <p>and why I have to perform an explicit cast instead</p> <pre><code>int? someValue = SomeCondition...
<p>The relevant section of the C# 3.0 spec is 7.13, the conditional operator:</p> <p>The second and third operands of the ?: operator control the type of the conditional expression. Let X and Y be the types of the second and third operands. Then,</p> <p>If X and Y are the same type, then this is the type of the condi...
How do I check SQL replication status via T-SQL? <p>I want to be able to check the status of a publication and subscription in SQL Server 2008 T-SQL. I want to be able to determine if its okay, when was the last successful, sync, etc.. Is this possible?</p>
<p>I know this is a little late....</p> <pre><code>SELECT (CASE WHEN mdh.runstatus = '1' THEN 'Start - '+cast(mdh.runstatus as varchar) WHEN mdh.runstatus = '2' THEN 'Succeed - '+cast(mdh.runstatus as varchar) WHEN mdh.runstatus = '3' THEN 'InProgress - '+cast(mdh.runstatus as varchar) WHEN mdh.r...
How to avoid screen flickering when showing form with user drawn controls? <p>So the <a href="http://stackoverflow.com/questions/214215/user-drawn-controls-are-using-the-previous-forms-background">transparent background problem</a> is solved. Now, every time I show the form (or have to have it repainted), I get a lot ...
<p>Did you try setting the <a href="http://stackoverflow.com/questions/220100/how-do-i-enable-double-buffering-of-a-control-using-c-window-forms">DoubleBuffered</a> property for the form?</p>
Practical limit for the number of databases in SQL Server? <p>In one of the stackoverflow podcasts (#18 I think) Jeff and Joel were talking about multi vs single tenant databases. Joel mentioned that "FogBugz on Demand" used a database per customer architecture and I was wondering if there is a point beyond which you'l...
<p>Technically the limit of databases per instance in SQL Server is 32,767, but I doubt that you could use a SQL Server instance that has more than 2,000 databases, at that point the server would probably be not responsive.</p> <p>You may be able to have close to 30,000 databases if they were all auto-closed and not b...
As a C# developer who wants to do some PHP work, what [book/online articles] should I [buy/read] to introduce myself to PHP? <p>I've got the bare minimum to handle the Linux/MySQL parts of the stack, but I want to have a basic grasp of PHP before I dive in. I'll be working on WordPress plugins, in case there's anythin...
<p>I would recomment the <a href="http://www.php.net/manual/en/">PHP manual</a> too!</p>
What is the proper way to maintain state in a custom server control? <p>This works, but is it the proper way to do it???</p> <p>I have a custom server control that has an [input] box on it. I want it to kinda mimic the ASP.NET TextBox, but not completely. When the textbox is rendered i have a javascript that allows ...
<p>I find using IStateManager works the best. </p> <p>For example:</p> <pre><code>partial class MyControl : System.Web.UI.UserControl, IStateManager { [Serializable()] protected struct MyControlState { public bool someValue; public string name; } protected MyControlState state; ...
Does anyone know the language used to code Orkut? <p>For sure this question will not help anyone in a heavy way, but it can be useful somehow. In the beginning, all <strong>Orkut</strong> pages had the extension <code>*.aspx</code>, but now all pages are <strong>masqueraded</strong> under a <code>Main#page.aspx</code>....
<p>browsing around, it seems like a lot of the stuff ends up as <a href="http://help.orkut.com/support/bin/answer.py?answer=30993&amp;src=top5" rel="nofollow">.py</a> (python) files. From what I remember, Orkut was created, and then bought out by Google, so they may be in the process of switching it over to python, w...
Tibco & Windows Process Activation <p>I'm thinking about how I could scale out Tibco EMS queue listeners written in managed code (C# in this instance). I'm looking for predominantly isolation and clustering characteristics.</p> <p>In MSMQ I could use Windows Process Activation Service to host and manage the number and...
<p>If I understand your question correctly, then the TIBCO equivalent is <a href="http://www.tibco.com/products/soa/composite-applications/activematrix-service-grid/default.jsp" rel="nofollow">TIBCO ActiveMatrix Service Grid</a>. It supports C# service containers and can host and manage your C# listeners.</p> <p>Coupl...
Word macro error messages <p>I am changing document template macros. The one thing I can't find out how to do is to customize error messages. For example an error message in a document is</p> <p>"Error! No table of figures entries found"</p> <p>I would like to change this to display something else. Is it possible to ...
<blockquote> <p>Is it possible to put this in some kind of global error handler? – Craig</p> </blockquote> <p>It is possible. Here is a very rough example.</p> <p>In a standard module:</p> <pre><code>Sub HandleErr(ErrNo As Long) Select Case ErrNo Case vbObjectError + 1024 MsgBox "No table of fi...
How to share custom data between iPhone applications? <p>If I make two iPhone applications, how can/should I share custom data (not contacts and stuff like that) among them?</p> <p>Thanks!</p>
<p>There are two different ways you might go about this.</p> <p>1) The data you need to share is non-persistent. In other words you need to launch one application with a piece of data that it can do something with. In this case you would register a special URL scheme per application.</p> <p>You can find out more info...
Is there a webservice available for checking a person's credit score? <p>I'm developing an application that should automatically check a person's credit score and present him different payment options based on that score.</p> <p>The closest I could find is <a href="http://www.google.com/url?sa=t&amp;source=web&amp;ct=...
<p>Here is a list of <a href="http://www.calyxsoftware.com/connections/services/list.asp?Cat=7" rel="nofollow">credit vendors</a> you can check if they service your industry. The vendor that you choose should provide an integration guide for you.</p>
How do I add a new replicated table to a SQL Server 2005 DB that is in merge replication? <p>We have merge replication set up over a distributed environment (50 to 1500km between offices) for a SQL Server 2005 database of about 350Gb. We now need to add a couple of new tables that must also be in replication, but with...
<p>sp_addmergearticle - Adds an article to an existing merge publication. This stored procedure is executed at the Publisher on the publication database.</p> <p><a href="http://msdn.microsoft.com/en-us/library/ms174329.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms174329.aspx</a> </p>
Record level permissions <p><p>In a database I am designing I have implemented profile based object level security. <p>Each user can view, edit, insert, update database tables according to the profiles (roles) he is a member of. <p>Now there is a need to implement "External Users" who can view only the relevant records...
<p>You should probably create a VIEW which limits the records and then apply the proper rights on the view. </p>
ASP.NET MVC ready for business applications (integrating 3rd party controls/components)? <p>My company has developed (and still continues to develope) a large ASP.NET business application. Our platform is ASP.NET 2.0 using some ASP.NET Ajax. We're <strong>extensively using third-party components</strong>, like webgrids...
<p>If they use the ASP.NET Control Model (That will be about 99,9% of controls written by ASP.NET Control vendors), they have to rewrite their controls. How much work there is in that, is very different depending of there arhitecture of their controls - the more ajax they already use, the more posible it is that they e...
What are TIOCM_OUT1 and TIOCM_OUT2 good for? <p><code>termios.h</code> defines:</p> <pre><code>#define TIOCM_OUT1 0x2000 #define TIOCM_OUT2 0x4000 </code></pre> <p>But what are the flags good for?</p>
<pre><code>TIOCM_OUT1 = Unassigned Programmable Output #1 TIOCM_OUT2 = Unassigned Programmable Output #2 </code></pre> <p>It looks like they can be used to set the <code>OUT1</code> and <code>OUT2</code> bits in the MCR.<br> But what are the Unassigned Programmable Outputs good for?<br> My best understanding is they a...
Private function in Fortran <p>How do I declare a private function in Fortran?</p>
<p>This will only work with a Fortran 90 module. In your module declaration, you can specify the access limits for a list of variables and routines using the "public" and "private" keywords. I usually find it helpful to use the private keyword by itself initially, which specifies that everything within the module is ...
Reducing coding standards 'brainwashing' duration and effort of new hires <p>At my current job we're pretty strict about code quality and coding standards. All new hires go through a 'brainwashing' period in which time senior developers coach them to write (hopefully) better code.</p> <p>The code review process is met...
<p>Spend some time writing an application that demonstrates all of your principles of optimal code. The source of this can be turned into a handbook on "What to aim for". People do much better at achieving a goal with concrete aims rather than continually being penalised by striking "anti-goals". Also it takes less tim...
What are the benefits of MS Word content controls? <p>Office 2007 brings a new goodie called as 'content controls'. I need to evaluate this to see if this serves as a solution for a problem under research.</p> <p>Due to paucity of time and my general disdain for Office-interop-pains, </p> <ul> <li>can someone summari...
<p>Well after 2 days of research, here's what I found.</p> <p>Content Controls are the next step in evolution from the old bookmarks..</p> <ol> <li><strong>Protection</strong> - you can protect content-controls in your document such that the user cannot edit them. e.g. the terms of the contract may not be editable li...
What code highlighting libs are there for Ruby? <p>What'd also interest me is which have more or less dependencies.</p>
<p>I'm using <a href="http://coderay.rubychan.de/" rel="nofollow">Coderay</a> (<a href="http://blog.logeek.fr/2008/3/31/data-visualization-with-ruby-and-rmagick-where-are-those-bikes" rel="nofollow">see it in action at the bottom of this article</a>)</p> <p>Not sure how many (if any) dependencies it has.</p>
Standard File Naming Conventions in Ruby <p>For a file containing the given class, SomeCoolClass, what would be the proper or standard filename?</p> <pre> 1. somecoolclass.rb 2. some_cool_class.rb 3. some-cool-class.rb 4. SomeCoolClass.rb </pre> <p>or some other variation?</p> <p>I noticed in the Ruby stdlib, ve...
<p>With just <a href="http://www.ruby-lang.org">Ruby</a> (i.e. not Rails), naming is only a convention. In <a href="http://rubyonrails.org">Rails</a> the <a href="http://itsignals.cascadia.com.au/?p=7">convention</a> of using underscores is necessary (almost).</p> <p>I think convention #2 <code>lowercase_and_undersc...
Easy way to flatten XML file with LINQ <p>Is there an easy way with LINQ to flatten an XML file?</p> <p>I can see a number of ways with XSLT but wondered what the best option with LINQ would be?</p> <p>I cant put the xml structure up exactly as stackoverflow seems to filter chevron chars. But its something like this ...
<p>OK; it depends on the output you want - with XElement you'd need to do a bit of work to remove all the descendent nodes etc. However, it is actually quite simple with XmlDocument:</p> <pre class="lang-cs prettyprint-override"><code>string xml = @"&lt;xml&gt;&lt;nodeA&gt;&lt;nodeA1/&gt;&lt;nodeA2/&gt;&lt;/nodeA&gt;&...
remotely and programatically logoff an active domain user <p>I need to be able to logoff any user from his windows session from a program. </p> <p>I know I could log in as an admin and force a remote logoff. Is there any other way to force a logoff without logging in? </p> <p>The tool will run as admin so that's not ...
<p>Perhaps with Sysinternals' <a href="http://technet.microsoft.com/en-us/sysinternals/bb896649.aspx" rel="nofollow" title="PsTools">PsTools</a>, particularly <a href="http://technet.microsoft.com/en-us/sysinternals/bb897541.aspx" rel="nofollow" title="PsShutdown">PsShutdown</a>?</p>
Raise CellValueChanged from a custom editing control in a DataGridView <p>I have a DataGridView (WinForms) in which I have defined a custom EditingControl derived from DataGridViewTextBoxEditingControl that only allows numeric characters.</p> <p>I need to raise CellValueChanged event on the DataGridView each time the ...
<p>What is the goal here? It appears you are attempting to create a keyboard mask, where any non confirming character raises an alert? If so, you may find happiness in the DataGridView by adding a MaskedTextBoxColumn. A MaskedTextBoxColumn controls the input in a much more reasonable way than forcing edit commits. </p>...
Why ^*$ matches "127.0.0.1" <p>I don't understand, why does the following regular expression:</p> <pre><code>^*$ </code></pre> <p>Match the string "127.0.0.1"? Using <code>Regex.IsMatch("127.0.0.1", "^*$");</code></p> <p>Using Expresso, it does not match, which is also what I would expect. Using the expression <code...
<p>Well, theoretically you are right, it should not match. But this depends on how the implementation works internally. Most regex impl. will take your regex and strip ^ from the front (taking note that it must match from start of the string) and strip $ from the end (noting that it must to the end of the string), what...
C# Generics/Design Patterns: Should I use the template method? <p><strong>Scenario:</strong></p> <p>(If anyone has answered/viewed my questions recently this will be somewhat familar)</p> <p>I have 3 different web services which expose a set of objects that have commonality. I've written wrapper classes and conversio...
<p>I think in general, if you want your code to have different type signatures, you'll have to write the code three different times. Since the types are different, it's not "the same code" at all.</p> <p>You could put what you have into an inherited method and then wrap the results in each subclass.</p>
What code highlighting libs are there for Java? <p>I'd like them to be easy to bundle, with few dependencies and easy to use.</p>
<p>Do you want to highlight Java code or use a Java lib to highlight some other code?</p> <p>I use these two: <a href="https://jhighlight.dev.java.net/">https://jhighlight.dev.java.net/</a> (server-side) for xml and <a href="http://code.google.com/p/syntaxhighlighter/">http://code.google.com/p/syntaxhighlighter/</a> (...
Best ways to deal with UTC and daylight saving times <p>What are the best ways of dealing with UTC Conversion and daylight saving times conversion. What are the problems and their solutions. All in C# .Net 2.0. Also any existing problems with this in .Net 2.0.</p>
<p>If you use UTC times you shouldn't worry about clients timezones or daylight saving... (if they have set a standard)</p>
Are there any good Javascript graphics libraries? <p>After staring at <a href="http://maettig.com/code/javascript/3d_dots.html">this 3D cube</a> and <a href="http://www.uselesspickles.com/triangles/demo.html">these triangles</a> for a while I started wondering if there's any good reliable Javascript graphics library wi...
<p>John Resig's port of the Processing library to Javascript:</p> <p><a href="http://ejohn.org/blog/processingjs">http://ejohn.org/blog/processingjs</a></p>
Bat file to run a .exe at the command prompt <p>I want to create a .bat file so I can just click on it so it can run:</p> <pre><code>svcutil.exe /language:cs /out:generatedProxy.cs /config:app.config http://localhost:8000/ServiceModelSamples/service </code></pre> <p>Can someone help me with the structure of the .bat ...
<p>To start a program and then close command prompt without waiting for program to exit:</p> <pre><code>start /d "path" file.exe </code></pre>
MSBuild, example that filters entire solution of .cs files <p>I want to learn MSBuild, was wondering if someone could get me started with a simple build script to filter out my vs.net 2008 project of all files with the .cs extension.</p> <ol> <li>how do I run the build?</li> <li>where do you usually store the build al...
<p>You typically run an MSBuild script from the command line using the following syntax:</p> <pre><code>MSBuild &lt;scriptfilename&gt; /t:targetname </code></pre> <p>You can get more information here: <a href="http://msdn.microsoft.com/en-us/library/0k6kkbsd.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/librar...
Set BufferedImage alpha mask in Java <p>I have two BufferedImages I loaded in from pngs. The first contains an image, the second an alpha mask for the image.</p> <p>I want to create a combined image from the two, by applying the alpha mask. My google-fu fails me.</p> <p>I know how to load/save the images, I just need...
<p>I'm too late with this answer, but maybe it is of use for someone anyway. This is a simpler and more efficient version of Michael Myers' method:</p> <pre><code>public void applyGrayscaleMaskToAlpha(BufferedImage image, BufferedImage mask) { int width = image.getWidth(); int height = image.getHeight(); ...
How can I stop ASP.NET Menu controls from generating inline html style elements <p>I have a master page that contains an ASP.NET server side Menu control (System.Web.UI.WebControls.Menu)</p> <p>I <em>am</em> using the CSSFriendly adapters from here</p> <p><a href="http://www.asp.net/CSSAdapters/Menu.aspx">http://www....
<p>In .NET Framework 4, ASP.NET menu has a new property, <code>IncludeStyleBlock</code>, that you can set to false to avoid generation of <code>&lt;style&gt;</code> block. However, it still generates a <code>style="float:left"</code> attribute that can only be overridden with a <code>float: none !important</code> in yo...
Operations on arbitrary value types <p>This <a href="http://themechanicalbride.blogspot.com/2008/04/using-operators-with-generics.html" rel="nofollow">article</a> describes a way, in C#, to allow the addition of arbitrary value types which have a + operator defined for them. In essence it allows the following code:</p>...
<p>Due to the way templates are compiled in C++, simply doing:</p> <pre><code>template &lt; class T &gt; T add(T const &amp; val1, T const &amp; val2) { return val1 + val2; } </code></pre> <p>will work, you'll get a compile error for every type where an operator+ is not defined.</p> <p>C++ templates generate cod...
How do I create 7-Zip archives with .NET? <p>How can I create 7-Zip archives from my C# console application? I need to be able to extract the archives using the regular, widely available <a href="http://www.7-zip.org/">7-Zip</a> program.</p> <p><hr /></p> <h2>Here are my results with the examples provided as answers ...
<p><a href="http://www.eggheadcafe.com/tutorials/aspnet/064b41e4-60bc-4d35-9136-368603bcc27a/7zip-lzma-inmemory-com.aspx">EggCafe 7Zip cookie example</a> This is an example (zipping cookie) with the DLL of 7Zip.</p> <p><a href="http://www.codeplex.com/7zsharp">CodePlex Warper</a> This is an open source project that wa...
ASP.NET Tab Controls <p>I'm currently attempting to create a tabbed interface in a web application, and based on my search, there aren't any 'built in' tab controls in ASP.NET. There are some in the <a href="http://www.asp.net/ajax/" rel="nofollow">ASP.NET AJAX</a> downloadable toolkit, as well as a wealth of 'pay for...
<p>You can use MultiView/Views and your own navigation to get tabs in ASP.NET. </p>
How to speed up WPF programs? <p>I love programming with and for Windows Presentation Framework. Mostly I write browser-like apps using WPF and XAML.</p> <p>But what really annoys me is the slowness of WPF. A simple page with only a few controls loads fast enough, but as soon as a page is a teeny weeny bit more comple...
<ol> <li><p><strong>How do you speed up WPF?</strong><br /><br> Often after using one of the following profiling tools it is obvious what is causing my bottlenecks.</p> <ul> <li>If memory is the issue then I virtualize my data.</li> <li>If render time is the issue then I virtualize the controls or simplify control tem...
How do I force a rollover at application startup with Log4net RolloverFileAppender? <p>Have Log4Net configured in our application to use a date stamped name and a 10Meg file size limit.<br /> This automatically causes a rollover to a new file at midnight and whenever the 10Meg limit is reached. I would also like to rol...
<p>Set <a href="http://logging.apache.org/log4net/release/sdk/log4net.Appender.FileAppender.AppendToFile.html" rel="nofollow">appendToFile</a> to false in your config file.</p> <pre><code>&lt;appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"&gt; .... &lt;appendToFile value="false" /&...
In PHP, how can I correct missing keys in an array? <p>After using <a href="http://us.php.net/array_unique"><code>array_unique</code></a>, an array without the duplicate values is removed. However, it appears that the keys are also removed, which leaves gaps in an array with numerical indexes (although is fine for an a...
<p><code>$foo = array_values($foo);</code> will re-number an array for you</p>
IIS 7.0 Multiple Domain Site Bindings <p>I've got three web sites each with its own domain going to my one Windows Server 2008 IIS 7.0 web server.</p> <ul> <li><code>example1.com</code></li> <li><code>example2.com</code></li> <li><code>example3.com</code></li> </ul> <p>The site bindings for each:</p> <p><img src="ht...
<p>I would validate that you have example3.com pointing to the proper location on disk. Also ensure that it is not stopped.</p> <p>The fallback to example1 is due to the binding entry with no header value.</p>
Asp.Net MVC Beta: Previous RouteData overrides current RouteData? <p>I have something similar to the following method: </p> <pre><code> public ActionResult Details(int id) { var viewData = new DetailsViewData { Booth = BoothRepository.Find(id), Category = ItemType.HotBuy ...
<p>It's hard for me to tell what you expect to happen and what is happening from your post. Is it possible there's an error in your BoothRepository.Find method such that it returns the same thing every time?</p> <p>ModelBinder should not be affecting this method because the parameter to the action method is a simple t...
Option Strict On and .NET for VB6 programmers <p>I'm preparing a class on Visual Basic 2005 targeting Visual Basic 6 programmers migrating to the .NET platform.<br /><br/> I would like a word of advice about whether to recommend them to always enable <strong>Option Strict</strong> or not.<br /><br/> I've worked exclusi...
<p>Yes! Option Strict is definitely a best practice with .Net. Emphasize that .Net is at it's core a strongly typed platform, and will be until the DLR is more completely supported. With few exceptions, every <code>Dim</code> and <code>Function</code> should have an explicit type declared to go with it. Things like...
How should I manage developing on SQL Server 2008 and SQL Server 2005 for different clients? <p>The company I work for has several clients. I'm currently splitting my time between 2 .net projects. For Client A I need Visual Studio 2008, SQL Server 2008 and the 3.5 framework. For Client B 2005 versions/2.0 Framework.</...
<p>I personally have both installed on the same system and use the proper tool for each project</p> <p>VS 2005/SQL Server 2005</p> <p>VS 2008/SQL Server 2008</p> <p>I find that it works jsut fine, and I don't have the hassle of switching VM's.. I see the VM as just added overhead.</p>
How to script Visual Studio 2008 from Python? <p>I'd like to write Python scripts that drive Visual Studio 2008 and Visual C++ 2008. All the examples I've found so far use <code>win32com.client.Dispatch</code>. This works fine for Excel 2007 and Word 2007 but fails for Visual Studio 2008:</p> <pre><code>import win32...
<p>Depending on what exactly you're trying to do, <a href="http://www.autoitscript.com/autoit3/index.shtml" rel="nofollow">AutoIt</a> may meet your needs. In fact, I'm sure it will do anything you need it to do.</p> <p>Taken from my <a href="http://stackoverflow.com/questions/151846/get-other-running-processes-window...
Effective copying multiple files <p>I have to copy quite a lot of files from one folder to another. Currently I am doing it in this way:</p> <pre><code>string[] files = Directory.GetFiles(rootFolder, "*.xml"); foreach (string file in files) { string otherFile = Path.Combine(otherFolder, Path.GetFileName(file)); ...
<p>I can't think of a more efficient way than File.Copy, it goes directly to the OS. </p> <p>On the other hand if it takes that long, I would strongly suggest to show a progress dialog - like <a href="http://msdn.microsoft.com/en-us/library/bb762164(VS.85).aspx">SHFileOperation</a> does it for you. At least your users...
How to check for optional fields in $_POST <p>At the moment my code looks like this:</p> <pre><code># Assign values for saving to the db $data = array( 'table_of_contents' =&gt; $_POST['table_of_contents'], 'length' =&gt; $_POST['length'] ); # Check for fields that may not be set if ( isset($_POST['lossless_c...
<p>How about this:</p> <pre><code>// this is an array of default values for the fields that could be in the POST $defaultValues = array( 'table_of_contents' =&gt; '', 'length' =&gt; 25, 'lossless_copy' =&gt; false, ); $data = array_merge($defaultValues, $_POST); // $data is now the post with all the keys s...
Should I use multi-byte overloading (mbstring.func_overload)? <p>I'm in the process of making my PHP site Unicode-aware. I'm wondering if anyone has experience with the <code>mbstring.func_overload</code> setting, which replaces the normal string functions (e.g. <code>strlen</code>) with their multi-byte equivalents (<...
<p>My answer is: <em>definitely not</em>!</p> <p>The problem is that there is no easy way to "reset" str* functions once they are overloaded. </p> <p>For some time this can work well with your project, but almost surely you will run into an external library that uses string functions to, for example, implement a bina...
ASP.NET PasswordRecovery Control with Localized content <p>I am working on a simple portal application using the ASP.NET membership and login controls. I would like to use the PasswordRecovery control to send emails containing forgotten passwords, however my portal requires localization. I have an existing Content Mana...
<p>Try handling the SendingMail event of the PasswordRecovery control. In that event, set the e.Message.Body and e.Message.Subject properties to your localized text.</p>
How to get the new value of an HTML input after a keypress has modified it? <p>I have an HTML input box</p> <pre><code>&lt;input type="text" id="foo" value="bar"&gt; </code></pre> <p>I've attached a handler for the '<em>keyup</em>' event, but if I retrieve the current value of the input box during the event handler, ...
<p>can you post your code? i'm not finding an issue with this. tested on firefox 3.01/safari 3.1.2 with:</p> <pre><code>function showMe(e) { // i am spammy! alert(e.value); } .... &lt;input type="text" id="foo" value="bar" onkeyup="showMe(this)" /&gt; </code></pre>
Insert cell comments in excel programmaticaly <p>What's the better way to insert cell comments in excel 2007 files programmaticaly using c# and .net 3.5?</p>
<p>I just did exactly that but with MS Word (using Microsoft.Office.Interop.Word</p> <p>range.Comments.Add ( range, ref _categoryMessage );</p> <p>So, I would suggest using Microsoft.Office.Interop.Excel and the similar method. Consider this from MSDN:</p> <p><a href="http://msdn.microsoft.com/es-es/library/microsof...
Class will compile for Tests/Console but not in Asp.net application <p>I have a simple interface:</p> <pre><code>public interface IVisitorsLogController { List&lt;VisitorsLog&gt; GetVisitorsLog(); int GetUniqueSubscribersCount(); int GetVisitorsCount(); string GetVisitorsSummary(); } </code></pre> <...
<p>Out of interest, can you compile the following line:</p> <pre><code>ctl = VisitorsLogController.Instance; </code></pre> <p>? I'm just wondering if somehow you've got two interfaces named the same thing.</p> <p>What does Intellisense prompt you with when you type <code>ctl.</code> and press Ctrl-Space?</p>
Corel draw 13 mysql query <p>Is there a way to do a mysql database query in Corel Draw 13(X3)? </p>
<p>If I recall correctly, CorelDraw uses VBA as scripting language, no?</p> <p>If so, if it is not restricted, you can probably use ODBC to do that. See <a href="http://dev.mysql.com/doc/refman/5.0/en/connector-odbc.html" rel="nofollow" title="MySQL Connector/ODBC">MySQL Connector/ODBC</a> for details.</p>
Want to host WCF Webservice as Windows Service as against to Hosting in IIS <p>I want to expose few web services but thinking of hosting those as Windows Service as against hosting in IIS.</p> <p>Is it a good practice? </p> <p>If yes? How do I make it secured? </p> <p>I want to authenticate the users who are accessi...
<p>You might want to read <a href="http://msdn.microsoft.com/en-us/library/bb332338.aspx" rel="nofollow">this Microsoft article</a> , which clearly points Pros/cons of each hosting method, including: Console/WinForms App, IIS 6 and 7 (there are differences) and Windows Services. </p>
How Do You Get the Height of the Titlebar Using Java (Swing)? <p>I am getting a <code>MouseEvent</code> in Java. the <code>getPoint()</code> method is adding the height of the title bar into the y portion of the coordinate.</p> <p>I was wondering how I can find the height of the title bar of the current window in ord...
<p>You can find the frame insets by calling the getInsets method (defined in Container). Frame insets are discussed at the top of the Frame API docs. <a href="http://stackoverflow.com/questions/193457/getting-drawable-area-of-an-awt-frame-in-mac-os-x">See this question.</a></p> <p>Of course you could always add your m...
Scalability on the web <p>I've been arguing with some friends on the university, and we can't get to a point to which is the framework with more scalability for web applications (and still very fast).</p> <p>One calls for jsp, the other one for ruby other for php and so on. Could i ask you to clarify us on what as mor...
<p>Ruby and PHP are not webapp frameworks. They are programming languages which are popular for web development.</p> <p>Generally speaking, webapp scalability is not a property of a programming language, and a given webapp framework may at most <em>not hamper</em> scalability. Good scalability is more a property of ap...
What methods do wikis use for merging concurrent edits? <p>If two users edit the same wiki topic, what methods have been used in wikis (or in similar collaborative editing software) to merge the second user's edits with the first?</p> <p>I'd like a solution that:</p> <ul> <li>doesn't require locking</li> <li>doesn't ...
<p><a href="http://twiki.org" rel="nofollow">TWiki</a> automatically merges <a href="http://twiki.org/cgi-bin/view/TWiki.SimultaneousEdits" rel="nofollow">Simultaneous Edits</a>.</p> <blockquote> <p>TWiki allows multiple simultaneous edits of the same topic, and then merges the different changes automatically. You p...
Database of Software <p>I'm looking for a database of commonly installed Windows software. At minimum I need the name of the software and the executable name, but it'd also be nice to have the publisher and the common installation path, etc. Basically, I'd like to be able to query it to find all the software by Adobe a...
<p>Your best bet would be to <a href="http://www.developer.com/net/asp/article.php/3079381">query</a> amazon.com, since they sell lots of software and provide public interfaces to access their database.</p>