instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I was given an assignment to basically explain this. I have taken a quick look at the compiler documentation, and it seems to be a good place to start although it is quite extensive and I don't have much time. I'd like to know if I'd need to understand the C99 standards beforehand, or if there's another good source I c... | If you're looking to quickly understand the C language and its compiler documentation, you don't necessarily need to have a comprehensive understanding of the C99 standards beforehand, especially if you already grasp basic concepts like heaps, stacks, and linking. However, familiarity with the C language and its syntax... | 47,442 | [
{
"from": "human",
"value": "I was given an assignment to basically explain this. I have taken a quick look at the compiler documentation, and it seems to be a good place to start although it is quite extensive and I don't have much time. I'd like to know if I'd need to understand the C99 standards beforeha... |
I got this doubt while writing some code. Is 'bool' a basic datatype defined in the C++ standard or is it some sort of extension provided by the compiler ? I got this doubt because Win32 has 'BOOL' which is nothing but a typedef of long. Also what happens if I do something like this:
int i = true;
Is it "always" guara... | In C++, `bool` is a standard basic datatype defined by the C++ language itself, and it was introduced in the language with the original standard in 1998 (C++98). The `bool` type can take on one of two values: `true` or `false`.
On the other hand, `BOOL` in the Windows API (Win32) is a typedef that is generally define... | 49,753 | [
{
"from": "human",
"value": "I got this doubt while writing some code. Is 'bool' a basic datatype defined in the C++ standard or is it some sort of extension provided by the compiler ? I got this doubt because Win32 has 'BOOL' which is nothing but a typedef of long. Also what happens if I do something like ... |
The 1.0 spec for OpenCL just came out a few days ago (Spec is here) and I've just started to read through it. I want to know if it plays well with other high performance multiprocessing APIs like OpenMP (spec) and I want to know what I should learn. So, here are my basic questions:
If I am already using OpenMP, will... | It's great to hear that you're diving into OpenCL! Let's address your questions one by one.
### 1. OpenMP and OpenCL Compatibility
If you're already using OpenMP, it should not inherently break OpenCL, and vice versa. OpenMP is designed for CPU-based parallel programming, while OpenCL extends those capabilities to GPU... | 45,539 | [
{
"from": "human",
"value": "The 1.0 spec for OpenCL just came out a few days ago (Spec is here) and I've just started to read through it. I want to know if it plays well with other high performance multiprocessing APIs like OpenMP (spec) and I want to know what I should learn. So, here are my basic quest... |
I am designing the (G)UI of a program, and have stumbled across a problem; The program will convert a number into different units, and the layout of a unit been converted to is:
[Unit name (when clicked gives information)]
[Special status, if any]
[Output in textfield that can also be used for input (to convert to othe... | Designing a user interface that balances functionality and ease of use is definitely a challenge, and your considerations reflect a strong focus on user experience. Here are some thoughts on your proposed solutions and additional suggestions:
### 1. Click on Text Field to Copy to Clipboard
This is a common pattern in ... | 47,764 | [
{
"from": "human",
"value": "I am designing the (G)UI of a program, and have stumbled across a problem; The program will convert a number into different units, and the layout of a unit been converted to is:\n[Unit name (when clicked gives information)]\n[Special status, if any]\n[Output in textfield that ca... |
I have a relationship between two tables, authors and styles.
Every author is associated with a style, with the special case where an author doesn't have a style (IS NULL).
There's no problem in setting the reference to NULL, but there's a problem doing a query to select the authors and styles.
For example, the query: ... | If you're unable to use explicit `LEFT JOIN` syntax and still want to retrieve authors along with their associated styles (including those with NULL styles), you can modify your `SELECT` statement to use a `UNION`. The idea here is to perform two separate queries: one for authors with associated styles and another for ... | 49,397 | [
{
"from": "human",
"value": "I have a relationship between two tables, authors and styles.\nEvery author is associated with a style, with the special case where an author doesn't have a style (IS NULL).\nThere's no problem in setting the reference to NULL, but there's a problem doing a query to select the a... |
I am developing a MMC 3.0 snap-in. I have custom actions to be displayed in the right had side MMC action pane, which I have done using
ParentFormView.SelectionData.ActionsPaneItems.Add(CustomAction)
Things are working fine so far.
My problem is - Windows by default also paints actions such as 'View', 'New window fr... | To programmatically disable the default actions that appear in the MMC (Microsoft Management Console) Action Pane when your MMC snap-in loads, you can use the `IScopeItem` interface to modify the properties of the context in which your snap-in is displayed.
Here is a general approach you can take:
1. **Clear Default ... | 46,352 | [
{
"from": "human",
"value": "I am developing a MMC 3.0 snap-in. I have custom actions to be displayed in the right had side MMC action pane, which I have done using \nParentFormView.SelectionData.ActionsPaneItems.Add(CustomAction) \nThings are working fine so far. \nMy problem is - Windows by default also p... |
One of the nice feature of the Image control is that we can specified an Uri as the ImageSource and the image is automatically downloaded for us. This is great! However, the control doesn't seem to have a property indicating if the image loading is in progress or not.
Is there a property telling us the status (Download... | In many frameworks, including WPF (Windows Presentation Foundation) and Xamarin.Forms, the `Image` control does not directly expose a property that indicates the status of the image loading process (e.g., downloading, downloaded). However, you can manage this by using the `ImageSource` and event handlers or by leveragi... | 44,572 | [
{
"from": "human",
"value": "One of the nice feature of the Image control is that we can specified an Uri as the ImageSource and the image is automatically downloaded for us. This is great! However, the control doesn't seem to have a property indicating if the image loading is in progress or not.\nIs there ... |
I have following foreach-loop:
using System.IO;
//...
if (Directory.Exists(path))
{
foreach(string strFile in Directory.GetFiles(path, "*.txt"))
{
// do something, possibly delete the file named strFile
}
}
Could there be side effects when deleting files in the directory that is currently used f... | Yes, there can be side effects when deleting files in a `foreach` loop that iterates over a collection of files in the directory.
In your code, `Directory.GetFiles(path, "*.txt")` retrieves an array of file paths matching the specified pattern at the point in time when the method is called. This means that the `forea... | 49,177 | [
{
"from": "human",
"value": "I have following foreach-loop:\nusing System.IO;\n//... \nif (Directory.Exists(path))\n{\n foreach(string strFile in Directory.GetFiles(path, \"*.txt\"))\n {\n // do something, possibly delete the file named strFile\n }\n}\n\nCould there be side effects when de... |
Is the following possible in SQL Server 2000?
CREATE FUNCTION getItemType (@code varchar(18))
RETURNS int
AS
BEGIN
Declare @Type tinyint
Select @Type = case len(@code)
WHEN 12,14,17 THEN 1
WHEN 13,15,18 THEN 2
WHEN 8,10 THEN 3
ELSE 0
END
RETURN (@Type)
END
Thanks.
| Yes, your SQL function `getItemType` is almost correct for SQL Server 2000, but there are a couple of issues with the `CASE` statement that you need to address. In SQL Server, the `CASE` statement doesn't support multiple conditions in the `WHEN` clause like you have it. Instead, you need to use the `OR` operator to ac... | 47,662 | [
{
"from": "human",
"value": "Is the following possible in SQL Server 2000?\nCREATE FUNCTION getItemType (@code varchar(18))\nRETURNS int\nAS\nBEGIN\nDeclare @Type tinyint\nSelect @Type = case len(@code)\nWHEN 12,14,17 THEN 1\nWHEN 13,15,18 THEN 2\nWHEN 8,10 THEN 3\nELSE 0\nEND\nRETURN (@Type)\nEND\n\nThan... |
Can anyone explain the differences between Protocols and Categories in Objective-C? When do you use one over the other?
| In Objective-C, **Protocols** and **Categories** are both important features, but they serve different purposes and have distinct characteristics.
### Protocols
**Definition**: A Protocol is a list of methods that a class can choose to implement. It’s similar to an interface in languages like Java.
**Characteristics... | 48,310 | [
{
"from": "human",
"value": "Can anyone explain the differences between Protocols and Categories in Objective-C? When do you use one over the other?\n"
},
{
"from": "gpt",
"value": "In Objective-C, **Protocols** and **Categories** are both important features, but they serve different purposes an... |
So our scenario is this: We have multiple Sharepoint sites that are created dynamically on a "as requested" basis. Basically there's a new site for each new project. Now, for every site we want to add a search clause that says that only contents with a metadata tag value equal to the sitename should be found. Quick exa... | To achieve your goal of ensuring that documents are tagged with the correct "ProjectName" metadata value in SharePoint search, you can automate this process using a combination of workflows (or Power Automate), content types, and metadata settings, instead of relying solely on scopes which can be cumbersome to manage m... | 45,296 | [
{
"from": "human",
"value": "So our scenario is this: We have multiple Sharepoint sites that are created dynamically on a \"as requested\" basis. Basically there's a new site for each new project. Now, for every site we want to add a search clause that says that only contents with a metadata tag value equal... |
What ports do you need to open in a firewall to connect a remote Windows computer to a Microsoft Active Directory server domain behind that firewall?
| To connect a remote Windows computer to a Microsoft Active Directory domain, several ports need to be opened in the firewall to facilitate various services. Here are the key ports that should be opened:
1. **LDAP (Lightweight Directory Access Protocol)**:
- **TCP 389**: Used for LDAP directory services.
2. **LDAPS... | 47,394 | [
{
"from": "human",
"value": "What ports do you need to open in a firewall to connect a remote Windows computer to a Microsoft Active Directory server domain behind that firewall?\n"
},
{
"from": "gpt",
"value": "To connect a remote Windows computer to a Microsoft Active Directory domain, several... |
We have IIS6 running on a 64-bit Windows 2003 server with 32Gb physical RAM.
Due to some older 32-bit dependencies within our .NET 3.5 ASP.NET application, we are currently forced to run our IIS worker process in 32-Bit wow64 mode which I understand gives us access to 4Gb of memory for our worker process.
My question i... | When you run a 32-bit application, even in a web garden configuration with multiple worker processes (W3WP.exe instances), each worker process will still be constrained by the 4 GB memory limit imposed by the 32-bit addressing system. In a standard 32-bit environment, each process can access up to 2 GB of memory by def... | 47,493 | [
{
"from": "human",
"value": "We have IIS6 running on a 64-bit Windows 2003 server with 32Gb physical RAM.\nDue to some older 32-bit dependencies within our .NET 3.5 ASP.NET application, we are currently forced to run our IIS worker process in 32-Bit wow64 mode which I understand gives us access to 4Gb of me... |
I keep a JMS connection always open, because I have a MessageListener on it.
Is it a common need to worry about minimizing maintenance of applications with long lived JMS connections?
I was thinking something along the lines of try to recover from some possible common well known kinds of failure, like temporary conne... | Yes, it is common practice to consider the maintenance and reliability of applications that utilize long-lived JMS (Java Message Service) connections. Keeping a JMS connection open for a MessageListener can be convenient, but it does come with certain risks, especially in terms of connectivity and resource management. ... | 46,545 | [
{
"from": "human",
"value": "I keep a JMS connection always open, because I have a MessageListener on it. \nIs it a common need to worry about minimizing maintenance of applications with long lived JMS connections? \nI was thinking something along the lines of try to recover from some possible common well k... |
I distribute my application using a VS2008 install package, which normally works great. When I create new versions of the app, I go in and increment the Version property on the install package and verify the RemovePreviousVersions property is set to True.
This works just fine most of the time - I just run the install ... | This issue where the older version of your application still runs despite having installed a newer version can be frustrating. Here are some potential reasons for this behavior and steps you can take to troubleshoot and resolve the issue:
1. **Executable Path Issues**:
- Verify that the executable path for the inst... | 40,499 | [
{
"from": "human",
"value": "I distribute my application using a VS2008 install package, which normally works great. When I create new versions of the app, I go in and increment the Version property on the install package and verify the RemovePreviousVersions property is set to True.\nThis works just fine ... |
I'm trying to write a simple WCF Wrapper to load a SyndicationFeed as a client.
Contract
[ServiceContract]
public interface IFeedService
{
[OperationContract]
[WebGet(UriTemplate="")]
SyndicationFeed GetFeed();
}
Usage
using (var cf = new WebChannelFactory<IFeedService>(new Uri("http://channel9.msdn.com/Fe... | To create a WCF service that can fetch an arbitrary feed without appending the method name to the URL, you can use a combination of the `WebGet` attribute and a service operation that accepts a parameter for the feed URL. This allows you to call any feed by specifying the URL as an input parameter. Here's how you can i... | 45,907 | [
{
"from": "human",
"value": "I'm trying to write a simple WCF Wrapper to load a SyndicationFeed as a client.\nContract\n[ServiceContract]\npublic interface IFeedService\n{\n [OperationContract]\n [WebGet(UriTemplate=\"\")]\n SyndicationFeed GetFeed();\n}\n\nUsage\nusing (var cf = new WebChannelFact... |
I have an old Borland project which I would like to port to Visual Studio 2008. Is there a way to dump, in a human-readable format, the source file, compile options and dependency information from a .ide file?
I'd like something a bit more comprehensive than the 'Generate Makefile' option.
| Porting a Borland project to Visual Studio 2008 can indeed be challenging, especially if you're dealing with older project files like `.ide`. Unfortunately, the `.ide` file is a binary file, and directly reading it can be complex. However, there are a few ways to extract information from it.
### Here are some approach... | 47,246 | [
{
"from": "human",
"value": "I have an old Borland project which I would like to port to Visual Studio 2008. Is there a way to dump, in a human-readable format, the source file, compile options and dependency information from a .ide file?\nI'd like something a bit more comprehensive than the 'Generate Makef... |
I'm trying to make a proxy object in IronPython, which should dynamically present underlying structure. The proxy itself shouldn't have any functions and properties, I'm trying to catch all the calls in the runtime. Catching the function calls is easy, I just need to define getattr() function for my object, and check d... | Creating a dynamic proxy in IronPython (especially in version 1.x) that can differentiate between getting and setting properties can be quite challenging. Since IronPython 1.1.2 lacks some of the features that make this easier in later versions, you'll have to rely on the capabilities available at that time.
While th... | 44,542 | [
{
"from": "human",
"value": "I'm trying to make a proxy object in IronPython, which should dynamically present underlying structure. The proxy itself shouldn't have any functions and properties, I'm trying to catch all the calls in the runtime. Catching the function calls is easy, I just need to define geta... |
I've got a problem in that changing the way I'm doing Url Rewriting in an Asp.Net application has changed the IIS log files from looking like this:
/page/ 80 etc..
/page/anotherpage/ 80 etc...
to
default.aspx page=1 80 etc...
default.aspx page=2 80 etc...
I'm a bit stumped as to how this happened. Is there a setting I... | It sounds like the change in the URL rewriting mechanism in your ASP.NET application has affected how the URLs are logged in your IIS log files. Instead of the friendly URLs being logged, it appears that the underlying ASP.NET page parameters are being recorded instead.
### Troubleshooting Steps:
1. **Check URL Rewri... | 44,136 | [
{
"from": "human",
"value": "I've got a problem in that changing the way I'm doing Url Rewriting in an Asp.Net application has changed the IIS log files from looking like this:\n/page/ 80 etc..\n/page/anotherpage/ 80 etc...\nto\ndefault.aspx page=1 80 etc...\ndefault.aspx page=2 80 etc...\nI'm a bit stumped... |
I thought this was pretty straight forward but I don't get the same results as the tutorials I read. I have a button on an html page that calls a function in script tags. I also have a reference to the prototype.js file which I haven't even begun to implement yet. If I leave that reference in the page, my function call... | It looks like you're trying to create a simple button that calls a JavaScript function when clicked, but you're encountering issues with the presence of the Prototype.js library. This can happen if Prototype.js defines its own versions of certain functions or modifies the JavaScript environment in a way that causes con... | 46,771 | [
{
"from": "human",
"value": "I thought this was pretty straight forward but I don't get the same results as the tutorials I read. I have a button on an html page that calls a function in script tags. I also have a reference to the prototype.js file which I haven't even begun to implement yet. If I leave tha... |
I want some of the items to be bold depending on a property of an object i'm putting into the listbox.
I think you can do it with changing templates but can't seem to find an example.
Thanks!
| To make specific items in a ListBox bold depending on a property of the data object, you can utilize DataTemplates in WPF (Windows Presentation Foundation). Here's a simple example to demonstrate how to achieve this.
### Example Setup
1. **Create a Data Model**: First, define a simple class that represents the object... | 47,412 | [
{
"from": "human",
"value": "I want some of the items to be bold depending on a property of an object i'm putting into the listbox.\nI think you can do it with changing templates but can't seem to find an example.\nThanks!\n"
},
{
"from": "gpt",
"value": "To make specific items in a ListBox bold... |
I have a mouseenter and mouseleave event for a Panel control that changes the backcolor when the mouse enters and goes back to white when it leaves.
I have Label control within this panel as well but when the mouse enters the Label control, the mouseleave event for the panel fires.
This makes sense but how do I keep th... | To keep the backcolor of the Panel the same when the mouse is over the Panel or any of its child controls (like the Label), you can achieve this by handling the mouse events at the Panel level. You can do this by using the `MouseEnter` and `MouseLeave` events on the child controls (in this case, the Label) and setting ... | 44,167 | [
{
"from": "human",
"value": "I have a mouseenter and mouseleave event for a Panel control that changes the backcolor when the mouse enters and goes back to white when it leaves.\nI have Label control within this panel as well but when the mouse enters the Label control, the mouseleave event for the panel fi... |
i m trying to design a mmo game using python...
I have evaluated stackless and since it is not the general python and it is a fork, i dont want to use it
I am trying to chose between
pysage
candygram
dramatis
and
parley
any one try any of these libraries?
Thanks a lot for your responses
| Designing an MMO game is an ambitious project, and choosing the right libraries and frameworks is crucial for its success. Let's take a look at the libraries you've mentioned:
1. **PySage**: PySage is a Python library for creating games, particularly focused on networked multiplayer games. It provides functionality to... | 49,044 | [
{
"from": "human",
"value": "i m trying to design a mmo game using python...\nI have evaluated stackless and since it is not the general python and it is a fork, i dont want to use it\nI am trying to chose between\npysage\ncandygram\ndramatis\nand\nparley\nany one try any of these libraries?\nThanks a lot f... |
This is a simple question, but one I'm not finding much information for in the docs. When dealing with custom configuration sections, collections, elements, etc., when does the IsReadOnly setting actually mean "read only"?
With IsReadOnly returning True, I can still do things like MyBase.Item("property") = value;.
Are ... | The `IsReadOnly` property in custom configuration sections and collections in .NET primarily indicates whether the configuration section or collection can be modified after it has been populated with data from the configuration file. However, this can sometimes be a bit confusing due to how the configuration system wor... | 49,189 | [
{
"from": "human",
"value": "This is a simple question, but one I'm not finding much information for in the docs. When dealing with custom configuration sections, collections, elements, etc., when does the IsReadOnly setting actually mean \"read only\"?\nWith IsReadOnly returning True, I can still do things... |
I know I could have an attribute but that's more work than I want to go to... and not general enough.
I want to do something like
class Whotsit
{
private string testProp = "thingy";
public string TestProp
{
get { return testProp; }
set { testProp = value; }
}
}
...
Whotsit whotsit ... | If you want to retrieve the property name (e.g., "TestProp") using reflection based on an instance property value, there are a couple of approaches you can take. Given your scenario, where you want to extract the name of the property from its value, you can use the `GetProperties` method to iterate through the properti... | 49,398 | [
{
"from": "human",
"value": "I know I could have an attribute but that's more work than I want to go to... and not general enough.\nI want to do something like \nclass Whotsit\n{\n private string testProp = \"thingy\";\n\n public string TestProp \n {\n get { return testProp; }\n set {... |
I have made a flash gallery that loads images from an xml file and fades them in and out. However I have been asked to make it so they fade in from left to right (i.e. hiding a bit of image while slowly revealing the whole image). Code is below:
_root.onEnterFrame=function () {
var picLoaded = thisLoad... | To achieve a fade-in effect from left to right, you will need to modify how you display the images in your gallery. Instead of simply fading in the entire image, you will animate the x position of a mask or a container that reveals the image gradually from left to right.
Here’s a simplified approach to achieve this e... | 47,416 | [
{
"from": "human",
"value": "I have made a flash gallery that loads images from an xml file and fades them in and out. However I have been asked to make it so they fade in from left to right (i.e. hiding a bit of image while slowly revealing the whole image). Code is below:\n_root.onEnterFrame=function () {... |
I need to use FtpWebRequest to put a file in a FTP directory. Before the upload, I would first like to know if this file exists.
What method or property should I use to check if this file exists?
| To check if a file exists on an FTP server using `FtpWebRequest`, you can use the `FtpWebRequest` to issue a `LIST` command. This command will retrieve a list of files in the specified directory. By analyzing the returned list, you can determine whether the specific file exists.
Here’s a sample method to check if a fi... | 44,889 | [
{
"from": "human",
"value": "I need to use FtpWebRequest to put a file in a FTP directory. Before the upload, I would first like to know if this file exists. \nWhat method or property should I use to check if this file exists?\n"
},
{
"from": "gpt",
"value": "To check if a file exists on an FTP ... |
Are there any JAVA API's for polling a database.
Should be able to
a) Be able to get all the data from a table to start with.
b) Poll it every configurable minutes.
| Yes, there are several Java APIs and libraries that you can use to poll a database. Below are some common approaches and libraries that can help you achieve your requirements:
### 1. JDBC (Java Database Connectivity)
JDBC is the standard Java API for connecting to a database. You can use it to execute SQL queries to ... | 41,322 | [
{
"from": "human",
"value": "Are there any JAVA API's for polling a database.\nShould be able to\na) Be able to get all the data from a table to start with.\nb) Poll it every configurable minutes.\n"
},
{
"from": "gpt",
"value": "Yes, there are several Java APIs and libraries that you can use to... |
I'm giving my first steps on Python. I saw that we don't have switch case statement,
so I would you guys implement a text Menu in python?
Thanks
| Certainly! In Python, while there is no built-in `switch` or `case` statement like in some other languages, you can achieve similar functionality using `if-elif-else` statements, dictionaries, or by creating a class with methods.
Here's a simple example of how to implement a text menu using `if-elif-else` statements:
... | 45,507 | [
{
"from": "human",
"value": "I'm giving my first steps on Python. I saw that we don't have switch case statement,\nso I would you guys implement a text Menu in python?\nThanks\n"
},
{
"from": "gpt",
"value": "Certainly! In Python, while there is no built-in `switch` or `case` statement like in ... |
I am looking at the EAGLView files from the apple iphone sample code and I am trying to understand how EAGLViewDelegate protocol works.
Question:
How does this didResizeEAGLSurfaceForView function get called? I don't see any implementation of it?
EAGLView.h
@protocol EAGLViewDelegate <NSObject>
- (void) didResizeEAGLSu... | In the `EAGLView` class from the Apple iPhone sample code, the `didResizeEAGLSurfaceForView:` method is a part of the `EAGLViewDelegate` protocol that is intended to be called whenever the EAGL surface of the view is resized. The actual invocation of this method is likely to occur within the implementation of the `EAGL... | 48,068 | [
{
"from": "human",
"value": "I am looking at the EAGLView files from the apple iphone sample code and I am trying to understand how EAGLViewDelegate protocol works.\nQuestion:\nHow does this didResizeEAGLSurfaceForView function get called? I don't see any implementation of it?\nEAGLView.h\n@protocol EAGLVie... |
I have a class in which looking up an instance is expensive, so instances are cached:
class Foo
def self.find(id)
Rails.cache.fetch("Foo.#{id}") do
// some expensive lookup, like an HTTParty request, or a long SQL query
...
end
end
end
That works fine until Foos have related Foos:
class Foo
d... | To handle the caching of `Foo` instances while still being able to set instance variables for attributes like `@children`, you can utilize a few strategies.
### 1. Use Memoization with Instance Variables and Fetch from Cache
Instead of directly using `Rails.cache.fetch`, you can separate the caching mechanism from th... | 43,927 | [
{
"from": "human",
"value": "I have a class in which looking up an instance is expensive, so instances are cached:\nclass Foo\n def self.find(id)\n Rails.cache.fetch(\"Foo.#{id}\") do\n // some expensive lookup, like an HTTParty request, or a long SQL query\n ...\n end\n end\nend\n\nThat w... |
I am trying to port a WebForms app to Silverlight, this application is using the GDI Graphics class to draw polygons to a in-memory bitmap, it will then do pixel by pixel comparisons so I need access to the pixel buffer.
Example:
Graphics g = Graphics.FromImage(bmp);
g.FillClosedCurve(brush, points, FillMode.W... | Porting a WebForms application that relies heavily on GDI+ to a Silverlight application can present some challenges, especially when it comes to accessing pixel data. Silverlight (and WPF) does not directly expose a way to manipulate pixel data of rendered graphics in the same way GDI+ does.
However, there are a few ... | 47,342 | [
{
"from": "human",
"value": "I am trying to port a WebForms app to Silverlight, this application is using the GDI Graphics class to draw polygons to a in-memory bitmap, it will then do pixel by pixel comparisons so I need access to the pixel buffer.\nExample:\n\n Graphics g = Graphics.FromImage(bmp);\n ... |
How would you solve this problem?
You're scraping HTML of blogs. Some of the HTML of a blog is blog posts, some of it is formatting, sidebars, etc. You want to be able to tell what text in the HTML belongs to which post (i.e. a permalink) if any.
I know what you're thinking: You could just look at the RSS and ignore th... | To solve the problem of associating blog posts between the HTML scraped from the page and the corresponding entries in the RSS feed, you can follow a systematic approach. Here’s a step-by-step breakdown:
### Step 1: Pre-processing
1. **Extract HTML Content**: Use an HTML parser (like BeautifulSoup for Python) to extra... | 45,550 | [
{
"from": "human",
"value": "How would you solve this problem?\nYou're scraping HTML of blogs. Some of the HTML of a blog is blog posts, some of it is formatting, sidebars, etc. You want to be able to tell what text in the HTML belongs to which post (i.e. a permalink) if any.\nI know what you're thinking: Y... |
I have a CompositeDataBoundControl and im trying to add a ItemCommand to it, ala the System.Web.UI.WebControls.Repeater - so like a numpty, I just thought if I reflector'ed and added the code like so, it should work:
private static readonly object EventItemCommand = new object();
protected override bool OnBubbleEvent(... | To implement the `ItemCommand` event in your `CompositeDataBoundControl`, you need to ensure that the event is triggered appropriately when a command is issued. It sounds like you've got the structure in place, but let's clarify and ensure that the event is raised correctly when the command is invoked.
Here's a step-b... | 46,641 | [
{
"from": "human",
"value": "I have a CompositeDataBoundControl and im trying to add a ItemCommand to it, ala the System.Web.UI.WebControls.Repeater - so like a numpty, I just thought if I reflector'ed and added the code like so, it should work:\nprivate static readonly object EventItemCommand = new object(... |
I wrote a program using AutoIT to fetch information from a number of websites using Internet Explorer. AutoIT is capable of hiding the window so that it is not visible, however when I navigate to a new website on that hidden window I still get the IE navigation sounds (button click sound, etc.).
How can I disable the s... | To disable the sounds in Internet Explorer when using AutoIT, you can manipulate the Internet Explorer settings using the Windows registry. This method allows you to stop the navigation sounds specifically for Internet Explorer without affecting the system-wide sound settings.
Here's how you can do it in your AutoIT s... | 47,009 | [
{
"from": "human",
"value": "I wrote a program using AutoIT to fetch information from a number of websites using Internet Explorer. AutoIT is capable of hiding the window so that it is not visible, however when I navigate to a new website on that hidden window I still get the IE navigation sounds (button cl... |
I have a Linq-to-SQL data model that includes a type Party which is sub classed twice for Company and Individual. I am trying to bind two repeaters to Linq-to-SQL queries as follows
Dim oComp As IEnumerable(Of Company)
Dim oInd As IEnumerable(Of Individual)
oComp = From oP As Company In ERM.Parties _
... | The issue you're encountering stems from how LINQ-to-SQL generates the data models and how the data binding works with generics and inheritance. When you define your LINQ queries to return specific subclasses (`Company` and `Individual`), the resulting collections (`oComp` and `oInd`) are strongly typed to those subcla... | 46,943 | [
{
"from": "human",
"value": "I have a Linq-to-SQL data model that includes a type Party which is sub classed twice for Company and Individual. I am trying to bind two repeaters to Linq-to-SQL queries as follows \n Dim oComp As IEnumerable(Of Company)\n Dim oInd As IEnumerable(Of Individual)\n\n ... |
Duplicate post, see: When do you use the "this" keyword?
On almost every project I worked the "This" operator is used, when i start developing i was told that it is a good practice. is this really necessary does it gives you more readability?
| The `this` keyword in programming, particularly in languages like JavaScript, Java, C#, and others, is often used to refer to the current instance of a class or object. Whether or not to use `this` can depend on the context and the conventions of the codebase you are working in. Here are some points to consider regardi... | 48,476 | [
{
"from": "human",
"value": "Duplicate post, see: When do you use the \"this\" keyword?\n\nOn almost every project I worked the \"This\" operator is used, when i start developing i was told that it is a good practice. is this really necessary does it gives you more readability?\n"
},
{
"from": "gpt"... |
I understand how the implementation of dynamic binding works and also the difference between static and dynamic binding, I am just having trouble wrapping my brain around the definition of dynamic binding. Basically other than it is a run-time binding type.
| Dynamic binding, also known as late binding, refers to the process of resolving a function or method call at runtime rather than at compile time. This means that the method that gets executed is determined during program execution based on the actual object type, not the reference type.
Here’s a more detailed breakdo... | 42,040 | [
{
"from": "human",
"value": "I understand how the implementation of dynamic binding works and also the difference between static and dynamic binding, I am just having trouble wrapping my brain around the definition of dynamic binding. Basically other than it is a run-time binding type.\n"
},
{
"from... |
As I learn more about Computer Science, AI, and Neural Networks, I am continually amazed by the cool things a computer can do and learn. I've been fascinated by projects new and old, and I'm curios of the interesting projects/applications other SO users have run into.
| It's great to hear about your enthusiasm for computer science and AI! There are numerous interesting projects and applications in these fields that showcase the capabilities of computers and neural networks. Here are a few notable examples across various domains:
### 1. **Image Recognition and Generation**
- **GANs... | 43,418 | [
{
"from": "human",
"value": "As I learn more about Computer Science, AI, and Neural Networks, I am continually amazed by the cool things a computer can do and learn. I've been fascinated by projects new and old, and I'm curios of the interesting projects/applications other SO users have run into.\n"
},
... |
Can someone explain me the reason of overflow in variable a? Note that b is bigger than a.
static void Main(string[] args)
{
int i = 2;
long a = 1024 * 1024 * 1024 * i;
long b = 12345678901234567;
System.Console.WriteLine("{0}", a);
System.Console.WriteLine("{0}", b);
System.Console.Wr... | The overflow you're observing in the variable `a` is due to how integer multiplication and type conversions work in C#. Let's break down the expression that causes this overflow:
```csharp
long a = 1024 * 1024 * 1024 * i;
```
### 1. Integer Type Calculation
In C#, when you perform arithmetic operations on integers, t... | 48,407 | [
{
"from": "human",
"value": "Can someone explain me the reason of overflow in variable a? Note that b is bigger than a.\nstatic void Main(string[] args)\n{\n int i = 2; \n long a = 1024 * 1024 * 1024 * i;\n long b = 12345678901234567;\n System.Console.WriteLine(\"{0}\", a);\n System.C... |
Between Yahoo! UI Compressor, Dean Edwards Packer and jsmin, which produces better results, both in terms of resulting footprint and fewer errors when obfuscating.
| When comparing Yahoo! UI Compressor, Dean Edwards' Packer, and JSMin, it's essential to consider several factors including the output footprint, compatibility, and the likelihood of errors during obfuscation. Each tool has its strengths and weaknesses:
1. **Yahoo! UI Compressor**:
- **Footprint**: It tends to produ... | 47,387 | [
{
"from": "human",
"value": "Between Yahoo! UI Compressor, Dean Edwards Packer and jsmin, which produces better results, both in terms of resulting footprint and fewer errors when obfuscating.\n"
},
{
"from": "gpt",
"value": "When comparing Yahoo! UI Compressor, Dean Edwards' Packer, and JSMin, ... |
Simple code:
>>> set([2,2,1,2,2,2,3,3,5,1])
set([1, 2, 3, 5])
Ok, in the resulting sets there are no duplicates.
What if the object in the list are not int but are some defined by me?
What method does it check to understand if they are different? I implemented __eq__ and __cmp__ with some objects but set doesn't seems... | In Python, when you use a `set`, the uniqueness of the elements is determined not only by the `__eq__` method but also by the `__hash__` method of the objects. For an object to be used in a `set`, it must be hashable, which means that it must implement the `__hash__` method. Here’s how it works:
1. **Equality**: When ... | 44,524 | [
{
"from": "human",
"value": "Simple code:\n>>> set([2,2,1,2,2,2,3,3,5,1])\nset([1, 2, 3, 5])\n\nOk, in the resulting sets there are no duplicates.\nWhat if the object in the list are not int but are some defined by me?\nWhat method does it check to understand if they are different? I implemented __eq__ and ... |
I am wondering how to tell NHibernate to resolve dependencies on my POCO domain objects.
I figured out that methods like CalculateOrderTax should be in the Domain object because they encode domain specific business rules. But once I have two of those I am violating SRP.
It would be no problem to extract those methods ... | When working with NHibernate and Dependency Injection (DI), especially in scenarios where you want to follow the Single Responsibility Principle (SRP) and keep your domain objects clean, there are several approaches you can consider to resolve dependencies for your POCO (Plain Old CLR Objects) domain entities.
### 1. ... | 46,693 | [
{
"from": "human",
"value": "I am wondering how to tell NHibernate to resolve dependencies on my POCO domain objects.\nI figured out that methods like CalculateOrderTax should be in the Domain object because they encode domain specific business rules. But once I have two of those I am violating SRP. \nIt wo... |
Is there a website that lists all of the publicly available JQuery plugins?
Also, are these plugins usually open source or do some people charge you money to download them?
| Yes, there are several websites that list publicly available jQuery plugins. One of the most popular and comprehensive sources is the **jQuery Plugin Registry**, which was historically hosted on jQuery's official site. However, as of recent years, it may not be actively maintained, and many developers now turn to commu... | 49,928 | [
{
"from": "human",
"value": "Is there a website that lists all of the publicly available JQuery plugins? \nAlso, are these plugins usually open source or do some people charge you money to download them?\n"
},
{
"from": "gpt",
"value": "Yes, there are several websites that list publicly availabl... |
I have huge number of Word files I need to merge (join) into one file, and will be time consuming to use the Word merger (one by one). Have you experienced any tool that can handle this job?
| Yes, there are several tools and methods you can use to merge multiple Word files into a single document efficiently. Here are some options you can consider:
### 1. **Using Microsoft Word's Built-in Features (Batch Merge)**
If you have access to Microsoft Word, you can use the following method:
- Open a new Word docu... | 46,571 | [
{
"from": "human",
"value": "I have huge number of Word files I need to merge (join) into one file, and will be time consuming to use the Word merger (one by one). Have you experienced any tool that can handle this job?\n"
},
{
"from": "gpt",
"value": "Yes, there are several tools and methods yo... |
I am working on a compiler implementation and wish to check if the end of file has been reached?
I know that this can be done using the yywrap() function in the lex file, but the requirement is that we want if the EOF is explicitly defined as in the hex value 0x1a, then how do we reference that.
Example:
main()
{
... | To handle the detection of the EOF marker (0x1A) in your lexer/parser setup, you can leverage the lexer (like Lex or Flex) to recognize this character and report it as a syntax error when it appears in your source code.
Here is a step-by-step guide on how to implement this in your Flex (.l) file and how to manage it i... | 43,962 | [
{
"from": "human",
"value": "I am working on a compiler implementation and wish to check if the end of file has been reached? \nI know that this can be done using the yywrap() function in the lex file, but the requirement is that we want if the EOF is explicitly defined as in the hex value 0x1a, then how do... |
I was reading Jeff Atwood's blog on Behold WordPress, Destroyer of CPUs and saw that many people there considered 20 SQL Queries per page load to be a lot. What is the average amount of queries per page nowadays for a highly dynamic page with auto suggest, auto refreshing of data, customized pages, and the kitchen sin... | The number of SQL queries per page load can vary significantly depending on the complexity of the web application and the way the database is structured. For highly dynamic websites like Amazon, the number of SQL queries may be optimized, often being far less than what one might expect given the amount of data being di... | 48,393 | [
{
"from": "human",
"value": "I was reading Jeff Atwood's blog on Behold WordPress, Destroyer of CPUs and saw that many people there considered 20 SQL Queries per page load to be a lot. What is the average amount of queries per page nowadays for a highly dynamic page with auto suggest, auto refreshing of da... |
I'd like to make a simple html form where a person can upvote or downvote an item. However I don't like the default look of a <input type="submit"> . What other options do I have to send a POST request than a bulky, default button?
| You have several options for styling your HTML form to make the upvote and downvote buttons more visually appealing than the default `<input type="submit">`. Here are a few alternatives you can consider:
### 1. Using `<button>` Elements
You can use the `<button>` element, which is more flexible for styling with CSS co... | 47,177 | [
{
"from": "human",
"value": "I'd like to make a simple html form where a person can upvote or downvote an item. However I don't like the default look of a <input type=\"submit\"> . What other options do I have to send a POST request than a bulky, default button?\n"
},
{
"from": "gpt",
"value": "... |
I have the following simple button with an image as the template. The problem is that I want to change the image to a resource, instead of a content reference. I want to do this so I can share the DLL as a re-usable library, and it doesn't work well when I do that.
How do I tell the Image object to use an embedded ... | To use an embedded resource in a XAML file for a Button's image, you need to ensure that the image is properly marked as an embedded resource in your project. You can achieve this by setting the image's `Build Action` to `Resource` in the properties of the image file in Visual Studio.
Once you've done that, you can re... | 46,903 | [
{
"from": "human",
"value": "I have the following simple button with an image as the template. The problem is that I want to change the image to a resource, instead of a content reference. I want to do this so I can share the DLL as a re-usable library, and it doesn't work well when I do that. \nHow do I... |
I have been tasked with developing a solution that tracks changes to a database.
For updates I need to capture:
date of update
old value
new value
field affected
person doing change
record id
table record is in
For deletes:
date of delete
person doing delete
The title/description/id of record deleted. The tables I ... | Tracking changes in a database can be accomplished through various methods, and you've already identified some of the key options available. Let's explore them further, taking into consideration the constraints and requirements you've outlined:
### 1. Tracking Table Approach with Stored Procedures
You mentioned creat... | 46,327 | [
{
"from": "human",
"value": "I have been tasked with developing a solution that tracks changes to a database.\nFor updates I need to capture:\n\ndate of update\nold value\nnew value\nfield affected\nperson doing change\nrecord id\ntable record is in\n\nFor deletes:\n\ndate of delete\nperson doing delete\nTh... |
I know this isn't really what XPath is for but if I have a HashMap of XPath expressions to values how would I go about building an XML document. I've found dom-4j's
DocumentHelper.makeElement(branch, xpath) except it is incapable of creating attributes or indexing. Surely a library exists that can do this?
Map xMap = ... | Creating an XML document using XPath expressions stored in a HashMap, while incorporating attributes and indexing, requires a bit more manual handling, as the typical XPath use does not directly support the creation of XML structures.
However, you can achieve this with a combination of XML creation techniques and some... | 40,278 | [
{
"from": "human",
"value": "I know this isn't really what XPath is for but if I have a HashMap of XPath expressions to values how would I go about building an XML document. I've found dom-4j's \nDocumentHelper.makeElement(branch, xpath) except it is incapable of creating attributes or indexing. Surely a li... |
What is the difference between a Layer Backed View and a Layer Hosting View in Core Animation?
What are the steps to setting up each and when is it appropriate to use either type?
| In Core Animation, the differences between a Layer Backed View and a Layer Hosting View are essential to understand for efficient rendering and display of visual elements in iOS and macOS applications.
### Layer Backed View vs. Layer Hosting View
1. **Layer Backed View**:
- A Layer Backed View is a view that has i... | 45,452 | [
{
"from": "human",
"value": "What is the difference between a Layer Backed View and a Layer Hosting View in Core Animation? \nWhat are the steps to setting up each and when is it appropriate to use either type?\n"
},
{
"from": "gpt",
"value": "In Core Animation, the differences between a Layer B... |
We have a UI widget on our main UI that uses JavaScript to respond to scrolling events from the browser. The response to each scroll event is relatively expensive. A user can easily "queue" up a large set of scrolling events, while the first several are being processed and rendering within the widget.
The problem with ... | To effectively manage the expensive scrolling events and avoid getting stuck in "scroll processing purgatory," you can implement a throttling or debouncing mechanism combined with an approach to "catch up" to the latest scroll position. Here's a structured way to handle this:
### 1. **Throttle the Scroll Events**
You ... | 45,976 | [
{
"from": "human",
"value": "We have a UI widget on our main UI that uses JavaScript to respond to scrolling events from the browser. The response to each scroll event is relatively expensive. A user can easily \"queue\" up a large set of scrolling events, while the first several are being processed and ren... |
I have a web app which queries a Lucene index and it works just fine in a W2K3 server in my network. Now I got my azure code so I wanted to test the service uploading the app. In order to do that I had to install Vista (I did it in a Virtual machine) cause the Azure SDK won't install on an XP box.
I created my Cloud S... | The issue you're encountering relates to the security policies in Azure, especially when running code that interacts with the filesystem (like querying a Lucene index). When you run your application in Azure, it operates under a specific security context that imposes restrictions on certain operations.
Here are severa... | 44,648 | [
{
"from": "human",
"value": "I have a web app which queries a Lucene index and it works just fine in a W2K3 server in my network. Now I got my azure code so I wanted to test the service uploading the app. In order to do that I had to install Vista (I did it in a Virtual machine) cause the Azure SDK won't i... |
One example is described here. But the author apparently forgot to include the code for download.
Another example is shown here. However, this one doesn't quite work (as described in comments).
How do you do this correctly?
| It sounds like you're trying to implement a particular example or code that involves downloading something, but the references you provided lack the necessary code or instructions. While I don’t have access to the specific examples you mentioned, I can help you understand how to correctly implement a file download func... | 44,825 | [
{
"from": "human",
"value": "One example is described here. But the author apparently forgot to include the code for download.\nAnother example is shown here. However, this one doesn't quite work (as described in comments).\nHow do you do this correctly?\n"
},
{
"from": "gpt",
"value": "It sou... |
I have a string like "1234567890". Now I need to store/print out this with the following format,
123-456-7890
What is the best method to implement this in C?
Thanks for comments/answers.
| To format a string like "1234567890" into the format "123-456-7890" in C, you can use the `sprintf` function to format the output. Below is a simple implementation that demonstrates how to achieve this:
```c
#include <stdio.h>
int main() {
const char *original = "1234567890";
char formatted[15]; // Allocate e... | 46,942 | [
{
"from": "human",
"value": "I have a string like \"1234567890\". Now I need to store/print out this with the following format,\n 123-456-7890\nWhat is the best method to implement this in C?\nThanks for comments/answers.\n"
},
{
"from": "gpt",
"value": "To format a string li... |
The following code is implemented in Page_Load event to show SaveFileDialog to the user
string targetFileName = Request.PhysicalApplicationPath + "Reports\\TempReports\\FolderMasters" + Utility.GetRandomNumber() + ".pdf";
FileInfo file = new FileInfo(targetFileName);
// Clear the content of the response.
Response.Clea... | The code snippet you provided is meant to prompt the user with a file download dialog for a PDF file, allowing them to save it locally. However, you cannot directly capture the user response from the SaveFileDialog (i.e., whether the user clicks "Save" or "Cancel") when serving files through ASP.NET. The download dialo... | 45,572 | [
{
"from": "human",
"value": "The following code is implemented in Page_Load event to show SaveFileDialog to the user\nstring targetFileName = Request.PhysicalApplicationPath + \"Reports\\\\TempReports\\\\FolderMasters\" + Utility.GetRandomNumber() + \".pdf\";\n\nFileInfo file = new FileInfo(targetFileName);... |
I've noticed slight spacing differences in HTML rendering between these versions in Windows XP.
Is the box-model interpreted in a slight different manner?
| The box model in HTML/CSS refers to how elements are structured and how space is allocated around them. The rendering differences you observe on Windows XP can be attributed to several factors, including:
1. **Browser Differences**: Different browsers (e.g., Internet Explorer, Firefox, etc.) may implement the box mode... | 48,720 | [
{
"from": "human",
"value": "I've noticed slight spacing differences in HTML rendering between these versions in Windows XP.\nIs the box-model interpreted in a slight different manner?\n"
},
{
"from": "gpt",
"value": "The box model in HTML/CSS refers to how elements are structured and how space ... |
Is there any limitations to the WPF Document.Paragraph object when using the FlowDocument control?
I have the FlowDocument turning blank when I add a Paragraph that is more than 450 lines to the Paragraph. I could not locate anything within the MSDN documentation regarding max. lengths etc.
Any ideas why this would ha... | When using the `FlowDocument` control in WPF (Windows Presentation Foundation), there are a few considerations and potential limitations that could lead to the issue you are experiencing with a blank display when adding a `Paragraph` that exceeds a certain number of lines, such as 450.
### Potential Reasons for Blank ... | 46,893 | [
{
"from": "human",
"value": "Is there any limitations to the WPF Document.Paragraph object when using the FlowDocument control?\nI have the FlowDocument turning blank when I add a Paragraph that is more than 450 lines to the Paragraph. I could not locate anything within the MSDN documentation regarding max... |
So, I have the following rows in the DB:
1 | /users/
2 | /users/admin/
3 | /users/admin/*
4 | /users/admin/mike/
5 | /users/admin/steve/docs/
The input URL is /users/admin/steve/, and the goal is to find the URL match from the DB.
I want to return #3 as the correct row, since the wildcard "*" specifies that anything ca... | Your initial thoughts on how to approach the problem are solid, but we can streamline the process a bit for efficiency. Below is a more efficient method to find the correct row based on your input URL using a combination of SQL queries and processing logic:
### Efficient Approach:
1. **Check for Exact Match**: First,... | 45,120 | [
{
"from": "human",
"value": "So, I have the following rows in the DB:\n1 | /users/\n2 | /users/admin/\n3 | /users/admin/*\n4 | /users/admin/mike/\n5 | /users/admin/steve/docs/\nThe input URL is /users/admin/steve/, and the goal is to find the URL match from the DB.\nI want to return #3 as the correct row, s... |
Lets say I have a table in a sql server 2000 database called TransactionType:
CREATE TABLE [dbo].[TransactionType](
[ID] [int] NOT NULL,
[Description] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
CONSTRAINT [PK_TransactionType] PRIMARY KEY CLUSTERED
(
[ID] ASC
) ON [PRIMARY]
) ON [PRIMARY]... | You’ve identified a common challenge when working with enumerations mapped to database identifiers. When using enumerations, the risk arises that the IDs in the database may change, causing the enumeration in the application to become out of sync. Here are some design patterns and techniques that you can use to mitigat... | 44,761 | [
{
"from": "human",
"value": "Lets say I have a table in a sql server 2000 database called TransactionType:\nCREATE TABLE [dbo].[TransactionType](\n [ID] [int] NOT NULL,\n [Description] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,\n CONSTRAINT [PK_TransactionType] PRIMARY KEY CLUSTERED ... |
This is a sql newbie question.
Basically, I want an extra column to return with my select statement to number the rows.
I'm using mysql.
Eg:
select * from friends
David
Steve
Joe
What is the syntax to get:
1 David
2 Steve
3 Joe
| To add a column that numbers the rows in your SQL query result, you can use the `ROW_NUMBER()` function available in MySQL 8.0 and later. The basic syntax to achieve your desired output is as follows:
```sql
SELECT
ROW_NUMBER() OVER () AS row_num,
name
FROM
friends;
```
In this query:
- `ROW_NUMBER() O... | 48,081 | [
{
"from": "human",
"value": "This is a sql newbie question.\nBasically, I want an extra column to return with my select statement to number the rows.\nI'm using mysql.\nEg: \nselect * from friends\n\nDavid\nSteve\nJoe\n\nWhat is the syntax to get:\n1 David\n2 Steve\n3 Joe\n\n"
},
{
"from": "gpt"... |
For various reasons, I have a bunch of static resources all with the following naming format:
xxxxx?yyyyy
where the x's are regular letter chars, and the y's numbers 0-9.
Apache is truncating the filename in the GET request at the "?" - as this is traditionally used to delinate query params - and thus reporting the fo... | To resolve the issue with Apache interpreting the question mark (`?`) in your filenames as the beginning of query parameters, you can configure your Apache server to allow the question mark in the filenames. Here are some methods to accomplish this:
### 1. Use URL Encoding
The simplest solution is to URL encode the `?... | 47,114 | [
{
"from": "human",
"value": "For various reasons, I have a bunch of static resources all with the following naming format:\nxxxxx?yyyyy\nwhere the x's are regular letter chars, and the y's numbers 0-9. \nApache is truncating the filename in the GET request at the \"?\" - as this is traditionally used to del... |
I'm trying to display a caret (^) in math mode in LaTeX to represent the exclusive or operation implemented in the "C languages". By default, ^ is for creating a superscript in math mode. The closest I can seem to get is by using \wedge, which isn't the same.
| In LaTeX, to display a caret (^) in math mode without it being interpreted as a superscript, you can use the `\textcircumflex` command from the `amsmath` package or you can use the `\text` command to insert it as text within math mode. Here are a couple of methods you can use:
1. **Using `\textcircumflex`**:
```lat... | 47,097 | [
{
"from": "human",
"value": "I'm trying to display a caret (^) in math mode in LaTeX to represent the exclusive or operation implemented in the \"C languages\". By default, ^ is for creating a superscript in math mode. The closest I can seem to get is by using \\wedge, which isn't the same.\n"
},
{
... |
.NET Framework 3.5 comes with all the LINQ goodies, and also includes predefined generic Func and Action delegates. They are generic for up to 4 arguments. I am writing a C++/CLI project that (unfortunately) uses VS 2005 and must only rely on the standard 2.0 assembly set (so no System.Core).
I tried defining my own ge... | In .NET Framework 2.0, generic delegates like `Func` and `Action` are not available, as they were introduced in .NET Framework 3.5 with the System.Core assembly. However, if you're developing a C++/CLI project targeting .NET Framework 2.0 and you need to define your own generic delegates, you'll need to ensure that you... | 46,348 | [
{
"from": "human",
"value": ".NET Framework 3.5 comes with all the LINQ goodies, and also includes predefined generic Func and Action delegates. They are generic for up to 4 arguments. I am writing a C++/CLI project that (unfortunately) uses VS 2005 and must only rely on the standard 2.0 assembly set (so no... |
"Fatal error: Allowed memory size of 31457280 bytes exhausted (tried to allocate 9828 bytes)".
This is the error i get but I am only trying to upload a 1mb image. I have increased the memory limit in php.ini and the execution time. I am trying this on a local MAMP server, on a Mac using firefox. This going to be for an... | It sounds like you encountered a memory exhaustion issue while trying to upload and process an image using PHP. In your scenario, you mentioned that the allowed memory size was exhausted even though you were only uploading a 1 MB image. There are a few considerations to keep in mind when dealing with memory limits in P... | 45,832 | [
{
"from": "human",
"value": "\"Fatal error: Allowed memory size of 31457280 bytes exhausted (tried to allocate 9828 bytes)\".\nThis is the error i get but I am only trying to upload a 1mb image. I have increased the memory limit in php.ini and the execution time. I am trying this on a local MAMP server, on ... |
I use ReturnOfSmartPart on WSS3 to display a ASCX in Sharepoint as a web part. This works beautifully.
The only problem is that the AjaxSmartPart seems to be using the Debug mode javascript (the scripts are close to 1MB!)
How can I ensure that the AjaxSmartPart only uses the Release mode java scripts?
Note:
I have Pub... | To ensure that the `AjaxSmartPart` in SharePoint is using the release mode JavaScript files instead of the debug mode ones, you can try the following steps:
### 1. Verify Web.Config Settings
Ensure that the `Debug` attribute in your `web.config` file is indeed set to `false` and that you have published your ASCX contr... | 44,796 | [
{
"from": "human",
"value": "I use ReturnOfSmartPart on WSS3 to display a ASCX in Sharepoint as a web part. This works beautifully.\nThe only problem is that the AjaxSmartPart seems to be using the Debug mode javascript (the scripts are close to 1MB!)\nHow can I ensure that the AjaxSmartPart only uses the R... |
I have strange problem with sharepoint and ajax functionality. We have an UpdatePanel placed inside webpart. When partial postback occurs, page title gets missing.
We have found that temporary partial solution is to write title element into one line and not use any spaces or controls inside it..not even a literal contr... | The issue you're encountering with the page title disappearing during an UpdatePanel partial postback in SharePoint is relatively common. This behavior occurs because the UpdatePanel only refreshes certain parts of the page, and the title tag is not included in the portion that gets updated.
Here are some potential so... | 43,056 | [
{
"from": "human",
"value": "I have strange problem with sharepoint and ajax functionality. We have an UpdatePanel placed inside webpart. When partial postback occurs, page title gets missing.\nWe have found that temporary partial solution is to write title element into one line and not use any spaces or co... |
How might a person simulate firing the HttpSessionListener.sessionDestroyed object in a session listener?
Is just setting the Tomcat session timeout to 1 and then waiting the only way?
| Simulating the `HttpSessionListener.sessionDestroyed` event can indeed be done by waiting for a session to timeout, which is typically how sessions are designed to be terminated in a web application. However, there are a few alternative approaches that you might consider to trigger this event without having to wait for... | 47,854 | [
{
"from": "human",
"value": "How might a person simulate firing the HttpSessionListener.sessionDestroyed object in a session listener?\nIs just setting the Tomcat session timeout to 1 and then waiting the only way? \n"
},
{
"from": "gpt",
"value": "Simulating the `HttpSessionListener.sessionDes... |
What is the best way to design a user login mechanism using Java? What are the best practices to be followed to architect a secure and robust login mechanism?
What is the difference between JAAS, JNDI and GSSAPI? How do you decide which one to choose?
| Designing a secure and robust user login mechanism in Java requires a combination of best practices, appropriate technologies, and an understanding of user authentication concepts. Below are key considerations for architecting a login mechanism:
### Best Practices for Designing a User Login Mechanism
1. **Use Strong ... | 44,836 | [
{
"from": "human",
"value": "What is the best way to design a user login mechanism using Java? What are the best practices to be followed to architect a secure and robust login mechanism? \nWhat is the difference between JAAS, JNDI and GSSAPI? How do you decide which one to choose?\n"
},
{
"from": "... |
I need to use lists for my program and needed to decide if I use std::vector or std::list.
The problem with vector is that there is no remove method and with list that there is no operator []. So I decided to write my own class extending std::list and overloading the [] operator.
My code looks like this:
#include <list... | The issue you're encountering with the linker error is likely related to the way C++ handles templates. Template classes and functions must be defined in the same translation unit where they are instantiated. This is because the compiler needs to see the complete definition of the template to generate the appropriate c... | 48,091 | [
{
"from": "human",
"value": "I need to use lists for my program and needed to decide if I use std::vector or std::list.\nThe problem with vector is that there is no remove method and with list that there is no operator []. So I decided to write my own class extending std::list and overloading the [] operato... |
I was reading the Math.random() javadoc and saw that random is only psuedorandom.
Is there a library (specifically java) that generates random numbers according to random variables like environmental temperature, CPU temperature/voltage, or anything like that?
| In Java, generating random numbers based on environmental variables (like temperature or CPU metrics) typically requires access to system or environmental data that isn't inherently available through the standard libraries. The `Math.random()` method provides pseudorandom numbers, which are not based on any external en... | 47,562 | [
{
"from": "human",
"value": "I was reading the Math.random() javadoc and saw that random is only psuedorandom. \nIs there a library (specifically java) that generates random numbers according to random variables like environmental temperature, CPU temperature/voltage, or anything like that?\n"
},
{
... |
I've trouble getting my components to update when the params has changed:
package mycompany
{
import flash.events.Event;
import mx.events.SliderEvent;
import mx.controls.HSlider;
import mx.controls.sliderClasses.Slider;
public class FromToSlider extends HSlider
{
/* from: */
... | It looks like your `FromToSlider` component is not updating the slider thumbs properly when you set the `from` and `to` properties. The issue stems from the fact that while you are updating the `values` array when you set these properties, you're not explicitly informing the slider that it needs to redraw itself or upd... | 46,791 | [
{
"from": "human",
"value": "I've trouble getting my components to update when the params has changed:\npackage mycompany\n{\n\n import flash.events.Event;\n import mx.events.SliderEvent;\n import mx.controls.HSlider;\n import mx.controls.sliderClasses.Slider;\n\n public class FromToSlider ex... |
As the title suggests. I want to be able to change the label of a single field in the admin application. I'm aware of the Form.field attribute, but how do I get my Model or ModelAdmin to pass along that information?
| To change the label of a single field in the Django admin application, you can achieve this by overriding the `get_fieldsets` method in your `ModelAdmin` class. This allows you to customize how fields are displayed, including changing the labels.
Here's a step-by-step guide on how to do this:
1. **Import Necessary Mo... | 45,282 | [
{
"from": "human",
"value": "As the title suggests. I want to be able to change the label of a single field in the admin application. I'm aware of the Form.field attribute, but how do I get my Model or ModelAdmin to pass along that information?\n"
},
{
"from": "gpt",
"value": "To change the labe... |
the title sums it up really. Using the standalone exiftool program to dump all image metadata to a console I can see a line
Color Space Data : RGB
It looks like this is taken from the ICC-header
I want to get the same data programatically in java. I've tried the drew noakes library and the Sanselan library, but neither... | To extract the "Color Space Data" (like "RGB") from an image in Java, you can use the Apache Commons Imaging library (formerly known as Sanselan) or the Metadata Extractor library, which is often more suited for reading EXIF metadata.
Here's how you can accomplish this using the Metadata Extractor library:
### Step 1... | 45,801 | [
{
"from": "human",
"value": "the title sums it up really. Using the standalone exiftool program to dump all image metadata to a console I can see a line\nColor Space Data : RGB\nIt looks like this is taken from the ICC-header\nI want to get the same data programatically in java. I've tried the drew noakes l... |
I have an xml string
<grandparent>
<parent>
<child>dave</child>
<child>laurie</child>
<child>gabrielle</child>
</parent>
</grandparrent>
What I want to get is the data raw xml that's inside the parent.
I'm using MSXML
iXMLElm->get_xml(&bStr);
is returning
<parent>
<child>dave</child>
... | To extract the inner XML content (i.e., the child elements) of an XML node using MSXML in C++, you can use the `selectNodes` or `selectSingleNode` method to get the children and then manually construct the XML string from those nodes. Unfortunately, there isn't a direct function that will give you just the inner conten... | 44,271 | [
{
"from": "human",
"value": "I have an xml string \n<grandparent>\n <parent>\n <child>dave</child>\n <child>laurie</child>\n <child>gabrielle</child>\n </parent>\n</grandparrent>\n\nWhat I want to get is the data raw xml that's inside the parent. \nI'm using MSXML \niXMLElm->get_xml(&b... |
I need some help on asp.net mvc install.
I got the below two errors when I try to install ASP.NET MVC Beta:
Faulting application devenv.exe, version 9.0.21022.8, time stamp 0x47317b3d, faulting module unknown, version 0.0.0.0, time stamp 0x00000000, exception code 0xc0000005, fault offset 0x006c0061, process id 0x11d8,... | It looks like you're encountering issues with the installation of ASP.NET MVC Beta on your system. Based on the error messages you've provided, here are some potential solutions to help resolve these issues:
1. **Run the Installer as Administrator**:
- Make sure to right-click on the installer and select "Run as ad... | 47,110 | [
{
"from": "human",
"value": "I need some help on asp.net mvc install.\nI got the below two errors when I try to install ASP.NET MVC Beta:\nFaulting application devenv.exe, version 9.0.21022.8, time stamp 0x47317b3d, faulting module unknown, version 0.0.0.0, time stamp 0x00000000, exception code 0xc0000005, ... |
I have a Java object which is able to configure itself given an XML configuration description (it takes other descriptions as well, but I'm interested in the XML at the moment). I'm wondering if I can embed the XML description directly into a Spring application context description. I'm imagining something like:
<bean i... | Embedding raw XML directly in a Spring application context XML configuration file (like in your example) is not supported out-of-the-box. However, there are a few strategies you could employ to achieve your goal. Here are a couple of approaches:
### 1. Use an External XML Configuration File
You can define your XML co... | 47,699 | [
{
"from": "human",
"value": "I have a Java object which is able to configure itself given an XML configuration description (it takes other descriptions as well, but I'm interested in the XML at the moment). I'm wondering if I can embed the XML description directly into a Spring application context descripti... |
I have two forms in microsoft access, one called Bill and the other one called Payment. They both have Total amount as a field in both of the forms. I am trying to reference the Bill total amount to the Payment total amount.
I have tried in the Payment total amount control source : =Forms!Bill![Total Amount]
but this ... | When you're trying to reference a control from another form in Microsoft Access, there are a few things to keep in mind to ensure that your expression works correctly. Here are some steps and considerations to troubleshoot and set up your reference from the Bill form to the Payment form correctly.
1. **Ensure the Bill... | 45,481 | [
{
"from": "human",
"value": "I have two forms in microsoft access, one called Bill and the other one called Payment. They both have Total amount as a field in both of the forms. I am trying to reference the Bill total amount to the Payment total amount. \nI have tried in the Payment total amount control sou... |
I recently upgraded to Delphi 2009 and was disappointed to find out that I couldn't easily replace one VCL component with another. The best answer back was that GExperts could be used to do this.
Is it worthwhile to petition Embarcadero to incorporate some or all of the capabilities of GExperts right into Delphi? Whic... | Petitioning Embarcadero to incorporate some or all of the capabilities of GExperts into Delphi is certainly a worthwhile endeavor, especially if you believe that certain features would significantly enhance the development experience. GExperts offers many useful functionalities that could help streamline workflows, imp... | 45,678 | [
{
"from": "human",
"value": "I recently upgraded to Delphi 2009 and was disappointed to find out that I couldn't easily replace one VCL component with another. The best answer back was that GExperts could be used to do this. \nIs it worthwhile to petition Embarcadero to incorporate some or all of the capabi... |
I am running a query on Sybase ASE that produces a ResultSet that I then traverse and write the contents out to a file. Sometimes, this will throw a NullPointerException, stating that the ResultSet is null. However, it will do this after printing out one or two records. Other times, with the same exact input, I will re... | The `NullPointerException` you are encountering in your Java application when accessing the `ResultSet` could be due to a few different reasons. Here are some things you should consider and check:
1. **Check ResultSet Initialization**:
Ensure that your `ResultSet` is properly initialized and that your query is succ... | 48,031 | [
{
"from": "human",
"value": "I am running a query on Sybase ASE that produces a ResultSet that I then traverse and write the contents out to a file. Sometimes, this will throw a NullPointerException, stating that the ResultSet is null. However, it will do this after printing out one or two records. Other ti... |
Inside a windows batch file I'd like to figure out what the fully qualified path name of this batch file is.
I have tried %0 but this does only gave me the typed command (e.g. just the file name without path or extension).
| In a Windows batch file, you can use the following methods to get the fully qualified path name of the batch file itself:
1. **Using `%~f0`**:
This variable expands to the fully qualified path of the batch file, including its drive letter and path.
```batch
@echo off
echo The fully qualified path of this ... | 49,965 | [
{
"from": "human",
"value": "Inside a windows batch file I'd like to figure out what the fully qualified path name of this batch file is.\nI have tried %0 but this does only gave me the typed command (e.g. just the file name without path or extension).\n"
},
{
"from": "gpt",
"value": "In a Windo... |
Why wasn't the Java "throws" clause (in method declaration) included in C#?
| The absence of a `throws` clause in C# is rooted in the language's design philosophy and approach to error handling. Here are several reasons why C# does not include a `throws` clause, unlike Java:
1. **Simplification of Method Signatures**: C# aims to keep method signatures cleaner and less cluttered. The addition of... | 48,379 | [
{
"from": "human",
"value": "Why wasn't the Java \"throws\" clause (in method declaration) included in C#?\n"
},
{
"from": "gpt",
"value": "The absence of a `throws` clause in C# is rooted in the language's design philosophy and approach to error handling. Here are several reasons why C# does no... |
I'm trying to migrate a website from Windows 2000 to Win2k3 using the IIS 6 Migration Tool. I'm getting a bunch of 404s on content. A popular theory is that my IWAM account is out of sync with the IIS metabase, and to run synciwam to fix it. However I'm getting this 1B6 error and the only link I haven't chased in go... | The error message you're encountering (`Error: 1B6: Object doesn't support this property or method`) when running the `synciwam.vbs` script typically indicates that there is an issue with the IIS metabase or the way the script is trying to interact with it. Here are several steps you can take to troubleshoot and resolv... | 45,427 | [
{
"from": "human",
"value": "I'm trying to migrate a website from Windows 2000 to Win2k3 using the IIS 6 Migration Tool. I'm getting a bunch of 404s on content. A popular theory is that my IWAM account is out of sync with the IIS metabase, and to run synciwam to fix it. However I'm getting this 1B6 error... |
Is there any way to get code level access to a bluetooth mapped drive? The simple use case is I have a bluetooth folder in Explorer that looks something like:
"My Bluetooth Places\Entire Bluetooth Neighborhood\DEV1\OBEX File Transfer\E:\"
which maps to a device root, and I want to be able to read/write to the file sy... | Accessing a Bluetooth-mapped drive at a code level to read and write files is possible but can be challenging due to the specifics of how Bluetooth file transfers work and how they are represented in the operating system.
### Overview
When you see a Bluetooth device listed in "My Bluetooth Places" in Windows Explorer... | 44,385 | [
{
"from": "human",
"value": "Is there any way to get code level access to a bluetooth mapped drive? The simple use case is I have a bluetooth folder in Explorer that looks something like:\n\"My Bluetooth Places\\Entire Bluetooth Neighborhood\\DEV1\\OBEX File Transfer\\E:\\\" \nwhich maps to a device root, ... |
YAHOO.namespace("yuibook.calendar");
//define the lauchCal function which creates the calendar
YAHOO.yuibook.calendar.launchCal = function() {
//create the calendar object, specifying the container
var myCal = new YAHOO.widget.Calendar("mycal");
//draw the calendar on screen
myCal.render();
}
... | It looks like there are a few issues in your JavaScript code that are preventing the calendar from being displayed when you click the icon. Let's go through them:
1. **Scope of `myCal`**: The `myCal` variable is defined inside the `launchCal` function, making it local to that function. Therefore, it is not accessible ... | 49,239 | [
{
"from": "human",
"value": "YAHOO.namespace(\"yuibook.calendar\"); \n\n//define the lauchCal function which creates the calendar \nYAHOO.yuibook.calendar.launchCal = function() { \n\n //create the calendar object, specifying the container \n var myCal = new YAHOO.widget.Calendar(\"mycal\"); \n\n /... |
In the app I am working on, I want to allow the user to upload static HTML pages to replace the default "user profile" MVC View page. Is this possible? That is, the user uploaded html pages will totally run out of MVC, and it can include its own CSS links, etc.
Ideas? Suggestions?
| Yes, it is indeed possible to allow users to upload static HTML pages to replace a default MVC View page. However, there are several considerations and steps to ensure it works smoothly and securely. Here’s how you can go about it:
### Steps and Considerations
1. **File Upload Implementation**:
- Create a file upl... | 45,216 | [
{
"from": "human",
"value": "In the app I am working on, I want to allow the user to upload static HTML pages to replace the default \"user profile\" MVC View page. Is this possible? That is, the user uploaded html pages will totally run out of MVC, and it can include its own CSS links, etc.\nIdeas? Suggest... |
I've decided that I want to use Mercurial for a small, personal project.
Most of the help I've read about it talks about merging changes between multiple users. Since I'm solo, that's not going to happen.
Should I have multiple repositories? My development computer is already backed up nightly to my Windows Home Se... | Using Mercurial for your solo project is a great choice! Here are some practices and considerations specifically tailored for a lone developer:
### Single vs. Multiple Repositories
- **Single Repository**: For a small, personal project, a single repository is usually sufficient. You can maintain all of your code and h... | 44,492 | [
{
"from": "human",
"value": "I've decided that I want to use Mercurial for a small, personal project. \nMost of the help I've read about it talks about merging changes between multiple users. Since I'm solo, that's not going to happen.\nShould I have multiple repositories? My development computer is alre... |
I want to create a new object using Class::DBI. One of the fields of this object is a BLOB type. I have a filehandle I want to use for this data, but apparently, just doing this doesn't work:
my $item = My::Class::DBI::Class->insert({
foo => $bar,
biz => $baz,
blob => $my_f... | When using Class::DBI with a BLOB field, you generally need to read the contents of the filehandle into a scalar before you can store it in the database. Class::DBI expects the BLOB data to be a scalar value containing the actual binary data, not a filehandle.
Here’s how you can read the filehandle and insert the BLOB... | 49,021 | [
{
"from": "human",
"value": "I want to create a new object using Class::DBI. One of the fields of this object is a BLOB type. I have a filehandle I want to use for this data, but apparently, just doing this doesn't work:\nmy $item = My::Class::DBI::Class->insert({\n foo => $bar,\n biz ... |
There's lots of information about how cached execution plans in SQL Server eliminate much if not most of the performance advantage of stored procedures over dynamic sql. However, I have not found much about whether the same is true for Oracle databases. Does anyone have information or pointers to information about dyna... | In Oracle, the handling of dynamic SQL and stored procedures is somewhat different from SQL Server, and there are several factors to consider regarding performance. Oracle provides a feature called "private SQL areas" that cache execution plans, which helps to optimize the execution of both static and dynamic SQL.
###... | 45,905 | [
{
"from": "human",
"value": "There's lots of information about how cached execution plans in SQL Server eliminate much if not most of the performance advantage of stored procedures over dynamic sql. However, I have not found much about whether the same is true for Oracle databases. Does anyone have informat... |
I am building an Auto Updater for a winforms desktop application.
When the update is downloading, how can I provide a Resume download capability in case the customers internet connection breaks?
| Implementing a resume capability for downloads in your WinForms desktop application requires careful handling of the file transfer process. Here’s a general approach you can take to achieve this:
### Steps for Implementing a Resume Download Capability
1. **HTTP Range Requests**:
To support resuming downloads, your... | 42,503 | [
{
"from": "human",
"value": "I am building an Auto Updater for a winforms desktop application.\nWhen the update is downloading, how can I provide a Resume download capability in case the customers internet connection breaks?\n"
},
{
"from": "gpt",
"value": "Implementing a resume capability for d... |
I need to set up SSL over Active Directory. I googled a lot but could not found a decent write up about how to do this. Please if you know some good resources about this let me know.
Thanks!
| Setting up SSL for Active Directory is essential for securing LDAP communications (LDAP over SSL, or LDAPS). Here’s a step-by-step guide on how to set this up, along with some resources you might find helpful.
### Steps to Set Up SSL Over Active Directory (LDAPS)
#### 1. **Obtain a Certificate**
You will need an SSL... | 47,141 | [
{
"from": "human",
"value": "I need to set up SSL over Active Directory. I googled a lot but could not found a decent write up about how to do this. Please if you know some good resources about this let me know.\nThanks!\n"
},
{
"from": "gpt",
"value": "Setting up SSL for Active Directory is ess... |
I'm looking for a tool (or a set of tools) for Windows that will perform the following:
Capture UDP packets from a specific network interface to a file.
Play a stream of packets from a file through a network interface.
In addition to 2: replay the original packets to a different host than the original one.
I've alrea... | For your requirements on Windows XP SP2/3, you can consider a combination of tools to achieve capturing, playback, and modification of UDP packets.
### 1. **Capture UDP Packets:**
You've mentioned using **Wireshark**, which is an excellent tool for capturing packets. Ensure you have the appropriate permissions and dri... | 47,654 | [
{
"from": "human",
"value": "I'm looking for a tool (or a set of tools) for Windows that will perform the following:\n\nCapture UDP packets from a specific network interface to a file.\nPlay a stream of packets from a file through a network interface.\nIn addition to 2: replay the original packets to a diff... |
From time to time my applications GUI stops redrawing.
There a lot of threads that are firing all kinds of events (like timers or network data ready etc.). Also there are a lot of controls that are subscribing these events. Because of that, all the event handlers play the InvokeRequired/Invoke game.
Now I figured out t... | It seems like you've run into a common issue with GUI applications that involve heavy use of threading and event handling. The primary problem you faced was that the use of `Invoke()` was causing the UI thread to become blocked, leading to the GUI freezing when there were too many requests to update the UI.
By switchi... | 47,901 | [
{
"from": "human",
"value": "From time to time my applications GUI stops redrawing.\nThere a lot of threads that are firing all kinds of events (like timers or network data ready etc.). Also there are a lot of controls that are subscribing these events. Because of that, all the event handlers play the Invok... |
When running get svn fetch to pull the latest new branches from the upstream svn repository I got this error:
$ git svn fetch
fatal: failed to unpack tree object 5ecb324e8b8fcb918acb253f33edc6ce49e49e0d
read-tree 5ecb324e8b8fcb918acb253f33edc6ce49e49e0d: command returned error: 128
Now every attempt at git svn on that... | The error you're encountering indicates that there is likely corruption in the Git repository that's preventing it from correctly unpacking the specified object. Here are some steps you can take to try and resolve the issue without starting a fresh clone of the repository:
### Step 1: Check for Corrupt Objects
First, ... | 48,729 | [
{
"from": "human",
"value": "When running get svn fetch to pull the latest new branches from the upstream svn repository I got this error:\n$ git svn fetch\nfatal: failed to unpack tree object 5ecb324e8b8fcb918acb253f33edc6ce49e49e0d\nread-tree 5ecb324e8b8fcb918acb253f33edc6ce49e49e0d: command returned erro... |
When starting a new project that required the use of membership providers I found that I could not connect to a remote database that contained the membership database.
I ran aspnet_regsql and was able to create the membership database on the remote server but when I go to ASPNET Configuration (cassini development serve... | When dealing with ASP.NET Membership Providers and attempting to connect to a remote database, there are several factors you need to consider to troubleshoot the issue. Here are some steps to help you resolve the connectivity problem:
1. **Connection String**:
Ensure that your connection string in your application'... | 48,890 | [
{
"from": "human",
"value": "When starting a new project that required the use of membership providers I found that I could not connect to a remote database that contained the membership database.\nI ran aspnet_regsql and was able to create the membership database on the remote server but when I go to ASPNE... |
I have 2 different webapps (package into different war files) which needs to share some data via a cache (ehcache). I want to test out this idea with you to see if it works.
My idea is to create a service that bootstraps/accesses the ehcache and package that inside a jar. Then package that jar into the two wars:
WAR1:... | Your approach to using Ehcache in multiple web applications (WAR files) is a common strategy for sharing cached data between applications. However, there are important considerations to keep in mind for this configuration to work effectively.
### Key Considerations
1. **Ehcache Configuration**: Ensure that your Ehcac... | 48,136 | [
{
"from": "human",
"value": "I have 2 different webapps (package into different war files) which needs to share some data via a cache (ehcache). I want to test out this idea with you to see if it works.\nMy idea is to create a service that bootstraps/accesses the ehcache and package that inside a jar. Then ... |
I feel that it should be something very simple and obvious but just stuck on this for the last half an hour and can't move on.
All I need is to split an array of elements into N groups based on element index.
For example we have an array of 30 elements [e1,e2,...e30], that has to be divided into N=3 groups like this:
g... | You can simplify the logic to split an array into `N` groups by using a single calculation for determining the group index based on the element's index. Here's a general approach that can be applied in various programming languages:
### General Approach
1. Calculate the size of each group using integer division. The ... | 47,042 | [
{
"from": "human",
"value": "I feel that it should be something very simple and obvious but just stuck on this for the last half an hour and can't move on.\nAll I need is to split an array of elements into N groups based on element index.\nFor example we have an array of 30 elements [e1,e2,...e30], that has... |
i wonder if there is a way to generate valid GUIDs/UUIDs where the first (or any part) part is a user-selected prefix.
I.e., the GUID has the format AAAAAAAA-BBBB-CCCC-DDDD-DDDDDDDDDDDD, and I want to set any part to a pre-defined value (ideally the AAA's). The goal is to have GUIDs still globally unique, but they do n... | Yes, it is possible to generate UUIDs (Universally Unique Identifiers) with a user-selected prefix for certain parts while still adhering to the general format of a UUID. However, it's important to understand that doing so will affect the uniqueness guarantees of the UUID since a part of it is predetermined.
### UUID... | 45,695 | [
{
"from": "human",
"value": "i wonder if there is a way to generate valid GUIDs/UUIDs where the first (or any part) part is a user-selected prefix.\nI.e., the GUID has the format AAAAAAAA-BBBB-CCCC-DDDD-DDDDDDDDDDDD, and I want to set any part to a pre-defined value (ideally the AAA's). The goal is to have ... |
Here is my SQL Statement which is not returning DISTINCT Thread Titles.
SELECT DISTINCT TOP 5 tblThread.Title, tblPost.Date
FROM tblPost
INNER JOIN tblThread ON tblPost.ThreadID = tblThread.ThreadID
ORDER BY tblPost.Date DESC
The common field between tblThread and tblPost is ThreadID.
What I want this to do is retu... | To achieve your goal of retrieving the latest distinct thread titles based on the latest posts, you need to focus on grouping your results by `tblThread.Title` while still maintaining the latest post date for those threads. You can use a Common Table Expression (CTE) or a subquery to first get the latest post for each ... | 48,750 | [
{
"from": "human",
"value": "Here is my SQL Statement which is not returning DISTINCT Thread Titles.\nSELECT DISTINCT TOP 5 tblThread.Title, tblPost.Date \nFROM tblPost \nINNER JOIN tblThread ON tblPost.ThreadID = tblThread.ThreadID \nORDER BY tblPost.Date DESC\n\nThe common field between tblThread and tblP... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.