instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
Why do you think Microsoft wants us to go through IEnumerable to get to IEnumerator? Isn't the presence or absence of a valid cast to IEnumerator for a given type enough to determine if the type is enumerable or not?
For example whats wrong with the following?
class MyClass : IEnumerator
{
...
}
MyClass myObj = ne... | The design choice by Microsoft to use `IEnumerable` and `IEnumerator` as separate interfaces is intentional and serves several important purposes in the .NET framework. Let's break down the reasoning:
### 1. Separation of Concerns
- **IEnumerable**: This interface is designed to provide a way to obtain an enumerator ... | 41,163 | [
{
"from": "human",
"value": "Why do you think Microsoft wants us to go through IEnumerable to get to IEnumerator? Isn't the presence or absence of a valid cast to IEnumerator for a given type enough to determine if the type is enumerable or not?\nFor example whats wrong with the following?\nclass MyClass : ... |
Informed options needed about the merits of flat file database. I'm considering using a flat file database scheme to manage data for a custom blog. It would be deployed on Linux OS variant and written in Java.
What are the possible negatives or positives regarding performance for reading and writing of both article... | Using a flat file database (or file system-based storage) for a custom blog can be a feasible approach, particularly for small to medium-sized applications or personal projects. However, there are several merits and drawbacks you should consider regarding performance, scalability, and data management.
### Merits of Us... | 39,923 | [
{
"from": "human",
"value": "Informed options needed about the merits of flat file database. I'm considering using a flat file database scheme to manage data for a custom blog. It would be deployed on Linux OS variant and written in Java. \nWhat are the possible negatives or positives regarding performan... |
Is it acceptable to make more than 1 facade class (not instance) in a facade design pattern?
I mean, is it formally forbidden ?
Will it inhibit the 'facade design pattern' advantage itself?
| In the facade design pattern, there is no formal restriction on the number of facade classes you can create. The primary purpose of a facade is to provide a simplified interface to a complex subsystem, allowing clients to interact with it more easily. Here are some considerations regarding the use of multiple facade cl... | 41,685 | [
{
"from": "human",
"value": "Is it acceptable to make more than 1 facade class (not instance) in a facade design pattern?\nI mean, is it formally forbidden ? \nWill it inhibit the 'facade design pattern' advantage itself?\n"
},
{
"from": "gpt",
"value": "In the facade design pattern, there is no... |
I need to create some functionality in our SharePoint app that populates a list or lists with some simple hierarchical data. Each parent record will represent a "submission" and each child record will be a "submission item." There's a 1-to-n relationship between submissions and submission items. Is this practical to... | Creating hierarchical data in SharePoint is indeed practical and can be accomplished through lists and lookup columns, even if you're dealing with a 1-to-n relationship like the one you've described between submissions and submission items. Here’s how you can set this up:
### Step-by-Step Guide
1. **Create Lists**:
... | 39,979 | [
{
"from": "human",
"value": "I need to create some functionality in our SharePoint app that populates a list or lists with some simple hierarchical data. Each parent record will represent a \"submission\" and each child record will be a \"submission item.\" There's a 1-to-n relationship between submission... |
How do I access 'a' below?
var test = function () {
return {
'a' : 1,
'b' : this.a + 1 //doesn't work
};
};
| In JavaScript, when you use `this` inside a function (especially an anonymous function like in your example), it refers to the global object in non-strict mode, or `undefined` in strict mode. In this case, `this.a` is trying to access a property `a` on the global object, which does not exist, hence it will not work as ... | 41,320 | [
{
"from": "human",
"value": "How do I access 'a' below?\nvar test = function () {\n return {\n 'a' : 1,\n 'b' : this.a + 1 //doesn't work\n };\n};\n\n"
},
{
"from": "gpt",
"value": "In JavaScript, when you use `this` inside a function (especially an anonymous function like ... |
We have merge replication set up over a distributed environment (50 to 1500km between offices) for a SQL Server 2005 database of about 350Gb. We now need to add a couple of new tables that must also be in replication, but without pushing the new snapshot to all the subscribers. Is this possible, and if so, what would... | In SQL Server 2005, adding new tables to an existing merge replication setup without pushing a new snapshot to all subscribers can be a bit tricky, but it is possible using a method called "Add Article." Here’s how you can do this:
### Steps to Add New Tables to Merge Replication without a Full Snapshot:
1. **Create ... | 40,662 | [
{
"from": "human",
"value": "We have merge replication set up over a distributed environment (50 to 1500km between offices) for a SQL Server 2005 database of about 350Gb. We now need to add a couple of new tables that must also be in replication, but without pushing the new snapshot to all the subscribers.... |
Everyone in my office uses Macs and therefore most use Safari.
We have a page that has 30 checkboxes on it, I didn't even do the HTML myself but no matter if I use the html input checkbox with a label or an asp:Checkbox usig the text property for the label my boss is irritated because the checkbox is a little below ce... | It's not uncommon to encounter browser-specific rendering issues, especially with form elements like checkboxes. When you’re dealing with design inconsistencies across different browsers, it can be frustrating to explain to stakeholders who may not have a technical background. Here are some steps you can take to addres... | 41,806 | [
{
"from": "human",
"value": "Everyone in my office uses Macs and therefore most use Safari. \nWe have a page that has 30 checkboxes on it, I didn't even do the HTML myself but no matter if I use the html input checkbox with a label or an asp:Checkbox usig the text property for the label my boss is irritated... |
I am working on an algorithm that will try to pick out, given an HTML file, what it thinks is the parent element that most likely contains the majority of the page's content text.
For example, it would pick the div "content" in the following HTML:
<html>
<body>
<div id="header">This is the header we don't care... | Yes, there are several approaches you can use to identify the parent element that likely contains the main content of a webpage. Your idea of traversing the HTML tree and evaluating text length is a solid start. Here are some additional strategies that can enhance your algorithm:
### 1. **Text Length and Density Analy... | 39,334 | [
{
"from": "human",
"value": "I am working on an algorithm that will try to pick out, given an HTML file, what it thinks is the parent element that most likely contains the majority of the page's content text.\nFor example, it would pick the div \"content\" in the following HTML:\n<html>\n <body>\n <d... |
I'm building a program that has a class used locally, but I want the same class to be used the same way over the network. This means I need to be able to make synchronous calls to any of its public methods. The class reads and writes files, so I think XML-RPC is too much overhead. I created a basic rpc client/server us... | It sounds like you've been through quite a journey in finding the right solution for your requirements. Based on your description, it's clear you need a way to access a class instance across a network as if it were local, allowing synchronous calls to its methods. Here’s a quick summary of potential options for remote ... | 40,972 | [
{
"from": "human",
"value": "I'm building a program that has a class used locally, but I want the same class to be used the same way over the network. This means I need to be able to make synchronous calls to any of its public methods. The class reads and writes files, so I think XML-RPC is too much overhea... |
How exactly does NSInvocation work? Is there a good introduction?
I’m specifically having issues understanding how the following code (from Cocoa Programming for Mac OS X, 3rd Edition) works, but then also be able to apply the concepts independently of the tutorial sample. The code:
- (void)insertObject:(Person *)p inE... | NSInvocation is a powerful feature in Objective-C that allows you to encapsulate a method call, including its target, selector, arguments, and the return value. This can be particularly useful for tasks that require delayed or deferred execution, such as implementing undo functionality, as demonstrated in your provided... | 36,083 | [
{
"from": "human",
"value": "How exactly does NSInvocation work? Is there a good introduction?\nI’m specifically having issues understanding how the following code (from Cocoa Programming for Mac OS X, 3rd Edition) works, but then also be able to apply the concepts independently of the tutorial sample. The ... |
I'm writing javascript code that is read in as a string and executed via eval() by a firefox extension. Firebug does "see" my script so I am not able to use breakpoints, see objects, etc.
I am currently using Firefox's error console which I'm starting to find limiting. What are my other options? Ideally, I would be ab... | Debugging JavaScript code that is injected via `eval()` in a Firefox extension can indeed be challenging, especially when using tools like Firebug. Here are some strategies and tools that might help you debug your Greasemonkey scripts more effectively:
### 1. Use the DevTools
Modern versions of Firefox come with built... | 41,273 | [
{
"from": "human",
"value": "I'm writing javascript code that is read in as a string and executed via eval() by a firefox extension. Firebug does \"see\" my script so I am not able to use breakpoints, see objects, etc. \nI am currently using Firefox's error console which I'm starting to find limiting. What ... |
I've got mssql 2005 running on my personal computer with a database I'd like to run some python scripts on. I'm looking for a way to do some really simple access on the data. I'd like to run some select statements, process the data and maybe have python save a text file with the results.
Unfortunately, even though I kn... | For your requirements of accessing MS SQL Server 2005 with Python, I'd recommend using the `pyodbc` library. It is a versatile and widely-used library that meets your criteria:
1. **Compatibility**: `pyodbc` works with various versions of SQL Server, including older versions like SQL Server 2005. It can also be used w... | 40,491 | [
{
"from": "human",
"value": "I've got mssql 2005 running on my personal computer with a database I'd like to run some python scripts on. I'm looking for a way to do some really simple access on the data. I'd like to run some select statements, process the data and maybe have python save a text file with the... |
In C++, on the stack, a simple variable is assigned a memory address so that we can use a pointer to contain this memory to point to it; then is a pointer also assigned a memory address?
If yes, can we have a pointer of pointers?
| Yes, in C++, a pointer is also assigned a memory address.
When you declare a simple variable, it is stored in memory at a specific address. A pointer is a variable that holds the address of another variable (in this case, the address of the simple variable). So, when you create a pointer to a variable, the pointer it... | 42,116 | [
{
"from": "human",
"value": "In C++, on the stack, a simple variable is assigned a memory address so that we can use a pointer to contain this memory to point to it; then is a pointer also assigned a memory address?\nIf yes, can we have a pointer of pointers?\n"
},
{
"from": "gpt",
"value": "Yes... |
I've installed passenger a little while back and when I restarted my mac tonight, Apache2 won't start.
Here is what I get.
Anyone have any ideas? Re-install Apache2?
dyld: Library not loaded: /usr/lib/libaprutil-1.0.dylib
Referenced from: /usr/sbin/httpd
Reason: no suitable image found. Did find:
/usr/lib/lib... | The error message you're seeing indicates that Apache is unable to load the `libaprutil-1.0.dylib` library due to an architecture mismatch. This issue often arises after system updates, especially when there are changes to the macOS architecture or updates to libraries that Apache depends on.
Here are some steps you c... | 40,182 | [
{
"from": "human",
"value": "I've installed passenger a little while back and when I restarted my mac tonight, Apache2 won't start.\nHere is what I get. \nAnyone have any ideas? Re-install Apache2?\ndyld: Library not loaded: /usr/lib/libaprutil-1.0.dylib\n Referenced from: /usr/sbin/httpd\n Reason: no sui... |
In a .NET 2.0 C# application I use the following code to detect the operating system platform:
string os_platform = System.Environment.OSVersion.Platform.ToString();
This returns "Win32NT". The problem is that it returns "Win32NT" even when running on Windows Vista 64-bit.
Is there any other method to know the correct... | To accurately detect whether your .NET 2.0 C# application is running on a 64-bit Windows operating system, you can check the `Environment.Is64BitOperatingSystem` property. However, this property is not available in .NET 2.0, so you'll need to use an alternative approach.
In .NET 2.0, one common method to determine if ... | 41,679 | [
{
"from": "human",
"value": "In a .NET 2.0 C# application I use the following code to detect the operating system platform:\nstring os_platform = System.Environment.OSVersion.Platform.ToString();\n\nThis returns \"Win32NT\". The problem is that it returns \"Win32NT\" even when running on Windows Vista 64-bi... |
In a java class I have two timers
TimerTask t1 = new TimerTask() {.. }
TimerTask t2 = new TimerTask() { ...}
Do t1 and t2 execute as two separate threads? How do you verify it?
| In Java, `TimerTask` does not create its own thread. Instead, when you schedule a `TimerTask` using a `Timer`, it will be executed by one of the threads from the `Timer`'s thread pool, which is single-threaded. This means that if you schedule multiple `TimerTask`s using the same `Timer` instance, they will be executed ... | 41,414 | [
{
"from": "human",
"value": "In a java class I have two timers\nTimerTask t1 = new TimerTask() {.. }\nTimerTask t2 = new TimerTask() { ...}\n\nDo t1 and t2 execute as two separate threads? How do you verify it?\n"
},
{
"from": "gpt",
"value": "In Java, `TimerTask` does not create its own thread.... |
I have an Events table whose goal is to store actions done by web site users. An action basically alters or create a new row in a table X. This will allow me to store an history of all actions done by a user. As such, Events contains:
a primary key column
a text to describe the event (ex: "posted a comment")
a discrim... | To map your `Events` table to the `Event` class in Fluent NHibernate, you can achieve this with a combination of a few strategies. Since you have multiple foreign keys pointing to different tables and only one of them will be set at a time, you can use a property to hold a reference to the actual event entity and imple... | 38,776 | [
{
"from": "human",
"value": "I have an Events table whose goal is to store actions done by web site users. An action basically alters or create a new row in a table X. This will allow me to store an history of all actions done by a user. As such, Events contains:\n\na primary key column\na text to describe ... |
Are there instances where switch(case) is is a good design choice (except for simplicity) over strategy or similar patterns...
| Yes, there are instances where using a `switch` statement (or `switch-case` construct) can be a suitable design choice over more complex design patterns like Strategy, especially when considering factors such as performance, readability, and context. Here are some scenarios where a `switch-case` can be advantageous:
1... | 40,243 | [
{
"from": "human",
"value": "Are there instances where switch(case) is is a good design choice (except for simplicity) over strategy or similar patterns... \n"
},
{
"from": "gpt",
"value": "Yes, there are instances where using a `switch` statement (or `switch-case` construct) can be a suitable d... |
When I create a graph after using range.copy and range.paste it leaves the paste range selected, and then when I create a graph a few lines later, it uses the selection as the first series in the plot. I can delete the series, but is there a more elegant way to do this? I tried
Set selection = nothing
but it won't ... | In Excel VBA, when you copy and paste a range, the resulting selection can indeed affect subsequent operations, like creating a graph. If you want to avoid the issue of having the unwanted selection act as an additional series in your plot, there are a few strategies you could employ:
### 1. Use the `Application.CutCo... | 39,040 | [
{
"from": "human",
"value": "When I create a graph after using range.copy and range.paste it leaves the paste range selected, and then when I create a graph a few lines later, it uses the selection as the first series in the plot. I can delete the series, but is there a more elegant way to do this? I trie... |
I would like to create dynamic urls that route to controller actions with an Id value. I've created the following route using a catch-all parameter
routes.MapRoute(
"RouteName",
"{id}/{*Url}",
new { controller = "Controller", action = ... | To achieve the desired URL structure (`http://website.com/fake/url/path/1`) while still being able to extract the ID as a parameter for your controller action in an ASP.NET MVC application, you can create a custom route that matches your desired URL pattern.
You can define a route that captures the ID as the last seg... | 43,092 | [
{
"from": "human",
"value": "I would like to create dynamic urls that route to controller actions with an Id value. I've created the following route using a catch-all parameter\nroutes.MapRoute(\n \"RouteName\", \n \"{id}/{*Url}\",\n ... |
I am developing a C# program, and i have one function that consumes too much CPU. I would like to know a way to control this by code (not with any external application) and restrict the percentage of CPU usage.
For example, if it uses 90% of the CPU usage, to make my app consume only a 20%, even if it becomes slower. ... | To control CPU usage within a C# application, you can create a mechanism that regulates the amount of work done within a specific time period, effectively throttling your CPU usage. Although you cannot directly set a CPU usage percentage for a process in C#, you can adjust the workload so that it uses a desired fractio... | 31,704 | [
{
"from": "human",
"value": "I am developing a C# program, and i have one function that consumes too much CPU. I would like to know a way to control this by code (not with any external application) and restrict the percentage of CPU usage. \nFor example, if it uses 90% of the CPU usage, to make my app consu... |
I'm dealing with a large group of entities that store locations. They are displayed on a map. I'm trying to come up with an efficient way to group near located entities into one entity when viewed from a higher location. So, for example, if you are very high, when looking down, you will see one entity that represents a... | What you're trying to accomplish can be efficiently handled using a spatial data structure combined with a clustering algorithm. Here are some suggested approaches:
### 1. **Quadtrees / K-D Trees**
These are spatial partitioning structures that can help with efficiently querying and rendering the groups of entities. Y... | 39,790 | [
{
"from": "human",
"value": "I'm dealing with a large group of entities that store locations. They are displayed on a map. I'm trying to come up with an efficient way to group near located entities into one entity when viewed from a higher location. So, for example, if you are very high, when looking down, ... |
I'm trying to add two folders to my eclipse project's classpath, let's say Folder A and Folder B. B is inside A. Whenever I add A to the classpath
<classpathentry kind="lib" path="/A"/>
it works just fine, but I need to be able to access the files in B as well. Whenever I try to add
<classpathentry kind="lib" path=... | In Eclipse, when adding folders to the classpath in a Java project, you cannot add a nested folder (like `A/B`) if the parent folder (`A`) has already been added as a library. This is because Eclipse treats `A` as a "library" and therefore it does not allow adding nested entries within it.
To solve this issue and incl... | 41,602 | [
{
"from": "human",
"value": "I'm trying to add two folders to my eclipse project's classpath, let's say Folder A and Folder B. B is inside A. Whenever I add A to the classpath\n<classpathentry kind=\"lib\" path=\"/A\"/>\n\nit works just fine, but I need to be able to access the files in B as well. Whenev... |
I have been noticing on my trackers that bots are visiting my site ALOT. Should I change or edit my robots.txt or change something? Not sure if thats good, because they are indexing or what?
| If you're noticing a significant amount of bot traffic to your site, it's important to analyze the type of bots that are visiting and their behavior. Here are a few steps you can take:
1. **Identify the Bots**: Determine if the bots are legitimate (e.g., search engine crawlers like Googlebot, Bingbot) or if they are m... | 42,703 | [
{
"from": "human",
"value": "I have been noticing on my trackers that bots are visiting my site ALOT. Should I change or edit my robots.txt or change something? Not sure if thats good, because they are indexing or what?\n"
},
{
"from": "gpt",
"value": "If you're noticing a significant amount of ... |
Is it possible to use e.g. SQLite with PowerBuilder? I need an embedded open source database (no additional costs).
| Yes, it is possible to use SQLite with PowerBuilder. SQLite is a lightweight, embedded, open-source database that can be used without additional costs, making it a suitable option for your requirements. To use SQLite with PowerBuilder, you'll typically follow these steps:
1. **Download SQLite**: Make sure you have the... | 40,490 | [
{
"from": "human",
"value": "Is it possible to use e.g. SQLite with PowerBuilder? I need an embedded open source database (no additional costs). \n"
},
{
"from": "gpt",
"value": "Yes, it is possible to use SQLite with PowerBuilder. SQLite is a lightweight, embedded, open-source database that ca... |
I am attempting to integrate an existing payment platform into my webshop. After making a succesful transaction, the payment platform sends a request to an URL in my application with the transaction ID included in the query parameters.
However, I need to do some post-processing like sending an order confirmation, etc. ... | It sounds like you're on the right track with using `session_id()` and `session_start()`. However, if `$_SESSION` is still empty after that, there are a few common issues to check:
1. **Session Storage Location**: Make sure that the session data is being stored in a location that is accessible to your script. If you'r... | 38,592 | [
{
"from": "human",
"value": "I am attempting to integrate an existing payment platform into my webshop. After making a succesful transaction, the payment platform sends a request to an URL in my application with the transaction ID included in the query parameters.\nHowever, I need to do some post-processing... |
I've got MS Access database with linked tables, whenever each table is linked to a table in the same SQL Server database. I have a query inside Access that joins two tables (in particular I'm updating a table based on another using a join).
The question is does Access "download" all the table data before doing a join? ... | When you're working with linked tables in Microsoft Access that point to tables in a SQL Server database, Access can be configured to send queries directly to SQL Server for execution, rather than downloading all the data to Access and processing the query locally. This is known as "pass-through" behavior.
For the spe... | 42,387 | [
{
"from": "human",
"value": "I've got MS Access database with linked tables, whenever each table is linked to a table in the same SQL Server database. I have a query inside Access that joins two tables (in particular I'm updating a table based on another using a join).\nThe question is does Access \"downloa... |
We need to see what methods/fields an object has in Javascript.
| In JavaScript, you can inspect the properties (including methods) of an object using several approaches. Here are some common methods to achieve this:
### 1. Using `console.log`
You can log the object directly to the console. If you're using a browser's developer tools, you can then expand the object to see its prope... | 38,255 | [
{
"from": "human",
"value": "We need to see what methods/fields an object has in Javascript.\n"
},
{
"from": "gpt",
"value": "In JavaScript, you can inspect the properties (including methods) of an object using several approaches. Here are some common methods to achieve this:\n\n### 1. Using `co... |
I moved a bunch of projects to Solution Folders to chop up our list of projects into manageable folders, now each of the folders projects are not in alphabetical order. This only occurs on machines other than my own. Any ideas how to alleviate this?
| If you're encountering issues with the ordering of Solution Folders and projects in Visual Studio where they appear in a different order on other machines, here are a few steps you can take to alleviate the issue:
1. **Verify Solution File Changes**:
- After moving projects into Solution Folders, ensure that the ch... | 40,876 | [
{
"from": "human",
"value": "I moved a bunch of projects to Solution Folders to chop up our list of projects into manageable folders, now each of the folders projects are not in alphabetical order. This only occurs on machines other than my own. Any ideas how to alleviate this?\n"
},
{
"from": "gpt"... |
For my next project, the two leading frontrunners are .NET and Java. The project is to take a directory (something like My Music in Windows) that contains directories and music files (MP3s initially, but eventually expanded to other music formats). For each file, it would allow you to play the file and view/edit its me... | It sounds like you have an interesting and engaging project ahead of you! Both .NET and Java have their strengths and weaknesses, but given your desire to get back into .NET and your intention to develop a cross-platform application, let’s delve into the aspects that will help you make your decision:
### .NET Framewor... | 33,257 | [
{
"from": "human",
"value": "For my next project, the two leading frontrunners are .NET and Java. The project is to take a directory (something like My Music in Windows) that contains directories and music files (MP3s initially, but eventually expanded to other music formats). For each file, it would allow ... |
When I'm running a simple Ruby script, what's the easiest way to dump an object's fields to the console?
I'm looking for something similar to PHP's print_r() that will work with arrays as well.
| In Ruby, the easiest way to dump an object's fields (including arrays) to the console is by using the `pp` method from the `pp` (pretty print) library, or you can use the built-in `p` method. Here's how you can use both of them:
1. **Using `pp` for pretty printing**:
First, you need to require the `pp` library. It ... | 43,334 | [
{
"from": "human",
"value": "When I'm running a simple Ruby script, what's the easiest way to dump an object's fields to the console? \nI'm looking for something similar to PHP's print_r() that will work with arrays as well.\n"
},
{
"from": "gpt",
"value": "In Ruby, the easiest way to dump an ob... |
I have to build an application based in an ActiveX library (MIL for Matrox framegrabbers).
The library should be already working, since it compiles and run a console application provided as example. (Yes, the console application is probably not using any ActiveX at all... I actually don't know)
The application will set... | Building an application using an ActiveX library in Visual C++ 6 (VC6) can seem daunting, especially if you are new to Visual C++ and ActiveX. Below, I'll outline a very basic tutorial that covers setting up a simple dialog with "OK" and "Cancel" buttons in VC6, and how to work with ActiveX controls.
### Step 1: Setti... | 39,488 | [
{
"from": "human",
"value": "I have to build an application based in an ActiveX library (MIL for Matrox framegrabbers).\nThe library should be already working, since it compiles and run a console application provided as example. (Yes, the console application is probably not using any ActiveX at all... I act... |
I have the following attributes in my DB.
statistic id, devicename, value, timestamp.
For a given statistic, I want to find the 2 most recent timestamps and corresopnding values for a every unique device.
I am trying stuff like
Trial 1)
select statistic, devicename, value, timestamp
from X_STATSVALUE
where statistic... | To achieve the goal of retrieving the two most recent timestamps and their corresponding values for each unique device for a given statistic, you can use a common table expression (CTE) or a subquery to first rank the rows for each device based on the timestamp. Then you can filter those results to get only the top two... | 43,448 | [
{
"from": "human",
"value": "I have the following attributes in my DB.\n\nstatistic id, devicename, value, timestamp.\n\nFor a given statistic, I want to find the 2 most recent timestamps and corresopnding values for a every unique device.\nI am trying stuff like \nTrial 1)\nselect statistic, devicename, va... |
Can someone explain how egg-info directories are tied to their respective modules? For example, I have the following:
/usr/local/lib/python2.5/site-packages/quodlibet/
/usr/local/lib/python2.5/site-packages/quodlibet-2.0.egg-info/
I'm assuming the egg-info directory is to make the corresponding module visible to setup... | The `egg-info` directories are indeed closely tied to Python packages and modules, particularly when it comes to setuptools and the older `easy_install` command. Let's break down how this works and how you can use it to develop your packages more easily.
### How Egg-info Directories Work
1. **Purpose of Egg-info**: T... | 34,584 | [
{
"from": "human",
"value": "Can someone explain how egg-info directories are tied to their respective modules? For example, I have the following:\n/usr/local/lib/python2.5/site-packages/quodlibet/\n/usr/local/lib/python2.5/site-packages/quodlibet-2.0.egg-info/\n\nI'm assuming the egg-info directory is to m... |
Or do I have to pinvoke native code?
I don't want the power status...well I do, but I don't want to poll it all the time and would rather have an event fire.
| If you want to receive notifications for changes in power status (such as when the device is plugged in or unplugged) without continuously polling the power status, you can utilize the Windows API to register for system power events. This can be done using P/Invoke in C#. Here's how to do it:
1. **Use the `RegisterPow... | 40,162 | [
{
"from": "human",
"value": "Or do I have to pinvoke native code?\nI don't want the power status...well I do, but I don't want to poll it all the time and would rather have an event fire. \n"
},
{
"from": "gpt",
"value": "If you want to receive notifications for changes in power status (such as... |
I am trying to setup a TFS Team Build and am new to MSBuild. I have a solution that contains a few projects (MyProject1, MyProject2, ..). I find that setting up the team build I could only select which solution should be built and when performing the build the build target for all the projects becomes the same and the ... | Yes, you can definitely specify individual projects to be built using MSBuild instead of building the entire solution. MSBuild is quite flexible, and allows you to build specific project files (`.csproj`, `.vbproj`, etc.) directly, as well as solutions (`.sln`).
### Building Individual Projects
If you want to build ... | 39,955 | [
{
"from": "human",
"value": "I am trying to setup a TFS Team Build and am new to MSBuild. I have a solution that contains a few projects (MyProject1, MyProject2, ..). I find that setting up the team build I could only select which solution should be built and when performing the build the build target for a... |
What is the best way to give the user feedback for a color selection?
I have a dialog with a "Select Color" push button which pops a QColorDialog. After the selection is made I want to show the user the color selected.
Usually I do this using a QLabel and changing it's background color in the palette. This method is cu... | Using a `QLabel` to show the selected color by changing its background color is indeed a common approach in Qt applications. However, if you're looking for a more standard and potentially cleaner way to provide feedback for a color selection, consider using a custom QWidget or QLabel that allows you to visually display... | 41,070 | [
{
"from": "human",
"value": "What is the best way to give the user feedback for a color selection?\nI have a dialog with a \"Select Color\" push button which pops a QColorDialog. After the selection is made I want to show the user the color selected.\nUsually I do this using a QLabel and changing it's backg... |
For those of you who are decent with subsonic!
TblNewsCollection col =
new Select().From(Tables.TblNews)
.InnerJoin(Tables.TblContent)
.Paged(currentPage, pageSize)
.OrderDesc(TblContent.Columns.PubDate)
.ExecuteAsCollection<TblNewsColl... | The issue you are encountering appears to stem from the way the parameter types are being handled in your SubSonic query, particularly with regard to the `Where` clause. When using `InnerJoin`, the SubSonic ORM may be attempting to convert the parameter type for the `Where` clause incorrectly, particularly if the datat... | 40,320 | [
{
"from": "human",
"value": "For those of you who are decent with subsonic!\n TblNewsCollection col =\n new Select().From(Tables.TblNews)\n .InnerJoin(Tables.TblContent)\n .Paged(currentPage, pageSize)\n .OrderDesc(TblContent.Columns.PubDate)\n ... |
I'm using some meta-programming to generate a bunch of methods in ruby like so:
class EmotionalObject
def self.mood( name, *details )
define_method(name) do
# ...
end
end
mood :happy, #...
mood :sad, #...
mood :ebuillent, #...
#...
end
I know that I can pass rdoc '-A mood' to get it to reco... | In Ruby, the documentation generated by RDoc has certain sections like "Attributes:" that are automatically populated based on the methods and attributes defined in the class. However, there isn't a built-in way to change the title of these sections directly. But you can use a workaround by overriding some RDoc behavio... | 40,536 | [
{
"from": "human",
"value": "I'm using some meta-programming to generate a bunch of methods in ruby like so:\nclass EmotionalObject\n def self.mood( name, *details )\n define_method(name) do\n # ...\n end\n end\n\n mood :happy, #...\n mood :sad, #...\n mood :ebuillent, #...\n #...\n end\n\n... |
What firefox plugins could you not live without, as relates to webdev?
My list would be:
DBGBar
Dom Inspector
Firebug
Firecookie
Google toolbar (useful for seo)
Live HTTP
ReloadEvery
TamperData
Web Developer
I am always on the lookout for new ones though, so I wonder if anyone knows of any great ones that I may have ... | As a web developer, having the right tools can significantly enhance your productivity and debugging capabilities. Here are some additional Firefox plugins (or extensions) that you might find useful, along with a brief description of each:
1. **React Developer Tools** - If you're working with React, this extension all... | 41,922 | [
{
"from": "human",
"value": "What firefox plugins could you not live without, as relates to webdev?\nMy list would be:\n\nDBGBar\nDom Inspector\nFirebug\nFirecookie\nGoogle toolbar (useful for seo)\nLive HTTP\nReloadEvery\nTamperData\nWeb Developer\n\nI am always on the lookout for new ones though, so I won... |
The Code Snippet is as follwos
namespace RecruiterWebService
{
/// <summary>
/// Summary description for Service1
/// </summary>
[WebService(Namespace = "http://tempuri.org/") ]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
public class **Service1** : S... | To address your questions regarding the web service you provided:
### 1. Changing the Name of the Web Service
To change the name of your web service from `Service1` to `Jobs`, you need to:
- Rename the class from `Service1` to `Jobs`.
- Update any associated references to `Service1` to `Jobs` in the client consuming... | 38,688 | [
{
"from": "human",
"value": "The Code Snippet is as follwos\nnamespace RecruiterWebService\n{\n /// <summary>\n /// Summary description for Service1\n /// </summary>\n\n\n [WebService(Namespace = \"http://tempuri.org/\") ]\n [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]\n [... |
I'm planning to write a aspx pages on Windows XP machine. I have IIS 7.0 enabled and virtual directory setup. Are aspx page developments allowed on Win XP?
| Yes, you can develop ASP.NET pages (ASPX) on a Windows XP machine, but there are some considerations to keep in mind:
1. **IIS Version**: Windows XP comes with IIS 5.1, which is not as robust as IIS 7.0 found in later versions of Windows (like Windows Vista and Windows 7). However, you can still develop and run ASP.NE... | 42,848 | [
{
"from": "human",
"value": "I'm planning to write a aspx pages on Windows XP machine. I have IIS 7.0 enabled and virtual directory setup. Are aspx page developments allowed on Win XP?\n"
},
{
"from": "gpt",
"value": "Yes, you can develop ASP.NET pages (ASPX) on a Windows XP machine, but there a... |
I have a problem where I cannot identify visitors to my intranet page because their browser is configured to use a proxy, even for the local intranet. I always see the proxy IP and no other details about the client. The SOE that my company uses has the proxy set up already for Firefox and Internet Explorer, and I canno... | When dealing with proxies, the challenge of identifying clients can be tricky, especially if the proxy doesn't pass through the original client's IP address. However, you can collect some information about the client using JavaScript on the browser side. Here's a general approach you might consider:
### Step 1: Gather... | 40,279 | [
{
"from": "human",
"value": "I have a problem where I cannot identify visitors to my intranet page because their browser is configured to use a proxy, even for the local intranet. I always see the proxy IP and no other details about the client. The SOE that my company uses has the proxy set up already for F... |
If i do jQuery(expr).change( function), then I can get an event function to fire when the user makes a change to the value.
Is it possible to get this to fire if it's changed programatically, ie if I call jQuery(expr).val("moo").
or if some Plain old JavaScript changes it's value?
Thanks for any help.
| In jQuery, the `.change()` event handler will not automatically fire when you change the value programmatically using `jQuery(expr).val("newValue")` or through plain JavaScript (e.g., `element.value = "newValue"`). The `change` event is only triggered when a user interacts with the element.
To manually trigger the `ch... | 43,850 | [
{
"from": "human",
"value": "If i do jQuery(expr).change( function), then I can get an event function to fire when the user makes a change to the value.\nIs it possible to get this to fire if it's changed programatically, ie if I call jQuery(expr).val(\"moo\").\nor if some Plain old JavaScript changes it's ... |
I have been programming for the last 3 years. When I program, I use to handle all known exceptions and alert the user gracefully. I have seen some code recently which has almost all methods wrapped inside try/catch blocks. The author says it is part of defensive programming. I wonder, is this really defensive programmi... | Wrapping almost all methods in try/catch blocks is a practice that can lead to several issues and may not align with the principles of defensive programming. Defensive programming aims to write code that anticipates potential problems and handles them gracefully, but it doesn't necessarily mean that every piece of code... | 41,847 | [
{
"from": "human",
"value": "I have been programming for the last 3 years. When I program, I use to handle all known exceptions and alert the user gracefully. I have seen some code recently which has almost all methods wrapped inside try/catch blocks. The author says it is part of defensive programming. I w... |
I am using ASP.NET 2.0 and VS 2005. I need to populate a grid on an update panel from an Oracle refcursor after the user clicks a button. I have an example from another project, but it is pretty complicated. Is there an easy way to display the data in a grid in an updatepanel? We don't want the data to be displayed... | Certainly, you can populate a grid on an UpdatePanel in ASP.NET 2.0 with data from an Oracle REF CURSOR after a user clicks a button. Here’s a simplified way to achieve this:
### Step-by-Step Implementation
1. **Add Required Assemblies**: Ensure you have the Oracle Data Provider for .NET (`Oracle.DataAccess.dll`) ref... | 38,408 | [
{
"from": "human",
"value": "I am using ASP.NET 2.0 and VS 2005. I need to populate a grid on an update panel from an Oracle refcursor after the user clicks a button. I have an example from another project, but it is pretty complicated. Is there an easy way to display the data in a grid in an updatepanel... |
can you set SO_RCVTIMEO and SO_SNDTIMEO socket options in boost asio?
If so how?
Note I know you can use timers instead, but I'd like to know about these socket options in particular.
| Yes, you can set `SO_RCVTIMEO` (receive timeout) and `SO_SNDTIMEO` (send timeout) socket options in Boost.Asio. These options correspond to socket-level timeouts for blocking operations.
To set these socket options, you can use the `boost::asio::ip::tcp::socket` or any other socket type in Boost.Asio and then apply th... | 41,488 | [
{
"from": "human",
"value": "can you set SO_RCVTIMEO and SO_SNDTIMEO socket options in boost asio?\nIf so how?\nNote I know you can use timers instead, but I'd like to know about these socket options in particular. \n"
},
{
"from": "gpt",
"value": "Yes, you can set `SO_RCVTIMEO` (receive timeout... |
I need to apply a style in code ike this:
TextBlock.Style = TryFindResource("MyStyle") as Style;
that will be updated dynamically when the resource dictionary is changed (i.e. skin is replaced at runtime). In other words I need the equivalent to using a dynamic resource like this:
<TextBlock Style="{DynamicResource My... | In WPF, when you want to apply a style dynamically in code that updates whenever the resource dictionary is changed (similar to how `DynamicResource` works in XAML), you can use the `DynamicResource` approach programmatically.
Here’s how to achieve that:
1. **Use `DynamicResource` in XAML**: This is the preferred app... | 43,084 | [
{
"from": "human",
"value": "I need to apply a style in code ike this:\nTextBlock.Style = TryFindResource(\"MyStyle\") as Style;\n\nthat will be updated dynamically when the resource dictionary is changed (i.e. skin is replaced at runtime). In other words I need the equivalent to using a dynamic resource li... |
Are there any good references for best practices for storing postal addresses in an RDBMS? It seems there are lots of tradeoffs that can be made and lots of pros and cons to each to be evaluated -- surely this has been done time and time again? Maybe someone has at least written done some lessons learned somewhere?
E... | Storing postal addresses in a relational database management system (RDBMS) is indeed a complex task due to the variability in address formats, the presence of international addresses, and the need for data normalization and validation. Below are some best practices, considerations, and references that might help you d... | 36,936 | [
{
"from": "human",
"value": "Are there any good references for best practices for storing postal addresses in an RDBMS? It seems there are lots of tradeoffs that can be made and lots of pros and cons to each to be evaluated -- surely this has been done time and time again? Maybe someone has at least writt... |
I have a table with a view_name field (varchar(256)) and I would like to use that field in an sql query.
Example :
TABLE university_members
id | type | view_name | count
1 | professors | view_professors | 0
2 | students | view_students2 | 0
3 | staff | view_staff4 | 0
And I would like to update all rows with some aggre... | Using dynamic SQL is the appropriate way to handle this scenario where you want to use the contents of a `view_name` field to perform an aggregate query. Since SQL Server doesn't allow direct variable substitution for object names (like views) in a static SQL query, you will need to use dynamic SQL to build and execute... | 42,386 | [
{
"from": "human",
"value": "I have a table with a view_name field (varchar(256)) and I would like to use that field in an sql query.\nExample :\nTABLE university_members\nid | type | view_name | count\n1 | professors | view_professors | 0\n2 | students | view_students2 | 0\n3 | staff | view_staff4 | 0\nAnd... |
My application (C++ using SQL Native Client with SQL Server 2000) is consistently finding its way into a hanging state. I believe this is because a transaction is left uncommitted someplace on a table and a SELECT query on that table, as a result of the open transaction, is blocking.
Unfortunately, I'm really having t... | When dealing with hanging transactions and blocking in SQL Server, it can be challenging to pinpoint where transactions are left uncommitted. Fortunately, SQL Server provides several tools to help identify blocking sessions and uncommitted transactions.
### Steps to Diagnose Uncommitted Transactions
1. **Use Activity... | 38,807 | [
{
"from": "human",
"value": "My application (C++ using SQL Native Client with SQL Server 2000) is consistently finding its way into a hanging state. I believe this is because a transaction is left uncommitted someplace on a table and a SELECT query on that table, as a result of the open transaction, is blo... |
Other than CouchDB and Native XML Databases (such as eXist), which databases can store and query un- and semi-structured data?
I've been handed lots of data in different formats (XML, JSON, YAML, CSV, some custom formats), which I need to merge and work with, but developing a schema in a relational database will be tim... | Certainly! There are several open-source databases that can handle unstructured and semi-structured data effectively. Here are some notable ones that you may want to consider:
1. **MongoDB**: A popular NoSQL document database that stores data in a JSON-like format (BSON). It allows for flexible schemas and supports po... | 40,722 | [
{
"from": "human",
"value": "Other than CouchDB and Native XML Databases (such as eXist), which databases can store and query un- and semi-structured data?\nI've been handed lots of data in different formats (XML, JSON, YAML, CSV, some custom formats), which I need to merge and work with, but developing a s... |
I have been trying to build eclipse fetched from CVS, but cannot find where to begin?
Usually it has been simple, make X, build X, but I am not finding it that easy with this. There are hundreds of plugins, and I cannot seem to find where to build them all and have the eclipse IDE.
Is there any tutorial that will step ... | Building Eclipse from CVS can indeed be a bit more complex than building typical applications due to its modular architecture and the number of plugins involved. Here’s a step-by-step guide to help you get started, along with some resources:
### Step-by-Step Guide to Build Eclipse from CVS
1. **Install Prerequisites*... | 35,447 | [
{
"from": "human",
"value": "I have been trying to build eclipse fetched from CVS, but cannot find where to begin?\nUsually it has been simple, make X, build X, but I am not finding it that easy with this. There are hundreds of plugins, and I cannot seem to find where to build them all and have the eclipse ... |
I'm refactoring some code I inherited from a long-gone developer, and I find this:
ImportExportForm l_Form = new ImportExportForm();
l_Form.InitializeLifetimeService();
l_Form.ShowDialog();
I've never seen or used the LifetimeService before, but from the little I've read, I don't understand why I would want to use it ... | In .NET, the `InitializeLifetimeService` method is used with objects that derive from `MarshalByRefObject`. This method is part of the remoting infrastructure, which was more relevant in earlier versions of .NET when remote method calls were more common.
By calling `l_Form.InitializeLifetimeService()`, the code is ens... | 41,995 | [
{
"from": "human",
"value": "I'm refactoring some code I inherited from a long-gone developer, and I find this:\nImportExportForm l_Form = new ImportExportForm();\nl_Form.InitializeLifetimeService();\nl_Form.ShowDialog();\n\nI've never seen or used the LifetimeService before, but from the little I've read, ... |
All the member variables and member functions in my class ClassA are static.
If a user is trying (by mistake) to create an object of this class, he receives a warning: "ClassA, local variable never referenced", because all the functions are static, so this object is never referenced. So, I want to prevent the user fro... | To prevent the instantiation of a class in C++, especially when all member functions are static, you can indeed create a private constructor. However, if you want to fully enforce the restriction on object creation and ensure that neither default construction, copy construction, nor assignment is possible, you should c... | 42,342 | [
{
"from": "human",
"value": "All the member variables and member functions in my class ClassA are static. \nIf a user is trying (by mistake) to create an object of this class, he receives a warning: \"ClassA, local variable never referenced\", because all the functions are static, so this object is never re... |
When you create a link to an executable file intended for download (like say update.exe), on a web page, IE7 gives the user the option to "Run" or "Save". I don't want users to be running the update file they should be downloading.
Is it possible to disable the "Save" option on the dialog the IE displays, or even force... | It is not possible to completely disable the "Save" option or force a download to occur without user intervention in Internet Explorer 7 or any other modern web browser. Browsers are designed with user security in mind, which includes allowing users to make informed choices about what they download and run.
However, y... | 43,466 | [
{
"from": "human",
"value": "When you create a link to an executable file intended for download (like say update.exe), on a web page, IE7 gives the user the option to \"Run\" or \"Save\". I don't want users to be running the update file they should be downloading.\nIs it possible to disable the \"Save\" opt... |
I wanted to deserialize an XML message containing an element that can be marked nil="true" into a class with a property of type int?. The only way I could get it to work was to write my own NullableInt type which implements IXmlSerializable. Is there a better way to do it?
I wrote up the full problem and the way I solv... | When dealing with XML deserialization in .NET, especially for nullable types, it's common to encounter issues when elements are marked as `nil="true"` in the XML. If you have a property of type `int?` (nullable int) in your class and want to handle this case directly during deserialization, you might not need to create... | 40,395 | [
{
"from": "human",
"value": "I wanted to deserialize an XML message containing an element that can be marked nil=\"true\" into a class with a property of type int?. The only way I could get it to work was to write my own NullableInt type which implements IXmlSerializable. Is there a better way to do it?\nI ... |
We have developers with knowledge of these languages - Ruby , Python, .Net or Java. We are developing an application which will mainly handle XML documents. Most of the work is to convert predefined XML files into database tables, providing mapping between XML documents through database, creating reports from database ... | Given the requirements you've described—handling XML documents, mapping data to database tables, and generating reports—a few factors can help determine which language might be the easiest and fastest to work with:
1. **XML Handling**: All four languages (Ruby, Python, .NET, and Java) have robust libraries for parsing... | 41,398 | [
{
"from": "human",
"value": "We have developers with knowledge of these languages - Ruby , Python, .Net or Java. We are developing an application which will mainly handle XML documents. Most of the work is to convert predefined XML files into database tables, providing mapping between XML documents through ... |
Is there any regular expression library that i can use with CString of vc6?
Opensource/Free library is needed
| In Visual C++ 6 (VC6), you can use various regular expression libraries, but finding one that directly supports `CString` can be a bit challenging since VC6 is quite old and modern libraries may not be compatible. Here are a few options for open-source or free libraries that you can consider:
1. **PCRE (Perl Compatibl... | 40,575 | [
{
"from": "human",
"value": "Is there any regular expression library that i can use with CString of vc6?\nOpensource/Free library is needed\n"
},
{
"from": "gpt",
"value": "In Visual C++ 6 (VC6), you can use various regular expression libraries, but finding one that directly supports `CString` c... |
Discrete mathematics (also finite mathematics) deals with topics such as logic, set theory, information theory, partially ordered sets, proofs, relations, and a number of other topics.
For other branches of mathematics, there are tools that support programming. For statistics, there is R and S that have many useful sta... | You're correct that discrete mathematics encompasses a wide range of topics, and while many programming languages can be used to implement discrete mathematics concepts, there are some languages and libraries specifically designed for or widely used in the context of discrete mathematics.
Here are a few options you mi... | 36,968 | [
{
"from": "human",
"value": "Discrete mathematics (also finite mathematics) deals with topics such as logic, set theory, information theory, partially ordered sets, proofs, relations, and a number of other topics.\nFor other branches of mathematics, there are tools that support programming. For statistics, ... |
I'm wondering if anyone has good resources to read or code to experiment for "autcomplete"
I would like to know what's the theory behind autocompletion, where to start what are the commonn mistakes etc.
I found fascinating the way products like Enso, Launchy, Google chrome and even tcsh perform their auto complete, I... | Autocomplete is an interesting and complex topic that combines aspects of computer science, linguistics, and user interface design. Here are some resources and concepts to help you understand the theory behind autocomplete systems and get you started on implementing one:
### Theory Behind Autocompletion
1. **Data Str... | 40,072 | [
{
"from": "human",
"value": "I'm wondering if anyone has good resources to read or code to experiment for \"autcomplete\" \nI would like to know what's the theory behind autocompletion, where to start what are the commonn mistakes etc. \nI found fascinating the way products like Enso, Launchy, Google chrome... |
what is the value of using IDictionary here?
| Using `IDictionary<TKey, TValue>` in your code can provide several benefits, especially when working with collections of key-value pairs. Here are some key advantages of utilizing `IDictionary<TKey, TValue>`:
1. **Key-Value Pair Storage**: `IDictionary` is specifically designed to store data as pairs of keys and value... | 41,020 | [
{
"from": "human",
"value": "what is the value of using IDictionary here?\n"
},
{
"from": "gpt",
"value": "Using `IDictionary<TKey, TValue>` in your code can provide several benefits, especially when working with collections of key-value pairs. Here are some key advantages of utilizing `IDiction... |
I want a pure virtual parent class to call a child implementation of a function like so:
class parent
{
public:
void Read() { //read stuff }
virtual void Process() = 0;
parent()
{
Read();
Process();
}
}
class child : public parent
{
public:
virtual void Process() { //process... | The issue you're encountering relates to how virtual functions work in C++. When you call a virtual function in the constructor of a base class, the derived class's implementation of that function will not be called because the derived class has not yet been fully constructed at that point.
Here's a breakdown of what'... | 41,038 | [
{
"from": "human",
"value": "I want a pure virtual parent class to call a child implementation of a function like so:\nclass parent\n{\n public:\n void Read() { //read stuff }\n virtual void Process() = 0;\n parent() \n {\n Read();\n Process();\n }\n}\nclass child : public pare... |
What do you suggest for Data Access layer? Using ORMs like Entity Framework and Hibernate OR Code Generators like Subsonic, .netTiers, T4, etc.?
| Choosing between Object-Relational Mappers (ORMs) like Entity Framework (EF) and Hibernate, and code generators such as Subsonic, .NET Tiers, T4, etc., depends on your project's specific needs, complexity, and team expertise. Here are some considerations for both approaches:
### Using ORMs (Entity Framework, Hibernate... | 36,977 | [
{
"from": "human",
"value": "What do you suggest for Data Access layer? Using ORMs like Entity Framework and Hibernate OR Code Generators like Subsonic, .netTiers, T4, etc.?\n"
},
{
"from": "gpt",
"value": "Choosing between Object-Relational Mappers (ORMs) like Entity Framework (EF) and Hibernat... |
I have an IList<T> that I need to sort, and I would rather not copy the list if possible. I've noticed that ArrayList has an Adapter static method that wraps the passed list without copying it, but this takes an IList and I have an IList<T>. Is it safe to cast from a System.Collections.Generic.IList<T> to a System.Co... | Yes, in .NET 2.0, it is generally safe to cast a `System.Collections.Generic.IList<T>` to `System.Collections.IList`. The `IList<T>` interface is designed to be compatible with the non-generic `IList` interface, and because `IList<T>` implements `IList`, you can use it in places where an `IList` is required.
Here's a... | 40,269 | [
{
"from": "human",
"value": "I have an IList<T> that I need to sort, and I would rather not copy the list if possible. I've noticed that ArrayList has an Adapter static method that wraps the passed list without copying it, but this takes an IList and I have an IList<T>. Is it safe to cast from a System.Co... |
Is there any difference between website and web application project? What if you are working on a project that is sort of hybrid of site and application? which project should you chose?
| Yes, there are differences between a website and a web application, though the lines between the two can sometimes blur, especially in hybrid projects. Here's a breakdown of the key differences:
### Website
- **Purpose**: A website is primarily informational, providing static content like text, images, and videos. Exa... | 41,337 | [
{
"from": "human",
"value": "Is there any difference between website and web application project? What if you are working on a project that is sort of hybrid of site and application? which project should you chose?\n"
},
{
"from": "gpt",
"value": "Yes, there are differences between a website and... |
Is it possible to do a simple count(*) query in a PHP script while another PHP script is doing insert...select... query?
The situation is that I need to create a table with ~1M or more rows from another table, and while inserting, I do not want the user feel the page is freezing, so I am trying to keep update the coun... | When using MySQL with PHP, especially with older versions like PHP 4.3 and MySQL 4.1, you will face certain limitations. Here are some suggestions to help you achieve your goal of inserting data into a table while keeping the user updated about the number of inserted rows:
### 1. Use Transactions
If you are inserting ... | 38,826 | [
{
"from": "human",
"value": "Is it possible to do a simple count(*) query in a PHP script while another PHP script is doing insert...select... query? \nThe situation is that I need to create a table with ~1M or more rows from another table, and while inserting, I do not want the user feel the page is freezi... |
I have the following code, I'm trying to get a table with 4 columns across. If I run out of columns, create a new row and make 4 more coumns. rinse. lather. repeat.
<tbody>
<%
int i = 0;
foreach (ItmXtnMultimedia multimedia in ViewData.Model.ItmXtnMultimedia) {
if (i%4 == 0 && i== 0)
{
%><tr><%
}
if (i%4 ==... | You can definitely simplify your code using helper methods or extension methods to manage the rows and columns more cleanly. Although ASP.NET MVC does not have built-in methods specifically for rendering tables in this way, you can create a helper method to clean up your view code.
Here's a potential approach using a ... | 40,977 | [
{
"from": "human",
"value": "I have the following code, I'm trying to get a table with 4 columns across. If I run out of columns, create a new row and make 4 more coumns. rinse. lather. repeat.\n<tbody>\n<%\nint i = 0;\nforeach (ItmXtnMultimedia multimedia in ViewData.Model.ItmXtnMultimedia) {\n if (i%4 ==... |
I have a plugin for OpenFire that creates and delivers a message to a user using
XMPPServer.getInstance().getMessageRouter().route(message)
What I would like to know is what happens to that message if the user is not online.
My goal is to only have the message delivered if the user is online, and fail or be routed t... | In OpenFire, when you use `XMPPServer.getInstance().getMessageRouter().route(message)`, the behavior of message delivery depends on the presence of the recipient user. Here's how it works:
1. **Online Users**: If the recipient user is online and connected to the XMPP server, the message will be routed to them immediat... | 31,174 | [
{
"from": "human",
"value": "I have a plugin for OpenFire that creates and delivers a message to a user using\nXMPPServer.getInstance().getMessageRouter().route(message)\n\nWhat I would like to know is what happens to that message if the user is not online. \nMy goal is to only have the message delivered i... |
I am begging to use jquery. I have the following call that works in IE7 but not FF 3.0.4. But if I change the null to {} it works fine. Is null not valid for this case and I just got lucky that it worked in IE or is this an error with jquery.
$.post("complexitybar.ashx?a=init&vc=" + validationCode, null, loadInitial... | The difference in behavior between Internet Explorer (IE) and Firefox (FF) in your jQuery `.post()` call may stem from how these browsers handle null as the second parameter of the function.
In jQuery, the second parameter of the `.post()` method is expected to be either an object containing data to be sent to the se... | 42,891 | [
{
"from": "human",
"value": "I am begging to use jquery. I have the following call that works in IE7 but not FF 3.0.4. But if I change the null to {} it works fine. Is null not valid for this case and I just got lucky that it worked in IE or is this an error with jquery.\n$.post(\"complexitybar.ashx?a=in... |
I added the following to my web.config to redirect the user to the login page if they aren't authenticated, but going to the URL does cause a redirect?
<location path="user/add">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>
I have setup forms... | It looks like you're trying to set up an authorization rule in your `web.config` to deny anonymous users access to the `/user/add` route and redirect them to the login page if they are not authenticated. However, you might not be seeing the expected behavior for a few reasons. Here are some things to check and configur... | 40,902 | [
{
"from": "human",
"value": "I added the following to my web.config to redirect the user to the login page if they aren't authenticated, but going to the URL does cause a redirect?\n <location path=\"user/add\">\n <system.web>\n <authorization>\n <deny users=\"?\" />\n </authorization>\n... |
Most of my programming experience has either been using forms (Windows Forms, or ASP.NET) or small embedded projects interfacing hardware. Recently I began going through some tutorials for iPhone development. I'm interested in learning Objective-C and the iPhone sdk.
I wanted to make a small frogger-like game to help ... | Creating a simple Frogger-like game is a fantastic way to learn iPhone development using Objective-C! You can definitely structure your game with a grid-based movement system, which is intuitive and easy to implement for a beginner. Below are some steps and tips to help you get started:
### 1. Set Up Your Project
Star... | 40,039 | [
{
"from": "human",
"value": "Most of my programming experience has either been using forms (Windows Forms, or ASP.NET) or small embedded projects interfacing hardware. Recently I began going through some tutorials for iPhone development. I'm interested in learning Objective-C and the iPhone sdk. \nI wanted ... |
How do i parse a text file in c#?
| Parsing a text file in C# can be done in several ways depending on the structure of the data in the file and what you want to accomplish. Below, I'll provide a simple example of how to read a text file line by line and parse its content. This will include basic file operations and string manipulation.
### Example: Par... | 34,577 | [
{
"from": "human",
"value": "How do i parse a text file in c#?\n"
},
{
"from": "gpt",
"value": "Parsing a text file in C# can be done in several ways depending on the structure of the data in the file and what you want to accomplish. Below, I'll provide a simple example of how to read a text fil... |
I have a silverlight control (View) which displays a list of items in a specified property of the datacontext (viewmodel).
What I need is for the scrollviewer in my control to scroll to the top or bottom depending on where the latest item has been added to the list. (It'll always be either the beginning or the end of t... | In Silverlight, you can achieve the desired scrolling behavior by utilizing the `CollectionChanged` event of the observable collection that your ViewModel uses to hold the list of items. Since Silverlight does not expose the `DataContextChanged` event, you need to directly monitor the collection for changes.
Here’s a ... | 38,917 | [
{
"from": "human",
"value": "I have a silverlight control (View) which displays a list of items in a specified property of the datacontext (viewmodel).\nWhat I need is for the scrollviewer in my control to scroll to the top or bottom depending on where the latest item has been added to the list. (It'll alwa... |
I'm trying to make a window that closes when you click outside it, and at the moment I'm looking into doing that by handling the WndProc function.
None of the messages I'm getting so far seem useful, but there are a few I don't understand at all. What do codes 0x0118, 0xC123, 0xC128 and 0xC12E represent?
| In the context of Windows programming, `WndProc` is the window procedure function that processes messages sent to a window. The messages you’re seeing, such as `0x0118` and others, are hex codes representing specific messages that Windows can send to the window.
### Understanding the Messages
1. **0x0118 (WM_SYSTIMER... | 40,759 | [
{
"from": "human",
"value": "I'm trying to make a window that closes when you click outside it, and at the moment I'm looking into doing that by handling the WndProc function.\nNone of the messages I'm getting so far seem useful, but there are a few I don't understand at all. What do codes 0x0118, 0xC123, ... |
say p.products_price equals 1
why does:
UPDATE products p
SET p.products_price = (1 + p.products_price)
WHERE p.products_id = 8
make p.products_price equals 3?
It is adding 1 to the price and then doing it all over again? I am trying to do something a little more complicated but when it didn't work I broke it down t... | The issue you are experiencing could be caused by a misunderstanding of the context in which the `UPDATE` statement is being evaluated. Let's analyze your scenario step by step.
Given that `p.products_price` is initially `1`, the query you provided is:
```sql
UPDATE products p
SET p.products_price = (1 + p.products_p... | 41,895 | [
{
"from": "human",
"value": "say p.products_price equals 1\nwhy does:\n\nUPDATE products p\nSET p.products_price = (1 + p.products_price)\nWHERE p.products_id = 8\n\n\nmake p.products_price equals 3?\nIt is adding 1 to the price and then doing it all over again? I am trying to do something a little more com... |
Since upgrading to 2008 I and many people here have noticed that randomly VS will no longer step in to code or jump over breakpoints. Its got to the stage where debugging is becoming a real chore. We are running SP1 but noticed problem on 2008 basic too.
In ref to Robert's question: We host WCF and Remoting services in... | It sounds like you're experiencing a frustrating issue with Visual Studio 2008 when debugging WCF and Remoting services. Debugging issues like breakpoints not being hit or not stepping into code can indeed be quite challenging, especially when working with services that handle multiple threads or processes.
Here are s... | 39,196 | [
{
"from": "human",
"value": "Since upgrading to 2008 I and many people here have noticed that randomly VS will no longer step in to code or jump over breakpoints. Its got to the stage where debugging is becoming a real chore. We are running SP1 but noticed problem on 2008 basic too.\nIn ref to Robert's ques... |
I am dabbling in the world of web services and I've been making a simple web service which mimics mathematical operations. Firstly it was simple, passing in two integers and then a binary operator would be applied to these (plus, minus etc) depending on the method called.
Then I decided to make things a little more com... | It sounds like you're working on a web service that utilizes partial classes to separate the data representation from the business logic. This is a common practice in many frameworks, but the success of your approach depends on the technology stack you are using and how you define and use these partial classes. Here's ... | 35,821 | [
{
"from": "human",
"value": "I am dabbling in the world of web services and I've been making a simple web service which mimics mathematical operations. Firstly it was simple, passing in two integers and then a binary operator would be applied to these (plus, minus etc) depending on the method called.\nThen ... |
Within an unordered list:
<li><span></span> The lazy dog.</li>
<li><span>AND</span> The lazy cat.</li>
<li><span>OR</span> The active goldfish.</li>
Adding a class or style attribute is permitted but padding the text and adding or changing tags is not allowed.
The page is rendering with Courier New.
Goal is to have te... | To achieve the desired alignment of the text after the `<span>` elements within your unordered list, you can utilize CSS. One effective approach is to use `display: flex` on the list items and apply some margins to the `<span>` elements to create space.
Here's how you can do it:
### HTML
```html
<ul>
<li><span><... | 42,039 | [
{
"from": "human",
"value": "Within an unordered list:\n<li><span></span> The lazy dog.</li>\n<li><span>AND</span> The lazy cat.</li>\n<li><span>OR</span> The active goldfish.</li>\n\nAdding a class or style attribute is permitted but padding the text and adding or changing tags is not allowed.\nThe page is... |
You know how Subversion stores a copy of every file it has checked-out in the hidden .svn folders? The website I'm building is pretty big (has over 1Gig of PDF files). These PDF files will very rarely change throughout the existence of the website.
I was wondering if there was a way of telling Subversion that it should... | In Subversion (SVN), every working copy indeed contains a `.svn` directory that stores metadata, including the full revision of each file. However, there isn't a built-in feature in Subversion to selectively avoid storing local copies of certain files while still being able to sync those files with the server.
Here ar... | 42,241 | [
{
"from": "human",
"value": "You know how Subversion stores a copy of every file it has checked-out in the hidden .svn folders? The website I'm building is pretty big (has over 1Gig of PDF files). These PDF files will very rarely change throughout the existence of the website.\nI was wondering if there was ... |
I want to refactor this mumbo jumbo of a method to make it more readible, it has way to many nested IF's for my liking.
How would you refactor this?
public static void HandleUploadedFile(string filename)
{
try
{
if(IsValidFileFormat(filename)
{
int folderID = GetFolderIDFromFilename(filename);
i... | You can improve the readability of the `HandleUploadedFile` method by reducing the nested `if` statements and making the code more modular. One approach is to extract each validation step into its own method that returns a boolean indicating success or failure. This will make it clearer what each part of the code is do... | 43,665 | [
{
"from": "human",
"value": "I want to refactor this mumbo jumbo of a method to make it more readible, it has way to many nested IF's for my liking.\nHow would you refactor this?\npublic static void HandleUploadedFile(string filename)\n{\n try\n {\n if(IsValidFileFormat(filename)\n {\n int fold... |
I'm trying to get a file with ant, using the get property. I'm running apache 2, and I can get the file from the indicated URL using wget and firefox, but ant gives me the following error:
[get] Error opening connection java.io.IOException:
Server returned HTTP response code: 503 for URL: http://localhost/jars/jai_cor... | The issue you are encountering with the Ant `<get>` task returning a 503 error when using `localhost` is likely related to how your local server handles requests. A 503 Service Unavailable error typically indicates that the server is temporarily unable to handle the request, but since you can access the file using `wge... | 41,740 | [
{
"from": "human",
"value": "I'm trying to get a file with ant, using the get property. I'm running apache 2, and I can get the file from the indicated URL using wget and firefox, but ant gives me the following error:\n[get] Error opening connection java.io.IOException:\n Server returned HTTP response code:... |
Assuming a largish template library with around 100 files containing around 100 templates with overall more than 200,000 lines of code. Some of the templates use multiple inheritance to make the usage of the library itself rather simple (i.e. inherit from some base templates and only having to implement certain busines... | Refactoring a large, complex template library into a more manageable and maintainable architecture is indeed a challenging but rewarding task. Here’s a structured approach to help you simplify the architecture, reduce complexity, and improve maintainability:
### 1. **Understand the Current State**
- **Documentation... | 38,922 | [
{
"from": "human",
"value": "Assuming a largish template library with around 100 files containing around 100 templates with overall more than 200,000 lines of code. Some of the templates use multiple inheritance to make the usage of the library itself rather simple (i.e. inherit from some base templates and... |
In most programming languages, dictionaries are preferred over hashtables.
What are the reasons behind that?
| In many programming languages, dictionaries are preferred over hashtables for several reasons, which generally relate to the distinctions in naming conventions, design choices, and features. Here are some of the key reasons:
1. **Abstraction and Interface**:
- **Higher-level abstraction**: Dictionaries often provid... | 40,640 | [
{
"from": "human",
"value": "In most programming languages, dictionaries are preferred over hashtables.\nWhat are the reasons behind that?\n"
},
{
"from": "gpt",
"value": "In many programming languages, dictionaries are preferred over hashtables for several reasons, which generally relate to the... |
I'm doing some research for my end of degree project: a multiplattform application developed using .net3.5 and mono2.0
I need some opinion about what you people think is the best Object Relational Mapping framework which will also run with mono.
Additionaly, any opinion about what ORM will work the best for my project... | For your project using .NET 3.5 and Mono 2.0, there are several Object Relational Mapping (ORM) frameworks that you can consider. Given your requirements, here are a few options that should work well with Mono and SQLite:
1. **NHibernate**:
- **Pros**: NHibernate is a mature and widely-used ORM for .NET. It provide... | 40,326 | [
{
"from": "human",
"value": "I'm doing some research for my end of degree project: a multiplattform application developed using .net3.5 and mono2.0 \nI need some opinion about what you people think is the best Object Relational Mapping framework which will also run with mono.\nAdditionaly, any opinion about... |
How can you get and set the hash or anchor part of an URL in pure Actionscript? When googling for a solution I've found explainations for doing it using JavaScript, but is it possible to get it without using JavaScript? (I'm using Actionscript 2, I may consider updating the code to AS 3, but it doesn't seem to be a qui... | In ActionScript 2 (AS2), you cannot directly manipulate the URL hash (also known as the anchor) since the Flash Player does not provide a built-in method to access the hash part of the URL. The hash is generally handled by the browser, and the Flash Player is sandboxed from these types of operations for security reason... | 41,611 | [
{
"from": "human",
"value": "How can you get and set the hash or anchor part of an URL in pure Actionscript? When googling for a solution I've found explainations for doing it using JavaScript, but is it possible to get it without using JavaScript? (I'm using Actionscript 2, I may consider updating the code... |
I'm writing a discovery test against the Cocoa API as I ramp up on all things Mac related. I'm currently trying to discover the best method for URL encoding a string. Using the Google toolbox for Mac I have a unit test that I intentionally cause a failure in:
NSString* expected = @"ab%%20c";
NSString* encoded = @"ab ... | It looks like you're encountering an issue with how special characters are being displayed in your assertion failure messages. The `%` character, when used in certain contexts, may be interpreted differently (for instance, in format strings), which could lead to confusion in the output.
To ensure that your assertion m... | 43,108 | [
{
"from": "human",
"value": "I'm writing a discovery test against the Cocoa API as I ramp up on all things Mac related. I'm currently trying to discover the best method for URL encoding a string. Using the Google toolbox for Mac I have a unit test that I intentionally cause a failure in:\n NSString* expecte... |
Which is faster? This:
bool isEqual = (MyObject1 is MyObject2)
Or this:
bool isEqual = ("blah" == "blah1")
It would be helpful to figure out which one is faster. Obviously, if you apply .ToUpper() to each side of the string comparison like programmers often do, that would require reallocating memory which affects per... | To compare the performance of the two expressions you've provided:
1. **Object Type Comparison**:
```csharp
bool isEqual = (MyObject1 is MyObject2);
```
This expression checks whether `MyObject1` is of the type `MyObject2`. The `is` operator in C# performs a type check at runtime. This check is typically ... | 42,592 | [
{
"from": "human",
"value": "Which is faster? This:\nbool isEqual = (MyObject1 is MyObject2)\n\nOr this:\nbool isEqual = (\"blah\" == \"blah1\")\n\nIt would be helpful to figure out which one is faster. Obviously, if you apply .ToUpper() to each side of the string comparison like programmers often do, that ... |
I am fairly new to MySQL and have a project in which I need to design a database that will store responses from an online questionnaire. Reports will need to be written from the data. Does anyone have any tips on what type of fields to use? The questions will either have a Yes No answer, a choice of 4 options from v... | Designing a database to store responses from an online questionnaire involves careful consideration of the types of questions you're asking and how you plan to analyze that data later on. Here’s a basic outline of how you might structure your database, along with some tips for defining your fields.
### Basic Structure... | 38,669 | [
{
"from": "human",
"value": "I am fairly new to MySQL and have a project in which I need to design a database that will store responses from an online questionnaire. Reports will need to be written from the data. Does anyone have any tips on what type of fields to use? The questions will either have a Ye... |
I would like to be able to use an ASP.NET view as an email template, complete with the <%= "hi there" %> syntax. Is there a way to invoke/setup this view engine in a standalone way?
| Yes, it is possible to use an ASP.NET view as an email template in a standalone way, allowing you to use the `<%= %>` syntax to insert dynamic content. This typically involves setting up a `Razor` view engine or using `WebForms` view engine depending on your project's setup. Below are steps on how to achieve this using... | 39,594 | [
{
"from": "human",
"value": "I would like to be able to use an ASP.NET view as an email template, complete with the <%= \"hi there\" %> syntax. Is there a way to invoke/setup this view engine in a standalone way?\n"
},
{
"from": "gpt",
"value": "Yes, it is possible to use an ASP.NET view as an ... |
Simple question, hopefully an easy way and just want to verify I'm doing it the correct / efficient way.
I have a class T object, which is typically put into a vector that is created in my main() function. It can be any kind of data, string, int, float.. etc. I'm reading from a file... which is inputted from the user... | Your approach to reading data from a file and inserting it into a vector seems to have some good elements, but there are a few issues and improvements that can be made to ensure it works correctly and efficiently. Let’s break down your code and offer some suggestions:
1. **File Opening**: When you open the file, you'r... | 37,191 | [
{
"from": "human",
"value": "Simple question, hopefully an easy way and just want to verify I'm doing it the correct / efficient way.\nI have a class T object, which is typically put into a vector that is created in my main() function. It can be any kind of data, string, int, float.. etc. I'm reading from... |
The application that I'm designing will retrieve and store content from a variety of disparate sources on a schedule. In some cases, the content will be retrieved based on a time interval (think stock quotes), and in other cases the content will be retrieved based on a custom schedule (MWF @ 2pm). Many of the process... | Designing an application that retrieves and stores content from various sources using workflows requires careful consideration of architecture, hosting, monitoring, and user interface requirements. Below is a high-level architecture and suggestions on how to achieve your objectives using the technologies you've mention... | 40,224 | [
{
"from": "human",
"value": "The application that I'm designing will retrieve and store content from a variety of disparate sources on a schedule. In some cases, the content will be retrieved based on a time interval (think stock quotes), and in other cases the content will be retrieved based on a custom s... |
Given a NxN matrix with 0s and 1s. Set every row that contains a 0 to all 0s and set every column that contains a 0 to all 0s.
For example
1 0 1 1 0
0 1 1 1 0
1 1 1 1 1
1 0 1 1 1
1 1 1 1 1
results in
0 0 0 0 0
0 0 0 0 0
0 0 1 1 0
0 0 0 0 0
0 0 1 1 0
A Microsoft Engineer told me that there is a solution that involves ... | To solve the problem of setting every row and column containing at least one `0` to all `0`s without using extra memory (other than a constant amount), we can use a clever approach. The idea is to use the first row and first column of the matrix to keep track of whether each row or column should be set to `0`.
Here is... | 40,516 | [
{
"from": "human",
"value": "Given a NxN matrix with 0s and 1s. Set every row that contains a 0 to all 0s and set every column that contains a 0 to all 0s.\nFor example\n1 0 1 1 0\n0 1 1 1 0\n1 1 1 1 1\n1 0 1 1 1\n1 1 1 1 1\n\nresults in\n0 0 0 0 0\n0 0 0 0 0\n0 0 1 1 0\n0 0 0 0 0\n0 0 1 1 0\n\nA Microsoft ... |
I have a Visual Source Safe repository, and some (not all, alas!) of my releases are identified by label. I know how to get by label from the command line, but:
Can I get by label from within Visual Studio?
I'm using Visual Studio 2003 (would the answer be different in other versions of Visual Studio?).
Thanks.
... | In Visual Studio 2003, you can work with Visual SourceSafe (VSS) and access labeled versions of your files, but the interface is somewhat limited compared to more modern version control systems.
Here’s how you can get a labeled version of your files within Visual Studio 2003:
1. **Open the SourceSafe Explorer**: Visu... | 43,083 | [
{
"from": "human",
"value": "I have a Visual Source Safe repository, and some (not all, alas!) of my releases are identified by label. I know how to get by label from the command line, but:\nCan I get by label from within Visual Studio? \nI'm using Visual Studio 2003 (would the answer be different in othe... |
I'm having some doubts on how to set up my SVN stuff.
First my situation:
Programmer working alone on most stuff, outside access not needed (yet).
I want:
A speedy SVN, preferably free.
Private
Backup friendly
Somewhat hassle free
A lot of storage.
I don't want:
To have problems transfering my data to another co... | Given your situation and requirements, let's evaluate your options for setting up version control with SVN or GIT:
### Option 1: Using SVN
1. **Local Installation on a Windows Machine**:
- **Pros**:
- Easy to set up using tools like VisualSVN Server, which provides a GUI for managing repositories.
- Fast... | 39,608 | [
{
"from": "human",
"value": "I'm having some doubts on how to set up my SVN stuff. \nFirst my situation:\nProgrammer working alone on most stuff, outside access not needed (yet).\nI want:\nA speedy SVN, preferably free. \nPrivate \nBackup friendly \nSomewhat hassle free \nA lot of storage. \n\nI don't want:... |
I have an annoying problem which I might be able to somehow circumvent, but on the other hand would much rather be on top of it and understand what exactly is going on, since it looks like this stuff is really here to stay.
Here's the story: I have a simple OpenGL app which works fine: never a major problem in compilin... | It sounds like you're encountering a fairly complex issue that likely involves mismatched runtimes and library dependencies when integrating the Boost library with the Spread Toolkit in your Visual Studio project. Let's break down the situation and see if we can clarify things and suggest possible solutions.
### 1. **... | 37,536 | [
{
"from": "human",
"value": "I have an annoying problem which I might be able to somehow circumvent, but on the other hand would much rather be on top of it and understand what exactly is going on, since it looks like this stuff is really here to stay.\nHere's the story: I have a simple OpenGL app which wor... |
I use BaseUserControl, where I have a method
private string typeName
{
get { return GetType().FullName; }
}
private object headOne
{
get { return Context.Items[typeName + "_Head"]; }
set { Context.Items[typeName + "_Head"] = value; }
}
public void Head(Action template)
{
if (headOne == null)
{
... | To achieve your goal of executing a `Request.Write()` call within a `<head>` tag in your ASP.NET application without creating a custom view engine, you can utilize a combination of server-side code and a mechanism for rendering the output at the right place in your page.
Given the existing setup with the `Head` method... | 42,012 | [
{
"from": "human",
"value": "I use BaseUserControl, where I have a method\nprivate string typeName\n{\n get { return GetType().FullName; }\n}\n\nprivate object headOne\n{\n get { return Context.Items[typeName + \"_Head\"]; }\n set { Context.Items[typeName + \"_Head\"] = value; }\n}\n\npublic void H... |
that one has been nagging me ever since I dabbled in web developpement; is there a way for this? Could I override that style and rely on some other mean to inform my users that that control can't be ineracted with?
My problem is that the graying of RadioButton- and CheckBox-Lists' labels makes them unreadable.
I could... | It seems you're trying to find a way to manage the visual styling of disabled controls, particularly for `RadioButtonList` and `CheckBoxList` in web development, without resorting to invasive changes. Indeed, the default styling for disabled inputs often makes them hard to read, which can be a concern for user accessib... | 39,640 | [
{
"from": "human",
"value": "that one has been nagging me ever since I dabbled in web developpement; is there a way for this? Could I override that style and rely on some other mean to inform my users that that control can't be ineracted with?\nMy problem is that the graying of RadioButton- and CheckBox-Li... |
I have a custom attribute which can be assigned to a class, [FooAttribute]. What I would like to do, from within the attribute, is determine which type has actually used me. e.g. If I have:
[FooAttribute]
public class Bar
{
}
In the code for FooAttribute, how can I determine it was Bar class that added me? I'm not spe... | In C#, attributes are metadata that can be applied to classes, methods, properties, and other entities. When you are creating a custom attribute and you want to get the type that is using the attribute, you cannot access that information directly within the constructor of the attribute itself, because attributes do not... | 42,103 | [
{
"from": "human",
"value": "I have a custom attribute which can be assigned to a class, [FooAttribute]. What I would like to do, from within the attribute, is determine which type has actually used me. e.g. If I have:\n[FooAttribute]\npublic class Bar\n{\n}\n\nIn the code for FooAttribute, how can I determ... |
My crappy web host did some upgrades the other day and some settings have gone awry, because looking at our company's wiki (MediaWiki), every quote is being escaped with a backslashes. It's not even just data which is being posted (i.e.: the articles) which are affected, but also the standard MediaWiki text. For exampl... | It sounds like you're dealing with an issue related to escaping of special characters in your MediaWiki installation. Given that disabling `magic_quotes_gpc` hasn't resolved the issue, it's likely that the escaping is being done at a different level, or the settings aren't being applied properly due to how the PHP envi... | 41,596 | [
{
"from": "human",
"value": "My crappy web host did some upgrades the other day and some settings have gone awry, because looking at our company's wiki (MediaWiki), every quote is being escaped with a backslashes. It's not even just data which is being posted (i.e.: the articles) which are affected, but als... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.