instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I have example of code below.
<script type="text/javascript" src="assets/scripts/somescript.php">.
</script>
So, will my browser still cache this just by not setting this scripts headers meta tag cache to must-revalidate?
| The behavior of your browser caching the script referenced in your `<script>` tag depends on several factors, including HTTP headers and how the server is configured to serve the script.
1. **Cache-Control Headers**: If the server responds with specific cache control headers (like `Cache-Control`, `Expires`, or `ETag`... | 39,112 | [
{
"from": "human",
"value": "I have example of code below. \n<script type=\"text/javascript\" src=\"assets/scripts/somescript.php\">. \n</script>\n\nSo, will my browser still cache this just by not setting this scripts headers meta tag cache to must-revalidate?\n"
},
{
"from": "gpt",
"value": "T... |
Is a tournament graph the same thing as a directed complete graph? And, do all vertices in a tournament graph have the same number of edges?
| Yes, a tournament graph is indeed a specific type of directed graph that is also referred to as a directed complete graph. In a tournament graph, every pair of vertices is connected by exactly one directed edge; that is, for any two distinct vertices \( u \) and \( v \), there is either a directed edge from \( u \) to ... | 38,573 | [
{
"from": "human",
"value": "Is a tournament graph the same thing as a directed complete graph? And, do all vertices in a tournament graph have the same number of edges?\n"
},
{
"from": "gpt",
"value": "Yes, a tournament graph is indeed a specific type of directed graph that is also referred to ... |
I have downloaded Samples for MS SQL Server 2005 and I don't know how to get an .exe file from files like ascmd.sln, ascmd.cs, ascmd.csproj. When I'm trying to launch an .sln file in Visual Studio there is an error like:
The application for project C:\project_path\project_name is not installed
Do I need a C# compiler... | To build an executable (`.exe`) file from the source files you have (like `ascmd.sln`, `ascmd.cs`, and `ascmd.csproj`), you need to follow these steps:
### Prerequisites
1. **Visual Studio**: Make sure you have the appropriate version of Visual Studio installed that supports C# development. Since the project is for S... | 34,679 | [
{
"from": "human",
"value": "I have downloaded Samples for MS SQL Server 2005 and I don't know how to get an .exe file from files like ascmd.sln, ascmd.cs, ascmd.csproj. When I'm trying to launch an .sln file in Visual Studio there is an error like:\n\nThe application for project C:\\project_path\\project_n... |
ArrayList filters = new ArrayList();
filters.Add(new string[] { "Name", "Equals", "John" });
ObjectDataSource1.SelectParameters.Add("AppliedFilters",
string.Join(",",(string[])filters.ToArray(typeof(string))));
Am trying to add a parameter to my object data source which is bound to my select method... | It sounds like you're trying to pass an array of strings as a parameter to an `ObjectDataSource`'s select method, but you've encountered a problem with how to handle the parameterization since the `SelectParameters.Add` method expects a string.
If your goal is to pass a `string[]` (or a similar collection) to the `Sel... | 35,355 | [
{
"from": "human",
"value": " ArrayList filters = new ArrayList();\n filters.Add(new string[] { \"Name\", \"Equals\", \"John\" });\n\n\n ObjectDataSource1.SelectParameters.Add(\"AppliedFilters\", \n string.Join(\",\",(string[])filters.ToArray(typeof(string))));\n\nAm trying to add a parameter t... |
Still struggling to understand what best practices are with respect to macros. I'm attempting to write a macro which defines packages on the fly.
(defmacro def-dynamic-package (name)
`(defpackage ,(intern (string-upcase name) "KEYWORD")
(:use :common-lisp)))
This works fine only for expressions such as:
(def-d... | Your `def-dynamic-package` macro is correctly defined, and it works as expected for literals. However, when you're trying to call this macro from within a function (`make-package-from-path`), you're encountering an issue because macros are expanded at compile time, while functions are executed at runtime.
When you try... | 36,834 | [
{
"from": "human",
"value": "Still struggling to understand what best practices are with respect to macros. I'm attempting to write a macro which defines packages on the fly.\n(defmacro def-dynamic-package (name)\n `(defpackage ,(intern (string-upcase name) \"KEYWORD\")\n (:use :common-lisp)))\n\nThis... |
what is the difference in using a standard
type
sl: TStringList
compared to using a generic TList
type
sl: TList<string>
?
As far as I can see, both behave exactly the same.
Is it just another way of doing the same thing?
Are there situations where one would be better than the other?
Thanks!
| The difference between using `TStringList` and `TList<string>` in Delphi (or similar Object Pascal environments) lies in their design, functionality, and specific use cases. Here’s a breakdown of the differences and when one might be more suitable than the other:
### TStringList
- **Specialized for Strings:** `TString... | 34,019 | [
{
"from": "human",
"value": "what is the difference in using a standard \ntype \n sl: TStringList \n\ncompared to using a generic TList\ntype \n sl: TList<string>\n\n?\nAs far as I can see, both behave exactly the same.\nIs it just another way of doing the same thing?\nAre there situations where one would... |
How am I to bubble the event caused when itemIndex is changed in a dropdownlist - so that I can use the itemindex-value in my ItemCreatedCommand-function?
A solution is found at:
http://209.85.129.132/search?q=cache:cYDzeE8Swf0J:authors.aspalliance.com/hmcheung/Articles/030331/Default.aspx+dropdownlist+datalist+selecte... | To bubble the event caused when the `SelectedIndex` changes in a `DropDownList` to use its value in your `ItemCreatedCommand` function in C#, you can follow these steps:
1. **Create an event handler for the `SelectedIndexChanged` event of the `DropDownList`.**
2. **In this event handler, store the selected value in a ... | 36,426 | [
{
"from": "human",
"value": "How am I to bubble the event caused when itemIndex is changed in a dropdownlist - so that I can use the itemindex-value in my ItemCreatedCommand-function?\nA solution is found at:\nhttp://209.85.129.132/search?q=cache:cYDzeE8Swf0J:authors.aspalliance.com/hmcheung/Articles/030331... |
I'm using git-svn to work against my company's central Subversion repository. We've recently created a new feature branch in the central repo.
How do I tell Git about it? When I run git branch -r I can only see the branches that existed when I ran fetch against the Subversion repo to initialize my Git repo?
| When using `git-svn`, the command you ran (`git branch -r`) only shows the branches that were fetched during the initial setup of your Git repository. To make Git aware of the new feature branch created in the central Subversion repository, you need to fetch the latest changes from the Subversion repository. Here’s how... | 37,908 | [
{
"from": "human",
"value": "I'm using git-svn to work against my company's central Subversion repository. We've recently created a new feature branch in the central repo. \nHow do I tell Git about it? When I run git branch -r I can only see the branches that existed when I ran fetch against the Subversion ... |
I do a lot of XSLT programming. I also do Java, PL/SQL, JavaScript, and a few others. I can easily find communities of Java and JavaScript programmers via the web. PL/SQL is a little more difficult, but between OTN and AskTom, I do pretty well. But XSLT seems to be neglected to me. Where do you go for XSLT? I kno... | You're correct that XSLT is not as widely discussed as some other programming languages, but there are still several valuable resources and communities where you can connect with other XSLT programmers and get support. Here are some suggestions:
1. **Stack Overflow**: Although you mentioned that the tags for XSLT are ... | 35,883 | [
{
"from": "human",
"value": "I do a lot of XSLT programming. I also do Java, PL/SQL, JavaScript, and a few others. I can easily find communities of Java and JavaScript programmers via the web. PL/SQL is a little more difficult, but between OTN and AskTom, I do pretty well. But XSLT seems to be neglected... |
In a comment on this answer to another question, someone said that they weren't sure what functools.wraps was doing. So, I'm asking this question so that there will be a record of it on StackOverflow for future reference: what does functools.wraps do, exactly?
| `functools.wraps` is a decorator in Python's `functools` module that is used to preserve the metadata of the original function when creating a wrapper function. When you create a decorator that wraps another function, the default behavior is that the wrapper function replaces the original function, which means that cer... | 35,784 | [
{
"from": "human",
"value": "In a comment on this answer to another question, someone said that they weren't sure what functools.wraps was doing. So, I'm asking this question so that there will be a record of it on StackOverflow for future reference: what does functools.wraps do, exactly?\n"
},
{
"f... |
I have a Windows forms project (VS 2005, .net 2.0). The solution has references to 9 projects. Everything works and compiles fine on one of my computers. When I move it to a second computer, 8 out of the 9 project compile with no problem. When I try to compile the 9th project (the main project for the application - pro... | The error you are encountering indicates that the project you are working on requires strong-naming for at least one of the referenced assemblies. In .NET, if a project or its dependencies are strongly named, the output assembly must also be strong-named. Here are some steps you can follow to diagnose and potentially f... | 35,236 | [
{
"from": "human",
"value": "I have a Windows forms project (VS 2005, .net 2.0). The solution has references to 9 projects. Everything works and compiles fine on one of my computers. When I move it to a second computer, 8 out of the 9 project compile with no problem. When I try to compile the 9th project (t... |
There are (at least) two ways that technical debts make their way into projects. The first is by conscious decision. Some problems just are not worth tackling up front, so they are consciously allowed to accumulate as technical debt. The second is by ignorance. The people working on the project don't know or don't real... | Yes, there are several common types of technical debts that teams often unknowingly introduce into their projects, which can become significantly more costly to address later on. Here are a few examples:
1. **Hard-Coded Values**: Developers sometimes hard-code values (like URLs, API keys, or configuration settings) wi... | 36,423 | [
{
"from": "human",
"value": "There are (at least) two ways that technical debts make their way into projects. The first is by conscious decision. Some problems just are not worth tackling up front, so they are consciously allowed to accumulate as technical debt. The second is by ignorance. The people workin... |
Is there any GUI-based tools to assist you with writing and maintaining the configuration file? Any code tools to codegen the config file? What are the best ways to make this a little bit easier? Are most people just using Castle ActiveRecord now?
| When it comes to managing configuration files, especially in the context of web applications or databases, there are several tools and methods that can help make the process easier, including GUI-based tools and code generation tools. Here are some options you might consider:
### GUI-based Tools
1. **Visual Studio**: ... | 36,429 | [
{
"from": "human",
"value": "Is there any GUI-based tools to assist you with writing and maintaining the configuration file? Any code tools to codegen the config file? What are the best ways to make this a little bit easier? Are most people just using Castle ActiveRecord now?\n"
},
{
"from": "gpt",
... |
I want to use the same functionality available when a Panel.AutoScroll is true, but with the scrollbars invisible.
To do so I need to know how can I scroll to left/right up/down using functions in my code.
| To enable scrolling in a panel with `AutoScroll` set to `true`, while keeping the scrollbars hidden, you can programmatically scroll the panel's content by modifying its `AutoScrollPosition` property. This allows you to move the visible area of the panel without displaying the scrollbars.
Here's how you can achieve th... | 32,918 | [
{
"from": "human",
"value": "I want to use the same functionality available when a Panel.AutoScroll is true, but with the scrollbars invisible.\nTo do so I need to know how can I scroll to left/right up/down using functions in my code.\n"
},
{
"from": "gpt",
"value": "To enable scrolling in a pa... |
Okay, I guess this is entirely subjective and whatnot, but I was thinking about entropy sources for random number generators. It goes that most generators are seeded with the current time, correct? Well, I was curious as to what other sources could be used to generate perfectly valid, random (The loose definition) numb... | You're absolutely right that entropy sources for random number generators (RNGs) are a fascinating topic! Here’s a breakdown of the concepts you raised:
### 1. Seed Sources for RNGs:
Many random number generators are seeded with the current time because it's easy to obtain and provides a reasonably varied starting poi... | 36,058 | [
{
"from": "human",
"value": "Okay, I guess this is entirely subjective and whatnot, but I was thinking about entropy sources for random number generators. It goes that most generators are seeded with the current time, correct? Well, I was curious as to what other sources could be used to generate perfectly ... |
I know several ways of writing paged query in SQL Server 2005. But I have no idea about their performance. Which one is the best and most optimized way for writing paging SQL queries?
Using Row_Number()
Using Partition by
Using Temporary tables
Using Nest Top N with Order by
Some other way?
| In SQL Server 2005, paging through large datasets efficiently can be a challenge. The various methods you mentioned have different performance implications based on how they work. Let's look at each approach:
### 1. **Using `ROW_NUMBER()`**
This is the most common and generally recommended method for paging in SQL Ser... | 32,424 | [
{
"from": "human",
"value": "I know several ways of writing paged query in SQL Server 2005. But I have no idea about their performance. Which one is the best and most optimized way for writing paging SQL queries?\n\nUsing Row_Number()\nUsing Partition by\nUsing Temporary tables\nUsing Nest Top N with Order ... |
I have some XSD-s that define my objects hierarchy. for example math.xsd, base.xsd
while math.xsd is depends on base.xsd. I need to generate classes from those xsd-s.
I've already read about those two tools:
CodeXS tool and XSD.exe.
the problem with the xsd.exe is that I didn't succeed generating classes from two xsd... | To generate classes from XSD files that have dependencies on one another (like your `math.xsd` depending on `base.xsd`), the `xsd.exe` tool can handle that, but you need to execute the commands in a specific way. Below are steps and parameters for `xsd.exe`, some additional tools, and a comparison among them.
### Usin... | 35,548 | [
{
"from": "human",
"value": "I have some XSD-s that define my objects hierarchy. for example math.xsd, base.xsd\nwhile math.xsd is depends on base.xsd. I need to generate classes from those xsd-s.\nI've already read about those two tools:\nCodeXS tool and XSD.exe.\nthe problem with the xsd.exe is that I d... |
I have a big load of documents, text-files, that I want to search for relevant content. I've seen a searching tool, can't remeber where, that implemented a nice method as I describe in my requirement below.
My requirement is as follows:
I need an optimised search function: I supply this search function with a list (on... | Your approach to implementing an optimized search function using a relational database is a sound one, especially considering the need for performance and the requirement to return relevant documents based on user input in real-time. Here are some suggestions and considerations for enhancing your approach:
### Databas... | 15,300 | [
{
"from": "human",
"value": "I have a big load of documents, text-files, that I want to search for relevant content. I've seen a searching tool, can't remeber where, that implemented a nice method as I describe in my requirement below.\nMy requirement is as follows:\n\nI need an optimised search function: I... |
I can use an bitmap in a menu
CMenu men;
CBitmap b;
b.LoadBitmap(IDB_0);
men.AppendMenu( MF_ENABLED,1,&b);
I can draw an icon into a DC
CImageList IL;
IL.Create(70, 14, ILC_COLOR16 | ILC_MASK, 1, 0);
IL.Add(AfxGetApp()->LoadIcon(IDI_0));
IL.Draw ( pDC, 0, rcIcon.TopLeft(), ILD_BLEND50 );
But I cannot find... | Displaying an icon in a menu in MFC is not directly supported with the same approach as bitmaps. Instead, you can use an `ImageList` along with a menu to achieve that effect. Here's how you can do it:
1. **Create an `ImageList` that contains your icon.**
2. **Attach this `ImageList` to your menu.**
3. **Draw the icon ... | 34,315 | [
{
"from": "human",
"value": "I can use an bitmap in a menu\nCMenu men;\nCBitmap b;\nb.LoadBitmap(IDB_0); \nmen.AppendMenu( MF_ENABLED,1,&b);\n\nI can draw an icon into a DC\n CImageList IL;\n IL.Create(70, 14, ILC_COLOR16 | ILC_MASK, 1, 0);\n IL.Add(AfxGetApp()->LoadIcon(IDI_0));\n IL.Draw ( pDC, 0, r... |
EDIT: This question duplicates How to access the current Subversion build number? (Thanks for the heads up, Charles!)
Hi there,
This question is similar to Getting the subversion repository number into code
The differences being:
I would like to add the revision number to Python
I want the revision of the repository... | To retrieve the Subversion (SVN) repository revision number using Python, you can indeed use the `subprocess` module to call the `svn info` command and then extract the revision number from its output. While it might seem "brutal" to use regex, this method is quite common for parsing command line output when a dedicate... | 33,114 | [
{
"from": "human",
"value": "\nEDIT: This question duplicates How to access the current Subversion build number? (Thanks for the heads up, Charles!)\n\nHi there,\nThis question is similar to Getting the subversion repository number into code\nThe differences being:\n\nI would like to add the revision number... |
We are working on a legacy system (7 years old), with lots of java/jsp files that have never been formatted before, not reader at all. Because we have many old versions, we are afraid that we won't be able to effectively diff unformatted and formatted files anymore if we format them.
Are there any command line format t... | Yes, there are several command-line tools available that you can use to format Java and JSP files. These tools can help you format your legacy code consistently, making it easier to read and work with. Here are some popular ones:
### 1. **Google Java Format**
- **Description:** A program that reformats Java source cod... | 33,241 | [
{
"from": "human",
"value": "We are working on a legacy system (7 years old), with lots of java/jsp files that have never been formatted before, not reader at all. Because we have many old versions, we are afraid that we won't be able to effectively diff unformatted and formatted files anymore if we format ... |
The var keyword does away with the need for an explicit type declaration and I have read with interest the SO discussion of when it might be appropriate.
I have also read about (but not used) Boo which seems to take things a step further by making it optional to declare a local variable. With Boo, both the type and th... | The inclusion of the `var` keyword in C# serves several purposes that go beyond merely supporting anonymous types, even though that is one of its significant features. Here are a few reasons why the `var` keyword was included and its usefulness:
1. **Type Inference**: The primary purpose of `var` is to allow the compi... | 36,883 | [
{
"from": "human",
"value": "The var keyword does away with the need for an explicit type declaration and I have read with interest the SO discussion of when it might be appropriate.\nI have also read about (but not used) Boo which seems to take things a step further by making it optional to declare a local... |
We have a dedicated godaddy server and it seemed to grind to a halt when we had users downloading only 3MB every 2 seconds (this was over about 20 http requests).
I want to look into database locking etc. to see if that is a problem - but first I'm curious as to what a dedicated server ought to be able to serve.
| The performance of a dedicated server can depend on various factors, including hardware specifications (CPU, RAM, disk type), server configuration, software (web server and database), the nature of the applications running, and the way traffic is handled. Here are some considerations to assess whether your dedicated se... | 32,869 | [
{
"from": "human",
"value": "We have a dedicated godaddy server and it seemed to grind to a halt when we had users downloading only 3MB every 2 seconds (this was over about 20 http requests).\nI want to look into database locking etc. to see if that is a problem - but first I'm curious as to what a dedicate... |
pdb and winpdb both seem to be missing this essential (to me) feature. I saw something suggesting WingIDE has it but I'd prefer a solution that is free, and if I do have to pay, I'd prefer to pay for something that is better than Wing.
| It sounds like you're looking for a Python debugger with specific features that are not offered by pdb or winpdb. While WingIDE does have many advanced features, there are also several free or open-source alternatives that you might find useful. Here are a few suggestions:
1. **PyCharm Community Edition**: PyCharm's f... | 37,233 | [
{
"from": "human",
"value": "pdb and winpdb both seem to be missing this essential (to me) feature. I saw something suggesting WingIDE has it but I'd prefer a solution that is free, and if I do have to pay, I'd prefer to pay for something that is better than Wing.\n"
},
{
"from": "gpt",
"value"... |
Given two computers attached to the Internet that know nothing about each other before hand, is it possible for one computer to be able to broadcast a message so that the second computer could receive it and respond?
I know UDP broadcast exsits, but I believe that those are generally filtered by the ISP before it reach... | Yes, you are correct that typical UDP broadcasts are generally limited to local networks and are not routed over the broader Internet. This is primarily because routers and ISPs typically filter out broadcast traffic to prevent it from overwhelming networks.
In a typical Internet scenario, two computers that do not ha... | 37,686 | [
{
"from": "human",
"value": "Given two computers attached to the Internet that know nothing about each other before hand, is it possible for one computer to be able to broadcast a message so that the second computer could receive it and respond?\nI know UDP broadcast exsits, but I believe that those are gen... |
Is there a HTMLHelper for file upload? Specifically, I am looking for a replace of
<input type="file"/>
using ASP.NET MVC HTMLHelper.
Or, If I use
using (Html.BeginForm())
What is the HTML control for the file upload?
| In ASP.NET MVC, you can create a file upload control using the `HtmlHelper` extension methods. There is no built-in HTML helper specifically for file uploads like there is for text inputs, but you can create your own custom HTML helper or use the standard `Html.TextBoxFor` method with the right attributes.
Here's how ... | 35,796 | [
{
"from": "human",
"value": "Is there a HTMLHelper for file upload? Specifically, I am looking for a replace of\n<input type=\"file\"/>\n\nusing ASP.NET MVC HTMLHelper. \nOr, If I use \nusing (Html.BeginForm()) \n\nWhat is the HTML control for the file upload? \n"
},
{
"from": "gpt",
"value": "I... |
Is there anything that has features of TFS(Like Source Control, Debug, Testing,...) that we can use in a workgroup with a small team(say 1-6 persons)?
BTW: we are using VS 2008 Team Suit
| If you're looking for alternatives to Team Foundation Server (TFS) that provide similar features and can be used effectively in a small workgroup (1-6 persons), there are several options you might consider. Some of these tools focus on source control, debugging, and testing, providing a more streamlined experience for ... | 32,838 | [
{
"from": "human",
"value": "Is there anything that has features of TFS(Like Source Control, Debug, Testing,...) that we can use in a workgroup with a small team(say 1-6 persons)?\nBTW: we are using VS 2008 Team Suit\n"
},
{
"from": "gpt",
"value": "If you're looking for alternatives to Team Fou... |
Hi does anybody know how to initialize two list at the same time with ajax?
This is my code
<html>
<body onload="iniciaListas()">
<script type="text/javascript">
var xmlHttp
function iniciaListas()
{
muestraListaPaises();
muestraListaProfesiones();
}
function muestraListaProfesiones()
{
//Se inicia... | You can initialize both lists simultaneously using AJAX by utilizing `Promise.all()`. This approach allows you to wait for both AJAX requests to complete before proceeding. Here's how you can modify your existing JavaScript code to implement this:
1. **Create a function that returns a Promise for each AJAX call.**
2. ... | 28,314 | [
{
"from": "human",
"value": "Hi does anybody know how to initialize two list at the same time with ajax?\nThis is my code\n<html>\n<body onload=\"iniciaListas()\">\n\n<script type=\"text/javascript\">\nvar xmlHttp\nfunction iniciaListas()\n{\n muestraListaPaises();\n muestraListaProfesiones();... |
I have in my Form constructor, after the InitializeComponent the following code:
using (WebClient client = new WebClient())
{
client.DownloadDataCompleted += new DownloadDataCompletedEventHandler(client_DownloadDataCompleted);
client.DownloadDataAsync("http://example.com/version.txt");
}
When I start my form, ... | The issue you are experiencing is due to the fact that the `WebClient.DownloadDataAsync` method is actually a non-blocking call. However, if you are calling it before `InitializeComponent()` has been executed, it can lead to an issue where your UI may seem unresponsive until the download completes.
To ensure that the ... | 34,981 | [
{
"from": "human",
"value": "I have in my Form constructor, after the InitializeComponent the following code:\nusing (WebClient client = new WebClient())\n{\n client.DownloadDataCompleted += new DownloadDataCompletedEventHandler(client_DownloadDataCompleted);\n client.DownloadDataAsync(\"http://exampl... |
Is there any function like php's mb_convert_encoding which can convert an encoding to another?
I want to convert the utf-8 text, passed in a input field inside the flash, to iso-8859-7 encoding.
| In ActionScript (the programming language used in Flash), there isn't a direct equivalent to PHP's `mb_convert_encoding` function. However, you can perform character encoding conversions by using the `String` class and `ByteArray` class in ActionScript.
To convert UTF-8 encoded text to ISO-8859-7 (Greek), you can foll... | 35,386 | [
{
"from": "human",
"value": "Is there any function like php's mb_convert_encoding which can convert an encoding to another? \nI want to convert the utf-8 text, passed in a input field inside the flash, to iso-8859-7 encoding.\n"
},
{
"from": "gpt",
"value": "In ActionScript (the programming lang... |
In Delphi if I type "if" and space it automatically inserts the code snippet with an if statement block defined. I know in Visual Studio I can insert a snippet, but I have to either right-click and select "insert snippet", or hit CTRL-K followed by CTRL-X.
Is there a way to configure Visual Studio to automatically ins... | Yes, you can configure Visual Studio to automatically insert snippets similar to how Delphi does when you type certain keywords (like "if") and then press space. This feature is not built-in by default, but you can achieve a similar effect using **Code Snippet Shortcuts** or creating your own custom behavior. Here's ho... | 37,140 | [
{
"from": "human",
"value": "In Delphi if I type \"if\" and space it automatically inserts the code snippet with an if statement block defined. I know in Visual Studio I can insert a snippet, but I have to either right-click and select \"insert snippet\", or hit CTRL-K followed by CTRL-X. \nIs there a way t... |
I've got a lot of pages in my site, I'm trying to think of a nice way to separate these into areas that are a little more isolated than just simple directories under my base web project. Is there a way to put my web forms into a separate class library? If so, how is it done?
Thanks in advance.
| Yes, you can absolutely separate your web forms into a class library in order to better organize your project. This approach can help you manage your code more effectively, promote reusability, and improve maintainability. Below are steps to create and use a class library for your web forms in ASP.NET.
### Steps to Cr... | 34,613 | [
{
"from": "human",
"value": "I've got a lot of pages in my site, I'm trying to think of a nice way to separate these into areas that are a little more isolated than just simple directories under my base web project. Is there a way to put my web forms into a separate class library? If so, how is it done?\n... |
When using gdb and Vim, often I want to stop on a particular line. Normally in Vim I copy-paste the line number showing on the rule area to the gdb session. It'd save me a lot of hassle if I could use something like "+<magic-incantation> to copy the line number of the current cursor position into the xclipboard buffer.... | Yes, it is possible to create a custom command in Vim that allows you to copy the line number of the current cursor position to the clipboard. You can achieve this by using Vim's ability to execute external commands and manipulate the clipboard.
Here's a step-by-step guide to set it up:
1. **Install the Required Vim ... | 37,165 | [
{
"from": "human",
"value": "When using gdb and Vim, often I want to stop on a particular line. Normally in Vim I copy-paste the line number showing on the rule area to the gdb session. It'd save me a lot of hassle if I could use something like \"+<magic-incantation> to copy the line number of the current c... |
I have a winforms application, that why someone clicks on a button I need to open up IE to a specific URL.
When someone closes the winforms app, I then need to close IE.
Is this possible? If yes, how?
| Yes, it is possible to open Internet Explorer (IE) to a specific URL when a button is clicked in a WinForms application and to close it when the application is closed. You can accomplish this using the `Process` class from the `System.Diagnostics` namespace to start and close the Internet Explorer process.
Here’s a si... | 24,097 | [
{
"from": "human",
"value": "I have a winforms application, that why someone clicks on a button I need to open up IE to a specific URL.\nWhen someone closes the winforms app, I then need to close IE.\nIs this possible? If yes, how?\n"
},
{
"from": "gpt",
"value": "Yes, it is possible to open Int... |
Does anybody know how I can run a gant build which ignores build errors? Something like ant and make are doing with the '-k' or '-keep-going' switch.
Thx
| In Gradle, the build tool you are referring to with "gant" seems to be a typo, as Gant is not a widely known build tool. If you are asking about Gradle, there isn't a direct equivalent to the `-k` or `--keep-going` switches found in Ant or Make. However, Gradle has a similar feature that can be emulated.
To run a Grad... | 38,402 | [
{
"from": "human",
"value": "Does anybody know how I can run a gant build which ignores build errors? Something like ant and make are doing with the '-k' or '-keep-going' switch.\nThx\n"
},
{
"from": "gpt",
"value": "In Gradle, the build tool you are referring to with \"gant\" seems to be a typo... |
<?php
class Box {
var $contents;
function Box($contents) {
$this->contents = $contents;
}
function get_whats_inside() {
return $this->contents;
}
}
?>
I am going through a OO tutorial. I am familiar with PHP and the concept of OO but it is still an uphill struggle most of th... | The issue you're encountering is related to the use of HTML entities in your PHP code. Specifically, the `>` entity is an HTML representation for the greater-than symbol (`>`), which should not be used in PHP code. In PHP, you should use the actual `>` character.
Here is the corrected version of your class:
```php... | 36,481 | [
{
"from": "human",
"value": "<?php\nclass Box {\n var $contents;\n\n function Box($contents) {\n $this->contents = $contents;\n }\n\n function get_whats_inside() {\n return $this->contents;\n }\n}\n?>\n\nI am going through a OO tutorial. I am familiar with PHP and the conc... |
I want to deal with the command line input in Ruby:
> cat input.txt | myprog.rb
> myprog.rb < input.txt
> myprog.rb arg1 arg2 arg3 ...
What is the best way to do it? In particular I want to deal with blank STDIN, and I hope for an elegant solution.
#!/usr/bin/env ruby
STDIN.read.split("\n").each do |a|
puts a
end
... | To elegantly handle command line input in Ruby, including standard input (STDIN) and command-line arguments (ARGV), you can modify your script to check for blank STDIN and process the inputs accordingly. Below is an improved version of your script that handles these cases:
```ruby
#!/usr/bin/env ruby
# Read input fro... | 38,169 | [
{
"from": "human",
"value": "I want to deal with the command line input in Ruby:\n> cat input.txt | myprog.rb\n> myprog.rb < input.txt\n> myprog.rb arg1 arg2 arg3 ...\n\nWhat is the best way to do it? In particular I want to deal with blank STDIN, and I hope for an elegant solution.\n#!/usr/bin/env ruby\n\n... |
I'm looking to implement something in Java along the lines of:
class Foo{
private int lorem; //
private int ipsum;
public setAttribute(String attr, int val){
//sets attribute based on name
}
public static void main(String [] args){
Foo f = new Foo();
f.setAttribute("lorem",1);
f.setAttribute("ipsum... | In Java, you cannot directly set a class attribute by its name without using reflection or some form of data structure. However, since you requested not to use any data structures, the closest approach would be to use Java Reflection, which allows you to inspect and manipulate classes at runtime.
Here's how you can im... | 37,049 | [
{
"from": "human",
"value": "I'm looking to implement something in Java along the lines of:\nclass Foo{\n private int lorem; //\n private int ipsum; \n\n public setAttribute(String attr, int val){\n //sets attribute based on name\n }\n\n public static void main(String [] args){\n Foo f = new Foo();\n... |
I have a simple web page that till now didn't need any login. It is programed with Perl CGIs.
I would like to know the steps to add session support in order to have the login information available.
I don't want very complicated methods, because the web page is very simple.
Also I want some recommendations for the techn... | Adding session support to your Perl CGI application can be accomplished relatively simply, and there are several libraries available to help you with this. Below are the general steps you can follow to implement session support, as well as recommendations for the technologies and libraries you can use.
### Step 1: Cho... | 35,315 | [
{
"from": "human",
"value": "I have a simple web page that till now didn't need any login. It is programed with Perl CGIs.\nI would like to know the steps to add session support in order to have the login information available.\nI don't want very complicated methods, because the web page is very simple.\nAl... |
I have configured a simple LAMP stack on Debian and I am experiencing some problems with the Apache web server.
Each 3-4 hours the web server is entering a deadlock and all the requests that hit the database block. The server is creating a new child for each request. The number of processes increases very quickly. Aft... | It sounds like you've already identified a significant part of the issue with your LAMP stack by switching from APC for user data caching to Memcache. Using APC (Alternative PHP Cache) for both opcode caching and user data can indeed lead to problems, especially under heavy load, as it isn't optimized for managing user... | 35,867 | [
{
"from": "human",
"value": "I have configured a simple LAMP stack on Debian and I am experiencing some problems with the Apache web server. \nEach 3-4 hours the web server is entering a deadlock and all the requests that hit the database block. The server is creating a new child for each request. The numbe... |
When setting the export path in Unix, example:
export PATH=$PATH: $EC2_HOME/bin
If I quit terminal and open it back up to continue working, I have to go through all the steps again, setting up the paths each time.
I'm wondering how I can set the path and have it "stick" so my system knows where to find everything the ... | To make your PATH changes persist across terminal sessions in Unix (or Linux), you need to add the `export PATH` command to your shell's configuration file. The specific file you should edit depends on the shell you are using (for example, `bash`, `zsh`, etc.) and its version. Here's how you can do it for the most comm... | 36,394 | [
{
"from": "human",
"value": "When setting the export path in Unix, example:\nexport PATH=$PATH: $EC2_HOME/bin\n\nIf I quit terminal and open it back up to continue working, I have to go through all the steps again, setting up the paths each time.\nI'm wondering how I can set the path and have it \"stick\" s... |
I'm using MS SQL Server 2005. Is there a difference, to the SQL engine, between
SELECT * FROM MyTable;
and
SELECT ColA, ColB, ColC FROM MyTable;
When ColA, ColB, and ColC represent every column in the table?
If they are the same, is there a reason why you should use the 2nd one anyway? I have a project that's heavy ... | Yes, there is a difference between `SELECT * FROM MyTable;` and `SELECT ColA, ColB, ColC FROM MyTable;` even when `ColA`, `ColB`, and `ColC` represent every column in the table. Here are some of the key differences and considerations:
### 1. **Performance**
- **SELECT *:** This query retrieves all columns from the tab... | 34,151 | [
{
"from": "human",
"value": "I'm using MS SQL Server 2005. Is there a difference, to the SQL engine, between\nSELECT * FROM MyTable;\n\nand\nSELECT ColA, ColB, ColC FROM MyTable;\n\nWhen ColA, ColB, and ColC represent every column in the table?\nIf they are the same, is there a reason why you should use th... |
Does anyone have any idea why the following code sample fails with an XmlException "Data at the root level is invalid. Line 1, position 1."
var body = "<?xml version="1.0" encoding="utf-16"?><Report> ......"
XmlDocument bodyDoc = new XmlDocument();
bodyDoc.LoadXml(body);
| The error you are encountering, "Data at the root level is invalid. Line 1, position 1," is likely due to how you've constructed the XML string. Specifically, you are using double quotes (`"`) for both the outer string and the XML declaration, which results in an incorrect string format.
Here's the problematic line of... | 37,164 | [
{
"from": "human",
"value": "Does anyone have any idea why the following code sample fails with an XmlException \"Data at the root level is invalid. Line 1, position 1.\"\nvar body = \"<?xml version=\"1.0\" encoding=\"utf-16\"?><Report> ......\"\nXmlDocument bodyDoc = new XmlDocument(); \nbodyDoc... |
We have an application that installs SQL Server Express from the command line and specifies the service account as the LocalSystem account via the parameter SQLACCOUNT="NT AUTHORITY\SYSTEM".
This doesn't work with different languages because the account name for LocalSystem is different. There's a table listing the dif... | Yes, you can achieve this in C# using the `System.Management` namespace, which provides access to a wide range of Windows Management Instrumentation (WMI) classes.
Here’s how you can get the account name for the LocalSystem account using its SID (`S-1-5-18`) in C#:
```csharp
using System;
using System.Management;
cl... | 33,624 | [
{
"from": "human",
"value": "We have an application that installs SQL Server Express from the command line and specifies the service account as the LocalSystem account via the parameter SQLACCOUNT=\"NT AUTHORITY\\SYSTEM\".\nThis doesn't work with different languages because the account name for LocalSystem ... |
Does that mean that I can't share a Form between delphi 2007 and 2009?
| Sharing a form between Delphi 2007 and Delphi 2009 can be problematic due to changes in the VCL (Visual Component Library) and the underlying framework, especially regarding the Unicode support introduced in Delphi 2009. Here are a few key points to consider:
1. **Unicode Support**: Delphi 2009 introduced Unicode stri... | 36,704 | [
{
"from": "human",
"value": "Does that mean that I can't share a Form between delphi 2007 and 2009?\n"
},
{
"from": "gpt",
"value": "Sharing a form between Delphi 2007 and Delphi 2009 can be problematic due to changes in the VCL (Visual Component Library) and the underlying framework, especially... |
Background
A project installs some files that contain all the elements to define a UserControl - some user source, a CodeCompileUnit for designer code, and a resx file. At runtime, these files are compiled into an assembly and the classes are consumed by our main application (the assembly is only updated when necessary... | There are indeed a few options you can consider for localizing your UserControl project, and each option comes with its own set of advantages and disadvantages. Below are some alternatives to the solutions you've proposed, along with the potential issues associated with each option:
### Alternative Solutions
1. **Usi... | 35,626 | [
{
"from": "human",
"value": "Background\nA project installs some files that contain all the elements to define a UserControl - some user source, a CodeCompileUnit for designer code, and a resx file. At runtime, these files are compiled into an assembly and the classes are consumed by our main application (t... |
I am sending data across a link with very little bandwidth and I will probably be sending large data files.
I have Merge Replication and Snapshot replication configured at present.
Is it possible to enable compression in SQL Server 2005 replication and if so, how?
Thanks.
| In SQL Server 2005, there is no built-in feature to enable data compression specifically for replication processes such as Merge Replication or Snapshot Replication. However, you can consider a couple of workarounds to potentially reduce the amount of data being sent over the network.
### Workarounds for Compression i... | 27,656 | [
{
"from": "human",
"value": "I am sending data across a link with very little bandwidth and I will probably be sending large data files. \nI have Merge Replication and Snapshot replication configured at present. \nIs it possible to enable compression in SQL Server 2005 replication and if so, how?\nThanks.\n... |
I'm sorry I could not think of a better title.
The problem is the following:
For our customer we have created (as part of a larger application) a
graphical designer which they can use to build "scenario's".
These scenario's consist of "Composites" which in turn consist
of "Commands". These command objects all derive fr... | Creating a simple programming language or scripting capability for your graphical designer can enhance usability significantly, especially if you allow users to express scenarios in a way that feels more natural to them. Here are a few suggestions for how to approach this problem:
### 1. **Scripting Language Embedding... | 31,921 | [
{
"from": "human",
"value": "I'm sorry I could not think of a better title.\nThe problem is the following:\nFor our customer we have created (as part of a larger application) a\ngraphical designer which they can use to build \"scenario's\".\nThese scenario's consist of \"Composites\" which in turn consist\n... |
If you want to associate some constant value with a class, here are two ways to accomplish the same goal:
class Foo
{
public:
static const size_t Life = 42;
};
class Bar
{
public:
enum {Life = 42};
};
Syntactically and semantically they appear to be identical from the client's point of view:
size_t fooLife = ... | Both `Foo::Life` and `Bar::Life` achieve the same goal of providing a constant value associated with a class, but there are some key differences in how they are defined and used in C++. Here are a few considerations:
### 1. **Type Safety and Type Checking**
- `Foo::Life` is explicitly defined as a `static const size_t... | 33,894 | [
{
"from": "human",
"value": "If you want to associate some constant value with a class, here are two ways to accomplish the same goal:\nclass Foo\n{\npublic:\n static const size_t Life = 42;\n};\n\nclass Bar\n{\npublic:\n enum {Life = 42};\n};\n\nSyntactically and semantically they appear to be identi... |
I have a project right now where I'd like to be able to pull rows out of an Access database that a 3rd party product uses to store its information. There will likely be a small number of users hitting this database at the same time my "export" process does, so I'm a little concerned about data integrity and concurrent... | Microsoft Access uses a file-based database system, which means it handles concurrency and locking differently than server-based databases. Here are some key points regarding Access's handling of concurrent access and locking, especially in the context of your .NET import process:
### 1. **Locking Mechanism in Access:... | 23,327 | [
{
"from": "human",
"value": "I have a project right now where I'd like to be able to pull rows out of an Access database that a 3rd party product uses to store its information. There will likely be a small number of users hitting this database at the same time my \"export\" process does, so I'm a little co... |
I'm writing a stored procedure that needs to have a lot of conditioning in it. With the general knowledge from C#.NET coding that exceptions can hurt performance, I've always avoided using them in PL/SQL as well. My conditioning in this stored proc mostly revolves around whether or not a record exists, which I could ... | When considering how to check for the existence of a record in PL/SQL, you have correctly identified two common approaches: using `COUNT(*)` or handling exceptions. Each approach has its pros and cons.
### Approach 1: Using `COUNT(*)`
This method gives you the ability to explicitly check the number of records that me... | 30,877 | [
{
"from": "human",
"value": "I'm writing a stored procedure that needs to have a lot of conditioning in it. With the general knowledge from C#.NET coding that exceptions can hurt performance, I've always avoided using them in PL/SQL as well. My conditioning in this stored proc mostly revolves around wheth... |
I am trying to get the signature on the method below to work. As this is an Anonymous Type I have some trouble, any help would be great.
When I looked at sortedGameList.ToList() in a QuickWatch window I get the signature
System.Collections.Generic.List<<>f__AnonymousType0<System.DateTime,System.Linq.IGrouping<System.D... | The issue you're encountering arises from the fact that you're trying to return a list of an anonymous type, but your method signature specifies that it should return a `List<IGrouping<DateTime, Game>>`. Anonymous types cannot be referenced outside of their declaring scope, which is why you're seeing the signature for ... | 37,642 | [
{
"from": "human",
"value": "I am trying to get the signature on the method below to work. As this is an Anonymous Type I have some trouble, any help would be great.\nWhen I looked at sortedGameList.ToList() in a QuickWatch window I get the signature \nSystem.Collections.Generic.List<<>f__AnonymousType0<Sys... |
I am trying to programatically set the dpi metadata of an jpeg image in Java. The source of the image is a scanner, so I get the horizontal/vertical resolution from TWAIN, along with the image raw data. I'd like to save this info for better print results.
Here's the code I have so far. It saves the raw image (byteArray... | The issue with your code appears to relate to how you are setting the metadata for the JPEG image, specifically the density attributes (`Xdensity`, `Ydensity`, and `resUnits`).
Here's an overview of your code along with suggestions for debugging and improving it:
### Key Areas to Address:
1. **Metadata Type**:
E... | 30,621 | [
{
"from": "human",
"value": "I am trying to programatically set the dpi metadata of an jpeg image in Java. The source of the image is a scanner, so I get the horizontal/vertical resolution from TWAIN, along with the image raw data. I'd like to save this info for better print results.\nHere's the code I have... |
I am very familiar with the Command pattern, but I don't yet understand the difference in theory between a Functor and a command. In particular, I am thinking of Java implementations. Both are basically programming "verbs" represented as objects. However, in the case of functors, as I have seen from some examples anony... | The distinction between a **Functor** and a **Command** can indeed be subtle, especially when you're familiar with the Command pattern. Let's break down the differences between the two in terms of their conceptual framework, purpose, and how they're typically implemented in Java.
### Command Pattern
1. **Purpose**: T... | 31,662 | [
{
"from": "human",
"value": "I am very familiar with the Command pattern, but I don't yet understand the difference in theory between a Functor and a command. In particular, I am thinking of Java implementations. Both are basically programming \"verbs\" represented as objects. However, in the case of functo... |
I find it much easier to write MXML classes with embedded Script than trying to make an actionscript file.
I was wondering however what kind of overhead there is of using an MXML file - in terms of file size. I'm not especially concerned about performance, but if that is relevant would be interested in any findings.
Ob... | When using MXML in Adobe Flex, it's important to recognize how it compiles down to ActionScript and what implications that may have for file size and performance.
### MXML Compilation
1. **Compilation to ActionScript**: MXML files are essentially a higher-level abstraction that is compiled down to ActionScript by the... | 36,987 | [
{
"from": "human",
"value": "I find it much easier to write MXML classes with embedded Script than trying to make an actionscript file.\nI was wondering however what kind of overhead there is of using an MXML file - in terms of file size. I'm not especially concerned about performance, but if that is releva... |
http://biochrom.fivesite.co.uk/catalogue4.asp
On the page above there is an image floated to the left. To the right of it is a list, titled "features". The list items have a background image, however, it isn't appearing. List 2 shows how the background image looks.
Does anyone know how I can make the bullets visible?
| It sounds like you're having an issue with the visibility of the background images used for the bullets in your list items. Here are some steps to help you troubleshoot and fix the problem:
1. **Check the Background Image URL**: Ensure that the URL for the background image is correct. You can check this by inspecting ... | 35,076 | [
{
"from": "human",
"value": "http://biochrom.fivesite.co.uk/catalogue4.asp\nOn the page above there is an image floated to the left. To the right of it is a list, titled \"features\". The list items have a background image, however, it isn't appearing. List 2 shows how the background image looks.\nDoes anyo... |
How do I replace text from one file with text from another file using vbscript?
The text being replaced is somewhere in the middle of the file.
| To replace text from one file with text from another file using VBScript, you'll need to follow these general steps:
1. Read the content of the source file from which you want to take the text.
2. Read the content of the target file in which you want to perform the text replacement.
3. Perform the text replacement.
4.... | 36,558 | [
{
"from": "human",
"value": "How do I replace text from one file with text from another file using vbscript?\nThe text being replaced is somewhere in the middle of the file. \n"
},
{
"from": "gpt",
"value": "To replace text from one file with text from another file using VBScript, you'll need to... |
I am working on a WPF application which has a treeview that represents an XML. I load the XML on to the XDocument, then bind the TreeView to this object.
Now using the MVVM pattern, I want to provide a ViewModel on top of XDocument. What are some of the things that I should implement in the ViewModel class.
I am thin... | You're on the right track with your thoughts about implementing a ViewModel for a WPF application that uses an `XDocument` to represent XML data in a `TreeView`. The MVVM pattern is a powerful architecture that helps keep your UI and logic separated, making your application more modular and easier to maintain. Below ar... | 32,766 | [
{
"from": "human",
"value": "I am working on a WPF application which has a treeview that represents an XML. I load the XML on to the XDocument, then bind the TreeView to this object. \nNow using the MVVM pattern, I want to provide a ViewModel on top of XDocument. What are some of the things that I should im... |
I need in a bash script to get details about a file when I know the inode.The system is Linux.
| You can retrieve details about a file using its inode number with the `find` command in a bash script. Below is an example of how you can do this:
```bash
#!/bin/bash
# Check if an inode number is provided as an argument
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <inode_number> <search_directory>"
exit 1
fi
INO... | 37,277 | [
{
"from": "human",
"value": "I need in a bash script to get details about a file when I know the inode.The system is Linux.\n"
},
{
"from": "gpt",
"value": "You can retrieve details about a file using its inode number with the `find` command in a bash script. Below is an example of how you can d... |
I have almost the worst spec in the world. An application that exists and used to work. My aim is to recreate this app and make it work.
It's a very simple util that just displays the following information to screen:
ARFCN - Absolute Radio Frequency Channel Number
LAC - Location Area Code of the cell (unique in PLMN... | To develop an application that retrieves the specified cellular information, you'll likely need to use a combination of platform-specific libraries, P/Invokes, and possibly custom SDKs. Below are some potential approaches and libraries that can help you retrieve the desired information:
### 1. Using OpenNETCF Librarie... | 36,475 | [
{
"from": "human",
"value": "I have almost the worst spec in the world. An application that exists and used to work. My aim is to recreate this app and make it work. \nIt's a very simple util that just displays the following information to screen:\n\nARFCN - Absolute Radio Frequency Channel Number\nLAC - L... |
I have got some code to load an assembly and get all types, which implement a certain interface, like this (assume asm is a valid and loaded assembly).
var results = from type in asm.GetTypes()
where typeof(IServiceJob).IsAssignableFrom(type)
select type;
Now I'm stuck: I need to create instances of these objects ... | To create instances of types that implement a specific interface, invoke methods and properties on those instances, and store references to the created objects, you can follow these steps:
1. Use reflection to instantiate the types.
2. Store the instances in an array or a list.
3. Optionally invoke any methods or prop... | 33,332 | [
{
"from": "human",
"value": "I have got some code to load an assembly and get all types, which implement a certain interface, like this (assume asm is a valid and loaded assembly).\nvar results = from type in asm.GetTypes()\n where typeof(IServiceJob).IsAssignableFrom(type)\n select type;\n\nNow I'm stuck... |
I'm trying to get the dates from entries in two different RSS feeds through feedparser.
Here is what I'm doing:
import feedparser as fp
reddit = fp.parse("http://www.reddit.com/.rss")
cc = fp.parse("http://contentconsumer.com/feed")
print reddit.entries[0].date
print cc.entries[0].date
And here's how they come out:
20... | To compare the dates from the entries of two different RSS feeds, you can use the `datetime` module in Python to convert the strings you get from the RSS feeds into `datetime` objects. This will allow you to easily compare the two dates.
Here's how you can do it:
1. Parse the date strings into `datetime` objects.
2. ... | 36,074 | [
{
"from": "human",
"value": "I'm trying to get the dates from entries in two different RSS feeds through feedparser.\nHere is what I'm doing:\nimport feedparser as fp\nreddit = fp.parse(\"http://www.reddit.com/.rss\")\ncc = fp.parse(\"http://contentconsumer.com/feed\")\nprint reddit.entries[0].date\nprint c... |
I have a JPanel extension that I've written and would like to be able to use it in the NetBeans designer. The component is simply adds some custom painting and continues to function as a container to be customised on each use.
I have properties to expose in addition to the standard JPanel ones and have a custom pain... | To make your custom `JPanel` extension usable in the NetBeans GUI Builder, you'll need to follow a few steps to ensure it integrates well with the designer. Here’s how you can do it:
### Step 1: Create a Custom JPanel Class
Ensure your custom panel extends `JPanel` and has the necessary properties and overridden meth... | 35,203 | [
{
"from": "human",
"value": "I have a JPanel extension that I've written and would like to be able to use it in the NetBeans designer. The component is simply adds some custom painting and continues to function as a container to be customised on each use. \nI have properties to expose in addition to the s... |
We often send emails in HTML for clients (Dont like it but not my choice)
Does anyone have any info or a link on support for the dynscrc attribute or img in email clients?
| The `dynsrc` attribute is not widely supported in email clients. In fact, it is not recommended to use `dynsrc` at all, as it has limited support and is not standard HTML. Most email clients prioritize security and do not support many HTML and JavaScript features, including potentially unsupported attributes like `dyns... | 36,139 | [
{
"from": "human",
"value": "We often send emails in HTML for clients (Dont like it but not my choice)\nDoes anyone have any info or a link on support for the dynscrc attribute or img in email clients?\n"
},
{
"from": "gpt",
"value": "The `dynsrc` attribute is not widely supported in email clien... |
There are 3 web apps.
Site A and B are both ASP.NET Web Application with FormsAuthentications configurations, and there is a protected folder in site B which also configured correctly in the web.config. Site C is a classic ASP web which keep authentication status with Session.
Now please consider the following steps:
1... | It seems you are experiencing some confusion regarding how authentication sessions work across different web applications and how they handle sessions and cookies. Let's break down your observations and clarify why you can access the protected pages without re-logging in for both Site B (ASP.NET) and Site C (classic AS... | 32,146 | [
{
"from": "human",
"value": "There are 3 web apps.\nSite A and B are both ASP.NET Web Application with FormsAuthentications configurations, and there is a protected folder in site B which also configured correctly in the web.config. Site C is a classic ASP web which keep authentication status with Session.\... |
I'm developing an object-oriented PHP website right now and am trying to determine the best way to abstract database functionality from the rest of the system. Right now, I've got a DB class that manages all the connections and queries that the system uses (it's pretty much an interface to MDB2). However, when using th... | To effectively manage database queries in an object-oriented PHP application, you can utilize several techniques to improve maintainability, reduce repetition, and increase security. Here are some recommended approaches:
### 1. **Data Access Objects (DAOs) or Repositories**
You can create a separate class for managin... | 34,367 | [
{
"from": "human",
"value": "I'm developing an object-oriented PHP website right now and am trying to determine the best way to abstract database functionality from the rest of the system. Right now, I've got a DB class that manages all the connections and queries that the system uses (it's pretty much an i... |
I have a Stored procedure which schedules a job. This Job takes a lot of time to get completed (approx 30 to 40 min). I need to get to know the status of this Job.
Below details would help me
1) How to see the list of all jobs that have got scheduled for a future time and are yet to start
2) How to see the the list of ... | To monitor SQL Server Agent jobs in Microsoft SQL Server, you can use various system views and stored procedures to retrieve information about scheduled jobs, their status, and their execution history. Below are the details for each of your requests:
### 1) List of All Jobs Scheduled for a Future Time
To see all jobs ... | 24,995 | [
{
"from": "human",
"value": "I have a Stored procedure which schedules a job. This Job takes a lot of time to get completed (approx 30 to 40 min). I need to get to know the status of this Job.\nBelow details would help me\n1) How to see the list of all jobs that have got scheduled for a future time and are ... |
I want to learn MSBuild, was wondering if someone could get me started with a simple build script to filter out my vs.net 2008 project of all files with the .cs extension.
how do I run the build?
where do you usually store the build also?
| Certainly! MSBuild is a powerful build platform that can help you automate the building of your projects. Below, I’ll guide you through creating a simple MSBuild script to filter out all `.cs` files from a Visual Studio .NET 2008 project, and I will explain how to run the build and where to store your build scripts.
#... | 30,677 | [
{
"from": "human",
"value": "I want to learn MSBuild, was wondering if someone could get me started with a simple build script to filter out my vs.net 2008 project of all files with the .cs extension.\n\nhow do I run the build?\nwhere do you usually store the build also?\n\n"
},
{
"from": "gpt",
... |
can we output a .jpg image or .gif image in C? I mean can we print a picture as output with the help of a C program?Aslo can we write a script in C language for HTML pages as can be written in JavaScript? Can the browsers operate on it?If not possible is there any plugin for any of the browsers?
Any example code or lin... | Yes, it is possible to output image files like `.jpg` or `.gif` in C, but it typically involves working with libraries that can handle graphics and image formats. C itself doesn't provide built-in functions for handling these image formats directly, but libraries like SDL (Simple DirectMedia Layer), OpenCV, or others c... | 28,606 | [
{
"from": "human",
"value": "can we output a .jpg image or .gif image in C? I mean can we print a picture as output with the help of a C program?Aslo can we write a script in C language for HTML pages as can be written in JavaScript? Can the browsers operate on it?If not possible is there any plugin for any... |
I have an ASPX page and on this page I have a control that contains an AJAX UpdatePanel.
When the control makes a callback my ASPX page's Page_Load event is triggered, but the Page.IsCallBack property is false.
How do I know in the page's Page_Load event if there was a callback?
| In ASP.NET Web Forms, when using an `UpdatePanel` control to enable partial page updates via AJAX, the `Page_Load` event is triggered for every request, including those for callbacks, but the `Page.IsPostBack` and `Page.IsCallback` properties behave differently.
The `IsCallback` property is typically used for controls... | 37,928 | [
{
"from": "human",
"value": "I have an ASPX page and on this page I have a control that contains an AJAX UpdatePanel.\nWhen the control makes a callback my ASPX page's Page_Load event is triggered, but the Page.IsCallBack property is false.\nHow do I know in the page's Page_Load event if there was a callbac... |
In preview 5 I was overriding the OnActionExecuting in my custom controller class, but now for some reason in beta it is giving me an error saying the parameter FilterExecutingContext doesn't exist?
protected override void OnActionExecuting(System.Web.Mvc.FilterExecutingContext filterContext)
What is the paramete... | In ASP.NET Core, the method signature for `OnActionExecuting` has changed from what you might have been familiar with in previous versions of ASP.NET MVC.
In the earlier versions of ASP.NET MVC, you were using the `System.Web.Mvc.FilterExecutingContext`. However, in ASP.NET Core, the corresponding context class is `A... | 35,663 | [
{
"from": "human",
"value": "In preview 5 I was overriding the OnActionExecuting in my custom controller class, but now for some reason in beta it is giving me an error saying the parameter FilterExecutingContext doesn't exist?\n protected override void OnActionExecuting(System.Web.Mvc.FilterExecutingCo... |
This code was working properly before, basically I have a master page that has a single text box for searching, I named it searchBox. I have a method to pull the content of searchBox on form submit and set it to a variable userQuery. Here is the method:
Public Function searchString(ByVal oTextBoxName As String) As St... | The issue you're encountering likely stems from how the ASP.NET WebForms page lifecycle works and how the controls are managed during postbacks.
When you submit the form from a page other than `search.aspx`, the `TextBox` control (`searchBox`) is submitted as part of the form data, but it may not retain its value when... | 34,174 | [
{
"from": "human",
"value": "This code was working properly before, basically I have a master page that has a single text box for searching, I named it searchBox. I have a method to pull the content of searchBox on form submit and set it to a variable userQuery. Here is the method:\nPublic Function search... |
We have a requirement to display an editable list in a web page.
What would be the easiest way to do that? Farpoint Spread was something I have used to achieve this earlier but it was quite slow when a large number of records were involved and it needed to be coded in VBScript. Besides it wasn't free.
I would be lookin... | If you're looking for an editable list solution in a web application using JavaScript, there are several free and open-source libraries that can help you create a spreadsheet-like interface or an editable list without the overhead and limitations of Farpoint Spread. Here are a few options you might consider:
### 1. **... | 33,783 | [
{
"from": "human",
"value": "We have a requirement to display an editable list in a web page.\nWhat would be the easiest way to do that? Farpoint Spread was something I have used to achieve this earlier but it was quite slow when a large number of records were involved and it needed to be coded in VBScript.... |
I have a Freemarker template which contains a bunch of placeholders for which values are supplied when the template is processed. I want to conditionally include part of the template if the userName variable is supplied, something like:
[#if_exists userName]
Hi ${userName}, How are you?
[/#if_exists]
However, the Fr... | In FreeMarker, you can check if a variable exists by using the `?exists` built-in. This allows you to conditionally include content based on whether a variable is defined or not. Instead of using `if_exists`, you can use the following syntax:
```freemarker
[#if userName?exists]
Hi ${userName}, How are you?
[/#if]
``... | 40,032 | [
{
"from": "human",
"value": "I have a Freemarker template which contains a bunch of placeholders for which values are supplied when the template is processed. I want to conditionally include part of the template if the userName variable is supplied, something like:\n[#if_exists userName]\n Hi ${userName}, ... |
Can I find out when the last INSERT, UPDATE or DELETE statement was performed on a table in an Oracle database and if so, how?
A little background: The Oracle version is 10g. I have a batch application that runs regularly, reads data from a single Oracle table and writes it into a file. I would like to skip this if the... | In Oracle 10g, there is no built-in way to directly track the last INSERT, UPDATE, or DELETE operation on a table if you cannot modify the schema (e.g., by adding triggers or using auditing options). However, you can approach your requirement using a couple of methods, given your constraints.
### Method 1: Using a Tim... | 34,385 | [
{
"from": "human",
"value": "Can I find out when the last INSERT, UPDATE or DELETE statement was performed on a table in an Oracle database and if so, how?\nA little background: The Oracle version is 10g. I have a batch application that runs regularly, reads data from a single Oracle table and writes it int... |
Can I export multiple calendar events into a single iCalendar file?
| Yes, you can export multiple calendar events into a single iCalendar file (.ics). The process usually involves the following steps, depending on the calendar service or software you're using:
### Using Calendar Applications (like Google Calendar or Outlook)
1. **Google Calendar:**
- Open Google Calendar.
- Clic... | 37,355 | [
{
"from": "human",
"value": "Can I export multiple calendar events into a single iCalendar file? \n"
},
{
"from": "gpt",
"value": "Yes, you can export multiple calendar events into a single iCalendar file (.ics). The process usually involves the following steps, depending on the calendar servic... |
I'm making a program which the user build directories (not in windows, in my app) and in these folders there are subfolders and so on; every folder must contain either folders or documents. What is the best data structure to use? Notice that the user may select a subfolder and search for documents in it and in its subf... | For your application that allows users to create directories and subdirectories (with unlimited nesting), a tree data structure is the most suitable choice. The tree structure effectively represents hierarchical relationships, such as folders containing subfolders and documents.
Here's a recommended approach to implem... | 27,160 | [
{
"from": "human",
"value": "I'm making a program which the user build directories (not in windows, in my app) and in these folders there are subfolders and so on; every folder must contain either folders or documents. What is the best data structure to use? Notice that the user may select a subfolder and s... |
I currently have 2 BufferedReaders initialized on the same text file. When I'm done reading the text file with the first BufferedReader, I use the second one to make another pass through the file from the top. Multiple passes through the same file are necessary.
I know about reset(), but it needs to be preceded with ca... | When you want to read a file multiple times in Java, the simplest solution is to use a single `BufferedReader` to read the file and reset its position after each read. However, as you've noted, the `reset()` method requires a prior call to `mark()`, which can be cumbersome.
Since you mentioned that you're reading the ... | 33,611 | [
{
"from": "human",
"value": "I currently have 2 BufferedReaders initialized on the same text file. When I'm done reading the text file with the first BufferedReader, I use the second one to make another pass through the file from the top. Multiple passes through the same file are necessary.\nI know about re... |
A basic definition and example and a few references for "X-Macros" is given in this wikipedia entry on the C pre-processor:
An X-Macro is a header file (commonly
using a ".def" extension instead of
the traditional ".h") that contains a
list of similar macro calls (which can
be referred to as "component macros... | X-Macros are a powerful technique in C programming that allows for code generation and organization by defining a list of macros in a single header file. This method can simplify repetitive tasks and improve maintainability.
### Good Sources of Information
1. **"Advanced C Programming" by Peter van der Linden** - Thi... | 38,314 | [
{
"from": "human",
"value": "A basic definition and example and a few references for \"X-Macros\" is given in this wikipedia entry on the C pre-processor:\n\nAn X-Macro is a header file (commonly\n using a \".def\" extension instead of\n the traditional \".h\") that contains a\n list of similar macro ca... |
By "code snippet execution", I mean the ability to write a few lines of code, run and test it without having to fire up an IDE and create a dummy project.
It's incredibly useful for helping people with a small code sample without creating a project, compiling everything cleanly, sending them the code snippet and deleti... | For executing small code snippets quickly without the overhead of a full IDE, there are several tools across different programming languages that you might find useful. Here are some suggestions, including alternatives to Eclipse for Java and options for C:
### C#
- **LINQPad**: You already mentioned this, but it's w... | 36,496 | [
{
"from": "human",
"value": "By \"code snippet execution\", I mean the ability to write a few lines of code, run and test it without having to fire up an IDE and create a dummy project.\nIt's incredibly useful for helping people with a small code sample without creating a project, compiling everything clean... |
We have an Oracle DB running on Linux.
When data is ready to report, a value is placed in a table in the DB.
Presently an app is scheduled to run every 10 seconds to check for the value and if it's there it prints out the report. NOT prety.
How can I make this pretty?
I sort of envision the Oracle DB somehow triggerin... | To improve the current setup where your application polls the database every 10 seconds, you can implement a more efficient event-driven architecture. This involves using a signaling mechanism to notify the Windows server when new data is ready in the Oracle database. Here are a few options to accomplish this:
### Opt... | 35,588 | [
{
"from": "human",
"value": "We have an Oracle DB running on Linux.\nWhen data is ready to report, a value is placed in a table in the DB.\nPresently an app is scheduled to run every 10 seconds to check for the value and if it's there it prints out the report. NOT prety.\nHow can I make this pretty?\nI sor... |
I have many unused computers at home. What would be the easiest way for me to utilize them to parallelize my C# program with little or no code changes?
The task I'm trying to do involves looping through lots of english sentences, the dataset can be easily broken into smaller chunks, processed in different machines conc... | Utilizing multiple unused computers to parallelize your C# program can be achieved in several ways, even with minimal code changes. Below are some approaches that can help you accomplish this:
### 1. **Use Distributed Computing Frameworks**
You can leverage distributed computing frameworks that are designed to handle... | 33,558 | [
{
"from": "human",
"value": "I have many unused computers at home. What would be the easiest way for me to utilize them to parallelize my C# program with little or no code changes?\nThe task I'm trying to do involves looping through lots of english sentences, the dataset can be easily broken into smaller ch... |
I'm writing an implementation of a virtual machine in C#, and I need to implement the VM's stack, which can contain two types of entry - return entries or backtrack entries. What is the best way of implementing this?
I'm currently using a base type, as follows:
class StackEntry { }
class Return : StackEntry { uint pc; ... | Certainly! Your current approach with a base class and derived classes is a common way to implement a stack that can hold different types of entries. However, as you've observed, type testing and downcasting can lead to clumsy code. Here are a few strategies to improve the design and make it more elegant.
### Option 1... | 32,242 | [
{
"from": "human",
"value": "I'm writing an implementation of a virtual machine in C#, and I need to implement the VM's stack, which can contain two types of entry - return entries or backtrack entries. What is the best way of implementing this?\nI'm currently using a base type, as follows:\nclass StackEntr... |
I know I can configure command line arguments in the Run configuration but I want to run a java file multiple times with different command line arguments. It's a pain to change the Run Configuration every time.
Is there a way I can make Eclipse prompt me for command line arguments every time I run the program?
| Yes, you can set up Eclipse to prompt you for command line arguments every time you run your Java program. While Eclipse does not have a built-in feature to prompt for command line arguments directly during the run process, you can achieve this by modifying your Java program to read arguments from the console.
Here's ... | 36,044 | [
{
"from": "human",
"value": "I know I can configure command line arguments in the Run configuration but I want to run a java file multiple times with different command line arguments. It's a pain to change the Run Configuration every time.\nIs there a way I can make Eclipse prompt me for command line argume... |
Why are circular references in Visual Studio a bad practice?
First, I will describe an example of how this can happen using C# in Visual Studio, since VS will typically inform you if you have a circular reference and prevent it.
First, a Utilities class is created relying only on the code given to you by Visual Studio ... | Circular references in software development, including C# projects in Visual Studio, are generally considered a bad practice for several reasons. While they may seem manageable in the short term, they can lead to significant complications over time. Here are some key issues associated with circular references:
### 1. ... | 35,724 | [
{
"from": "human",
"value": "Why are circular references in Visual Studio a bad practice?\nFirst, I will describe an example of how this can happen using C# in Visual Studio, since VS will typically inform you if you have a circular reference and prevent it.\nFirst, a Utilities class is created relying only... |
I´ve tweaked the VC++ settings so that all of my actual code will go to one place, while compiler generated binaries will go to another. This ncb file is the exception though. It is a quite large IDE generated binary file (Intellisense database). I can´t seem to be able to move it anywhere other than the solution folde... | In Visual C++ (VC++), the NCB (Named Code Browser) file is indeed tied to the project and is typically created in the solution folder. Unfortunately, as of my last knowledge update, there is no built-in feature in Visual Studio that allows you to relocate the NCB file to a different directory directly.
However, here a... | 35,697 | [
{
"from": "human",
"value": "I´ve tweaked the VC++ settings so that all of my actual code will go to one place, while compiler generated binaries will go to another. This ncb file is the exception though. It is a quite large IDE generated binary file (Intellisense database). I can´t seem to be able to move ... |
The title pretty much says it all, but for those of you who are familiar with both the latest VMWare Fusion and the "linked clone" feature found in VMWare workstation, can you confirm whether this feature is currently present or absent in Fusion?
This could be considered an update of this previous question:
Replacing V... | As of my last knowledge update in October 2023, VMware Fusion does not support the linked clone feature that is available in VMware Workstation. Linked clones allow users to create a new virtual machine that is based on an existing VM but shares the virtual disks with the parent VM. This feature is particularly useful ... | 39,437 | [
{
"from": "human",
"value": "The title pretty much says it all, but for those of you who are familiar with both the latest VMWare Fusion and the \"linked clone\" feature found in VMWare workstation, can you confirm whether this feature is currently present or absent in Fusion?\nThis could be considered an u... |
Im having problems displaying records to my view when passing viewdata to a user control.
This is only apparent for linq to sql objects where I am using table joins.
The exception I receive is "Unable to cast object of type '<>f__AnonymousType410[System.String,System.Int32,System.Nullable1[System.DateTime],System.Stri... | The issue you're facing stems from the fact that when you perform a LINQ query that includes joins and select specific fields into an anonymous type, you cannot cast the result directly to your data model classes, such as `table1`.
In your LINQ query, you are selecting an anonymous type that contains fields from seve... | 33,676 | [
{
"from": "human",
"value": "Im having problems displaying records to my view when passing viewdata to a user control.\nThis is only apparent for linq to sql objects where I am using table joins.\nThe exception I receive is \"Unable to cast object of type '<>f__AnonymousType410[System.String,System.Int32,S... |
I have a site where I use CustomErrors in the web.config to specify a custom error page, and that's working just fine. The custom 404 page is also specified in the IIS configuration (because if it's not, I don't get my custom 404 page).
But I have some logic that kicks in if a user gets a 404 that looks at their reque... | The issue you are experiencing with the `aspxerrorpath` not being appended to the URL in your test environment could be due to a few different factors related to the configuration of IIS and the handling of custom errors. Here are some potential solutions to troubleshoot and resolve the issue:
### 1. **Check the Custo... | 29,588 | [
{
"from": "human",
"value": "I have a site where I use CustomErrors in the web.config to specify a custom error page, and that's working just fine. The custom 404 page is also specified in the IIS configuration (because if it's not, I don't get my custom 404 page).\nBut I have some logic that kicks in if a... |
The query used inside the IN() returns: 1, 2. However the whole query returns 0 rows which is impossible since they are present. What am I doing wrong here?
SELECT DISTINCT
li.auto_id
FROM
links AS li
JOIN group_data AS gi ON
li.auto_id = gi.autoid AND li.user_id = gi.userid
WHERE
gi.groupid IN
(
... | Based on the query you provided and your explanation of the issue, it appears that there may be a misunderstanding regarding how the `IN()` clause works with the subquery. Let's break down the problem:
1. **Subquery Behavior**: The subquery inside the `IN()` clause is returning a single string value (e.g., "1, 2") due... | 35,564 | [
{
"from": "human",
"value": "The query used inside the IN() returns: 1, 2. However the whole query returns 0 rows which is impossible since they are present. What am I doing wrong here?\nSELECT DISTINCT \n li.auto_id\nFROM \n links AS li\n JOIN group_data AS gi ON \n li.auto_id = gi.autoid AND li.use... |
I am currently writing an financial application, and we have a pretty standard customer table. It consists of many mandatory fields, and some optional like Cell/Fax etc.. I'm using NHibernate as a ORM and have all the mappings right. It already works.
I just wonder, how do I "express" in code that a field is not-null w... | To express in code which properties in your POCO (Plain Old CLR Object) can be null and which cannot, you can leverage nullable types and data annotations for validation. This way, you can make your intentions clear without relying solely on comments or XML mappings. Here's how you can achieve this:
### Using Nullable... | 36,116 | [
{
"from": "human",
"value": "I am currently writing an financial application, and we have a pretty standard customer table. It consists of many mandatory fields, and some optional like Cell/Fax etc.. I'm using NHibernate as a ORM and have all the mappings right. It already works.\nI just wonder, how do I \"... |
I have finally got the green light to use Memcached in our project (after months of lobbying against a database-based caching solution - just don't ask...), however we will need to use Repcached as well to have backup copies of our data. Has anyone built this for Win32? We may end up using Linux in production, but de... | Great to hear that you've got the go-ahead to use Memcached! It's indeed a powerful caching solution, and using Repcached for replication adds an extra layer of data safety.
Regarding your question about Repcached on Win32: while there are precompiled binaries available for Linux, Repcached does not have official supp... | 37,295 | [
{
"from": "human",
"value": "I have finally got the green light to use Memcached in our project (after months of lobbying against a database-based caching solution - just don't ask...), however we will need to use Repcached as well to have backup copies of our data. Has anyone built this for Win32? We may... |
I have a web login page with the standard username password and login button controls. I would like to write a wrapper page that will render and auto fill the username and login form text boxes with a constant and force the onclick event for login button. Any suggestions how to accomplish this?
| Creating a wrapper page to autofill username and password fields and automatically trigger the login button's click event can be achieved using JavaScript. Here's how you can do this:
### Step-by-Step Guide
1. **Create a Wrapper Page**: You can create a simple HTML page that will act as your wrapper for the login pag... | 33,800 | [
{
"from": "human",
"value": "I have a web login page with the standard username password and login button controls. I would like to write a wrapper page that will render and auto fill the username and login form text boxes with a constant and force the onclick event for login button. Any suggestions how to ... |
I am using the ruby daemons gem to create a custom daemon for my rails project. The only problem is that when I try to start the daemons ruby lib/daemons/test_ctl start that it fails and will not start. The log file has this output.
# Logfile created on Wed Oct 22 16:14:23 +0000 2008 by /
*** below you find the most... | The error messages you are seeing indicate several issues that may be occurring in your Ruby daemon setup. Here are some steps you can take to troubleshoot and resolve these issues:
1. **Check Dependencies**: Make sure that all required gems and dependencies are properly installed. The error `no such file to load -- u... | 32,889 | [
{
"from": "human",
"value": "I am using the ruby daemons gem to create a custom daemon for my rails project. The only problem is that when I try to start the daemons ruby lib/daemons/test_ctl start that it fails and will not start. The log file has this output.\n# Logfile created on Wed Oct 22 16:14:23 +00... |
I've found an interesting article about Lucene and geosearching:
http://sujitpal.blogspot.com/2008/02/spatial-search-with-lucene.html
Is there an equivilant .NET implementation out there that I have been unable to find or do I have to rework the Java-code in his example to fit in the .NET Framework?
| As of my last knowledge update in October 2023, there isn't a direct equivalent of Apache Lucene specifically for .NET that supports geospatial searching out of the box. However, there are several libraries and frameworks that you can consider for implementing geospatial search functionalities in .NET:
1. **Lucene.NET... | 38,257 | [
{
"from": "human",
"value": "I've found an interesting article about Lucene and geosearching:\nhttp://sujitpal.blogspot.com/2008/02/spatial-search-with-lucene.html\nIs there an equivilant .NET implementation out there that I have been unable to find or do I have to rework the Java-code in his example to fit... |
I have an existing application that uses CArchive to serialize a object structure to a file. I am wondering if can replace the usage of CArchive with some custom class to write to a database the same way that things are serialized. Before I go about figuring if this is doable I was wondering if other people have done... | Yes, it is indeed possible to create a custom class that acts as a drop-in replacement for `CArchive`, allowing you to serialize your objects to a database instead of a file. The main idea is to maintain a similar interface so that your existing code can remain largely unchanged.
Here's a general approach you can take... | 37,699 | [
{
"from": "human",
"value": "I have an existing application that uses CArchive to serialize a object structure to a file. I am wondering if can replace the usage of CArchive with some custom class to write to a database the same way that things are serialized. Before I go about figuring if this is doable ... |
I am using sql express 2008 and vs2008, writing in c#.
I have a db table with a Geography column in it, into which I need to put gps data I collected. When I tried creating an Entity-Framework mapping for this table, it just ignored the column with some warning about not being able to map such column types.
I then look... | When working with SQL Server's Geography type in Entity Framework (EF) or NHibernate, it can indeed be challenging since these libraries often don't have direct support for certain SQL Server-specific types like Geography. However, there are a few strategies you can use to work with Geography columns in your database w... | 35,193 | [
{
"from": "human",
"value": "I am using sql express 2008 and vs2008, writing in c#.\nI have a db table with a Geography column in it, into which I need to put gps data I collected. When I tried creating an Entity-Framework mapping for this table, it just ignored the column with some warning about not being ... |
I'm setting the below variables in my vimrc to control how windows get split when I bring up the file explorer plugin for vim. But it appears these variables are not being read because they have no effect on how the file explorer window is displayed. I'm new to vim. I know the vimrc file is being read because I can mak... | It sounds like you're trying to customize the behavior of a file explorer plugin in Vim, likely something like NERDTree or a similar plugin. However, the variables you're trying to set (`g:explWinSize`, `g:explSplitBelow`, `g:explDetailedHelp`) may not be recognized because they are not standard Vim settings or not def... | 34,181 | [
{
"from": "human",
"value": "I'm setting the below variables in my vimrc to control how windows get split when I bring up the file explorer plugin for vim. But it appears these variables are not being read because they have no effect on how the file explorer window is displayed. I'm new to vim. I know the v... |
I have a ControlTemplate that is made up of a ToolBarTray and a ToolBar. In my ToolBar, I have several buttons and then a label. I want to be able to update the label in my toolbar with something like "1 of 10"
My first thought is to programatically find the label and set it, but I'm reading that this should be do... | To update the `Label` in your `ToolBar` using data binding and triggers, you first need to set up a way to hold the information you want to display (e.g., "1 of 10"). This typically involves using a `ViewModel` with properties and perhaps some commands if needed.
Here’s a step-by-step approach to achieve this:
1. **D... | 31,688 | [
{
"from": "human",
"value": "I have a ControlTemplate that is made up of a ToolBarTray and a ToolBar. In my ToolBar, I have several buttons and then a label. I want to be able to update the label in my toolbar with something like \"1 of 10\" \nMy first thought is to programatically find the label and se... |
I know it is customary, but why? Are there real technical reasons why any other way would be a really bad idea or is it just based on the history of encoding and backwards compatibility? In addition, what are the dangers of not using UTF-8, but some other encoding (most notably, UTF-16)?
Edit : By interacting, I mostl... | The use of UTF-8 as a predominant character encoding in systems, particularly in Unix-like environments (like Linux and macOS), is indeed customary, but there are solid technical reasons behind its widespread adoption.
### Technical Reasons for Using UTF-8
1. **Backwards Compatibility with ASCII**: UTF-8 is designed... | 30,539 | [
{
"from": "human",
"value": "I know it is customary, but why? Are there real technical reasons why any other way would be a really bad idea or is it just based on the history of encoding and backwards compatibility? In addition, what are the dangers of not using UTF-8, but some other encoding (most notably,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.