instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
Does anyone know of any notepad++ plugin that saves a version of whatever I'm working on periodically? Ideally, it would save many versions with the automatic version number and the date in the title, and perhaps store them in a zipped archive to save space. Does something like this exist already, or shold I attempt to...
As of my last update, there isn't a specific Notepad++ plugin that automatically saves multiple versions of your files with timestamps and version numbers and archives them in a zipped format. However, there are some approaches you can consider: ### Existing Plugins and Solutions 1. **AutoSave Plugin**: This plugin c...
32,842
[ { "from": "human", "value": "Does anyone know of any notepad++ plugin that saves a version of whatever I'm working on periodically? Ideally, it would save many versions with the automatic version number and the date in the title, and perhaps store them in a zipped archive to save space.\nDoes something like...
OK, so I couldn't really think of an apropos title that summarizes this. The IPrintPipelinePropertyBag interface has the method AddProperty which aptly enough "adds a property to a property bag." http://msdn.microsoft.com/en-us/library/aa506384.aspx AddProperty( [in, string] const wchar_t *pszName, [in] const ...
When working with COM and `VARIANT` types, particularly for passing strings to a method like `AddProperty`, it's essential to ensure that the memory management is handled correctly. This is crucial to avoid memory leaks and dangling pointers. Here's how you can ensure proper management of a string passed through a `V...
28,077
[ { "from": "human", "value": "OK, so I couldn't really think of an apropos title that summarizes this.\nThe IPrintPipelinePropertyBag interface has the method AddProperty which aptly enough \"adds a property to a property bag.\"\nhttp://msdn.microsoft.com/en-us/library/aa506384.aspx\n\nAddProperty( [in, st...
I'm trying to get a kernel module to load at boot. If I run insmod /path/to/module.ko, it works fine. But this has to be repeated every time I reboot. If I run modprobe /path/to/module.ko, it can't find the module. I know modprobe uses a configuration file, but I can't get it to load the module even after adding /path/...
To ensure that your kernel module loads automatically at boot, you can follow these steps. ### Step 1: Install the Module Make sure your kernel module is properly compiled and available at a known location, preferably in `/lib/modules/$(uname -r)/` directory, since this is where `modprobe` looks for modules. 1. Cop...
31,352
[ { "from": "human", "value": "I'm trying to get a kernel module to load at boot.\nIf I run insmod /path/to/module.ko, it works fine. But this has to be repeated every time I reboot.\nIf I run modprobe /path/to/module.ko, it can't find the module.\nI know modprobe uses a configuration file, but I can't get it...
How exactly can one implement a Log off function when using ASP.NET Forms Authentication on an intranet application? How will this work if I am an administrator and want to log in "as someone else" into the application? Please share your ideas
Implementing a log off function in an ASP.NET Forms Authentication application is straightforward, and it involves clearing the user's authentication ticket and redirecting them to a login page. Here’s a step-by-step guide on how to accomplish this, along with how an administrator can log in "as someone else." ### Imp...
30,422
[ { "from": "human", "value": "How exactly can one implement a Log off function when using ASP.NET Forms Authentication on an intranet application?\nHow will this work if I am an administrator and want to log in \"as someone else\" into the application?\nPlease share your ideas\n" }, { "from": "gpt", ...
I like to have my code warning free for VS.NET and GCC, and I like to have my code 64-bit ready. Today I wrote a little module that deals with in memory buffers and provides access to the data via a file-style interface (e.g. you can read bytes, write bytes, seek around etc.). As the data-type for current read position...
In C, `size_t` is defined as an unsigned integer type. The C standard specifies that it is used for sizes of objects and array indexing, meaning it cannot represent negative values. Given that, you should not have to worry about its signedness—it is guaranteed to be unsigned. However, your concern about handling overf...
30,350
[ { "from": "human", "value": "I like to have my code warning free for VS.NET and GCC, and I like to have my code 64-bit ready.\nToday I wrote a little module that deals with in memory buffers and provides access to the data via a file-style interface (e.g. you can read bytes, write bytes, seek around etc.).\...
How do get the startup path ( system.windows.forms.application.StartupPath ) of my exe without adding a reference to system.windows.forms?
If you want to get the startup path of your executable without adding a reference to `System.Windows.Forms`, you can do so using the `System.IO` and `System.Reflection` namespaces. Specifically, you can use the `Assembly` class to get the location of the currently executing assembly. Here's how to do it: ```csharp usi...
34,496
[ { "from": "human", "value": "How do get the startup path ( system.windows.forms.application.StartupPath ) of my exe without adding a reference to system.windows.forms?\n" }, { "from": "gpt", "value": "If you want to get the startup path of your executable without adding a reference to `System.Wi...
What possible reasons could exist for MySQL giving the error “Access denied for user 'xxx'@'yyy'” when trying to access a database using PHP-mysqli and working fine when using the command-line mysql tool with exactly the same username, password, socket, database and host? Update: There were indeed three users in the my...
The error "Access denied for user 'xxx'@'yyy'" in MySQL indicates that there is a problem with the user's authentication when trying to access the database from PHP using the MySQLi extension. This error can occur for several reasons, especially considering your scenario where it works on the command line but fails whe...
28,869
[ { "from": "human", "value": "What possible reasons could exist for MySQL giving the error “Access denied for user 'xxx'@'yyy'” when trying to access a database using PHP-mysqli and working fine when using the command-line mysql tool with exactly the same username, password, socket, database and host?\nUpdat...
It seems OpenLaszlo can run on AIR. What's less obvious is whether OpenLaszlo apps can use the AIR-specific APIs, like file system access. If so, how exactly is this done?
OpenLaszlo can indeed run on Adobe AIR, and developers can utilize AIR-specific APIs to enhance their applications with additional functionalities, such as file system access. However, integrating AIR-specific features into OpenLaszlo applications requires some additional steps. ### How to Use AIR-Specific APIs in Ope...
32,909
[ { "from": "human", "value": "It seems OpenLaszlo can run on AIR. What's less obvious is whether OpenLaszlo apps can use the AIR-specific APIs, like file system access. If so, how exactly is this done?\n" }, { "from": "gpt", "value": "OpenLaszlo can indeed run on Adobe AIR, and developers can uti...
When an Expression<T> is compiled, is the resultant code implicitly cached by the framework? I'm thinking along the lines of the static Regex methods where the framework implicitly compiles and caches the last few regexes. If compiled Expression<T> objects are not cached, can you recommend some best practices for keepi...
When working with `Expression<T>`, understanding its behavior upon compilation and caching is essential for performance and correctness in your application. ### Caching Behavior of Compiled Expressions 1. **Implicit Caching**: Unlike the behavior of `Regex`, which caches its compiled patterns, `Expression<T>.Compile(...
31,257
[ { "from": "human", "value": "When an Expression<T> is compiled, is the resultant code implicitly cached by the framework? I'm thinking along the lines of the static Regex methods where the framework implicitly compiles and caches the last few regexes.\nIf compiled Expression<T> objects are not cached, can y...
What are the benefits of Perforce? I'd love to have some insight as to how Perforce can work better in a given situation than, say, Subversion. If you have experience with both Perforce and Subversion and you don't believe that there are any advantages, or believe that svn has advantages over Perforce, I'd like to know...
Perforce and Subversion (SVN) are both popular version control systems, but they have different strengths and weaknesses. Here are some of the benefits of using Perforce, along with a comparison to Subversion: ### Benefits of Perforce 1. **Scalability**: - Perforce is designed to handle large-scale projects and re...
29,851
[ { "from": "human", "value": "What are the benefits of Perforce?\nI'd love to have some insight as to how Perforce can work better in a given situation than, say, Subversion.\nIf you have experience with both Perforce and Subversion and you don't believe that there are any advantages, or believe that svn has...
I want in an application with a simple text input, enriched with some marks to include formatting or semantic labeling. I want the syntax as easy as possible and I want to include self-defined labels. Example: [bold]Stackoverflow[/bold] is a [tag]good[/tag] resource for programmers. Tables would be needed too. HTML/XML...
It sounds like you're looking for a lightweight markup language that provides an easy way to format text with semantic labeling while also supporting tables. Here are a few options that come close to your requirements and could potentially be adapted to meet your needs: ### 1. **Markdown** Markdown is widely used for ...
29,945
[ { "from": "human", "value": "I want in an application with a simple text input, enriched with some marks to include formatting or semantic labeling. I want the syntax as easy as possible and I want to include self-defined labels.\nExample:\n[bold]Stackoverflow[/bold] is a [tag]good[/tag] resource for progra...
Can someone supply me with a regex to match a search term that is not preceded or followed by [a-z] and [A-Z]? (Other characters are OK.) I.e., when searching for key, I don't want keyboard in my search results, but key. is okay.
You can achieve this using a negative lookbehind and a negative lookahead in your regex pattern. To match a search term that is not preceded or followed by any lowercase or uppercase letters, you can use the following regex: ``` (?<![a-zA-Z])key(?![a-zA-Z]) ``` Here's a breakdown of the regex: - `(?<![a-zA-Z])` is a...
34,839
[ { "from": "human", "value": "Can someone supply me with a regex to match a search term that is not preceded or followed by [a-z] and [A-Z]? (Other characters are OK.) I.e., when searching for key, I don't want keyboard in my search results, but key. is okay.\n" }, { "from": "gpt", "value": "You ...
With SQLAlchemy, is there a way to know beforehand whether a relation would be lazy-loaded? For example, given a lazy parent->children relation and an instance X of "parent", I'd like to know if "X.children" is already loaded, without triggering the query.
Yes, in SQLAlchemy, you can check if a relationship is loaded without triggering a query by using the `has` or `is` methods from the `sqlalchemy.orm` library. Specifically, for checking whether a relationship is already loaded, you can use the `orm.attributes` module, which provides an `instance.state` property. For ...
33,939
[ { "from": "human", "value": "With SQLAlchemy, is there a way to know beforehand whether a relation would be lazy-loaded?\nFor example, given a lazy parent->children relation and an instance X of \"parent\", I'd like to know if \"X.children\" is already loaded, without triggering the query.\n" }, { "...
What data structure does the following declaration specify? List<ArrayList>[] myArray; I think it should declare an array where each element is a List (e.g., a LinkedList or an ArrayList) and require that each List contain ArrayList objects. My reasoning: List<String> someList; // A List of String object...
The declaration `List<ArrayList>[] myArray;` specifies an array of `List<ArrayList>` objects. This means that each element of the array (`myArray[i]`) is expected to be a `List` (such as an `ArrayList` or a `LinkedList`) that contains `ArrayList` objects. Here's a breakdown of the different components: 1. **`List<Arr...
17,767
[ { "from": "human", "value": "What data structure does the following declaration specify?\n List<ArrayList>[] myArray;\n\nI think it should declare an array where each element is a List (e.g., a LinkedList or an ArrayList) and require that each List contain ArrayList objects.\nMy reasoning:\n List<String> so...
I need to create a panel which should be invisible but the components inside it (for example, JTextArea, JButton, etc.) should be visible. When I click on the invisible panel, it should become visible. I can only use JRE 1.4 and nothing more than that. :( Any idea how to create such a transparent panel???
To create a transparent panel in Java Swing that can host visible components but appears invisible itself, you can create a custom class that extends `JPanel`. You will override the `paintComponent` method to make the panel transparent and add mouse event handling to toggle its visibility when clicked. Here's how you ...
30,250
[ { "from": "human", "value": "I need to create a panel which should be invisible but the components inside it (for example, JTextArea, JButton, etc.) should be visible. When I click on the invisible panel, it should become visible.\nI can only use JRE 1.4 and nothing more than that. :(\nAny idea how to creat...
I need to integrate a email client in my current python web app. Anything available? L.E.: I'm building my app on top of CherryPy
Integrating an email client into your Python web application built with CherryPy can be accomplished using various libraries and APIs. Below are some options you can consider, ranging from using libraries for sending and receiving emails to more comprehensive solutions for building a web-based email client. ### 1. **U...
27,754
[ { "from": "human", "value": "I need to integrate a email client in my current python web app.\nAnything available?\nL.E.: I'm building my app on top of CherryPy\n" }, { "from": "gpt", "value": "Integrating an email client into your Python web application built with CherryPy can be accomplished u...
I have a VB6 application that needs to update it's self. For this purpose, the PM has recommended using a batch file that is to be launched from the application. The batch file should kill the process, download the new version from a local server, overwrite the old files and launch the application again. My problem wit...
When you use the `taskkill` command in a batch file to terminate a process, the control is indeed returned to the parent batch file (or command prompt) as soon as the command is executed. However, the timing of resource cleanup, including file locks, can vary based on several factors, such as the operating system's pro...
28,401
[ { "from": "human", "value": "I have a VB6 application that needs to update it's self. For this purpose, the PM has recommended using a batch file that is to be launched from the application. The batch file should kill the process, download the new version from a local server, overwrite the old files and lau...
Given a stylesheet with a fully qualified reference to an image resource on another server, is there a good way to handle promotions through different environments that require a different base URL? background-image: url (evironmentSpecificURL/resourceName.foo); The environmentSpecificURL will vary from environment...
Handling environment-specific URLs in CSS can be challenging, especially when you want to avoid modifying the CSS files directly across different environments (development, QA, staging, production). Here are a few strategies that you might find useful: ### 1. CSS Preprocessors Using CSS preprocessors like Sass or Less...
30,991
[ { "from": "human", "value": "Given a stylesheet with a fully qualified reference to an image resource on another server, is there a good way to handle promotions through different environments that require a different base URL?\n\nbackground-image: url\n (evironmentSpecificURL/resourceName.foo);\n\nThe env...
Is it possible to detect, on the client side, whether the user is using an encrypted page or not? Put another way -- I want to know if the URL of the current page starts with http or https.
Yes, you can detect whether the current page is served over HTTP or HTTPS on the client side using JavaScript. You can check the protocol of the current page by accessing the `window.location.protocol` property. Here’s a simple example: ```javascript if (window.location.protocol === 'https:') { console.log("The pa...
35,555
[ { "from": "human", "value": "Is it possible to detect, on the client side, whether the user is using an encrypted page or not?\nPut another way -- I want to know if the URL of the current page starts with http or https.\n" }, { "from": "gpt", "value": "Yes, you can detect whether the current pag...
What is the use of Cursor Auto Fetch in SQL Server? thanks
In SQL Server, cursor auto-fetch is not a specific feature or term. However, it sounds like you're referring to cursor behavior in relation to how data is retrieved when using cursors in SQL Server. Cursors in SQL Server are database objects that allow you to retrieve rows from a result set one at a time, rather than...
32,781
[ { "from": "human", "value": "What is the use of Cursor Auto Fetch in SQL Server?\nthanks\n" }, { "from": "gpt", "value": "In SQL Server, cursor auto-fetch is not a specific feature or term. However, it sounds like you're referring to cursor behavior in relation to how data is retrieved when usin...
i have an ico file that contains a 48x48 and a 256x256 Vista PNG version (as well as the 32x32 and 16x16 versions). i want to draw the icon using the appropriate internal size version. i've tried: Icon ico = Properties.Resources.TestIcon; e.Graphics.DrawIcon(ico, new Rectangle(0, 0, 48, 48)); e.Graphics.DrawIcon(ico, n...
To draw the correct version of the icon based on the size you want, you need to create a method that extracts the desired icon size from the `ICO` file. The `.NET` `Icon` class does not have a built-in mechanism to extract specific sizes other than the default 32x32, which is why you see the unexpected behavior when tr...
32,453
[ { "from": "human", "value": "i have an ico file that contains a 48x48 and a 256x256 Vista PNG version (as well as the 32x32 and 16x16 versions). i want to draw the icon using the appropriate internal size version.\ni've tried:\nIcon ico = Properties.Resources.TestIcon;\ne.Graphics.DrawIcon(ico, new Rectangl...
I've got three (relevant) models, specified like this: class User < ActiveRecord::Base has_many :posts has_many :comments has_many :comments_received, :through => :posts, :source => :comments end class Post < ActiveRecord::Base belongs_to :user has_many :comments end class Comment < ActiveRecord::Base bel...
It looks like you're on the right track with wanting to set up routes to access a user's received comments. However, there are a few adjustments needed for the routing to work correctly. ### 1. Setting Up Custom Routes The `has_many` option you are trying to use with `map.resources` is designed for direct association...
33,392
[ { "from": "human", "value": "I've got three (relevant) models, specified like this:\nclass User < ActiveRecord::Base\n has_many :posts\n has_many :comments\n has_many :comments_received, :through => :posts, :source => :comments\nend\n\nclass Post < ActiveRecord::Base\n belongs_to :user\n has_many :comm...
Say suppose 10 developers have taken 6 months to develop some application. As a project manager how much time should I spare in my plans for testing? 6 months of effort includes unit testing. I am specific about functional test and user acceptance test. Is there any ratio or relationship between development time and te...
The amount of time allocated for testing, particularly functional testing and user acceptance testing (UAT), can vary depending on several factors, including the complexity of the application, the development methodology used, and the organization's quality standards. However, there are some general guidelines and best...
30,242
[ { "from": "human", "value": "Say suppose 10 developers have taken 6 months to develop some application. As a project manager how much time should I spare in my plans for testing?\n6 months of effort includes unit testing. I am specific about functional test and user acceptance test.\nIs there any ratio or r...
I have a web page that has a web form for signing up. I want to remove fields. I've tried removing the field code from the .asp file but obviously there are other things that I need to remove along those lines. I have full access to all the code but I need help knowing where things are linked as far as making the form ...
Certainly! Here’s a step-by-step guide on how to safely remove fields from a web form in an ASP page, along with the associated cleanup steps. Make sure to back up your original files before making any changes. ### Step 1: Identify the Fields to Remove 1. **Open the ASP file**: Locate the .asp file that contains your ...
27,762
[ { "from": "human", "value": "I have a web page that has a web form for signing up. I want to remove fields. I've tried removing the field code from the .asp file but obviously there are other things that I need to remove along those lines. I have full access to all the code but I need help knowing where thi...
I am adding a context menu using QAction for a widget. Now, there is some white space beside the text of the action. I assume this is the space where the QIcon association with the QAction should have been there. Now how do I hide this space. I tried doing: action->setIcon(QIcon()); but still does not seem to work. Ki...
When you create a `QAction` and do not assign an icon to it, Qt typically reserves space for the icon, which can lead to the extra white space you are observing beside the action text. Setting the icon to an empty `QIcon` using `action->setIcon(QIcon());` often does not remove this reserved space. To avoid this issue ...
32,422
[ { "from": "human", "value": "I am adding a context menu using QAction for a widget.\nNow, there is some white space beside the text of the action. I assume this is the space where the QIcon association with the QAction should have been there. Now how do I hide this space. I tried doing:\naction->setIcon(QIc...
Using Java, how can I test that a URL is contactable, and returns a valid response? http://stackoverflow.com/about
To test if a URL is contactable and returns a valid response in Java, you can use the `HttpURLConnection` class from the `java.net` package. Below is a sample code snippet that demonstrates how to achieve this. ```java import java.io.IOException; import java.net.HttpURLConnection; import java.net.URL; public class UR...
33,112
[ { "from": "human", "value": "Using Java, how can I test that a URL is contactable, and returns a valid response?\nhttp://stackoverflow.com/about\n\n" }, { "from": "gpt", "value": "To test if a URL is contactable and returns a valid response in Java, you can use the `HttpURLConnection` class from...
I have a draggable with a custom helper. Sometimes the helper is a clone and sometimes it is the original element. The problem is that when the helper is the original element and is not dropped on a valid droppable it gets removed. My solution looks like this so far: in my on_dropped callback I set ui.helper.dropped_o...
Your approach to handling the draggable's behavior when dropped on an invalid droppable is on the right track. The key here is to decide what should happen to the draggable element if it is not dropped on a valid droppable. Here are some possible solutions you could implement in the `stop` callback of your draggable: ...
33,828
[ { "from": "human", "value": "I have a draggable with a custom helper. Sometimes the helper is a clone and sometimes it is the original element. \nThe problem is that when the helper is the original element and is not dropped on a valid droppable it gets removed. My solution looks like this so far:\nin my on...
I have this piece of code (summarized)... AnsiString working(AnsiString format,...) { va_list argptr; AnsiString buff; va_start(argptr, format); buff.vprintf(format.c_str(), argptr); va_end(argptr); return buff; } And, on the basis that pass by reference is preferred where possible, I changed...
The issue you're facing is indeed related to the use of variadic functions and how they handle argument passing and types. In your original `working` function, the `format` parameter is passed by value (which is appropriate for this case). This allows the variadic function to work correctly, as `va_start` retrieves th...
31,960
[ { "from": "human", "value": "I have this piece of code (summarized)...\nAnsiString working(AnsiString format,...)\n{\n va_list argptr;\n AnsiString buff;\n\n va_start(argptr, format);\n buff.vprintf(format.c_str(), argptr);\n\n va_end(argptr);\n return buff;\n}\n\nAnd, on the basis that pa...
Why does this lambda expression not compile? Action a = () => throw new InvalidOperationException(); Conjecture is fine, but I would really appreciate references to the C# language specification or other documentation. And yes, I know that the following is valid and will compile: Action a = () => { throw new InvalidOp...
The lambda expression `Action a = () => throw new InvalidOperationException();` does not compile because of how expression-bodied members and lambda expressions are defined in C#. Specifically, a lambda expression must produce an expression (or a block of statements), and throwing an exception in this way does not conf...
29,901
[ { "from": "human", "value": "Why does this lambda expression not compile?\nAction a = () => throw new InvalidOperationException();\n\nConjecture is fine, but I would really appreciate references to the C# language specification or other documentation.\nAnd yes, I know that the following is valid and will co...
My huge 32-bit web services LLBLGen-based data access application is running alone on a dedicated 64-bit machine. Its physical memory consumption steadily grows up to approximately 2GB when the process releases almost all of the allocated space (up to 1,5GB) and continues to grow from that point again. There is no obse...
The behavior you are observing in your application is characteristic of a memory leak or fragmentation issue commonly encountered in long-running 32-bit applications. Here are several strategies to address the memory cleanup and help mitigate the issues you are facing: ### 1. **Identify Memory Leaks** - **Profiling...
29,765
[ { "from": "human", "value": "My huge 32-bit web services LLBLGen-based data access application is running alone on a dedicated 64-bit machine. Its physical memory consumption steadily grows up to approximately 2GB when the process releases almost all of the allocated space (up to 1,5GB) and continues to gro...
After I open something with emacsclient, when I kill that buffer (C-x k) I get a confirmation dialog: Buffer `blah' still has clients; kill it? (yes or no) But when I kill buffers opened directly from Emacs I don't. Is there a way not to get them when emacsclient opened them?
Yes, you can control the behavior of the confirmation dialog when killing buffers that have clients in Emacs. Specifically, you can adjust the variable `kill-buffer-query-functions` to either include or exclude certain conditions that trigger the confirmation prompt when you kill a buffer. Here’s how you can configure...
32,987
[ { "from": "human", "value": "After I open something with emacsclient, when I kill that buffer (C-x k) I get a confirmation dialog:\nBuffer `blah' still has clients; kill it? (yes or no)\n\nBut when I kill buffers opened directly from Emacs I don't. Is there a way not to get them when emacsclient opened them...
I should preface this by saying I'm working on a pocket PC app and the data files live on sd cards. I have an app that has to create an array of size x. malloc is failing every time. I've got a 1 gig file on a 4 gig card. I've got 64 megs of onboard memory (ram/data/application/os) I can't process the data because ...
When working with limited RAM and large data files on an SD card, using dynamic memory allocation (`malloc`) to create a large array can lead to failures due to insufficient memory. Instead, consider using a more efficient approach to manage your data. Here are some strategies you can apply: ### 1. **Memory-Mapped Fil...
27,338
[ { "from": "human", "value": "I should preface this by saying I'm working on a pocket PC app and the data files live on sd cards. \nI have an app that has to create an array of size x. \nmalloc is failing every time. \nI've got a 1 gig file on a 4 gig card. \nI've got 64 megs of onboard memory (ram/data/appl...
I have started using Jython as it seems to be a excellent language, and has proved to be so far. I am using dom4j to manipulate and retrieve data from the DOM of a bunch of HTML files I have on disk. I have wrote the below script to check threw the DOM using Xpath for H1 tags and grab text, if a H1 tag is not present ...
Certainly! Your current implementation of checking for the `h1` tag and then falling back to the `title` tag is quite straightforward. However, you can refactor the code to make it more concise and readable by creating a utility function that handles the XPath selection and text retrieval. This way, you can avoid repea...
33,249
[ { "from": "human", "value": "I have started using Jython as it seems to be a excellent language, and has proved to be so far.\nI am using dom4j to manipulate and retrieve data from the DOM of a bunch of HTML files I have on disk. I have wrote the below script to check threw the DOM using Xpath for H1 tags ...
We're looking at doing a MOSS 2007 site which will have a fairly dynamic component (an external product catalog). The external produces will be stored in a database (not managed by SharePoint) and all interaction will occur via Web Parts. Is it possible to configure the SharePoint search to index the textual content an...
In SharePoint 2007 (MOSS 2007), configuring the search to index content from an external database is not straightforward, as SharePoint primarily indexes its own content stored in document libraries, lists, and other SharePoint-specific data sources. However, there are ways to work around this limitation. ### Option 1...
30,921
[ { "from": "human", "value": "We're looking at doing a MOSS 2007 site which will have a fairly dynamic component (an external product catalog). The external produces will be stored in a database (not managed by SharePoint) and all interaction will occur via Web Parts.\nIs it possible to configure the SharePo...
Mine would have to be the float and margin bugs... If you float an element, and then specify a margin for it, it will double the margin. The solution to this is to add display: inline to the element. This will stop the double margin, and all other browsers will ignore it because only block level objects can be floated....
It sounds like you're encountering a common issue related to CSS floats and margins. However, the behavior you described isn't the typical case for margin doubling. Here's a bit more detail on how floats and margins work, along with some solutions to common issues you might face: 1. **Floating Elements and Margins**: ...
33,113
[ { "from": "human", "value": "Mine would have to be the float and margin bugs...\nIf you float an element, and then specify a margin for it, it will double the margin.\nThe solution to this is to add display: inline to the element. This will stop the double margin, and all other browsers will ignore it becau...
I have a number of web apps running on several IIS6/Server 2003 boxes. They run well and are happy. They are all asp.net web apps and use .NET 3.5. What, if any, would be valid reasons for contemplating moving the web apps to IIS7/Server 2008?
Migrating your ASP.NET web applications from IIS 6/Server 2003 to IIS 7/Server 2008 can be a beneficial move for several reasons, despite your current setup running well. Here are some valid reasons to consider the migration: 1. **End of Support**: Windows Server 2003 and IIS 6 have reached their end of support (EoS) ...
33,341
[ { "from": "human", "value": "I have a number of web apps running on several IIS6/Server 2003 boxes. They run well and are happy. They are all asp.net web apps and use .NET 3.5.\nWhat, if any, would be valid reasons for contemplating moving the web apps to IIS7/Server 2008?\n" }, { "from": "gpt", ...
I was shocked to learn that OpenMosix is closed. Can you suggest any similar free tool for linux. For those who don't know, OpenMosix is a software package that turns networked computers running GNU/Linux into a cluster. It automatically balances the load between different nodes of the cluster, and nodes can join or ...
If you're looking for alternatives to OpenMosix for clustering and load balancing in a Linux environment, there are several open-source solutions you might want to consider. Below are a few options along with brief descriptions and personal insights from the community. ### 1. **HTCondor** - **Overview**: HTCondor is a...
29,915
[ { "from": "human", "value": "I was shocked to learn that OpenMosix is closed. Can you suggest any similar free tool for linux. \nFor those who don't know, OpenMosix is\n\na software package that turns networked computers running GNU/Linux into a cluster. It automatically balances the load between different ...
Just looking for the relevant documentation. An example is not necessary, but would be appreciated. We have a situation where we are having to create 100s of virtual directories manually, and it seems like automating this would be a good way to make the process more efficient for now. Perhaps next year we can rewo...
Hi William, It sounds like you're facing quite a challenge with the current setup. Automating the creation of virtual directories can definitely save you time and reduce errors. Below, I’ll point you toward some relevant documentation for automating virtual directory creation, particularly if you're using IIS (Interne...
30,303
[ { "from": "human", "value": "Just looking for the relevant documentation. An example is not necessary, but would be appreciated. \nWe have a situation where we are having to create 100s of virtual directories manually, and it seems like automating this would be a good way to make the process more efficien...
I found a while ago (and I want to confirm again) that if you declare a class level variable, you should not call its constructor until the class constructor or load has been called. The reason was performance - but are there other reasons to do or not do this? Are there exceptions to this rule? ie: this is what I do...
You're raising an important point about the initialization of class-level variables in C#. Let’s break down the considerations for initializing these variables, including performance, code readability, and other factors. ### 1. **Initialization Timing** - **In the Constructor**: By initializing `_person` within the...
31,939
[ { "from": "human", "value": "I found a while ago (and I want to confirm again) that if you declare a class level variable, you should not call its constructor until the class constructor or load has been called. The reason was performance - but are there other reasons to do or not do this? Are there excep...
This is a simplified version of the problem. We have customers who send us lots of data and then query it. We are required by them to have several "public" ids they can query our data by. (Most want to query our system via the id they send along with the data, but not always). For simplicity, we'll call them "pid",...
To address the problem of efficiently querying your data with respect to the relationships between `entity`, `episode`, `series`, and `broadcast` while avoiding the pitfalls of options 1 and 2, you can consider implementing an index-based or join-based approach while maintaining referential integrity without introducin...
30,362
[ { "from": "human", "value": "This is a simplified version of the problem. \nWe have customers who send us lots of data and then query it. We are required by them to have several \"public\" ids they can query our data by. (Most want to query our system via the id they send along with the data, but not alwa...
I get this error message when installing SQL 2005 Analysis services. The cabinet File 'sql.cab' required for this installation is corrupt and cannot be used. This could indicate a network error, an error reading from the CD-ROM, or a problem with this package. Im installing from an ISO file downloaded from MSDN. How...
The error message you are encountering indicates that the installation process is unable to find the `sql.cab` file, which is typically included in the installation package. Since you mentioned that you're installing from an ISO file downloaded from MSDN and that the file `sql.cab` is not present, here are several step...
30,488
[ { "from": "human", "value": "I get this error message when installing SQL 2005 Analysis services.\nThe cabinet File 'sql.cab' required for this installation is corrupt and cannot be used. This could indicate a network error, an error reading from the CD-ROM, or a problem with this package.\nIm installing...
Is there a way to compile multiple java source directories in a single maven project?
Yes, you can compile multiple Java source directories in a single Maven project by configuring your `pom.xml` file appropriately. By default, Maven uses the `src/main/java` directory for your main source code and `src/test/java` for your test code. However, you can specify additional source directories by adding `<sour...
30,025
[ { "from": "human", "value": "Is there a way to compile multiple java source directories in a single maven project? \n" }, { "from": "gpt", "value": "Yes, you can compile multiple Java source directories in a single Maven project by configuring your `pom.xml` file appropriately. By default, Maven...
I'm trying to use SubSonic for a new project with an existing database but when I try to build the project after generating the SubSonic files I'm getting these same two exceptions on different classes: Partial declarations of 'MyData.UserCollection' must not specify different base classes Type 'MyData.UserCollection'...
The exceptions you're encountering when using SubSonic with your existing database suggest that there may be some issues with the auto-generated classes for the database tables, specifically around class inheritance and member declarations. Here are some steps you can take to troubleshoot and resolve the issues: 1. *...
32,138
[ { "from": "human", "value": "I'm trying to use SubSonic for a new project with an existing database but when I try to build the project after generating the SubSonic files I'm getting these same two exceptions on different classes:\n\nPartial declarations of 'MyData.UserCollection' must not specify differen...
I am currently using Rails 2.1.0 and want to upgrade to Rails 2.1.1. After issuing the following command gem update rails I suppose that I need to change this line RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION in environment.rb What other actions should I take to ensure that my application is using ...
Upgrading from Rails 2.1.0 to Rails 2.1.1 is a relatively small version upgrade, but there are still some steps you should follow to ensure your application is using the latest version properly. Here's a list of actions you should take: 1. **Update the Version in `environment.rb`:** You've already mentioned this st...
25,288
[ { "from": "human", "value": "I am currently using Rails 2.1.0 and want to upgrade to Rails 2.1.1. After issuing the following command \ngem update rails\n\nI suppose that I need to change this line \nRAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION\n\nin environment.rb\nWhat other actions shoul...
When creating an MDI Application with "Visual Studio" style using the AppWizard of VS2008 (plus Feature Pack), the CMainFrame class gets a method CreateDockingWindows(). Since I don't want all panes to be always visible but display them depending on the type of the active document, I made those windows to members of my...
Creating docking panes in a Visual Studio MDI application can indeed be tricky, especially when you're trying to control their visibility based on the active document. While moving the creation of the docking windows from the `CMainFrame` to the views might seem like a feasible solution, it may introduce complications,...
30,126
[ { "from": "human", "value": "When creating an MDI Application with \"Visual Studio\" style using the AppWizard of VS2008 (plus Feature Pack), the CMainFrame class gets a method CreateDockingWindows().\nSince I don't want all panes to be always visible but display them depending on the type of the active doc...
I've been a C# programmer for about 2 years total, and professionally for a little more than 1. I work at a company as a developer on an application that began before the days of .NET 2. My question is this: What is the benefit to use databinding from sql queries directly to a control over querying and manually adding ...
Data binding in .NET allows you to connect data sources (like databases, lists, etc.) directly to UI controls. This approach has several benefits compared to manually querying data and populating controls. Here are some key considerations: ### Benefits of Using Data Binding: 1. **Simplicity and Readability**: Data bi...
32,357
[ { "from": "human", "value": "I've been a C# programmer for about 2 years total, and professionally for a little more than 1. I work at a company as a developer on an application that began before the days of .NET 2. My question is this:\nWhat is the benefit to use databinding from sql queries directly to a ...
I have checked with the wikipedia article, and it seems like it is missing the c++ version of a code example. I am not able to fully appreciate the Facade pattern without this, can you please help explain it to me using C++?
Certainly! The Facade pattern is a structural design pattern that provides a simplified interface to a complex system of classes, libraries, or frameworks. It is essentially a way to reduce complexity for the client by providing a higher-level interface. Let’s look at an example in C++. Imagine we have a home theater ...
30,240
[ { "from": "human", "value": "I have checked with the wikipedia article, and it seems like it is missing the c++ version of a code example. I am not able to fully appreciate the Facade pattern without this, can you please help explain it to me using C++?\n" }, { "from": "gpt", "value": "Certainl...
I'm listening to a talk about C#4's dynamic keyword and I'm wondering... Will this feature be orthogonal to other .NET features, for example will it support extension methods? public static class StrExtension { public static string twice(this string str) { return str + str; } } ... dynamic x = "Yo"; x.twice(); // w...
Yes, in C# 4.0, the `dynamic` keyword is indeed designed to work in a way that is largely orthogonal to other features of .NET, including extension methods. This means that extension methods can be called on dynamic types, but there are some nuances to consider. In your example: ```csharp public static class StrExten...
32,585
[ { "from": "human", "value": "I'm listening to a talk about C#4's dynamic keyword and I'm wondering... Will this feature be orthogonal to other .NET features, for example will it support extension methods?\npublic static class StrExtension {\n public static string twice(this string str) { return str + str...
Using VB.NET, how do I add the values from an XML file into an SQL Server database with a similar schema?
To add values from an XML file into an SQL Server database using VB.NET, you can follow these steps: 1. **Read the XML file**: Load the XML file into an `XmlDocument` or `XDocument` object. 2. **Parse the XML**: Extract the relevant data from the XML structure. 3. **Connect to SQL Server**: Use ADO.NET to connect to y...
29,940
[ { "from": "human", "value": "Using VB.NET, how do I add the values from an XML file into an SQL Server database with a similar schema?\n" }, { "from": "gpt", "value": "To add values from an XML file into an SQL Server database using VB.NET, you can follow these steps:\n\n1. **Read the XML file**...
Can standard pointers in .Net do this? Or does one need to resort to P/invoke? Note that I'm not talking about object references; I'm talking about actual C# pointers in unsafe code.
In .NET, you can use standard pointers in unsafe code, but there are some limitations and considerations that differentiate them from typical use in unmanaged languages like C or C++. Here’s a breakdown of how you can use pointers in C# and when you might need P/Invoke: ### Using Pointers in Unsafe Code In C#, pointer...
31,906
[ { "from": "human", "value": "Can standard pointers in .Net do this? Or does one need to resort to P/invoke?\nNote that I'm not talking about object references; I'm talking about actual C# pointers in unsafe code.\n" }, { "from": "gpt", "value": "In .NET, you can use standard pointers in unsafe c...
I just recently installed the MVC beta. However, I assumed because the versioning numbers have changed and because it now uses the GAC instead of the bin folder that it wouldn't break existing applications. However, it has. What steps do I need to follow to ensure my existing preview 3 applications use a bin copy of th...
When working with MVC (Model-View-Controller) and upgrading from one version or preview to another, it can sometimes lead to compatibility issues, especially when the framework versioning and installation method changes. If the new MVC beta uses the GAC (Global Assembly Cache) and has caused issues with your existing a...
31,673
[ { "from": "human", "value": "I just recently installed the MVC beta.\nHowever, I assumed because the versioning numbers have changed and because it now uses the GAC instead of the bin folder that it wouldn't break existing applications.\nHowever, it has.\nWhat steps do I need to follow to ensure my existing...
Let's suppose I have an applet running within a page in a browser. What happens when the browser is closed by the user? Is the applet notified so that it can perform some kind of close action on its side (closing connections opened to a server, cleaning static variables, ...)? Also, I assume the same behavior would app...
When a user closes a browser or navigates away from a page containing an applet, the behavior regarding how the applet is notified can vary based on several factors, including the implementation of the applet, the browser, and the Java Virtual Machine (JVM) handling the applet. Here's a detailed explanation of what hap...
30,831
[ { "from": "human", "value": "Let's suppose I have an applet running within a page in a browser.\nWhat happens when the browser is closed by the user?\nIs the applet notified so that it can perform some kind of close action on its side (closing connections opened to a server, cleaning static variables, ...)?...
I need to reproduce a bug, and a guy from the other team has sent me a .mdf and .ldf files from his sql server 2005 instance. When I attach the database, all I get is empty tables, even though file is 2 mb large. The db contains 2 tables that have, among other thing, a varbinary(max) field. At the same time another dat...
When you attach a SQL Server database and find that the tables are empty, especially when dealing with `.mdf` and `.ldf` files that appear to be sizable, several factors could be at play. Here are some potential reasons why the data might be inaccessible or not appearing as expected: 1. **Compatibility Issues**: Since...
26,048
[ { "from": "human", "value": "I need to reproduce a bug, and a guy from the other team has sent me a .mdf and .ldf files from his sql server 2005 instance. When I attach the database, all I get is empty tables, even though file is 2 mb large. The db contains 2 tables that have, among other thing, a varbinary...
In your “enterprise” work environment, how are engineers held accountable for performing code inspections and unit testing? What processes do you follow (formal methodology or custom process) to ensure the quality of your software? Do you or have you tried implementing a developer "signoff" sheet for deliverables? Th...
In an enterprise work environment, ensuring accountability for code inspections and unit testing can be a challenge, especially when trying to foster a culture of quality. Here are some strategies and processes that can be implemented to promote these practices, particularly in the context of using tools like Code Coll...
28,619
[ { "from": "human", "value": "In your “enterprise” work environment, how are engineers held accountable for performing code inspections and unit testing? What processes do you follow (formal methodology or custom process) to ensure the quality of your software? Do you or have you tried implementing a devel...
I'm kind of new to C++ and have some questions, this is one of them. Is there ANY reason when you are using a function that takes in one or several parameters, parameters of which you know will always be stored in a variable before the function call, to pass a copy of the variable, rather than a pointer to the variable...
In C++, the decision to pass arguments by value (copying the variable) versus passing by pointer (or reference) depends on a variety of factors including performance, safety, and code clarity. Here's a breakdown of the considerations: ### Passing by Value: 1. **Copy Semantics**: When you pass a variable by value, a co...
27,387
[ { "from": "human", "value": "I'm kind of new to C++ and have some questions, this is one of them.\nIs there ANY reason when you are using a function that takes in one or several parameters, parameters of which you know will always be stored in a variable before the function call, to pass a copy of the varia...
I'd like to run a subcommand from Perl (or pipe it into a Perl script) and have the script process the command's output immediately, rather than waiting for a timeout, a newline, or a certain number of blocks. For example, let's say I want to surround each chunk of input with square brackets. When I run the script like...
Yes, you can achieve the desired functionality in a more elegant way by using the `IO::Select` module, which allows you to work with filehandles in a more straightforward manner compared to manipulating the flags directly. The `IO::Select` module enables you to wait for input without blocking indefinitely. Here’s a re...
27,874
[ { "from": "human", "value": "I'd like to run a subcommand from Perl (or pipe it into a Perl script) and have the script process the command's output immediately, rather than waiting for a timeout, a newline, or a certain number of blocks. For example, let's say I want to surround each chunk of input with sq...
Does silverlight support the remoting functionality of the .net framework?
Silverlight does not natively support .NET Remoting. Silverlight is a platform designed for creating rich internet applications and operates in a sandboxed environment for security reasons, which limits its ability to directly communicate with server-side technologies that are not specifically designed for web applicat...
35,478
[ { "from": "human", "value": "Does silverlight support the remoting functionality of the .net framework?\n" }, { "from": "gpt", "value": "Silverlight does not natively support .NET Remoting. Silverlight is a platform designed for creating rich internet applications and operates in a sandboxed env...
Can every possible value of a float variable can be represented exactly in a double variable? In other words, for all possible values X will the following be successful: float f1 = X; double d = f1; float f2 = (float)d; if(f1 == f2) System.out.println("Success!"); else System.out.println("Failure!"); My suspicion...
The relationship between `float` and `double` in Java (or in most programming languages that follow similar floating-point standards) is such that not all possible values of a `float` can be perfectly represented by a `double`, but it can be safely converted back and forth between them in most cases, as long as you con...
32,748
[ { "from": "human", "value": "Can every possible value of a float variable can be represented exactly in a double variable?\nIn other words, for all possible values X will the following be successful:\nfloat f1 = X;\ndouble d = f1;\nfloat f2 = (float)d;\n\nif(f1 == f2)\n System.out.println(\"Success!\");\ne...
I would like to see the specific style elements that are used in the default stylesheet for the various browsers. Do the browsers have an actual file based stylesheetss that I locate on my system and read? If so, what are the default locations of those files? If not, where I can find this information?
Web browsers do not typically expose their default stylesheets as separate, easily accessible files on your system. Instead, they often apply default styles through built-in mechanisms that are part of the browser's rendering engine. These default styles are usually referred to as "user agent stylesheets." ### Locatin...
30,689
[ { "from": "human", "value": "I would like to see the specific style elements that are used in the default stylesheet for the various browsers. Do the browsers have an actual file based stylesheetss that I locate on my system and read? If so, what are the default locations of those files? If not, where I can...
For a rigorous marker of the source database state, I'd like to capture the @@DBTS of an external database in a sproc. Yeah, I think I could issue USE ExternalDB GO SELECT @myVarbinary8 = @@DBTS GO USE OriginalDB GO but, even if I could, it seems ugly. For now, I've embedded a scalar-valued function in the sour...
To capture the `@@DBTS` value from an external database in a stored procedure while avoiding the need for context switching with `USE`, you can leverage a linked server setup, if it's applicable for your environment. Unfortunately, as you've noted, you can't directly reference `@@DBTS` from an external database using a...
31,138
[ { "from": "human", "value": "For a rigorous marker of the source database state, I'd like to capture the @@DBTS\nof an external database in a sproc. Yeah, I think I could issue \n\n\nUSE ExternalDB\nGO\n\nSELECT @myVarbinary8 = @@DBTS\nGO\n\nUSE OriginalDB\nGO\n\n\nbut, even if I could, it seems ugly.\nFor...
Is it possible to serialize and deserialize a class in C++? I've been using Java for 3 years now, and serialization / deserialization is fairly trivial in that language. Does C++ have similar features? Are there native libraries that handle serialization? An example would be helpful.
Yes, it is indeed possible to serialize and deserialize classes in C++. However, unlike Java, which has built-in support for serialization through interfaces like `Serializable`, C++ does not have a native serialization framework. Instead, you have to implement your own serialization logic or utilize third-party librar...
24,015
[ { "from": "human", "value": "Is it possible to serialize and deserialize a class in C++?\nI've been using Java for 3 years now, and serialization / deserialization is fairly trivial in that language. Does C++ have similar features? Are there native libraries that handle serialization?\nAn example would be h...
I am trying to create a new contact using Dynamic Entity. The sample i found in CRM SDK had this code. // Set the properties of the contact using property objects. StringProperty firstname = new StringProperty(); firstname.Name = "firstname"; firstname.Value = "Jesper"; StringProperty la...
It looks like you're trying to create a new contact using the CRM SDK, but you are facing type conversion issues. Let's break down the issues and clarify what you need to do. 1. **Type Mismatch**: The error messages you're encountering indicate that you are trying to assign types that do not match the expected propert...
32,153
[ { "from": "human", "value": "I am trying to create a new contact using Dynamic Entity. The sample i found in CRM SDK had this code.\n// Set the properties of the contact using property objects.\n StringProperty firstname = new StringProperty();\n firstname.Name = \"firstname\";\n firstn...
I have a text file with a series of commands each one is on a diferent line what I need to do is go through the text file line by line and for each line perform a set of operations. How would I loop through line by line? Example: Text file contains: johndoe.log Apples and organes.log monkies and zebras.log script wo...
You can loop through a text file line by line in Python using the `with` statement to handle the file. Here's a basic example to accomplish what you're looking to do: ```python # Open the text file containing the list of log file names with open('commands.txt', 'r') as file: # Iterate over each line in the file ...
33,604
[ { "from": "human", "value": "I have a text file with a series of commands each one is on a diferent line what I need to do is go through the text file line by line and for each line perform a set of operations. How would I loop through line by line?\nExample:\nText file contains:\njohndoe.log\nApples and o...
Are there any tools to transform SVG (XML) data to Canvas friendly input?
Yes, there are several tools and libraries that can help transform SVG data into a format suitable for rendering on an HTML5 Canvas. Here are some popular options: 1. **canvg**: This is a popular JavaScript library that allows you to render SVG directly onto a Canvas element. You can feed SVG strings or even load SVG ...
31,876
[ { "from": "human", "value": "Are there any tools to transform SVG (XML) data to Canvas friendly input?\n" }, { "from": "gpt", "value": "Yes, there are several tools and libraries that can help transform SVG data into a format suitable for rendering on an HTML5 Canvas. Here are some popular optio...
In any (non-web) .net project, the compiler automatically declares the DEBUG and TRACE constants, so I can use conditional compiling to, for example, handle exceptions differently in debug vs release mode. For example: #if DEBUG /* re-throw the exception... */ #else /* write something in the event log... */ #en...
In an ASP.NET project, the same conditional compilation symbols (`DEBUG` and `TRACE`) are available just like in other .NET projects. You do not need to manually define the `DEBUG` constant, as it is already set by default in debug builds of your ASP.NET application. Here's how you can use conditional compilation in y...
32,342
[ { "from": "human", "value": "In any (non-web) .net project, the compiler automatically declares the DEBUG and TRACE constants, so I can use conditional compiling to, for example, handle exceptions differently in debug vs release mode.\nFor example:\n#if DEBUG\n /* re-throw the exception... */\n#else\n ...
Is it possible to determine whether my web site is being accessed as a trusted site? In another question we determined that, in general, it is not prudent to have visibility to client IE settings. Would this qualify as an exception? The reason I'd like to do this is that some functions won't work unless the site is b...
Determining whether your website is being accessed as a trusted site in Internet Explorer (IE) or any other browser is quite challenging due to security and privacy concerns. Browsers intentionally limit the information available to web pages about the user's environment, including their security settings, to protect u...
31,545
[ { "from": "human", "value": "Is it possible to determine whether my web site is being accessed as a trusted site? In another question we determined that, in general, it is not prudent to have visibility to client IE settings. Would this qualify as an exception?\nThe reason I'd like to do this is that some...
I just downloaded MVC and I am going through a tutorial. Everything goes fine until I try to declare a DataContext object. My dbml is named db.dbml (tried another on named test.dbml) and when I try this: public dbDataContext db = new dbDataContext(); I get: The type or namespace name 'dbDataContext' could not be f...
It sounds like you might be experiencing a couple of common issues that can occur when using LINQ to SQL with DataContext in a new project. Here are some steps you can take to troubleshoot and resolve the issue: 1. **Check the Namespace**: Make sure you're using the correct namespace for your `dbDataContext` class. Wh...
24,608
[ { "from": "human", "value": "I just downloaded MVC and I am going through a tutorial. Everything goes fine until I try to declare a DataContext object.\nMy dbml is named db.dbml (tried another on named test.dbml) and when I try this:\npublic dbDataContext db = new dbDataContext();\n\nI get:\n\nThe type or ...
I'm running a console app (myApp.exe) which outputs a pseudo localized (unicode) string to the standard output. If I run this in a regular command prompt(cmd.exe), the unicode data gets lost. If I run this in a unicode command prompt(cmd.exe /u) or set the properties of the console to "Lucida Console" then the unicode ...
To ensure that the Unicode output from your console application (`myApp.exe`) is correctly captured in your C# application, you need to set the appropriate encoding for the `StandardOutput` stream in your `Process` object. By default, the encoding might not be set to support Unicode, leading to loss of information. He...
29,014
[ { "from": "human", "value": "I'm running a console app (myApp.exe) which outputs a pseudo localized (unicode) string to the standard output.\nIf I run this in a regular command prompt(cmd.exe), the unicode data gets lost.\nIf I run this in a unicode command prompt(cmd.exe /u) or set the properties of the co...
I'm trying to write an app using Ruby on Rails and I'm trying to achieve the following: The app needs to receive UDP messages coming in on a specific port (possibly 1 or more per second) and store them in the database so that the rest of my Rails app can access it. I was thinking of writing a separate daemon that w...
Your approach to handling incoming UDP messages in a Ruby on Rails app is reasonable, and it is indeed more efficient to have a long-running Ruby process that can continuously receive and process these messages instead of spawning a new Ruby process for each message. Here are a few strategies and tools you can use to ...
23,668
[ { "from": "human", "value": "I'm trying to write an app using Ruby on Rails and I'm trying to achieve the following:\n\nThe app needs to receive UDP messages coming in on a specific port (possibly 1 or more per second) and store them in the database so that the rest of my Rails app can access it. \n\nI was...
I've found Ruby to be very attractive; I like the fact that everything is an object and its syntax is very appealing. I was hoping that it would gain a lot of popularity this year, but I don't see lot of activity in Ruby. For instance if we take the number of tags added in SO there are only about 700 questions tagged...
Ruby has experienced various phases of popularity over the years, especially with the rise of Ruby on Rails in the mid-2000s. However, several factors may contribute to its current perception and activity levels: 1. **Rise and Maturity of Alternatives**: While Ruby on Rails made a significant impact, other frameworks ...
32,419
[ { "from": "human", "value": "I've found Ruby to be very attractive; I like the fact that everything is an object and its syntax is very appealing. \nI was hoping that it would gain a lot of popularity this year, but I don't see lot of activity in Ruby. \nFor instance if we take the number of tags added in S...
What is the best way to store a large number of data points? For example temperature values which are measured every minute over lots of locations? SQL databases with one row per data points doesn't seem very efficient.
When storing large volumes of time-series data, like temperature readings taken every minute from multiple locations, using a traditional SQL database with one row per data point can indeed be inefficient. Here are several alternative approaches and best practices for storing such data effectively: ### 1. Time-Series ...
26,968
[ { "from": "human", "value": "What is the best way to store a large number of data points?\nFor example temperature values which are measured every minute over lots of locations?\nSQL databases with one row per data points doesn't seem very efficient.\n" }, { "from": "gpt", "value": "When storing...
All paint programs, independent of how simple or complex they are, come with a fill tool. This basically replaces the color of a closed region with another color. I know that there are different APIs to do this, but I am interested in the algorithm. What would be an efficient algorithm to implement this tool? A couple ...
The "fill" tool you're describing is commonly implemented using algorithms that can efficiently identify and fill a connected region of pixels. There are two main algorithms that are typically used for this purpose: the **Flood Fill Algorithm** and the **Scanline Fill Algorithm**. Below, I'll describe the Flood Fill Al...
30,392
[ { "from": "human", "value": "All paint programs, independent of how simple or complex they are, come with a fill tool. This basically replaces the color of a closed region with another color. I know that there are different APIs to do this, but I am interested in the algorithm. What would be an efficient al...
I'm using Visual Studio 2008 (SP1) to create a web test that will allow me to edit a page using EditForm.aspx. I am trying it using fiddler and the recorder. I have managed to get some tests to run, but they do not change the properties. Does anyone have any tips on how to do this?
Creating web tests in Visual Studio 2008 can be tricky, especially when you're trying to automate actions that change properties on a web page through an `EditForm.aspx`. Here are some tips that can help you ensure that your web tests correctly interact with the page and change the necessary properties: ### Tips for R...
26,011
[ { "from": "human", "value": "I'm using Visual Studio 2008 (SP1) to create a web test that will allow me to edit a page using EditForm.aspx.\nI am trying it using fiddler and the recorder. I have managed to get some tests to run, but they do not change the properties.\nDoes anyone have any tips on how to do...
When I restart my apache2 and reload a page, the log file shows boogie.tontut.fi - - [28/Oct/2008:03:27:49 +0200] "GET /test HTTP/1.1" 404 457 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3" ...as supposed to, as it's 03:27:49 now. However, when I click the refresh butt...
The issue you're encountering seems to be related to time zone settings either on your web server or in your application. Here are some steps to troubleshoot and resolve the issue: ### 1. Check Apache Time Zone Configuration Apache uses the system time and time zone settings of the server it is running on. You can che...
31,993
[ { "from": "human", "value": "When I restart my apache2 and reload a page, the log file shows\nboogie.tontut.fi - - [28/Oct/2008:03:27:49 +0200] \"GET /test HTTP/1.1\" 404 457 \"-\" \"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3\"\n\n...as supposed to, as it's 03...
I have a script that takes a command and executes it on a remote host. It works fine, for example: $ rexec "ant build_all" will execute the "ant build_all" command on the remote system (passing it through SSH, etc). Because I'm lazy, I want to set up an alias for this command (and ultimately, several others), such th...
You can achieve this using a shell function instead of an alias. Bash functions allow you to encapsulate the desired command while still accepting additional arguments. Here’s how you can set it up: 1. Open your `~/.bashrc` (or `~/.bash_profile` depending on your system) in a text editor. 2. Add the following function...
34,487
[ { "from": "human", "value": "I have a script that takes a command and executes it on a remote host. It works fine, for example:\n$ rexec \"ant build_all\"\n\nwill execute the \"ant build_all\" command on the remote system (passing it through SSH, etc).\nBecause I'm lazy, I want to set up an alias for this ...
I have a WPF app which snaps to screen edges (I just set the .Top or .Left of the window if you're within 20 pixels of the screen edge), but I recently added some code provided by the WPF SDK Team to "mess" with the window chrome, and although it's working great (screenshot), it's causing the "snapto" to move the windo...
It sounds like you're experiencing an issue with how the window's non-client area is being calculated and managed after you modified the WM_NCCALCSIZE handler. The unexpected behavior of your window snapping to the edges could be a result of the changes made to the window's size and placement properties during the hand...
27,183
[ { "from": "human", "value": "I have a WPF app which snaps to screen edges (I just set the .Top or .Left of the window if you're within 20 pixels of the screen edge), but I recently added some code provided by the WPF SDK Team to \"mess\" with the window chrome, and although it's working great (screenshot), ...
I have a 'generic' boiler plate static method for checking for InvokeRequired and invoking an associated action accordingly. If an unhandled exception is raised by the action, the stack trace isn't much help because it starts from here. I can get information about the control, but that isn't always much help. I was won...
You're on the right track by adding context to your error messages. However, when it comes to capturing additional information about the `Action` being invoked, especially if it's a lambda or an anonymous delegate, it can be a bit tricky. The `Target` property only provides the instance that the delegate is bound to, a...
32,034
[ { "from": "human", "value": "I have a 'generic' boiler plate static method for checking for InvokeRequired and invoking an associated action accordingly.\nIf an unhandled exception is raised by the action, the stack trace isn't much help because it starts from here. I can get information about the control, ...
I'm currently working on project with Haskell, and have found myself some trouble. I'm supposed to read and insert into a list each line in a "dictionary.txt" file, but I can't seem to do so. I've got this code: main = do let list = [] loadNums "dictionary.txt" list loadNums location list = do inh <- openF...
The error you're encountering arises from the fact that in Haskell, `inpStr:list` does not modify `list` in place; instead, it creates a new list. Additionally, you're missing the need to bind that new list back into a variable. Here's a revised version of your code that accomplishes the task of reading each line from...
31,744
[ { "from": "human", "value": "I'm currently working on project with Haskell, and have found myself some trouble. I'm supposed to read and insert into a list each line in a \"dictionary.txt\" file, but I can't seem to do so. I've got this code:\nmain = do\n let list = []\n loadNums \"dictionary.txt\" li...
If I have a comma separated file like the following: foo,bar,n ,a,bc,d one,two,three ,a,bc,d And I want to join the \n, to produce this: foo,bar,n,a,bc,d one,two,three,a,bc,d What is the regex trick? I thought that an if (/\n,/) would catch this. Also, will I need to do anything special for a UTF-8 encoded file? Fi...
To achieve the desired output from a CSV file where you want to join lines based on certain criteria (in this case, lines that start with a comma), you can use a regular expression to identify those lines and concatenate them appropriately. Here’s how you can do it using regex and the Groovy programming language: ###...
32,417
[ { "from": "human", "value": "If I have a comma separated file like the following:\n\nfoo,bar,n\n,a,bc,d\none,two,three\n,a,bc,d\n\nAnd I want to join the \\n, to produce this:\n\nfoo,bar,n,a,bc,d\none,two,three,a,bc,d\n\nWhat is the regex trick? I thought that an if (/\\n,/) would catch this.\nAlso, will I ...
I'm trying to extract an uploaded zip file and store its contents in the database, one entry per file. The rubyzip library has nearly no useful documentation. There is an assets table that has key :string (file name) and data :binary (file contents). I'm using the rubyzip library, and have made it as far as this: Zip:...
To extract file contents from a ZipEntry using the `rubyzip` library and store them directly in your database, you do not need to use a temporary file. Instead, you can read the contents of the `Zip::Entry` directly into memory. Here's how you can achieve that: You can use the `get_input_stream` method from the `Zip::...
32,080
[ { "from": "human", "value": "I'm trying to extract an uploaded zip file and store its contents in the database, one entry per file. The rubyzip library has nearly no useful documentation.\nThere is an assets table that has key :string (file name) and data :binary (file contents).\nI'm using the rubyzip lib...
Let's say you have a aspx page that does not rely on session, but does rely on viewstate for persistance between postbacks. If a user is accessing this page, and leaves for a long lunch, will viewstate still be valid when he returns?
Yes, ViewState will still be valid when the user returns, as long as certain conditions are met. ViewState is stored in a hidden field on the page and is tied to the specific instance of that page and the controls on it. Here are the key considerations: 1. **Page Lifecycle and ViewState**: When a user leaves the page ...
32,327
[ { "from": "human", "value": "Let's say you have a aspx page that does not rely on session, but does rely on viewstate for persistance between postbacks. \nIf a user is accessing this page, and leaves for a long lunch, will viewstate still be valid when he returns?\n" }, { "from": "gpt", "value":...
Does anyone know of a good Java API for controlling RS-232 devices in a WIN32 enviroment? I've tried RXTX but they don't support RS232, only RS-485.
It seems there's a bit of confusion regarding RXTX; it does indeed support RS-232 communication. RXTX is a popular Java library for serial communication, including RS-232 ports. If you are experiencing issues, it could be related to installation or configuration rather than an inherent limitation of the library. Howev...
31,272
[ { "from": "human", "value": "Does anyone know of a good Java API for controlling RS-232 devices in a WIN32 enviroment?\nI've tried RXTX but they don't support RS232, only RS-485.\n" }, { "from": "gpt", "value": "It seems there's a bit of confusion regarding RXTX; it does indeed support RS-232 co...
I'm working with a small FAT16 filesystem, and I want to generate CRC values for indidual XML files which store configuration information. In case the data changes or is corrupted, I want to be able to check the CRC to determine that the file is still in it's original state. The question is, how do I put the CRC value ...
When working with files that need to maintain integrity, such as configuration files in your case, storing a CRC (Cyclic Redundancy Check) value within the file can indeed pose a challenge, as it could alter the file's content and subsequently change the CRC that you want to verify. However, there are standard approach...
26,326
[ { "from": "human", "value": "I'm working with a small FAT16 filesystem, and I want to generate CRC values for indidual XML files which store configuration information. In case the data changes or is corrupted, I want to be able to check the CRC to determine that the file is still in it's original state.\nTh...
i wonder if there is a way to access a control's templatepart from within c# for modifying the part (e.g. hiding, etc..). is it possible to get a reference to the part with pure c#? i don't want to touch the controls template. thanks j.
In WPF (Windows Presentation Foundation), you can access a control's `TemplatePart` programmatically in C#. However, the direct access and manipulation of template parts typically require you to interact with the control's `Template` and retrieve the specific part you are interested in. Here's how you can access a `T...
30,517
[ { "from": "human", "value": "i wonder if there is a way to access a control's templatepart from within c# for modifying the part (e.g. hiding, etc..). is it possible to get a reference to the part with pure c#?\ni don't want to touch the controls template.\nthanks\nj.\n" }, { "from": "gpt", "val...
Is is better to do a joined query like this: var employer = (from person in db.People join employer in db.Employers on person.EmployerID equals employer.EmployerID where person.PersonID == idPerson select employer).FirstOrDefault(); Or is it just...
When choosing between two approaches to querying data in Entity Framework (or similar ORMs), there are several factors to consider, including readability, performance, and maintainability. Let's analyze the two queries you've provided. ### Query 1: Using a Join ```csharp var employer = (from person in db.People ...
32,494
[ { "from": "human", "value": "Is is better to do a joined query like this:\nvar employer = (from person in db.People\n join employer in db.Employers\n on person.EmployerID equals employer.EmployerID \n where person.PersonID == idPerson\n sel...
I'm considering altering some tables to use nvarchar(50) as primary key instead of an int primary key. Using an int ID for a key really is irrelevant data, it's the string I'm interested in. What sort of performance hit will occur, or where do you research this? Other than cut and try that is.
Using `nvarchar(50)` as a primary key instead of an `int` primary key can have several implications for performance, storage, and maintainability of your database. Here are some important considerations to keep in mind: ### Performance Considerations 1. **Storage Size**: - An `int` data type typically takes 4 byte...
30,931
[ { "from": "human", "value": "I'm considering altering some tables to use nvarchar(50) as primary key instead of an int primary key. Using an int ID for a key really is irrelevant data, it's the string I'm interested in. What sort of performance hit will occur, or where do you research this? Other than cut a...
I'm new to the MVC framework and wondering how to pass the RSS data from the controller to a view. I know there is a need to convert to an IEnumerable list of some sort. I have seen some examples of creating an anonymous type but can not figure out how to convert an RSS feed to a generic list and pass it to the view. ...
Passing RSS feed data from a controller to a view in an MVC framework can indeed be accomplished without using a strongly typed model. Since you want to work with multiple RSS feeds and prefer not to have a strong typing, you can return a dynamic collection of items. ### Step 1: Fetching the RSS Feed First, you need ...
32,355
[ { "from": "human", "value": "I'm new to the MVC framework and wondering how to pass the RSS data from the controller to a view. I know there is a need to convert to an IEnumerable list of some sort. I have seen some examples of creating an anonymous type but can not figure out how to convert an RSS feed to ...
I was wondering, what's the best approach in creating users authentication for my asp.net-mvc web application. Should I use the Forms authentication using a custom MembershipProvider ? Or should I implement my own login and registration mechanism for my users?
When it comes to user authentication in an ASP.NET MVC application, the best approach often depends on your specific needs, project requirements, and the complexity of the application you're building. Here’s a comparison of using Forms Authentication with a custom MembershipProvider versus implementing your own login a...
31,507
[ { "from": "human", "value": "I was wondering, what's the best approach in creating users authentication for my asp.net-mvc web application.\nShould I use the Forms authentication using a custom MembershipProvider ?\nOr should I implement my own login and registration mechanism for my users? \n" }, { ...
It's been my experience that some security software (like Symantec's Norton AntiVirus) oftentimes prohibit their removal from a Windows system via the "Add or Remove Programs" utility, going so far as to occasionally require a removal program obtained from Symantec's homepage. (I assume this it to prevent a malicious ...
You've touched on an important aspect of security software design: the ability to resist unauthorized removal. There are several reasons and techniques for implementing such measures, as well as considerations across different operating systems. ### Reasons for Resisting Removal 1. **Protection Against Malware**: One...
30,554
[ { "from": "human", "value": "It's been my experience that some security software (like Symantec's Norton AntiVirus) oftentimes prohibit their removal from a Windows system via the \"Add or Remove Programs\" utility, going so far as to occasionally require a removal program obtained from Symantec's homepage....
I am calling an unmanaged C++ dll that expects a char* as one of its parameters and I want to push a byte[] into it. The project is written in VB.NET. What type of marshalling will work for this?
To call an unmanaged C++ DLL that expects a `char*` parameter from VB.NET, you can use `MarshalAs` with the appropriate type for marshalling the `byte[]` array. In VB.NET, you can marshal a `byte[]` to a `char*` by using the `System.Runtime.InteropServices.Marshal` class. Since `byte` in .NET is equivalent to `unsign...
30,411
[ { "from": "human", "value": "I am calling an unmanaged C++ dll that expects a char* as one of its parameters and I want to push a byte[] into it. The project is written in VB.NET. \nWhat type of marshalling will work for this?\n" }, { "from": "gpt", "value": "To call an unmanaged C++ DLL that e...
Someone asked me a question via e-mail about integer partitions the other day (as I had released a Perl module, Integer::Partition, to generate them), that I was unable to answer. Background: here are all the integer partitions of 7 (the sum of each row equals 7). 7 6 1 5 2 5 1 1 4 3 4 2 1 4 1 1 1 3 3 1 3 2 2 3 2 1 1 3...
The distribution of partition lengths for integer partitions indeed shows a particular pattern that can sometimes resemble other statistical distributions. However, it is not strictly Gaussian or Poisson. Instead, the distribution of partition lengths has been studied and has known asymptotic behaviors, but no simple a...
27,622
[ { "from": "human", "value": "Someone asked me a question via e-mail about integer partitions the other day (as I had released a Perl module, Integer::Partition, to generate them), that I was unable to answer.\nBackground: here are all the integer partitions of 7 (the sum of each row equals 7).\n7\n6 1\n5 2\...
I have seen a few different in-process SQL databases for .NET (including one from Microsoft), but either they do not work under medium trust (ASP.NET) or the documentation/websites don't even talk about. What experiences have you had with in-process databases in general, and do you know of any that work under medium tr...
In-process SQL databases are a great option for applications that require lightweight data storage without the overhead of managing a full-fledged database server. However, the challenge of compatibility with medium trust in ASP.NET can limit your options. Here are some popular in-process databases and considerations r...
33,064
[ { "from": "human", "value": "I have seen a few different in-process SQL databases for .NET (including one from Microsoft), but either they do not work under medium trust (ASP.NET) or the documentation/websites don't even talk about.\nWhat experiences have you had with in-process databases in general, and do...
I know that in the original C++0x standard there was a feature called export. But I can't find a description or explanation of this feature. What is it supposed to do? Also: which compiler is supporting it?
The `export` keyword was part of an early draft of the C++11 standard (formerly known as C++0x). The intention behind `export` was to allow the separation of the declaration of a template from its definition, enabling templates to be defined in different translation units. This was supposed to allow developers to defin...
33,793
[ { "from": "human", "value": "I know that in the original C++0x standard there was a feature called export.\nBut I can't find a description or explanation of this feature. What is it supposed to do? Also: which compiler is supporting it?\n" }, { "from": "gpt", "value": "The `export` keyword was p...
Is it possible for the .NET CLR to support Objective-C? Are there any reasons (either from a legal or implementational) standpoint why this wouldn't be possible? In the spirit of cross-platform application development, it would be nice to be able to write and run Objective-C applications on Windows machines. At least I...
Supporting Objective-C on the .NET Common Language Runtime (CLR) would present several challenges, both legally and implementationally. Here are some key considerations: ### 1. Language Compatibility - **Language Paradigms**: Objective-C is an object-oriented language that extends C with Smalltalk-style messaging. The...
27,599
[ { "from": "human", "value": "Is it possible for the .NET CLR to support Objective-C? Are there any reasons (either from a legal or implementational) standpoint why this wouldn't be possible?\nIn the spirit of cross-platform application development, it would be nice to be able to write and run Objective-C ap...
i have java web service, returns an Object contains couple of variables data, this web service being called in ASP code, but asp code always getting the Mime Type is "text/plain". even though I did setup the below Response.ContentType = "application/xml" and not parsing the web service results and error out type mismat...
If you are encountering an issue where your Java web service is returning data with the MIME type of "text/plain" instead of "application/xml", there are a few steps you can take to troubleshoot and potentially resolve the issue. Here are some suggestions: ### 1. Check Java Web Service Configuration Ensure that your J...
27,744
[ { "from": "human", "value": "i have java web service, returns an Object contains couple of variables data, this web service being called in ASP code, but asp code always getting the Mime Type is \"text/plain\". even though I did setup the below\nResponse.ContentType = \"application/xml\"\nand not parsing th...
I'm trying to dynamically generate a gif image of a specified size and color in an HttpHandler. For some reason, the image is being generated with a dithered color pattern rather than the solid color I expected the SolidBrush to create. The following code is the simplest I could find that exposes the problem. private...
It looks like you've already identified the issue with the dithering in the GIF image generated by your code. When saving images as GIFs, GDI+ often uses a web-safe color palette, which can lead to dithering when colors outside that palette are used. To ensure that the specific color you want is represented correctly ...
33,328
[ { "from": "human", "value": "I'm trying to dynamically generate a gif image of a specified size and color in an HttpHandler. For some reason, the image is being generated with a dithered color pattern rather than the solid color I expected the SolidBrush to create. The following code is the simplest I cou...
I need a logging framework in my application. I have two candidates: Log4Net and Logging from Application Block. Which is better? any specific advantage to any of them? Thanks
Choosing between Log4Net and the Logging Application Block (part of the Microsoft Enterprise Library) depends on your specific requirements, preferences, and the context of your application. Here are some points to consider for each framework: ### Log4Net **Advantages:** 1. **Popularity and Community Support:** Log4N...
31,300
[ { "from": "human", "value": "I need a logging framework in my application. I have two candidates: Log4Net and Logging from Application Block.\nWhich is better? any specific advantage to any of them?\nThanks\n" }, { "from": "gpt", "value": "Choosing between Log4Net and the Logging Application Blo...
We've purchased a tool from Redgate called SQL Data Compare. I use it mainly for testing purposes to prove that my application is making the modifications to the database that I think it is, and not making any other changes. My current application has both "online" and "offline" editing. In online mode you are workin...
Creating a linked server to a SQL Server Compact Edition (SQL CE) database from SQL Server is not straightforward, primarily because SQL CE does not support OLE DB or ODBC in the way that SQL Server typically interacts with linked servers. However, you can create a workaround using an intermediary approach. Below are a...
31,476
[ { "from": "human", "value": "We've purchased a tool from Redgate called SQL Data Compare. I use it mainly for testing purposes to prove that my application is making the modifications to the database that I think it is, and not making any other changes.\nMy current application has both \"online\" and \"off...
My platform: Visual C# 2008 Express Edition with NUnit 2.2.7 I have a solution with my code in one project and my NUnit unit tests in a different project in the same solution. I have been struggling hard to debug and single-step through the NUnit tests. I found some references online that suggested calling the followi...
Using NUnit within Visual C# 2008 Express Edition can be a bit cumbersome, especially when trying to debug your unit tests. Your current approach to call the test methods directly is a workaround that allows you to debug but isn't the most elegant solution. Below are some suggestions that could improve your experience:...
32,349
[ { "from": "human", "value": "My platform: Visual C# 2008 Express Edition with NUnit 2.2.7\nI have a solution with my code in one project and my NUnit unit tests in a different project in the same solution.\nI have been struggling hard to debug and single-step through the NUnit tests. I found some reference...
I am using Ruby on Rails. I want to create a filter field on a page such that whenever the input field's value changes I filter a list shown below via ajax. (Exaclty like the Users search works in Stackoverflow) For now, I made it run with a form_remote_tag containing a text_field_tag and a submit_tag, and it filters m...
To achieve the desired behavior of filtering a list with AJAX every time the value of an input field changes in Ruby on Rails, you can use JavaScript (or jQuery) to handle the `input` or `change` event. The `onchange` event might not trigger as expected in some scenarios, especially if you're trying to catch every char...
31,385
[ { "from": "human", "value": "I am using Ruby on Rails.\nI want to create a filter field on a page such that whenever the input field's value changes I filter a list shown below via ajax. (Exaclty like the Users search works in Stackoverflow)\nFor now, I made it run with a form_remote_tag containing a text_f...