instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I got a program that writes some data to a file using a method like the one below.
public void ExportToFile(string filename)
{
using(FileStream fstream = new FileStream(filename,FileMode.Create))
using (TextWriter writer = new StreamWriter(fstream))
{
// try catch block for write permissions
... | To handle the `UnauthorizedAccessException` in your code, you can wrap the `ExportToFile` logic within a try-catch block. Here's how you could modify your `ExportToFile` method to catch that specific exception:
```csharp
public void ExportToFile(string filename)
{
try
{
using (FileStream fstream = new ... | 14,313 | [
{
"from": "human",
"value": "I got a program that writes some data to a file using a method like the one below.\n\npublic void ExportToFile(string filename)\n{\n using(FileStream fstream = new FileStream(filename,FileMode.Create))\n using (TextWriter writer = new StreamWriter(fstream))\n {\n ... |
I want an expression that will fail when it encounters words such as "boon.ini" and "http". The goal would be to take this expression and be able to construct for any set of keywords.
| To create an expression that fails when encountering specific keywords such as "boon.ini" and "http", you can use a regular expression (regex) in many programming languages. The regex pattern can be constructed to match any of the specified keywords.
Here's an example of how you could structure a regex pattern for thi... | 13,070 | [
{
"from": "human",
"value": "I want an expression that will fail when it encounters words such as \"boon.ini\" and \"http\". The goal would be to take this expression and be able to construct for any set of keywords.\n"
},
{
"from": "gpt",
"value": "To create an expression that fails when encoun... |
I need to create a repeatable process for deploying SQL Server Reporting Services reports. I am not in favor of using Visual Studio and or Business Development Studio to do this. The rs.exe method of scripting deployments also seems rather clunky. Does anyone have a very elegant way that they have been able to deplo... | Automating the deployment of SQL Server Reporting Services (SSRS) reports without relying on Visual Studio or `rs.exe` can be challenging, but there are several alternatives you can consider. Below are a few elegant approaches that can help you achieve a repeatable and automated deployment process:
### 1. **PowerShell... | 7,706 | [
{
"from": "human",
"value": "I need to create a repeatable process for deploying SQL Server Reporting Services reports. I am not in favor of using Visual Studio and or Business Development Studio to do this. The rs.exe method of scripting deployments also seems rather clunky. Does anyone have a very eleg... |
Is there a way to add a resource to a ResourceDictionary from code without giving it a resource key?
For instance, I have this resource in XAML:
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type xbap:FieldPropertyInfo}"
ItemsSource="{Binding Path=Value.Values}">
<TextBlock Text="{... | In WPF, when you're defining resources in XAML without a key, it's generally intended to be used for a specific type of data without being explicitly referenced. When you create resources programmatically, you do need to provide a key to store it in the `ResourceDictionary`, which means you can't truly replicate the be... | 15,393 | [
{
"from": "human",
"value": "Is there a way to add a resource to a ResourceDictionary from code without giving it a resource key?\nFor instance, I have this resource in XAML:\n<TreeView.Resources>\n <HierarchicalDataTemplate DataType=\"{x:Type xbap:FieldPropertyInfo}\"\n ItemsSource=\"{Binding Pat... |
I've been a Unix-based web programmer for years (Perl and PHP). I'm also competent with C and C++ (and bash and that sort of sysadmin sort of stuff) in terms of the language itself. I've never had a problem learning a new language (I mucked around with Java a few years ago and whilst I could write it I just didn't li... | It's great to hear that you're looking to expand your programming repertoire into Windows application development! Given your background in C and C++, you're well-positioned to dive into native Windows development. Let's break down the options you have in Visual Studio, as well as wxWidgets and Qt.
### Microsoft Optio... | 8,876 | [
{
"from": "human",
"value": "I've been a Unix-based web programmer for years (Perl and PHP). I'm also competent with C and C++ (and bash and that sort of sysadmin sort of stuff) in terms of the language itself. I've never had a problem learning a new language (I mucked around with Java a few years ago and... |
When you send an email using C# and the System.Net.Mail namespace, you can set the "From" and "Sender" properties on the MailMessage object, but neither of these allows you to make the MAIL FROM and the from address that goes into the DATA section different from each other. MAIL FROM gets set to the "From" property va... | You are correct in your assessment of the behavior of the `System.Net.Mail` namespace in C#. In this namespace, the `From` property sets the sender's email address for the SMTP envelope, and any additional `Sender` field is added as a header in the email body. Unfortunately, it doesn't allow for the `MAIL FROM` SMTP co... | 14,328 | [
{
"from": "human",
"value": "When you send an email using C# and the System.Net.Mail namespace, you can set the \"From\" and \"Sender\" properties on the MailMessage object, but neither of these allows you to make the MAIL FROM and the from address that goes into the DATA section different from each other. ... |
I'm a web-guy stuck in "application world" in VS 2005. I created my windows forms program and want to give my end users the ability to install it (and some of it's resources) into a standard Program Files/App Directory location along with a start menu/desktop launcher.
The help files don't give any instructions (tha... | Creating an installer for your Windows Forms application in Visual Studio 2005 can indeed be a bit confusing if you're not familiar with the process. Here's a step-by-step guide to help you create a simple installer using the Visual Studio Setup and Deployment project.
### Step 1: Create a Setup Project
1. **Open you... | 13,230 | [
{
"from": "human",
"value": "I'm a web-guy stuck in \"application world\" in VS 2005. I created my windows forms program and want to give my end users the ability to install it (and some of it's resources) into a standard Program Files/App Directory location along with a start menu/desktop launcher. \nThe... |
I looked for the name of a procedure, which applies a tree structure of procedures to a tree structure of data, yielding a tree structure of results - all three trees having the same structure.
Such a procedure might have the signature:
(map-tree data functree)
Its return value would be the result of elementwise ap... | It seems that you're looking for a higher-order function that applies a tree-like structure of functions (functree) to a tree-like structure of data (data) to produce a tree of results. This kind of operation is indeed common in functional programming and is often referred to as "mapping" over tree structures.
In Sche... | 10,948 | [
{
"from": "human",
"value": "I looked for the name of a procedure, which applies a tree structure of procedures to a tree structure of data, yielding a tree structure of results - all three trees having the same structure. \nSuch a procedure might have the signature: \n(map-tree data functree)\nIts return... |
We have a program that produces several SWF files, some CSS and XML files, all of which need to be deployed for the thing to work.
Is there a program or technique out there for wrapping all these files together into a single SWF file?
| Wrapping multiple files (like SWF, CSS, and XML) into a single SWF file is not directly supported because SWF files are primarily designed to contain ActionScript and vector graphics, not to function as archives. However, you can employ some techniques to effectively bundle these resources together for deployment.
###... | 8,800 | [
{
"from": "human",
"value": "We have a program that produces several SWF files, some CSS and XML files, all of which need to be deployed for the thing to work.\nIs there a program or technique out there for wrapping all these files together into a single SWF file?\n"
},
{
"from": "gpt",
"value":... |
I have a datagridview that accepts a list(of myObject) as a datasource. I want to add a new row to the datagrid to add to the database. I get this done by getting the list... adding a blank myObject to the list and then reseting the datasource. I now want to set the focus to the second cell in the new row.
To CLARIFY i... | To set focus to a specific cell in a DataGridView after adding a new row, you can use the `CurrentCell` property of the DataGridView. Here’s how you can do it step by step:
1. Add a new blank `myObject` to your list.
2. Reset the `DataSource` of the DataGridView to reflect the updated list.
3. Set the `CurrentCell` pr... | 11,050 | [
{
"from": "human",
"value": "I have a datagridview that accepts a list(of myObject) as a datasource. I want to add a new row to the datagrid to add to the database. I get this done by getting the list... adding a blank myObject to the list and then reseting the datasource. I now want to set the focus to the... |
I'm using NHibernate 2 and PostgreSQL in my project. SchemaExport class does a great job generating DDL scheme for database, but it's great until the first application.
Is there any way to generate "migration" DLL (batch of "ALTER TABLE"'s instead of DROP/CREATE pair) using NHibernate mapping files?
| NHibernate's SchemaExport class is primarily designed to create and drop schemas rather than perform migrations or alterations of existing tables. Unfortunately, NHibernate 2 does not natively support generating migration scripts like you might find in some other ORM frameworks.
However, there are a few approaches you... | 13,992 | [
{
"from": "human",
"value": "I'm using NHibernate 2 and PostgreSQL in my project. SchemaExport class does a great job generating DDL scheme for database, but it's great until the first application. \nIs there any way to generate \"migration\" DLL (batch of \"ALTER TABLE\"'s instead of DROP/CREATE pair) usin... |
I'm writing a series of Windows services. I want them to fail if errors are thrown during startup (in OnStart() method). I had assumed that merely throwing an error in OnStart() would do this, but I'm finding that instead it "Starts" and presents me with a message stating "The service has started, but is inactive. I... | In a Windows service, the `OnStart` method is responsible for initializing the service and starting its operations. If an exception is thrown during the execution of `OnStart`, the service may not shut down as you expect, and you may see a message indicating that the service has started but is inactive.
To ensure that... | 14,088 | [
{
"from": "human",
"value": "I'm writing a series of Windows services. I want them to fail if errors are thrown during startup (in OnStart() method). I had assumed that merely throwing an error in OnStart() would do this, but I'm finding that instead it \"Starts\" and presents me with a message stating \"... |
I am using Spry (SpryData.js,xpath.js)
var ds1 = new Spry.Data.XMLDataSet("_db/db.xml", "bildiriler/bildiri",{useCache:false});
// load the xml tree
....
<!-- use it in a loop -
Sometimes the page use "ds1.loadData();" to refresh the data -->
<div spry:region="ds1" spry:repeatchildren="ds1">
<a href="#">{auth... | To show a loader animation or "Loading text" while the XML data is being loaded in your Spry DataSet, you can take advantage of the `onLoad` and `onError` events provided by the `XMLDataSet` object. You can display a loader when you initiate the data loading and hide it once the data has successfully loaded or if there... | 15,244 | [
{
"from": "human",
"value": "I am using Spry (SpryData.js,xpath.js)\n var ds1 = new Spry.Data.XMLDataSet(\"_db/db.xml\", \"bildiriler/bildiri\",{useCache:false});\n // load the xml tree\n\n....\n<!-- use it in a loop - \n Sometimes the page use \"ds1.loadData();\" to refresh the data -->\n <div spry:regi... |
I'd like to integrate a Python IDLE-esque command prompt interface into an existing NI-CVI (LabWindows) application. I've tried to follow the Python.org discussions but seem to get lost in the details. Is there a resource out there for dummies like me?
| Integrating a Python command prompt interface into a National Instruments LabWindows/CVI application can be a complex task, especially if you're not familiar with both environments. Here are some simplified steps and resources that may help you get started:
### 1. **Understand the Requirements**
- You want to integ... | 12,332 | [
{
"from": "human",
"value": "I'd like to integrate a Python IDLE-esque command prompt interface into an existing NI-CVI (LabWindows) application. I've tried to follow the Python.org discussions but seem to get lost in the details. Is there a resource out there for dummies like me?\n"
},
{
"from": ... |
I am having the problem that I cannot select a specific XML node which needs to be deleted. I have already tried to select the node by using the XPath which works fine for some XML files but I cannot figure out the correct XPath for a node in a more complex file.
Does anybody know a freeware tool which can load a XML f... | The issue you're encountering with your XPath expression may be related to XML namespaces. The XML you provided has a default namespace (defined by the `xmlns` attribute in the `<SmsFormData>` element), which means that your XPath expressions need to take that namespace into account.
In XPath, if you want to select no... | 15,125 | [
{
"from": "human",
"value": "I am having the problem that I cannot select a specific XML node which needs to be deleted. I have already tried to select the node by using the XPath which works fine for some XML files but I cannot figure out the correct XPath for a node in a more complex file.\nDoes anybody k... |
We have a series of closed source applications and libraries, for which we think it would make sense opening up the source code.
What has been blocking us, so far, is the effort needed to clean up the code base and documenting the source before opening up.
We want to open up the source only if we have a reasonable chan... | When considering the success of an open-source project, several factors beyond the inherent "interestingness" and "usefulness" of the codebase can significantly influence its potential for attracting contributors and fostering a vibrant community. Here are several important factors to consider:
### 1. **Cleanliness of... | 12,597 | [
{
"from": "human",
"value": "We have a series of closed source applications and libraries, for which we think it would make sense opening up the source code.\nWhat has been blocking us, so far, is the effort needed to clean up the code base and documenting the source before opening up.\nWe want to open up t... |
When trying to distribute work that requires a multiple stage processing pipeline what are the communication, synchronization and throughput costs limitations in JMS vs JavaSpaces?
| When considering a multiple-stage processing pipeline in distributed systems, both Java Message Service (JMS) and JavaSpaces provide mechanisms for communication and synchronization, but they do so in different ways and are subject to different limitations regarding costs and throughput. Here’s a breakdown of the commu... | 10,702 | [
{
"from": "human",
"value": "When trying to distribute work that requires a multiple stage processing pipeline what are the communication, synchronization and throughput costs limitations in JMS vs JavaSpaces?\n"
},
{
"from": "gpt",
"value": "When considering a multiple-stage processing pipeline... |
I have implemented the WMD control that Stack Overflow uses into a project of mine, it almost works like a charm, but when I save the changes to the database it is saving the HTML version and not the Markdown version.
So where I have this in my text box:
**boldtext**
It is really saving this:
<b>boldtext</b>
How do I... | To save the Markdown version instead of the HTML version in your project, you need to ensure that you are correctly converting the input to Markdown before saving it to your database. Here's a general approach to achieve this:
1. **Capture the User Input**: When the user submits their input (e.g., from a form), ensure... | 15,066 | [
{
"from": "human",
"value": "I have implemented the WMD control that Stack Overflow uses into a project of mine, it almost works like a charm, but when I save the changes to the database it is saving the HTML version and not the Markdown version.\nSo where I have this in my text box:\n**boldtext**\n\nIt is ... |
I have a large legacy codebase with very complicated makefiles, with lots of variables. Sometimes I need to change them, and I find that it's very difficult to figure out why the change isn't working the way I expect. What I'd like to find is a tool that basically does step-through-debugging of the "make" process, wh... | Debugging complex Makefiles can indeed be quite challenging, especially in large legacy codebases. While `make` does provide some built-in debugging flags, they might not give you the detailed insights you're looking for. Here are a few suggestions to help you step through the `make` process and inspect variable values... | 12,259 | [
{
"from": "human",
"value": "I have a large legacy codebase with very complicated makefiles, with lots of variables. Sometimes I need to change them, and I find that it's very difficult to figure out why the change isn't working the way I expect. What I'd like to find is a tool that basically does step-th... |
I would like to be able to override the default behaviour for positioning the caret in a masked textbox.
The default is to place the caret where the mouse was clicked, the masked textbox already contains characters due to the mask.
I know that you can hide the caret as mentioned in this post, is there something similar... | Certainly! You can control the positioning of the caret in a masked textbox (or any textbox) programmatically. If you're using WinForms in C#, for example, you can handle the `Enter` event of the masked textbox to set the caret position to the beginning of the textbox whenever it gains focus.
Here’s a simple implement... | 13,947 | [
{
"from": "human",
"value": "I would like to be able to override the default behaviour for positioning the caret in a masked textbox.\nThe default is to place the caret where the mouse was clicked, the masked textbox already contains characters due to the mask.\nI know that you can hide the caret as mention... |
We are utilizing the XML data type in Microsoft SQL Server 2005 for a project. Some members of the team and I feel that we should also use XSDs while members of the other camp feel that we should keep the XMLs ad hoc and not treat them as "types".
The XMLs are an effort to bring structure and centrality to a number of ... | Using XML schemas (XSDs) with your XML data has several advantages and disadvantages, particularly in the context of your project with SQL Server 2005 and .NET 3.5/C#. Here’s a summary to help clarify:
### Advantages of Using XML Schemas (XSDs)
1. **Validation**:
- XSDs provide a formal structure for your XML dat... | 11,892 | [
{
"from": "human",
"value": "We are utilizing the XML data type in Microsoft SQL Server 2005 for a project. Some members of the team and I feel that we should also use XSDs while members of the other camp feel that we should keep the XMLs ad hoc and not treat them as \"types\".\nThe XMLs are an effort to br... |
We want to be able to advance our business by utilizing both of the power of KOFAX and SharePoint 2007. Any pointers Development-wise?
| Integrating Kofax with SharePoint 2007 can enhance your business processes by streamlining document capture, management, and workflow. Here are some development pointers to consider:
### 1. **Understand the Integration Points**
- **Document Capture:** Use Kofax to scan and capture documents which can then be sent d... | 14,679 | [
{
"from": "human",
"value": "We want to be able to advance our business by utilizing both of the power of KOFAX and SharePoint 2007. Any pointers Development-wise?\n"
},
{
"from": "gpt",
"value": "Integrating Kofax with SharePoint 2007 can enhance your business processes by streamlining document... |
What all would be the requirements for the following scenario:
A GSM modem connected to a PC running
a web based (ASP.NET) application. In
the application the user selects a
phone number from a list of phone nos.
When he clicks on a button named the
PC should call the selected phone
number. When the person... | To implement the scenario you described, several requirements beyond just ASP.NET, a database for storing phone numbers, and a GSM modem will need to be addressed. Below is a list of those requirements grouped into several categories:
### 1. **Hardware Requirements**
- **GSM Modem**: A compatible GSM modem that suppor... | 11,614 | [
{
"from": "human",
"value": "What all would be the requirements for the following scenario:\n\nA GSM modem connected to a PC running\n a web based (ASP.NET) application. In\n the application the user selects a\n phone number from a list of phone nos.\n When he clicks on a button named the\n PC should c... |
I'm trying to find a source control for my own personal use that's as simple as possible. The main feature I need is being able to read/pull a past version of my code. I am the only developer. I've looked at a lot of different version control systems, but they all seem way more complicated than I need. I need one t... | Hi Mike,
Based on your requirements for a simple version control system that runs on Windows, interacts solely with the local filesystem, and ideally has a graphical user interface, here are a few options you might consider:
1. **Git with a GUI Client**:
- **Git** itself is widely used and can be configured to wor... | 13,955 | [
{
"from": "human",
"value": "I'm trying to find a source control for my own personal use that's as simple as possible. The main feature I need is being able to read/pull a past version of my code. I am the only developer. I've looked at a lot of different version control systems, but they all seem way mo... |
I am developing a web app which requires a username and password to be stored in the web.Config, it also refers to some URLs which will be requested by the web app itself and never the client.
I know the .Net framework will not allow a web.config file to be served, however I still think its bad practice to leave this s... | It's crucial to keep sensitive information such as usernames and passwords secure, even if it's stored in `web.config`. Since you're limited in terms of access and can't use command-line tools or the registry, you can implement encryption for the values in your `web.config` file. Below are some approaches and libraries... | 8,625 | [
{
"from": "human",
"value": "I am developing a web app which requires a username and password to be stored in the web.Config, it also refers to some URLs which will be requested by the web app itself and never the client.\nI know the .Net framework will not allow a web.config file to be served, however I st... |
I'm building some routing functionality between services. The original service and the service that does the routing have an identical configuration; both are using netTcpBinding with the following binding configuration:
netTcpBinding
security mode="Message"
message clientCredentialType="UserName"
The service behavi... | Your understanding of the issue is on the right track. The exception message you're seeing suggests a problem with the security context token, which can occur due to several reasons, including expired tokens, mismatched bindings, or even issues with how the message is being processed by the intermediate relay service.
... | 10,193 | [
{
"from": "human",
"value": "I'm building some routing functionality between services. The original service and the service that does the routing have an identical configuration; both are using netTcpBinding with the following binding configuration:\n\nnetTcpBinding\nsecurity mode=\"Message\"\nmessage clie... |
Inside a .NET 3.5 web app running impersonation I am trying to execute a process via:
var process = new Process
{ StartInfo =
{ CreateNoWindow = true,
FileName = "someFileName",
Domain = "someDomain",
Username = "som... | The "Access is Denied" error you're encountering when trying to start a process with impersonation in a .NET application running on IIS can be challenging to troubleshoot. Here are several potential issues and solutions that might help you resolve this:
### 1. Permission Issues
Even if you have set the trust level to ... | 11,584 | [
{
"from": "human",
"value": "Inside a .NET 3.5 web app running impersonation I am trying to execute a process via:\nvar process = new Process \n { StartInfo = \n { CreateNoWindow = true, \n FileName = \"someFileName\", \n Domain = \"so... |
I happened to debate with a friend during college days whether advanced mathematics is necessary for any veteran programmer. He used to argue fiercely against that. He said that programmers need only basic mathematical knowledge from high school or fresh year college math, no more no less, and that almost all of progra... | The debate you've had with your friend is a common one in the programming and computer science community. Each side has valid points, and the necessity of advanced mathematics for a programmer can depend on various factors, including the specific field of programming, the complexity of the problems being solved, and th... | 13,289 | [
{
"from": "human",
"value": "I happened to debate with a friend during college days whether advanced mathematics is necessary for any veteran programmer. He used to argue fiercely against that. He said that programmers need only basic mathematical knowledge from high school or fresh year college math, no mo... |
I've become lazy in my old age. For my C# work I've become quite reliant on Roland Weigelt's excellent GhostDoc plugin for Visual Studio.
Is anyone aware of a similar plugin for Java work in IntelliJ IDEA?
| Yes, for Java development in IntelliJ IDEA, you can use the built-in **Doc Comments** feature, which is quite powerful for generating JavaDoc comments automatically. Simply type `/**` above a method, class, or field and press `Enter`. IntelliJ IDEA will generate a doc comment template based on the context, including pa... | 16,314 | [
{
"from": "human",
"value": "I've become lazy in my old age. For my C# work I've become quite reliant on Roland Weigelt's excellent GhostDoc plugin for Visual Studio.\nIs anyone aware of a similar plugin for Java work in IntelliJ IDEA?\n"
},
{
"from": "gpt",
"value": "Yes, for Java development i... |
Let's say you have a class with a Uri property. Is there any way to get that property to accept both a string value and a Uri? How would you build it?
I'd like to be able to do something like one of the following, but neither are supported (using VB, since it lets you specify type in the Set declaration for the 2nd o... | In VB.NET, you can't have overloaded properties directly for different types (like you tried with `Link1` for `Uri` and `Link1` for `String`), but you can implement a workaround by using a single property with a custom setter that checks the type of the value being assigned.
One approach is to create a single propert... | 15,538 | [
{
"from": "human",
"value": "Let's say you have a class with a Uri property. Is there any way to get that property to accept both a string value and a Uri? How would you build it?\nI'd like to be able to do something like one of the following, but neither are supported (using VB, since it lets you specify... |
I have a very simple bit of script that changes the status of an item in a MySql database - it works fine in IE7, but if I try it in Firefox, it looks like it's worked, but hasn't... Which is extremely odd.
The code is very simple - first I get the details of the record I'm looking for:
<cfscript>
// Get the Product At... | It's frustrating when server-side code behaves differently across browsers, especially when it seems to work fine in one browser but not in another. However, in this case, the issue might not be with the server-side code itself but rather how the different browsers handle requests, caching, or other behaviors.
Here ar... | 12,087 | [
{
"from": "human",
"value": "I have a very simple bit of script that changes the status of an item in a MySql database - it works fine in IE7, but if I try it in Firefox, it looks like it's worked, but hasn't... Which is extremely odd.\nThe code is very simple - first I get the details of the record I'm loo... |
What would be the best way to expose certain functionality in a Dotnet VSTO Excel add-in to VBA, without requiring the user to be a local administrator (i.e. no COM registration, no HttpListener)? Would it be possible to use Microsoft Message Queues from VBA?
| Exposing functionality from a .NET VSTO (Visual Studio Tools for Office) Excel add-in to VBA (Visual Basic for Applications) without requiring COM registration or additional permissions can be a challenge. However, there are several approaches that can be taken, each with its pros and cons.
### Possible Approaches:
1... | 14,585 | [
{
"from": "human",
"value": "What would be the best way to expose certain functionality in a Dotnet VSTO Excel add-in to VBA, without requiring the user to be a local administrator (i.e. no COM registration, no HttpListener)? Would it be possible to use Microsoft Message Queues from VBA?\n"
},
{
"fr... |
I have a generic method defined like this:
public void MyMethod<T>(T myArgument)
The first thing I want to do is check if the value of myArgument is the default value for that type, something like this:
if (myArgument == default(T))
But this doesn't compile because I haven't guaranteed that T will implement the == op... | You're correct that working with generics in C# can lead to complications when dealing with default values, especially when you want to support both reference types and value types.
Here's a clean way to handle your scenario without redundancy and while maintaining type safety:
### Solution using Nullable<T>
You ca... | 14,001 | [
{
"from": "human",
"value": "I have a generic method defined like this:\npublic void MyMethod<T>(T myArgument)\n\nThe first thing I want to do is check if the value of myArgument is the default value for that type, something like this:\nif (myArgument == default(T))\n\nBut this doesn't compile because I hav... |
Every sample that I have seen uses static XML in the xmldataprovider source, which is then used to databind UI controls using XPath binding.
Idea is to edit a dynamic XML (structure known to the developer during coding), using the WPF UI.
Has anyone found a way to load a dynamic xml string (for example load it from a ... | Certainly! If you want to load an XML string dynamically at runtime and bind it to WPF UI controls, you can use an `XmlDataProvider` programmatically in your code-behind. Here’s how you can achieve this:
### Step-by-step Implementation
1. **Load the XML String**: You will load your XML string from a file or any other... | 10,857 | [
{
"from": "human",
"value": "Every sample that I have seen uses static XML in the xmldataprovider source, which is then used to databind UI controls using XPath binding. \nIdea is to edit a dynamic XML (structure known to the developer during coding), using the WPF UI.\nHas anyone found a way to load a dyna... |
Code:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Unusual Array Lengths!</title>
<script type="text/javascript">
var arrayList = new Array();
arrayList = [1, 2, 3, 4, 5, ];
alert(arrayList.length);
</script>
</head>
<body>
</body>
</html>
Notice the extra comma in th... | It's a good observation that different browsers may behave differently when it comes to JavaScript and handling extra commas in array literals. Let's address your questions one by one:
### i. Which one of these is correct?
The ECMAScript specification (which defines the JavaScript language) states that trailing comma... | 3,640 | [
{
"from": "human",
"value": "Code:\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n <title>Unusual Array Lengths!</title>\n\n <script type=\"text/javascript\">\n var arrayList = new Array();\n arrayList = [1, 2, 3, 4, 5, ];\n alert(arrayList.length);\n </script>\n\n</he... |
I have a user script that would be much more useful if it could dynamically change some of its execution dependent on what the user wanted. Passing simple switches would easily solve this problem but I don't see any way to do it.
I also tried embedding a keyword in the script name, but Xcode copies the script to a gui... | In Xcode, user scripts accessed via the script menu do indeed have some limitations regarding passing arguments directly. Unfortunately, Xcode does not support passing arbitrary arguments to user scripts in the same way that you might pass arguments to a command-line script.
However, you can use the following approach... | 14,502 | [
{
"from": "human",
"value": "I have a user script that would be much more useful if it could dynamically change some of its execution dependent on what the user wanted. Passing simple switches would easily solve this problem but I don't see any way to do it.\nI also tried embedding a keyword in the script ... |
I have several different locations in a fairly wide area, each with a Linux server storing company data. This data changes every day in different ways at each different location. I need a way to keep this data up-to-date and synced between all these locations.
For example:
In one location someone places a set of images... | Using `rsync` in conjunction with cron jobs is a reasonable approach for syncing files across multiple Linux servers, especially if you're looking for a method that is efficient and relatively easy to manage. However, there are several considerations and strategies you can employ to improve or refine this solution. Her... | 12,650 | [
{
"from": "human",
"value": "I have several different locations in a fairly wide area, each with a Linux server storing company data. This data changes every day in different ways at each different location. I need a way to keep this data up-to-date and synced between all these locations.\nFor example:\nIn ... |
Is there a tool or script which easily merges a bunch of JAR files into one JAR file? A bonus would be to easily set the main-file manifest and make it executable.
The concrete case is a Java restructured text tool. I would like to run it with something like:
java -jar rst.jar
As far as I can tell, it has no dependen... | To merge multiple JAR files into a single executable JAR, you can use a combination of tools and approaches. One popular approach is to create a "fat JAR" or "uber JAR" that contains all the required classes and resources in one file. Below are steps to do this, along with tools you can use:
### Option 1: Using the Ma... | 6,113 | [
{
"from": "human",
"value": "Is there a tool or script which easily merges a bunch of JAR files into one JAR file? A bonus would be to easily set the main-file manifest and make it executable.\nThe concrete case is a Java restructured text tool. I would like to run it with something like:\n\njava -jar rst.j... |
I am hosting SpiderMonkey in a current project and would like to have template functions generate some of the simple property get/set methods, eg:
template <typename TClassImpl, int32 TClassImpl::*mem>
JSBool JS_DLL_CALLBACK WriteProp(JSContext* cx, JSObject* obj, jsval id, jsval* vp)
{
if (TClassImpl* pImpl = (TCl... | It seems you're running into template specialization issues and overload resolution in Visual C++ when attempting to create template functions that handle different types of member variables. The root of your issue lies in the fact that Visual C++ has specific rules for overload resolution, and the way you are defining... | 10,931 | [
{
"from": "human",
"value": "I am hosting SpiderMonkey in a current project and would like to have template functions generate some of the simple property get/set methods, eg:\ntemplate <typename TClassImpl, int32 TClassImpl::*mem>\nJSBool JS_DLL_CALLBACK WriteProp(JSContext* cx, JSObject* obj, jsval id, js... |
I'm writing a shell script to do some web server configuration. I need to disable all currently active virtual hosts. a2dissite doesn't accept multiple arguments, so I can't do
a2dissite `ls /etc/apache2/sites-enabled`
Should I use find? Is it safe to manually delete the symlinks in /etc/apache2/sites-enabled?
| To disable all currently active virtual hosts in Apache, you can indeed use the `a2dissite` command, but since it does not accept multiple arguments directly, you can combine it with a `for` loop in your shell script. However, manually deleting the symlinks in `/etc/apache2/sites-enabled` is not recommended, as it migh... | 16,291 | [
{
"from": "human",
"value": "I'm writing a shell script to do some web server configuration. I need to disable all currently active virtual hosts. a2dissite doesn't accept multiple arguments, so I can't do\na2dissite `ls /etc/apache2/sites-enabled`\n\nShould I use find? Is it safe to manually delete the sym... |
I want to implement an ISAPI filter like feature using HttpModule in IIS7 running under IIS Integrated Request Processing Pipeline mode.
The goal is to look at the incoming request at the Web Server level, and inject some custom HttpHeaders into the request. (for ex: HTTP\_EAUTH\_ID)
And later in the page lifecycle of ... | Yes, it is possible to implement a functionality similar to an ISAPI filter using an `HttpModule` in IIS7 under the Integrated Pipeline mode. However, you can't directly modify the `ServerVariables` collection within the `HttpModule`. Instead, you can achieve your goal by utilizing the `HttpContext.Current.Items` colle... | 13,952 | [
{
"from": "human",
"value": "I want to implement an ISAPI filter like feature using HttpModule in IIS7 running under IIS Integrated Request Processing Pipeline mode.\nThe goal is to look at the incoming request at the Web Server level, and inject some custom HttpHeaders into the request. (for ex: HTTP\\_EAU... |
I am a programmer at a financial institute. I have recently been told to enforce that all new user id's to have at least one alpha and one numeric. I immediately thought that this was a horrible idea and I would rather not implement it, as I believe this is an anti-feature and of poor user experience. The problem is... | It's understandable to have reservations about enforcing specific requirements for user IDs, as they can impact user experience and may not significantly enhance security. Let's explore some reasons why this requirement may not be ideal, along with potential references that could strengthen your case.
### Reasons Agai... | 10,499 | [
{
"from": "human",
"value": "I am a programmer at a financial institute. I have recently been told to enforce that all new user id's to have at least one alpha and one numeric. I immediately thought that this was a horrible idea and I would rather not implement it, as I believe this is an anti-feature and... |
From what I've seen in the past, StackOverflow seems to like programming challenges, such as the fast char to string exercise problem which got dozens of responses. This is an optimization challenge: take a very simple function and see if you can come up with a smarter way of doing it.
I've had a function that I've wa... | Optimizing the function to wrap a datastream into a NAL unit with escape codes is indeed a challenge due to the rare occurrences where such codes are needed. Given that the escape sequences only need to be handled for very specific byte patterns, we can improve performance by reducing unnecessary checks and handling by... | 13,301 | [
{
"from": "human",
"value": "From what I've seen in the past, StackOverflow seems to like programming challenges, such as the fast char to string exercise problem which got dozens of responses. This is an optimization challenge: take a very simple function and see if you can come up with a smarter way of d... |
I'm learning Haskell in the hope that it will help me get closer to functional programming. Previously, I've mostly used languages with C-like syntax, like C, Java, and D.
I have a little question about the coding style of an if/else control block used by the tutorial on Wikibooks. The code looks like the following:
do... | In Haskell, indentation and layout rules are quite different from those in C-like languages, and your observation about the conventions is valid. Haskell uses significant whitespace to determine the structure of the code, which can lead to different formatting practices compared to languages like C, Java, or D.
Regard... | 10,145 | [
{
"from": "human",
"value": "I'm learning Haskell in the hope that it will help me get closer to functional programming. Previously, I've mostly used languages with C-like syntax, like C, Java, and D.\nI have a little question about the coding style of an if/else control block used by the tutorial on Wikibo... |
Please consider this example class:
[Serializable]
public class SomeClass
{
private DateTime _SomeDateTime;
public DateTime SomeDateTime
{
get { return _SomeDateTime; }
set { _SomeDateTime = value; }
}
}
I would like to alter the serialization of any DateTime declared in the class acco... | To alter the serialization of `DateTime` properties in a class while maintaining ease of maintenance and supporting inheritance, you can create a custom `ISerializable` implementation for the class. This will allow you to control how properties are serialized without having to write custom serialization code for every ... | 15,266 | [
{
"from": "human",
"value": "Please consider this example class:\n[Serializable]\npublic class SomeClass\n{\n private DateTime _SomeDateTime;\n\n public DateTime SomeDateTime\n {\n get { return _SomeDateTime; }\n set { _SomeDateTime = value; }\n }\n}\n\nI would like to alter the se... |
I am moving from classic ASP to ASP.NET and have encountered what many of you already know as "viewstate". I might be jumping the gun with my assumption, but it looks highly cumbersome. I have developed many ASP forms in the past and never had issues with keeping state. Is there another way OR am I going to have to ... | Welcome to the world of ASP.NET! Transitioning from Classic ASP to ASP.NET can indeed feel overwhelming at first, especially with concepts like ViewState. Here’s a breakdown to help you understand ViewState and explore alternatives for maintaining state in ASP.NET.
### Understanding ViewState
ViewState is a mechanism ... | 13,381 | [
{
"from": "human",
"value": "I am moving from classic ASP to ASP.NET and have encountered what many of you already know as \"viewstate\". I might be jumping the gun with my assumption, but it looks highly cumbersome. I have developed many ASP forms in the past and never had issues with keeping state. Is ... |
As I develop more with vim, I find myself wanting to copy in blocks of useful code, similar to "templates" in Eclipse.
I was thinking of making a separate file for each code chunk and just reading them in with
:r code-fornext
but that just seems kind of primitive. Googling around I find vim macros mentioned and somet... | Yes, Vim has several features that can help you achieve functionality similar to Eclipse's templates and JEdit's macros. Here's a breakdown of some of those features and how you can use them:
### 1. Vim Snippets (Using Plugins)
For snippet functionality similar to Eclipse templates, you can use plugins such as:
- **v... | 10,311 | [
{
"from": "human",
"value": "As I develop more with vim, I find myself wanting to copy in blocks of useful code, similar to \"templates\" in Eclipse. \nI was thinking of making a separate file for each code chunk and just reading them in with\n:r code-fornext\n\nbut that just seems kind of primitive. Googli... |
I am looking for some advice on what should I concentrate my efforts to get the needed skills to become a Java developer for Oracle applications. I'm bit confused as there are lot of technologies in the Java world. Where should I start? What to avoid? Is JDeveloper a good IDE for a beginner?
| To become a Java developer focused on Oracle applications, it's important to structure your learning and efforts effectively, as the Java ecosystem can indeed be overwhelming. Here's a guide on where to start and what to focus on:
### **Core Java Fundamentals**
1. **Java Basics**:
- **Start with Core Java**: Focu... | 11,836 | [
{
"from": "human",
"value": "I am looking for some advice on what should I concentrate my efforts to get the needed skills to become a Java developer for Oracle applications. I'm bit confused as there are lot of technologies in the Java world. Where should I start? What to avoid? Is JDeveloper a good IDE fo... |
What is a good regular expression that can validate a text string to make sure it is a valid Windows filename? (AKA not have \/:*?"<>| characters).
I'd like to use it like the following:
// Return true if string is invalid.
if (Regex.IsMatch(szFileName, "<your regex string>"))
{
// Tell user to reformat their filen... | To validate a Windows filename using a regular expression, you can create a pattern that disallows the specific invalid characters. The invalid characters in Windows filenames are: `\ / : * ? " < > |`.
Here is a regular expression that matches a valid Windows filename by checking for the presence of any invalid charac... | 16,592 | [
{
"from": "human",
"value": "What is a good regular expression that can validate a text string to make sure it is a valid Windows filename? (AKA not have \\/:*?\"<>| characters).\nI'd like to use it like the following:\n// Return true if string is invalid.\nif (Regex.IsMatch(szFileName, \"<your regex string... |
Is there a utility that will generate html or css for blocks of code (.net c#) when you post it on a website?
I have seen several websites with very nicely formatted code and I dont believe they do this manually.
| Yes, there are several utilities and libraries that can automatically format code blocks into nicely styled HTML or CSS for presentation on websites. Here are some popular options you can use:
1. **Prism.js**:
- Prism is a lightweight, extensible syntax highlighter. It allows you to add code highlighting to your HT... | 14,987 | [
{
"from": "human",
"value": "Is there a utility that will generate html or css for blocks of code (.net c#) when you post it on a website? \nI have seen several websites with very nicely formatted code and I dont believe they do this manually.\n"
},
{
"from": "gpt",
"value": "Yes, there are seve... |
I have months stored in SQL Server as 1,2,3,4,...12. I would like to display them as January,February etc. Is there a function in SQL Server like MonthName(1) = January? I am trying to avoid a CASE statement, if possible.
| In SQL Server, there isn't a built-in function that directly converts an integer (1-12) into the corresponding month name without using a `CASE` statement. However, you can achieve this by using the `DATENAME` function in conjunction with `DATEADD` or by using a more simplified approach with a temporary table or a comm... | 17,480 | [
{
"from": "human",
"value": "I have months stored in SQL Server as 1,2,3,4,...12. I would like to display them as January,February etc. Is there a function in SQL Server like MonthName(1) = January? I am trying to avoid a CASE statement, if possible.\n"
},
{
"from": "gpt",
"value": "In SQL Serve... |
I just came across the proposed Boost::Dataflow library.
It seems like an interesting approach and I was wondering if there are other such alternative frameworks for C++, and if there are any related design patterns.
I have not ruled out Boost::Dataflow, I am just looking into any available alternatives so I can under... | Boost::Dataflow is indeed an interesting library aimed at providing a dataflow programming model in C++. If you're exploring alternatives or related frameworks, here are some notable options you might consider:
### Alternative Frameworks
1. **Intel Threading Building Blocks (TBB)**:
- TBB is a widely used C++ libr... | 5,801 | [
{
"from": "human",
"value": "I just came across the proposed Boost::Dataflow library. \nIt seems like an interesting approach and I was wondering if there are other such alternative frameworks for C++, and if there are any related design patterns.\nI have not ruled out Boost::Dataflow, I am just looking int... |
This is related to the accepted answer for What’s your #1 way to be careful with a live database?
Suppose you create a temp table for backup purpose and make your changes in the original. The changes break the system and you want to restore the backup. In the meantime some other records have also changed in the origina... | To effectively handle the situation where you're making changes to a live database while ensuring that you can restore a consistent state in the event of failure, you should consider the following strategies:
### 1. **Use Transactions:**
- Wrap your database operations in a transaction. This way, if anything goes w... | 14,232 | [
{
"from": "human",
"value": "This is related to the accepted answer for What’s your #1 way to be careful with a live database?\nSuppose you create a temp table for backup purpose and make your changes in the original. The changes break the system and you want to restore the backup. In the meantime some othe... |
I usually use C++ stdlib map whenever I need to store some data associated with a specific type of value (a key value - e.g. a string or other object). The stdlib map implementation is based on trees which provides better performance (O(log n)) than the standard array or stdlib vector.
My questions is, do you know of a... | Yes, in C++, the Standard Template Library (STL) provides a hash table implementation through the `std::unordered_map` class. This class is part of the `<unordered_map>` header and offers average-case constant time complexity (O(1)) for insertions, deletions, and lookups, assuming a good hash function and a well-distri... | 14,527 | [
{
"from": "human",
"value": "I usually use C++ stdlib map whenever I need to store some data associated with a specific type of value (a key value - e.g. a string or other object). The stdlib map implementation is based on trees which provides better performance (O(log n)) than the standard array or stdlib ... |
Traditionalist argue that stored procedures provide better security than if you use a Object Relational Mapping (ORM) framework such as NHibernate.
To counter that argument what are some approaches that can be used with NHibernate to ensure that proper security is in place (for example, preventing sql injection, etc.)... | One effective approach to ensure security when using NHibernate is to use parameterized queries. By utilizing parameterized queries, you can prevent SQL injection attacks, which occur when untrusted input is concatenated directly into a SQL statement. In NHibernate, you can achieve this by defining your queries with pl... | 15,800 | [
{
"from": "human",
"value": "Traditionalist argue that stored procedures provide better security than if you use a Object Relational Mapping (ORM) framework such as NHibernate. \nTo counter that argument what are some approaches that can be used with NHibernate to ensure that proper security is in place (fo... |
I have this query in sql server 2000:
select pwdencrypt('AAAA')
which outputs an encrypted string of 'AAAA':
0x0100CF465B7B12625EF019E157120D58DD46569AC7BF4118455D12625EF019E157120D58DD46569AC7BF4118455D
How can I convert (decrypt) the output from its origin (which is 'AAAA')?
| In SQL Server 2000, the `PWDCrypt` function is used to encrypt a password, but it does not provide a built-in function to decrypt it. The encryption it performs is a one-way hashing function, which means that you cannot directly reverse the output to retrieve the original input (in this case, 'AAAA').
The `PWDCrypt` f... | 14,775 | [
{
"from": "human",
"value": "I have this query in sql server 2000:\nselect pwdencrypt('AAAA')\n\nwhich outputs an encrypted string of 'AAAA':\n\n0x0100CF465B7B12625EF019E157120D58DD46569AC7BF4118455D12625EF019E157120D58DD46569AC7BF4118455D\n\nHow can I convert (decrypt) the output from its origin (which is ... |
I recently discussed editors with a co-worker. He uses one of the less popular editors and I use another (I won't say which ones since it's not relevant and I want to avoid an editor flame war). I was saying that I didn't like his editor as much because it doesn't let you do find/replace with regular expressions.
He ... | Sure! Regular expressions (regex) can be incredibly powerful for find/replace operations in text editing, allowing for complex string manipulations that would be tedious or impossible with standard find/replace. Here are several real-life scenarios where regex find/replace can be useful:
1. **Reformatting Dates**: If ... | 14,881 | [
{
"from": "human",
"value": "I recently discussed editors with a co-worker. He uses one of the less popular editors and I use another (I won't say which ones since it's not relevant and I want to avoid an editor flame war). I was saying that I didn't like his editor as much because it doesn't let you do f... |
I'm really new to .NET, and I still didn't get the hang about how configuration files work.
Every time I search on Google about it I get results about web.config, but I'm writing a Windows Forms application.
I figured out that I need to use the System.Configuration namespace, but the documentation isn't helping.
How do... | In .NET applications, configuration files are typically used to store settings that your application might need to access at runtime. While `web.config` is common for ASP.NET applications, Windows Forms applications usually use `App.config` (which is ultimately transformed into an `appname.exe.config` file).
However, ... | 11,126 | [
{
"from": "human",
"value": "I'm really new to .NET, and I still didn't get the hang about how configuration files work.\nEvery time I search on Google about it I get results about web.config, but I'm writing a Windows Forms application.\nI figured out that I need to use the System.Configuration namespace, ... |
I'm implementing a cache in a class library that i'm using in an asp.net application.
I created my cache object as a singleton pattern with a static method to update the cache which is really just loading a member variable/property with a collection of data i need cached (got some locking logic ofcourse). I figured it... | Implementing a cache in an ASP.NET application involves considering several factors, particularly when dealing with a significant amount of data. The concerns you raised regarding garbage collection, efficient data retrieval, and the overall caching strategy are valid. Here are some best practices and strategies for im... | 12,784 | [
{
"from": "human",
"value": "I'm implementing a cache in a class library that i'm using in an asp.net application. \nI created my cache object as a singleton pattern with a static method to update the cache which is really just loading a member variable/property with a collection of data i need cached (got ... |
Ok, so I just ran into the following problem that raised an eyebrow.
For various reasons I have a testing setup where Testing classes in a TestingAssembly.dll depend on the TestingBase class in a BaseTestingAssembly.dll.
One of the things the TestBase does in the meantime is look for a certain embedded resource in its ... | The behavior you're encountering with the `_calling_assembly` field in your `TestBase` class has to do with the timing of when the static constructor is executed and how the .NET runtime manages assembly loading and execution context.
### Understanding Static Constructors
1. **Static Constructors Execution Timing**: ... | 13,688 | [
{
"from": "human",
"value": "Ok, so I just ran into the following problem that raised an eyebrow.\nFor various reasons I have a testing setup where Testing classes in a TestingAssembly.dll depend on the TestingBase class in a BaseTestingAssembly.dll.\nOne of the things the TestBase does in the meantime is l... |
Is there a way to emulate a disk drive in .NET, intercepting read/write/lock operations?
I would like to create something with a front-end similar to GMail Drive in C#.
Thanks,
Tom
| Yes, you can emulate a disk drive in .NET and intercept read/write/lock operations, but it involves some complexity and requires low-level programming. In .NET, you don't have direct access to file system drivers or low-level disk operations, but you can achieve this with a few different approaches.
### Possible Appro... | 11,410 | [
{
"from": "human",
"value": "Is there a way to emulate a disk drive in .NET, intercepting read/write/lock operations?\nI would like to create something with a front-end similar to GMail Drive in C#.\nThanks,\nTom\n"
},
{
"from": "gpt",
"value": "Yes, you can emulate a disk drive in .NET and inte... |
Where can I find a list of all types of bsd style socket errors?
| You can find a list of BSD-style socket errors in several places. Here are some reliable sources:
1. **Man Pages**: On Unix-like operating systems, you can use the command line to access the manual pages for sockets. Use the command:
```bash
man errno
```
This will give you a list of error codes and their ... | 15,511 | [
{
"from": "human",
"value": "Where can I find a list of all types of bsd style socket errors?\n"
},
{
"from": "gpt",
"value": "You can find a list of BSD-style socket errors in several places. Here are some reliable sources:\n\n1. **Man Pages**: On Unix-like operating systems, you can use the co... |
We have an error that we can't seem to find and don't have the need/resources to try and track it down. What we do need to do is just keep the freaking "Please tell Microsoft about this problem" dialog boxes from cluttering up the server.
It is from an MS-Access error (we think) but I can't find where Access is instal... | To stop the "Please tell Microsoft about this problem" error reporting dialog boxes from appearing on your Windows Server 2003 system, you can disable Windows Error Reporting. This will prevent the error messages from cluttering up the server. Here’s how to do that:
### Disable Windows Error Reporting
1. **Open the C... | 13,784 | [
{
"from": "human",
"value": "We have an error that we can't seem to find and don't have the need/resources to try and track it down. What we do need to do is just keep the freaking \"Please tell Microsoft about this problem\" dialog boxes from cluttering up the server.\nIt is from an MS-Access error (we th... |
With ASP.NET MVC (or using HttpHandlers) you can dynamically generate URLs, like the one in this question, which includes the title.
What happens if the title changes (for example, editing it) and there's a link pointing to the page from another site, or Google's Pagerank was calculated for that URL?
I guess it's all l... | When you use dynamically generated URLs that include content like titles, changing that content will indeed result in a broken link for external sites or bookmarks that are using the old URL. This can lead to a loss of page rank in search engines and a poor user experience for visitors who click on those links.
To mit... | 15,079 | [
{
"from": "human",
"value": "With ASP.NET MVC (or using HttpHandlers) you can dynamically generate URLs, like the one in this question, which includes the title.\nWhat happens if the title changes (for example, editing it) and there's a link pointing to the page from another site, or Google's Pagerank was c... |
How to set all the values in a std::map to the same value, without using a loop iterating over each value?
| In C++, the standard library `std::map` does not provide a built-in method to set all values to the same value without iterating over them. However, you can achieve this in a more concise way using the `std::for_each` algorithm in conjunction with a lambda function. This does not eliminate the need for iteration but ca... | 12,291 | [
{
"from": "human",
"value": "How to set all the values in a std::map to the same value, without using a loop iterating over each value? \n"
},
{
"from": "gpt",
"value": "In C++, the standard library `std::map` does not provide a built-in method to set all values to the same value without iterati... |
I recently inherited a database on which one of the tables has the primary key composed of encoded values (Part1*1000 + Part2).
I normalized that column, but I cannot change the old values.
So now I have
select ID from table order by ID
ID
100001
100002
101001
...
I want to find the "holes" in the table (more precisel... | To efficiently find the first "hole" after `100000` in your table, you can use a different approach that avoids the subquery, which can be less efficient, especially as the size of the table grows. One method is to use a `JOIN` or a `LEFT JOIN` to identify the missing IDs directly. Here's a suggested query that should ... | 15,749 | [
{
"from": "human",
"value": "I recently inherited a database on which one of the tables has the primary key composed of encoded values (Part1*1000 + Part2).\nI normalized that column, but I cannot change the old values.\nSo now I have\nselect ID from table order by ID\nID\n100001\n100002\n101001\n...\n\nI w... |
GWT gets locale from either the locale property or the locale query string. If neither is specified, it uses the "default" (ie en_US) locale.
Why doesn't it get it from the browser settings?
It seems the only solution to this is to replace your static html launch page with something like a JSP that reads the browser ... | You're correct that GWT (Google Web Toolkit) retrieves the locale from either the `locale` property or the locale query string, and defaults to a static locale if neither is provided. This design choice can seem limiting, especially when considering the variety of locales users might have based on their browser setting... | 12,761 | [
{
"from": "human",
"value": "GWT gets locale from either the locale property or the locale query string. If neither is specified, it uses the \"default\" (ie en_US) locale.\nWhy doesn't it get it from the browser settings?\nIt seems the only solution to this is to replace your static html launch page with... |
I'm new to both Web Services and RMI and I wonder which is the better way to do remoting between different web applications, when these applications are all written in Java, that is when different programming languages don't matter (which would be the advantage of WS).
While on the one hand I would guess that there's a... | You're right to consider both Java RMI (Remote Method Invocation) and web services for remoting between different web applications. Each approach has its own strengths and weaknesses, which can make one more suitable than the other depending on your specific use case. Here's a breakdown of the two:
### Java RMI
**Adva... | 10,263 | [
{
"from": "human",
"value": "I'm new to both Web Services and RMI and I wonder which is the better way to do remoting between different web applications, when these applications are all written in Java, that is when different programming languages don't matter (which would be the advantage of WS).\nWhile on... |
At the beginning of each PHP page I open up the connection to MySQL, use it throughout the page and close it at the end of the page. However, I often redirect in the middle of the page to another page and so in those cases the connection does not be closed. I understand that this is not bad for performance of the web s... | You're correct that PHP automatically closes MySQL connections at the end of the script's execution, so in many cases, you don't need to explicitly close the connection. However, there are still several factors to consider when dealing with database connections in PHP:
1. **Resource Management**: While PHP does automa... | 15,049 | [
{
"from": "human",
"value": "At the beginning of each PHP page I open up the connection to MySQL, use it throughout the page and close it at the end of the page. However, I often redirect in the middle of the page to another page and so in those cases the connection does not be closed. I understand that thi... |
I have always made a point of writing nice code comments for classes and methods with the C# xml syntax. I always expected to easily be able to export them later on.
Today I actually have to do so, but am having trouble finding out how. Is there something I'm missing? I want to go Menu->Build->Build Code Documentation,... | In C#, you can generate XML documentation files directly from your code comments. If you're unable to see the option to build code documentation in Visual Studio, it may be due to a few reasons. Here’s how you can ensure that your XML documentation is generated correctly:
1. **Project Properties**:
- Right-click o... | 13,979 | [
{
"from": "human",
"value": "I have always made a point of writing nice code comments for classes and methods with the C# xml syntax. I always expected to easily be able to export them later on.\nToday I actually have to do so, but am having trouble finding out how. Is there something I'm missing? I want to... |
I need to import a large CSV file into an SQL server. I'm using this :
BULK
INSERT CSVTest
FROM 'c:\csvfile.txt'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
GO
problem is all my fields are surrounded by quotes (" ") so a row actually looks like :
"... | When dealing with CSV files where fields are surrounded by quotes and you also want to retain the quote structure without including the quotes in the actual data, you will need to handle this a bit more carefully in SQL Server. You're correct in considering a format file, as it can give you more control over how the da... | 9,688 | [
{
"from": "human",
"value": "I need to import a large CSV file into an SQL server. I'm using this :\nBULK \nINSERT CSVTest\n FROM 'c:\\csvfile.txt'\n WITH\n (\n FIELDTERMINATOR = ',',\n ROWTERMINATOR = '\\n'\n )\nGO\n\nproblem is all my fields are surro... |
We're thinking about using the rufus-scheduler gem on a Ruby on Rails project to do regular monitoring of a communication queue. Has anyone have experience using this gem on a Rails project? Anyone have strong preferences of an alternative scheduler?
| The `rufus-scheduler` gem is a popular choice for scheduling tasks in Ruby applications, including Ruby on Rails projects. It allows you to schedule tasks to run at specific intervals or times, and it's fairly straightforward to use. Many developers appreciate its lightweight nature and simplicity for running backgroun... | 16,360 | [
{
"from": "human",
"value": "We're thinking about using the rufus-scheduler gem on a Ruby on Rails project to do regular monitoring of a communication queue. Has anyone have experience using this gem on a Rails project? Anyone have strong preferences of an alternative scheduler?\n"
},
{
"from": "g... |
I am a little new to pyOpenSSL. I am trying to figure out how to associate the generated socket to an ssl cert. verify_cb gets called which give me access to the cert and a conn but how do I associate those things when this happens:
cli,addr = self.server.accept()
| In `pyOpenSSL`, when you want to associate a socket with an SSL certificate, you're generally working with `SSL.Connection` objects. When you accept a connection with `server.accept()`, you'll receive a raw socket. To associate that socket with an SSL context and your SSL certificate, you will typically wrap the socket... | 9,703 | [
{
"from": "human",
"value": "I am a little new to pyOpenSSL. I am trying to figure out how to associate the generated socket to an ssl cert. verify_cb gets called which give me access to the cert and a conn but how do I associate those things when this happens:\ncli,addr = self.server.accept()\n"
},
{... |
So, I have a penchant for Easter Eggs... this dates back to me being part of the found community of the Easter Egg Archive.
However, I also do a lot of open source programming.
What I want to know is, what do you think is the best way to SYSTEMATICALLY and METHODICALLY obfuscate code.
Examples in PHP/Python/C/C++ prefe... | Obfuscation is the process of deliberately making code difficult to understand, often to protect intellectual property or hide functionality. While it's important to note that obfuscation shouldn't replace proper security practices, it can serve as an additional layer of protection. Here are some systematic and methodi... | 10,560 | [
{
"from": "human",
"value": "So, I have a penchant for Easter Eggs... this dates back to me being part of the found community of the Easter Egg Archive.\nHowever, I also do a lot of open source programming.\nWhat I want to know is, what do you think is the best way to SYSTEMATICALLY and METHODICALLY obfusca... |
I'm not sure how I should express this, but I'll give it a try.
I recently started coding my portfolio in object-oriented PHP and I'm wondering if it's according to best practices to use a single page where the content changes depending on SQL data and the $_GET variable?
If so/not, why?
Edit: Take a look at my next p... | Using a single page to serve different content based on SQL data and the `$_GET` variable can be a valid approach in certain contexts, especially for simpler applications or when aiming for a single-page application (SPA) feel. However, there are several best practices to consider when implementing this approach in obj... | 13,002 | [
{
"from": "human",
"value": "I'm not sure how I should express this, but I'll give it a try. \nI recently started coding my portfolio in object-oriented PHP and I'm wondering if it's according to best practices to use a single page where the content changes depending on SQL data and the $_GET variable?\nIf ... |
Is it possible to determine when a ChucK child shred has finished executing if you have a reference to the child shred? For example, in this code:
// define function go()
fun void go()
{
// insert code
}
// spork another, store reference to new shred in offspring
spork ~ go() => Shred @ offspring;
Is it possible... | Yes, in ChucK, you can determine when a child shred has finished executing by using the `Shred` reference you obtained when you sporked the child shred.
When you spork a shred, it returns a reference to that shred which you can use to check its status later. You can check if the shred is still running or has finished ... | 14,564 | [
{
"from": "human",
"value": "Is it possible to determine when a ChucK child shred has finished executing if you have a reference to the child shred? For example, in this code:\n// define function go()\nfun void go()\n{\n // insert code\n}\n\n// spork another, store reference to new shred in offspring\ns... |
The question gives all necessary data: what is an efficient algorithm to generate a sequence of K non-repeating integers within a given interval [0,N-1]. The trivial algorithm (generating random numbers and, before adding them to the sequence, looking them up to see if they were already there) is very expensive if K is... | To efficiently generate a sequence of K non-repeating integers within a given interval [0, N-1], we can use the **Fisher-Yates shuffle** algorithm. This algorithm is efficient and allows us to generate the required sequence without the need for excessive lookups or random number generation overhead.
Here’s how you can... | 14,069 | [
{
"from": "human",
"value": "The question gives all necessary data: what is an efficient algorithm to generate a sequence of K non-repeating integers within a given interval [0,N-1]. The trivial algorithm (generating random numbers and, before adding them to the sequence, looking them up to see if they were... |
I have a ASP.NET application running on a remote web server and I just started getting this error:
Method not found: 'Void System.Collections.Generic.ICollection`1..ctor()'.
I disassembled the code in the DLL and it seems like the compiler is incorrectly optimizing the code. (Note that Set is a class that implements ... | This issue you're experiencing seems related to how ILMerge is handling the merging process of your assemblies. It's not uncommon for ILMerge to cause unexpected behavior or conflicts, especially if there are differences in the build environments or if there are certain optimizations and settings applied during the bui... | 14,831 | [
{
"from": "human",
"value": "I have a ASP.NET application running on a remote web server and I just started getting this error:\nMethod not found: 'Void System.Collections.Generic.ICollection`1..ctor()'.\n\nI disassembled the code in the DLL and it seems like the compiler is incorrectly optimizing the code.... |
Is it possible to change the hostname in Windows 2003 from the command line with out-of-the-box tools?
| Yes, it is possible to change the hostname in Windows Server 2003 using the command line with out-of-the-box tools. You can use the `netdom` command, which is available on Windows Server 2003, to rename the computer.
Here’s how you can do it:
1. Open the Command Prompt with administrative privileges. You can do this ... | 13,921 | [
{
"from": "human",
"value": "Is it possible to change the hostname in Windows 2003 from the command line with out-of-the-box tools?\n"
},
{
"from": "gpt",
"value": "Yes, it is possible to change the hostname in Windows Server 2003 using the command line with out-of-the-box tools. You can use the... |
I cant seem to find much info on haskells layout features, as I understand it is something like pythons formatting requirements except that is optional. How can I choose not to use this option correctly? Would it be a good idea to start without it so that I get a solid feel for the language itself?
| Haskell's layout system, also known as the "offside rule," is indeed similar to Python's indentation-based syntax in that it uses indentation to determine the structure of the code. However, unlike Python, where indentation is mandatory, Haskell allows you to choose whether to use layout (indentation) or use explicit g... | 13,474 | [
{
"from": "human",
"value": "I cant seem to find much info on haskells layout features, as I understand it is something like pythons formatting requirements except that is optional. How can I choose not to use this option correctly? Would it be a good idea to start without it so that I get a solid feel for ... |
Background
I have a massive db for a SharePoint site collection. It is 130GB and growing at 10gb per month. 100GB of the 130GB is in one site collection. 30GB is the version table. There is only one site collection - this is by design.
Question
Am I able to partition a database (SharePoint) using SQL 2005s data part... | Partitioning a SharePoint database can be complex, and there are several considerations to keep in mind. Here’s a breakdown of your questions:
### 1. **Can you partition a SharePoint database using SQL Server 2005's data partitioning features?**
Yes, SQL Server 2005 supports partitioning, but it is important to note t... | 13,421 | [
{
"from": "human",
"value": "Background\nI have a massive db for a SharePoint site collection. It is 130GB and growing at 10gb per month. 100GB of the 130GB is in one site collection. 30GB is the version table. There is only one site collection - this is by design.\nQuestion\nAm I able to partition a dat... |
I'm trying to be better about unit testing my code, but right now I'm writing a lot of code that deals with remote systems. SNMP, WMI, that sort of thing. With most classes I can mock up objects to test them, but how do you deal with unit testing a real system? For example, if my class goes out and gets the Win32_Lo... | Unit testing code that interacts with remote systems like SNMP or WMI can be challenging, especially since these tests can introduce flakiness and dependencies on the external systems' state and availability. Here are some strategies to effectively unit test your code while dealing with such scenarios:
### 1. **Use Mo... | 11,922 | [
{
"from": "human",
"value": "I'm trying to be better about unit testing my code, but right now I'm writing a lot of code that deals with remote systems. SNMP, WMI, that sort of thing. With most classes I can mock up objects to test them, but how do you deal with unit testing a real system? For example, i... |
Can anyone recommend a dropdownlist control for asp.net (3.5) that can render option groups? Thanks
| For ASP.NET 3.5, a common way to implement a dropdown list (or `DropDownList` control) that can render option groups is by using the built-in `DropDownList` control along with `ListItem` objects organized into groups using the `OptGroup` element. However, the `DropDownList` control in ASP.NET does not directly support ... | 12,669 | [
{
"from": "human",
"value": "Can anyone recommend a dropdownlist control for asp.net (3.5) that can render option groups? Thanks\n"
},
{
"from": "gpt",
"value": "For ASP.NET 3.5, a common way to implement a dropdown list (or `DropDownList` control) that can render option groups is by using the b... |
def foo ():
x = re.compile('^abc')
foo2(x)
def foo2(x):
How do I get x to return '^abc'? within the following code
logging.info('x is ' + x.???)
| To return the string pattern `'^abc'` from the compiled regular expression object `x`, you can access the pattern attribute of the compiled regex. In Python's `re` module, a compiled regex object has a `pattern` attribute that contains the original string pattern used to create it.
You would modify your logging line t... | 17,014 | [
{
"from": "human",
"value": "def foo ():\n x = re.compile('^abc')\n\n foo2(x)\n\ndef foo2(x):\n\nHow do I get x to return '^abc'? within the following code\nlogging.info('x is ' + x.???)\n\n"
},
{
"from": "gpt",
"value": "To return the string pattern `'^abc'` from the compiled regular expres... |
I'm trying to get the contents of a XML document element, but the element has a colon in it's name.
This line works for every element but the ones with a colon in the name:
$(this).find("geo:lat").text();
I assume that the colon needs escaping. How do I fix this?
| In jQuery, when you're dealing with XML elements that have a colon in their names (which typically indicates a namespace), you can use the `*|` selector to match elements with specific prefixes. In your case, for the `geo:lat` element, you can use the following syntax:
```javascript
$(this).find("*|lat").text();
```
... | 18,571 | [
{
"from": "human",
"value": "I'm trying to get the contents of a XML document element, but the element has a colon in it's name.\nThis line works for every element but the ones with a colon in the name:\n$(this).find(\"geo:lat\").text();\n\nI assume that the colon needs escaping. How do I fix this?\n"
},
... |
In low latency trading applications we are very conscious of latency issues. There is some concern that our application may experience increased latency if the server on which it is running changes PowerNow state.
Any kernel developers familiar with calling PowerNow changes and how much processor time is used for the ... | PowerNow! (for AMD processors) and Intel SpeedStep (for Intel processors) are technologies designed to dynamically adjust the CPU's frequency and voltage based on the current load to save power and reduce heat generation. However, changing the power state can introduce some latency, which is crucial to consider in low-... | 13,615 | [
{
"from": "human",
"value": "In low latency trading applications we are very conscious of latency issues. There is some concern that our application may experience increased latency if the server on which it is running changes PowerNow state.\nAny kernel developers familiar with calling PowerNow changes an... |
Are there any best practices (or even standards) to store addresses in a consistent and comprehensive way in a database ?
To be more specific, I believe at this stage that there are two cases for address storage :
you just need to associate an address to a person, a building or any item (the most common case). Then a ... | When designing a database for storing addresses with a focus on consistency and the ability to run statistical queries, it's essential to consider various best practices and standards. Here's a structured approach you can follow:
### 1. Address Schema Design
To facilitate consistency and make it easier to analyze add... | 10,882 | [
{
"from": "human",
"value": "Are there any best practices (or even standards) to store addresses in a consistent and comprehensive way in a database ?\nTo be more specific, I believe at this stage that there are two cases for address storage :\n\nyou just need to associate an address to a person, a building... |
I have an application that is causing a lot of headaches. It's a .NET app connecting to SQL Server 2005 via a web service. The program has grid that is filled by a long running stored procedure that is prone to timing out. In the case when it does time out and a SqlException is thrown, there is no execption handling to... | The issues you’re experiencing with your .NET application and SQL Server could indeed be influenced by unclosed connections, especially under the conditions you’ve described. Let’s break down the consequences of unclosed connections and how they might relate to the symptoms you're seeing:
### Consequences of Unclosed ... | 12,220 | [
{
"from": "human",
"value": "I have an application that is causing a lot of headaches. It's a .NET app connecting to SQL Server 2005 via a web service. The program has grid that is filled by a long running stored procedure that is prone to timing out. In the case when it does time out and a SqlException is ... |
I have a program that spits out an Excel workbook in Excel 2003 XML format. It works fine with one problem, I cannot get the column widths to set automatically.
A snippet of what I produce:
<Table >
<Column ss:AutoFitWidth="1" ss:Width="2"/>
<Row ss:AutoFitHeight="0" ss:Height="14.55">
<Cell ss:StyleID="s6... | To automatically set column widths in Excel 2003 XML format, you need to ensure that you are using the correct attributes within your XML structure. The attribute `ss:AutoFitWidth` should be set to `1`, but for the column widths to adjust based on the content, you might need to avoid setting an explicit width.
Here's ... | 15,236 | [
{
"from": "human",
"value": "I have a program that spits out an Excel workbook in Excel 2003 XML format. It works fine with one problem, I cannot get the column widths to set automatically.\nA snippet of what I produce:\n <Table >\n <Column ss:AutoFitWidth=\"1\" ss:Width=\"2\"/>\n <Row ss:AutoFitHeigh... |
I'm trying to replace each , in the current file by a new line:
:%s/,/\n/g
But it inserts what looks like a ^@ instead of an actual newline. The file is not in DOS mode or anything.
What should I do?
If you are curious, like me, check the question Why is \r a newline for Vim? as well.
| In Vim, to replace each comma with a newline, the correct syntax for inserting a newline in the substitution command is to use `\r`. Your command should look like this:
```vim
:%s/,/\r/g
```
Here’s a breakdown of what happens:
- `%s` tells Vim to substitute in the entire file.
- `,` is the pattern you want to search... | 16,436 | [
{
"from": "human",
"value": "I'm trying to replace each , in the current file by a new line:\n:%s/,/\\n/g \n\nBut it inserts what looks like a ^@ instead of an actual newline. The file is not in DOS mode or anything.\nWhat should I do?\nIf you are curious, like me, check the question Why is \\r a newline fo... |
Having programmed through emacs and vi for years and years at this point, I have heard that using an IDE is a very good way of becoming more efficient.
To that end, I have decided to try using Eclipse for a lot of coding and seeing how I get on.
Are there any suggestions for easing the transition over to an IDE. Obviou... | Transitioning from text editors like Emacs and Vi to an Integrated Development Environment (IDE) like Eclipse can be a rewarding experience, especially with its features designed to enhance productivity. Here are some suggestions to ease the transition:
### 1. Familiarize Yourself with the Interface
- **Explore the La... | 11,049 | [
{
"from": "human",
"value": "Having programmed through emacs and vi for years and years at this point, I have heard that using an IDE is a very good way of becoming more efficient.\nTo that end, I have decided to try using Eclipse for a lot of coding and seeing how I get on.\nAre there any suggestions for e... |
I am setting up Apache server with TortoiseSVN for a local source code repository.
I have observed that if someone deletes a file using TortoiseSVN it will get deleted from everyone's view and the only log will be their in log history. I feel it is dangerous that any user can delete a file if they have read/write righ... | Yes, you can set up permissions in Apache Subversion (SVN) to restrict who can add or delete files in your repository. This can be managed using the `authz` file, which allows you to define user permissions for specific paths in your repository. Here’s how you can configure it to allow only admins to delete or add file... | 15,801 | [
{
"from": "human",
"value": "I am setting up Apache server with TortoiseSVN for a local source code repository. \nI have observed that if someone deletes a file using TortoiseSVN it will get deleted from everyone's view and the only log will be their in log history. I feel it is dangerous that any user can ... |
In PHP I can name my array indices so that I may have something like:
$shows = Array(0 => Array('id' => 1, 'name' => 'Sesame Street'),
1 => Array('id' => 2, 'name' => 'Dora The Explorer'));
Is this possible in Python?
| Yes, you can achieve similar functionality in Python by using lists of dictionaries. In your PHP example, you have an array of associative arrays. In Python, this can be represented as a list of dictionaries. Here’s how you can do it:
```python
shows = [
{'id': 1, 'name': 'Sesame Street'},
{'id': 2, 'name': 'D... | 17,426 | [
{
"from": "human",
"value": "In PHP I can name my array indices so that I may have something like:\n$shows = Array(0 => Array('id' => 1, 'name' => 'Sesame Street'), \n 1 => Array('id' => 2, 'name' => 'Dora The Explorer'));\n\nIs this possible in Python?\n"
},
{
"from": "gpt",
"valu... |
Studying emergence, it's quite useful to have a development framework to build upon to quickly test out new ideas. 3d with physics collision would be nice, and open-source would be a big plus. For this purpose 'breve' looks quite promising, but I was wondering if anyone had used it or knows of any other suitable engine... | Breve is indeed a fascinating tool for simulating complex systems and studying emergence, particularly due to its focus on agent-based modeling and 3D graphics. It allows for the creation of simulations where agents can interact with each other and their environment, making it quite suitable for exploring emergent beha... | 15,878 | [
{
"from": "human",
"value": "Studying emergence, it's quite useful to have a development framework to build upon to quickly test out new ideas. 3d with physics collision would be nice, and open-source would be a big plus. For this purpose 'breve' looks quite promising, but I was wondering if anyone had used... |
I have a popup window containing a form which gathers data for a report.
When I click submit in that window, I want it to close the popup, and open the report in the original window that called the popup.
I think I can open the report in the correct window by using
{ :target => <name of window> }
in the form_tag, but ... | To achieve your goal of closing a popup window and opening a report in the original window, you'll need to use a combination of JavaScript and HTML. Here's how you can implement this step-by-step.
### Step 1: Set the Name of the Originating Window
When you open the popup window from the original window, you can set t... | 10,187 | [
{
"from": "human",
"value": "I have a popup window containing a form which gathers data for a report.\nWhen I click submit in that window, I want it to close the popup, and open the report in the original window that called the popup.\nI think I can open the report in the correct window by using\n{ :target ... |
What do you think is a good IDE for learning SmallTalk? I'll only be using it as a hobby, so it has to be free.
| If you're looking to learn Smalltalk as a hobby and prefer a free IDE, here are a couple of good options:
1. **Pharo**: Pharo is a popular open-source Smalltalk environment. It has an easy-to-use interface and comes with a rich set of tools for development. Pharo is designed to be friendly for beginners and includes a... | 17,279 | [
{
"from": "human",
"value": "What do you think is a good IDE for learning SmallTalk? I'll only be using it as a hobby, so it has to be free.\n"
},
{
"from": "gpt",
"value": "If you're looking to learn Smalltalk as a hobby and prefer a free IDE, here are a couple of good options:\n\n1. **Pharo**:... |
We have an intranet system that schedules routine tasks. We also have Fogbugz for bug tracking. When an urgent bug comes in, we track that task in the bugtracker. However, I need to write back to both the Intranet and our CMS. I'm thinking Biztalk as the middle piece, but am not sure the best way to go about it. Databa... | Integrating different systems like your intranet scheduling system, Fogbugz for bug tracking, and a CMS can indeed be complex. BizTalk Server can help in orchestrating these integrations, but choosing the right approach depends on several factors, including the capabilities of the systems involved, data structure, real... | 13,748 | [
{
"from": "human",
"value": "We have an intranet system that schedules routine tasks. We also have Fogbugz for bug tracking. When an urgent bug comes in, we track that task in the bugtracker. However, I need to write back to both the Intranet and our CMS. I'm thinking Biztalk as the middle piece, but am not... |
The prompt says that if I install the software into a directory with spaces:
the rebuild build tool used by the D Shared Source System will fail to build
and that I will be
forced to reinstall in a different location
However, I don't like random things in my C:\ drive. D, IMO, belongs in Program Files with PHP and ... | If you want to install the software (D) in a directory that contains spaces (such as `C:\Program Files`) while avoiding issues with the build tool, you can use a few workarounds:
1. **Use the Short Path Name**: Windows has short path names for directories that contain spaces. For example, `C:\Program Files` is often r... | 12,610 | [
{
"from": "human",
"value": "The prompt says that if I install the software into a directory with spaces:\n\nthe rebuild build tool used by the D Shared Source System will fail to build\n\nand that I will be\n\nforced to reinstall in a different location\n\nHowever, I don't like random things in my C:\\ dri... |
I want to create basic low-poly 3D models to use in XNA Game Studio games. What cheap/free tools do people recommend?
And does anyone have any links or snippets of code that show how to load 3D models of some sort into XNA and then draw them on the screen?
| Creating low-poly 3D models for use in XNA Game Studio can be done effectively with several free or low-cost tools. Here are a few recommendations:
### 3D Modeling Tools
1. **Blender**
- **Description**: Blender is a powerful open-source 3D modeling tool that is widely used for creating 3D models, animations, and ... | 8,818 | [
{
"from": "human",
"value": "I want to create basic low-poly 3D models to use in XNA Game Studio games. What cheap/free tools do people recommend?\nAnd does anyone have any links or snippets of code that show how to load 3D models of some sort into XNA and then draw them on the screen?\n"
},
{
"from... |
On some Microsoft Access queries, I get the following message: Operation must use an updatable query. (Error 3073). I work around it by using temporary tables, but I'm wondering if there's a better way. All the tables involved have a primary key. Here's the code:
UPDATE CLOG SET CLOG.NEXTDUE = (
SELECT H1.paidth... | The error message "Operation must use an updatable query" (Error 3073) usually occurs in Microsoft Access when you attempt to run an action query (like `UPDATE`) that involves a subquery that isn't updatable. In your case, the nested subqueries are causing the issue.
Here are a few potential approaches to work around ... | 14,240 | [
{
"from": "human",
"value": "On some Microsoft Access queries, I get the following message: Operation must use an updatable query. (Error 3073). I work around it by using temporary tables, but I'm wondering if there's a better way. All the tables involved have a primary key. Here's the code:\nUPDATE CLOG... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.