input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
Which Facebook .NET Library is the best to use? <p>There is a list of projects <a href="http://www.marketing-ninja.com/old-stuff/list-of-facebook-sdks-for-net/">here</a>, mainly the <a href="http://www.codeplex.com/FacebookToolkit">Facebook Developer Toolkit</a> and <a href="http://www.nikhilk.net/FacebookNET.aspx">Fac... | <p>I also started experimenting with Facebook Developer Toolkit (FDT) but dropped it for Facebook.NET. There is a fork of the latter at <a href="http://www.codeplex.com/fbnet" rel="nofollow">http://www.codeplex.com/fbnet</a> which slowly covers recent changes in Facebook API. Have a look at this post since it has some ... |
Recommended spec for a build server <p>We're using CruiseControl.NET to manage our builds and we're in the process of obtaining a new build server. I've been tasked with coming up with the spec for the new server.</p>
<p>This server will need to run multiple builds concurrently and as effeciently as possible.</p>
<p>... | <p>Make sure the spec includes a multi-core processor, and fast HDDs (10000RPM). </p>
|
Error with C# Partial classes <p>I am using partial classes to split some functionality between 2 files, but I am getting an error. What am I doing wrong?</p>
<p>A1.cs:</p>
<pre><code>private partial class A
{
private string SomeProperty { get { return "SomeGeneratedString"; } }
}
</code></pre>
<p>A2.cs:... | <p>Are the two partial classes in the same namespace? That could be an explanation.</p>
|
C++ testing framework: recommendation sought <p>I'm looking for a "quick and dirty" C++ testing framework I can use on my Windows/Visual Studio box. It's just me developing, so it doesn't have to be enterprise class software.
Staring at a list of testing frameworks, I am somewhat befuddled...</p>
<p><a href="http://e... | <p>I have used both <a href="http://unittest-cpp.sourceforge.net/">UnitTest++</a> and <a href="http://www.boost.org/doc/libs/1_36_0/libs/test/doc/html/index.html">Boost.Test</a>. They are both easy to setup and use.
Although, I wouldn't use Boost.Test if you're not already using the Boost libraries. It's a bit much to ... |
What is the general complexity of building a canonical language representation? <p>It is often handy to have a canonical representation of a language (in my case they are usually domain specific languages); however, I believe there are strict limits on the expressiveness of the languages involved that determine whether... | <p>By "canonical representation" I assume you mean the following: Call programs <em>P</em> and <em>Q</em> <em>equivalent</em> if they "do the same thing" on the same inputs. "Doing the same thing" means that the programs have the same output, and either both programs halt after a finite time or both enter an infinite l... |
SQL Date Range Split <p>Can you please let me know the SQL to split date ranges when they overlap?</p>
<p>Data (sample data with a date range and possibly other columns):</p>
<pre><code> Col1 FromDate ToDate
1. 1 1/1/2008 31/12/2010
2. 1 1/1/2009 31/12/2012
3. 1 1/1/2009 31/12/2014
</code></pre>
<p>Ou... | <p>This should do the trick (MySQL dialect, but easily adaptable)</p>
<p>Initial setup</p>
<pre><code>SQL query: SELECT * FROM `test` LIMIT 0, 30 ;
Rows: 3
start end
2008-01-01 2010-12-31
2009-01-01 2012-12-31
2009-01-01 2014-12-31
</code></pre>
<p>Query</p>
<pre><code>SELECT
`start` , min( `end` )
FROM... |
Navigation on validation failure in Seam/JSF <p>I've been playing with <a href="http://www.seamframework.org/" rel="nofollow">Seam</a> (2.0.2.SP1) for a few weeks, and I have most of the basics nailed down, but I haven't come up with a decent solution to the following.</p>
<p>Suppose I have a form at <code>/foo.xhtml<... | <p>You would normally redisplay the same view on a validation failure, rather than redirect. Assuming that you are using UrlRewrite for the rewrite rules, perhaps you can use an <em>outbound-rule</em> so that the <em>/foo/{fooId}</em> URL is still shown in this case.</p>
|
CSS and lack of constants/variables issue? <p>Given a stylesheet with a fully qualified reference to an image resource on another server, is there a good way to handle promotions through different environments that require a different base URL?</p>
<blockquote>
<p>background-image: url
(evironmentSpecificURL/resou... | <p>The resources that you reference should really be at a relative level to your css file, that way its just a "..\resourceName.foo" away from working.</p>
<p>Of cource you could also look into build tools that auto-generate the environment specific areas of your site, so all properties such as css file, .properties f... |
What are some best practices for handling sensitive information? <p>I'm currently creating an application for a customer that will allow them to automatically bill their customers credit cards. </p>
<p>I'm curious as to what are some <strong>best practices</strong> to safely store and access the credit card informati... | <p>Read the <a href="http://pcistandard.com/requirements.html" rel="nofollow">PCI requirements</a>. Everything will be there.</p>
<p>Actually, you <em>must</em> follow them.</p>
|
Uninitialized string offset error from PHP import script <p>I have an import-from-excel script as part of a CMS that previously ran without issue.</p>
<p>My shared-hosting provider has recently upgraded their infrastructure, including PHP from 5.1 to 5.2.6, and the script now returns "Uninitialized string offset: -XXX... | <p>Solved here:
<a href="http://www.phpbuilder.com/board/archive/index.php/t-10328608.html" rel="nofollow">http://www.phpbuilder.com/board/archive/index.php/t-10328608.html</a></p>
|
Issues with client consuming a .net web service upgraded from .NET 1.1 to 3.5 <p>I am working on a web application that was recently converted from Visual Studio 2003 to Visual Studio 2008. The application contained some web services that were written using the .NET 1.1 Framework and Web Service Enhancements 2.0. The... | <p>If you go directly to the asmx url with a web browser, and then click on the method you want to call, what's the SOAPAction that they want?</p>
<p>next, check the Reference.vb code and see what the SoapDocumentMethodAttribute attribute is set to.</p>
<p>Do they match?</p>
|
How can I concatenate regex literals in JavaScript? <p>Is it possible to do something like this?</p>
<pre><code>var pattern = /some regex segment/ + /* comment here */
/another segment/;
</code></pre>
<p>Or do I have to use new <code>RegExp()</code> syntax and concatenate a string? I'd prefer to use the literal a... | <p>Here is how to create a regular expression without using the regular expression literal syntax. This lets you do arbitary string manipulation before it becomes a regular expression object:</p>
<pre><code>var segment_part = "some bit of the regexp";
var pattern = new RegExp("some regex segment" + /*comment here */
... |
Convert Month Number to Month Name Function in SQL <p>I have months stored in SQL Server as 1,2,3,4,...12. I would like to display them as January,February etc. Is there a function in SQL Server like MonthName(1) = January? I am trying to avoid a CASE statement, if possible.</p>
| <p>I think this is the best way to get the <strong>month name</strong> when you have the <strong>month number</strong></p>
<pre><code>Select DateName( month , DateAdd( month , @MonthNumber , 0 ) - 1 )
</code></pre>
<p><strong>[EDIT]</strong></p>
<p>As Asif said below, another way of doing this would be </p>
<pre><c... |
Javascript nested class <p>How do I define nested class in Java Script. </p>
<p>Here is the code snippet I have:</p>
<pre><code>objA = new TestA();
function TestB ()
{
this.testPrint = function ()
{
print ( " Inside testPrint " );
}
}
function TestA ()
{
var myObjB = new TestB();
}
</code></pre>
<p>... | <p>If you want the prototype definition of the inner nested classes to be not accessible from outside the outer class, as well as a cleaner OO implementation, take a look at this.</p>
<pre><code>var BobsGarage = BobsGarage || {}; // namespace
/**
* BobsGarage.Car
* @constructor
* @returns {BobsGarage.Car}
*/
Bobs... |
How to inflate a file with zlib.NET? <p>I'm using the <a href="http://www.componentace.com/zlib_.NET.htm" rel="nofollow">zlib.NET</a> library to try and inflate files that are compressed by zlib (on a Linux box, perhaps). Here's what I'm doing:</p>
<pre><code>zlib.ZInputStream zinput =
new zlib.ZInputStream(File.... | <p>It appears I made the mistake of assuming all virtual methods were overridden, which wasn't the case. I was using zlib.ZInputStream.ReadByte(), which is just the inherited Stream.ReadByte(), which doesn't do any inflate.</p>
<p>I used zlib.ZInputStream.Read() instead, and it worked like it should.</p>
|
Would you architect the control API of the next-gen Mars rover to be RESTful instead of an RPC? <p>Forgive me if this verges on being a "discussion" question, but I really would
appreciate a yes/no answer, with an appropriate explanation. </p>
<p>Suppose you have to design and implement a control API for a robot, sa... | <p>I think REST would make more sense than traditional RPC. Even the <a href="http://msdn.microsoft.com/en-us/library/bb466255.aspx">Micorosft Robotics Studio runtime application model</a> uses REST.</p>
<p>The robot can consist of different resources that are identified by URI, including one for each sensor and actua... |
Modifying NSDate to represent 1 month from today <p>I'm adding repeating events to a Cocoa app I'm working on. I have repeat every day and week fine because I can define these mathematically (3600*24*7 = 1 week). I use the following code to modify the date:</p>
<pre><code>[NSDate dateWithTimeIntervalSinceNow:(3600*24*... | <p>(Almost the same as <a href="http://stackoverflow.com/questions/181459/is-there-a-better-way-to-find-midnight-tomorrow/181495#181495">this question</a>.)</p>
<p>From the <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSCalendarDate_Class/Reference/Reference.html">documentation<... |
What's is a good ratio of Class to Lines of Code for Object-Oriented languages? <p>What's is a good ratio for the number Classes to Lines of Code for an Object-Oriented language (say C++,C#,Java and their likes)?</p>
<p>Many people, including managers, like the traditional LOC (lines of code) metric to measure the com... | <p>LOCs or NLOCs aren't really a good measure of quality or health of your code. I recommend using <a href="http://www.ndepend.com">NDepend</a>'s static code analysis (for you .net peeps) to see how well your solution is architected.</p>
<p>I find that LOCs is good measurement only at the method level. That is, I gene... |
How do I add to a list with Linq to SQL? <p>I have a table in the database that I'm retrieving using LINQ to SQL, and as a part of my processing I want to add to this list, then update the database with the new items + any changes I've made.</p>
<p>What I thought I could do was this:</p>
<pre><code>var list = (from i... | <p>The List is meaningless. It's just happens to hold objects that the DataContext knows about. We need to make sure that the DataContext knows about the new ones. The important thing is that they don't have to be complete when we alert the DataContext to them:</p>
<pre><code>Item item;
if (needNewOne)
{
item ... |
SQL 2005 Full-Text Catalog is randomly sloooowww <p>I've built a full-text catalog on a SQL 2005 box that, after it's re-build process completes, runs extremely slow. I've implemented a hack (i.e. try...catch{do again}) so that my users don't get a timeout error; this makes me feel bad inside. All subsequent queries ... | <p>It could also be caused by this Sql Server 'feature' which we've experienced.</p>
<p><strong>You may experience a 45-second delay when you run a full-text query in an instance of SQL Server 2005 that is running on a server without Internet access</strong> </p>
<p><a href="http://support.microsoft.com/default.aspx/... |
onClose Event in ASP.NET <p>Is there an event like onLoad? </p>
<p>just at closing the Site (onClose)?</p>
| <p>Not in the sense that I suspect you're thinking. All your code in ASP.net runs on the server which doesn't inherently "know" when the site is closed by the user. To achieve what you're after, you'd need to use Javascript to handle the window.onunload / window.onbeforeunload events and trigger some form of request to... |
PHP's file_get_contents not returning until remote servers' keep-alive limit is exceeded <p>From one apache server file_get_contents returns the contents of a url straight away. On another apache server file_get contents won't return the contents of the same url until the keep-alive limit of the server hosting that ur... | <p>Does using <code>fopen</code> manually work faster?</p>
<p>Rather than spending hours working out why <code>file_get_contents</code> doesn't work, you might be better-off swapping it out.</p>
<p>If <code>fopen</code> isn't any faster, there's probably a config or filesystem issue. If it is faster, it's likely a ph... |
Get Visual Studio to throw exceptions across threads <p>In my Silverlight project I have a thread that fires every x milliseconds. In this thread I was attempting to change the state of the application. This wasn't working and I didn't know why, so put a breakpoint in to the Timer callback. The breakpoint was hit, but ... | <p>Can you change the break handling for InvalidOperationException so it breaks immediately rather than only if it's unhandled?</p>
|
Create COM component and ActiveX controls <p>Is is possible to create COM component and ActiveX controls in .Net (using c# language). I searched internet but i could`t get anything.<br><br>
Thanks,<br>
santhosh</p>
| <p>Declare an interface and implement it with class.<br>
If you have parameters/return values that are not OLE Automation compatible (custom structs, enums and so on), you might need to decorate them with the <a href="http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshalasattribute.aspx">Marsha... |
Is it possible to specify proxy credentials in your web.config? <p>I need to configure a website to access a webservice on another machine, via a proxy. I can configure the website to use a proxy, but I can't find a way of specifying the credentials that the proxy requires, is that possible? Here is my current config... | <p>Yes, it is possible to specify your own credentials without modifying the current code. It requires a small piece of code from your part though.</p>
<p>Create an assembly called <em>SomeAssembly.dll</em> with this class :</p>
<pre><code>namespace SomeNameSpace
{
public class MyProxy : IWebProxy
{
p... |
Interesting UTF-8 Yahoo File Download Headers <p>My company runs a webmail service, and we were trying to diagnose a problem with Word downloads not opening automatically - the same *.doc file download from Yahoo Mail would open, but one from ours would not.</p>
<p>In the course of investigating the headers we saw thi... | <p>I think the correct answer to this is in rfc 2231:</p>
<p>Asterisks ("*") are reused to provide the indicator that language and
character set information is present and encoding is being used. A
single quote ("'") is used to delimit the character set and language
information at the beginning of the paramet... |
Tool for web server redirect management? <p>I'm considering rolling my own, but just in case there's a good piece of software already available, I'm asking here: Is there something that will provide an interface to webserver redirect configuration, and allow redirects to be managed by a fairly non-technical userbase. T... | <p>You could use either a <a href="http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritemap" rel="nofollow">RewriteMap</a> script/program, or a static map (whichever is easiest for you/your users).</p>
<p>Check <a href="http://rewrite.drbacchus.com/rewritewiki/RewriteMap" rel="nofollow">http://rewrite.drbacchu... |
What ReSharper 4+ live templates for C# do you use? <p>What ReSharper 4.0 templates for <strong>C#</strong> do you use?</p>
<p>Let's share these in the following format:</p>
<p><hr /></p>
<h2>[Title]</h2>
<p><em>Optional description</em> </p>
<p><strong>Shortcut:</strong> shortcut<br />
<strong>Available in:</str... | <h2>Simple Lambda</h2>
<p>So simple, so useful - a little lambda:</p>
<p><strong>Shortcut</strong>: x</p>
<p><strong>Available</strong>: C# where expression is allowed.</p>
<pre><code>x => x.$END$
</code></pre>
<p>Macros: none.</p>
|
Large File Download - Connection With Server Reset <p>I have an asp.net website that allows the user to download largish files - 30mb to about 60mb. Sometimes the download works fine but often it fails at some varying point before the download finishes with the message saying that the connection with the server was re... | <p>Will</p>
<pre><code><configuration>
<system.web>
<httpRuntime executionTimeout="3600"/>
</system.web>
</configuration>
</code></pre>
<p>help anything?</p>
<p>The inner loop that writes the data seems a bit convoluted, I would at least change it to:</p>
<pre><code>int length;... |
How do I return an exit code from a VBScript console application <p>I Have an old vbs script file being kicked off by an AutoSys job. Can I, and how do I, return an int return value to indicate success or failure?</p>
| <p>Try:</p>
<pre><code>WScript.Quit n
</code></pre>
<p>Where n is the ERRORLEVEL you want to return</p>
|
Implement validation as a method or as a property? <p>I have an object that needs a test if the object data is valid. The validation itself would be called from the thread that instatiated the object, it looks like this:</p>
<pre><code> {
if (_step.Equals(string.Empty)) return false;
if (_type.Equals(string.Empty)... | <p>My personal opinion here would be:</p>
<ul>
<li>If the "validate" method mutates the object in any way (which your example doesn't) then make it a method.</li>
<li>If the object remains un-changed after validation, make it a property.</li>
</ul>
|
Missing Workflow project templates in Visual Studio 2008 <p>I cannot add workflow item to my WPF project.</p>
<p>I create a new WPF project and want to add a sequential workflow. When I do "Add new item" there is no item template to select.</p>
<p>Any hints?</p>
| <p>I don't think you can simply add a workflow to a WPF project. You need to create a WF project and build your workflow in that, then reference the WF project. </p>
|
Agile/Scrum resource planning cross projects <p>We have different steps in our planning for online webprojects:</p>
<p>1) Information Architecture</p>
<ul>
<li>Provides user stories</li>
<li>Provides wireframes</li>
</ul>
<p>2) Design</p>
<ul>
<li>Use Wireframes to develop a nice design</li>
</ul>
<p>3) Developmen... | <p>The situation where an IA (or a UI designer or anyone else for that matter) could not be committed for the whole length of the project is quite common.</p>
<p>However with Agile the problem is easily resolved: commit a resource for the length of the iteration where he is needed. I.e. if you need an architect for a ... |
Why use Ruby instead of Smalltalk? <p>Ruby is becoming <a href="http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html" rel="nofollow">popular</a>, largely from the influence Ruby on Rails, but it feels like it is currently struggling through its adolescence. There are a lot of similarities between Ruby and S... | <p>I'm more of a Pythonista than a Ruby user, however the same things hold for Ruby for much the same reasons.</p>
<ul>
<li><p>The architecture of Smalltalk is somewhat insular whereas Python and Ruby were built from the ground up to facilitate integration. Smalltalk never really gained a body of hybrid application s... |
Preprocessing source code as a part of a maven build <p>I have a lot of Java source code that requires custom pre-processing. I'd like rid of it but that's not feasible right now so I'm stuck with it. Given that I have an unfortunate problem that shouldn't have existed in the first place, how do I solve it using maven?... | <p>This is something that is very doable and I've done something very similar in the past.</p>
<p>An example from a project of mine, where I used the antrun plug-in to execute an external program to process sources:</p>
<pre><code> <build>
<plugins>
<plugin>
<groupId>org.apache.ma... |
How to migrate a 3rd party web part from SharePoint 2 (2003) to SharePoint 3 (2007) <p>I am migrating a site from SharePoint 2 to 3 (in fact, from SharePoint Portal Server 2003 to Microsoft Office SharePoint Server 2007). There are a handful of 3rd party web parts and since this is a migration, not an in-place upgrade... | <p>You can still install .CAB files with WSSv3 using the same STSADM command as you used in WSSv2</p>
<pre><code>STSADM -o addwppack -filename <filename.CAB>
</code></pre>
<p>However, maybe you should get in touch with the providers of these 3rd party web parts? Perhaps they will have versions for WSSv3 package... |
Can a WinForms app be configured to run as "x86" without recompiling? <p>Can a WinForms app compiled for "Any CPU" be configured to run as "x86" on a 64-bit server without recompiling the app? Specifically, I'm looking for an app.config setting or Control Panel applet to accomplish this end. All the customer's clients ... | <p>From <a href="http://www.request-response.com/blog/PermaLink,guid,34966ef8-3142-46b2-84e0-372b5c36ddcc.aspx" rel="nofollow">http://www.request-response.com/blog/PermaLink,guid,34966ef8-3142-46b2-84e0-372b5c36ddcc.aspx</a></p>
<blockquote>
<p>You can, however, control and
override this default behaviour even
... |
Default parameters with C++ constructors <p>Is it good practice to have a class constructor that uses default parameters, or should I use separate overloaded constructors? For example:</p>
<pre><code>// Use this...
class foo
{
private:
std::string name_;
unsigned int age_;
public:
foo(const std::string&... | <p>Definitely a matter of style. I prefer constructors with default parameters, so long as the parameters make sense. Classes in the standard use them as well, which speaks in their favor.</p>
<p>One thing to watch out for is if you have defaults for all but one parameter, your class can be implicitly converted from... |
Copy tables from one database to another in SQL Server <p>I have a database called foo and a database called bar. I have a table in foo called tblFoobar that I want to move (data and all) to database bar from database foo. What is the SQL statement to do this?</p>
| <p>SQL Server Management Studio's "Import Data" task (right-click on the DB name, then tasks) will do most of this for you. Run it from the database you want to copy the data into.</p>
<p>If the tables don't exist it will create them for you, but you'll probably have to recreate any indexes and such. If the tables d... |
Relocate JSF-generated javascript <p>I am using lots of commandLinks in my app. For them to work, JSF generates some wild Javascript ( <code>function dpf(f) {var adp...</code> ). Sadly, the script-tag destroys my layout. (It really does - I am sure about that).</p>
<p>Is there a way to force JSF to generate the script... | <p>Maybe you can try to externalize your Javascript.
Instead of putting the Javascript code within your page, it will only include a script tag that points to a Javascript file.
To do that, modify your web.xml file to have that:</p>
<pre><code><context-param>
<param-name>com.sun.faces.externalizeJavaSc... |
Adding click event to button to fire javascript, through VB.NET <p>I have an ASP.NET page which pulls a set of images from a database table, and using an enumerator, goes through all of them and displays then.</p>
<p>This all happens in the codebehind (VB.NET), where the code adds the placeholder and some controls ins... | <p><code>cmdMyButton.attributes.add("onclick", "alert('hello');")</code> ?</p>
|
DBCC CHECKIDENT on a temporary table throwing permissions error for wrong user <p>I'm logged into a SQL Server 2005 database as a non-sa user, 'bhk', that is a member of the 'public' server role only. The following code tries to execute within a stored procedure called by user 'bhk'. This line of code...</p>
<pre><cod... | <p>Here is an alternate solution, that may work if you need to re-seed with a sequence number of more than 1.</p>
<pre><code>TRUNCATE #Table1
SET IDENTITY_INSERT #Table1 ON
INSERT INTO #Table1 (TableID) -- This is your primary key field
VALUES (@SequenceNumber - 1)
SET IDENTITY_INSERT #Table1 OFF
DELETE FROM #Tabl... |
Why does GCC-Windows depend on cygwin? <p>I'm not a C++ developer, but I've always been interested in compilers, and I'm interested in tinkering with some of the GCC stuff (particularly LLVM).</p>
<p>On Windows, GCC requires a POSIX-emulation layer (cygwin or MinGW) to run correctly.</p>
<p>Why is that?</p>
<p>I use... | <p>Actually, the question premise is wrong: <a href="http://www.mingw.org/">MinGW</a> GCC does <strong>NOT</strong> require Cygwin.</p>
<p>You will see you don't need Cygwin at all. It runs natively on Windows (32-bit, at least). Both the toolchain and the produced binaries are independent of Cygwin.</p>
<p>The MinGW... |
Mathematics and Game Programming <p>I want to program graphical 2D games more complex than the basic 2D stuff I already know. I don't want to do 3D programming. Just more complex 2D stuff. I dropped high school before I could learn a lot of stuff so I walked away with enough algebra knowledge to balance my checkbook an... | <p>You need to be competent in Trigonometry: <a href="http://en.wikipedia.org/wiki/Trigonometry">Wikipedia</a> and <a href="http://mathworld.wolfram.com/topics/Trigonometry.html">Mathworld</a></p>
<p>Even though you don't wish to do 3D programming, 2D games also use vectors and matrices. (from Linear Algebra)</p>
<p>... |
Can I specify my explicit type comparator inline? <p>So .NET 3.0/3.5 provides us with lots of new ways to query, sort, and manipulate data, thanks to all the neat functions supplied with LINQ. Sometimes, I need to compare user-defined types that don't have a built-in comparison operator. In many cases, the comparison... | <p>My <a href="http://pobox.com/~skeet/csharp/miscutil">MiscUtil</a> library contains a ProjectionComparer to build an IComparer<T> from a projection delegate. It would be the work of 10 minutes to make a ProjectionEqualityComparer to do the same thing.</p>
<p>EDIT: Here's the code for ProjectionEqualityComparer:</... |
How Do You Handle Validation In Silverlight? <p>How have you decided to handle data/control validation in your silverlight applications? </p>
| <p>You can throw and capture data validation exceptions.</p>
<p>To manage both of these types of errors need to take 3 steps:</p>
<ol>
<li>Identify the error handler either in the control or higher in the visiblity hierarchy (e.g., a container; in this case the grid that contains the text box)</li>
<li>Set NotifyOnVa... |
What's the best version control system for handling projects with graphics? <p>I'm part of a small team (usually just two people), I handle the code, he handles the graphic design. In the past I've used CVS to handle version control of the code files, and while we've included the graphics in the repository, he hasn't ... | <p>I would recommend Subversion with TortoiseSVN. It integrates into Windows Explorer and allows you to do everything you need from the context menu (update, commit, branch, merge... anything). It can handle all kinds of files, and best of all, both Subversion and TortoiseSVN are free (along with the other SVN tools).<... |
How do you execute a stored procedure using Castle ActiveRecord? <p>I believe there is a discussion on this very topic somewhere on the net but I lost the url and I am unable to find it via googling.</p>
<p>What I might try right now would be:</p>
<pre><code>ISessionFactoryHolder factoryHolder = ActiveRecordMediator&... | <p>This works for me (stored procedure with params and dynamic result table):</p>
<pre><code>// get Connection
System.Data.IDbConnection con = ActiveRecordMediator.GetSessionFactoryHolder()
.GetSessionFactory(typeof(Autocomplete))
... |
Expose Java class as SOAP WebService - how? <p>I am looking for a framework to turn given Java class into WebService (may be with some limitations on method parameters etc)</p>
<p>Thanks</p>
| <p>You can use <a href="http://ws.apache.org/axis2/" rel="nofollow">axis2</a>, or <a href="http://xfire.codehaus.org/" rel="nofollow">xfire</a>. I'm sure there are other ways also, but these are the two that I've used.</p>
|
How do I add an extra source directory that will be used by the maven-jxr-plugin? <p>I'm using the build-helper-maven-plugin to add it to my build, but I'd
like to see the XREF source for this extra source directory as well.</p>
<p>FYI:</p>
<p><a href="http://maven.apache.org/plugins/maven-jxr-plugin/index.html" rel=... | <p>You can tell JXR what files to index using a file pattern, following Ant guidelines. For example, to include all java files in src/main/java and all source in src/main/java2, the following configuration in your file should work:</p>
<pre><code><project>
...
<reporting>
<plugins>
...
... |
How to format a string as a telephone number in C# <p>I have a string "1112224444' it is a telephone number. I want to format as 111-222-4444 before I store it in a file. It is on a datarecord and I would prefer to be able to do this without assigning a new variable.</p>
<p>I was thinking:</p>
<pre><code>String.Forma... | <p>From a <a href="http://blog.stevex.net/index.php/string-formatting-in-csharp/">good page</a> full of examples:</p>
<pre><code>String.Format("{0:(###) ###-####}", 8005551212);
This will output "(800) 555-1212".
</code></pre>
<p>Although a regex may work even better, keep in mind the old programming quote:</p>
... |
Recommendations for converting raster images to vector graphics <p>If a person is looking to batch convert a large number of raster images into vector graphics, are there any tools out there that do that well?</p>
<p>For an example, think of just about any diagram that has standard shapes (ellipses, rectangles) and te... | <p><a href="http://www.inkscape.org/doc/tracing/tutorial-tracing.html">Inkscape uses</a> the Potrace engine to trace raster graphics. You usually have to play with it a bit to get useful output, but it does surprisingly well and is easy to use.</p>
|
Any way to transfer value from one cell to another? <p>Is there any way in the SQL language or in MySQL (or other DBMA) to transfer a value from one cell to another? For example, say there is a table called user_cars with the following structure:</p>
<pre><code>|id| |user_name| |num_cars|
</code></pre>
<p>Bob has 5 c... | <p>For Oracle you could do this. Don't know if there is an equivalent in mysql. Obviously this particular statement is very specific to the example you stated.</p>
<pre><code> UPDATE user_cars
SET num_cars = num_cars +
CASE WHEN user_name='Bob' THEN -2
WHEN user_name... |
How to launch multiple Internet Explorer windows/tabs from batch file? <p>I would like a batch file to launch two separate programs then have the command line window close. Actually, to clarify, I am launching Internet Explorer with two different URLs.</p>
<p>So far I have something like this:</p>
<pre><code>start "~... | <p>Try this in your batch file:</p>
<pre><code>@echo off
start /d "C:\Program Files\Internet Explorer" IEXPLORE.EXE www.google.com
start /d "C:\Program Files\Internet Explorer" IEXPLORE.EXE www.yahoo.com
</code></pre>
|
How to use C# to sanitize input on an html page? <p>Is there a library or acceptable method for sanitizing the input to an html page?</p>
<p>In this case I have a form with just a name, phone number, and email address. </p>
<p>Code must be C#.</p>
<p>For example:</p>
<pre><code>"<script src='bobs.js'>John Do... | <p>If by sanitize you mean REMOVE the tags entirely, the RegEx example referenced by Bryant is the type of solution you want.</p>
<p>If you just want to ensure that the code DOESN'T mess with your design and render to the user. You can use the HttpUtility.HtmlEncode method to prevent against that!</p>
|
What is the correct LINQtoSQL-ish way to do a table truncate? <p>I have a project with a formidable data access layer using LinqtoSQL for just about anything touching our databases. I needed to build a helper class that bridges some common crud operations from CLSA objects to LinqToSql ones. Everything has been operati... | <p>This is not possible without doing a custom T-SQL query. Doing a .Delete() and SubmitChanges afterwords would, as you probably already know, result in a DELETE statement.</p>
<p>Of course you could create a stored procedure that truncates the table, and then call the procedure from LINQ, but that isn't really what ... |
How To Get Photo IDs from Flickr API? <p>I am trying to use JQUERY to grab photos from a Flickr group. I can get back valid JSON, but can't figure out how to get access to the actual photos. The JSON that is returned contains an empty list where I would expect photos.</p>
<p>So when I plug this into the browser:</p>
... | <p>I just pasted that same url into Firefox (using my own Flickr api key) and it worked fine, I got (anonymized):</p>
<pre><code>jsonFlickrApi(
{"photos": {"page":1, "pages":1, "perpage":100, "total":"6", "photo":
[{"id": "292744xxxx", "owner":"11363xxx@xxx", "secret":"f084efxxxx",
"server":"3xxx", "farm":4,... |
Good language & framework for cross platform (windows & mac) desktop application <p>The last cross platform desktop development I did was Java/Swing. What about flex?</p>
| <p>Don't do it. If you need to go cross-platform, write the main guts of your application in a business logic layer that doesn't depend on any GUI framework and then use the native platform API to finish each app.</p>
<p>Your users will thank you.</p>
|
Replace in multiple files - graphical tool for Linux <p>It needs to be graphical. No sed, awk, grep, perl, whatever. I know how to use those and I do use them now, but I need to cherry-pick each replace in 300+ files.</p>
<p>I want a tool where I can:</p>
<ul>
<li>type a search string</li>
<li>type a replace string</... | <p>I think <a href="http://regexxer.sourceforge.net/">regexxer</a> is exactly what you're looking for:</p>
<h3><a href="http://regexxer.sourceforge.net/">Regexxer</a></h3>
<blockquote>
<p>regexxer is a nifty GUI search/replace tool featuring Perl-style regular
expressions. If you need project-wide substitution ... |
Problem using SQLite :memory: with NHibernate <p>I use NHibernate for my dataacess, and for awhile not I've been using SQLite for local integration tests. I've been using a file, but I thought I would out the :memory: option. When I fire up any of the integration tests, the database seems to be created (NHibernate sp... | <p>A SQLite memory database only exists as long as the connection to it remains open. To use it in unit tests with NHibernate:<br />
1. Open an ISession at the beginning of your test (maybe in a [SetUp] method).<br />
2. Use the connection from that session in your SchemaExport call.<br />
3. Use that same session in ... |
Detect GCC compile-time flags of a binary <p>Is there a way to find out what gcc flags a particular binary was compiled with?</p>
| <p>A quick look at the GCC documentation doesn't turn anything up.</p>
<p>The Boost guys are some of the smartest C++ developers out there, and they <a href="http://www.boost.org/doc/libs/1%5F36%5F0/more/getting%5Fstarted/unix-variants.html#library-naming">resort</a> to naming <a href="http://www.boost.org/doc/libs/1%... |
How to put WPF Tab Control tabs on the side <p>I am trying to create a Tab Control in WPF that has the tabs arranged down the right side of the control, with the text rotated 90 degrees The look is similar to those plastic tabs you can buy and use in a notebook. I have tried changing the TabStripPlacement to Right, but... | <p>The effect I believe you are seeking is achieved by providing a HeaderTemplate for the TabItem's in you Tab collection.</p>
<pre><code><TabControl TabStripPlacement="Right">
<TabControl.Resources>
<Style TargetType="{x:Type TabItem}">
<Setter Property="Padding" Value="4" />
... |
Detect that the Internet connection is offline? <p>How to detect that the Internet connection is offline in JavaScript?</p>
| <p>You can determine that the connection is lost by making <strong>failed XHR requests</strong>.</p>
<p>The standard approach is to <strong>retry the request</strong> a few times. If it doesn't go through, <strong>alert the user</strong> to check the connection, and <strong>fail gracefully</strong>.</p>
<p><strong>S... |
Where can I find my .emacs file for Emacs running on Windows? <p>I tried looking for the .emacs file for my Windows install for Emacs but could not find it. Does it have the same filename under Windows as in Unix? Do I have to create it myself? If so, under what specific directory does it go?</p>
| <p>Copy'n'paste from the emacs FAQ:
<a href="http://www.gnu.org/software/emacs/windows/">http://www.gnu.org/software/emacs/windows/</a></p>
<h3><a href="http://www.gnu.org/software/emacs/manual/html_node/efaq-w32/Location-of-init-file.html#Location-of-init-file">Where do I put my init file?</a></h3>
<p>On Windows, th... |
Speed of multiple variable assignment in T-SQL <p>Imagine I have a chunk of initialisation code at the top of a stored procedure with a number of variable assignments:</p>
<pre><code>SET @proc = 'sp_madeupname'
SET @magic_number = 42
SET @tomorrows_date = DATEADD(dd, 1, GETDATE())
...
</code></pre>
<p>Clearly doing a... | <p>In this case, SELECT wins, performance-wise, when performing multiple assignments.</p>
<p>Here is some more information about it:</p>
<p><a href="http://www.sqlmag.com/Articles/ArticleID/94555/94555.html" rel="nofollow">SELECT vs. SET: Optimizing Loops</a></p>
|
MS Office hyperlinks change code page? <p>When you paste the following URL into IE: <a href="http://technet.microsoft.com/en-us/sysinternals/bb897434.aspx" rel="nofollow">http://technet.microsoft.com/en-us/sysinternals/bb897434.aspx</a>, the link on the right of the page cleanly says "Download Zoomit (77 KB)". If you ... | <p>I found an answer that seems to be working. First I added an alert to display the document.charset. This displayed "utf-8" when invoked directly, and "windows-1252" when invoked from a hyperlink in a MS Office document. I therefore inserted the following meta-tag, and pages seem to display correctly even when inv... |
Database localization <p>i am looking for opinions if the following problem maybe has a better/different/common solution:</p>
<p><hr /></p>
<p>I have a database for products which contains the names of the products in english (the default language of this application) and i need translations of the names if available... | <p>Looks good to me. The one thing I might change is the way you handle languages: that should probably be a separate table. Thus, you would have:</p>
<pre><code>CREATE TABLE products_l10n
(
product_id serial NOT NULL,
language_id int NOT NULL,
"name" character varying(255) NOT NULL,
CONSTRAINT products_l10n... |
Retrieving the new ID from a SQLDataAdaptor.Update <p>How would you go about retrieving the @@IDENTITY value for each row when the SQLDataAdapater.Update is executed on a table?</p>
<p>eg. Is it possible to modify/intercept the InsertCommand, generated by the SQLCommandBuilder, to say add an output parameter, and then... | <p>Bill Vaughn knows a thing or two about this. They key is tweaking your InsertCommand.</p>
<p>See <a href="http://www.betav.com/Files/Content/Articles/Managing%20and%20Identity%20Crisis.pdf" rel="nofollow">"Managing an @@IDENTITY Crisis"</a>.</p>
<p>Note: the actual solution uses SCOPE_IDENTITY() in order to be tri... |
Why is Apache executing .php.html files as PHP? <p>I have an odd problem...I'm using a documentation generator which generates a lot of output like docs/foo.php.html. It's XHTML, and thus contains <code><?xml...></code> tags at the beginning of file. The problem is, Apache has somehow decided to run it through th... | <p>The problem seems to be in <a href="http://httpd.apache.org/docs/2.2/mod/mod_mime.html">mod_mime</a>.</p>
<p>Quote from the Apache mod_mime documentation page:</p>
<blockquote>
<p>If you would prefer only the last dot-separated part of the filename to be mapped to a particular piece of meta-data, then do not use... |
IE6 generated strange worksheet name when doing export from java application <p>I am encountering error like </p>
<pre><code>test(10)[1].csv file cannot be found at
C:\Documents and Settings\Ron\Local Settings\Temporary Internet Files\Content.IE5\PQ0STUVW
</code></pre>
<p>When trying to do export of CSV file using ... | <p>I've already got that problem and asked the <a href="http://stackoverflow.com/questions/120497/how-to-work-around-the-1-ie-bug-while-saving-an-excel-file-from-a-web-server">question that as a correct answer</a> (or, shall I say, a good workaround for IE).</p>
|
What is the javascript MIME type for the type attribute of a script tag? <p>What is the <a href="http://en.wikipedia.org/wiki/MIME">MIME</a> type of javascript? </p>
<p>More specifically, what is the right thing to put in the "type" attribute of a script tag? <code>application/x-javascript</code> and <code>text/javasc... | <p>This is a common mistake. The MIME type for javascript wasn't standardized for years. It's now <a href="http://www.rfc-editor.org/rfc/rfc4329.txt">officially</a>: "<strong>application/javascript</strong>".</p>
<p>The real kicker here is that most browsers won't use that attribute anyway, at least not in the case ... |
Daemon Threads Explanation <p>In the <a href="https://docs.python.org/2/library/threading.html#thread-objects">Python documentation</a>
it says:</p>
<blockquote>
<p>A thread can be flagged as a "daemon thread". The significance of this
flag is that the entire Python program exits when only daemon threads
are lef... | <p>Some threads do background tasks, like sending keepalive packets, or performing periodic garbage collection, or whatever. These are only useful when the main program is running, and it's okay to kill them off once the other, non-daemon, threads have exited.</p>
<p>Without daemon threads, you'd have to keep track of... |
Where and how does Windows XP store wep/wpa keys? <p>Like the title says Where and How (i.e. if encrypted, with what method) does Windows XP store WEP/WPA Keys?</p>
| <p>I found this: <a href="http://msdn.microsoft.com/en-us/library/ms706987(VS.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms706987(VS.85).aspx</a>.</p>
|
How do I create the migrations for a legacy database? <p>I am currently developing a Rails application using a database that was designed before I was aware of Rails existence.<br />
I have currently created some migrations to add some new tables and new columns to existing tables.</p>
<p>I would like to have the migr... | <p>We had this exact issue when we ported a PHP application to rails. What we did is similar to tomtoday's suggestion. First we pointed the rails configuration to the current database. Then we did a rake db:schema:dump and copied the db/schema.rb file to something like db/schema_base.rb. Then you make your first mi... |
Installing ASP.Net 2.0 after IIS <p>I just got a dedicated server from a hosting company, and for some reason, it didn't have IIS installed.
It did have .Net 2.0, though.</p>
<p>So I installed IIS, but now my ASP.net websites won't work.
I just get a 404, no event log entries, nothing...</p>
<p>I noticed in the redis... | <p>run from the command line</p>
<pre><code>aspnet_regiis -i
</code></pre>
<p>You may have to navigate to the folder it was installed.
Mine and the default is</p>
<pre><code>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
</code></pre>
|
Windows swapping redundantly? <p>This may not be strictly programming related but more OS-structure related.</p>
<p>Running Vista 32 bit on a brand new laptop with 3GB of memory, Running idle the system consumes about 40% of its memory. Other then the fact that this is outrageous on its own right, the OS <strong>shoul... | <p>A page fault doesn't necessarily mean that something was paged to disk. A modern OS has many levels of state that a page might be in, for example Windows will probably distinguish between a page of memory that is being actively used, and a page of memory that hasn't been touched in a while and could be paged to disk... |
Storing more than 1 data item at a single index in a linked-list? <p>I am trying to store more than 1 data item at a single index in my linked-list. All of the examples in my textbook seem to illustrate adding only 1 piece of data per index. I'm assuming it is possible to add more?</p>
<p>For example, using the Coll... | <p>There seems to be a little confusion about how linked lists work. Essentially, a linked list is composed of nodes, each of which contains one datum (an object, which itself can contain several member variables, to be precise), and a link to the next node in the list (or a null pointer if there is no such next node)... |
Specify parts of the header that have to be signed and/or encrypted in WCF with binding that support standards <p>Using Ws2007HttpBinding and securing the service, the WSDL file generated shows in the policy section that all the ws-addressing headers and the body will be signed, and that the body will be encrypted.</p>... | <p>Nevermind, after a few days I found an answer over here: <a href="http://blogs.msdn.com/drnick/archive/2007/01/19/securing-custom-headers-version-2.aspx" rel="nofollow">http://blogs.msdn.com/drnick/archive/2007/01/19/securing-custom-headers-version-2.aspx</a></p>
|
How can I store multiple values in a Perl hash table? <p>Up until recently, I've been storing multiple values into different hashes with the same keys as follows:</p>
<pre><code>%boss = (
"Allan" => "George",
"Bob" => "George",
"George" => "lisa" );
%status = (
"Allan" => "Contractor"... | <p>This is the standard way, as per <a href="http://perldoc.perl.org/perldsc.html">perldoc perldsc</a>.</p>
<pre><code>~> more test.pl
%chums = ( "Allan" => {"Boss" => "George", "Status" => "Contractor"},
"Bob" => {"Boss" => "Peter", "Status" => "Part-time"} );
print $chums{"Allan"}{"B... |
Apache + mod_lisp + clisp <p>How to to configure apache + mod_lisp + clisp and set up a "Hello World!"? I couldn't find any complete howto on the subject. Thanks.</p>
<p>Edit: Vebjorn's solution works, but then I don't how to code the "hello world!". Can anyone tell me how to proceed? There's something like SWANKing t... | <ol>
<li>Download <a href="http://www.fractalconcept.com:8000/public/open-source/mod_lisp/mod_lisp.c">http://www.fractalconcept.com:8000/public/open-source/mod_lisp/mod_lisp.c</a></li>
<li>Compile and install Apache module with <code>sudo apxs -i -c mod_lisp.c</code></li>
<li>Add the following to your <code>httpd.conf<... |
jQuery animate backgroundColor <p>I am trying to animate a change in backgroundColor using jQuery on mouseover.</p>
<p>I have checked some example and I seem to have it right, it works with other properties like fontSize, but with backgroundColor I get and "Invalid Property" js error.
The element I am working with is ... | <p>The color plugin is only 4kb so much cheaper than the UI library. Of course you'll want to use a <a href="http://github.com/jquery/jquery-color">decent version</a> of the plugin and not <a href="http://plugins.jquery.com/project/color">some buggy old thing</a> which doesn't handle Safari and crashes when the transi... |
Does Ruby have a built-in do ... while? <p>Ruby has a wealth of conditional constructs, including <code>if</code>/<code>unless</code>, <code>while</code>/<code>until</code> etc.</p>
<p>The <code>while</code> block from C:</p>
<pre><code>while (condition) {
...
}
</code></pre>
<p>can be directly translated to Rub... | <p>...The best I could come up with is the <code>loop</code> construct with a <code>break</code> at the end: </p>
<pre><code>loop do
...
break unless condition
end
</code></pre>
|
Setting ruby hash .default to a list <p>I thought I understood what the default method does to a hash... </p>
<p>Give a default value for a key if it doesn't exist:</p>
<pre><code>irb(main):001:0> a = {}
=> {}
irb(main):002:0> a.default = 4
=> 4
irb(main):003:0> a[8]
=> 4
irb(main):004:0> a[9] +=... | <p>This is a very useful idiom:</p>
<pre><code>(myhash[key] ||= []) << value
</code></pre>
<p>It can even be nested:</p>
<pre><code>((myhash[key1] ||= {})[key2] ||= []) << value
</code></pre>
<p>The other way is to do:</p>
<pre><code>myhash = Hash.new {|hash,key| hash[key] = []}
</code></pre>
<p>But t... |
C# controls in a MFC Application <p>I am responsible for the User Interface of an application written completely in Visual C++ using MFC and some third-part controls. I would like to use C# (WinForms or even better WPF) to improve the application look&feel.</p>
<p>I would like some advices about how to do it. Lin... | <p>A good starting point is the <a href="http://msdn.microsoft.com/en-us/library/ms742522.aspx" rel="nofollow">Win32 and WPF interop</a> page on MSDN.</p>
|
How can I convert my current page to pdf after some content dynamically added via AJAX? <p>I have found some libraries or web services in PHP that does the job. The problem is that the conversion is done when the page is fully loaded, I would like to <strong>convert the page to PDF</strong> <strong>after some content d... | <p>You could post back <code>document.getElementsByTagName('html')[0].innerHTML</code> to the server (possibly using AJAX) and generate a PDF from that.</p>
|
Order of tags in <head></head> <p>does it matter at all what order the <code><link></code> or <code><script></code> or <code><meta></code> tags are in in the <code><head></head></code>?</p>
<p>(daft question but one of those things i've never given any thought to until now.)</p>
| <p><strong>Optimization</strong></p>
<p>According to the folks over at Yahoo! you should <a href="http://developer.yahoo.com/performance/rules.html#css_top">put CSS at the top</a> and <a href="http://developer.yahoo.com/performance/rules.html#js_bottom">scripts at the bottom</a> because scripts block parallel download... |
T4 Template directory missing on build server <p>I've just set up a new build server with the Windows 2008 .NET 3.5 SDK, and for some reason it hasn't installed c:\Program Files\Common Files\Microsoft Shared\TextTemplating so I can't run t4 templates on it. I had a look at the install options in add/remove programs and... | <p>My understanding is that the T4 engine is a feature of Visual Studio, not the .NET Framework SDK. </p>
|
How to get a complete list of object's methods and attributes? <pre><code>dir(re.compile(pattern))
</code></pre>
<p>does not return pattern as one of the lists's elements. Namely it returns:</p>
<pre><code>['__copy__', '__deepcopy__', 'findall', 'finditer', 'match', 'scanner', 'search', 'split', 'sub', 'subn']
</cod... | <p>For the <strong>complete</strong> list of attributes, the short answer is: no. The problem is that the attributes are actually defined as the arguments accepted by the <code>getattr</code> built-in function. As the user can reimplement <code>__getattr__</code>, suddenly allowing any kind of attribute, there is no po... |
QDockWidget initial width <p>How do I set the initial width of a QDockWidget?</p>
<p>I have implemented the sizeHint function but what next?</p>
| <p>The documentation for <code>QDockWidget</code> says:</p>
<blockquote>
A QDockWidget acts as a wrapper for its child widget, set with setWidget(). Custom size hints, minimum and maximum sizes and size policies should be <b>implemented in the child widget</b>. QDockWidget will respect them, adjusting its own constrai... |
Built in code generation in vs.net 2008? or free via MS? <p>What code generation tools are built-in to vs.net 2008 or are officially available via Microsoft?</p>
<p>I know of:</p>
<ul>
<li>Entity Framework</li>
<li>sqlmetal</li>
</ul>
<p>What else is there?</p>
<p>Ideally i'm looking for something that will generat... | <p>How about <a href="http://www.mygenerationsoftware.com" rel="nofollow">http://www.mygenerationsoftware.com</a>?</p>
|
How do I extract the version and path from an SVN working copy into a nant variable? <p>I am creating a new build process for a DotNet project which is to be held in Subversion.</p>
<p>For each dll/exe that I compile (via Nant) I would like to include 2 additional attibutes in the dlls that are built.</p>
<p>I alread... | <p>Firstly, you can use "svn info --xml >out.xml" to get the svn information to a text file. You can then use a Nant xml-peek to get a value out of the file into a variable.</p>
<pre><code><xmlpeek file="out.xml" xpath="/info/entry/url" property="svn.url" />
</code></pre>
|
How to find the installation directory of a third-party application, such as Google Earth, using C#? <p>I have the following code fragment that starts a <a href="http://en.wikipedia.org/wiki/Google_Earth" rel="nofollow">Google Earth</a> process using a hardcoded path:</p>
<pre><code>var process =
new Process
... | <p>From the example given you can gauge that I'm actually trying to pass a KML file to Google Earth. Because of this, the simplest way of resolving this problem is relying on the file association of KML with Google Earth and using the following as a replacement for the entire example:</p>
<pre><code>Process.Start(kmlP... |
ASP.Net: Approaches to multilingual websites with Javascript and AJAX <p>We've recently completed phase 1 of a ASP.Net website in English and French. We went with using resource files to store language specific strings, but because the site used ASP.Net AJAX and javascript heavily we rigged up a solution to pass the ri... | <p>In my main project (a RAD framework using PHP with gettext for translations) we're doing already alot of prepare operations on javascript files like merging and minifying them. Within this preperations we parse for gettext-markers and replace them with the language specific text.</p>
<p>The result get save as javas... |
How does one weed out dependencies in a large project? <p>I'm about to inherit a rather large Java enterprise project that has a large amount of third party dependencies. There is at least seventy JARs included and some of them would seem to be unused e.g. spring.jar which I know isn't used.</p>
<p>It seems that over ... | <p>Personally, I think you have to start by assessing the scale of the problem. It's going to be fairly painful, but I'd make a list of the dependencies and work out exactly which parts of the project use which ones.</p>
<p>Then I'd work out exactly what features of each you're actually making use of (in many cases, ... |
How do I protect all worksheet in an Excel workbook with a single click? <p>I have around 25 worksheets in my workbook (Excel spreadsheet).
Is there a way I can protect all the 25 worksheets in single click ? or this feature is not available and I will have to write a VBA code to accomplish this. I need very often to p... | <p>I don't believe there's a way to do it without using VBA. If you are interested in a VBA solution, here is the code:</p>
<pre><code>Dim ws as Worksheet
Dim pwd as String
pwd = "" ' Put your password here
For Each ws In Worksheets
ws.Protect Password:=pwd
Next ws
</code></pre>
<p>Unprotecting is virtually the... |
Find beginning of sentence in String <p>I want to display the results of a searchquery in a website with a title and a short description. The short description should be a small part of the page which holds the searchterm. What i want to do is:
1 strip tags in page
2 find first position of seachterm
3 from that positio... | <p>Even that will ultimately fail. Given the sentence "We went to Dr. Smith's office", if your search term is "office", virtually any criterion you use will give you "Smith's office" as your sentence.</p>
|
How do you change your apparent country of origin to test a site? <p>I want to be able to set my country of origin - does this involve testing through a proxy, or is there something that can be set else where?</p>
| <p>I would use <a href="http://www.torproject.org/">TOR</a> for this purpose. That way you are sure you are hitting the site from a different country.</p>
|
Get null == null in SQL <p>I wish to search a database table on a nullable column. Sometimes the value I'm search for is itself NULL. Since Null is equal to nothing, even NULL, saying</p>
<pre><code>where MYCOLUMN=SEARCHVALUE
</code></pre>
<p>will fail. Right now I have to resort to</p>
<pre><code>where ((MYCOLUM... | <p>You can do the IsNull or NVL stuff, but it's just going to make the engine do more work. You'll be calling functions to do column conversions which then have to have the results compared.</p>
<p>Use what you have</p>
<pre><code>where ((MYCOLUMN=SEARCHVALUE) OR (MYCOLUMN is NULL and SEARCHVALUE is NULL))
</code></... |
Strange LINQ Exception (Index out of bounds) <p>I have a table, we'll call <code>Users</code>. This table has a single primary key defined in SQL Server - an autoincrement <code>int ID</code>.</p>
<p>Sometimes, my LINQ queries against this table fail with an <code>"Index was outside the range"</code> error - even the ... | <p>This almost certainly won't be everyone's root cause, but I encountered this exact same exception in my project - and found that the root cause was that an exception was being thrown during construction of an entity class. Oddly, the true exception is "lost" and instead manifests as an ArgumentOutOfRange exception o... |
Configuring python <p>I am new to python and struggling to find how to control the amount of memory a python process can take? I am running python on a Cento OS machine with more than 2 GB of main memory size. Python is taking up only 128mb of this and I want to allocate it more. I tried to search all over the internet... | <p>Forget all that, python just allocates more memory as needed, there is not a myriad of comandline arguments for the VM as in java, just let it run. For all comandline switches you can just run python -h or read man python.</p>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.