content stringlengths 86 88.9k | title stringlengths 0 150 | question stringlengths 1 35.8k | answers list | answers_scores list | non_answers list | non_answers_scores list | tags list | name stringlengths 30 130 |
|---|---|---|---|---|---|---|---|---|
Q:
NHibernate SetTimeout on ICriteria
Could someone tell me what the units the SetTimeout(int) method in the ICriteria interface uses?
Is it milliseconds, seconds, minutes or other?
A:
A little bit of poking around suggests that it could be seconds:
Assuming that ICriteria is the same as the Criteria interface in H... | NHibernate SetTimeout on ICriteria | Could someone tell me what the units the SetTimeout(int) method in the ICriteria interface uses?
Is it milliseconds, seconds, minutes or other?
| [
"A little bit of poking around suggests that it could be seconds:\nAssuming that ICriteria is the same as the Criteria interface in Hibernate core, then the JavaDoc for org.hibernate.Criteria provides a hint - the \"see also\" link to java.sql.Statement.setQueryTimeout(). The latter refers to its timeout parameter ... | [
28,
8
] | [] | [] | [
"nhibernate"
] | stackoverflow_0000033955_nhibernate.txt |
Q:
XML Parser Validation Report
Most XML parsers will give up after the first error in a document. In fact, IIRC, that's actually part of the 'official' spec for parsers.
I'm looking for something that will break that rule. It should take a given schema (assuming a valid schema) and an xml input and attempt to ke... | XML Parser Validation Report | Most XML parsers will give up after the first error in a document. In fact, IIRC, that's actually part of the 'official' spec for parsers.
I'm looking for something that will break that rule. It should take a given schema (assuming a valid schema) and an xml input and attempt to keep going after the first error and... | [
"\nIn fact, IIRC, that's actually part of the 'official' spec for parsers.\n\nOfficial does not need to be quoted :)\n\nfatal error\n[Definition:] An error which a conforming XML processor must detect and report to the application. After encountering a fatal error, the processor may continue processing the data to ... | [
1,
1,
1
] | [] | [] | [
"validation",
"xml"
] | stackoverflow_0000032505_validation_xml.txt |
Q:
How to embed control change commands inside of a MIDI file
I am making a simple game in order to learn a new language. I am in the process of collecting some music for the game and would like to use the MIDI format so that I can control the flow of the track (i.e., I would like to have an introduction that only p... | How to embed control change commands inside of a MIDI file | I am making a simple game in order to learn a new language. I am in the process of collecting some music for the game and would like to use the MIDI format so that I can control the flow of the track (i.e., I would like to have an introduction that only plays once and does not play again when the song loops.)
I am hav... | [
"Sounds like what you really want is a midi editor\n",
"try looking in the Midi 1.0 spec\nHere's a table of the control change messages though it looks like you're looking for a way to do this in software. yes?\nyou could try just sending it as raw midi data (ie. the messages on that table)\nlooking over your que... | [
4,
3,
2
] | [] | [] | [
"midi"
] | stackoverflow_0000034023_midi.txt |
Q:
php scripts writing to non-world-writable files
How can you allow a PHP script to write to a file with high-security restrictions, such as only allowing a single user to write to it?
The difficulty seems to be that a PHP script is running as a low-permissions user (maybe apache, or www, or nobody?), and even if I ... | php scripts writing to non-world-writable files | How can you allow a PHP script to write to a file with high-security restrictions, such as only allowing a single user to write to it?
The difficulty seems to be that a PHP script is running as a low-permissions user (maybe apache, or www, or nobody?), and even if I chown apache the_writable_file, the directory it's in... | [
"Unfortunately, in shared hosts that use mod_php, there is no way to restrict access to secure files to your web app and login user.\nThe solution is to run your web app as your login user. When you do that, UNIX file permissions can correctly lock everyone else out. There are several ways to implement that, includ... | [
2,
0,
0
] | [] | [] | [
"permissions",
"php"
] | stackoverflow_0000034015_permissions_php.txt |
Q:
Can't create a subversion repository with Eclipse 3.4.0, svn 1.5.1
I'm working on mac OS x 10.4. I have a subversion repository stored on an external drive connected via USB. I created a new python project in Eclipse (using the PyDev plugin). When I use right click Team->Share Project to set up a new project with ... | Can't create a subversion repository with Eclipse 3.4.0, svn 1.5.1 | I'm working on mac OS x 10.4. I have a subversion repository stored on an external drive connected via USB. I created a new python project in Eclipse (using the PyDev plugin). When I use right click Team->Share Project to set up a new project with subversion, I get the following error:
Error while creating module: org.... | [
"Try adding the repository first using the \"SVN Repository Exploring\" perspective (Window > Open Perspective > Other... > SVN Repository Exploring).\nMake sure that the URL you are using points to the correct directory, which typically contains these default repository files:\nconf/ dav/ db/ format hooks/ lo... | [
2
] | [] | [] | [
"eclipse",
"macos",
"svn"
] | stackoverflow_0000033990_eclipse_macos_svn.txt |
Q:
Install the Radrails plugin for Aptana Studio offline
I downloaded and installed the Aptana Studio free version. But apparently, to install the Radrails plugin for ruby on rails development you have to connect to the internet. I don't have internet on my machine right now. So is there a way I could download the in... | Install the Radrails plugin for Aptana Studio offline | I downloaded and installed the Aptana Studio free version. But apparently, to install the Radrails plugin for ruby on rails development you have to connect to the internet. I don't have internet on my machine right now. So is there a way I could download the installer from another machine and copy it over my existing A... | [
"I wrote down my duel with Aptana Rails - See if this helps you.\nThere is a link on manual installation that may be what you're looking for.\n",
"If you're able to actually install it on the machine with the Internet connection, then you can simply copy over the directory you installed it in. Eclipse installatio... | [
3,
0
] | [] | [] | [
"aptana",
"radrails",
"ruby_on_rails"
] | stackoverflow_0000034019_aptana_radrails_ruby_on_rails.txt |
Q:
Checking if userinput is a valid URI in XUL
Is there a built-in function/method that can check if a given string is a valid URI or not in the Mozilla XUL toolkit? I have looked for one but found none, but since this is my first time using XUL and its documentation it could be that I just overlooked it. So I'm just... | Checking if userinput is a valid URI in XUL | Is there a built-in function/method that can check if a given string is a valid URI or not in the Mozilla XUL toolkit? I have looked for one but found none, but since this is my first time using XUL and its documentation it could be that I just overlooked it. So I'm just making sure before I start writing my own IsVali... | [
"The nsIIOService.newURI(...) method is what you're looking for. It throws NS_ERROR_MALFORMED_URI if the URI string is invalid.\nExample:\ntry {\n var ioServ = Components.classes[\"@mozilla.org/network/io-service;1\"]\n .getService(Components.interfaces.nsIIOService);\n var uriObj = ioServ... | [
4
] | [] | [] | [
"firefox",
"javascript",
"validation",
"xul"
] | stackoverflow_0000034076_firefox_javascript_validation_xul.txt |
Q:
Using Unsigned Primitive Types
Most of time we represent concepts which can never be less than 0. For example to declare length, we write:
int length;
The name expresses its purpose well but you can assign negative values to it. It seems that for some situations, you can represent your intent more clearly by writ... | Using Unsigned Primitive Types | Most of time we represent concepts which can never be less than 0. For example to declare length, we write:
int length;
The name expresses its purpose well but you can assign negative values to it. It seems that for some situations, you can represent your intent more clearly by writing it this way instead:
uint length... | [
"If you decrement a signed number with a value of 0, it becomes negative and you can easily test for this. If you decrement an unsigned number with a value of 0, it underflows and becomes the maximum value for the type - somewhat more difficult to check for. \n",
"Your second point is the most important. Generall... | [
5,
5,
5,
2,
2,
0
] | [] | [] | [
"c#",
"primitive_types"
] | stackoverflow_0000033852_c#_primitive_types.txt |
Q:
VS2008: Copy Web Site from command line
How do I execute the "Copy Web Site" command for an ASP.NET project in VS2008 from the command line? If I need to script this, let me have some pointers on where I can learn that.
A:
Would this help you get started?
Walkthrough: Deploying an ASP.NET Web Application Using X... | VS2008: Copy Web Site from command line | How do I execute the "Copy Web Site" command for an ASP.NET project in VS2008 from the command line? If I need to script this, let me have some pointers on where I can learn that.
| [
"Would this help you get started?\nWalkthrough: Deploying an ASP.NET Web Application Using XCOPY\n"
] | [
4
] | [] | [] | [
"asp.net",
"command_line",
"visual_studio_2008"
] | stackoverflow_0000034112_asp.net_command_line_visual_studio_2008.txt |
Q:
Dividing a list of nodes in half
<xsl:for-each select="./node [position() <= (count(*) div 2)]">
<li>foo</li>
</xsl:for-each>
<xsl:for-each select="./node [count(*) div 2 < position()]">
<li>bar</li>
</xsl:for-each>
My list has 12 nodes, but the second list is always 8 and the first is always 4. Wha... | Dividing a list of nodes in half | <xsl:for-each select="./node [position() <= (count(*) div 2)]">
<li>foo</li>
</xsl:for-each>
<xsl:for-each select="./node [count(*) div 2 < position()]">
<li>bar</li>
</xsl:for-each>
My list has 12 nodes, but the second list is always 8 and the first is always 4. What's wrong with my selects?
| [
"When you do count(*), the current node is the node element being processed. You want either count(current()/node) or last() (preferable), or just calculate the midpoint to a variable for better performance and clearer code:\n<xsl:variable name=\"nodes\" select=\"node\"/>\n<xsl:variable name=\"mid\" select=\"count(... | [
7,
2,
0,
0
] | [] | [] | [
"xml",
"xslt"
] | stackoverflow_0000034087_xml_xslt.txt |
Q:
Microsoft Office 2007 automated installation - editing the config.xml file
I'm creating an automated installation of Office 2007. To customise your Office 2007 installation the Office Customization Tool (OCT) does most of the work for you. One the OCT's features is the ability to run additional programs during t... | Microsoft Office 2007 automated installation - editing the config.xml file | I'm creating an automated installation of Office 2007. To customise your Office 2007 installation the Office Customization Tool (OCT) does most of the work for you. One the OCT's features is the ability to run additional programs during the Office installation. However it is pretty poor at it.
Fortunately by editi... | [
"In standard XML you embed quotes in attribute values using ", &34; or .\nSee the page on Wikipedia for a list of XML entity references.\nI don't know if this will solve your problem, but seeing as it is an XML parser error it should.\n"
] | [
2
] | [] | [] | [
"installation",
"office_2007",
"packaging",
"xml"
] | stackoverflow_0000033976_installation_office_2007_packaging_xml.txt |
Q:
How to you pass a variable amount of parmeters to web-service
We are trying to create a web-service that we plan to pass a variable amount of variables to it.
Can this be done?
Basically instead of pass all possible parameters we wish to pass only the set values and use the defaults set in the web-service.
Here is... | How to you pass a variable amount of parmeters to web-service | We are trying to create a web-service that we plan to pass a variable amount of variables to it.
Can this be done?
Basically instead of pass all possible parameters we wish to pass only the set values and use the defaults set in the web-service.
Here is an example of the XML we are looking to send, we would sent an unk... | [
"I would pass in an xml document instead of doing concreate functions for this. \nThe webservice in your example is leaky - the consumer needs to know too much about this interface and the implementation of the webservice internally. \nXML Document and then tie that with an XSD. That way you can prevalidte the in... | [
5,
0,
0,
0
] | [] | [] | [
"c#",
"soap",
"web_services"
] | stackoverflow_0000034128_c#_soap_web_services.txt |
Q:
How to handle variable width FieldObjects in Crystal Reports
I have a Crystal Report which is viewed via a CrystalReportViewer control on an .aspx page (using VS2008).
The report has two data-driven FieldObjects (which can contain a variable number of chars) which I would like to display on the same line beside ... | How to handle variable width FieldObjects in Crystal Reports | I have a Crystal Report which is viewed via a CrystalReportViewer control on an .aspx page (using VS2008).
The report has two data-driven FieldObjects (which can contain a variable number of chars) which I would like to display on the same line beside each other.
Problem is when the text in the first FieldObject is... | [
"you can add a text object to the report. And while editing the text of the text object, drag the field you want to show from the object explorer into the text box. Then hit space, then drag the second field in to the same text box. Your two fields will always be one space a part. You could, of course, add more spa... | [
5,
1
] | [] | [] | [
"crystal_reports"
] | stackoverflow_0000033937_crystal_reports.txt |
Q:
Using Hibernate to work with Text Files
I am using Hibernate in a Java application to access my Database and it works pretty well with MS-SQL and MySQL. But some of the data I have to show on some forms has to come from Text files, and by Text files I mean Human-Readable files, they can be CSV, Tab-Delimited, or e... | Using Hibernate to work with Text Files | I am using Hibernate in a Java application to access my Database and it works pretty well with MS-SQL and MySQL. But some of the data I have to show on some forms has to come from Text files, and by Text files I mean Human-Readable files, they can be CSV, Tab-Delimited, or even a key, value pair, per line since my data... | [
"Hibernate is written against the JDBC API. So, you need a JDBC driver that works with the file format you are interested in. Obviously, even for read-only access, this isn't going to perform well, but it might still be useful if that's not a high priority. On a Windows system, you can set up ODBC datasources for d... | [
8,
6,
0
] | [] | [] | [
"database",
"hibernate",
"java",
"text_files"
] | stackoverflow_0000033438_database_hibernate_java_text_files.txt |
Q:
How to program user preferences
I'm using Ruby on Rails for an internal site. Different users of the site have access to a wide variety of data and highly disparate perspectives of the data. Within those different classes of users, there needs to be levels of access. Within the levels of access I need to be able t... | How to program user preferences | I'm using Ruby on Rails for an internal site. Different users of the site have access to a wide variety of data and highly disparate perspectives of the data. Within those different classes of users, there needs to be levels of access. Within the levels of access I need to be able to add features from other classes of ... | [
"Another totally different approach would be to use acts_as_authenticated and authorization plugins. The tables will be built by the plugins (ie users, roles and roles_users). From the doc:\n\nThe authorization plugin provides the following:\n\n\nA simple way of checking authorization at either the class or instanc... | [
3,
2
] | [] | [] | [
"ruby",
"ruby_on_rails",
"user_controls",
"user_interface"
] | stackoverflow_0000032966_ruby_ruby_on_rails_user_controls_user_interface.txt |
Q:
COMException "Library not registered." while using System.DirectoryServices
I have only just started received the following error in my windows forms application under .NET 2 framework on windows 2000 when using System.DirectoryServices.
{System.Runtime.InteropServices.COMException}
System.Runtime.InteropServi... | COMException "Library not registered." while using System.DirectoryServices | I have only just started received the following error in my windows forms application under .NET 2 framework on windows 2000 when using System.DirectoryServices.
{System.Runtime.InteropServices.COMException}
System.Runtime.InteropServices.COMException: {"Library not registered."}
_className: Nothing
_COMPlusExcepti... | [
"Having used Reflector to have a quick peak at the Directory Services code, it looks like your Active Directory Service Interfaces installation might be kaput.\nYou can download version 2.5 from Technet although I'm not sure if it's the latest version or if it works with Windows 2000.\n"
] | [
1
] | [] | [] | [
".net_2.0",
"active_directory",
"com"
] | stackoverflow_0000034270_.net_2.0_active_directory_com.txt |
Q:
What is the best way to add an event in JavaScript?
I see 2 main ways to set events in JavaScript:
Add an event directly inside the tag like this:
<a href="" onclick="doFoo()">do foo</a>
Set them by JavaScript like this:
<a id="bar" href="">do bar</a>
and add an event in a <script> section inside the <head> sect... | What is the best way to add an event in JavaScript? | I see 2 main ways to set events in JavaScript:
Add an event directly inside the tag like this:
<a href="" onclick="doFoo()">do foo</a>
Set them by JavaScript like this:
<a id="bar" href="">do bar</a>
and add an event in a <script> section inside the <head> section or in an external JavaScript file, like that if you'r... | [
"\nI think the first method is easier to read and maintain\n\nI've found the opposite to be true. Bear in mind that sometimes more than one event handler will be bound to a given control.\nDeclaring all events in one central place helps to organize the actions taking place on the site. If you need to change somethi... | [
9,
4,
3,
1,
0,
0
] | [] | [] | [
"event_binding",
"events",
"html",
"javascript"
] | stackoverflow_0000034126_event_binding_events_html_javascript.txt |
Q:
Visually Tag/Mark a Window
I'm looking for a way to visually mark or tag a window (any OS) so that it stands out.
A while back, I accidentally replaced a live production database containing thousands of records with an empty dev version, simply because the two instances of Enterprise Manager looked identical to on... | Visually Tag/Mark a Window | I'm looking for a way to visually mark or tag a window (any OS) so that it stands out.
A while back, I accidentally replaced a live production database containing thousands of records with an empty dev version, simply because the two instances of Enterprise Manager looked identical to one another. I'd like to avoid tha... | [
"None that I'm aware of, but perhaps a virtual desktop system for your OS of choice would help keep the separation a little better for you.\n",
"If you are using TOAD for your db access you can set a custom colour for each of your connections. (List of Quest products here scroll down page to the TOAD links)\nThe ... | [
1,
1,
0
] | [] | [] | [
"user_interface"
] | stackoverflow_0000034286_user_interface.txt |
Q:
Automatic image rotation based on a logo
We're looking for a package to help identify and automatically rotate faxed TIFF images based on a watermark or logo.
We use libtiff for rotation currently, but don't know of any other libraries or packages I can use for detecting this logo and determining how to rotate ... | Automatic image rotation based on a logo | We're looking for a package to help identify and automatically rotate faxed TIFF images based on a watermark or logo.
We use libtiff for rotation currently, but don't know of any other libraries or packages I can use for detecting this logo and determining how to rotate the images.
I have done some basic work with O... | [
"You are in the right place using OpenCV, it is an excellent utility. For example, this guy used it for template matching, which is fairly similar to what you need to do. Also, the link Roddy specified looks similar to what you want to do.\nI feel that OpenCV is the best library out there for this kind of developme... | [
1,
0,
0
] | [] | [] | [
"image_rotation",
"opencv",
"tiff",
"watermark"
] | stackoverflow_0000032643_image_rotation_opencv_tiff_watermark.txt |
Q:
How do I filter nodes of TreeView and Menu controls with sitemap data sources based on user permissions?
I'm using the ASP.NET Login Controls and Forms Authentication for membership/credentials for an ASP.NET web application. And I'm using a site map for site navigation.
I have ASP.NET TreeView and Menu navigatio... | How do I filter nodes of TreeView and Menu controls with sitemap data sources based on user permissions? | I'm using the ASP.NET Login Controls and Forms Authentication for membership/credentials for an ASP.NET web application. And I'm using a site map for site navigation.
I have ASP.NET TreeView and Menu navigation controls populated using a SiteMapDataSource. But off-limits administrator-only pages are visible to non-ad... | [
"I had to set securityTrimmingEnabled to \"true\" in my web.config file.\n<?xml version=\"1.0\"?>\n<configuration>\n ...\n <system.web>\n ...\n <siteMap defaultProvider=\"default\">\n <providers>\n <clear/>\n <add name=\"default\"\n typ... | [
1,
1,
1
] | [] | [] | [
"asp.net",
"forms_authentication",
"sitemap"
] | stackoverflow_0000033395_asp.net_forms_authentication_sitemap.txt |
Q:
When do Request.Params and Request.Form differ?
I recently encountered a problem where a value was null if accessed with Request.Form but fine if retrieved with Request.Params. What are the differences between these methods that could cause this?
A:
Request.Form only includes variables posted through a form, wh... | When do Request.Params and Request.Form differ? | I recently encountered a problem where a value was null if accessed with Request.Form but fine if retrieved with Request.Params. What are the differences between these methods that could cause this?
| [
"Request.Form only includes variables posted through a form, while Request.Params includes both posted form variables and get variables specified as URL parameters.\n",
"Request.Params contains a combination of QueryString, Form, Cookies and ServerVariables (added in that order).\nThe difference is that if you ha... | [
32,
21,
1
] | [] | [] | [
"asp.net",
"c#",
"request"
] | stackoverflow_0000005706_asp.net_c#_request.txt |
Q:
Query TFS for updated files
I want to get an overview of files that are updated in TFS (that someone else checked in) that I don't have the latest version for.
A:
In Visual Studio Source Control Explorer, right click on the directory you want to compare, and select "Compare". It will pop up a dialog with a coupl... | Query TFS for updated files | I want to get an overview of files that are updated in TFS (that someone else checked in) that I don't have the latest version for.
| [
"In Visual Studio Source Control Explorer, right click on the directory you want to compare, and select \"Compare\". It will pop up a dialog with a couple of filtering options, and then show you what's out of date. \n",
"if they checked them in as part of a single changeset then you can find them that way. \n(rig... | [
2,
0
] | [] | [] | [
"tfs"
] | stackoverflow_0000034262_tfs.txt |
Q:
How do I truncate a string while converting to bytes in C#?
I would like to put a string into a byte array, but the string may be too big to fit. In the case where it's too large, I would like to put as much of the string as possible into the array. Is there an efficient way to find out how many characters will ... | How do I truncate a string while converting to bytes in C#? | I would like to put a string into a byte array, but the string may be too big to fit. In the case where it's too large, I would like to put as much of the string as possible into the array. Is there an efficient way to find out how many characters will fit?
| [
"In order to truncate a string to a UTF8 byte array without splitting in the middle of a character I use this:\nstatic string Truncate(string s, int maxLength) {\n if (Encoding.UTF8.GetByteCount(s) <= maxLength)\n return s;\n var cs = s.ToCharArray();\n int length = 0;\n int i = 0;\n while (i ... | [
6,
2,
1,
1
] | [] | [] | [
".net",
"arrays",
"c#",
"string",
"truncate"
] | stackoverflow_0000034395_.net_arrays_c#_string_truncate.txt |
Q:
How would you abbriviate XHTML to an arbitrary number of words?
How would you programmacially abbreviate XHTML to an arbitrary number of words without leaving unclosed or corrupted tags?
i.e.
<p>
Proin tristique dapibus neque. Nam eget purus sit amet leo
tincidunt accumsan.
</p>
<p>
Proin semper, orci ... | How would you abbriviate XHTML to an arbitrary number of words? | How would you programmacially abbreviate XHTML to an arbitrary number of words without leaving unclosed or corrupted tags?
i.e.
<p>
Proin tristique dapibus neque. Nam eget purus sit amet leo
tincidunt accumsan.
</p>
<p>
Proin semper, orci at mattis blandit, augue justo blandit nulla.
<span>Quisque ante ... | [
"Recurse through the DOM tree, keeping a word count variable up to date. When the word count exceeds your maximum word count, insert \"...\" and remove all following siblings of the current node, then, as you go back up through the recursion, remove all the following siblings of each of its ancestors.\n",
"You ne... | [
1,
1
] | [] | [] | [
"dom",
"dom_traversal",
"html",
"regex",
"xhtml"
] | stackoverflow_0000034394_dom_dom_traversal_html_regex_xhtml.txt |
Q:
Getting files and their version numbers from sharepoint
As a temporary stopgap until all the designers are in place we are currently hand-cranking a whole bunch of xml configuration files at work. One of the issues with this is file-versioning because people forget to update version numbers when updating the files... | Getting files and their version numbers from sharepoint | As a temporary stopgap until all the designers are in place we are currently hand-cranking a whole bunch of xml configuration files at work. One of the issues with this is file-versioning because people forget to update version numbers when updating the files (which is to be expected as humans generally suck at perfect... | [
"I am assuming you are talking about documents in a list or a library, not source files in the 12 hive. If so, each library has built-in versioning. You can access it by clicking on the Form Library Settings available from each library (with appropriate admin privs, of course). From there, select Versioning Sett... | [
1,
1
] | [] | [] | [
"sharepoint",
"versioning"
] | stackoverflow_0000033252_sharepoint_versioning.txt |
Q:
Do webtests need VS tester edition on the build server?
Using the TFS build server without VS 2008 Team System Tester Edition installed - is it possible to run a series of webtests as part of a build?
I know that Webtests can only be recorded using the Tester Edition of VS. Here's a post about this from Jeff, back... | Do webtests need VS tester edition on the build server? | Using the TFS build server without VS 2008 Team System Tester Edition installed - is it possible to run a series of webtests as part of a build?
I know that Webtests can only be recorded using the Tester Edition of VS. Here's a post about this from Jeff, back when he was at Vertigo.
I'm just trying to run the tests, th... | [
"You don't have to have the tester's edition; the Developer Edition works, as long as you can code and run those tests locally.\nI believe with the standard MSDN license, if you have Developer Edition, you can run a single build server with a copy of it. There might be some extra limitations, such as who can run b... | [
1
] | [] | [] | [
"build_process",
"tfs"
] | stackoverflow_0000034322_build_process_tfs.txt |
Q:
How to determine if an html tag splits across multiple lines
I'm writing a PHP script that involves scraping web pages. Currently, the script analyzes the page line by line, but it breaks if there is a tag that spans multiple lines, like
<img src="example.jpg"
alt="example">
If worse comes to worst, I could poss... | How to determine if an html tag splits across multiple lines | I'm writing a PHP script that involves scraping web pages. Currently, the script analyzes the page line by line, but it breaks if there is a tag that spans multiple lines, like
<img src="example.jpg"
alt="example">
If worse comes to worst, I could possibly preprocess the page by removing all line breaks, then re-inse... | [
"This is one of my pet peeves: never parse HTML by hand. Never parse HTML with regexps. Never parse HTML with string comparisons. Always use an HTML parser to parse HTML – that's what they're there for.\nIt's been a long time since I've done any PHP, but a quick search turned up this PHP5 HTML parser.\n",
"Don't ... | [
7,
2,
1,
1,
0,
0
] | [] | [] | [
"html",
"php",
"scripting"
] | stackoverflow_0000033814_html_php_scripting.txt |
Q:
How should I model a field that can contain both numeric and string values in SQL Server 2005?
I have a new database table I need to create...
It logically contains an ID, a name, and a "value".
That value field could be either numeric or a character string in nature.
I don't think I want to just make the field ... | How should I model a field that can contain both numeric and string values in SQL Server 2005? | I have a new database table I need to create...
It logically contains an ID, a name, and a "value".
That value field could be either numeric or a character string in nature.
I don't think I want to just make the field a varchar, because I also want to be able to query with filters like WHERE value > 0.5 and such.
Wha... | [
"A good way to get the query support you want is to have two columns: numvalue that stores a number and textvalue that stores characters. They should be nullable or at least have some default that represents no value. Your application can then decide which column to store its value and which to leave with no value.... | [
3,
2,
0,
0,
0,
0,
0,
0,
0
] | [] | [] | [
"database_design",
"sql_server"
] | stackoverflow_0000034398_database_design_sql_server.txt |
Q:
Standardised text editing behaviour across Mac applications
I've switched over to a Mac recently and, although things have been going quite well, the very different text-editing behaviours across applications is driving me insane.
Home, End, Page Up, Page Down, Apple-arrow, Ctrl-arrow, alt-arrow etc. quite often d... | Standardised text editing behaviour across Mac applications | I've switched over to a Mac recently and, although things have been going quite well, the very different text-editing behaviours across applications is driving me insane.
Home, End, Page Up, Page Down, Apple-arrow, Ctrl-arrow, alt-arrow etc. quite often do different things depending on the application.
Is there a way t... | [
"There are standards, but they are not based around what you're used to from windows. It drove me mad until I got over myself and decided to learn what the actual standards were. Since then I've been sold.\nThe ones I use:\n\nCommand-Left/Right - Jump to start/end of line\n\n\nCan also do this with ctrl-a/e which i... | [
6,
0
] | [] | [] | [
"keyboard_shortcuts",
"macos"
] | stackoverflow_0000033971_keyboard_shortcuts_macos.txt |
Q:
Are there similar tools to Clone Detective for other languages/IDEs?
I just saw Clone Detective linked on YCombinator news, and the idea heavily appeals to me. It seems like it would be useful for many languages, not just C#, but I haven't seen anything similar elsewhere.
Edit: For those who don't want to follow t... | Are there similar tools to Clone Detective for other languages/IDEs? | I just saw Clone Detective linked on YCombinator news, and the idea heavily appeals to me. It seems like it would be useful for many languages, not just C#, but I haven't seen anything similar elsewhere.
Edit: For those who don't want to follow the link, Clone Detective scans the codebase for duplicate code that may wa... | [
"Java has a few - some of the most popular static analysis tools have this built in along with many other useful rules.\nOnes I have used, in the (purely subjective) order that I was happiest with:\n\nPMD - comes with CPD - their copy and paste detector\nCheckstyle - specific rules to look for duplicate code\nFindb... | [
2,
2
] | [] | [] | [
"c#",
"language_agnostic"
] | stackoverflow_0000032338_c#_language_agnostic.txt |
Q:
How to turn off sounds in TortoiseSVN?
I do not want TortoiseSVN to alert me with sounds - e.g. when it fails to update.
How do I turn off sounds in TortoiseSVN?
A:
Right click > TortoiseSVN > Settings > System Sounds..
Scroll down to the bottom.
A:
You can do this from the Sounds panel in Control Panel.
| How to turn off sounds in TortoiseSVN? | I do not want TortoiseSVN to alert me with sounds - e.g. when it fails to update.
How do I turn off sounds in TortoiseSVN?
| [
"Right click > TortoiseSVN > Settings > System Sounds..\nScroll down to the bottom.\n",
"You can do this from the Sounds panel in Control Panel.\n"
] | [
3,
1
] | [] | [] | [
"system_sounds",
"tortoisesvn"
] | stackoverflow_0000034698_system_sounds_tortoisesvn.txt |
Q:
MySQL "Error 1005" when adding tables
I've recently been working with a MySQL database, and using MySQL workbench to design the Database.
When I use the export to SQL function, so I can actually get the layout in to the Database, I get:
"Error 1005: Cannot create table"
This appears to be related to Foreign Keys... | MySQL "Error 1005" when adding tables | I've recently been working with a MySQL database, and using MySQL workbench to design the Database.
When I use the export to SQL function, so I can actually get the layout in to the Database, I get:
"Error 1005: Cannot create table"
This appears to be related to Foreign Keys in the create table statement.
Does anybod... | [
"When you get this (and other errors out of the InnoDB engine) issue:\nSHOW ENGINE INNODB STATUS;\n\nIt will give a more detailed reason why the operation couldn't be completed. Make sure to run that from something that'll allow you to scroll or copy the data, as the response is quite long.\n",
"I ran into this ... | [
7,
1
] | [] | [] | [
"mysql",
"mysql_error_1005",
"mysql_workbench"
] | stackoverflow_0000034579_mysql_mysql_error_1005_mysql_workbench.txt |
Q:
How do you swap DIVs on mouseover (jQuery)?
This most be the second most simple rollover effect, still I don't find any simple solution.
Wanted: I have a list of items and a corresponding list of slides (DIVs). After loading, the first list item should be selected (bold) and the first slide should be visible. When... | How do you swap DIVs on mouseover (jQuery)? | This most be the second most simple rollover effect, still I don't find any simple solution.
Wanted: I have a list of items and a corresponding list of slides (DIVs). After loading, the first list item should be selected (bold) and the first slide should be visible. When the user hovers over another list item, that lis... | [
"Rather than displaying all slides when JS is off (which would likely break the page layout) I would place inside the switch LIs real A links to server-side code which returns the page with the \"active\" class pre-set on the proper switch/slide.\n\n\n$(document).ready(function() {\r\n switches = $('#switches > li... | [
19,
6,
5,
2,
0
] | [] | [] | [
"css",
"html",
"javascript",
"jquery"
] | stackoverflow_0000034536_css_html_javascript_jquery.txt |
Q:
How do you use the new ModelBinder classes in ASP.NET MVC Preview 5
You'll notice that Preview 5 includes the following in their release notes:
Added support for custom model binders. Custom binders allow you to define complex types as parameters to an action method. To use this feature, mark the complex type or ... | How do you use the new ModelBinder classes in ASP.NET MVC Preview 5 | You'll notice that Preview 5 includes the following in their release notes:
Added support for custom model binders. Custom binders allow you to define complex types as parameters to an action method. To use this feature, mark the complex type or the parameter declaration with [ModelBinder(…)].
So how do you go about ... | [
"Well I looked into this. ASP.NET provides a common location for registering the implementation of IControlBinders. They also have the basics of this working via the new Controller.UpdateModel method. \nSo I essentially combined these two concepts by creating an implementation of IModelBinder that does the same thi... | [
2
] | [] | [] | [
"asp.net_mvc"
] | stackoverflow_0000034709_asp.net_mvc.txt |
Q:
Odd behaviour for rowSpan in Flex
I am experiencing some oddities when working with a Grid component in flex, I have the following form that uses a grid to align the fields, as you can see, each GridRow has a border.
My problem is that the border is still visible through GridItems that span multiple rows (observe ... | Odd behaviour for rowSpan in Flex | I am experiencing some oddities when working with a Grid component in flex, I have the following form that uses a grid to align the fields, as you can see, each GridRow has a border.
My problem is that the border is still visible through GridItems that span multiple rows (observe the TextArea that spans 4 rows, the Gri... | [
"I think the problem is that when the Grid is drawn, it draws each row from top to bottom, and within each row the items left to right. So the row-spanned <mx:TextArea> item is drawn first extending down into the area of the 2 next rows, which get drawn after and on top.\nThe quickest way around I can see would be... | [
1
] | [] | [] | [
"apache_flex"
] | stackoverflow_0000032596_apache_flex.txt |
Q:
How do you build a ratings implementation?
We have need for a "rating" system in a project we are working on, similar to the one in SO. However, in ours there are multiple entities that need to be "tagged" with a vote up (only up, never down, like an increment). Sometimes we will need to show all of the entities i... | How do you build a ratings implementation? | We have need for a "rating" system in a project we are working on, similar to the one in SO. However, in ours there are multiple entities that need to be "tagged" with a vote up (only up, never down, like an increment). Sometimes we will need to show all of the entities in order of what is rated highest, regardless of ... | [
"Since reddit's ranking algorithm rocks, it makes very much sense to have a look at it, if not copy it:\n\nGiven the time the entry was posted A and the time of 7:46:43 a.m. December 8, 2005 B we have ts as their difference in seconds:\nts = A - B\nand x as the difference between the number of up votes U and the nu... | [
6
] | [] | [] | [
"algorithm",
"architecture",
"data_structures",
"database_design"
] | stackoverflow_0000034781_algorithm_architecture_data_structures_database_design.txt |
Q:
How do I implement Search Functionality in a website?
I want to implement search functionality for a website (assume it is similar to SO). I don't want to use Google search of stuff like that.
My question is:
How do I implement this?
There are two methods I am aware of:
Search all the databases in the application... | How do I implement Search Functionality in a website? | I want to implement search functionality for a website (assume it is similar to SO). I don't want to use Google search of stuff like that.
My question is:
How do I implement this?
There are two methods I am aware of:
Search all the databases in the application when the user gives his query.
Index all the data I have a... | [
"Use lucene,\nhttp://lucene.apache.org/java/docs/\n\nApache Lucene is a high-performance, full-featured text search engine library written entirely in Java. It is a technology suitable for nearly any application that requires full-text search, especially cross-platform.\n\nIt is available in java and .net. It is al... | [
40,
36,
4,
1,
1,
0
] | [
"If you application uses the Java EE stack and you are using Hibernate you can use the Compass Framework maintain a searchable index of your database. The Compass Framework uses Lucene under the hood.\nThe only catch is that you cannot replicate your search index. So you need to use a clustered database to hold the... | [
-2
] | [
"search"
] | stackoverflow_0000034314_search.txt |
Q:
Convert Web.config from .NET 2.0 to 3.5
What is the minimum I need to add to a .NET 2.0 WebSite's web.config to make it .NET 3.5?
Visual Studio adds all the config sections and script handlers, but if you aren't using those are they are really necessary?
Is there a command line tool to "upgrade" a .NET 2.0 web.co... | Convert Web.config from .NET 2.0 to 3.5 | What is the minimum I need to add to a .NET 2.0 WebSite's web.config to make it .NET 3.5?
Visual Studio adds all the config sections and script handlers, but if you aren't using those are they are really necessary?
Is there a command line tool to "upgrade" a .NET 2.0 web.config to 3.5?
| [
"There is a good description of the 3.5 web.config available here:\nhttps://web.archive.org/web/20211020153237/https://www.4guysfromrolla.com/articles/121207-1.aspx\nThe assemblies and config sections are important because they tell the runtime to use the new 3.5 dlls instead of the 2.0 dlls\nThe codedom section te... | [
9,
1,
1,
0
] | [] | [] | [
".net",
"asp.net",
"configuration",
"migration"
] | stackoverflow_0000033949_.net_asp.net_configuration_migration.txt |
Q:
Wifi Management on XP (SP2/SP3)
Wifi support on Vista is fine, but Native Wifi on XP is half baked. NDIS 802.11 Wireless LAN Miniport Drivers only gets you part of the way there (e.g. network scanning). From what I've read (and tried), the 802.11 NDIS drivers on XP will not allow you to configure a wireless connec... | Wifi Management on XP (SP2/SP3) | Wifi support on Vista is fine, but Native Wifi on XP is half baked. NDIS 802.11 Wireless LAN Miniport Drivers only gets you part of the way there (e.g. network scanning). From what I've read (and tried), the 802.11 NDIS drivers on XP will not allow you to configure a wireless connection. You have to use the Native Wifi... | [
"We use WZC on XP and Native WiFi on Vista, but here's the code which we use on Vista, FWIW.\nProfile creation:\n// open a handle to the service\nif ((dwError = WlanOpenHandle(\n WLAN_API_VERSION,\n NULL, // reserved\n &dwServiceVersion,\n &hClient\n )) != ERROR_SUCC... | [
1,
1
] | [] | [] | [
"networking",
"wifi",
"windows_xp",
"wireless"
] | stackoverflow_0000031673_networking_wifi_windows_xp_wireless.txt |
Q:
Email Delivery Question
This question comes on the heels of the question asked here.
The email that comes from our web server comes from an IP address that is different than that for the Exchange server. Is this okay if the SPF and Domain keys are setup properly?
A:
Short answer: Yes
A:
It should just fine. Ho... | Email Delivery Question | This question comes on the heels of the question asked here.
The email that comes from our web server comes from an IP address that is different than that for the Exchange server. Is this okay if the SPF and Domain keys are setup properly?
| [
"Short answer: Yes\n",
"It should just fine. However some spam filters will do a reverse lookup on the originating IP address and see if it's assigned to the domain name the email claims to be from, and some may check to see if the IP is an actual MX for the domain.\nSo the downside is that some recipients may ne... | [
3,
3
] | [] | [] | [
"email",
"email_spam"
] | stackoverflow_0000032803_email_email_spam.txt |
Q:
Class design decision
I have a little dilemma that maybe you can help me sort out.
I've been working today in modifying ASP.NET's Membership to add a level of indirection. Basically, ASP.NET's Membership supports Users and Roles, leaving all authorization rules to be based on whether a user belongs to a Role or n... | Class design decision | I have a little dilemma that maybe you can help me sort out.
I've been working today in modifying ASP.NET's Membership to add a level of indirection. Basically, ASP.NET's Membership supports Users and Roles, leaving all authorization rules to be based on whether a user belongs to a Role or not.
What I need to do is a... | [
"I feel the best combination of DRYness and forcing the contract is as follows (in pseudocode):\nclass Base {\n public final constructor(name) {\n constructor(name, null)\n end\n\n public abstract constructor(name, description);\n}\n\nor, alternatively:\nclass Base {\n public abstract constructor(name);\n\n ... | [
1,
0
] | [] | [] | [
"asp.net_membership",
"inheritance",
"oop"
] | stackoverflow_0000034806_asp.net_membership_inheritance_oop.txt |
Q:
How do I replicate content on a web farm
We have a Windows Server Web Edition 2003 Web Farm.
What can we use that handles replication across the servers for:
Content & IIS Configuration (App Pools, Virtual Directories, etc...)
We will be moving to Windows 2008 in the near future, so I guess what options are there... | How do I replicate content on a web farm | We have a Windows Server Web Edition 2003 Web Farm.
What can we use that handles replication across the servers for:
Content & IIS Configuration (App Pools, Virtual Directories, etc...)
We will be moving to Windows 2008 in the near future, so I guess what options are there on Windows 2008 as well.
| [
"I'd look into Windows Distributed File System. It should be supported by both Windows Server 2003 & 2008.\n",
"Distributed File System (DFS) is good for content, especially if each server (or a number of servers) host a replica synced up with File Replication Service (FRS). So if you've got two servers, each ha... | [
1,
1
] | [] | [] | [
"iis",
"replication",
"webserver"
] | stackoverflow_0000030379_iis_replication_webserver.txt |
Q:
Print out the keys and Data of a Hashtable in C# .NET 1.1
I need debug some old code that uses a Hashtable to store response from various threads.
I need a way to go through the entire Hashtable and print out both keys and the data in the Hastable.
How can this be done?
A:
foreach(string key in hashTable.Keys)
{... | Print out the keys and Data of a Hashtable in C# .NET 1.1 | I need debug some old code that uses a Hashtable to store response from various threads.
I need a way to go through the entire Hashtable and print out both keys and the data in the Hastable.
How can this be done?
| [
"foreach(string key in hashTable.Keys)\n{\n Console.WriteLine(String.Format(\"{0}: {1}\", key, hashTable[key]));\n}\n\n",
"I like:\nforeach(DictionaryEntry entry in hashtable)\n{\n Console.WriteLine(entry.Key + \":\" + entry.Value);\n}\n\n",
"\n public static void PrintKeysAndValues( Hashtable myList ) ... | [
22,
9,
3,
1,
1
] | [] | [] | [
".net_1.1",
"c#",
"hashtable"
] | stackoverflow_0000034879_.net_1.1_c#_hashtable.txt |
Q:
Finding your own number in a box
100 (or some even number 2N :-) ) prisoners are in a room A. They are numbered from 1 to 100.
One by one (from prisoner #1 to prisoner #100, in order), they will be let into a room B in which 100 boxes (numbered from 1 to 100) await them. Inside the (closed) boxes are numbers from ... | Finding your own number in a box | 100 (or some even number 2N :-) ) prisoners are in a room A. They are numbered from 1 to 100.
One by one (from prisoner #1 to prisoner #100, in order), they will be let into a room B in which 100 boxes (numbered from 1 to 100) await them. Inside the (closed) boxes are numbers from 1 to 100 (the numbers inside the boxes... | [
"This puzzle is explained at http://www.math.princeton.edu/~wwong/blog/blog200608191813.shtml and that person does a much better job of explaining the problem.\nThe \"all prisoners are killed\" statement is wrong.\nThe \"you can save 30+ on average\" is also wrong, the article says that 30% of the time you can save... | [
7,
3,
1,
1,
0,
0,
0,
0,
0,
0
] | [] | [] | [
"algorithm",
"puzzle"
] | stackoverflow_0000034345_algorithm_puzzle.txt |
Q:
How to convert complex filename into HTML link?
I have a directory with PDF files that I need to create an index for. It is a PHP page with a list of links:
<A HREF="path to file">filename</A>
The filenames can be complicated:
LVD 2-1133 - Ändring av dumpningslina (1984-11-20).pdf
What is the correct way to link... | How to convert complex filename into HTML link? | I have a directory with PDF files that I need to create an index for. It is a PHP page with a list of links:
<A HREF="path to file">filename</A>
The filenames can be complicated:
LVD 2-1133 - Ändring av dumpningslina (1984-11-20).pdf
What is the correct way to link to this file on a Linux/Apache server?
Is there a PH... | [
"You can use rawurlencode() to convert a string according to the RFC 1738 spec.\nThis function replaces all non-alphanumeric characters by their associated code.\nThe difference with urlencode() is that spaces are encoded as plus signs.\nYou'll probably want to use the last one.\nThis technique is called Percent or... | [
3,
1,
0,
0,
0
] | [] | [] | [
"html",
"php"
] | stackoverflow_0000035037_html_php.txt |
Q:
Is there a built in way in .Net AJAX to manually serialize an object to a JSON string?
I've found ScriptingJsonSerializationSection but I'm not sure how to use it. I could write a function to convert the object to a JSON string manually, but since .Net can do it on the fly with the <System.Web.Services.WebMethod()... | Is there a built in way in .Net AJAX to manually serialize an object to a JSON string? | I've found ScriptingJsonSerializationSection but I'm not sure how to use it. I could write a function to convert the object to a JSON string manually, but since .Net can do it on the fly with the <System.Web.Services.WebMethod()> and <System.Web.Script.Services.ScriptMethod()> attributes so there must be a built-in way... | [
"This should do the trick\nDim jsonSerialiser As New System.Web.Script.Serialization.JavaScriptSerializer\nDim jsonString as String = jsonSerialiser.Serialize(yourObject)\n\n",
"I think what you're looking for is this class:\nSystem.ServiceModel.Web.DataContractJsonSerializer\nHere's an example from Rick Strahl: ... | [
11,
6,
4,
3,
2,
1
] | [] | [] | [
".net_2.0",
"asp.net",
"json",
"serialization",
"vb.net"
] | stackoverflow_0000035106_.net_2.0_asp.net_json_serialization_vb.net.txt |
Q:
What types of testing do you include in your build process?
I use TFS 2008. We run unit tests as part of our continuous integration build and integration tests nightly.
What other types of testing do you automate and include in your build process? what technologies do you use to do so?
I'm thinking about smoke... | What types of testing do you include in your build process? | I use TFS 2008. We run unit tests as part of our continuous integration build and integration tests nightly.
What other types of testing do you automate and include in your build process? what technologies do you use to do so?
I'm thinking about smoke tests, performance tests, load tests but don't know how realisti... | [
"First, we have check-in (smoke) tests that must run before code can be checked in. It's done automatically by running a job that runs the tests and then makes the check-in to source control upon successful test completion. Second, cruise control kicks off build and regression tests. The product is built then sever... | [
3,
1
] | [] | [] | [
"build_automation",
"testing"
] | stackoverflow_0000034304_build_automation_testing.txt |
Q:
How do I store information in my executable in .Net
I'd like to bind a configuration file to my executable. I'd like to do this by storing an MD5 hash of the file inside the executable. This should keep anyone but the executable from modifying the file.
Essentially if someone modifies this file outside of the prog... | How do I store information in my executable in .Net | I'd like to bind a configuration file to my executable. I'd like to do this by storing an MD5 hash of the file inside the executable. This should keep anyone but the executable from modifying the file.
Essentially if someone modifies this file outside of the program the program should fail to load it again.
EDIT: The p... | [
"A better solution is to store the MD5 in the configuration file. But instead of the MD5 being just of the configuration file, also include some secret \"key\" value, like a fixed guid, in the MD5.\nwrite(MD5(SecretKey + ConfigFileText));\n\nThen you simply remove that MD5 and rehash the file (including your secre... | [
11,
1,
1
] | [
"just make a const string that holds the md5 hash and compile it into your app ... your app can then just refer to this const string when validating the configuration file\n"
] | [
-2
] | [
".net",
"c#"
] | stackoverflow_0000035103_.net_c#.txt |
Q:
Tools for finding memory corruption in managed C++ code
I have a .NET application, which is using an open source C++ compression library for compressing images. We are accessing the C++ library via managed C++. I'm seeing heap corruption during compression. A call to _CrtIsValidHeapPointer is finding an error o... | Tools for finding memory corruption in managed C++ code | I have a .NET application, which is using an open source C++ compression library for compressing images. We are accessing the C++ library via managed C++. I'm seeing heap corruption during compression. A call to _CrtIsValidHeapPointer is finding an error on a call to free() when cleaning up after compression.
Are th... | [
"On *nix, there's a tool called Valgrind that I use for dealing with memory issues, like memory leaks and memory corruption.\n",
"In native code, if the corruption always occurs in the same place in memory, you can use a data breakpoint to break the debugger when that memory is changed. Unfortunately, you cannot ... | [
1,
1,
0
] | [] | [] | [
".net",
"managed_c++"
] | stackoverflow_0000034973_.net_managed_c++.txt |
Q:
requiredfield validator is preventing another form from submitting
I have a page with many forms in panels and usercontrols, and a requiredfield validator I just added to one form is preventing all of my other forms from submitting. what's the rule that I'm not following?
A:
Are you using ValidationGroups? Try ... | requiredfield validator is preventing another form from submitting | I have a page with many forms in panels and usercontrols, and a requiredfield validator I just added to one form is preventing all of my other forms from submitting. what's the rule that I'm not following?
| [
"Are you using ValidationGroups? Try assigning each control with a validation group as well as the validator that you want to use. Something like:\n<asp:TextBox ID=\"txt1\" ValidationGroup=\"Group1\" ruant=\"server\" />\n<asp:RequiredFieldValidator ID=\"rfv1\" ... ValidationGroup=\"Group1\" />\n\nNote, if a butto... | [
5,
0
] | [] | [] | [
"asp.net"
] | stackoverflow_0000035208_asp.net.txt |
Q:
Working in Visual Studio (2005 or 2008) on a networked drive
Have you guys had any experiences (positive or negative) by placing your source code/solution on a network drive for Visual Studio 2005 or 2008? Please note I am not referring to placing your actual source control system on that drive, but rather your w... | Working in Visual Studio (2005 or 2008) on a networked drive | Have you guys had any experiences (positive or negative) by placing your source code/solution on a network drive for Visual Studio 2005 or 2008? Please note I am not referring to placing your actual source control system on that drive, but rather your working folder.
Thanks
| [
"It works just fine. I have worked with source code from my \"home\" folder on many different systems (NFS, Samba, AD) and never had any problems. The only drawback is that you might experience somewhat longer compile times if your network is slow or there is much traffic on the network. Under normal circumstances ... | [
1,
1
] | [] | [] | [
"visual_studio_2005",
"visual_studio_2008"
] | stackoverflow_0000035194_visual_studio_2005_visual_studio_2008.txt |
Q:
Simple Frameworks for Displaying Bitmaps and Handling Button Presses
We have a set of applications that basically display a bunch of bitmaps and text, then allow user to press "buttons" (certain bitmaps) that cause actions to occur.
We currently have these implemented using DirectX and a bunch of code to place the... | Simple Frameworks for Displaying Bitmaps and Handling Button Presses | We have a set of applications that basically display a bunch of bitmaps and text, then allow user to press "buttons" (certain bitmaps) that cause actions to occur.
We currently have these implemented using DirectX and a bunch of code to place the bitmaps and handle the button-presses. But we'd like to have the followi... | [
"Maybe the way to go is something like Clutter or Allegro. If you check in this article at ArsTechnica what they are using Clutter for, you might get an idea how to use it. I don't know for sure if it works on Windows, but I'm pretty sure it does, considering it only depends on libraries that are supported under Wi... | [
1,
0,
0
] | [] | [] | [
"bitmap",
"c++",
"graphics",
"user_interface"
] | stackoverflow_0000024196_bitmap_c++_graphics_user_interface.txt |
Q:
Best way to unit test ASP.NET MVC action methods that use BindingHelperExtensions.UpdateFrom?
In handling a form post I have something like
public ActionResult Insert()
{
Order order = new Order();
BindingHelperExtensions.UpdateFrom(order, this.Request.Form);
this.orderService.Save... | Best way to unit test ASP.NET MVC action methods that use BindingHelperExtensions.UpdateFrom? | In handling a form post I have something like
public ActionResult Insert()
{
Order order = new Order();
BindingHelperExtensions.UpdateFrom(order, this.Request.Form);
this.orderService.Save(order);
return this.RedirectToAction("Details", new { id = order.ID });
}
I am not u... | [
"I'm now using ModelBinder so that my action method can look (basically) like:\n public ActionResult Insert(Contact contact)\n {\n\n if (this.ViewData.ModelState.IsValid)\n {\n this.contactService.SaveContact(contact);\n\n return this.RedirectToAction(\"Details\", new { id ... | [
1,
0,
0
] | [] | [] | [
"asp.net_mvc",
"unit_testing"
] | stackoverflow_0000028723_asp.net_mvc_unit_testing.txt |
Q:
XmlSerializer changes in .NET 3.5 SP1
I've seen quite a few posts on changes in .NET 3.5 SP1, but stumbled into one that I've yet to see documentation for yesterday. I had code working just fine on my machine, from VS, msbuild command line, everything, but it failed on the build server (running .NET 3.5 RTM).
[Xm... | XmlSerializer changes in .NET 3.5 SP1 | I've seen quite a few posts on changes in .NET 3.5 SP1, but stumbled into one that I've yet to see documentation for yesterday. I had code working just fine on my machine, from VS, msbuild command line, everything, but it failed on the build server (running .NET 3.5 RTM).
[XmlRoot("foo")]
public class Foo
{
static... | [
"In SP1 does the foo.Bar property get properly deserialized?\nIn pre SP1 you wouldn't be able to deserialize the object because the set method of the Bar property is private so the XmlSerializer doesn't have a way to set that value. I'm not sure how SP1 is pulling it off.\nYou could try adding this to your web.con... | [
4,
0
] | [] | [] | [
".net_3.5",
"serialization",
"xml"
] | stackoverflow_0000034925_.net_3.5_serialization_xml.txt |
Q:
Managing multiple identical databases efficiently?
How, if you have a database per client of a web application instead of one database used by all clients, do you go about providing updates and enhancements to all databases efficiently?
How do you roll out changes to schema and code in such a scenario?
A:
It's k... | Managing multiple identical databases efficiently? | How, if you have a database per client of a web application instead of one database used by all clients, do you go about providing updates and enhancements to all databases efficiently?
How do you roll out changes to schema and code in such a scenario?
| [
"It's kinda difficult for us. We have a custom program that writes a lot of the sql code for the different databases for us. Essentially it writes the code once and then copies it over and over again along with placing the change database commands etc. It also makes sure that the primary key identities etc are in... | [
1,
1,
1
] | [] | [] | [
"database"
] | stackoverflow_0000035256_database.txt |
Q:
How can you make a .net windows forms project look fresh?
I'm working on a visual studio 2005 vb.net windows forms project that's been around for several years. It's full of default textboxes, labels, dropdowns, datagrids, datetime pickers -- all the standard stuff. The end result is a very gray, old-looking pro... | How can you make a .net windows forms project look fresh? | I'm working on a visual studio 2005 vb.net windows forms project that's been around for several years. It's full of default textboxes, labels, dropdowns, datagrids, datetime pickers -- all the standard stuff. The end result is a very gray, old-looking project.
What would be the best approach to making this project lo... | [
"I was actually just sprucing up a dialog today. A lot of it depends on what kind of application you have, and what OS it is running on. A couple of these tips will certainly go a long way to jazzing things up.\n\nEnsure adequate spacing between controls — don't cram them all together. Space is appealing. You mig... | [
38,
9,
6,
6,
5,
3,
3
] | [] | [] | [
".net",
"user_interface",
"visual_studio",
"winforms"
] | stackoverflow_0000033703_.net_user_interface_visual_studio_winforms.txt |
Q:
Minimalistic Database Administration
I am a developer. An architect on good days. Somehow I find myself also being the DBA for my small company. My background is fair in the DB arts but I have never been a full fledged DBA. My question is what do I have to do to ensure a realiable and reasonably functional dat... | Minimalistic Database Administration | I am a developer. An architect on good days. Somehow I find myself also being the DBA for my small company. My background is fair in the DB arts but I have never been a full fledged DBA. My question is what do I have to do to ensure a realiable and reasonably functional database environment with as little actual ef... | [
"I've been there. I used to have a job where I wrote code, did all the infrastructure stuff, wore the DBA hat, did user support, fixed the electric stapler when it jammed, and whatever else came up that might be remotely associated with IT. It was great! I learned a little about everything.\nAs far as the care a... | [
5,
5,
3
] | [] | [] | [
"administration",
"database",
"task"
] | stackoverflow_0000035357_administration_database_task.txt |
Q:
DOS filename escaping for use with *nix commands
I want to escape a DOS filename so I can use it with sed. I have a DOS batch file something like this:
set FILENAME=%~f1
sed 's/Some Pattern/%FILENAME%/' inputfile
(Note: %~f1 - expands %1 to a Fully qualified path name - C:\utils\MyFile.txt)
I found that the back... | DOS filename escaping for use with *nix commands | I want to escape a DOS filename so I can use it with sed. I have a DOS batch file something like this:
set FILENAME=%~f1
sed 's/Some Pattern/%FILENAME%/' inputfile
(Note: %~f1 - expands %1 to a Fully qualified path name - C:\utils\MyFile.txt)
I found that the backslashes in %FILENAME% are just escaping the next lette... | [
"This will work. It's messy because in BAT files you can't use set var=`cmd` like you can in unix.\nThe fact that echo doesn't understand quotes is also messy, and could lead to trouble if Some Pattern contains shell meta characters.\nset FILENAME=%~f1\necho s/Some Pattern/%FILENAME%/ | sed -e \"s/\\\\/\\\\\\\\/g\... | [
2,
2,
0
] | [] | [] | [
"dos",
"scripting",
"shell"
] | stackoverflow_0000035286_dos_scripting_shell.txt |
Q:
Encapsulate multiple properties at once using Resharper 4.0
When using Resharper to encapsulate a class's properties, is there a way to get it to do more than one property at a time?
A:
You might or might not already know this (R# does suffer from a lack of discoverability, unless you get the one-page key-shortc... | Encapsulate multiple properties at once using Resharper 4.0 | When using Resharper to encapsulate a class's properties, is there a way to get it to do more than one property at a time?
| [
"You might or might not already know this (R# does suffer from a lack of discoverability, unless you get the one-page key-shortcut page printed out), but ALT-INS opens a box which can at least mass-generate properties for fields.\nNot sure if that's any use - it's not the same as a retrospective encapsulation.\n"
] | [
9
] | [
"I don't think there such a feature out of the box.\nHowever, you could write a RS plugin that does this. But this would be another question...\n"
] | [
-1
] | [
"resharper",
"visual_studio"
] | stackoverflow_0000035402_resharper_visual_studio.txt |
Q:
What is the best solution for maintaining backup and revision control on live websites?
What is the best solution for maintaining backup and revision control on live websites?
As part of my job I work with several live websites. We need an efficient means of maintaining backups of the live folders over time. Addi... | What is the best solution for maintaining backup and revision control on live websites? | What is the best solution for maintaining backup and revision control on live websites?
As part of my job I work with several live websites. We need an efficient means of maintaining backups of the live folders over time. Additionally, updating these sites can be a pain, especially if a change happens to break in the ... | [
"You can still use SVN, but instead of doing a checkout on your live environment, do an export, that way no .svn directories will be created. The downside, of course, is that no code changes on your live environment can take place. This is a good thing.\nAs a general rule, code changes on production systems should ... | [
4,
2,
1,
1
] | [] | [] | [
"backup",
"hosting",
"version_control"
] | stackoverflow_0000027292_backup_hosting_version_control.txt |
Q:
How can I point Visual Studio 2008 to a new path for projects?
I didn't see the option to point the workspace (or it's VS equivalent, I'm still learning the terminology for Visual Studio, but it is called a workspace in Eclipse) to My Documents/Programming instead of -- well -- wherever it is now.
A:
What Craig ... | How can I point Visual Studio 2008 to a new path for projects? | I didn't see the option to point the workspace (or it's VS equivalent, I'm still learning the terminology for Visual Studio, but it is called a workspace in Eclipse) to My Documents/Programming instead of -- well -- wherever it is now.
| [
"What Craig said, plus if you do want to change the default it's in Tools -> Options -> Projects And Solutions.\nI've never changed the default and never created a solution/project in the default location, which might tell you something about how relevant it is...\n",
"Tools -> Options -> Projects & Solutions.\nT... | [
1,
1,
0
] | [] | [] | [
"visual_studio"
] | stackoverflow_0000035432_visual_studio.txt |
Q:
How do I get the assembler output from a C file in VS2005
I think the file that is produced is an .asm file, any idea how to produce this in Visual Studio when you do a build?
A:
Project->Properties->Configuration Properties->C/C++->Output Files
There you should see an option for Assembler Output.
John.
A:
Ope... | How do I get the assembler output from a C file in VS2005 | I think the file that is produced is an .asm file, any idea how to produce this in Visual Studio when you do a build?
| [
"Project->Properties->Configuration Properties->C/C++->Output Files\nThere you should see an option for Assembler Output.\nJohn.\n",
"\nOpen the Properties page for a project \nSelect the Configuration Properties -> C/C++ -> Output Files branch \nChange the Assembler Output option to something other than No Listi... | [
5,
5,
2
] | [] | [] | [
"assembly",
"c",
"visual_studio"
] | stackoverflow_0000034635_assembly_c_visual_studio.txt |
Q:
How do you use XML::Parser with Style => 'Objects'
The manual page for XML::Parser::Style::Objects is horrible. A simple hello world style program would really be helpful.
I really wanted to do something like this: (not real code of course)
use XML::Parser;
my $p = XML::Parser->new(Style => 'Objects', Pkg => 'MyN... | How do you use XML::Parser with Style => 'Objects' | The manual page for XML::Parser::Style::Objects is horrible. A simple hello world style program would really be helpful.
I really wanted to do something like this: (not real code of course)
use XML::Parser;
my $p = XML::Parser->new(Style => 'Objects', Pkg => 'MyNode');
my $tree = $p->parsefile('foo.xml');
$tree->doSom... | [
"When ever I need to do something similar, usually I end up using XML::Parser::EasyTree it has better documentation and is simpler to use.\nI highly recommend it.\n",
"In all cases here is actual code that runs ... doesn't mean much but produces output and hopefully can get you started ...\nuse XML::Parser;\n\np... | [
2,
1
] | [] | [] | [
"perl",
"xml"
] | stackoverflow_0000034914_perl_xml.txt |
Q:
Compiler Error C2143 when using a struct
I'm compiling a simple .c in visual c++ with Compile as C Code (/TC)
and i get this compiler error
error C2143: syntax error : missing ';' before 'type'
on a line that calls for a simple struct
struct foo test;
same goes for using the typedef of the struct.
error C22... | Compiler Error C2143 when using a struct | I'm compiling a simple .c in visual c++ with Compile as C Code (/TC)
and i get this compiler error
error C2143: syntax error : missing ';' before 'type'
on a line that calls for a simple struct
struct foo test;
same goes for using the typedef of the struct.
error C2275: 'FOO' : illegal use of this type as an exp... | [
"I forgot that in C you have to declare all your variables before any code.\n",
"Did you accidentally omit a semicolon on a previous line? If the previous line is an #include, you might have to look elsewhere for the missing semicolon.\nEdit: If the rest of your code is valid C++, then there probably isn't enough... | [
6,
1,
1,
0,
0
] | [] | [] | [
"c",
"visual_c++"
] | stackoverflow_0000035333_c_visual_c++.txt |
Q:
Google Talk's Graphics Toolkit?
What graphics toolkit is used for the Window's Google Talk application?
A:
There isn't much information on this out there but it seems to be their own customized controls plus an IE component (and not Qt like Google Earth). This forum thread has a little bit of information.
A:
I... | Google Talk's Graphics Toolkit? | What graphics toolkit is used for the Window's Google Talk application?
| [
"There isn't much information on this out there but it seems to be their own customized controls plus an IE component (and not Qt like Google Earth). This forum thread has a little bit of information.\n",
"I'm not positive but I believe it's QT. \n"
] | [
1,
0
] | [] | [] | [
"toolkit",
"user_interface",
"windows"
] | stackoverflow_0000034711_toolkit_user_interface_windows.txt |
Q:
Lightweight rich-text XML format?
I am writing a basic word processing application and am trying to settle on a native "internal" format, the one that my code parses in order to render to the screen. I'd like this to be XML so that I can, in the future, just write XSLT to convert it to ODF or XHTML or whatever.
Wh... | Lightweight rich-text XML format? | I am writing a basic word processing application and am trying to settle on a native "internal" format, the one that my code parses in order to render to the screen. I'd like this to be XML so that I can, in the future, just write XSLT to convert it to ODF or XHTML or whatever.
When searching for existing standards to ... | [
"As you are sure about needing to represent the presentational side of things, it may be worth looking at the XSL-FO W3C Recommendation. This is a full-blown page description language and the (deeply unfashionable) other half of the better-known XSLT.\nClearly the whole thing is anything but \"lightwight\", but if ... | [
5,
1,
1,
0
] | [
"XML is an external format, not internal.\nWhat's wrong with XHTML? It's simple and it's ubiquitous (at least HTML is). Your implementation would be easy to debug, and your users will be eternally greatful.\n"
] | [
-1
] | [
"standards",
"xml"
] | stackoverflow_0000031226_standards_xml.txt |
Q:
Bypass Forms Authentication auto redirect to login, How to?
I'm writing an app using asp.net-mvc deploying to iis6. I'm using forms authentication. Usually when a user tries to access a resource without proper authorization I want them to be redirected to a login page. FormsAuth does this for me easy enough.
Probl... | Bypass Forms Authentication auto redirect to login, How to? | I'm writing an app using asp.net-mvc deploying to iis6. I'm using forms authentication. Usually when a user tries to access a resource without proper authorization I want them to be redirected to a login page. FormsAuth does this for me easy enough.
Problem: Now I have an action being accessed by a console app. Whats t... | [
"Ok, I worked around this. I made a custom ActionResult (HttpForbiddenResult) and custom ActionFilter (NoFallBackAuthorize).\nTo avoid redirection, HttpForbiddenResult marks responses with status code 403. FormsAuthentication doesn't catch responses with this code so the login redirection is effectively skipped. Th... | [
5,
1,
0,
0
] | [
"I did some googling and this is what I came up with:\n\n HttpContext.Current.Response.StatusCode = 401;\n\nNot sure if it works or not, I haven't tested it. Either way, it's worth a try, right? :)\n"
] | [
-2
] | [
"asp.net",
"asp.net_mvc",
"forms_authentication"
] | stackoverflow_0000035322_asp.net_asp.net_mvc_forms_authentication.txt |
Q:
nmake, visualstudio, and .mak files
I was given a C++ project that was compiled using MS Visual Studio .net 2003 C++ compiler, and a .mak file that was used to compile it. I am able to build it from the command line using nmake project.mak, but the compiler complains that afxres.h was not found. I did a little s... | nmake, visualstudio, and .mak files | I was given a C++ project that was compiled using MS Visual Studio .net 2003 C++ compiler, and a .mak file that was used to compile it. I am able to build it from the command line using nmake project.mak, but the compiler complains that afxres.h was not found. I did a little searching around and the afxres.h is in th... | [
"There should be an icon in your Start menu under Programs that opens a cmd.exe instance with all the correct MSVS environment variables set up for command line building.\n",
"Another option is running the appropriate vars batch file from a regular command prompt. The name and location varies from version to ver... | [
4,
2
] | [] | [] | [
"nmake",
"visual_studio"
] | stackoverflow_0000035429_nmake_visual_studio.txt |
Q:
looping and average in c++
Programming Student here...trying to work on a project but I'm stuck.
The project is trying to find the miles per gallon per trip then at the end outputting total miles and total gallons used and averaging miles per gallon
How do I loop back up to the first question after the first set ... | looping and average in c++ | Programming Student here...trying to work on a project but I'm stuck.
The project is trying to find the miles per gallon per trip then at the end outputting total miles and total gallons used and averaging miles per gallon
How do I loop back up to the first question after the first set of questions has been asked.
Als... | [
"You will have to tell us the type of data you are given.\nAs per your last question: remember that an average can be calculated in real time by either storing the sum and the number of data points (two numbers), or the current average and the number of data points (again, two numbers).\nFor instance:\nclass Averag... | [
2
] | [] | [] | [
"c++"
] | stackoverflow_0000035522_c++.txt |
Q:
Trouble using JRun to Host Java Servlets
I am deploying new versions of java servlets with JRun as the host. I am having difficulty finding good sources for information about JRun and tutorials about how to configure and manage it.
After installing JRun and opening the launcher it can't start the admin server that... | Trouble using JRun to Host Java Servlets | I am deploying new versions of java servlets with JRun as the host. I am having difficulty finding good sources for information about JRun and tutorials about how to configure and manage it.
After installing JRun and opening the launcher it can't start the admin server that it creates by default...so obviously I'm runn... | [
"Jrun development has pretty much stopped. You should look into running another application server. Jboss or Glassfish are good alternatives.\n",
"This is probably going to be difficult to resolve unless you post either the error message from the log file or the list of steps that you took so far.\nI have JRun 3.... | [
2,
1,
1
] | [] | [] | [
"hosting",
"java",
"jrun",
"servlets"
] | stackoverflow_0000034726_hosting_java_jrun_servlets.txt |
Q:
Excluding Code Analysis rule in source
In a project I'm working on FxCop shows me lots of (and I mean more than 400) errors on the InitializeComponent() methods generated by the Windows Forms designer. Most of those errors are just the assignment of the Text property of labels.
I'd like to suppress those methods i... | Excluding Code Analysis rule in source | In a project I'm working on FxCop shows me lots of (and I mean more than 400) errors on the InitializeComponent() methods generated by the Windows Forms designer. Most of those errors are just the assignment of the Text property of labels.
I'd like to suppress those methods in source, so I copied the suppression code g... | [
"You've probably got the right code, but you also need to add CODE_ANALYSIS as a precompiler defined symbol in the project properties. I think those SuppressMessage attributes are only left in the compiled binaries if CODE_ANALYSIS is defined.\n",
"In FxCop 1.36 there is actually a project option on the \"Spellin... | [
18,
4,
2
] | [] | [] | [
"code_analysis",
"fxcop",
"initializecomponent",
"suppression",
"visual_studio"
] | stackoverflow_0000035551_code_analysis_fxcop_initializecomponent_suppression_visual_studio.txt |
Q:
Why does Python's iter() on a mapping return iterkeys() instead of iteritems()?
It seems like if you want to get the keys of a mapping, you ask for them; otherwise, give me the whole mapping (constituted by a set of key-value pairs). Is there a historical reason for this?
A:
Check out this thread for a discussio... | Why does Python's iter() on a mapping return iterkeys() instead of iteritems()? | It seems like if you want to get the keys of a mapping, you ask for them; otherwise, give me the whole mapping (constituted by a set of key-value pairs). Is there a historical reason for this?
| [
"Check out this thread for a discussion on the reasons behind this behavior (including that Guido likes it, and it's not likely to change).\n"
] | [
11
] | [] | [] | [
"iteration",
"mapping",
"python"
] | stackoverflow_0000035569_iteration_mapping_python.txt |
Q:
How far does SQL Server Express Edition scale?
Wikipedia says SQL Server Express Edition is limited to "one processor, 1 GB memory and 4 GB database files". Does anyone have practical experience with how well this scales?
A:
It's a regular sql server, it just has a limit. SharePoint by default uses the sql ser... | How far does SQL Server Express Edition scale? | Wikipedia says SQL Server Express Edition is limited to "one processor, 1 GB memory and 4 GB database files". Does anyone have practical experience with how well this scales?
| [
"It's a regular sql server, it just has a limit. SharePoint by default uses the sql server express if that gives you any idea. We have our entire office (80+) people running on that instance.\n",
"We have used SQL Server Express Edition in some of our smaller applications, maybe 5+ users, and smaller databases.... | [
5,
2,
0,
0
] | [] | [] | [
"sql_server_express"
] | stackoverflow_0000035559_sql_server_express.txt |
Q:
How to benchmark a SQL Server Query?
I'd like to know the standard way to benchmark a SQL Sever Query, preferably I'd like to know about the tools that come with SQL Server rather than 3rd Party tools.
A:
set showplan_text on
will show you the execution plan (to see it graphically use CTRL + K (sql 2000) or CTR... | How to benchmark a SQL Server Query? | I'd like to know the standard way to benchmark a SQL Sever Query, preferably I'd like to know about the tools that come with SQL Server rather than 3rd Party tools.
| [
"set showplan_text on \nwill show you the execution plan (to see it graphically use CTRL + K (sql 2000) or CTRL + M (sql 2005 +)\nset statistics IO on\nwill show you the reads\nset statistics time on\nwill show you the elapsed time\n",
"Use SQL Profiler.\nFor .NET applications, filter that Application name by '.N... | [
11,
1,
0
] | [] | [] | [
"benchmarking",
"database",
"sql_server"
] | stackoverflow_0000034858_benchmarking_database_sql_server.txt |
Q:
Django ImageField core=False in newforms admin
In the transition to newforms admin I'm having difficulty figuring out how specify core=False for ImageFields.
I get the following error:
TypeError: __init__() got an unexpected keyword argument 'core'
[Edit] However, by just removing the core argument I get a "This ... | Django ImageField core=False in newforms admin | In the transition to newforms admin I'm having difficulty figuring out how specify core=False for ImageFields.
I get the following error:
TypeError: __init__() got an unexpected keyword argument 'core'
[Edit] However, by just removing the core argument I get a "This field is required." error in the admin interface on ... | [
"To get rid of \"This field is required,\" you need to make it not required, by using blank=True (and possibly null=True as well, if it's not a CharField).\n",
"The core attribute isn't used anymore.\nFrom Brian Rosner's Blog:\n\nYou can safely just remove any and all core arguments. They are no longer used. newf... | [
5,
4,
2
] | [] | [] | [
"django",
"django_models",
"python"
] | stackoverflow_0000034209_django_django_models_python.txt |
Q:
How to Format Numbers in WinForms 1.1 DataGrid?
Is there a simple way to format numbers in a Winforms 1.1 datagrid? The Format property of the DataGridTextBoxColumn seems to be completely ignored. I know there is a solution that involves subclassing a Column control, and it's fairly simple, but was hoping there ... | How to Format Numbers in WinForms 1.1 DataGrid? | Is there a simple way to format numbers in a Winforms 1.1 datagrid? The Format property of the DataGridTextBoxColumn seems to be completely ignored. I know there is a solution that involves subclassing a Column control, and it's fairly simple, but was hoping there might be some trick to making the Format property jus... | [
"My personal opinion is that a datagridcolumnstyle is the way to go. Without seeing the code that you have, I can't say for certain why your formatting isn't taking hold when no style is defined - but mixing in formatting with data calculations and other parts of the code can get very messy very quickly.\nCreating... | [
1,
0
] | [] | [] | [
"winforms"
] | stackoverflow_0000034428_winforms.txt |
Q:
Using Office to programmatically convert documents?
I'm interested in using Office 2007 to convert between the pre-2007 binary formats (.doc, .xls, .ppt) and the new Office Open XML formats (.docx, .xlsx, .pptx)
How would I do this? I'd like to write a simple command line app that takes in two filenames (input and... | Using Office to programmatically convert documents? | I'm interested in using Office 2007 to convert between the pre-2007 binary formats (.doc, .xls, .ppt) and the new Office Open XML formats (.docx, .xlsx, .pptx)
How would I do this? I'd like to write a simple command line app that takes in two filenames (input and output) and perhaps the source and/or destination types,... | [
"Microsoft has a page which gives several examples of writing scripts to \"drive\" MS Word. One such example shows how to convert from a Word document to HTML. By changing the last parameter to any values listed here, you can get the output in different formats.\n",
"The easiest way would be to use Automation t... | [
2,
0
] | [] | [] | [
"ms_office"
] | stackoverflow_0000035639_ms_office.txt |
Q:
Frequent SystemExit in Ruby when making HTTP calls
I have a Ruby on Rails Website that makes HTTP calls to an external Web Service.
About once a day I get a SystemExit (stacktrace below) error email where a call to the service has failed. If I then try the exact same query on my site moments later it works fine.
... | Frequent SystemExit in Ruby when making HTTP calls | I have a Ruby on Rails Website that makes HTTP calls to an external Web Service.
About once a day I get a SystemExit (stacktrace below) error email where a call to the service has failed. If I then try the exact same query on my site moments later it works fine.
It's been happening since the site went live and I've ha... | [
"Using fcgi with Ruby is known to be very buggy. \nPractically everybody has moved to Mongrel for this reason, and I recommend you do the same.\n",
"It's been awhile since I used FCGI but I think a FCGI process could throw a SystemExit if the thread was taking too long. This could be the web service not respondi... | [
9,
8,
5,
1
] | [] | [] | [
"crash",
"ruby",
"ruby_on_rails"
] | stackoverflow_0000000514_crash_ruby_ruby_on_rails.txt |
Q:
Mac OS X: What is the best way to estimate the code & static data size of program?
I want to be able to get an estimate of how much code & static data is used by my C++ program?
Is there a way to find this out by looking at the executable or object files? Or perhaps something I can do at runtime?
Will otool help?... | Mac OS X: What is the best way to estimate the code & static data size of program? | I want to be able to get an estimate of how much code & static data is used by my C++ program?
Is there a way to find this out by looking at the executable or object files? Or perhaps something I can do at runtime?
Will otool help?
| [
"\n\"size\" is the traditional tool and works on all unix flavors. \n\"otool\" has a bit finer grain control and has a lot of options.\n\n.\n$ size python\n__TEXT __DATA __OBJC others dec hex\n860160 159744 0 2453504 3473408 350000\n\n",
"I think otool can help. Specifically, \"otool -s {segment}... | [
8,
2
] | [] | [] | [
"mach_o",
"macos"
] | stackoverflow_0000035491_mach_o_macos.txt |
Q:
How do I change my Active Sound Card on the Fly?
I currently have speakers set up both in my office and in my living room, connected to my PC via two sound cards, and would like to switch the set of speakers I'm outputting to on the fly.
Anyone know an application or a windows API call that I can use to change the... | How do I change my Active Sound Card on the Fly? | I currently have speakers set up both in my office and in my living room, connected to my PC via two sound cards, and would like to switch the set of speakers I'm outputting to on the fly.
Anyone know an application or a windows API call that I can use to change the default sound output device? It is currently a bit of... | [
"That topic is covered in depth here Easily Change or Switch the Default Audio Sound Output in Vista or XP. Note that sound management was changed in Vista significantly.\nOn a side note, I believe SnapStream is/was working on an application to allo multi-channel sound cards to output to different rooms (sets of s... | [
7
] | [] | [] | [
"audio",
"hardware",
"windows"
] | stackoverflow_0000035709_audio_hardware_windows.txt |
Q:
Linux GUI development
I have a large GUI project that I'd like to port to Linux.
What is the most recommended framework to utilize for GUI programming in Linux? Are Frameworks such as KDE / Gnome usable for this objective Or is better to use something more generic other than X?
I feel like if I chose one of Gnome... | Linux GUI development | I have a large GUI project that I'd like to port to Linux.
What is the most recommended framework to utilize for GUI programming in Linux? Are Frameworks such as KDE / Gnome usable for this objective Or is better to use something more generic other than X?
I feel like if I chose one of Gnome or KDE, I'm closing the ma... | [
"Your best bet may be to port it to a cross-platform widget library such as wxWidgets, which would give you portability to any platform wxWidgets supports.\nIt's also important to make the distinction between Gnome libraries and GTK, and likewise KDE libraries and Qt. If you write the code to use GTK or Qt, it shou... | [
15,
5,
4,
0
] | [] | [] | [
"c++",
"gnome",
"kde_plasma",
"linux",
"user_interface"
] | stackoverflow_0000035762_c++_gnome_kde_plasma_linux_user_interface.txt |
Q:
Programmatically editing Python source
This is something that I think would be very useful. Basically, I'd like there to be a way to edit Python source programmatically without requiring human intervention. There are a couple of things I would like to do with this:
Edit the configuration of Python apps that use... | Programmatically editing Python source | This is something that I think would be very useful. Basically, I'd like there to be a way to edit Python source programmatically without requiring human intervention. There are a couple of things I would like to do with this:
Edit the configuration of Python apps that use source modules for configuration.
Set up a ... | [
"Python's standard library provides pretty good facilities for working with Python source; note the tokenize and parser modules.\n",
"I had the same issue and I simply opened the file and did some replace: then reload the file in the Python interpreter. This works fine and is easy to do. \nOtherwise AFAIK you hav... | [
6,
0,
0
] | [] | [] | [
"file_io",
"python"
] | stackoverflow_0000032385_file_io_python.txt |
Q:
Anyone soloing using fogbugz?
Is there anyone working solo and using fogbugz out there? I'm interested in personal experience/overhead versus paper.
I am involved in several projects and get pretty hammered with lots of details to keep track of... Any experience welcome.
(Yes I know Mr. Joel is on the stackoverflo... | Anyone soloing using fogbugz? | Is there anyone working solo and using fogbugz out there? I'm interested in personal experience/overhead versus paper.
I am involved in several projects and get pretty hammered with lots of details to keep track of... Any experience welcome.
(Yes I know Mr. Joel is on the stackoverflow team... I still want good answers... | [
"I use it, especially since the hosted Version of FugBugz is free for up to 2 people. I found it a lot nicer than paper as I'm working on multiple projects, and my paper tends to get rather messy once you start making annotations or if you want to re-organize and shuffle tasks around, mark them as complete only to ... | [
35,
18,
14,
12,
7,
6,
1
] | [] | [] | [
"fogbugz"
] | stackoverflow_0000003180_fogbugz.txt |
Q:
FlexUnit component testing patterns: use addAsync or manually initialize?
We've been using Flex for about 6 months here at work, and I found that my first batches of FlexUnit tests involving custom components would tend to follow this sort of pattern:
import mx.core.Application;
import mx.events.FlexEvent;
import ... | FlexUnit component testing patterns: use addAsync or manually initialize? | We've been using Flex for about 6 months here at work, and I found that my first batches of FlexUnit tests involving custom components would tend to follow this sort of pattern:
import mx.core.Application;
import mx.events.FlexEvent;
import flexunit.framework.TestCase;
public class CustomComponentTest extends TestCase... | [
"I see nothing wrong with using the async version. I can agree that the second version is shorter, but I'm not sure that I think it's easier to follow. The test does a lot of things that you wouldn't normally do, whereas the first example is more true to how you would use the component outside the test environment.... | [
1
] | [] | [] | [
"apache_flex",
"unit_testing"
] | stackoverflow_0000035304_apache_flex_unit_testing.txt |
Q:
Desktop search utility for pdf,chm and djvu files
I want to write a tool that helps me search pdf/chm/djvu files in linux. Any pointers on how to go about it?
The major problem is reading/importing data from all these files. Can this be done with C and shell scripting?
A:
Tracker ships with Ubuntu 8.04 -- it w... | Desktop search utility for pdf,chm and djvu files | I want to write a tool that helps me search pdf/chm/djvu files in linux. Any pointers on how to go about it?
The major problem is reading/importing data from all these files. Can this be done with C and shell scripting?
| [
"Tracker ships with Ubuntu 8.04 -- it was a significant switch from Beagle which users believed was too resource (CPU) intensive and didn't yield good enough results. It indexes both pdf and chm and according to this bug report it also indexes djvu.\n",
"Note that djvu is an image compression format (optimized to... | [
1,
1,
0
] | [] | [] | [
"desktop_search"
] | stackoverflow_0000035722_desktop_search.txt |
Q:
Can an audio object be embedded in an InfoPath form?
Is it possible to embed an audio object (mp3, wma, whatever) in a web-enabled InfoPath form ?
If it is, how do you do it ?
A:
@Martin
That works for local forms that open in InfoPath. Nathan was asking about web-enabled forms. ActiveX controls are disabled... | Can an audio object be embedded in an InfoPath form? | Is it possible to embed an audio object (mp3, wma, whatever) in a web-enabled InfoPath form ?
If it is, how do you do it ?
| [
"@Martin\nThat works for local forms that open in InfoPath. Nathan was asking about web-enabled forms. ActiveX controls are disabled for web forms, as evidenced by the informational label at the bottom of the design controls when the form compatability has been set to the web.\nNow, I will admit that I know nothi... | [
1,
1,
0,
0
] | [] | [] | [
"audio",
"infopath",
"moss",
"sharepoint"
] | stackoverflow_0000034717_audio_infopath_moss_sharepoint.txt |
Q:
P/Invoke in Mono
What's the current status of Mono's Platform Invoke implementation on Linux and on Solaris?
A:
Working, usable and stable. It's well tested since quite a lot of mono's own low-level functionality has to be marshaled through it to the underlying operating system.
There are some P/Invoke extension... | P/Invoke in Mono | What's the current status of Mono's Platform Invoke implementation on Linux and on Solaris?
| [
"Working, usable and stable. It's well tested since quite a lot of mono's own low-level functionality has to be marshaled through it to the underlying operating system.\nThere are some P/Invoke extensions when compared to Microsoft .Net implementation (after all they deal with a single OS family and three architect... | [
29
] | [] | [] | [
".net",
"linux",
"mono",
"pinvoke",
"solaris"
] | stackoverflow_0000035853_.net_linux_mono_pinvoke_solaris.txt |
Q:
Is it possible to list named events in Windows?
I would like to create events for certain resources that are used across various processes and access these events by name. The problem seems to be that the names of the events must be known to all applications referring to them.
Is there maybe a way to get a list of... | Is it possible to list named events in Windows? | I would like to create events for certain resources that are used across various processes and access these events by name. The problem seems to be that the names of the events must be known to all applications referring to them.
Is there maybe a way to get a list of names events in the system?
I am aware that I might ... | [
"No, there is not any facility to enumerate named events. You could enumerate all objects in the respective object manager directory using ZwOpenDirectoryObject and then filter for events. But this routine is undocumented and therefore should not be used without good reason.\nWhy not use a separate mechanism to sha... | [
2,
1,
1
] | [] | [] | [
"events",
"windows"
] | stackoverflow_0000035748_events_windows.txt |
Q:
How do I autorun an application in a terminal in Ubuntu?
I've created a few autorun script files on various USB devices that run bash scripts when they mount. These scripts run "in the background", how do I get them to run in a terminal window? (Like the "Application in Terminal" gnome Launcher type.)
A:
Run th... | How do I autorun an application in a terminal in Ubuntu? | I've created a few autorun script files on various USB devices that run bash scripts when they mount. These scripts run "in the background", how do I get them to run in a terminal window? (Like the "Application in Terminal" gnome Launcher type.)
| [
"Run them as a two stage process with your \"autorun\" script calling the second script in a new terminal eg\ngnome-terminal -e top --title Testing\n\nWould run the program \"top\" in a new gnome terminal window with the title \"Testing\" You can add additional arguments like setting the geometry to determine the s... | [
5,
1
] | [] | [] | [
"autorun",
"bash",
"gnome",
"ubuntu"
] | stackoverflow_0000035905_autorun_bash_gnome_ubuntu.txt |
Q:
Launch a file with command line arguments without knowing location of exe?
Here's the situation: I am trying to launch an application, but the location of the .exe isn't known to me. Now, if the file extension is registered (in Windows), I can do something like:
Process.Start("Sample.xls");
However, I need to pa... | Launch a file with command line arguments without knowing location of exe? | Here's the situation: I am trying to launch an application, but the location of the .exe isn't known to me. Now, if the file extension is registered (in Windows), I can do something like:
Process.Start("Sample.xls");
However, I need to pass some command line arguments as well. I couldn't get this to work
Process ... | [
"Using my code from this answer you can get command associated with xls extension. Then you can pass this command to Process.Start method.\n",
"If you query the registry, you can retrieve the data about the registered file type and then call the app directly passing the command line arguments. See Programmatical... | [
4,
2
] | [] | [] | [
".net",
"c#",
"vb.net"
] | stackoverflow_0000035914_.net_c#_vb.net.txt |
Q:
Decision making in distributed applications
With a distributed application, where you have lots of clients and one main server, should you:
Make the clients dumb and the server smart: clients are fast and non-invasive. Business rules are needed in only 1 place
Make the clients smart and the server dumb: take as m... | Decision making in distributed applications | With a distributed application, where you have lots of clients and one main server, should you:
Make the clients dumb and the server smart: clients are fast and non-invasive. Business rules are needed in only 1 place
Make the clients smart and the server dumb: take as much load as possible off of the server
Additiona... | [
"You should do as much client-side processing as possible. This will enable your application to scale better than doing processing server-side. To solve your temperamental user problem, you could look into making your client processes run at a very low priority so there's no noticeable decrease in performance on th... | [
3,
2,
0
] | [] | [] | [
"distributed"
] | stackoverflow_0000035707_distributed.txt |
Q:
Log files in massively distributed systems
I do a lot of work in the grid and HPC space and one of the biggest challenges we have with a system distributed across hundreds (or in some case thousands) of servers is analysing the log files.
Currently log files are written locally to the disk on each blade but we c... | Log files in massively distributed systems | I do a lot of work in the grid and HPC space and one of the biggest challenges we have with a system distributed across hundreds (or in some case thousands) of servers is analysing the log files.
Currently log files are written locally to the disk on each blade but we could also consider publishing logging informatio... | [
"First, synchronize all clocks in the system using NTP.\nSecond, if you are collecting the logs in a single location (like the UDP appender you mention) make sure the logs have enough information to actually help. I would include at least the server that generated the log, the time it happened, and the message. I... | [
3,
0
] | [] | [] | [
"distributed_computing",
"hpc"
] | stackoverflow_0000035292_distributed_computing_hpc.txt |
Q:
Web server statics repository -or- ZFS vs. NTFS
My goal is to maintain a web file server separately from my main ASP.NET application server for better scalability. The web file server will store a lot of files downloaded by users.
So the question is: Is it worth to adopt FreeBSD + Apache + ZFS, or will good old II... | Web server statics repository -or- ZFS vs. NTFS | My goal is to maintain a web file server separately from my main ASP.NET application server for better scalability. The web file server will store a lot of files downloaded by users.
So the question is: Is it worth to adopt FreeBSD + Apache + ZFS, or will good old IIS be сonvenient enough?
| [
"I understand you will serve only static files. In this case, lightweight HTTP servers will give you a higher performance for a given machine. The following are well known:\n\nLighttpd\nThttpd\nNginx\n\nMany more are listed on Wikipedia. There's a more recent article on IBM DeveloperWorks.\n",
"It all depends on ... | [
2,
1,
0
] | [] | [] | [
"bsd",
"windows"
] | stackoverflow_0000027784_bsd_windows.txt |
Q:
I don't understand std::tr1::unordered_map
I need an associative container that makes me index a certain object through a string, but that also keeps the order of insertion, so I can look for a specific object by its name or just iterate on it and retrieve objects in the same order I inserted them.
I think this hy... | I don't understand std::tr1::unordered_map | I need an associative container that makes me index a certain object through a string, but that also keeps the order of insertion, so I can look for a specific object by its name or just iterate on it and retrieve objects in the same order I inserted them.
I think this hybrid of linked list and hash map should do the j... | [
"You've asked for the canonical reason why Boost::MultiIndex was made: list insertion order with fast lookup by key. Boost MultiIndex tutorial: list fast lookup\n",
"You need to index an associative container two ways:\n\nInsertion order\nString comparison\n\nTry Boost.MultiIndex or Boost.Intrusive. I haven't ... | [
17,
7,
4,
2,
0,
0
] | [
"@wesc: STL has std::map... so what's the difference with unordered_map? I don't think STL would implement twice the same thing and call it differently.\n"
] | [
-3
] | [
"c++",
"tr1",
"unordered_map"
] | stackoverflow_0000035950_c++_tr1_unordered_map.txt |
Q:
How do you full-text search multiple criteria on left-joined tables in SQL Server?
I have a query that originally looks like this:
select c.Id, c.Name, c.CountryCode, c.CustomerNumber, cacc.AccountNumber, ca.Line1, ca.CityName, ca.PostalCode
from dbo.Customer as c
left join dbo.CustomerAddress as ca on ca.Customer... | How do you full-text search multiple criteria on left-joined tables in SQL Server? | I have a query that originally looks like this:
select c.Id, c.Name, c.CountryCode, c.CustomerNumber, cacc.AccountNumber, ca.Line1, ca.CityName, ca.PostalCode
from dbo.Customer as c
left join dbo.CustomerAddress as ca on ca.CustomerId = c.Id
left join dbo.CustomerAccount as cacc on cacc.CustomerId = c.Id
where c.Count... | [
"NOTE: This isn't really an answer, just an attempt to clarify what might actually be causing the performance problem(s).\n90,000 records is really a fairly small data set and the query is relatively simple with just two join. Do you have indexes on CustomerAddress.CustomerId and CustomerAccount.CustomerId? That se... | [
1,
1,
1
] | [] | [] | [
"full_text_search",
"sql_server"
] | stackoverflow_0000035954_full_text_search_sql_server.txt |
Q:
Yaws uses old config file
I'm developing a web app on Yaws 1.65 (installed through apt) running on Debian etch on a VPS with UML. Whenever I do /etc/init.d/yaws restart or a stop/start, it initializes according to an old version of the config file (/etc/yaws/yaws.conf).
I know this because I changed the docroot f... | Yaws uses old config file | I'm developing a web app on Yaws 1.65 (installed through apt) running on Debian etch on a VPS with UML. Whenever I do /etc/init.d/yaws restart or a stop/start, it initializes according to an old version of the config file (/etc/yaws/yaws.conf).
I know this because I changed the docroot from the default to another dire... | [
"I'm completely inexperienced with yaws, but I have a troubleshooting suggestion: What happens if you remove the config file completely? If it still starts yaws without a config file, that could be a clear sign that something is being cached.\nFor what it's worth, with a quick 5 minutes of googling, I found no ment... | [
1
] | [] | [] | [
"yaws"
] | stackoverflow_0000036030_yaws.txt |
Q:
How do you test/change untested and untestable code?
Lately I had to change some code on older systems where not all of the code has unit tests.
Before making the changes I want to write tests, but each class created a lot of dependencies and other anti-patterns which made testing quite hard.
Obviously, I wanted t... | How do you test/change untested and untestable code? | Lately I had to change some code on older systems where not all of the code has unit tests.
Before making the changes I want to write tests, but each class created a lot of dependencies and other anti-patterns which made testing quite hard.
Obviously, I wanted to refactor the code to make it easier to test, write the t... | [
"First of all, here's a great article with tips on unit testing. Secondly, I found a great way to avoid making tons of changes in old code is to just refactor it a little until you can test it. One easy way to do this is to make private members protected, and then override the protected field.\nFor example, let's... | [
6,
3,
0,
0
] | [] | [] | [
"legacy",
"refactoring",
"unit_testing"
] | stackoverflow_0000007287_legacy_refactoring_unit_testing.txt |
Q:
Trouble with parallel make not always starting another job when one finishes
I'm working on a system with four logical CPS (two dual-core CPUs if it matters). I'm using make to parallelize twelve trivially parallelizable tasks and doing it from cron.
The invocation looks like:
make -k -j 4 -l 3.99 -C [dir] [12 ta... | Trouble with parallel make not always starting another job when one finishes | I'm working on a system with four logical CPS (two dual-core CPUs if it matters). I'm using make to parallelize twelve trivially parallelizable tasks and doing it from cron.
The invocation looks like:
make -k -j 4 -l 3.99 -C [dir] [12 targets]
The trouble I'm running into is that sometimes one job will finish but the... | [
"I'd drop the '-l'\nIf all you plan to run the the system is this build I think the -j 4 does what you want.\nBased on my memory, if you have anything else running (crond?), that can push the load average over 4.\nGNU make ref\n",
"Does make think one of the targets is failing? If so, it will stop the make after... | [
1,
0,
0
] | [] | [] | [
"makefile"
] | stackoverflow_0000035407_makefile.txt |
Q:
How to assign a method's output to a textbox value without code behind
How do I assign a method's output to a textbox value without code behind?
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server"... | How to assign a method's output to a textbox value without code behind | How do I assign a method's output to a textbox value without code behind?
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Public TextFromString As String = "test text test text"
Public Tex... | [
"There's a couple of different expression types in .ASPX files. There's:\n<%= TextFromMethod %>\n\nwhich simply reserves a literal control, and outputs the text at render time.\nand then there's:\n<%# TextFromMethod %>\n\nwhich is a databinding expression, evaluated when the control is DataBound(). There's also exp... | [
2,
1
] | [] | [] | [
"asp.net",
"vb.net"
] | stackoverflow_0000036028_asp.net_vb.net.txt |
Q:
Is using PHP accelerators such as MMCache or Zend Accelerator making PHP faster?
Does anybody have experience working with PHP accelerators such as MMCache or Zend Accelerator? I'd like to know if using either of these makes PHP comparable to faster web-technologies. Also, are there trade offs for using these?
... | Is using PHP accelerators such as MMCache or Zend Accelerator making PHP faster? | Does anybody have experience working with PHP accelerators such as MMCache or Zend Accelerator? I'd like to know if using either of these makes PHP comparable to faster web-technologies. Also, are there trade offs for using these?
| [
"Note that Zend Optimizer and MMCache (or similar applications) are totally different things. While Zend Optimizer tries to optimize the program opcode MMCache will cache the scripts in memory and reuse the precompiled code.\nI did some benchmarks some time ago and you can find the results in my blog (in German tho... | [
13,
5,
3,
2,
2,
1,
1,
1,
0,
0
] | [] | [] | [
"caching",
"php",
"zend_optimizer"
] | stackoverflow_0000012936_caching_php_zend_optimizer.txt |