instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I am getting this linker error.
mfcs80.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in MSVCRT.lib(dllmain.obj)
Please tell me the correct way of eliminating this bug. I read solution on microsoft support site about this bug but it didnt helped much.
I am using VS 2005 with Platform SDK
| The linker error you're encountering indicates that there is a conflict between the MFC library (mfcs80.lib) and the Microsoft C Runtime Library (MSVCRT.lib) because both libraries define the `_DllMain@12` entry point. This issue can arise when you're mixing different runtime libraries or have incorrect project setting... | 48,292 | [
{
"from": "human",
"value": "I am getting this linker error.\n\nmfcs80.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in MSVCRT.lib(dllmain.obj)\n\nPlease tell me the correct way of eliminating this bug. I read solution on microsoft support site about this bug but it didnt helped much.\nI am... |
I have a .NET program to upload an image to a webserver. I am using the ASP.NET file uploading control to do it. The program works alright in my local environment but when I run it on the webserver, I get the following error:
> System.UnauthorizedAccessException:
> Access to the path
> '\\fsvs02\target03\352972\352... | The `System.UnauthorizedAccessException` you're encountering typically indicates that your ASP.NET application does not have the necessary permissions to write to the specified path on the web server. Since the issue is intermittent, it could be due to various reasons, including user access rights, the state of the fil... | 48,217 | [
{
"from": "human",
"value": "I have a .NET program to upload an image to a webserver. I am using the ASP.NET file uploading control to do it. The program works alright in my local environment but when I run it on the webserver, I get the following error:\n> System.UnauthorizedAccessException:\n> Access ... |
I'm calling the code below.
On the line (IDataReader dr = cmd.ExecuteReader()) sql barfs with an Incorrect syntax near 'CompanyUpdate'.
using (SqlCommand cmd = new SqlCommand("CompanyUpdate"))
{
cmd.Parameters.Add("@CompanyID",SqlDbType.Int);
cmd.Parameters.Add("@Description",SqlDbTyp... | The issue you're facing arises from how you're constructing and executing the SQL command. The error message you're receiving, "Incorrect syntax near 'CompanyUpdate'", indicates that SQL Server is expecting a valid SQL command, but it's receiving the name of a stored procedure without the proper execution syntax.
### ... | 48,178 | [
{
"from": "human",
"value": "I'm calling the code below.\nOn the line (IDataReader dr = cmd.ExecuteReader()) sql barfs with an Incorrect syntax near 'CompanyUpdate'.\n using (SqlCommand cmd = new SqlCommand(\"CompanyUpdate\"))\n {\n cmd.Parameters.Add(\"@CompanyID\",SqlDbType.Int);\n ... |
I've got a website (currently in development for a third party, I'm sorry I can't show) that requires users to confirm their contact information by, clicking on a link sent to their email address, upon registration for the website.
It's a pretty standard practice, not very technical or unique, which is why I was surpri... | It's not uncommon for emails sent from dynamic web applications to be blocked or filtered by email providers like Hotmail (Outlook.com) and Yahoo Mail, especially if the emails don’t meet certain criteria or if the domain has not established a good reputation. Here are some key areas to consider, along with resources t... | 46,600 | [
{
"from": "human",
"value": "I've got a website (currently in development for a third party, I'm sorry I can't show) that requires users to confirm their contact information by, clicking on a link sent to their email address, upon registration for the website.\nIt's a pretty standard practice, not very tech... |
What is the best way to limit the amount of text that a user can enter into a 'textarea' field on a web page? The application in question is ASP .NET, but a platform agnostic answer is preferred.
I understand that some amount of javascript is likely needed to get this done as I do not wish to actually perform the 'post... | To limit the amount of text that a user can enter into a `<textarea>` field on a web page, while meeting the criteria you provided, you can implement a combination of HTML, CSS, and JavaScript. Here's a step-by-step guide:
### 1. Use HTML Attributes
Start by setting a `maxlength` attribute on the `<textarea>` to defi... | 49,846 | [
{
"from": "human",
"value": "What is the best way to limit the amount of text that a user can enter into a 'textarea' field on a web page? The application in question is ASP .NET, but a platform agnostic answer is preferred.\nI understand that some amount of javascript is likely needed to get this done as I... |
I arrive to output a string on multiple lines inside a retangle but haven't find a way to reduce or enlarge the line spacing.
How to do that?
| To control the line spacing when outputting text inside a rectangle, you generally have a couple of options, depending on the programming environment or tool you are using. Below are examples for some common environments:
### In HTML/CSS
If you are displaying text on a web page, you can control line spacing (line heig... | 46,478 | [
{
"from": "human",
"value": "I arrive to output a string on multiple lines inside a retangle but haven't find a way to reduce or enlarge the line spacing.\nHow to do that?\n"
},
{
"from": "gpt",
"value": "To control the line spacing when outputting text inside a rectangle, you generally have a c... |
Trying to find the product is installed in remote pC or not, it takes long time to execute,
is there any ways we can achieve this faster.
//usage:
//uninstall4("hostname", "productname", "{AC9C1263-2BA8-4863-BE18-01232375CE42}", "10.0.0.69");
public void uninstall4(string targetServer, string product,string... | When querying remote PCs for installed products using WMI (Windows Management Instrumentation), performance can indeed be an issue, particularly with the `Win32_Product` class. The `Win32_Product` class has significant overhead because it can trigger a consistency check for all installed products, which can take a long... | 46,048 | [
{
"from": "human",
"value": "Trying to find the product is installed in remote pC or not, it takes long time to execute,\nis there any ways we can achieve this faster.\n//usage:\n //uninstall4(\"hostname\", \"productname\", \"{AC9C1263-2BA8-4863-BE18-01232375CE42}\", \"10.0.0.69\");\n public void ... |
VARCHAR does not store Unicode characters.
NVARCHAR does store Unicode characters.
Today's applications should always be Unicode compatible.
NVARCHAR takes twice the amount of space to store it.
Point 4 doesn't matter because storage space is extremely inexpensive.
Ergo: When designing SQL Server databases today, one... | Your reasoning to favor `NVARCHAR` over `VARCHAR` in SQL Server databases is largely sound, particularly given the context of modern applications that frequently handle various languages and special characters. Let's break down your points and explore any potential disagreements or considerations:
1. **Unicode Support... | 49,782 | [
{
"from": "human",
"value": "\nVARCHAR does not store Unicode characters.\nNVARCHAR does store Unicode characters.\nToday's applications should always be Unicode compatible.\nNVARCHAR takes twice the amount of space to store it.\nPoint 4 doesn't matter because storage space is extremely inexpensive.\n\nErgo... |
My situation is as follow:
I have an application that can be started only a fixed number of times (less than 50).
A separate central process to manage other processes is not allowed due to business requirement. (ie. if a nice solution that involves ONLY the application processes is still acceptable)
I am using C# for ... | Using a system-wide mutex is a common way to manage multiple instances of an application, but as you pointed out, there are some challenges when it comes to unexpected termination of processes (e.g., via Task Manager). Here are some considerations regarding your approach and potential alternatives:
### Using a Mutex
... | 48,094 | [
{
"from": "human",
"value": "My situation is as follow:\n\nI have an application that can be started only a fixed number of times (less than 50).\nA separate central process to manage other processes is not allowed due to business requirement. (ie. if a nice solution that involves ONLY the application proce... |
We have an application which uses COM dll.Now, we are pushing updates of this dll.We copy the new dll ( overwriting the existing one) and register the dll. Is this a good practice.Or, should we first unregister the dll already on clients machine.
| When updating a COM DLL, it is generally recommended to unregister the existing DLL before overwriting it and then register the new version. Here are some reasons why this approach is preferable:
1. **Avoiding Conflicts:** If the old DLL is still registered while you're replacing it, there may be inconsistencies that ... | 49,077 | [
{
"from": "human",
"value": "We have an application which uses COM dll.Now, we are pushing updates of this dll.We copy the new dll ( overwriting the existing one) and register the dll. Is this a good practice.Or, should we first unregister the dll already on clients machine.\n"
},
{
"from": "gpt",
... |
I have this XML pattern...
<module>
<promo>
<day>1</day>
<day>2</day>
</promo>
<promo>
<day>3</day>
<day>4</day>
</promo>
<promo>
<day>Default</day>
</promo>
</module>
I would like to stop users putting the same value into 2 <day> tags anywhere in the <module> tag.
I can... | Hi Tom,
To enforce uniqueness across `<day>` tags in your XML structure while allowing multiple `<day>` tags within each `<promo>`, you can indeed face challenges using XSD constraints. However, there are a couple of approaches to achieve your goal:
### Approach 1: Use `xs:unique` with Grouping
You can use `xs:uniqu... | 40,340 | [
{
"from": "human",
"value": "I have this XML pattern...\n<module>\n <promo>\n <day>1</day>\n <day>2</day>\n </promo>\n <promo>\n <day>3</day>\n <day>4</day>\n </promo>\n <promo>\n <day>Default</day>\n </promo>\n</module>\n\nI would like to stop users putting the same val... |
I know python functions are virtual by default. Let's say I have this:
class Foo:
def __init__(self, args):
do some stuff
def goo():
print "You can overload me"
def roo():
print "You cannot overload me"
I don't want them to be able to do this:
class Aoo(Foo):
def roo():
... | In Python, all methods are indeed virtual and can be overridden by subclasses unless specific mechanisms are put in place to prevent this behavior. To prevent the method `roo` from being overridden in subclasses, you can use a couple of approaches.
### 1. Using a Convention (Single Leading Underscore)
One common conv... | 49,713 | [
{
"from": "human",
"value": "I know python functions are virtual by default. Let's say I have this:\nclass Foo:\n def __init__(self, args):\n do some stuff\n def goo():\n print \"You can overload me\"\n def roo():\n print \"You cannot overload me\"\n\nI don't want them to be ab... |
I have a textarea with many lines of input, and a JavaScript event fires that necessitates I scroll the textarea to line 345.
scrollTop sort of does what I want, except as far as I can tell it's pixel level, and I want something that operates on a line level. What also complicates things is that, afaik once again, it's... | To scroll a `<textarea>` to a specific line number while taking into account line wrapping and the pixel-based nature of the `scrollTop` property, you can calculate the pixel position by taking into account the line height and the number of lines that fit within the visible area of the textarea.
Here's a step-by-step... | 20,833 | [
{
"from": "human",
"value": "I have a textarea with many lines of input, and a JavaScript event fires that necessitates I scroll the textarea to line 345.\nscrollTop sort of does what I want, except as far as I can tell it's pixel level, and I want something that operates on a line level. What also complica... |
I have a JSON array with ActiveRecord objects. These objects can be reconstructed using the from_json method, which every AR object has. However with from_json it's only possible to reconstruct one single object.
To process an array, I could of course just extract substrings from the JSON array and create every object ... | Yes, there is a more efficient way to reconstruct an array of ActiveRecord objects from a JSON array without manually manipulating strings. You can use the `from_json` method in conjunction with the `map` method in Ruby to create the objects from a JSON array.
Here's how you can do it:
1. Parse the JSON string into a... | 43,715 | [
{
"from": "human",
"value": "I have a JSON array with ActiveRecord objects. These objects can be reconstructed using the from_json method, which every AR object has. However with from_json it's only possible to reconstruct one single object.\nTo process an array, I could of course just extract substrings fr... |
For statistical reasons, I want an extensive analysis from a dataset. I already have a function that exports the data to Excel, but I have raw data that way; 500 lines, 35 columns, heaps of text sometimes...
Is it possible to include a macro into a function so that the excelfile is readymade to be analyzed?
I am using... | To create an Excel file that is ready for analysis and includes macros, you will need to generate a file format that supports macros, specifically the Excel Macro-Enabled Workbook format (with the extension `.xlsm`). However, since you're currently using Excel 2003, which does not support `.xlsm`, you will need to use ... | 47,913 | [
{
"from": "human",
"value": "For statistical reasons, I want an extensive analysis from a dataset. I already have a function that exports the data to Excel, but I have raw data that way; 500 lines, 35 columns, heaps of text sometimes... \nIs it possible to include a macro into a function so that the excelfi... |
I am getting the following error when an event (Add/Edit/Delete) occurs on my databound control.
Invalid postback or callback argument.
Event validation is enabled using in
configuration or <%@ Page
EnableEventValidation="true" %> in a
page. For security purposes, this
feature verifies that arguments to
po... | The error you're encountering, "Invalid postback or callback argument," typically occurs when ASP.NET event validation detects a discrepancy between the data expected during a postback and what was actually posted back to the server. This is a security feature designed to prevent potentially malicious data from being s... | 49,252 | [
{
"from": "human",
"value": "I am getting the following error when an event (Add/Edit/Delete) occurs on my databound control.\n\nInvalid postback or callback argument.\n Event validation is enabled using in\n configuration or <%@ Page\n EnableEventValidation=\"true\" %> in a\n page. For security purpose... |
Is there a way to force IE or FF into a handheld mode for testing "@media handheld" stylesheets?
Or, do I have to publish the pages and test with my Blackberry?
I'd prefer to test this without pushing the application to the live server as the application is already in use.
Any ideas for me?
| Testing `@media handheld` stylesheets can be a bit challenging since most modern browsers, including Internet Explorer (IE) and Firefox (FF), do not natively support the `handheld` media type in the same way that they handle other media types like `screen` or `print`.
### Options for Testing Handheld Stylesheets
1. *... | 49,746 | [
{
"from": "human",
"value": "Is there a way to force IE or FF into a handheld mode for testing \"@media handheld\" stylesheets?\nOr, do I have to publish the pages and test with my Blackberry?\nI'd prefer to test this without pushing the application to the live server as the application is already in use.\n... |
I've one plist file and I want to parse it and copy it's content into NSArray,and code that I am using for that is.
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES);
NSString *documentsPath = [paths objectAtIndex:0];
NSString *fooPath = [documentsPath stringByAppendi... | The issue you are experiencing may arise from several factors related to file reading and memory management in Objective-C. Let's go through some common reasons and their potential fixes.
1. **File Existence and Accessibility**: Ensure that the file `myfirstplist.plist` always exists in the specified directory (`Docum... | 49,312 | [
{
"from": "human",
"value": "I've one plist file and I want to parse it and copy it's content into NSArray,and code that I am using for that is. \nNSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES);\n\nNSString *documentsPath = [paths objectAtIndex:0];\n\nNSSt... |
How do I post a form to an external site using an ASP.NET MVC controller?
EDIT: Ok... I have a view with some data on it. After the user completes the form I need to do a postback with a specified form format to an external site (like for paypal). After I posted the constructed form I need to redirect the action to a n... | To post a form to an external site using an ASP.NET MVC controller, you need to create a custom form in your view that will submit the required data to the external site (like PayPal). Since the submission happens directly from the client-side (browser), you can use a combination of HTML and JavaScript to achieve this.... | 45,565 | [
{
"from": "human",
"value": "How do I post a form to an external site using an ASP.NET MVC controller?\nEDIT: Ok... I have a view with some data on it. After the user completes the form I need to do a postback with a specified form format to an external site (like for paypal). After I posted the constructed... |
I'm using the Fish Gadget (http://abowman.com/google-modules/fish/) within a wiki based CMS, and need to reposition the gadget from one HTML element to another. (Note: the fish gadget is an example -- the problem occurs with other gadgets as well.)
If I directly reposition the gadget using the gadgets base class "ig_re... | The issue you're encountering with the Fish Gadget (or similar gadgets) when repositioning them within the DOM is indeed related to how browser security and the execution context of scripts work, particularly in relation to iframes.
### Understanding the Issue
1. **Iframe Isolation**: When a gadget loads, it typicall... | 47,511 | [
{
"from": "human",
"value": "I'm using the Fish Gadget (http://abowman.com/google-modules/fish/) within a wiki based CMS, and need to reposition the gadget from one HTML element to another. (Note: the fish gadget is an example -- the problem occurs with other gadgets as well.)\nIf I directly reposition the ... |
Should I instantiate my worker variables inside or outside my for loop
E.g.
a)
bool b = default(bool);
for (int i = 0; i < MyCollection.Length; i++)
{
b = false;
foreach(object myObject in myObjectCollection)
{
if (object.Property == MyCollection[i].Property)
{
b = true;
break;
}
} ... | Your observation about readability and clarity of scope is indeed important when deciding where to instantiate your variables in a loop.
### Option A: Instantiate Outside the Loop
```csharp
bool b = default(bool);
for (int i = 0; i < MyCollection.Length; i++)
{
b = false;
foreach (object myObject in myObject... | 49,663 | [
{
"from": "human",
"value": "Should I instantiate my worker variables inside or outside my for loop\nE.g.\na)\nbool b = default(bool);\n\nfor (int i = 0; i < MyCollection.Length; i++)\n{\n b = false;\n\n foreach(object myObject in myObjectCollection)\n {\n if (object.Property == MyCollection[i].Proper... |
From MS AJAX source code,
Type.isClass = function Type$isClass(type) {
/// <summary locid="M:J#Type.isClass" />
/// <param name="type" mayBeNull="true"></param>
/// <returns type="Boolean"></returns>
var e = Function._validateParams(arguments, [
{name: "type", mayBeNull: true}
]);
if (e) throw e;
if ((typeof(type) ... | In JavaScript, the double negation operator `!!` is commonly used to convert a value to its corresponding boolean representation. Here's a breakdown of why `!!type.__class` is used instead of just returning `type.__class` directly:
1. **Type Coercion**: The expression `type.__class` could return a variety of values:
... | 49,814 | [
{
"from": "human",
"value": "From MS AJAX source code,\nType.isClass = function Type$isClass(type) {\n/// <summary locid=\"M:J#Type.isClass\" />\n/// <param name=\"type\" mayBeNull=\"true\"></param>\n/// <returns type=\"Boolean\"></returns>\nvar e = Function._validateParams(arguments, [\n {name: \"type\"... |
We are experiencing an exceedingly hard to track down issue where we are seeing ClassCastExceptions sometimes when trying to iterate over a list of unmarshalled objects. The important bit is sometimes, after a reboot the particular code works fine. This seems to point in the direction of concurrency/timing/race conditi... | It sounds like you're dealing with a particularly tricky issue involving ClassCastExceptions that arise from the use of JAXB in an OSGi environment. Here are some insights and suggestions that might help you identify and resolve the intermittent ClassCastException problem you're experiencing:
### 1. ClassLoader Issues... | 49,235 | [
{
"from": "human",
"value": "We are experiencing an exceedingly hard to track down issue where we are seeing ClassCastExceptions sometimes when trying to iterate over a list of unmarshalled objects. The important bit is sometimes, after a reboot the particular code works fine. This seems to point in the dir... |
I'd like to rank my stories based on "controversy" quotient. For example, reddit.com currently has "controversial" section: http://www.reddit.com/controversial/
When a story has a lot of up and a lot of down votes, it's controversial even though the total score is 0 (for example). How should I calculate this quotient s... | To create a "controversy quotient" score for your stories, you can use a formula that takes into account both the number of upvotes and downvotes. The general idea is to measure how much disagreement there is among voters. A common approach involves calculating a balance or ratio between upvotes and downvotes while als... | 48,979 | [
{
"from": "human",
"value": "I'd like to rank my stories based on \"controversy\" quotient. For example, reddit.com currently has \"controversial\" section: http://www.reddit.com/controversial/\nWhen a story has a lot of up and a lot of down votes, it's controversial even though the total score is 0 (for ex... |
Is there some easy way to pad Strings in Java?
Seems like something that should be in some StringUtil-like API, but I can't find anything that does this.
| In Java, you can easily pad strings using the `String.format()` method or by using the `StringBuilder` class. However, if you're looking for a more convenient way to pad strings, you can write a simple utility method. Here's how you can do it:
### Using `String.format()`
You can use `String.format()` with a format sp... | 49,241 | [
{
"from": "human",
"value": "Is there some easy way to pad Strings in Java?\nSeems like something that should be in some StringUtil-like API, but I can't find anything that does this.\n"
},
{
"from": "gpt",
"value": "In Java, you can easily pad strings using the `String.format()` method or by us... |
Ok in my ListBox scrolling images w/ text, etc. the saga continues. When I click one of the items, to select it, that runs a process to open a web browser and go to a specific URL. The problem I'm having now is that when the WPF app loses focus, and the web browser opens, the item clicked inside the listbox turns white... | The issue you're experiencing with the ListBox item turning white when the WPF application loses focus is likely related to the WPF selection behavior and the styling you've applied. When the ListBox loses focus, it changes the visual state of the selected item based on the triggers you've defined. The `MultiTrigger` y... | 49,052 | [
{
"from": "human",
"value": "Ok in my ListBox scrolling images w/ text, etc. the saga continues. When I click one of the items, to select it, that runs a process to open a web browser and go to a specific URL. The problem I'm having now is that when the WPF app loses focus, and the web browser opens, the it... |
I've become very addicted to Project Euler recently and am trying to do this one next! I've started some analysis on it and have reduced the problem down substantially already. Here's my working:
A = pqr and
1/A = 1/p + 1/q + 1/r so pqr/A =
pq + pr + qr
And because of the first equation:
pq+pr+qr = 1
Since exa... | It looks like you're tackling a challenging problem from Project Euler, and you've made some good progress with your algebraic reduction! However, searching for the pairs \((a, b)\) directly, as your current implementation does, might be quite inefficient, especially as you approach the 150,000th smallest integer.
To ... | 49,269 | [
{
"from": "human",
"value": "I've become very addicted to Project Euler recently and am trying to do this one next! I've started some analysis on it and have reduced the problem down substantially already. Here's my working:\n\nA = pqr and\n1/A = 1/p + 1/q + 1/r so pqr/A =\n pq + pr + qr\nAnd because... |
This question is best summed up with a code example:
module TestOne
module Foo
def foo
42
end
end
module Bar
include Foo
end
class Quux
include Bar
end
end
TestOne::Bar.ancestors # => [TestOne::Bar, TestOne::Foo]
TestOne::Quux.ancestors # => [TestOne::Quux, TestOne::Bar, TestOne::Fo... | Your understanding of how module inclusion works in Ruby is on the right track, but there is a subtlety in the way methods are made available through module inclusion that leads to the behavior you're observing.
In Ruby, when you include a module inside a class, the methods defined in that module are added to the meth... | 42,432 | [
{
"from": "human",
"value": "This question is best summed up with a code example:\nmodule TestOne\n module Foo\n def foo\n 42\n end\n end\n\n module Bar\n include Foo\n end\n\n class Quux\n include Bar\n end\nend\n\nTestOne::Bar.ancestors # => [TestOne::Bar, TestOne::Foo]\nTestOne::Qu... |
I'm using a bookmarklet that inserts a script tag into the current web page.
This script has some UI and an "input type=submit...." tag in it.
Web page A has chosen not to style "input type=submit.." tags whereas web page B has styled them.
This results in the bookmarklet displaying differently styled submit
buttons ba... | To ensure that your submit buttons in the bookmarklet display in a default manner, regardless of the underlying page's styles, you can take a couple of approaches. The goal is to override any existing styles applied to the `<input type="submit">` elements and ensure that your buttons render with their browser-specific ... | 47,605 | [
{
"from": "human",
"value": "I'm using a bookmarklet that inserts a script tag into the current web page.\nThis script has some UI and an \"input type=submit....\" tag in it.\nWeb page A has chosen not to style \"input type=submit..\" tags whereas web page B has styled them.\nThis results in the bookmarklet... |
I have two computers. Both running WinXP SP2 (I don't really know ho similar they are beyond that). I am running MS Visual C# 2008 express edition on both and that's what I'm currently using to program.
I made an application that loads in an XML file and displays the contents in a DataGridView.
The first line of my x... | It sounds like you're encountering an encoding issue that might be stemming from how the XML file is being read and displayed in your application. Given that you're using Visual C# 2008 and dealing with XML files, here are a few troubleshooting steps and suggestions to help you resolve this issue:
### 1. Check the Enc... | 48,209 | [
{
"from": "human",
"value": "I have two computers. Both running WinXP SP2 (I don't really know ho similar they are beyond that). I am running MS Visual C# 2008 express edition on both and that's what I'm currently using to program.\nI made an application that loads in an XML file and displays the contents... |
I have a WCF server and I'm tapping into the "Faulted" event which stupidly only gives me "object sender, EventArgs e". How can I get the current 'Exception' object in that event?
Or, if there is some sort of global system way, like Environment.GetCurrentException(), that would be awesome, but I can't find it.
EDIT: To... | In WCF, handling errors globally is slightly different from ASP.NET. When you subscribe to the `Faulted` event of a WCF service, you are notified that the channel has entered the faulted state. Unfortunately, the `Faulted` event does not provide the original exception that caused the fault directly through the event ar... | 47,735 | [
{
"from": "human",
"value": "I have a WCF server and I'm tapping into the \"Faulted\" event which stupidly only gives me \"object sender, EventArgs e\". How can I get the current 'Exception' object in that event?\nOr, if there is some sort of global system way, like Environment.GetCurrentException(), that w... |
How do I let Microsoft know about a problem I've found in one of their core library routines? Do they have a central repository to report these things?
I am not a member of Microsoft Development Network (MSDN).
Or should I even bother?
| If you've encountered a problem with a Microsoft core library routine and want to report it, you have a few options, even if you're not a member of the Microsoft Developer Network (MSDN):
1. **GitHub**: Many of Microsoft's open-source projects, including parts of the .NET framework and other libraries, are hosted on G... | 45,164 | [
{
"from": "human",
"value": "How do I let Microsoft know about a problem I've found in one of their core library routines? Do they have a central repository to report these things?\nI am not a member of Microsoft Development Network (MSDN).\nOr should I even bother?\n"
},
{
"from": "gpt",
"value... |
I have a situation where I need to work with a datagrid and adding columns dynamically in PageInit as the grid has a few conditional requests that it must handle. I'm moving along easily with BoundColumns, and ButtonColumns, those are easy. The problem is with the creation of a TemplateColumn via code. I have found ... | Creating a `TemplateColumn` dynamically in a DataGrid and binding data to controls within the template can indeed be a bit tricky. Here's a step-by-step approach to achieve this using `ITemplate`.
### Step 1: Create a Custom Template Class
You'll need to create a class that implements the `ITemplate` interface. This ... | 46,411 | [
{
"from": "human",
"value": "I have a situation where I need to work with a datagrid and adding columns dynamically in PageInit as the grid has a few conditional requests that it must handle. I'm moving along easily with BoundColumns, and ButtonColumns, those are easy. The problem is with the creation of ... |
I want to port few C/C++ libraries to Android, how feasible it would be
e.g. OpenSSL can it be ported
or suppose an application which depends on OpenSSL, what is the best way to port it to Android when Android I think itself has libssl.so
what are the tools available e.g. Scratchbox, any alternatives?
Has anybody exper... | Porting C/C++ libraries to Android can be quite feasible, but there are several considerations to keep in mind, particularly regarding compatibility and dependencies. Let's break down your concerns regarding OpenSSL, tools for porting, and general advice for working with C/C++ on Android.
### Porting OpenSSL to Androi... | 46,263 | [
{
"from": "human",
"value": "I want to port few C/C++ libraries to Android, how feasible it would be\ne.g. OpenSSL can it be ported\nor suppose an application which depends on OpenSSL, what is the best way to port it to Android when Android I think itself has libssl.so\nwhat are the tools available e.g. Scr... |
Now I know there are a lot of similar questions around SO but I think I've covered all the basics. Here's what I know:
My favicon is accessible through /favicon.ico (full link)
The HTML is (page URL):
<link rel="icon" href="http://www.bandcmotors.co.uk/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href=... | It sounds like you've gone through many troubleshooting steps for your favicon issue, and the fact that it suddenly started working after a restart indicates that it was indeed a caching problem. Browsers can sometimes hold onto favicon caches stubbornly, making it frustrating when you make changes but don't see the ef... | 48,909 | [
{
"from": "human",
"value": "Now I know there are a lot of similar questions around SO but I think I've covered all the basics. Here's what I know:\nMy favicon is accessible through /favicon.ico (full link)\nThe HTML is (page URL):\n<link rel=\"icon\" href=\"http://www.bandcmotors.co.uk/favicon.ico\" type=\... |
I'm studying an introductory course in databases and one of the exercises is to work with MS-Access. However I'm using Linux at home and although I can use the computer classes at the university it is far from convenient (limited open time - my studying time is mostly nights).
So how can I use an Access file (*.mdb) in... | Using Microsoft Access files (.mdb) on Linux can be challenging, but there are several approaches you can take. Here’s a guide on how to work with Access files on Linux, including tools for conversion and potential issues you may encounter.
### Tools for Working with .mdb Files on Linux
1. **MDBTools**:
- **Overvi... | 48,560 | [
{
"from": "human",
"value": "I'm studying an introductory course in databases and one of the exercises is to work with MS-Access. However I'm using Linux at home and although I can use the computer classes at the university it is far from convenient (limited open time - my studying time is mostly nights).\n... |
If I am posting a question about a query against an Oracle database, what should I include in my question so that people have a chance to answer me? How should I get this information?
Simply providing the poorly performing query may not be enough.
| When posting a question about a query against an Oracle database, it's important to provide sufficient context and details to help others understand the issue you're facing and to give them a better chance of providing helpful answers. Here’s a structured approach to what you should include in your question:
### 1. **... | 48,739 | [
{
"from": "human",
"value": "If I am posting a question about a query against an Oracle database, what should I include in my question so that people have a chance to answer me? How should I get this information?\nSimply providing the poorly performing query may not be enough.\n"
},
{
"from": "gpt"... |
Has anyone implemented sorting a list of domain names?
I have seen some applications sort them as flat strings, but the problem is that you end up scattering all the related hosts in a domain:
a.me.com
a.you.com
b.me.com
b.you.com
So, the basic logic I came up with reverse the order of the labels, then sort.
FQDNs of o... | Sorting domain names while keeping related domains together can be a bit tricky, especially with traditional sorting methods. However, your approach of reversing the order of the labels is a good idea and can help to achieve the desired sorting. Let's break this down into implementations in both JavaScript and Java.
... | 49,108 | [
{
"from": "human",
"value": "Has anyone implemented sorting a list of domain names?\nI have seen some applications sort them as flat strings, but the problem is that you end up scattering all the related hosts in a domain:\na.me.com\na.you.com\nb.me.com\nb.you.com\nSo, the basic logic I came up with reverse... |
I'm building a webpage that queries a MySQL database and (currently) produces a text-only list of the findings. The queries to complete a single record are similar to:
movie (title, description, etc)
actors in the movie (name, gender)
related movies
Out of curiosity I've used memory_get_peak_usage() and memory_get... | When it comes to memory usage in PHP applications, especially those involving database queries, there are a few factors to consider. The memory usage figures you've provided seem reasonable, especially given that you're working with potentially large datasets (e.g., movie titles, descriptions, and actor information). H... | 45,022 | [
{
"from": "human",
"value": "I'm building a webpage that queries a MySQL database and (currently) produces a text-only list of the findings. The queries to complete a single record are similar to:\n\nmovie (title, description, etc)\n\n\nactors in the movie (name, gender)\nrelated movies\n\n\nOut of curiosit... |
I have a string that has angle brackets in it like this:
<element1>my text here</element1>
The string literally looks like this when I write it to console or my dataGridView or anywhere else. However, I'm trying to write this as part of an XML document.
Everything is fine except that in the xml file that is written... | When writing strings that contain XML-like structures to an XML document, the characters such as `<` and `>` get escaped to `<` and `>` respectively. This is a standard behavior in XML to ensure that the content is well-formed and doesn't get interpreted as markup.
If you want to write the string as literal text... | 44,538 | [
{
"from": "human",
"value": "I have a string that has angle brackets in it like this:\n<element1>my text here</element1>\n\nThe string literally looks like this when I write it to console or my dataGridView or anywhere else. However, I'm trying to write this as part of an XML document. \nEverything is fin... |
I want to use the GridView mode of a ListView to display a set of data that my program will be receiving from an external source. The data will consist of two arrays, one of column names and one of strings values to populate the control.
I don't see how to create a suitable class that I can use as the Item in a ListVi... | To use a `ListView` in `GridView` mode to dynamically display data in WPF, where the columns and their respective data are determined at runtime, you can make use of a dynamic data structure, such as a `DataTable` or a `Dictionary`. Here, I'll demonstrate how to implement both methods.
### Method 1: Using DataTable
Y... | 43,718 | [
{
"from": "human",
"value": "I want to use the GridView mode of a ListView to display a set of data that my program will be receiving from an external source. The data will consist of two arrays, one of column names and one of strings values to populate the control.\nI don't see how to create a suitable cl... |
Actionscript 3.0 has decent native XML support so I'm not surprised to see a lot of people loading an external XML and then passing the object around to various modules/sections of code.
However my instinct is to create a class (i.e. with statically named/typed fields), populate it from the XML and pass THAT around ins... | You've touched on an important aspect of software design: the trade-off between flexibility and structure. Both approaches—using XML directly and creating a class to encapsulate your data—have their advantages and disadvantages.
### Using XML Directly
**Advantages:**
- **Flexibility**: XML is inherently flexible. You... | 42,851 | [
{
"from": "human",
"value": "Actionscript 3.0 has decent native XML support so I'm not surprised to see a lot of people loading an external XML and then passing the object around to various modules/sections of code.\nHowever my instinct is to create a class (i.e. with statically named/typed fields), populat... |
I am having an issue with SSH hanging on my Mac Book Pro. This only happens to me once I get home from work after I have used SSH while at work. The three factors I have narrowed the issue down to are SSH, our work AFS network drive and the method of network connectivity.
At work we use an AFS drive with Kerberos Authe... | It sounds like a frustrating situation! The symptoms you're describing often relate to DNS resolution issues, lingering socket connections, or authentication problems from your work network. Here are a few troubleshooting steps and potential solutions to consider:
### 1. Check DNS Settings
Since you're switching from... | 47,308 | [
{
"from": "human",
"value": "I am having an issue with SSH hanging on my Mac Book Pro. This only happens to me once I get home from work after I have used SSH while at work. The three factors I have narrowed the issue down to are SSH, our work AFS network drive and the method of network connectivity.\nAt wo... |
On top of my head, especially for C/Linux developer:
ack
git-bz
colorgcc
colordiff
moap and prepare-ChangeLog
Is there some tool/script you couldn't work without, but that you feel others don't know so much?
For instance, I just found:
cppcheck
| As a C/Linux developer, there are indeed many tools and scripts that can significantly enhance productivity and code quality. Aside from the ones you've listed, here are some lesser-known tools that could be incredibly valuable:
1. **ctags**: This tool generates an index (or tag) file of names found in source code def... | 48,019 | [
{
"from": "human",
"value": "On top of my head, especially for C/Linux developer:\n\nack\ngit-bz\ncolorgcc\ncolordiff\nmoap and prepare-ChangeLog\n\nIs there some tool/script you couldn't work without, but that you feel others don't know so much?\nFor instance, I just found:\n\ncppcheck\n\n"
},
{
"f... |
I would like to know how to setup an SVN repository with LDAP authentication.
I do not want to use Apache DAV though.
| Setting up an SVN (Subversion) repository with LDAP authentication without using Apache DAV involves configuring the SVN server to use LDAP for authentication through command-line interfaces. Here's a step-by-step guide to accomplish this using the `svnserve` command.
### Prerequisites
1. **SVN Installed**: Ensure yo... | 48,947 | [
{
"from": "human",
"value": "I would like to know how to setup an SVN repository with LDAP authentication.\nI do not want to use Apache DAV though.\n"
},
{
"from": "gpt",
"value": "Setting up an SVN (Subversion) repository with LDAP authentication without using Apache DAV involves configuring th... |
is it possible to access calendar entries on the iPhone/iPod touch, i.e. reading, creating, changing, deleting appointments?
I searched the iPhone SDK documentation but didn't find anything. Perhaps I missed something.
| Yes, it is possible to access calendar entries on an iPhone or iPod touch using the EventKit framework provided by Apple. EventKit allows you to read, create, modify, and delete calendar events and reminders.
To use EventKit, you will need to import the EventKit framework in your project and request permission from th... | 46,950 | [
{
"from": "human",
"value": "is it possible to access calendar entries on the iPhone/iPod touch, i.e. reading, creating, changing, deleting appointments?\nI searched the iPhone SDK documentation but didn't find anything. Perhaps I missed something.\n"
},
{
"from": "gpt",
"value": "Yes, it is pos... |
Sorry - this may be an easy question, I'm new to iPhone development and still wrapping my head around Views vs ViewControllers.
I have a NavigationViewController and I can push Views using the following method in the RootViewController which is connected to a Bar Button Item:
- (IBAction)switch:(id)sender {
NSL... | You're on the right track, and it's great to see you're diving into iPhone development! To call the same method from a button in your view, you don't need to create a new instance of your `RootViewController`. Instead, you can reference the existing instance.
Here's how to do it:
1. **Delegate Pattern or Target-Actio... | 48,183 | [
{
"from": "human",
"value": "Sorry - this may be an easy question, I'm new to iPhone development and still wrapping my head around Views vs ViewControllers.\nI have a NavigationViewController and I can push Views using the following method in the RootViewController which is connected to a Bar Button Item:\n... |
I defined a Controller to force authentication by using the [Authorize] attribute. When a session times out, the request is still passed down and executed instead of forcing a redirect.
I do use FormsAuthentication to login and logoff users.
Any ideas on how to control that?
Example:
[Authorize]
public class ProjectsC... | It sounds like you're experiencing an issue where, even with the `[Authorize]` attribute applied to your controller, users are still able to execute actions in that controller when their session times out. This can happen if the authentication middleware isn't set up properly or if the application is allowing unauthent... | 41,181 | [
{
"from": "human",
"value": "I defined a Controller to force authentication by using the [Authorize] attribute. When a session times out, the request is still passed down and executed instead of forcing a redirect.\nI do use FormsAuthentication to login and logoff users.\nAny ideas on how to control that?\n... |
I have been looking through Scott Guthrie's MVC tutorials and it seems like the syntax for doing strongly typed views has changed, or I am doing something wrong...
My controller code:
return View(CurrentUser);
Code behind in the view:
public partial class EditProfile : ViewPage<User>
Yet in the view's front end ... | It sounds like you're using the older version of ASP.NET MVC syntax with `ViewPage<T>`, but the way you're trying to access the model in your view might be where the confusion is coming from.
When you define your view to be strongly typed using `ViewPage<User>`, you should be able to access the properties of your `Use... | 49,225 | [
{
"from": "human",
"value": "I have been looking through Scott Guthrie's MVC tutorials and it seems like the syntax for doing strongly typed views has changed, or I am doing something wrong... \nMy controller code:\nreturn View(CurrentUser);\n\nCode behind in the view:\n public partial class EditProfile ... |
Is there a pure .net way to do this reliably? The solutions I keep finding either require guessing or they have a solution that is specific to a database provider. Usually querying some internal system table to get this information.
| In .NET, when you're working with databases, you might sometimes need to discover information about the database schema, such as tables, columns, and their data types. If you're looking for a "pure .NET" way to accomplish this without relying on specific database providers, you can utilize the `System.Data.Common` name... | 45,873 | [
{
"from": "human",
"value": "Is there a pure .net way to do this reliably? The solutions I keep finding either require guessing or they have a solution that is specific to a database provider. Usually querying some internal system table to get this information.\n"
},
{
"from": "gpt",
"value": "... |
I have a WPF program to which I need to add a "Demo mode". Since I want my designers to be able to modify the demo mode without me having to recompile the program each time, I tough it would be a great idea to use a storyboard from an external XAML file. The "Demo mode" is basically a storyboard animating some of the a... | To animate a dependency property (DP) of a static object in WPF from an external XAML storyboard, you'll indeed need to utilize the `Storyboard.TargetName` and `Storyboard.TargetProperty`. Since you're working with a singleton static member of your application's class, you cannot declare it directly in the XAML. Instea... | 49,199 | [
{
"from": "human",
"value": "I have a WPF program to which I need to add a \"Demo mode\". Since I want my designers to be able to modify the demo mode without me having to recompile the program each time, I tough it would be a great idea to use a storyboard from an external XAML file. The \"Demo mode\" is b... |
I am making a little GUI frontend for a app at the moment using wxPython.
I am using wx.StaticText() to create a place to hold some text, code below:
content = wx.StaticText(panel, -1, "Text Here", style=wx.ALIGN_CENTRE)
I have a button when clicked retrieves data from MySQL, I am wanting to change the value of the St... | To change the text displayed by a `wx.StaticText` widget after retrieving data from MySQL, you just need to use the `SetLabel()` method, which is specifically designed for `wx.StaticText` instances.
Here is an example of how you can retrieve data from your MySQL database and update the `wx.StaticText`:
```python
impo... | 46,138 | [
{
"from": "human",
"value": "I am making a little GUI frontend for a app at the moment using wxPython.\nI am using wx.StaticText() to create a place to hold some text, code below:\ncontent = wx.StaticText(panel, -1, \"Text Here\", style=wx.ALIGN_CENTRE)\n\nI have a button when clicked retrieves data from My... |
Is it possible to set up somehow Microsoft SQL Server to run a stored procedure on regular basis?
| Yes, you can set up Microsoft SQL Server to run a stored procedure on a regular basis using SQL Server Agent, which is a component of SQL Server designed for job scheduling. Here are the general steps to create a job that runs a stored procedure at specified intervals:
### Steps to Set Up a Scheduled Job to Run a Stor... | 46,795 | [
{
"from": "human",
"value": "Is it possible to set up somehow Microsoft SQL Server to run a stored procedure on regular basis?\n"
},
{
"from": "gpt",
"value": "Yes, you can set up Microsoft SQL Server to run a stored procedure on a regular basis using SQL Server Agent, which is a component of SQ... |
How can I place a MFC CFormView inside a CDockablePane which was introduced in the VS 2008 MFC Feature Pack?
| To place a `CFormView` inside a `CDockablePane` in an MFC application (introduced in the Visual Studio 2008 MFC Feature Pack), you need to follow several steps to ensure proper integration and behavior of the dockable pane and the form view. Below are the steps to achieve this:
### 1. Create the CFormView Class
First... | 48,219 | [
{
"from": "human",
"value": "How can I place a MFC CFormView inside a CDockablePane which was introduced in the VS 2008 MFC Feature Pack?\n"
},
{
"from": "gpt",
"value": "To place a `CFormView` inside a `CDockablePane` in an MFC application (introduced in the Visual Studio 2008 MFC Feature Pack)... |
How can I send an email using SYstem.Net.Mail to an email address that is unusual (myFirstName.O'Reilly@mywebsite.com) but is still RFC 5322 compliant?
Does .NET support sending mail addresses that have single quotes in them, and if so, how do I force the system to allow email to be sent to those addresses? Right now w... | Yes, .NET's `System.Net.Mail` does support sending emails to addresses that conform to the RFC 5322 specification, which includes email addresses with special characters, such as single quotes. However, you need to ensure that you properly format and encode such addresses.
### Steps to Send Emails with Unusual Charact... | 47,809 | [
{
"from": "human",
"value": "How can I send an email using SYstem.Net.Mail to an email address that is unusual (myFirstName.O'Reilly@mywebsite.com) but is still RFC 5322 compliant?\nDoes .NET support sending mail addresses that have single quotes in them, and if so, how do I force the system to allow email ... |
I want to develop a very simple 2D game in Python. Pygame is the most popular library for game development in Python, but I'm already quite familiar with wxPython and feel comfortable using it. I've even written a Tetris clone in it, and it was pretty smooth.
I wonder, what does Pygame offer in terms of graphics (leavi... | Pygame and wxPython are both powerful libraries in Python, but they serve different purposes and excel in different areas. Here's a breakdown of what Pygame offers in terms of graphics that may make it more suitable for game development compared to wxPython:
### 1. **Game Loop Structure**:
- **Pygame**: Pygame is b... | 49,845 | [
{
"from": "human",
"value": "I want to develop a very simple 2D game in Python. Pygame is the most popular library for game development in Python, but I'm already quite familiar with wxPython and feel comfortable using it. I've even written a Tetris clone in it, and it was pretty smooth.\nI wonder, what doe... |
What is the simplest way to get the machine's time zone as a positive or negative UTC offset, preferably using some time of shell command?
| You can easily get the machine's UTC offset in a shell environment using the `date` command. Here are a couple of simple ways to do it:
### Using `date`
You can run the following command in your terminal:
```bash
date +%z
```
This will output the UTC offset in the format `±HHMM`. For example, `-0500` for UTC-5 or `+... | 43,816 | [
{
"from": "human",
"value": "What is the simplest way to get the machine's time zone as a positive or negative UTC offset, preferably using some time of shell command?\n"
},
{
"from": "gpt",
"value": "You can easily get the machine's UTC offset in a shell environment using the `date` command. He... |
My goal is to implements different image classification methods to show how they function and the advantages and disadvantages behind such methods. The ones I want to try and implement using Java include;
Minimum distance classifier
k-nearest neighbour classifier.
I was wondering what can be used to accomplish my task... | To implement image classification methods such as the Minimum Distance Classifier and k-Nearest Neighbors (k-NN) in Java, you have a variety of libraries and tools at your disposal. Here are some options that you can use to accomplish your task, along with a brief description of each:
### 1. **Java Image Processing Li... | 48,311 | [
{
"from": "human",
"value": "My goal is to implements different image classification methods to show how they function and the advantages and disadvantages behind such methods. The ones I want to try and implement using Java include; \nMinimum distance classifier\nk-nearest neighbour classifier.\nI was wond... |
Is there a way to automatically publish a website to multiple locations at once?
Our website is load balanced across multiple servers, so when I want to publish I have to do it to each server individually.
Thx,
Trev
| Yes, there are several approaches you can take to automatically publish a website to multiple locations (servers) at once. Here are a few options:
### 1. **Deployment Automation Tools**
- **CI/CD Pipelines**: Tools like Jenkins, GitLab CI/CD, GitHub Actions, or CircleCI can be used to automate the deployment proces... | 49,488 | [
{
"from": "human",
"value": "Is there a way to automatically publish a website to multiple locations at once?\nOur website is load balanced across multiple servers, so when I want to publish I have to do it to each server individually.\nThx,\nTrev\n"
},
{
"from": "gpt",
"value": "Yes, there are ... |
Or any other design that has the gui widgets as being the first port of call where an unhandled exception will kill the app?
We all want one main: "catch all" for face saving purposes (although in most cases this shouldn't have a "continue" feature) but it is impossible to easily implement one with gui widgets that are... | Your question touches on an important aspect of application design, particularly in GUI-based applications where unhandled exceptions can lead to a poor user experience and application crashes. There are several considerations and strategies for dealing with exception handling in GUI applications like those built with ... | 48,402 | [
{
"from": "human",
"value": "Or any other design that has the gui widgets as being the first port of call where an unhandled exception will kill the app?\nWe all want one main: \"catch all\" for face saving purposes (although in most cases this shouldn't have a \"continue\" feature) but it is impossible to ... |
I'm trying to unmount a WebDAV volume (mounted with FSMountServerVolumeSync()) using either FSUnmountVolumeSync() or FSEjectVolumeSync(). Thus far I've been unable to get either of them to reliably unmount the volume without blocking for more than 20 seconds. While they're blocking I can see webdavfs_agent complainin... | When dealing with WebDAV volumes and trying to unmount them on macOS, you might encounter issues like the ones you're experiencing with `FSUnmountVolumeSync()` and `FSEjectVolumeSync()`. Here are some considerations that could help clarify the situation and potentially provide a solution:
### Understanding FSUnmountVo... | 48,657 | [
{
"from": "human",
"value": "I'm trying to unmount a WebDAV volume (mounted with FSMountServerVolumeSync()) using either FSUnmountVolumeSync() or FSEjectVolumeSync(). Thus far I've been unable to get either of them to reliably unmount the volume without blocking for more than 20 seconds. While they're blo... |
Will the individual UML diagram shapes be NSView subclasses or NSBezierPaths? How are the diagrams created and managed?
| When designing UML diagram tools in a macOS application using Cocoa, you can choose between using `NSView` subclasses and `NSBezierPath` for representing individual UML diagram shapes. Each approach has its own advantages and considerations:
### Using NSView Subclasses
1. **Structure and Behavior**: Each UML shape ca... | 49,483 | [
{
"from": "human",
"value": "Will the individual UML diagram shapes be NSView subclasses or NSBezierPaths? How are the diagrams created and managed?\n"
},
{
"from": "gpt",
"value": "When designing UML diagram tools in a macOS application using Cocoa, you can choose between using `NSView` subclas... |
I am trying to loop on a recordset returned from db2 using a .wsf file and vbscript .
the vbscript libfile(lib.vbs) is as follows
'***************
Const ADOCon="Provider=IBMDADB2.1;Password=*****;User ID=*****;Data Source=yourdatasourc;"
'************************
'ADO environment is Initialised here
'************... | It looks like you are attempting to loop through a recordset obtained from a DB2 database using ADO in VBScript. However, you are encountering issues with moving through the recordset, specifically with the `MoveNext` method. Below, I'll provide some insights and changes to make your script work.
### Key Points to Add... | 47,538 | [
{
"from": "human",
"value": "I am trying to loop on a recordset returned from db2 using a .wsf file and vbscript .\nthe vbscript libfile(lib.vbs) is as follows\n'*************** \nConst ADOCon=\"Provider=IBMDADB2.1;Password=*****;User ID=*****;Data Source=yourdatasourc;\"\n'************************ \n'ADO... |
Let's just assume that I don't know much about Kerberos - just the basics.
I have...
Debian Linux 2.6 Webserver
Apache 2.2
mod_auth_kerb/5.3
PHP/5.2
a (working) Kerberos Realm
Windows Client
Firefox 3
an logged in identity "user@EXAMPLE.COM" in MIT Network Identity Manager
How do I use this information in a... | Using Kerberos authentication without having Apache handle it directly requires you to set up a way for your PHP application to access the user's Kerberos credentials. Here’s a guide to help you achieve that on your Debian server with Apache and mod_auth_kerb:
### Step 1: Configure mod_auth_kerb
Even though you menti... | 49,653 | [
{
"from": "human",
"value": "Let's just assume that I don't know much about Kerberos - just the basics.\nI have...\n\nDebian Linux 2.6 Webserver\n\n\nApache 2.2\n\n\nmod_auth_kerb/5.3 \nPHP/5.2\n\n\na (working) Kerberos Realm\nWindows Client\n\n\nFirefox 3\nan logged in identity \"user@EXAMPLE.COM\" in MIT ... |
I'd like to make a video tutorial for my SDK--one of those videos that shows the screen while some dude talks about what he's doing. Can someone direct me to easy and preferably free tools for doing so?
Desired features:
- Cuts (recording several snippets of video and putting them together afterward)
- Subtitles (not o... | Creating a video tutorial for your SDK on Windows can be accomplished using several free tools that offer screen recording, editing, and subtitle capabilities. Here are some recommended options that meet your requirements:
### Screen Recording Tools
1. **OBS Studio**
- **Features**: Free and open-source, supports ... | 48,017 | [
{
"from": "human",
"value": "I'd like to make a video tutorial for my SDK--one of those videos that shows the screen while some dude talks about what he's doing. Can someone direct me to easy and preferably free tools for doing so?\nDesired features:\n- Cuts (recording several snippets of video and putting ... |
I have a Windows Event Log entry giving the offset of the failed call triggering an application crash. I have a release build, the corresponding .PDB file, and the source.
I do not have a .MAP or .COD file.
How can I find the failing source line?
| To find the source line associated with a specific offset from a Windows Event Log entry in a release build, you can use the Program Database (PDB) file. Here's a step-by-step guide on how to do this:
### Prerequisites
1. **PDB file**: Ensure you have the PDB file that corresponds to the release build of your applicat... | 46,622 | [
{
"from": "human",
"value": "I have a Windows Event Log entry giving the offset of the failed call triggering an application crash. I have a release build, the corresponding .PDB file, and the source.\nI do not have a .MAP or .COD file.\nHow can I find the failing source line?\n"
},
{
"from": "gpt",... |
Say I have two tables, a master list of students containing personal info, and a list of student enrollments in classes. The two tables share a common column, which is a string uniquely identifying the student, but it is not the primary key.
Say I want to display all the enrollments on a page, along with some of the p... | Yes, your understanding of the relationship between the `Student` and `Enrollment` models is correct. In this case, a `Student` can have many `Enrollments`, and each `Enrollment` belongs to a single `Student`.
The relationship is set up correctly with the `has_many` and `belongs_to` associations in your models:
```ru... | 47,989 | [
{
"from": "human",
"value": "Say I have two tables, a master list of students containing personal info, and a list of student enrollments in classes. The two tables share a common column, which is a string uniquely identifying the student, but it is not the primary key. \nSay I want to display all the enrol... |
If the framework is persistence agnostic, can my unit tests construct a file system version of the persistance store underneath my entity model?
I'll be using the model first features of entity framework in the GUI for sure because it's too easy for my devs to make schema changes and keep DAL layer in sync.
Has anyone ... | Yes, you can definitely create a persistence-agnostic framework while still leveraging Entity Framework (EF) with model-first development. The key concept here is to separate your entity model from your persistence mechanism, allowing for more flexibility in your application architecture. Below are some suggestions on ... | 42,826 | [
{
"from": "human",
"value": "If the framework is persistence agnostic, can my unit tests construct a file system version of the persistance store underneath my entity model?\nI'll be using the model first features of entity framework in the GUI for sure because it's too easy for my devs to make schema chang... |
I am writing a client for a backup server.
My client schedules some folders for backup. (ex: every friday at hour X).
I am using for scheduling cron4j (a port of Linux cron to java).
Everything works nice until i schedule at the same time multiple upload jobs, then due to the multiple threads it gets messy.
Can anyone ... | To handle multiple uploads to an FTP server from multiple threads effectively, you need to manage thread safety and resource contention properly. Here are some strategies you can consider:
### 1. Use a Thread Pool
Instead of creating a new thread for each upload, use a thread pool to manage your threads. The `Executo... | 49,054 | [
{
"from": "human",
"value": "I am writing a client for a backup server.\nMy client schedules some folders for backup. (ex: every friday at hour X).\nI am using for scheduling cron4j (a port of Linux cron to java).\nEverything works nice until i schedule at the same time multiple upload jobs, then due to the... |
I have a Linq Query where I do the following:
query = context.Select(a => new
{
Course = (CourseType)a.CourseCode,
CourseDetail = sting.Format("Course: {0}\r\nCourse Detail: {1}", ((CourseType)a.CourseCode).ToString(), a.CourseDetail)
});
enum CourseType{
Unknown = 0,
FullTime = 1,
PartTime = 2
}
a.CourseCo... | The issue you're encountering with the tooltip displaying the integer value of the enum instead of the formatted string you're expecting is likely related to how the tooltip is being assigned and how the data binding is processed.
In your LINQ query, you are constructing an anonymous object with two properties: `Cours... | 48,271 | [
{
"from": "human",
"value": "I have a Linq Query where I do the following:\nquery = context.Select(a => new \n{\n Course = (CourseType)a.CourseCode,\n CourseDetail = sting.Format(\"Course: {0}\\r\\nCourse Detail: {1}\", ((CourseType)a.CourseCode).ToString(), a.CourseDetail)\n});\n\nenum CourseType{\n Un... |
I am trying to implement a wpf user control that binds a text box to a list of doubles using a converter. How can i set the instance of user control to be the converter parameter?
the code for the control is shown below
Thanks
<UserControl x:Class="BaySizeControl.BaySizeTextBox"
xmlns="http://schemas.microsoft.co... | To bind a TextBox in a WPF UserControl to a list of doubles using a converter and set the instance of the UserControl as a parameter for that converter, you'll need to modify your implementation slightly.
Given your existing XAML code for the `BaySizeTextBox` UserControl, you can follow these steps:
1. **Pass the Use... | 49,215 | [
{
"from": "human",
"value": "I am trying to implement a wpf user control that binds a text box to a list of doubles using a converter. How can i set the instance of user control to be the converter parameter?\nthe code for the control is shown below\nThanks \n<UserControl x:Class=\"BaySizeControl.BaySizeTe... |
I know there are couple 3rd party collection libraries out there (C5, PowerCollections and I guess loads more of other not so complete libraries) as well as the System.Collections.Generics classes. I am however quite unsure which library use to when. I have tried the C5 collections, but some sources claim that they are... | When it comes to choosing collection libraries in .NET, the choice largely depends on your specific use cases and performance requirements. Here's a breakdown of some popular third-party collection libraries, their use cases, and a few considerations that might help you decide:
### System.Collections.Generic
1. **Pro... | 44,848 | [
{
"from": "human",
"value": "I know there are couple 3rd party collection libraries out there (C5, PowerCollections and I guess loads more of other not so complete libraries) as well as the System.Collections.Generics classes. I am however quite unsure which library use to when. I have tried the C5 collecti... |
What is the best approach to calculating the largest prime factor of a number?
I'm thinking the most efficient would be the following:
Find lowest prime number that divides cleanly
Check if result of division is prime
If not, find next lowest
Go to 2.
I'm basing this assumption on it being easier to calculate the sma... | Your thought process is on the right track for calculating the largest prime factor of a number. Here’s a refined approach that builds on your ideas while addressing the concerns you've raised.
### Efficient Algorithm to Find the Largest Prime Factor
1. **Initialize Variables**:
- Start with the number \( n \) who... | 3,101 | [
{
"from": "human",
"value": "What is the best approach to calculating the largest prime factor of a number?\nI'm thinking the most efficient would be the following:\n\nFind lowest prime number that divides cleanly\nCheck if result of division is prime\nIf not, find next lowest\nGo to 2.\n\nI'm basing this a... |
I am trying to help a small business that has an application that could benefit from occasional (or temporary) database expertise. The problem is, this company has all their IP in this database, so they are rightfully hesitant to give someone access it.
They would typically meet and gain trust in person, but the tal... | Navigating the need for external database expertise while safeguarding sensitive intellectual property is a common concern for small businesses. Here are several strategies to consider when looking for trustworthy database administrators (DBAs) and safely involving them in your operations:
### 1. **Remote Work and Lim... | 48,279 | [
{
"from": "human",
"value": "I am trying to help a small business that has an application that could benefit from occasional (or temporary) database expertise. The problem is, this company has all their IP in this database, so they are rightfully hesitant to give someone access it. \nThey would typically ... |
I am using a AES cipher with a 16 byte block size.
If I try and encrypt a 16 byte string I have no problems, but any other length not a multiple of 16 is throwing an exception.
I know with 3-DES you can specify a padding type as part of the algorithm and it's handled with no extra work (e.g. DES/CBC/PKCS5Padding), bu... | When using AES (or any block cipher), the plaintext must indeed be a multiple of the block size, which is 16 bytes (128 bits) for AES. If the input data is not a multiple of the block size, you must apply padding before encryption and remove the padding after decryption.
In Java, you can specify padding schemes direct... | 49,048 | [
{
"from": "human",
"value": "I am using a AES cipher with a 16 byte block size. \nIf I try and encrypt a 16 byte string I have no problems, but any other length not a multiple of 16 is throwing an exception. \nI know with 3-DES you can specify a padding type as part of the algorithm and it's handled with no... |
How to enable and perform a "full text" search on a table in SQL Server 2005?
I did not quite understand the solution in: How do I use full text search across multiple tables, SQL Server 2005
| To enable and perform a full-text search in SQL Server 2005, you will need to follow these steps:
### Step 1: Enable Full-Text Search Feature
Before you can use full-text search, you need to ensure that the Full-Text Search feature is installed with your SQL Server instance. If you're using SQL Server 2005, it should... | 46,339 | [
{
"from": "human",
"value": "How to enable and perform a \"full text\" search on a table in SQL Server 2005? \nI did not quite understand the solution in: How do I use full text search across multiple tables, SQL Server 2005\n"
},
{
"from": "gpt",
"value": "To enable and perform a full-text sear... |
I haven't been able to find this explicitly stated anywhere yet, but a bunch of examples I've found online follow what I've been doing.
I have a C# class which uses ODP.net to connect to an Oracle DB and run a procedure that's in a package.
My package has stored procedures which take a ref cursor output parameter. A... | It's great that you're being proactive about managing resources when working with Oracle databases using ODP.NET. As you've noted, it's important to ensure that all resources, especially cursors, are properly managed to avoid running into issues like the "max number of open cursors" error.
The `OracleDataAdapter.Fill(... | 48,173 | [
{
"from": "human",
"value": "I haven't been able to find this explicitly stated anywhere yet, but a bunch of examples I've found online follow what I've been doing.\nI have a C# class which uses ODP.net to connect to an Oracle DB and run a procedure that's in a package. \nMy package has stored procedures w... |
I'm looking for a Python library for creating canvases for manipulating geometric shapes. Specifically I need the ability to create arbitrary polygons and place them on the canvas, the polygons need to have the ability to be transparent/have an alpha channel, I need to be able to edit polygons that are currently on the... | To achieve your requirements for creating a canvas for manipulating geometric shapes, you can consider using the following Python libraries:
### 1. Pygame
[Pygame](https://www.pygame.org/) is a well-known library for writing games and multimedia applications in Python. It supports drawing shapes, handling transparency... | 48,466 | [
{
"from": "human",
"value": "I'm looking for a Python library for creating canvases for manipulating geometric shapes. Specifically I need the ability to create arbitrary polygons and place them on the canvas, the polygons need to have the ability to be transparent/have an alpha channel, I need to be able t... |
I'm trying to host the CLR inside my C++ application and I'm having problems invoking the entry point of the managed application.
The entry point is defined as usual:
static void Main(string[] args)
And here's the actual C++ code:
CComPtr<_MethodInfo> entryPoint;
hr = assembly->get_EntryPoint(&entryPoint); // this wor... | The error you're experiencing, `COR_E_SAFEARRAYRANKMISMATCH`, indicates that there is a mismatch between the way the SafeArray is structured in your C++ code and how the .NET runtime is expecting to receive it. This often happens when the rank of the SafeArray or its elements doesn't match the expected structure.
In C... | 49,412 | [
{
"from": "human",
"value": "I'm trying to host the CLR inside my C++ application and I'm having problems invoking the entry point of the managed application.\nThe entry point is defined as usual:\nstatic void Main(string[] args)\n\nAnd here's the actual C++ code:\nCComPtr<_MethodInfo> entryPoint;\nhr = ass... |
What makes all the words of a programming language actually do anything? I mean, what's actually happening to make the computer know what all of those words mean? If I verbally tell my my computer to do something, it doesn't do it, because it doesn't understand. So how exactly can these human words written into a langu... | Great question! The key to understanding how programming languages work lies in several layers of abstraction and transformation from the high-level code you write to the actual machine code that a computer can execute.
### 1. **High-Level Language Syntax:**
Programming languages have specific syntax and semantics des... | 46,318 | [
{
"from": "human",
"value": "What makes all the words of a programming language actually do anything? I mean, what's actually happening to make the computer know what all of those words mean? If I verbally tell my my computer to do something, it doesn't do it, because it doesn't understand. So how exactly c... |
Is there a particular scenario where a WriteOnly property makes more sense then a method? The method approach feels much more natural to me.
What is the right approach?
Using Properties:
Public WriteOnly Property MyProperty As String
Set(ByVal value as String)
m_myField = value
End Set
End Property
public... | The choice between using a WriteOnly property and a method to set a value often comes down to the context and design principles of your application. Both approaches can be valid, but each has its own use cases. Here are some considerations that may make a WriteOnly property more suitable than a method:
### When to Use... | 49,613 | [
{
"from": "human",
"value": "Is there a particular scenario where a WriteOnly property makes more sense then a method? The method approach feels much more natural to me. \nWhat is the right approach?\nUsing Properties:\nPublic WriteOnly Property MyProperty As String\n Set(ByVal value as String)\n m_m... |
An answer and subsequent debate in the comments in another thread prompted me to ask:
In C# || and && are the short-circuited versions of the logical operators | and & respectively.
Example usage:
if (String.IsNullOrEmpty(text1) | String.IsNullOrEmpty(text2) | String.IsNullOrEmpty(text3))
{
//...
}
versus:
if (Str... | In C#, the usage of short-circuit operators (`||` and `&&`) versus their non-short-circuit counterparts (`|` and `&`) can greatly affect both code performance and readability. Let's break down the differences and implications for coding practice.
### Short-Circuit Operators (`||` and `&&`)
1. **Behavior**: The short-... | 49,396 | [
{
"from": "human",
"value": "An answer and subsequent debate in the comments in another thread prompted me to ask:\nIn C# || and && are the short-circuited versions of the logical operators | and & respectively.\nExample usage:\nif (String.IsNullOrEmpty(text1) | String.IsNullOrEmpty(text2) | String.IsNullOr... |
I'm trying to come up with a way to determine how "hot" certain threads are in a forum. What criteria would you use and why? How would these come together to give a hotness score?
The criteria I'm thinking of include:
how many replies
how long since the last reply
average time between replies
The problems this algori... | Creating a "hotness score" for forum threads involves considering multiple factors, as you rightly pointed out. Below, I’ll expand on your criteria, propose some additional ones, and suggest a formula to calculate a hotness score.
### Criteria to Consider:
1. **Number of Replies**:
- More replies generally indicat... | 47,611 | [
{
"from": "human",
"value": "I'm trying to come up with a way to determine how \"hot\" certain threads are in a forum. What criteria would you use and why? How would these come together to give a hotness score?\nThe criteria I'm thinking of include:\n\nhow many replies\nhow long since the last reply\naverag... |
Good morning,
I am working on a C# winform application that is using validation for the controls. The issue I'm having is that when a user clicks into a textbox and attempts to click out, the validation fires and re-focuses the control, basically the user cannot click out of the control to another control.
My desired r... | Good morning! It sounds like you're experiencing a common issue with validation in WinForms where validation fires during control focus changes, preventing users from navigating the form smoothly. To achieve the desired behavior of validating all controls only upon clicking the submit button and allowing users to navig... | 49,304 | [
{
"from": "human",
"value": "Good morning,\nI am working on a C# winform application that is using validation for the controls. The issue I'm having is that when a user clicks into a textbox and attempts to click out, the validation fires and re-focuses the control, basically the user cannot click out of th... |
I have 4 <select></select> elements in my form. Usually when submitting the form you would get this in the url, e.g.
index.html?day=01&month=01&year=1999&reporter=Joe+Blogs
However in my interface users are switching between the date picker and the person picker.
Is it possible to only send the values on the select th... | Yes, you can achieve this by dynamically disabling the `<select>` elements that are not active or currently in use when the form is submitted. This way, only the values from the active select elements will be included in the URL parameters when the form is submitted.
Here's a simple implementation using JavaScript to... | 43,494 | [
{
"from": "human",
"value": "I have 4 <select></select> elements in my form. Usually when submitting the form you would get this in the url, e.g.\nindex.html?day=01&month=01&year=1999&reporter=Joe+Blogs\n\nHowever in my interface users are switching between the date picker and the person picker.\nIs it poss... |
I'm trying to generate pairwise combinations of rows on based on their ids. SQLite version is 3.5.9. The table contents are the following:
id|name|val
1|A|20
2|B|21
3|C|22
with table schema being:
CREATE TABLE mytable (
id INTEGER NOT NULL,
name VARCHAR,
val INTEGER,
PRIMARY KEY (id)
);
Then ther... | What you're experiencing with your self-join in SQLite is related to how you're interpreting the results of your queries, rather than a bug in SQLite itself.
In your first query:
```sql
SELECT t1.id, t2.id
FROM mytable AS t1, mytable AS t2
WHERE t2.id > t1.id;
```
you are selecting pairs of `id`s where the `id` fro... | 49,727 | [
{
"from": "human",
"value": "I'm trying to generate pairwise combinations of rows on based on their ids. SQLite version is 3.5.9. The table contents are the following:\nid|name|val \n1|A|20\n2|B|21\n3|C|22\n\nwith table schema being:\nCREATE TABLE mytable (\n id INTEGER NOT NULL, \n name VARCHAR, \n ... |
I need to pull item quantity from a DB2 database from an aspx page and then update after the quantity has been changed. I want to create a web service that will send XML data and then parse back to my page. Looking for any good references or examples that anyone has possibly tried.
| Creating a web service to interact with a DB2 database from an ASP.NET web application involves several steps, including setting up the database connection, creating the web service to handle requests, and parsing XML data. Below are some references and a general outline to help you get started.
### Step 1: Set Up You... | 43,253 | [
{
"from": "human",
"value": "I need to pull item quantity from a DB2 database from an aspx page and then update after the quantity has been changed. I want to create a web service that will send XML data and then parse back to my page. Looking for any good references or examples that anyone has possibly t... |
How would one go about deleting all of the directories in a directory tree that have a certain name if the only access to the server available is via FTP?
To clarify, I would like to iterate over a directory tree and delete every directory whose name matches a certain string via FTP. A way to implement this in PHP wou... | If you only have access to a server via FTP and you want to delete directories with a specific name from a directory tree, you can accomplish this using PHP's FTP functions. Below is a step-by-step guide on how to create a PHP script to do this:
### Step-by-Step PHP Script for Deleting Directories via FTP
1. **Connec... | 44,428 | [
{
"from": "human",
"value": "How would one go about deleting all of the directories in a directory tree that have a certain name if the only access to the server available is via FTP?\nTo clarify, I would like to iterate over a directory tree and delete every directory whose name matches a certain string vi... |
Lets say we have something like:
<div class="row">
<div class="box">
<a class="more" href="#more"/>
</div>
<div class="hidden">
stuff
</div>
</div>
<div class="row">
<div class="box">
<a class="more" href="#more"/>
</div>
<div class="hidden">
... | I understand your question! You want to toggle the visibility of the `.hidden` class inside the same `.row` when the "more" link is clicked. Your current code attempts to select the wrong elements.
Here’s how you can accomplish this with jQuery:
1. When the user clicks on the "more" link, find the closest parent `.ro... | 44,984 | [
{
"from": "human",
"value": "Lets say we have something like:\n <div class=\"row\">\n <div class=\"box\">\n <a class=\"more\" href=\"#more\"/>\n </div>\n <div class=\"hidden\">\n stuff\n </div> \n </div>\n <div class=\"row\">\n <div class=\"box\">\n <a cla... |
I'm trying to retrieve data from an SQL Server 2000 server, and place into Excel. Which sounds simple I know.
I'm currently Copying, and Pasting into Excel, from Management Studio
The problem is one of the columns is an address, and it’s not retaining the newlines.
These new lines have to stay in the same cell in excel... | To keep the line breaks within the same cell in Excel when copying data from SQL Server Management Studio (SSMS), you can follow these steps:
1. **Using CHAR(13) and CHAR(10):**
In SQL Server, `CHAR(10)` represents a line feed (LF) and `CHAR(13)` represents a carriage return (CR). Together, they create a new line ... | 47,417 | [
{
"from": "human",
"value": "I'm trying to retrieve data from an SQL Server 2000 server, and place into Excel. Which sounds simple I know.\nI'm currently Copying, and Pasting into Excel, from Management Studio\nThe problem is one of the columns is an address, and it’s not retaining the newlines.\nThese new ... |
I have two vb.net class:
Public MustInherit Class Class1
Private m_sProperty1 As String = ""
Public Property sProperty1() As String
Get
Return m_sProperty1
End Get
Set(ByVal value As String)
m_sProperty1 = value
End Set
End Property
End Class
<ComClas... | When you expose a .NET class to COM, only public members that are visible to COM are available. In your case, you have defined `Class1` as a must-inherit class that contains a public property (`sProperty1`), and `Class2` inherits from `Class1`. However, there might be some issues with how the inherited properties are b... | 39,191 | [
{
"from": "human",
"value": "I have two vb.net class:\nPublic MustInherit Class Class1\n Private m_sProperty1 As String = \"\"\n Public Property sProperty1() As String\n Get\n Return m_sProperty1\n End Get\n Set(ByVal value As String)\n m_sProperty1 = value\n... |
Is there a widely accepted class for dealing with URLs in PHP?
Things like: getting/changing parts of an existing URL (e.g. path, scheme, etc), resolving relative paths from a base URL. Kind of like a two-way parse_url(), encapsulated with a bunch of handy functions.
Does something like this exist?
| Yes, there are several libraries in PHP that can help you work with URLs in a more structured and convenient way than using `parse_url()` and string manipulation. One of the most widely accepted and used libraries for this purpose is the **"Symfony URI"** component, which is part of the Symfony framework. Additionally,... | 49,933 | [
{
"from": "human",
"value": "Is there a widely accepted class for dealing with URLs in PHP?\nThings like: getting/changing parts of an existing URL (e.g. path, scheme, etc), resolving relative paths from a base URL. Kind of like a two-way parse_url(), encapsulated with a bunch of handy functions.\nDoes som... |
I've been spending some time looking at Phil Haack's article on Grouping Controllers very interesting stuff.
At the moment I'm trying to figure out if it would be possible to use the same ideas to create a plug-in/modular architecture for a project I'm working on.
So my question is: Is it possible to have the Areas in ... | Creating a modular or plug-in architecture for an ASP.NET application based on the ideas presented in Phil Haack's article on grouping controllers can certainly be done. Here's an outline of how you might achieve this, particularly focusing on the questions you've raised.
### 1. Splitting Areas Across Multiple Project... | 45,707 | [
{
"from": "human",
"value": "I've been spending some time looking at Phil Haack's article on Grouping Controllers very interesting stuff.\nAt the moment I'm trying to figure out if it would be possible to use the same ideas to create a plug-in/modular architecture for a project I'm working on.\nSo my questi... |
I am developing an Asp.net mvc application, everything works fine in ASP.net development server but when I am trying to host it on IIS 7. I am getting problem related to URL resolution. I have used relative paths in Javascript to give the image. The script file is in ~/Scripts/ folder and image files are in ~/Content/i... | The issue you are encountering with URL resolution in your ASP.NET MVC application when hosting it on IIS typically stems from the way relative paths are handled in your JavaScript code. When you provide a relative URL, the browser resolves it based on the current URL of the page.
### Solution: Use Absolute Paths or R... | 47,133 | [
{
"from": "human",
"value": "I am developing an Asp.net mvc application, everything works fine in ASP.net development server but when I am trying to host it on IIS 7. I am getting problem related to URL resolution. I have used relative paths in Javascript to give the image. The script file is in ~/Scripts/ ... |
I have an enumeration of delivery status codes. And when I save delivery data to the database they are stored with a foreign key to a table containing the same data (i.e. the same delivery codes)
What is the best strategy for keeping an enumeration in synch with data in a database?
Do you just remember to add to the e... | Maintaining synchronization between an enumeration in your code and the data stored in a database can be challenging, especially if the data in the database can change. Here are several strategies to help keep your enumeration in sync with your database delivery status codes:
### 1. Code Enumeration with Manual Update... | 49,203 | [
{
"from": "human",
"value": "I have an enumeration of delivery status codes. And when I save delivery data to the database they are stored with a foreign key to a table containing the same data (i.e. the same delivery codes)\nWhat is the best strategy for keeping an enumeration in synch with data in a data... |
C# 3.0 Extension methods add extensions to the base Type making calling that method on all instances of that Type legal.
Now, JavaScript I know implements IDispatchEx through which it's possible to add methods to a specific instance.
So how do I add a set of methods to an 'instance' of a C# class? I know this is a Dyn... | What you're trying to achieve in C#—adding methods or properties directly to instances of a class at runtime—is fundamentally different from how C# is designed, especially when compared to dynamic languages like JavaScript. C# is statically typed and compiled, which gives it certain advantages in terms of performance a... | 47,047 | [
{
"from": "human",
"value": "C# 3.0 Extension methods add extensions to the base Type making calling that method on all instances of that Type legal.\nNow, JavaScript I know implements IDispatchEx through which it's possible to add methods to a specific instance.\nSo how do I add a set of methods to an 'ins... |
Anybody ever had the error "Installation of the "Microsoft Expression Web 2" product has reported the following error: -2147024873.. " when trying to install Microsoft Expression Web 2 or Microsoft Expression Studio? This is the error I'm getting, but I can't figure out what the problem is. I have no beta or RC or pr... | The error you're encountering during the installation of Microsoft Expression Web 2 (or Expression Studio) appears to be related to a caching issue with the installation files. Specifically, the error code `0x80070017` indicates a "data error (cyclic redundancy check)", which suggests that the installation files may be... | 48,622 | [
{
"from": "human",
"value": "Anybody ever had the error \"Installation of the \"Microsoft Expression Web 2\" product has reported the following error: -2147024873.. \" when trying to install Microsoft Expression Web 2 or Microsoft Expression Studio? This is the error I'm getting, but I can't figure out wha... |
Our project is running on Windows CE 6.0 and is written in C++ . We have some problems with the code , and we are unable to debug . We also found out that if in our application we create threads and try to printf from them , the output won't appear . The only output that will appear is the one from the main thread . I ... | Yes, it's definitely possible to create a custom Windows message in your Windows CE application to display messages from other threads. Let’s break down the steps needed to accomplish this.
### 1. Define a Custom Windows Message
In your application's code, you'll need to define a custom message. This is usually done ... | 49,390 | [
{
"from": "human",
"value": "Our project is running on Windows CE 6.0 and is written in C++ . We have some problems with the code , and we are unable to debug . We also found out that if in our application we create threads and try to printf from them , the output won't appear . The only output that will ap... |
In Silverlight 2 I'm using a usercontrol which inherits the datacontext of the page that it's embedded on. This datacontext contains question text, a question type and a collection of answers. In the user control is a listbox which is bound to the collection of answers. As shown below:
<ListBox DataContext="{Binding}" ... | To access properties from the parent DataContext in your UserControl's ListBoxItem style, you can use the `RelativeSource` binding with a `FindAncestor` mode. This allows you to bind to the parent UserControl's DataContext (which holds the `QuestionType` property).
Here's how you can modify your `Visibility` bindings ... | 48,259 | [
{
"from": "human",
"value": "In Silverlight 2 I'm using a usercontrol which inherits the datacontext of the page that it's embedded on. This datacontext contains question text, a question type and a collection of answers. In the user control is a listbox which is bound to the collection of answers. As shown... |
I want a way to list files in a directory and putting a check box beside each one of them so I can select some of them and perform operations with each selected file, what's the best way to do this?
| To create a user interface for listing files in a directory with checkboxes for selection, you can use a variety of programming languages and frameworks. A common approach is to use Python with the `tkinter` library for a graphical user interface (GUI). Here’s a simple example to illustrate how you can achieve this:
#... | 43,058 | [
{
"from": "human",
"value": "I want a way to list files in a directory and putting a check box beside each one of them so I can select some of them and perform operations with each selected file, what's the best way to do this?\n"
},
{
"from": "gpt",
"value": "To create a user interface for list... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.