instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
Is there a way to take over the Entity Framework class builder? I want to be able to have my own class builder so i can make some properties to call other methods upon materialization or make the entity classes partial.
| To take over or customize the Entity Framework (EF) class generation process, you can employ several strategies. While EF does not provide a direct way to override its internal class builder, you can use some workarounds to achieve your objectives, like creating custom partial classes and extending the generated classe... | 483 | [
{
"from": "human",
"value": "Is there a way to take over the Entity Framework class builder? I want to be able to have my own class builder so i can make some properties to call other methods upon materialization or make the entity classes partial.\n"
},
{
"from": "gpt",
"value": "To take over o... |
I've started to add the time taken to render a page to the footer of our internal web applications. Currently it appears like this
Rendered in 0.062 seconds
Occasionally I get rendered times like this
Rendered in 0.000 seconds
Currently it's only meant to be a guide for users to judge whether a page is quick to loa... | When displaying page render times, it's important to balance precision with clarity, particularly if the primary audience is internal users who may not be familiar with interpreting the technical details. Here are some considerations for formatting the render time:
1. **Threshold for Displaying Time**:
- You could ... | 2,773 | [
{
"from": "human",
"value": "I've started to add the time taken to render a page to the footer of our internal web applications. Currently it appears like this\n\nRendered in 0.062 seconds\n\nOccasionally I get rendered times like this\n\nRendered in 0.000 seconds\n\nCurrently it's only meant to be a guide ... |
Unit testing and ASP.NET web applications are an ambiguous point in my group. More often than not, good testing practices fall through the cracks and web applications end up going live for several years with no tests.
The cause of this pain point generally revolves around the hassle of writing UI automation mid-develo... | Integrating Test-Driven Development (TDD) practices into ASP.NET web application development can be challenging, especially when it comes to UI automation. However, there are strategies and methodologies that can help streamline the process and ensure that tests are an integral part of the development lifecycle. Here a... | 1,070 | [
{
"from": "human",
"value": "Unit testing and ASP.NET web applications are an ambiguous point in my group. More often than not, good testing practices fall through the cracks and web applications end up going live for several years with no tests. \nThe cause of this pain point generally revolves around the ... |
I currently work with an Oracle database and we use stored procedures for all our SQL queries. The problem I have is that we do not really having a coding standard for our packages. So what happens is that every developer has a different style (or in some cases no sense of style) in how they format there packages. Maki... | There are several free SQL code formatters available that you can use to help standardize your SQL formatting in Oracle stored procedures. Here are some options you can consider:
1. **SQL Formatter by SQL Fiddle**: SQL Fiddle has a basic SQL formatter tool that can be used online. It might not be as feature-rich but c... | 2,078 | [
{
"from": "human",
"value": "I currently work with an Oracle database and we use stored procedures for all our SQL queries. The problem I have is that we do not really having a coding standard for our packages. So what happens is that every developer has a different style (or in some cases no sense of style... |
I often run into the following problem.
I work on some changes to a project that require new tables or columns in the database. I make the database modifications and continue my work. Usually, I remember to write down the changes so that they can be replicated on the live system. However, I don't always remember what I... | Yes, there are version control systems and tools specifically designed for managing database schema changes, often referred to as database migrations or database versioning. These tools help you track changes to your database schema, just like you would with code in a version control system like Git. Here are some popu... | 2,265 | [
{
"from": "human",
"value": "I often run into the following problem.\nI work on some changes to a project that require new tables or columns in the database. I make the database modifications and continue my work. Usually, I remember to write down the changes so that they can be replicated on the live syste... |
I've just put my new server up on an IP address with a domain pointing to it. I need to be able to remote admin it. I've opened the firewall for Remote Desktop and HTTP traffic. Is this going to be secure enough? I guess I should probably rename the administrator user...
| Setting up a new server with remote access capabilities is a crucial step, but security should be a top priority. Here are some recommendations to enhance the security of your server:
1. **Firewall Configuration**:
- Ensure that you have not only opened the firewall for Remote Desktop Protocol (RDP) and HTTP traffi... | 1,474 | [
{
"from": "human",
"value": "I've just put my new server up on an IP address with a domain pointing to it. I need to be able to remote admin it. I've opened the firewall for Remote Desktop and HTTP traffic. Is this going to be secure enough? I guess I should probably rename the administrator user...\n"
},... |
Can I use this approach efficiently?
using(SqlCommand cmd = new SqlCommand("GetSomething", new SqlConnection(Config.ConnectionString))
{
cmd.Connection.Open();
// set up parameters and CommandType to StoredProcedure etc. etc.
cmd.ExecuteNonQuery();
}
My concern is : Will the Dispose method of the SqlComman... | In your code snippet, the `using` statement is applied to `SqlCommand`, but it does not manage the `SqlConnection` object effectively because you're creating a new `SqlConnection` without properly handling its lifecycle. When the `using` block completes, only the `SqlCommand` is disposed, and the `SqlConnection` remain... | 2,670 | [
{
"from": "human",
"value": "Can I use this approach efficiently?\nusing(SqlCommand cmd = new SqlCommand(\"GetSomething\", new SqlConnection(Config.ConnectionString))\n{\n cmd.Connection.Open();\n // set up parameters and CommandType to StoredProcedure etc. etc.\n cmd.ExecuteNonQuery();\n}\n\nMy co... |
I have configured Indexing Service to index my files, which also include scanned images saved as hi-res TIFF files. I also installed MS Office 2003+ and configured MS Office Document Imaging (MODI) correctly, so I can perform OCR on my images and even embed the OCR'd text into TIFFs.
Indexing Service is able to index a... | Yes, there are better solutions to allow Microsoft Office Document Imaging (MODI) to work without having to disable Data Execution Prevention (DEP) completely. You can configure DEP to allow specific applications to run with exceptions. Here’s how to do that:
### Steps to Add MODI to DEP Exceptions:
1. **Open System ... | 2,559 | [
{
"from": "human",
"value": "I have configured Indexing Service to index my files, which also include scanned images saved as hi-res TIFF files. I also installed MS Office 2003+ and configured MS Office Document Imaging (MODI) correctly, so I can perform OCR on my images and even embed the OCR'd text into T... |
I'm packaging up a .NET 2.0 based web app for deployment through a Windows Installer based package. Our app uses Report Viewer 2008 and I'm including the Microsoft Report Viewer Redistributable 2008 installer. When I check the download page for Report Viewer 2008, it lists .NET 3.5 as a requirement.
Is having .Net ... | The Microsoft Report Viewer 2008 does indeed have a dependency on .NET Framework 3.5. This means that even though your application is targeting .NET 2.0, the Report Viewer itself requires the 3.5 framework to be installed on the target machine.
Here are a few points to consider regarding your situation:
1. **Report V... | 2,128 | [
{
"from": "human",
"value": "I'm packaging up a .NET 2.0 based web app for deployment through a Windows Installer based package. Our app uses Report Viewer 2008 and I'm including the Microsoft Report Viewer Redistributable 2008 installer. When I check the download page for Report Viewer 2008, it lists .NE... |
I'd like to have a java.utils.Timer with a resettable time in java.I need to set a once off event to occur in X seconds. If nothing happens in between the time the timer was created and X seconds, then the event occurs as normal.
If, however, before X seconds has elapsed, I decide that the event should occur after Y s... | You're correct that `java.util.Timer` does not have built-in support for resetting the timer with new timings directly, as once you cancel a timer, you can't reuse it. However, you can implement a mechanism to achieve the desired behavior by creating your own resettable timer class. This class can internally manage a `... | 1,131 | [
{
"from": "human",
"value": "I'd like to have a java.utils.Timer with a resettable time in java.I need to set a once off event to occur in X seconds. If nothing happens in between the time the timer was created and X seconds, then the event occurs as normal. \nIf, however, before X seconds has elapsed, I de... |
Here is a simplification of my database:
Table: Property
Fields: ID, Address
Table: Quote
Fields: ID, PropertyID, BespokeQuoteFields...
Table: Job
Fields: ID, PropertyID, BespokeJobFields...
Then we have other tables that relate to the Quote and Job tables individually.
I now need to add a Message table where users c... | Creating a system that effectively manages the relationship between messages, quotes, and jobs while maintaining referential integrity can indeed be a challenge, especially when adhering to the DRY (Don't Repeat Yourself) principle. Here are a couple of elegant solutions to consider:
### Solution 1: Polymorphic Associ... | 1,020 | [
{
"from": "human",
"value": "Here is a simplification of my database:\nTable: Property\nFields: ID, Address\n\nTable: Quote\nFields: ID, PropertyID, BespokeQuoteFields...\n\nTable: Job\nFields: ID, PropertyID, BespokeJobFields...\nThen we have other tables that relate to the Quote and Job tables individuall... |
How can I add rules to Visual Studio (2005 and up) for validating property markup (HTML) for a vendor's proprietary controls?
My client uses a control which requires several properties to be set as tags in the aspx file which generates something like 215 validation errors on each build. It's not preventing me from buil... | To manage validation errors for proprietary controls in Visual Studio (2005 and up), you can customize the validation rules in a few different ways. Here are some approaches you can take to reduce the noise from validation warnings/errors:
### 1. Disable Specific Validation Rules
If the proprietary control is generati... | 2,159 | [
{
"from": "human",
"value": "How can I add rules to Visual Studio (2005 and up) for validating property markup (HTML) for a vendor's proprietary controls?\nMy client uses a control which requires several properties to be set as tags in the aspx file which generates something like 215 validation errors on ea... |
In LINQ to SQL, is it possible to check to see if an entity is already part of the data context before trying to attach it?
A little context if it helps...
I have this code in my global.asax as a helper method. Normally, between requests, this isn't a problem. But right after signing in, this is getting called more t... | Yes, in LINQ to SQL, you can check if an entity is already part of the data context before attempting to attach it. When dealing with a data context, entities that are attached are tracked, and you can check if an entity exists in the context by using its `GetChangeSet()` method or by checking the `Local` property if y... | 1,042 | [
{
"from": "human",
"value": "In LINQ to SQL, is it possible to check to see if an entity is already part of the data context before trying to attach it?\nA little context if it helps...\nI have this code in my global.asax as a helper method. Normally, between requests, this isn't a problem. But right afte... |
I have a ListView control, and I'm trying to figure out the easiest/best way to disallow changing the selected row(s), without hiding the selected row(s).
I know there's a HideSelection property, but that only works when the ListView is still enabled (but not focused). I need the selection to be viewable even when the ... | To prevent changing the selected row(s) in a `ListView` control while ensuring that the selected items remain visible (even when the control is disabled), you can override the default behavior of the control by handling certain events and ensuring that the selection state remains unchanged.
Here are a few approaches t... | 1,661 | [
{
"from": "human",
"value": "I have a ListView control, and I'm trying to figure out the easiest/best way to disallow changing the selected row(s), without hiding the selected row(s).\nI know there's a HideSelection property, but that only works when the ListView is still enabled (but not focused). I need t... |
The RoR tutorials posit one model per table for the ORM to work.
My DB schema has some 70 tables divided conceptually into 5 groups of functionality
(eg, any given table lives in one and only one functional group, and relations between tables of different groups are minimised.)
So: should I design a model per conceptu... | In Ruby on Rails, the convention is indeed to have one model per database table, and this aligns with the Active Record pattern that Rails uses for Object-Relational Mapping (ORM). However, your question about whether to group models based on functionality is valid and largely depends on your project's architecture, co... | 1,784 | [
{
"from": "human",
"value": "The RoR tutorials posit one model per table for the ORM to work.\nMy DB schema has some 70 tables divided conceptually into 5 groups of functionality\n(eg, any given table lives in one and only one functional group, and relations between tables of different groups are minimised... |
Right now I am working on a solution to archive older data from a big working database to a separate archive database with the same schema. I move the data using SQL scripts and SQL Server Management Objects (SMO) from a .Net executable written in C#.
The archived data should still be accessible and even (occassionally... | Archiving data while maintaining the relationships and accessibility of the data can indeed be a challenge, especially in a large database. Here are several strategies and best practices that can help you improve your archiving process in SQL Server:
### 1. **Partitioning**
- **Table Partitioning**: Instead of physica... | 968 | [
{
"from": "human",
"value": "Right now I am working on a solution to archive older data from a big working database to a separate archive database with the same schema. I move the data using SQL scripts and SQL Server Management Objects (SMO) from a .Net executable written in C#.\nThe archived data should s... |
I'm currently trying to read in an XML file, make some minor changes (alter the value of some attributes), and write it back out again.
I have intended to use a StAX parser (javax.xml.stream.XMLStreamReader) to read in each event, see if it was one I wanted to change, and then pass it straight on to the StAX writer (ja... | You're correct that using StAX (Streaming API for XML) can be a bit tricky for modifying XML documents because it is primarily designed for processing XML streams rather than manipulating them in a straightforward way. Since StAX operates in a pull-based manner, you'll have to handle the events manually.
However, you ... | 434 | [
{
"from": "human",
"value": "I'm currently trying to read in an XML file, make some minor changes (alter the value of some attributes), and write it back out again.\nI have intended to use a StAX parser (javax.xml.stream.XMLStreamReader) to read in each event, see if it was one I wanted to change, and then ... |
I use TortoiseSVN to access file based local repo. In all my commits an author is my Windows login name. Is it possible to use different name?
I know how to change author after commit but how to change before? Installing apache/svnserver is not an option.
| Yes, you can change the author name for your commits in TortoiseSVN before you make the commit. This can be done by using the `svn` command line interface to set the author information in your local SVN configuration.
Here's how you can change your author name for commits in TortoiseSVN:
1. **Edit `config` File:**
... | 2,760 | [
{
"from": "human",
"value": "I use TortoiseSVN to access file based local repo. In all my commits an author is my Windows login name. Is it possible to use different name?\nI know how to change author after commit but how to change before? Installing apache/svnserver is not an option. \n"
},
{
"from... |
I've seen quite a few posts on changes in .NET 3.5 SP1, but stumbled into one that I've yet to see documentation for yesterday. I had code working just fine on my machine, from VS, msbuild command line, everything, but it failed on the build server (running .NET 3.5 RTM).
[XmlRoot("foo")]
public class Foo
{
static... | You've encountered a specific change in behavior regarding XML serialization in .NET 3.5 SP1 compared to the earlier RTM version. This change, particularly how the XmlSerializer handles read-only properties during deserialization, can indeed be confusing and lead to the kind of issues you experienced.
### Change Overv... | 2,305 | [
{
"from": "human",
"value": "I've seen quite a few posts on changes in .NET 3.5 SP1, but stumbled into one that I've yet to see documentation for yesterday. I had code working just fine on my machine, from VS, msbuild command line, everything, but it failed on the build server (running .NET 3.5 RTM).\n[Xml... |
Does anyone here know any resources on how to get started writing a plugin for Google's Picasa? I love it for photo management, but I have some ideas for how it could be better.
Riya-esque facial search: given a large enough corpus of faces and pictures (people tend to be repeated often in individuals' albums (famil... | While Picasa was a popular photo management tool, it's important to note that Google discontinued Picasa in 2016, which means that resources for developing plugins for it may be scarce and potentially outdated. However, I can still provide some guidance on how to approach developing a plugin or similar functionality ba... | 1,646 | [
{
"from": "human",
"value": "Does anyone here know any resources on how to get started writing a plugin for Google's Picasa? I love it for photo management, but I have some ideas for how it could be better.\n\nRiya-esque facial search: given a large enough corpus of faces and pictures (people tend to be r... |
I am a member of all the roles (Browser, Content Manager, My Reports, Publisher, Report Builder). If I login with a Local Administrator account, I can see and use it fine. Any ideas?
| It sounds like you're experiencing issues accessing certain features or functionalities in a system where you are a member of multiple roles. Since you can use everything properly when logged in as a Local Administrator but not under your standard user account, consider the following potential reasons and solutions:
1... | 1,596 | [
{
"from": "human",
"value": "I am a member of all the roles (Browser, Content Manager, My Reports, Publisher, Report Builder). If I login with a Local Administrator account, I can see and use it fine. Any ideas?\n"
},
{
"from": "gpt",
"value": "It sounds like you're experiencing issues accessing... |
I'm using Pylons (a python framework) to serve a simple web application, but it seems to die from time to time, with this in the error log: (2006, 'MySQL server has gone away')
I did a bit of checking, and saw that this was because the connections to MySQL were not being renewed. This shouldn't be a problem though, bec... | The error `(2006, 'MySQL server has gone away')` can be caused by various factors, including connection timeouts, large packets, or server resource limits. Since you've already adjusted `sqlalchemy.pool_recycle`, there are a few additional things you can investigate:
### 1. MySQL Configuration
You may need to check yo... | 1,887 | [
{
"from": "human",
"value": "I'm using Pylons (a python framework) to serve a simple web application, but it seems to die from time to time, with this in the error log: (2006, 'MySQL server has gone away')\nI did a bit of checking, and saw that this was because the connections to MySQL were not being renewe... |
I am particularly interested in Document Libraries, but in terms of general SharePoint lists, can anyone answer the following...?
What is the maximum number of items that a SharePoint list can contain?
What is the maximum number of lists that a single SharePoint server can host?
When the number of items in the list ap... | Certainly! Here are the answers to your questions regarding SharePoint lists:
### 1. Maximum Number of Items in a SharePoint List
The maximum number of items that a SharePoint list can contain is **30 million items**. However, it’s important to note that while lists can theoretically hold this many items, practical pe... | 1,739 | [
{
"from": "human",
"value": "I am particularly interested in Document Libraries, but in terms of general SharePoint lists, can anyone answer the following...?\n\nWhat is the maximum number of items that a SharePoint list can contain?\nWhat is the maximum number of lists that a single SharePoint server can h... |
Anyone have any good urls for templates or diagram examples in Visio 2007 to be used in software architecture?
| Here are some resources where you can find templates and diagram examples for Visio 2007, specifically for software architecture:
1. **Microsoft's Official Templates**:
- Microsoft provides templates for various versions of Visio. You can browse through the available templates specific to Visio 2007 on their [Micro... | 2,127 | [
{
"from": "human",
"value": "Anyone have any good urls for templates or diagram examples in Visio 2007 to be used in software architecture?\n"
},
{
"from": "gpt",
"value": "Here are some resources where you can find templates and diagram examples for Visio 2007, specifically for software archite... |
Does anyone know of a .NET date/time parser similar to Chronic for Ruby (handles stuff like "tomorrow" or "3pm next thursday")?
Note: I do write Ruby (which is how I know about Chronic) but this project must use .NET.
| Yes, in the .NET ecosystem, you can use libraries that offer similar functionality to Ruby's Chronic for parsing human-readable date and time strings. Here are a couple of options you can consider:
1. **NodaTime**: While primarily focused on providing an alternative to `DateTime` and improving date and time handling, ... | 3,915 | [
{
"from": "human",
"value": "Does anyone know of a .NET date/time parser similar to Chronic for Ruby (handles stuff like \"tomorrow\" or \"3pm next thursday\")?\nNote: I do write Ruby (which is how I know about Chronic) but this project must use .NET.\n"
},
{
"from": "gpt",
"value": "Yes, in the... |
In particular, I have to extract all the messages and attachments from Lotus Notes files in the fastest and most reliable way. Another point that may be relevant is that I need to do this from a secondary thread.
Edit
Thanks for the answers - both of which are good. I should provide more background information.
We cur... | Extracting messages and attachments from Lotus Notes files can indeed be challenging, especially when dealing with multi-threading issues and the Notes COM API. Here are some suggestions to help you work around these problems and potentially improve the stability of your WinForms application.
### 1. Initialization in ... | 1,349 | [
{
"from": "human",
"value": "In particular, I have to extract all the messages and attachments from Lotus Notes files in the fastest and most reliable way. Another point that may be relevant is that I need to do this from a secondary thread.\nEdit\nThanks for the answers - both of which are good. I should p... |
What's the optimal level of concurrency that the C++ implementation of BerkeleyDB can reasonably support?
How many threads can I have hammering away at the DB before throughput starts to suffer because of resource contention?
I've read the manual and know how to set the number of locks, lockers, database page size, e... | The optimal level of concurrency for Berkeley DB (BDB) can depend on various factors, including the hardware you are using, the specific workload patterns, and how you've configured BDB. However, I can provide some general guidelines and insights based on real-world experience.
### Key Factors Affecting Concurrency:
... | 2,247 | [
{
"from": "human",
"value": "\nWhat's the optimal level of concurrency that the C++ implementation of BerkeleyDB can reasonably support?\nHow many threads can I have hammering away at the DB before throughput starts to suffer because of resource contention?\n\nI've read the manual and know how to set the nu... |
I need to try to lock on an object, and if its already locked just continue (after time out, or without it).
The C# lock statement is blocking.
| If you need to achieve locking on an object in C# that doesn't block and allows you to continue executing code if the lock is already acquired by another thread, you can use the `Monitor.TryEnter` method instead of the `lock` statement.
Here’s how you can implement it:
1. **Use a `bool` flag to indicate whether the l... | 2,395 | [
{
"from": "human",
"value": "I need to try to lock on an object, and if its already locked just continue (after time out, or without it).\nThe C# lock statement is blocking.\n"
},
{
"from": "gpt",
"value": "If you need to achieve locking on an object in C# that doesn't block and allows you to co... |
First off, I am using Windows XP. I have multiple hard drives and it looks like something decided to make some folders on the second one ( which is just a data drive, no os ). These folders all have names like "e69f29f1b1f166d3d30b8c9f7156ba" and "bd92c24cc278614082cd88e7a64b". They contain folders named update, who... | The folders you are seeing on your second hard drive with names like "e69f29f1b1f166d3d30b8c9f7156ba" are likely related to temporary files or installation files created by software on your system, possibly during the installation of updates or software applications. The fact that these folders contain names that are h... | 1,771 | [
{
"from": "human",
"value": "First off, I am using Windows XP. I have multiple hard drives and it looks like something decided to make some folders on the second one ( which is just a data drive, no os ). These folders all have names like \"e69f29f1b1f166d3d30b8c9f7156ba\" and \"bd92c24cc278614082cd88e7a6... |
I have a Singleton/Factory object that I'd like to write a JUnit test for. The Factory method decides which implementing class to instantiate based upon a classname in a properties file on the classpath. If no properties file is found, or the properties file does not contain the classname key, then the class will insta... | To test your Singleton/Factory class while ensuring that each test method runs in a separate classloader, you can leverage JUnit's features along with some Java capabilities for creating a new classloader. While JUnit does not have built-in support for running tests in separate classloaders directly, you can achieve th... | 1,242 | [
{
"from": "human",
"value": "I have a Singleton/Factory object that I'd like to write a JUnit test for. The Factory method decides which implementing class to instantiate based upon a classname in a properties file on the classpath. If no properties file is found, or the properties file does not contain the... |
This is an adapted version of a question from someone in my office. She's trying to determine how to tell what ports MSDE is running on for an application we have in the field.
Answers to that narrower question would be greatly appreciated. I'm also interested in a broader answer that could be applied to any networke... | To determine what ports MSDE (Microsoft SQL Server Desktop Engine) is running on for your application, you can follow these steps:
### Finding the Port for MSDE:
1. **Check Configuration Files:**
- If your application has configuration files (like `.ini`, `.config`, etc.), check these files for any settings that s... | 1,335 | [
{
"from": "human",
"value": "This is an adapted version of a question from someone in my office. She's trying to determine how to tell what ports MSDE is running on for an application we have in the field.\nAnswers to that narrower question would be greatly appreciated. I'm also interested in a broader an... |
I have
class Foo < ActiveRecord::Base
named_scope :a, lambda { |a| :conditions => { :a => a } }
named_scope :b, lambda { |b| :conditions => { :b => b } }
end
I'd like
class Foo < ActiveRecord::Base
named_scope :ab, lambda { |a,b| :conditions => { :a => a, :b => b } }
end
but I'd prefer to do it in a DRY fashion... | You can achieve a more DRY approach by defining a method that combines the two named scopes into one. This will allow you to construct the query with a single call while still keeping it readable. Here's how you can do it:
```ruby
class Foo < ActiveRecord::Base
named_scope :a, lambda { |a| { conditions: { a: a } } }... | 2,587 | [
{
"from": "human",
"value": "I have\nclass Foo < ActiveRecord::Base\n named_scope :a, lambda { |a| :conditions => { :a => a } }\n named_scope :b, lambda { |b| :conditions => { :b => b } }\nend\n\nI'd like\nclass Foo < ActiveRecord::Base\n named_scope :ab, lambda { |a,b| :conditions => { :a => a, :b => b ... |
How do you redirect HTTPS to HTTP?. That is, the opposite of what (seemingly) everyone teaches.
I have a server on HTTPS for which I paid an SSL certification for and a mirror for which I haven't and keep around for just for emergencies so it doesn't merit getting a certification for.
On my client's desktops I have SOM... | To redirect HTTPS requests to HTTP on your server, you need to configure your web server to handle the redirection properly. Below are the steps for Apache and Nginx, which are two of the most common web servers.
### For Apache
1. **Enable `mod_rewrite`:** Make sure that the `mod_rewrite` module is enabled. You can d... | 2,153 | [
{
"from": "human",
"value": "How do you redirect HTTPS to HTTP?. That is, the opposite of what (seemingly) everyone teaches.\nI have a server on HTTPS for which I paid an SSL certification for and a mirror for which I haven't and keep around for just for emergencies so it doesn't merit getting a certificati... |
I am maintaining a few web applications. The development and qa environments use invalid/outdated ssl-certificates.
Although it is generally a good thing, that Firefox makes me click like a dozen times to accept the certificate, this is pretty annoying.
Is there a configuration-parameter to make Firefox (and possibly I... | It's generally not recommended to disable SSL certificate validation due to the security implications. However, if you still need to bypass SSL warnings for development environments, here are some options for both Firefox and Internet Explorer:
### Firefox
To disable SSL certificate verification in Firefox (not recom... | 1,991 | [
{
"from": "human",
"value": "I am maintaining a few web applications. The development and qa environments use invalid/outdated ssl-certificates.\nAlthough it is generally a good thing, that Firefox makes me click like a dozen times to accept the certificate, this is pretty annoying.\nIs there a configuratio... |
Mocking sealed classes can be quite a pain. I currently favor an Adapter pattern to handle this, but something about just keeps feels weird.
So, What is the best way you mock sealed classes?
Java answers are more than welcome. In fact, I would anticipate that the Java community has been dealing with this longer and... | Mocking sealed classes can indeed be challenging, as sealed classes cannot be inherited, which limits your ability to create mock implementations using traditional inheritance. Here are some approaches from both the .NET and Java communities for mocking sealed classes:
### 1. **Adapter Pattern (Wrapper Class)**
As you... | 920 | [
{
"from": "human",
"value": "Mocking sealed classes can be quite a pain. I currently favor an Adapter pattern to handle this, but something about just keeps feels weird. \nSo, What is the best way you mock sealed classes?\nJava answers are more than welcome. In fact, I would anticipate that the Java comm... |
How does Google Chrome command and control multiple cross platform processes and provide a shared window / rendering area?
Any insights?
| Google Chrome employs a multi-process architecture to enhance performance, security, and stability. In this architecture, Chrome uses multiple processes to manage various components of the browser, including tabs, extensions, and rendering tasks. Here's an overview of how it controls these processes and provides a shar... | 1,326 | [
{
"from": "human",
"value": "How does Google Chrome command and control multiple cross platform processes and provide a shared window / rendering area?\nAny insights?\n"
},
{
"from": "gpt",
"value": "Google Chrome employs a multi-process architecture to enhance performance, security, and stabili... |
I'm developing an application for Windows Mobile Devices using Visual Studio .NET 2008 whose UI requires the use of a ComboBox control. Unfortunately, for devices with neither a hardware fullsize keyboard nor a touchscreen interface, there is no way to move (tab) from the ComboBox control to another control on the same... | You're on the right track by using the `KeyDown` and `KeyUp` events. It sounds like you've already made some progress in capturing the directional key presses. However, if you're looking for a more streamlined solution, here are a few alternative approaches you could consider:
1. **Using the KeyDown Event**: You can h... | 1,809 | [
{
"from": "human",
"value": "I'm developing an application for Windows Mobile Devices using Visual Studio .NET 2008 whose UI requires the use of a ComboBox control. Unfortunately, for devices with neither a hardware fullsize keyboard nor a touchscreen interface, there is no way to move (tab) from the ComboB... |
What do you think the future of GPU as a CPU initiatives like CUDA are? Do you think they are going to become mainstream and be the next adopted fad in the industry? Apple is building a new framework for using the GPU to do CPU tasks and there has been alot of success in the Nvidias CUDA project in the sciences. Would ... | The future of GPU computing initiatives like CUDA appears promising, especially given the increasing demand for high-performance computing across various sectors, including artificial intelligence, machine learning, scientific computing, and even graphics rendering. Here are some key points to consider regarding the po... | 1,649 | [
{
"from": "human",
"value": "What do you think the future of GPU as a CPU initiatives like CUDA are? Do you think they are going to become mainstream and be the next adopted fad in the industry? Apple is building a new framework for using the GPU to do CPU tasks and there has been alot of success in the Nvi... |
We’ve found that the unit tests we’ve written for our C#/C++ code have really paid off.
But we still have thousands of lines of business logic in stored procedures, which only really get tested in anger when our product is rolled out to a large number of users.
What makes this worse is that some of these stored proce... | Unit testing stored procedures can be quite challenging, especially when dealing with the issues you’ve described. However, many teams have successfully implemented strategies to test stored procedures effectively. Here’s a structured approach and insights regarding your questions:
### 1. Unit Testing Stored Procedure... | 716 | [
{
"from": "human",
"value": "We’ve found that the unit tests we’ve written for our C#/C++ code have really paid off. \nBut we still have thousands of lines of business logic in stored procedures, which only really get tested in anger when our product is rolled out to a large number of users. \nWhat makes th... |
I wondered if anyone uses virtualized desktop PCs (running WinXP Pro or older) to have some old applications that are seldom used available for some ongoing tasks.
Say you have a really old project that every once in a while needs a document update in a database system or something like that. The database application i... | Using virtualized desktop PCs for running older applications, like Windows XP or earlier, is indeed a viable solution for many organizations. It allows businesses to retain access to legacy software while optimizing resources such as energy consumption, hardware requirements, and physical space. Here are some key point... | 1,022 | [
{
"from": "human",
"value": "I wondered if anyone uses virtualized desktop PCs (running WinXP Pro or older) to have some old applications that are seldom used available for some ongoing tasks.\nSay you have a really old project that every once in a while needs a document update in a database system or somet... |
How can a .net class library project and resulting dll be protected so it cant be referenced by other applications (.net projects) except those projects in my own solution?
| Protecting a .NET class library (DLL) to ensure that it can only be referenced by certain applications within your own solution is a challenging task because .NET assemblies are inherently designed to be reusable and shareable. However, you can apply a few techniques to help secure your DLL and limit its accessibility:... | 49 | [
{
"from": "human",
"value": "How can a .net class library project and resulting dll be protected so it cant be referenced by other applications (.net projects) except those projects in my own solution?\n"
},
{
"from": "gpt",
"value": "Protecting a .NET class library (DLL) to ensure that it can o... |
I've had this long term issue in not quite understanding how to implement a decent Lucene sort or ranking. Say I have a list of cities and their populations. If someone searches "new" or "london" I want the list of prefix matches ordered by population, and I have that working with a prefix search and an sort by field ... | To achieve the desired sorting and ranking behavior in Lucene, you can use a combination of a scoring mechanism and a custom sorting strategy. You want exact matches to appear first in the results, followed by prefix matches sorted by population. Here’s how to approach this problem:
### Step-by-Step Solution
1. **Boo... | 2,350 | [
{
"from": "human",
"value": "I've had this long term issue in not quite understanding how to implement a decent Lucene sort or ranking. Say I have a list of cities and their populations. If someone searches \"new\" or \"london\" I want the list of prefix matches ordered by population, and I have that worki... |
Instead of relying on my host to send an email, I was thinking of sending the email messages using my Gmail account. The emails are personalized emails to the bands I play on my show.
Is it possible to do it?
| Yes, it's possible to send personalized emails using your Gmail account. There are several methods you can use to automate this process while still maintaining the personalization aspect. Here are a few options:
### 1. **Mail Merge with Google Sheets and Gmail**
You can use Google Sheets in combination with Gmail to s... | 1,570 | [
{
"from": "human",
"value": "Instead of relying on my host to send an email, I was thinking of sending the email messages using my Gmail account. The emails are personalized emails to the bands I play on my show. \nIs it possible to do it?\n"
},
{
"from": "gpt",
"value": "Yes, it's possible to s... |
How do you get the maximum number of bytes that can be passed to a sendto(..) call for a socket opened as a UDP port?
| To determine the maximum number of bytes that can be passed to a `sendto()` call for a UDP socket, you need to consider the following:
1. **UDP Protocol Limitations**: The maximum size of a UDP packet is defined by the protocol itself. According to the specifications of the UDP protocol, the maximum size of a UDP data... | 1,557 | [
{
"from": "human",
"value": "How do you get the maximum number of bytes that can be passed to a sendto(..) call for a socket opened as a UDP port?\n"
},
{
"from": "gpt",
"value": "To determine the maximum number of bytes that can be passed to a `sendto()` call for a UDP socket, you need to consi... |
I have a fairly small MySQL database (a Textpattern install) on a server that I do not have SSH access to (I have FTP access only). I need to regularly download the live database to my local dev server on demand; i.e., I would like to either run a script and/or have a cron job running. What are some good ways of doing ... | To automate the process of downloading your live MySQL database to your local development server, you can indeed utilize the `mysqldump` command with the password included, as you've already identified. Here’s a step-by-step guide to help you set this up effectively:
### Step 1: Create a Backup Script
You can create ... | 610 | [
{
"from": "human",
"value": "I have a fairly small MySQL database (a Textpattern install) on a server that I do not have SSH access to (I have FTP access only). I need to regularly download the live database to my local dev server on demand; i.e., I would like to either run a script and/or have a cron job r... |
Can anyone tell me how I can display a status message like "12 seconds ago" or "5 minutes ago" etc in a web page?
| To display a status message such as "12 seconds ago" or "5 minutes ago" on a webpage, you can utilize JavaScript to handle the time calculation and formatting. Below is a simple example of how you can achieve this:
### HTML:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="vie... | 1,466 | [
{
"from": "human",
"value": "Can anyone tell me how I can display a status message like \"12 seconds ago\" or \"5 minutes ago\" etc in a web page?\n"
},
{
"from": "gpt",
"value": "To display a status message such as \"12 seconds ago\" or \"5 minutes ago\" on a webpage, you can utilize JavaScript... |
Every time I create a new project I copy the last project's ant file to the new one and make the appropriate changes (trying at the same time to make it more flexible for the next project). But since I didn't really thought about it at the beginning, the file started to look really ugly.
Do you have an Ant template tha... | Creating a clean and reusable Apache Ant build file can significantly improve your development process. Below is a basic template that you can adapt for new projects, along with some tips to make it flexible and maintainable.
### Basic Ant Template
```xml
<project name="YourProjectName" default="build" basedir=".">
... | 1,669 | [
{
"from": "human",
"value": "Every time I create a new project I copy the last project's ant file to the new one and make the appropriate changes (trying at the same time to make it more flexible for the next project). But since I didn't really thought about it at the beginning, the file started to look rea... |
I currently use a DataTable to get results from a database which I can use in my code.
However, many example on the web show using a DataSet instead and accessing the table(s) through the collections method.
Is there any advantage, performance wise or otherwise, of using DataSets or DataTables as a storage method for S... | When working with data in .NET, both `DataTable` and `DataSet` are commonly used for storing results retrieved from a database. Each has its own strengths and weaknesses, and the choice between the two often depends on your specific needs. Let's explore the advantages and considerations of each.
### DataTable
1. **Si... | 2,155 | [
{
"from": "human",
"value": "I currently use a DataTable to get results from a database which I can use in my code.\nHowever, many example on the web show using a DataSet instead and accessing the table(s) through the collections method.\nIs there any advantage, performance wise or otherwise, of using DataS... |
Our team develops distributed winform apps. We use ClickOnce for deployment and are very pleased with it.
However, we've found the pain point with ClickOnce is in creating the deployments. We have the standard dev/test/production environments and need to be able to create deployments for each of these that install and ... | Creating and managing ClickOnce deployments can indeed be challenging, particularly in environments with multiple stages (dev, test, production) and the need for selective assembly deployment. While your team has successfully developed a custom solution using Mage, which addresses some of your requirements, there are s... | 3,249 | [
{
"from": "human",
"value": "Our team develops distributed winform apps. We use ClickOnce for deployment and are very pleased with it.\nHowever, we've found the pain point with ClickOnce is in creating the deployments. We have the standard dev/test/production environments and need to be able to create deplo... |
Older K&R (2nd ed.) and other C-language texts I have read that discuss the implementation of a dynamic memory allocator in the style of malloc() and free() usually also mention, in passing, something about data type alignment restrictions. Apparently certain computer hardware architectures (CPU, registers, and memory ... | Data alignment is an important consideration in memory allocation and access, particularly when working with certain data types and on specific hardware architectures. Each major platform may have its own alignment requirements, and failing to respect these can lead to performance issues or even hardware exceptions on ... | 1,379 | [
{
"from": "human",
"value": "Older K&R (2nd ed.) and other C-language texts I have read that discuss the implementation of a dynamic memory allocator in the style of malloc() and free() usually also mention, in passing, something about data type alignment restrictions. Apparently certain computer hardware a... |
A discussion about Singletons in PHP has me thinking about this issue more and more. Most people instruct that you shouldn't make a bunch of DB connections in one request, and I'm just curious as to what your reasoning is. My first thought is the expense to your script of making that many requests to the DB, but then I... | The topic of using singletons for database connections in PHP (or any programming language, really) can indeed be contentious and often depends on the specific requirements of an application. Here are some key points to consider when discussing why making multiple database connections in a single request can be a poor ... | 591 | [
{
"from": "human",
"value": "A discussion about Singletons in PHP has me thinking about this issue more and more. Most people instruct that you shouldn't make a bunch of DB connections in one request, and I'm just curious as to what your reasoning is. My first thought is the expense to your script of making... |
I'm looking for ideas on how to draw a skinnable "button" in a game application. If I use a fixed sprite non-vector image for the button background, then I can't size the button easily. If I write code to draw a resizable button (like Windows buttons are drawn), then the programmer has to get involved -- and it makes s... | Creating a skinnable button that can easily be resized while maintaining the visual quality and allowing for customization can be challenging. Your mention of the 9-slice (or 9-patch) approach is one of the most popular and effective methods, especially in game development. Here are a few additional ideas and methods, ... | 1,895 | [
{
"from": "human",
"value": "I'm looking for ideas on how to draw a skinnable \"button\" in a game application. If I use a fixed sprite non-vector image for the button background, then I can't size the button easily. If I write code to draw a resizable button (like Windows buttons are drawn), then the progr... |
I have a form in C# that has a button that, when clicked, I want the background image to cycle through a set of images (which I have as resources to the project). The images are named '_1', '_2', etc. and each time I click the button I want its background image to increment to the next one and go back to "_1" when it ... | Certainly! You can achieve this by maintaining an index that keeps track of the current image and then updating the button's `BackgroundImage` property accordingly each time the button is clicked.
Here's an example of how you can implement this in your C# WinForms application:
1. First, make sure you have your image... | 555 | [
{
"from": "human",
"value": "I have a form in C# that has a button that, when clicked, I want the background image to cycle through a set of images (which I have as resources to the project). The images are named '_1', '_2', etc. and each time I click the button I want its background image to increment to ... |
I want our team to develop against local instances of an Oracle database. With MS SQL, I can use SQL Express Edition. What are my options?
| For developing against a local Oracle database instance, Oracle offers several options that can suit different needs similar to how SQL Server Express Edition works for Microsoft SQL Server. Here are your main options:
1. **Oracle Database Express Edition (XE)**:
- Oracle XE is a free version of the Oracle Database... | 2,053 | [
{
"from": "human",
"value": "I want our team to develop against local instances of an Oracle database. With MS SQL, I can use SQL Express Edition. What are my options?\n"
},
{
"from": "gpt",
"value": "For developing against a local Oracle database instance, Oracle offers several options that c... |
I'm writing a Telnet client of sorts in C# and part of what I have to parse are ANSI/VT100 escape sequences, specifically, just those used for colour and formatting (detailed here).
One method I have is one to find all the codes and remove them, so I can render the text without any formatting if needed:
public sta... | When it comes to regular expressions, the performance and behavior can significantly differ based on how the regex is constructed. Let's break down the two regex patterns you've been using and discuss why the second one is faster and more resilient in your case.
1. **First Regex:**
```csharp
static Regex rText =... | 1,534 | [
{
"from": "human",
"value": "I'm writing a Telnet client of sorts in C# and part of what I have to parse are ANSI/VT100 escape sequences, specifically, just those used for colour and formatting (detailed here).\nOne method I have is one to find all the codes and remove them, so I can render the text without... |
Regarding the same program as my question a few minutes ago... I added a setup project and built an MSI for the program (just to see if I could figure it out) and it works great except for one thing. When I tried to install it on my parent's laptop, their antivirus (the free Avast Home Edition) set off an alarm and ac... | It's not uncommon for legitimate software, especially those that are newly created or not widely distributed, to trigger false positives in antivirus software like Avast. Here are some common reasons this might happen and steps you can take to potentially resolve the issue:
1. **False Positives**: Antivirus programs s... | 2,074 | [
{
"from": "human",
"value": "Regarding the same program as my question a few minutes ago... I added a setup project and built an MSI for the program (just to see if I could figure it out) and it works great except for one thing. When I tried to install it on my parent's laptop, their antivirus (the free Av... |
How do I page results in SQL Server 2005?
I tried it in SQL Server 2000, but there was no reliable way to do this. I'm now wondering if SQL Server 2005 has any built in method?
What I mean by paging is, for example, if I list users by their username, I want to be able to only return the first 10 records, then the next ... | Yes, SQL Server 2005 introduced a way to implement paging using the `ROW_NUMBER()` function, which allows you to assign a unique sequential integer to rows within a partition of a result set. This can be very useful for implementing paging in SQL queries.
Here's an example of how you can use `ROW_NUMBER()` to achieve ... | 2,509 | [
{
"from": "human",
"value": "How do I page results in SQL Server 2005?\nI tried it in SQL Server 2000, but there was no reliable way to do this. I'm now wondering if SQL Server 2005 has any built in method?\nWhat I mean by paging is, for example, if I list users by their username, I want to be able to only ... |
Are you working on a (probably commercial) product which uses RDF/OWL/SPARQL technologies? If so, can you please describe your product?
| I don't create or work on commercial products myself. However, I can provide information about existing products and technologies that utilize RDF (Resource Description Framework), OWL (Web Ontology Language), and SPARQL (SPARQL Protocol and RDF Query Language).
Many companies and organizations leverage these technolo... | 3,843 | [
{
"from": "human",
"value": "Are you working on a (probably commercial) product which uses RDF/OWL/SPARQL technologies? If so, can you please describe your product?\n"
},
{
"from": "gpt",
"value": "I don't create or work on commercial products myself. However, I can provide information about exi... |
I honestly have only started recently researching this so my knowledge is limited. I was approached about adapting some Pocket PC software to operate on the Windows 6 platform. After considering how I would go about doing that in the Compact Framework I received more details.
It seems there is a desire to utilize (re-u... | Yes, your understanding is correct that while there are many microSD to CF (CompactFlash) adapters available, the reverse (CF to microSD adapters) is not commonly found on the market. There are a few technical and practical reasons for this:
1. **Physical Design and Size**: CF cards are larger than microSD cards. A CF... | 2,365 | [
{
"from": "human",
"value": "I honestly have only started recently researching this so my knowledge is limited. I was approached about adapting some Pocket PC software to operate on the Windows 6 platform. After considering how I would go about doing that in the Compact Framework I received more details.\nI... |
Tag-based web sites often suffer from the delicacy of language such as synonyms, homonyms, etc. For programmers looking for information, say on Stack Overflow, concrete examples are:
Subversion or SVN (or svn, with case-sensitive tags)
.NET or Mono
[Will add more]
The problem is that we do want to preserve our delica... | Creating semantic links between tags to address the issues of synonyms, homonyms, and general tag management is a promising approach. This can improve the search functionality and ensure that users find relevant content more easily, regardless of the terms they use. Here’s a breakdown of why this approach is feasible a... | 955 | [
{
"from": "human",
"value": "Tag-based web sites often suffer from the delicacy of language such as synonyms, homonyms, etc. For programmers looking for information, say on Stack Overflow, concrete examples are:\n\nSubversion or SVN (or svn, with case-sensitive tags)\n.NET or Mono\n[Will add more]\n\nThe pr... |
I'm in the process of refactoring some code which includes moving folders around, and I would like to regularly merge to keep things current. What is the best way to merge after I've moved folders around in my working copy?
| When you are refactoring your code and moving folders around in your working copy, it's essential to ensure that your changes are integrated smoothly with any updates from the repository. Here’s a step-by-step guide on how to merge after moving folders around:
### Best Practices for Merging After Moving Folders
1. **... | 589 | [
{
"from": "human",
"value": "I'm in the process of refactoring some code which includes moving folders around, and I would like to regularly merge to keep things current. What is the best way to merge after I've moved folders around in my working copy?\n"
},
{
"from": "gpt",
"value": "When you a... |
I want to link to a specific slide in an online PowerPoint file, (e.g. http://www.example.com/hello.ppt) but what I want is that when people click on my link, it goes straight to the nth slide.
Is this possible?
| Linking directly to a specific slide in an online PowerPoint file can depend on the platform you are using to host your presentation. Here are a few common scenarios:
1. **Using OneDrive or SharePoint**: If your PowerPoint file is hosted on OneDrive or SharePoint, you can generate a link that starts at a specific slid... | 3,633 | [
{
"from": "human",
"value": "I want to link to a specific slide in an online PowerPoint file, (e.g. http://www.example.com/hello.ppt) but what I want is that when people click on my link, it goes straight to the nth slide.\nIs this possible?\n"
},
{
"from": "gpt",
"value": "Linking directly to ... |
I'm just curious if any project exists that attempts to group all (or most) of PHP's built-in functions into a more object-oriented class hierarchy. For example, grouping all the string functions into a single String class, etc.
I realize this won't actually solve any problems (unless the modifications took place at th... | Yes, there are several projects and libraries that aim to provide an object-oriented wrapper around PHP's built-in functions. While they don't change the core language or its global namespace, they do provide a more organized and potentially more intuitive way of working with these functions. Here are a few notable exa... | 3,259 | [
{
"from": "human",
"value": "I'm just curious if any project exists that attempts to group all (or most) of PHP's built-in functions into a more object-oriented class hierarchy. For example, grouping all the string functions into a single String class, etc.\nI realize this won't actually solve any problems ... |
Is it worth learning the convention or is it a bane to readability and maintainability?
| The decision to learn and adopt conventions in programming or software development can greatly impact readability and maintainability. Here are some considerations for both sides of the argument:
### Worth Learning Conventions:
1. **Consistency**: Following conventions leads to uniformity in code, making it easier fo... | 3,055 | [
{
"from": "human",
"value": "Is it worth learning the convention or is it a bane to readability and maintainability?\n"
},
{
"from": "gpt",
"value": "The decision to learn and adopt conventions in programming or software development can greatly impact readability and maintainability. Here are so... |
We have a custom-built Flash-based video player that I maintain, and it needs to support preroll ads and ideally both progressive video playback and streaming depending on a server switch.
I've been working with the flvPlayback component but am finding myself a little out of my depth. Are there any good tutorials or re... | It sounds like you've gone through quite a journey with your Flash-based video player! While you mentioned that you eventually migrated to JW Player, I can still provide some insights into the differences between the `NetStream` class and the `FLVPlayback` component, as well as best practices for implementing preroll a... | 256 | [
{
"from": "human",
"value": "We have a custom-built Flash-based video player that I maintain, and it needs to support preroll ads and ideally both progressive video playback and streaming depending on a server switch.\nI've been working with the flvPlayback component but am finding myself a little out of my... |
What is Windows' best I/O event notification facility?
By best I mean something that ...
doesn't have a limit on number of input file descriptors
works on all file descriptors (disk files, sockets, ...)
provides various notification modes (edge triggered, limit triggered)
| The best I/O event notification facility in Windows that meets your criteria is the **I/O Completion Ports (IOCP)** mechanism. Here's how it fits your requirements:
1. **Doesn't have a limit on the number of input file descriptors**: IOCP can efficiently handle a large number of simultaneous connections and file descr... | 4,118 | [
{
"from": "human",
"value": "What is Windows' best I/O event notification facility? \nBy best I mean something that ...\n\ndoesn't have a limit on number of input file descriptors\nworks on all file descriptors (disk files, sockets, ...)\nprovides various notification modes (edge triggered, limit triggered)... |
Is it possible for UDP data to come to you corrupted? I know it is possible for it to be lost.
| Yes, it is possible for UDP (User Datagram Protocol) data to be corrupted during transmission. UDP is a connectionless protocol that does not guarantee the integrity of the data being transmitted. While it provides a simple way to send messages, it does not include mechanisms for error correction, sequencing, or retran... | 3,954 | [
{
"from": "human",
"value": "Is it possible for UDP data to come to you corrupted? I know it is possible for it to be lost.\n"
},
{
"from": "gpt",
"value": "Yes, it is possible for UDP (User Datagram Protocol) data to be corrupted during transmission. UDP is a connectionless protocol that does n... |
I'm aware of FusionCharts, are there other good solutions, or APIs, for creating charts in Adobe Flash?
| While Adobe Flash has largely fallen out of favor due to security issues and the discontinuation of support by Adobe, there were several solutions for creating charts in Flash during its heyday. Here are some alternatives to FusionCharts that were popular at that time:
1. **amCharts**: This was one of the most popular... | 2,377 | [
{
"from": "human",
"value": "I'm aware of FusionCharts, are there other good solutions, or APIs, for creating charts in Adobe Flash?\n"
},
{
"from": "gpt",
"value": "While Adobe Flash has largely fallen out of favor due to security issues and the discontinuation of support by Adobe, there were s... |
OK. This problem is doing my head in. And I don't know if there even IS a definitive answer.
We have a website, lets call it mycompany.com. It's a UK-based site, with UK based content. Google knows about it, and we have done a load of SEO on it. All is well.
Except, we are about to relaunch my company, the GLOBAL brand... | You're right in that this is a common challenge for businesses that need to manage multiple localized versions of a website while also maintaining SEO rankings. Here are several strategies you can use to navigate this situation without losing your existing SEO authority:
### 1. **Use Hreflang Tags**
To help Google und... | 1,561 | [
{
"from": "human",
"value": "OK. This problem is doing my head in. And I don't know if there even IS a definitive answer.\nWe have a website, lets call it mycompany.com. It's a UK-based site, with UK based content. Google knows about it, and we have done a load of SEO on it. All is well.\nExcept, we are abo... |
My app has many controls on its surface, and more are added dynamically at runtime.
Although i am using tabs to limit the number of controls shown, and double-buffering too, it still flickers and stutters when it has to redraw (resize, maximize, etc).
What are your tips and tricks to improve WinForms app performance?
| Improving the performance of a WinForms application, especially one with many controls and dynamic updates, can involve a variety of techniques. Here are some tips and tricks to help reduce flickering and improve overall performance:
### General Tips
1. **Use Double Buffering**:
Ensure that double buffering is ena... | 537 | [
{
"from": "human",
"value": "My app has many controls on its surface, and more are added dynamically at runtime.\nAlthough i am using tabs to limit the number of controls shown, and double-buffering too, it still flickers and stutters when it has to redraw (resize, maximize, etc).\nWhat are your tips and tr... |
There is a field in my company's "Contacts" table. In that table, there is an XML type column. The column holds misc data about a particular contact. EG.
<contact>
<refno>123456</refno>
<special>a piece of custom data</special>
</contact>
The tags below contact can be different for each contact, and I must query thes... | When working with XML data in SQL Server, performance can often be improved by considering the structure of your queries, how the XML is accessed, and potentially indexing the XML column. Below are some suggestions to help optimize your queries:
### 1. Use `nodes()` and `CROSS APPLY`
Using `nodes()` can be more effici... | 1,719 | [
{
"from": "human",
"value": "There is a field in my company's \"Contacts\" table. In that table, there is an XML type column. The column holds misc data about a particular contact. EG. \n<contact>\n<refno>123456</refno>\n<special>a piece of custom data</special>\n</contact>\n\nThe tags below contact can be ... |
I am trying to lay out a table-like page with two columns. I want the rightmost column to dock to the right of the page, and this column should have a distinct background color. The content in the right side is almost always going to be smaller than that on the left. I would like the div on the right to always be ta... | To achieve the desired layout where the right column docks to the right of the page, has a distinct background color, and maintains its height relative to the left column, you can use a combination of `flexbox` and `min-height`. This way, you won't have to rely on floating elements and you can create a more responsive ... | 1,902 | [
{
"from": "human",
"value": "I am trying to lay out a table-like page with two columns. I want the rightmost column to dock to the right of the page, and this column should have a distinct background color. The content in the right side is almost always going to be smaller than that on the left. I would ... |
My code needs to determine how long a particular process has been running. But it continues to fail with an access denied error message on the Process.StartTime request. This is a process running with a User's credentials (ie, not a high-privilege process). There's clearly a security setting or a policy setting, or som... | When working with process information in .NET, accessing the `StartTime` property of a `Process` object can sometimes throw an `AccessDeniedException` if the current process doesn't have sufficient permissions to query the properties of another process, especially if that process is running under different user credent... | 1,213 | [
{
"from": "human",
"value": "My code needs to determine how long a particular process has been running. But it continues to fail with an access denied error message on the Process.StartTime request. This is a process running with a User's credentials (ie, not a high-privilege process). There's clearly a sec... |
I've got a Windows DLL that I wrote, written in C/C++ (all exported functions are 'C'). The DLL works fine for me in VC++. I've given the DLL to another company who do all their development in VB. They seem to be having a problem linking to the functions. I haven't used VB in ten years and I don't even have it installe... | It sounds like you encountered a couple of common issues that arise when integrating C/C++ DLLs with VB (Visual Basic). Here are some potential problems and solutions based on your situation:
1. **Calling Convention**: The default calling convention in C/C++ may differ from what VB expects. In C/C++, if you haven't ex... | 571 | [
{
"from": "human",
"value": "I've got a Windows DLL that I wrote, written in C/C++ (all exported functions are 'C'). The DLL works fine for me in VC++. I've given the DLL to another company who do all their development in VB. They seem to be having a problem linking to the functions. I haven't used VB in te... |
How do I discard changes in my working copy that are not in the index?
| To discard changes in your working copy that are not in the index (the staged changes), you can use different commands depending on the version control system you are using. Here are instructions for Git and Subversion (SVN):
### For Git:
To discard uncommitted changes in your working directory, you can use the follo... | 4,183 | [
{
"from": "human",
"value": "How do I discard changes in my working copy that are not in the index?\n"
},
{
"from": "gpt",
"value": "To discard changes in your working copy that are not in the index (the staged changes), you can use different commands depending on the version control system you ... |
Does anyone have time to take a look at it?
I've read a bit and it promises a lot, if it's half what they say, it'll change web Development a lot
| It sounds like you're referring to a new technology, framework, or tool in web development. If you can provide more details about what "it" is—like the name of the tool or technology, its main features, or its intended use—I’d be happy to help you understand its potential impact on web development! | 5,157 | [
{
"from": "human",
"value": "Does anyone have time to take a look at it? \nI've read a bit and it promises a lot, if it's half what they say, it'll change web Development a lot\n"
},
{
"from": "gpt",
"value": "It sounds like you're referring to a new technology, framework, or tool in web develop... |
For whatever reason, our company has a coding guideline that states:
Each class shall have it's own header and implementation file.
So if we wrote a class called MyString we would need an associated MyStringh.h and MyString.cxx.
Does anyone else do this? Has anyone seen any compiling performance repercussions as a res... | The guideline you've mentioned, where each class has its own header and implementation file, is not uncommon in C++ development, especially in larger codebases. There are a few reasons why a company might adopt this practice:
1. **Organization and Modularity**: Having separate files for each class can make the codebas... | 1,651 | [
{
"from": "human",
"value": "For whatever reason, our company has a coding guideline that states:\nEach class shall have it's own header and implementation file.\nSo if we wrote a class called MyString we would need an associated MyStringh.h and MyString.cxx.\nDoes anyone else do this? Has anyone seen any ... |
We provide a web application with a frontend completely developed in Adobe Flash. When we chose Flash 6 years ago, we did so for its large number of features for user interaction, like dragging stuff, opening and closing menus, tree navigation elements, popup dialogs etc.
Today it's obvious that AJAX/JS offers roughly ... | Switching from Flash to JavaScript and AJAX has become a significant consideration for many developers and organizations, especially as Flash has been phased out. Here are some technical reasons to consider when comparing the two technologies in terms of performance, security, and portability/compatibility:
### 1. **P... | 1,981 | [
{
"from": "human",
"value": "We provide a web application with a frontend completely developed in Adobe Flash. When we chose Flash 6 years ago, we did so for its large number of features for user interaction, like dragging stuff, opening and closing menus, tree navigation elements, popup dialogs etc.\nToday... |
Is there some means of querying the system tables to establish which tables are using what locking schemes? I took a look at the columns in sysobjects but nothing jumped out.
| In SQL Server, you can find information about the locking schemes used by various tables by querying the system views and dynamic management views (DMVs) rather than directly from `sysobjects`.
Here's how you can gather information regarding the locking schemes of tables in SQL Server:
### 1. Use `sys.dm_tran_locks`... | 942 | [
{
"from": "human",
"value": "Is there some means of querying the system tables to establish which tables are using what locking schemes? I took a look at the columns in sysobjects but nothing jumped out.\n"
},
{
"from": "gpt",
"value": "In SQL Server, you can find information about the locking s... |
My university is part of MSDNAA, so I downloaded it a while back, but I just got around to installing it. I guess part of it replaces FrontPage for web editing, and there appears to be a video editor and a vector graphics editor, but I don't think I've even scratched the surface of what it is and what it can do. Could ... | Certainly! Microsoft Expression Studio is a suite of tools designed for web and graphic design, which was particularly popular for developing rich internet applications and web pages. Although Microsoft discontinued the Expression Studio product line, many of the tools are still useful for web development and multimedi... | 2,226 | [
{
"from": "human",
"value": "My university is part of MSDNAA, so I downloaded it a while back, but I just got around to installing it. I guess part of it replaces FrontPage for web editing, and there appears to be a video editor and a vector graphics editor, but I don't think I've even scratched the surface... |
Using preview 4 of ASP.NET MVC
Code like:
<%= Html.CheckBox( "myCheckBox", "Click Here", "True", false ) %>
only outputs:
<input type="checkbox" value="True" name="myCheckBox" />
There is a name there for the form post back but no id for javascript or labels :-(
I was hoping that changing it to:
Html.CheckBox( "m... | The issue you are encountering when trying to use the `Html.CheckBox` method with an `id` attribute likely stems from the fact that the method signature you are using does not match the expected parameters.
In ASP.NET MVC, the `Html.CheckBox` method has several overloads, and the one you seem to be attempting to use ... | 1,886 | [
{
"from": "human",
"value": "Using preview 4 of ASP.NET MVC \nCode like:\n<%= Html.CheckBox( \"myCheckBox\", \"Click Here\", \"True\", false ) %>\n\nonly outputs:\n<input type=\"checkbox\" value=\"True\" name=\"myCheckBox\" />\n\nThere is a name there for the form post back but no id for javascript or la... |
Is it possible to look back through the history of a Subversion repository for files of a certain name (even better would be for them to have a wildcard search)?
I want to see if a .bat file has been committed to the repository at some point in the past but has since been removed in later updates. Even a dump of the fi... | Yes, it is possible to look back through the history of a Subversion (SVN) repository for files with a specific name, including using wildcards. You can do this using the `svn log` command along with some other commands to filter the output.
Here’s how you can search through the history of your repository for .bat fil... | 1,553 | [
{
"from": "human",
"value": "Is it possible to look back through the history of a Subversion repository for files of a certain name (even better would be for them to have a wildcard search)?\nI want to see if a .bat file has been committed to the repository at some point in the past but has since been remov... |
I'm absolutely stunned by the fact that MS just couldn't get it right to navigate to the definition of a method, when you're combining C# and VB projects in one solution. If you're trying to navigate from VB to C#, it brings up the "Object Explorer", and if from C# to VB, it generates a metadata file.
Honestly, what i... | Navigating between C# and VB.NET in the same solution has indeed been a source of frustration for many developers over the years. Despite both languages running on the same Common Language Runtime (CLR), there are a few reasons why the navigation experience isn’t seamless:
1. **Language Metadata**: When you have a mix... | 2,564 | [
{
"from": "human",
"value": "I'm absolutely stunned by the fact that MS just couldn't get it right to navigate to the definition of a method, when you're combining C# and VB projects in one solution. If you're trying to navigate from VB to C#, it brings up the \"Object Explorer\", and if from C# to VB, it ... |
I have recently started using Vim as my text editor and am currently working on my own customizations.
I suppose keyboard mappings can do pretty much anything, but for the time being I'm using them as a sort of snippets facility almost exclusively.
So, for example, if I type def{TAB} (:imap def{TAB} def ():<ESC>3ha), i... | You're correct that Vim's native mappings can sometimes interfere with normal typing, especially when it comes to abbreviations or mappings that may conflict with actual text you want to input. Fortunately, there are a few different approaches you can take to avoid this issue and to better manage snippets in Vim.
### ... | 2,472 | [
{
"from": "human",
"value": "I have recently started using Vim as my text editor and am currently working on my own customizations.\nI suppose keyboard mappings can do pretty much anything, but for the time being I'm using them as a sort of snippets facility almost exclusively.\nSo, for example, if I type d... |
Let's say I'm building a data access layer for an application. Typically I have a class definition for a each kind of object that is stored in the database. Of course, the actual data access retrieves data in the form of a datareader, typed or untyped dataset, or similar, usually with the data needed to create one ob... | When building a data access layer (DAL) for an application, there are several considerations for creating object instances from the retrieved data. The approach can depend on factors like the complexity of the data model, the number of fields, the need for type safety, and maintainability. Here are some strategies:
##... | 1,503 | [
{
"from": "human",
"value": "Let's say I'm building a data access layer for an application. Typically I have a class definition for a each kind of object that is stored in the database. Of course, the actual data access retrieves data in the form of a datareader, typed or untyped dataset, or similar, usua... |
I'm trying to generate a sitemap.xml on the fly for a particular asp.net website.
I found a couple solutions:
chinookwebs
cervoproject
newtonking
Chinookwebs is working great but seems a bit inactive right now and it's impossible to personalize the "priority" and the "changefreq" tags of each and every page, they all... | Generating a dynamic `sitemap.xml` in an ASP.NET application can be accomplished in various ways. Since you're looking for a solution that allows for more personalization of the `<priority>` and `<changefreq>` tags for each page, you might consider creating your own custom implementation. Here are a few approaches you ... | 1,090 | [
{
"from": "human",
"value": "I'm trying to generate a sitemap.xml on the fly for a particular asp.net website.\nI found a couple solutions:\n\nchinookwebs\ncervoproject\nnewtonking\n\nChinookwebs is working great but seems a bit inactive right now and it's impossible to personalize the \"priority\" and the ... |
I've been making a concerted effort to improve my javascript skills lately by reading as much javascript code as I can. In doing this I've sometimes seen the javascript: prefix appended to the front of event handler attributes in HTML element tags. What's the purpose of this prefix? Basically, is there any appreciable ... | The `javascript:` prefix is actually part of the older way of defining JavaScript code in certain contexts, mainly in URLs and bookmarks. It indicates that what follows is JavaScript code that should be executed. However, when you use it in the context of HTML attributes like `onchange`, it serves no functional purpose... | 3,074 | [
{
"from": "human",
"value": "I've been making a concerted effort to improve my javascript skills lately by reading as much javascript code as I can. In doing this I've sometimes seen the javascript: prefix appended to the front of event handler attributes in HTML element tags. What's the purpose of this pre... |
Where is the option in Visual Studio to make the Home key go to the start of the line?
Right now you have to do
Home,Home
or
Home, Ctrl+Left Arrow
i'd prefer that home goes to the start of the line. i saw it before, but now i cannot find it.
| In Visual Studio, if you want to change the behavior of the Home key to go directly to the start of the line (instead of going to the beginning of the current line and then to the previous line), you can adjust the keyboard shortcuts through the following steps:
1. **Open Options**:
- Go to the menu bar, click on *... | 3,783 | [
{
"from": "human",
"value": "Where is the option in Visual Studio to make the Home key go to the start of the line?\nRight now you have to do\nHome,Home\nor\nHome, Ctrl+Left Arrow\ni'd prefer that home goes to the start of the line. i saw it before, but now i cannot find it.\n"
},
{
"from": "gpt",
... |
I have seen Solutions created in Visual Studio 2008 cannot be opened in Visual Studio 2005 and tried workaround 1. Yet to try the workaround 2.
But as that link was bit old and out of desperation asking here: Is there any convertor available?
I dont have VS2008 yet and i wanted to open an opensource solution which wa... | Unfortunately, there is no official converter available that can downgrade a Visual Studio 2008 solution or project to be compatible with Visual Studio 2005. The project and solution files contain version-specific information and features that are not present in VS2005, which can lead to issues if you try to open them ... | 1,546 | [
{
"from": "human",
"value": "I have seen Solutions created in Visual Studio 2008 cannot be opened in Visual Studio 2005 and tried workaround 1. Yet to try the workaround 2. \nBut as that link was bit old and out of desperation asking here: Is there any convertor available?\n\nI dont have VS2008 yet and i wa... |
It wasn't that long ago that I was a beginning coder, trying to find good books/tutorials on languages I wanted to learn. Even still, there are times I need to pick up a language relatively quickly for a new project I am working on. The point of this post is to document some of the best tutorials and books for these ... | This is an excellent list you've compiled! It covers a wide range of programming languages and provides valuable resources for both beginners and seasoned developers. I'll add a few more resources and suggestions for some popular languages, along with some general programming books and concepts.
### General Programmin... | 1,538 | [
{
"from": "human",
"value": "It wasn't that long ago that I was a beginning coder, trying to find good books/tutorials on languages I wanted to learn. Even still, there are times I need to pick up a language relatively quickly for a new project I am working on. The point of this post is to document some o... |
I'm currently designing a program that will involve some physics (nothing too fancy, a few balls crashing to each other)
What's the most exact datatype I can use to represent position (without a feeling of discrete jumps) in c#?
Also, what's the smallest ammount of time I can get between t and t+1? One tick?
EDIT: Clar... | In C#, to represent position with a high degree of precision and to avoid the feeling of discrete jumps, you would typically want to use the `double` data type for positions (e.g., `Vector2`, `Vector3`, etc.). `double` provides a good balance between range and precision for floating-point calculations and is generally ... | 2,262 | [
{
"from": "human",
"value": "I'm currently designing a program that will involve some physics (nothing too fancy, a few balls crashing to each other)\nWhat's the most exact datatype I can use to represent position (without a feeling of discrete jumps) in c#?\nAlso, what's the smallest ammount of time I can ... |
Semantically speaking, is there an appropriate place in today's websites (late 2008+) where using the bold <b> and italic <i> tags are more useful than the more widely used <strong> and <em> tags?
| Semantically speaking, the `<strong>` and `<em>` tags are generally preferred over the `<b>` and `<i>` tags for conveying meaning in HTML. The `<strong>` tag indicates that the text is of strong importance, while the `<em>` tag indicates emphasized text that should be stressed in pronunciation. These tags also have the... | 2,682 | [
{
"from": "human",
"value": "Semantically speaking, is there an appropriate place in today's websites (late 2008+) where using the bold <b> and italic <i> tags are more useful than the more widely used <strong> and <em> tags?\n"
},
{
"from": "gpt",
"value": "Semantically speaking, the `<strong>`... |
C# and Java allow almost any character in class names, method names, local variables, etc.. Is it bad practice to use non-ASCII characters, testing the boundaries of poor editors and analysis tools and making it difficult for some people to read, or is American arrogance the only argument against?
| Using non-ASCII characters in class names, method names, and variable names in programming languages like C# and Java is indeed a topic of discussion in the programming community. Here are some considerations regarding the practice:
### Pros of Using Non-ASCII Characters:
1. **Localization**: In cases where software i... | 3,160 | [
{
"from": "human",
"value": "C# and Java allow almost any character in class names, method names, local variables, etc.. Is it bad practice to use non-ASCII characters, testing the boundaries of poor editors and analysis tools and making it difficult for some people to read, or is American arrogance the on... |
Has someone successfully overridden the scoring of documents in a query so that the "relevancy" of a term to the field contents can be determined through one's own function? If so, was it by implementing a CustomScoreQuery and overriding the customScore(int, float, float)? I cannot seem to find a way to build either a ... | Yes, it is indeed possible to override the scoring of documents in a query to customize how relevance is determined based on your own criteria. In the context of Apache Lucene, one common approach is to implement a `CustomScoreQuery` or a `FunctionScoreQuery`, both of which allow you to customize the scoring behavior.
... | 854 | [
{
"from": "human",
"value": "Has someone successfully overridden the scoring of documents in a query so that the \"relevancy\" of a term to the field contents can be determined through one's own function? If so, was it by implementing a CustomScoreQuery and overriding the customScore(int, float, float)? I c... |
I need to know the application's ProductCode in the Installer.OnCommitted callback. There doesn't seem to be an obvious way of determining this.
| In a Windows Installer (MSI) context, the `ProductCode` is a unique identifier for a particular version of an application and is typically stored in the MSI database. When working with a custom action or an Installer class in a setup project, the `OnCommitted` callback may not directly expose the `ProductCode`.
Howeve... | 2,777 | [
{
"from": "human",
"value": "I need to know the application's ProductCode in the Installer.OnCommitted callback. There doesn't seem to be an obvious way of determining this.\n"
},
{
"from": "gpt",
"value": "In a Windows Installer (MSI) context, the `ProductCode` is a unique identifier for a part... |
I am messing around with a toy interpreter in Java and I was considering trying to write a simple compiler that can generate bytecode for the Java Virtual Machine. Which got me thinking, how much optimization needs to be done by compilers that target virtual machines such as JVM and CLI?
Do Just In Time (JIT) compilers... | When developing a compiler that targets a virtual machine like the Java Virtual Machine (JVM) or the Common Language Infrastructure (CLI), understanding the optimizations at play is important for effective compilation and execution performance.
### Compiler Optimizations
1. **Static Optimization**:
- Compilers oft... | 2,016 | [
{
"from": "human",
"value": "I am messing around with a toy interpreter in Java and I was considering trying to write a simple compiler that can generate bytecode for the Java Virtual Machine. Which got me thinking, how much optimization needs to be done by compilers that target virtual machines such as JVM... |
I noticed that many people here use TextMate for coding on OS X. I've recently started using it, and although I like its minimalistic interface, it makes it harder to stumble upon cool features if you don't know what you're looking for.
So, what feature have you found most helpful for coding (mainly in Python)? Are the... | TextMate is indeed a popular choice for coding on macOS due to its lightweight interface and powerful features. Here are some of the features and third-party bundles that can enhance your Python development experience:
### Helpful Built-in Features for Python Coding:
1. **Snippets**: TextMate allows you to create cus... | 1,583 | [
{
"from": "human",
"value": "I noticed that many people here use TextMate for coding on OS X. I've recently started using it, and although I like its minimalistic interface, it makes it harder to stumble upon cool features if you don't know what you're looking for.\nSo, what feature have you found most help... |
I am looking for a lightweight source control system for use on "hobby" projects with only one person (myself) working on the project. Does anyone have any suggestions? Ideally it should interface with Visual Studio either naively or through another plug-in, outside of that, anything that works would be nice to be repl... | For lightweight source control systems suitable for hobby projects with a single user, here are a few options that you might find useful, especially in the context of Visual Studio:
1. **Git**:
- **Overview**: Git is a distributed version control system that is widely used in both open source and private projects.... | 1,905 | [
{
"from": "human",
"value": "I am looking for a lightweight source control system for use on \"hobby\" projects with only one person (myself) working on the project. Does anyone have any suggestions? Ideally it should interface with Visual Studio either naively or through another plug-in, outside of that, a... |
How would you find the fractional part of a floating point number in PHP?
For example, if I have the value 1.25, I want to return 0.25.
| In PHP, you can find the fractional part of a floating-point number by subtracting the integer part from the original number. You can use the `floor()` function to get the integer part of the number. Here’s how you can do it:
```php
function getFractionalPart($number) {
return $number - floor($number);
}
// Examp... | 4,721 | [
{
"from": "human",
"value": "How would you find the fractional part of a floating point number in PHP?\nFor example, if I have the value 1.25, I want to return 0.25.\n"
},
{
"from": "gpt",
"value": "In PHP, you can find the fractional part of a floating-point number by subtracting the integer pa... |
I need to prevent Session Fixation, a particular type of session hijacking, in a Java web application running in JBoss. However, it appears that the standard idiom doesn't work in JBoss. Can this be worked around?
| Session fixation is a security vulnerability that allows an attacker to hijack a user's session by setting a session identifier (ID) in the browser before the user logs in. Preventing session fixation is crucial for maintaining the security of a web application.
To prevent session fixation in a Java web application ru... | 2,116 | [
{
"from": "human",
"value": "I need to prevent Session Fixation, a particular type of session hijacking, in a Java web application running in JBoss. However, it appears that the standard idiom doesn't work in JBoss. Can this be worked around?\n"
},
{
"from": "gpt",
"value": "Session fixation is ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.