instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
I'm trying to work out if I have an open relay on my server. How do I do that? I've tried http://www.abuse.net/relay.html and it reports: Hmmn, at first glance, host appeared to accept a message for relay. THIS MAY OR MAY NOT MEAN THAT IT'S AN OPEN RELAY. Some systems appear to accept relay mail, but then reject messag...
To determine if your server is an open relay, you can conduct a few tests. An open relay is a mail server that allows anyone on the internet to send emails through it, which can lead to misuse like spam. Here are steps you can take to check if your server is an open relay: ### Method 1: Manual Testing with Telnet or N...
13,874
[ { "from": "human", "value": "I'm trying to work out if I have an open relay on my server. How do I do that?\nI've tried http://www.abuse.net/relay.html\nand it reports:\nHmmn, at first glance, host appeared to accept a message for relay.\nTHIS MAY OR MAY NOT MEAN THAT IT'S AN OPEN RELAY.\nSome systems appea...
I'm at my wit's end here. I'm trying to use an auto-complete extender from the asp.net ajax extensions toolkit, which is filled from a bog-standard webservice. The application is a .net 3.5 web site, hosting the webservice in a subdirectory (real, not virtual). Whenever I try to post to the webservice I get the followi...
It sounds like you're facing a frustrating issue, and it's understandable given the complexities involved with different environments and configurations. Here are several troubleshooting steps you can take to help pinpoint the problem: 1. **Check IIS Settings**: Since your co-worker can run the application without iss...
18,562
[ { "from": "human", "value": "I'm at my wit's end here. I'm trying to use an auto-complete extender from the asp.net ajax extensions toolkit, which is filled from a bog-standard webservice. The application is a .net 3.5 web site, hosting the webservice in a subdirectory (real, not virtual).\nWhenever I try t...
I wish to implement a 2d bit map class in Python. The class would have the following requirements: Allow the creating of arbitrarily sized 2d bitmaps. i.e. to create an 8 x 8 bitmap (8 bytes), something like: bitmap = Bitmap(8,8) provide an API to access the bits in this 2d map as boolean or even integer values, i.e....
To implement a `Bitmap` class in Python that meets your requirements, you'll need to leverage Python's built-in capabilities for working with bits, bytes, and binary data. Below is an implementation that outlines how to create a 2D bitmap, access bits as boolean or integer values, and retrieve or create bitmap data fro...
14,866
[ { "from": "human", "value": "I wish to implement a 2d bit map class in Python. The class would have the following requirements:\n\nAllow the creating of arbitrarily sized 2d bitmaps. i.e. to create an 8 x 8 bitmap (8 bytes), something like:\nbitmap = Bitmap(8,8)\n\nprovide an API to access the bits in this ...
How can I dismiss dialog in Cocoa application when user presses Esc or Enter key? I have OK button, is it possible to make it default button?
In a Cocoa application, you can handle the dismissal of a dialog (or an NSWindow) when the user presses the Esc or Enter key by implementing certain methods in your view controller or window controller. Additionally, you can set a default button (usually the OK button) that gets activated when the Enter key is pressed....
19,087
[ { "from": "human", "value": "How can I dismiss dialog in Cocoa application when user presses Esc or Enter key? I have OK button, is it possible to make it default button?\n" }, { "from": "gpt", "value": "In a Cocoa application, you can handle the dismissal of a dialog (or an NSWindow) when the u...
Is there a Registry setting that I can look for to determine whether or not the Visual C++ redistributable is installed, whether standalone or as part of Visual Studio 2008? I know that I could launch the VC++ 2008 redistributable installer and let it handle the detection, but it would look cleaner if I can check for i...
Yes, you can check the Windows Registry to determine if the Visual C++ 2008 Redistributable is installed. The Visual C++ Redistributables are typically registered in the system Registry under specific keys. For Visual C++ 2008, you can look in the following locations in the Registry: ### 1. Registry Key Location - **...
19,637
[ { "from": "human", "value": "Is there a Registry setting that I can look for to determine whether or not the Visual C++ redistributable is installed, whether standalone or as part of Visual Studio 2008? I know that I could launch the VC++ 2008 redistributable installer and let it handle the detection, but i...
I'm using Java for accessing Alfresco content server via it's web service API for importing some content into it. Content should have some NamedValue properties set to UTF-8(cyrillic) string. I keep getting the Sax parser exception: org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x1b) was found in th...
The exception you're encountering, `org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x1b)`, indicates that there is a character in your input string that is not valid in XML. XML has a defined set of valid characters, and the one you are encountering, `0x1B`, is a control character that is not allowed...
17,594
[ { "from": "human", "value": "I'm using Java for accessing Alfresco content server via it's web service API for importing some content into it. Content should have some NamedValue properties set to UTF-8(cyrillic) string. I keep getting the Sax parser exception:\norg.xml.sax.SAXParseException: An invalid XML...
Why is there a minimum character count for posting questions? o.O Do you use int, bigint, tinyint, whatever? It seems like a small thing I guess, I was just wondering what the usual practice is
The minimum character count for posting questions on platforms is typically implemented to ensure that users provide enough context and detail for their inquiries. This helps improve the quality of discussions and makes it easier for others to understand and respond effectively. A brief question may lack sufficient inf...
23,200
[ { "from": "human", "value": "Why is there a minimum character count for posting questions? o.O\nDo you use int, bigint, tinyint, whatever?\nIt seems like a small thing I guess, I was just wondering what the usual practice is\n" }, { "from": "gpt", "value": "The minimum character count for postin...
We need to implement a simple state machine in C. Is a standard switch statement the best way to go? We have a current state (state) and a trigger for the transition. switch(state) { case STATE_1: state = DoState1(transition); break; case STATE_2: state = DoState2(transition); break; } ... DoSt...
Implementing a state machine in C using a switch statement is a common approach, especially for simple state machines. However, there are some considerations and potential improvements you can make to enhance readability, maintainability, and extensibility. Here’s a typical structure and some alternative approaches: #...
13,237
[ { "from": "human", "value": "We need to implement a simple state machine in C.\nIs a standard switch statement the best way to go?\nWe have a current state (state) and a trigger for the transition.\n\nswitch(state)\n{\n case STATE_1:\n state = DoState1(transition);\n break;\n case STATE_2:\n s...
Apple's CoreGraphics library defines two functions for describing an arc. CGPathAddArc adds an arc based on a center point, radius, and pair of angles. CGPathAddArcToPoint adds an arc based on a radius and a pair of tangent lines. The details are explained in the CGPath API reference. Why two functions? Simple conv...
The existence of both `CGPathAddArc` and `CGPathAddArcToPoint` in the CoreGraphics library serves different use cases and provides flexibility for drawing paths, which is essential for graphics programming. ### Reasons for Two Functions 1. **Different Use Cases**: - **CGPathAddArc**: This function is used when you...
20,333
[ { "from": "human", "value": "Apple's CoreGraphics library defines two functions for describing an arc.\n\nCGPathAddArc adds an arc based on a center point, radius, and pair of angles.\nCGPathAddArcToPoint adds an arc based on a radius and a pair of tangent lines.\n\nThe details are explained in the CGPath A...
I've got two models, joined by a Has and Belongs To Many join table. Lets call these models User and Event. The majority of Users have 0 events, while few have one or more. I want to do something like: User.find(:all, :joins => :events, :conditions => ["'Something that count the events' > ?"], 0) The problem is, I'm ...
To achieve this in Rails using Active Record, you can modify your query to filter users based on the count of associated events. You can use the `group` and `having` clauses to get users that have one or more associated events. Here's how you can write your query: ```ruby User.joins(:events) .group('users.id') ...
19,974
[ { "from": "human", "value": "I've got two models, joined by a Has and Belongs To Many join table. Lets call these models User and Event. The majority of Users have 0 events, while few have one or more. I want to do something like:\nUser.find(:all, :joins => :events, :conditions => [\"'Something that count...
In Python, you can do this: import webbrowser webbrowser.open_new("http://example.com/") It will open the passed in url in the default browser Is there a ruby equivalent?
Yes, in Ruby you can achieve similar functionality by using the `system` method to open a URL in the default web browser. Here’s an example: ```ruby url = "http://example.com/" system("open '#{url}'") # For macOS # system("xdg-open '#{url}'") # For Linux # system("start '#{url}'") # For Windows ``` You need to uncomm...
23,756
[ { "from": "human", "value": "In Python, you can do this:\nimport webbrowser\nwebbrowser.open_new(\"http://example.com/\")\n\nIt will open the passed in url in the default browser\nIs there a ruby equivalent?\n" }, { "from": "gpt", "value": "Yes, in Ruby you can achieve similar functionality by u...
I have a rails app that I have serving up XML on an infrequent basis. This is being run with mongrel and mysql. I've found that if I don't exercise the app for longer than a few hours it goes dead and starts throwing Errno::EPIPE errors. It seems that the mysql connection get timed out for inactivity or something like ...
The issue you're experiencing with your Rails application, where it becomes unresponsive after periods of inactivity, is likely due to MySQL closing the connection after a certain timeout period. When your application tries to execute a query after the connection has been closed, it results in `Errno::EPIPE` errors. H...
15,851
[ { "from": "human", "value": "I have a rails app that I have serving up XML on an infrequent basis.\nThis is being run with mongrel and mysql.\nI've found that if I don't exercise the app for longer than a few hours it goes dead and starts throwing Errno::EPIPE errors. It seems that the mysql connection get ...
Are there any?
It looks like your question might be incomplete. Could you please provide more context or specify what you're asking about? I'd be happy to help!
24,681
[ { "from": "human", "value": "Are there any?\n" }, { "from": "gpt", "value": "It looks like your question might be incomplete. Could you please provide more context or specify what you're asking about? I'd be happy to help!" } ]
When you are working on a new website, what combinations of browsers and operating systems do you target, and at what priorities? Do you find targeting a few specific combinations (and ignoring the rest) better than trying to strive to make them all work as intended? Common browsers: Firefox (1.5, 2, 3) Internet Expl...
When developing a new website, it's essential to target a combination of browsers and operating systems that reflect the typical audience of the site. However, the landscape of browsers and operating systems is ever-evolving, and the approach to testing can vary based on factors such as user demographics, project goals...
16,045
[ { "from": "human", "value": "When you are working on a new website, what combinations of browsers and operating systems do you target, and at what priorities? Do you find targeting a few specific combinations (and ignoring the rest) better than trying to strive to make them all work as intended?\nCommon br...
Is there a fix or a workaround for the memory leak in getpwnam?
The `getpwnam` function is used in C/C++ programming to retrieve user account information based on a username from the system's user database. If you suspect a memory leak when using `getpwnam`, it is likely due to how the function is being called or how the returned data is being handled. Here are some points to cons...
17,117
[ { "from": "human", "value": "Is there a fix or a workaround for the memory leak in getpwnam?\n" }, { "from": "gpt", "value": "The `getpwnam` function is used in C/C++ programming to retrieve user account information based on a username from the system's user database. If you suspect a memory lea...
Using Microsoft SQL Server's database mirroring capability, can the mirroring occur between two clusters? All of the examples in MSDN show a topology indicating single servers for both the principal and mirror server.
Yes, Microsoft SQL Server's database mirroring can be configured between two clustered instances, but it requires specific configurations. When you're dealing with database mirroring in a clustered environment, it's essential to understand the following: 1. **Clustered Instances**: SQL Server can run in a failover clu...
19,579
[ { "from": "human", "value": "Using Microsoft SQL Server's database mirroring capability, can the mirroring occur between two clusters? All of the examples in MSDN show a topology indicating single servers for both the principal and mirror server.\n" }, { "from": "gpt", "value": "Yes, Microsoft S...
Does it matter to developers that the current, and newer versions of .Net don't support windows 2000? It scares me to think that several of my clients still use Windows 2000 and although I may decide to stop supporting Windows 2000 one day, I don't like that Microsoft is pushing it on people's products. Could anyone s...
Your concerns regarding the lack of support for Windows 2000 in newer versions of .NET are valid, especially considering the needs of clients who may still be using older operating systems. Here are some points to consider regarding your situation: 1. **Legacy Systems**: Many businesses rely on legacy systems for vari...
19,816
[ { "from": "human", "value": "Does it matter to developers that the current, and newer versions of .Net don't support windows 2000?\nIt scares me to think that several of my clients still use Windows 2000 and although I may decide to stop supporting Windows 2000 one day, I don't like that Microsoft is pushin...
How can I round a decimal number (floating point) to the nearest integer? e.g. 1.2 = 1 1.7 = 2
To round a decimal number (floating point) to the nearest integer in most programming languages, you can use a built-in function. Here are examples for several popular programming languages: ### Python You can use the `round()` function: ```python rounded_number = round(1.2) # returns 1 rounded_number = round(1.7) #...
17,856
[ { "from": "human", "value": "How can I round a decimal number (floating point) to the nearest integer? \ne.g.\n1.2 = 1\n1.7 = 2\n\n" }, { "from": "gpt", "value": "To round a decimal number (floating point) to the nearest integer in most programming languages, you can use a built-in function. Her...
I'd like my .exe to have access to a resource string with my svn version. I can type this in by hand, but I'd prefer an automated way to embed this at compile time. Is there any such capability in Visual Studio 2008?
Yes, you can automate the process of embedding the SVN version into your .exe file at compile time using Visual Studio 2008. You can achieve this by using a pre-build event to run a script that retrieves the SVN version and then updates a resource file. Here's how you can do it step-by-step: ### Step 1: Create a Resou...
17,308
[ { "from": "human", "value": "I'd like my .exe to have access to a resource string with my svn version. I can type this in by hand, but I'd prefer an automated way to embed this at compile time. Is there any such capability in Visual Studio 2008?\n" }, { "from": "gpt", "value": "Yes, you can au...
Which of the two databases is most popular in business/industry? I ask this because in terms of straight revenue or market share, I suspect they're about 50-50, because US government is big on DB2. So, discounting government, military, and academia, which database vendor has the greatest share of the business segment?
In the business and industry sectors, Oracle Database tends to be the most popular choice, often leading in terms of market share and revenue. This is largely due to its long-standing presence in the enterprise space, extensive features, and strong support for high-performance transaction processing. While IBM's DB2 h...
23,450
[ { "from": "human", "value": "Which of the two databases is most popular in business/industry? I ask this because in terms of straight revenue or market share, I suspect they're about 50-50, because US government is big on DB2. So, discounting government, military, and academia, which database vendor has the...
I have a class declared as follows: Public MustInherit Container(Of T As {New, BaseClass}) Inherits ArrayList(Of T) I have classes that inherit this class. I have another class that I must pass instances in this method: Public Sub LoadCollection(Of T As {BaseClass, New})(ByRef Collection As Container(Of T)) I need to...
To declare a variable that can store instances of a class that is derived from a generic type with constraints, you need to use the `Container(Of BaseClass)` type as a base type. However, since `Container(Of T)` is a generic type, and you have a constraint on `T`, you cannot directly declare `_Container` as `Container(...
19,265
[ { "from": "human", "value": "I have a class declared as follows:\nPublic MustInherit Container(Of T As {New, BaseClass}) Inherits ArrayList(Of T)\n\nI have classes that inherit this class.\nI have another class that I must pass instances in this method:\nPublic Sub LoadCollection(Of T As {BaseClass, New})(B...
What are current practices for enabling developers to build systems that contain private data? Can anyone point to a "best practices" guide for that sort of thing? We have a Catch-22 here in that developers need to write applications that go against systems that have data that is considered "private." The IT administra...
When dealing with private data in development environments, there are several best practices that organizations can implement to balance the need for developers to work effectively with the need to protect sensitive information. Here are some key strategies and practices, along with references to relevant guidelines an...
8,480
[ { "from": "human", "value": "What are current practices for enabling developers to build systems that contain private data? Can anyone point to a \"best practices\" guide for that sort of thing?\nWe have a Catch-22 here in that developers need to write applications that go against systems that have data tha...
I asked here about a protocol that I was asked to implement, and how secure it was. Since it seemed clear from the very beginning that it was shit. Being so I ask: Can you guys point me to some very simple login protocol (I am null at cryptography systems)?? I am developing both server and client side of the applicatio...
Certainly! If you are looking for a simple and secure way to handle authentication without sending passwords in plain text, you can use a method known as the **Challenge-Response Authentication Protocol**. This method is relatively straightforward, not too lengthy in terms of message exchange, and avoids sending the pa...
17,551
[ { "from": "human", "value": "I asked here about a protocol that I was asked to implement, and how secure it was. Since it seemed clear from the very beginning that it was shit. Being so I ask:\nCan you guys point me to some very simple login protocol (I am null at cryptography systems)?? I am developing bot...
How can an object be loaded via Hibernate based on a field value of a member object? For example, suppose the following classes existed, with a one-to-one relationship between bar and foo: Foo { Long id; } Bar { Long id; Foo aMember; } How could one use Hibernate Criteria to load Bar if you only had the i...
To load a `Bar` object based on the `id` of the associated `Foo` object using Hibernate Criteria, you can do so without first loading the `Foo` object. Instead of loading the `Foo` and using it as a criterion, you can directly reference the `Foo`'s ID in your Criteria query. Here's how you can do that: ### Using Hib...
15,362
[ { "from": "human", "value": "How can an object be loaded via Hibernate based on a field value of a member object? For example, suppose the following classes existed, with a one-to-one relationship between bar and foo:\nFoo {\n Long id;\n}\n\nBar {\n Long id;\n Foo aMember;\n}\n\nHow could one use H...
exact code will be helpful. I assume the DirectoryServices namespace does it but I can't find the method that does it. I need actual C# code. All the samples I found so far are VB or VBScript. The C# examples I found are for reading/setting ADSI properties. A command like backup seems to have a certain .NET syntax whi...
To perform a backup of Active Directory using C#, you will typically interact with the Windows API, as there is no direct method in the .NET `DirectoryServices` namespace to back up Active Directory. However, you can execute Windows commands via C# that can invoke tools like `ntbackup` (for older versions of Windows) o...
17,923
[ { "from": "human", "value": "exact code will be helpful. I assume the DirectoryServices namespace does it but I can't find the method that does it.\n\nI need actual C# code. All the samples I found so far are VB or VBScript. The C# examples I found are for reading/setting ADSI properties. A command like bac...
I need to do some simple timezone calculation in mod_perl. DateTime isn't an option. What I need to do is easily accomplished by setting $ENV{TZ} and using localtime and POSIX::mktime, but under a threaded MPM, I'd need to make sure only one thread at a time was mucking with the environment. (I'm not concerned about...
To safely modify the environment variable `TZ` in a threaded environment like mod_perl, you'll need to use a mutex to ensure that only one thread at a time can access the critical section of code that modifies the environment variable. Below, I'll guide you through creating a mutex and using it for this purpose in Perl...
17,729
[ { "from": "human", "value": "I need to do some simple timezone calculation in mod_perl. DateTime isn't an option. What I need to do is easily accomplished by setting $ENV{TZ} and using localtime and POSIX::mktime, but under a threaded MPM, I'd need to make sure only one thread at a time was mucking with t...
I have been rather successful in promoting JQuery within my organization. No small feat on it's own. However, one of the ideas being kicked around here to make it part of our app is to create an ASP.net server side control. (We are going to be sticking with WebForms for the foreseeable future.) I'm not too wild about t...
Creating an ASP.NET server control to serve up jQuery does have its pros and cons, and it’s understandable that you're concerned about whether this approach is justified. Here are some thoughts based on your questions: ### Pros of Using an ASP.NET Server Control for jQuery 1. **Centralized Management**: By creating a...
18,717
[ { "from": "human", "value": "I have been rather successful in promoting JQuery within my organization. No small feat on it's own. However, one of the ideas being kicked around here to make it part of our app is to create an ASP.net server side control. (We are going to be sticking with WebForms for the fore...
I've run into a problem where I'm getting two printouts of my /etc/motd file on Gentoo Linux. sshd is doing one of the printouts, and I can toggle that by configuring /etc/ssh/sshd_config, but I can't find out who's printing the second copy. I can't disable sshd from printing out the motd due to an audit requirement....
If you're seeing two printouts of the Message of the Day (MOTD) upon SSH login and you've already confirmed that one of them is coming from `sshd`, the second copy is likely being printed from your shell configuration or a login script. Here are a few places to check that might be causing the additional MOTD printout: ...
17,885
[ { "from": "human", "value": "I've run into a problem where I'm getting two printouts of my /etc/motd file on Gentoo Linux. sshd is doing one of the printouts, and I can toggle that by configuring /etc/ssh/sshd_config, but I can't find out who's printing the second copy. I can't disable sshd from printing ...
I read all the licenses, and frankly I am kindda baffled by the many choices available. I know some relax the limitation of the license so that open source stuff can be used in commercial applications. But other than that, why are there so many licenses out there? Is there any major difference between them. How do I go...
It's great that you're looking into open source licenses! Understanding the nuances between different licenses is key to choosing the right one for your own project. Here’s a summary of the licenses you mentioned, along with their main features and differences: ### 1. **GPL (General Public License)** - **Versions**...
18,805
[ { "from": "human", "value": "I read all the licenses, and frankly I am kindda baffled by the many choices available. I know some relax the limitation of the license so that open source stuff can be used in commercial applications.\nBut other than that, why are there so many licenses out there? Is there any ...
This question might not seem programming related at first, but let me explain. I'm stuck with using a keyboard that doesn't have home end page up and page down buttons. I need those functions for programming. So the question is: what's a good/free utility to define system wide shortcuts and macros in vista? Mapping for...
If you're looking for a way to define custom keyboard shortcuts and macros on Windows Vista to map keys like Ctrl + Left Arrow to Home and Ctrl + Right Arrow to End, there are a few utilities you can try. Here are some popular and free options: 1. **AutoHotkey**: - **Overview**: This is a powerful scripting languag...
19,454
[ { "from": "human", "value": "This question might not seem programming related at first, but let me explain.\nI'm stuck with using a keyboard that doesn't have home end page up and page down buttons. I need those functions for programming.\nSo the question is: what's a good/free utility to define system wide...
I have a two dimensional array that I need to load data into. I know the width of the data (22 values) but I do not know the height (estimated around 4000 records, but variable). I have it declared as follows: float[,] _calibrationSet; .... int calibrationRow = 0; While (recordsToRead) { for (int i = 0; i < Se...
The issue you're facing is that you need to define the size of the two-dimensional array in a way that allows for a variable height. In C#, you cannot initialize a two-dimensional array without specifying both dimensions, and because you only know one dimension (the width), you'll need to use a different approach. Sin...
20,699
[ { "from": "human", "value": "I have a two dimensional array that I need to load data into. I know the width of the data (22 values) but I do not know the height (estimated around 4000 records, but variable).\nI have it declared as follows: \nfloat[,] _calibrationSet;\n ....\nint calibrationRow = 0;\nWh...
To save network traffic I'd like to compress my data. The only trick is that I the client is a c application and the server is php. I'm looking for an open source compression library that's available for both c and php. I guess I could write an external c application to decompress my data, but I'm trying to avoid spawn...
For your needs, one of the best options for cross-language compression is **zlib**. This library is widely used for data compression and has support for both C and PHP, making it a great fit for your application. ### How to Use zlib: 1. **In C**: You can use the zlib library to compress and decompress data easily. It...
19,922
[ { "from": "human", "value": "To save network traffic I'd like to compress my data. The only trick is that I the client is a c application and the server is php. I'm looking for an open source compression library that's available for both c and php.\nI guess I could write an external c application to decompr...
What's the best way of adding spaces between strings myString = string.Concat("a"," ","b") or myString = string.Concat("a",Chr(9),"b") I am using stringbuilder to build an XML file and looking for something efficient. Thanks Edit ~ Language VB.NET
In VB.NET, when it comes to adding spaces between strings for building XML or any other output, both methods you've mentioned are valid, but they serve slightly different purposes. Let's clarify them and suggest some best practices. ### Methods Explained: 1. **Using a space character (`" "`):** ```vb.net myStri...
18,614
[ { "from": "human", "value": "What's the best way of adding spaces between strings\nmyString = string.Concat(\"a\",\" \",\"b\")\n\nor\nmyString = string.Concat(\"a\",Chr(9),\"b\")\n\nI am using stringbuilder to build an XML file and looking for something efficient.\nThanks\nEdit ~ Language VB.NET\n" }, {...
In a related question, my team is about to (hopefully) start using LINQ, and I'd like to take advantage of anonymous types. What is the best way to mix VB.NET's Option Strict (which we've been using through the life of the project) and the new Option Infer directives?
When working with LINQ in VB.NET, utilizing anonymous types can greatly simplify your code by allowing you to create lightweight types without explicitly defining a class. However, when mixing `Option Strict` and `Option Infer`, it’s essential to understand how they interact to maintain type safety. ### Option Strict ...
18,153
[ { "from": "human", "value": "In a related question, my team is about to (hopefully) start using LINQ, and I'd like to take advantage of anonymous types. What is the best way to mix VB.NET's Option Strict (which we've been using through the life of the project) and the new Option Infer directives?\n" }, ...
I am wondering what everyone thinks the best method of handling results from your own database is. Other teams may be involved and there is always the chance the procedure/data could be altered and erroneous results would occur. My question is this. Is it better to let and exception occur, catch and log it or try to ha...
The approach you take to handle database results can significantly affect the reliability and maintainability of your code, especially when collaborating with other teams and managing potential errors. Below are some considerations for both strategies you've mentioned: catching exceptions and handling contingencies. #...
18,398
[ { "from": "human", "value": "I am wondering what everyone thinks the best method of handling results from your own database is. Other teams may be involved and there is always the chance the procedure/data could be altered and erroneous results would occur. My question is this. Is it better to let and excep...
I'm hoping to find out what tools folks use to synchronize data between databases. I'm looking for a JDBC solution that can be used as a command-line tool. There used to be a tool called Sync4J that used the SyncML framework but this seems to have fallen by the wayside.
There are several tools and approaches that can help you synchronize data between databases using JDBC, especially if you are looking for command-line solutions. Here are some popular options: 1. **Apache Nifi**: Nifi is a powerful data integration tool that can automate data flows between systems. It can handle JDBC ...
17,846
[ { "from": "human", "value": "I'm hoping to find out what tools folks use to synchronize data between databases. I'm looking for a JDBC solution that can be used as a command-line tool.\nThere used to be a tool called Sync4J that used the SyncML framework but this seems to have fallen by the wayside.\n" },...
Can someone explain what are the benefits of using the @import syntax comparing to just including css using the standard link method?
The `@import` syntax and the standard `<link>` method are both used to include CSS stylesheets in HTML, but they have different implications and benefits. Here’s a comparison of the two: ### Benefits of Using `@import` 1. **Conditional Imports**: - You can use `@import` within a CSS file to conditionally load styl...
14,335
[ { "from": "human", "value": "Can someone explain what are the benefits of using the @import syntax comparing to just including css using the standard link method?\n" }, { "from": "gpt", "value": "The `@import` syntax and the standard `<link>` method are both used to include CSS stylesheets in HT...
My DBA requires all database access to be done through trusted domain account. This can be done if you set the web.config . This requires the user to login or to be on the domain for IE pass the credentials through. I want to impersonate a user by using code. I am using the code found in this knowledgebase article...
Impersonating a user in ASP.NET allows your application to run under a different user account, but as you've discovered, the impersonation context typically only lasts for the duration of the request in which it was established. This means that once you move to a new page or handler, the impersonation is lost. To main...
14,404
[ { "from": "human", "value": "My DBA requires all database access to be done through trusted domain account. This can be done if you set the web.config . This requires the user to login or to be on the domain for IE pass the credentials through. I want to impersonate a user by using code. I am using the...
While I'd love to get rid of requiring FrontPage Extensions on a heavy traffic site I host, the client requires it to administrate the site. Having just implemented Wildcard Application Mapping in IIS 6 on this site in order to provide integrated Forms Authentication security between ASP and ASP.NET resources, this bre...
It sounds like you're running into a compatibility issue between FrontPage Extensions and Wildcard Application Mapping in IIS 6. FrontPage Extensions rely on specific ISAPI filters and handlers to manage its administration and publishing functions, and the use of Wildcard Application Mapping for ASP.NET can interfere w...
18,812
[ { "from": "human", "value": "While I'd love to get rid of requiring FrontPage Extensions on a heavy traffic site I host, the client requires it to administrate the site. Having just implemented Wildcard Application Mapping in IIS 6 on this site in order to provide integrated Forms Authentication security be...
I'm using C++ and accessing a UNC path across the network. This path is slightly greater than MAX_PATH. So I cannot obtain a file handle. But if I run the program on the computer in question, the path is not greater than MAX_PATH. So I can get a file handle. If I rename the file to have less characters (minus length...
In Windows, the `MAX_PATH` limitation refers to the maximum character length of a path that can be used with many API calls and functions. This limit is 260 characters, which includes the drive letter, colon, backslash, directory names, file name, and a terminating null character. When you're working with a UNC (Unive...
13,302
[ { "from": "human", "value": "I'm using C++ and accessing a UNC path across the network. This path is slightly greater than MAX_PATH. So I cannot obtain a file handle.\nBut if I run the program on the computer in question, the path is not greater than MAX_PATH. So I can get a file handle. If I rename the ...
I'm trying to use a Microsoft Access database for a demo project that I'm thinking of doing in either CodeIgniter or CakePHP. Ignoring the possible folly of using Microsoft Access, I haven't been able to figure out precisely how the connection string corresponds to the frameworks' database settings. In straight PHP, I ...
To connect to a Microsoft Access database using CodeIgniter with ODBC, you need to properly format the connection string within the database configuration. Here's how you can set it up: 1. **Connection String**: You should include the complete connection string in the `hostname` field. The `hostname` field in CodeIgni...
18,210
[ { "from": "human", "value": "I'm trying to use a Microsoft Access database for a demo project that I'm thinking of doing in either CodeIgniter or CakePHP. Ignoring the possible folly of using Microsoft Access, I haven't been able to figure out precisely how the connection string corresponds to the framework...
I have a 200+ case statement in Classic ASP which is getting out of control. It sets 5 variables, based on which case is selected. Address, Phone, Name etc. Just sets the variables and nothing else in each case. Databases or files are not an option for this application. Coming from the Perl world I would use a hash to ...
If you're looking to simplify a large set of conditional logic in Classic ASP, using a dictionary or an array can be an excellent way to structure your data. Classic ASP does not have a built-in hash structure like Perl, but it has the `Scripting.Dictionary` object, which behaves similarly and allows you to store key-v...
18,049
[ { "from": "human", "value": "I have a 200+ case statement in Classic ASP which is getting out of control. It sets 5 variables, based on which case is selected. Address, Phone, Name etc. Just sets the variables and nothing else in each case.\nDatabases or files are not an option for this application.\nComing...
I have this Document table with some meta data for the document in it and also the document content as a blob. then I use lucene.Net to query my documents; which in return gives me a list of Guids to my Document table and also two fields containing the highlighted html versions of the document name and extract with the...
In scenarios like yours, where you're trying to optimize your LINQ queries while avoiding unnecessary loading of large BLOB fields, you can consider a few alternative approaches without restructuring your database significantly. Here are some suggestions: ### 1. Use Projection Without Materializing Entities Instead o...
17,360
[ { "from": "human", "value": "I have this Document table with some meta data for the document in it and also the document content as a blob.\nthen I use lucene.Net to query my documents; which in return gives me a list of Guids to my Document table and also two fields containing the highlighted html versions...
I'm currently developing a website and my client wants the text of various articles to overflow into two columns. Kind of like in a newspaper? So it would look like: Today in Wales, someone actually Nobody was harmed in did something interesting. the incident, although one Authorities are baffled by th...
You can achieve a newspaper-style layout with columns using just CSS by utilizing the CSS `column` property. This allows you to create multi-column layouts easily without needing to manipulate your HTML structure with JavaScript. Here’s a simple example of how to implement this: ### HTML ```html <!DOCTYPE html> <htm...
18,561
[ { "from": "human", "value": "I'm currently developing a website and my client wants the text of various articles to overflow into two columns. Kind of like in a newspaper? So it would look like:\nToday in Wales, someone actually Nobody was harmed in\ndid something interesting. the incident, ...
Back in the olden days, there were tricks used (often for blitting offscreen framebuffers), to copy large chunks of memory from one location to another. Now that I'm working in C#, I've found the need to move an array of bytes (roughly 32k in size) from one memory location to another approximately 60 times per second. ...
In your benchmarking code, you've correctly identified that `Buffer.BlockCopy` is significantly faster than manual byte-by-byte copying in a loop, even when attempting to optimize it by copying multiple bytes at a time. `Buffer.BlockCopy` is optimized for performance and works well for your case of copying large arrays...
16,609
[ { "from": "human", "value": "Back in the olden days, there were tricks used (often for blitting offscreen framebuffers), to copy large chunks of memory from one location to another.\nNow that I'm working in C#, I've found the need to move an array of bytes (roughly 32k in size) from one memory location to a...
I’m getting an intermittent false negative on the following line of code in an ASP.NET 2 web site: if (!System.IO.Directory.Exists(folder)) The folder clearly exists, and even contains a log file that is written to when the CLR doesn’t lie about the folder’s existence. Any help would be appreciated.
Intermittent issues with directory existence checks can be tricky to diagnose, especially in an ASP.NET application. Here are several potential causes and solutions that you can investigate: 1. **Permissions Issues**: Ensure that the application pool user (the identity under which your ASP.NET application runs) has pe...
17,147
[ { "from": "human", "value": "I’m getting an intermittent false negative on the following line of code in an ASP.NET 2 web site:\nif (!System.IO.Directory.Exists(folder))\n\nThe folder clearly exists, and even contains a log file that is written to when the CLR doesn’t lie about the folder’s existence. Any h...
What's the easiest way to centre a java.awt.Window, such as a JFrame or a JDialog?
To center a `java.awt.Window`, such as a `JFrame` or `JDialog`, you can use the `setLocationRelativeTo(null)` method. This method positions the window in the center of the screen. Here’s how you can do it: ### For a JFrame: ```java import javax.swing.JFrame; public class CenteredFrame { public static void main(S...
21,036
[ { "from": "human", "value": "What's the easiest way to centre a java.awt.Window, such as a JFrame or a JDialog?\n" }, { "from": "gpt", "value": "To center a `java.awt.Window`, such as a `JFrame` or `JDialog`, you can use the `setLocationRelativeTo(null)` method. This method positions the window ...
I am exploring ASP.NET MVC and I wanted to add jQuery to make the site interactive. I used StringTemplate, ported to .Net, as my template engine to generate html and to send JSON. However, when I view the page, I could not see it. After debugging, I've realized that the $ is used by the StringTemplate to access propert...
It's great to see you're diving into ASP.NET MVC and exploring jQuery! Handling template engines can be tricky, especially when there's a conflict with the symbols they use. As you've discovered, the `$` symbol is a common point of conflict. ### Alternatives to StringTemplate While you can certainly stick with String...
16,573
[ { "from": "human", "value": "I am exploring ASP.NET MVC and I wanted to add jQuery to make the site interactive. I used StringTemplate, ported to .Net, as my template engine to generate html and to send JSON. However, when I view the page, I could not see it. After debugging, I've realized that the $ is use...
How can I instantiate a JMS queue listener in java (JRE /JDK / J2EE 1.4) that only receives messages that match a given JMSCorrelationID? The messages that I'm looking to pick up have been published to a queue and not a topic, although that can change if needed. Here's the code that I'm currently using to put the mess...
To instantiate a JMS queue listener in Java that only receives messages matching a given `JMSCorrelationID`, you can use a message selector. The message selector is a string expression used to filter the messages that the listener receives. Here’s a basic outline on how to set up a JMS queue listener that uses a mess...
15,774
[ { "from": "human", "value": "How can I instantiate a JMS queue listener in java (JRE /JDK / J2EE 1.4) that only receives messages that match a given JMSCorrelationID? The messages that I'm looking to pick up have been published to a queue and not a topic, although that can change if needed.\nHere's the cod...
How do I go about adding a trendline to a bar chart in reporting services 2005?
In SQL Server Reporting Services (SSRS) 2005, adding a trendline directly to a bar chart is not supported as a built-in feature like in some other charting tools. However, you can achieve a similar effect by using a combination of a bar chart and a line chart. Here’s how to do it: ### Steps to Add a Trendline to a Bar...
18,405
[ { "from": "human", "value": "How do I go about adding a trendline to a bar chart in reporting services 2005?\n" }, { "from": "gpt", "value": "In SQL Server Reporting Services (SSRS) 2005, adding a trendline directly to a bar chart is not supported as a built-in feature like in some other chartin...
Did anyone of you ever find a way of getting the Microsoft Report Viewer Control (Web) to work from within an Ajax UpdatePanel?
Getting the Microsoft Report Viewer Control to work within an AJAX UpdatePanel can be challenging due to the way the Report Viewer handles rendering and postbacks. However, there are workarounds that can help you achieve this. Here are some general steps and tips to integrate the Microsoft Report Viewer with an AJAX Up...
17,899
[ { "from": "human", "value": "Did anyone of you ever find a way of getting the Microsoft Report Viewer Control (Web) to work from within an Ajax UpdatePanel?\n" }, { "from": "gpt", "value": "Getting the Microsoft Report Viewer Control to work within an AJAX UpdatePanel can be challenging due to t...
I'm trying to display a boolean field in Report Designer in Visual Studio 2008. When I tried to run it, an error occurred: "An error has occurred during report processing. String was not recognized as a valid Boolean." I tried to convert it using CBool() but it didn't work.
The error "String was not recognized as a valid Boolean" suggests that the field you are trying to use as a Boolean in your report is coming in as a string, and that string is not being recognized as a valid Boolean value (`True` or `False`). To address this issue, you can take the following steps: 1. **Check the Da...
20,469
[ { "from": "human", "value": "I'm trying to display a boolean field in Report Designer in Visual Studio 2008. When I tried to run it, an error occurred:\n \"An error has occurred during report processing.\n String was not recognized as a valid Boolean.\"\n\nI tried to convert it using CBool() but it di...
I have a class that encapsulates tcp socket communications with a server. For each command message sent to the server, the server will send back a response message that invariably contains a response code (OK, Fail). Using my class, each command can be executed either sync or async. There are basically two types of exc...
Your approach to handling command responses and exceptions in your TCP socket communication class reflects a common challenge in designing a robust error-handling strategy. Here are some considerations for your current strategy and alternative approaches: ### Current Strategy: 1. **Enum Return Values**: Using an enum ...
17,381
[ { "from": "human", "value": "I have a class that encapsulates tcp socket communications with a server. For each command message sent to the server, the server will send back a response message that invariably contains a response code (OK, Fail). Using my class, each command can be executed either sync or as...
I was always wondering if there is operator for deleting multi dimensional arrays in the standard C++ language. If we have created a pointer to a single dimensional array int *array = new int[size]; the delete looks like: delete [] array; That's great. But if we have two dimension array, we can not do delete [][] two...
In C++, when you allocate memory for arrays, there are certain rules and conventions that dictate how memory allocation and deallocation should be handled. Let's clarify the concepts related to multidimensional arrays and their deletion. ### Single-Dimensional Arrays When you allocate a single-dimensional array using...
18,530
[ { "from": "human", "value": "I was always wondering if there is operator for deleting multi dimensional arrays in the standard C++ language.\nIf we have created a pointer to a single dimensional array\nint *array = new int[size];\n\nthe delete looks like:\ndelete [] array;\n\nThat's great. But if we have tw...
I've studied C programming in college some years ago and have developed some medium applications back then (nothing serious). Now I have to develop some more 'advanced' C applications (involving POSIX threads and RPC), but right now I'm a little rusty even with the basics. Can anyone recommend me good online C referenc...
Certainly! Here are some excellent online resources and reference manuals for C programming that can help you refresh your knowledge and get up to speed with more advanced topics like POSIX threads and RPC: 1. **C Programming Language (Kernighan & Ritchie)**: - While not an online manual, the book "The C Programmin...
17,172
[ { "from": "human", "value": "I've studied C programming in college some years ago and have developed some medium applications back then (nothing serious). Now I have to develop some more 'advanced' C applications (involving POSIX threads and RPC), but right now I'm a little rusty even with the basics.\nCan ...
I'm trying to balance a set of currency values using vb.net. The totals for both these values is cast as a double. I'm getting rounding errors in some situations. What's the best way to avoid this? Is there a type I can use in preference to double? How do I round the resultant value to two decimal places? Here's my co...
In VB.NET, using `Double` for currency calculations can lead to rounding errors due to the way floating-point arithmetic is handled. For financial calculations, it is generally advisable to use `Decimal`, which provides a better representation for monetary values because it has a higher precision and avoids some of the...
19,054
[ { "from": "human", "value": "I'm trying to balance a set of currency values using vb.net. The totals for both these values is cast as a double. I'm getting rounding errors in some situations. \nWhat's the best way to avoid this? Is there a type I can use in preference to double? How do I round the resultant...
we have a template project we often copy. so we can costumize the copy and still have a common template. To optimize the "copy & initial changes"-process, i though that i can write a little script, that does the following: copy the project-template (in svn) to another directory in the svn check-out the project and do ...
To automate the process of copying a project template from SVN, making some customizations, and then checking it back in, you can use a scripting approach. Here are some steps to guide you through the process and an example using a shell script (assuming a Unix-like environment). ### Steps to Automate the Process 1....
16,127
[ { "from": "human", "value": "we have a template project we often copy. so we can costumize the copy and still have a common template.\nTo optimize the \"copy & initial changes\"-process, i though that i can write a little script, that does the following:\n\ncopy the project-template (in svn) to another dire...
I have a complex query with group by and order by clause and I need a sorted row number (1...2...(n-1)...n) returned with every row. Using a ROWNUM (value is assigned to a row after it passes the predicate phase of the query but before the query does any sorting or aggregation) gives me a non-sorted list (4...567...123...
To achieve sorted row numbers along with your result set in SQL, you'll typically use the `ROW_NUMBER()` window function instead of `ROWNUM`. The `ROW_NUMBER()` function allows you to assign a unique sequential integer to rows within a partition of a result set, and you can control the order of those numbers based on t...
19,631
[ { "from": "human", "value": "I have a complex query with group by and order by clause and I need a sorted row number (1...2...(n-1)...n) returned with every row. Using a ROWNUM (value is assigned to a row after it passes the predicate phase of the query but before the query does any sorting or aggregation) ...
I am creating a website in CakePHP and I am kind of new on it. I couldn't find good resources on this matter, so there you go: I have a three table structure for registering users: Users, Addresses and Contacts. I have to build a view with info of all three tables like: Full Name: [ ] (from Users) Shi...
Creating a web form in CakePHP that collects information from multiple tables can be a bit challenging, especially for someone new to the framework. Below are some steps and guidelines to help you manage this structure effectively. ### Step 1: Setting Up Models You will need to set up the models for `Users`, `Addresse...
8,318
[ { "from": "human", "value": "I am creating a website in CakePHP and I am kind of new on it. I couldn't find good resources on this matter, so there you go:\nI have a three table structure for registering users: Users, Addresses and Contacts. I have to build a view with info of all three tables like:\n\nFull...
Do you know a good and free Hashtable imlementation for Delphi 5 ? I need to organize a huge amount of data in a hastable and I am bit worried about memory leak issues that I found in most available implementations on the web. Tks
For Delphi 5, there are a few good options for implementing a hashtable, but finding one that is both free and well-maintained can be a challenge. Here are some suggestions that you might find useful: 1. **TDictionary from Delphi's Generics.Collections**: If you have access to later versions of Delphi or can upgrade, ...
18,604
[ { "from": "human", "value": "Do you know a good and free Hashtable imlementation for Delphi 5 ?\nI need to organize a huge amount of data in a hastable and I am bit worried about memory leak issues that I found in most available implementations on the web.\nTks\n" }, { "from": "gpt", "value": "F...
Do .net applications run on linux? Are there any free/paid interop libraries available ?
Yes, .NET applications can run on Linux. With the introduction of .NET Core (now referred to as .NET 5 and later versions), Microsoft made significant strides in making the .NET framework cross-platform. This means that applications built using .NET can run on Windows, macOS, and Linux. ### Options for Running .NET Ap...
19,109
[ { "from": "human", "value": "Do .net applications run on linux? \nAre there any free/paid interop libraries available ?\n" }, { "from": "gpt", "value": "Yes, .NET applications can run on Linux. With the introduction of .NET Core (now referred to as .NET 5 and later versions), Microsoft made sign...
I am curious whether it is OK to copy a directory that is under version control and start working on both copies. I know it can be different from one VCS to another, but I intentionally don't specify any VCS since I am curious about different cases. I was talking to a coworker recently about doing it in SVN. I think it...
When dealing with version control systems (VCS), the ability to copy a working directory (or repository) and continue working on both copies can indeed differ depending on the VCS in question. Here’s a general overview of how this works for some common VCS systems, including SVN and various distributed VCS (DVCS) like ...
19,042
[ { "from": "human", "value": "I am curious whether it is OK to copy a directory that is under version control and start working on both copies.\nI know it can be different from one VCS to another, but I intentionally don't specify any VCS since I am curious about different cases.\nI was talking to a coworker...
Say you're coding some kind of web application. Something where people can contribute content, e.g. a simple photo-sharing site. How many good reasons can you think of to not go with an object-oriented database (e.g. db4o)?
When considering whether to use an object-oriented database (OODB) like db4o for a photo-sharing web application, there are several reasons you might decide against it. Here are some key points: 1. **Maturity and Adoption**: Relational databases (RDBMS) like MySQL, PostgreSQL, or SQLite are far more mature and widely ...
16,337
[ { "from": "human", "value": "Say you're coding some kind of web application. Something where people can contribute content, e.g. a simple photo-sharing site.\nHow many good reasons can you think of to not go with an object-oriented database (e.g. db4o)?\n" }, { "from": "gpt", "value": "When cons...
I'm looking for a few talking points I could use to convince coworkers that it's NOT OK to run a 24/7 production application by simply opening Visual Studio and running the app in debug mode. What's different about running a compiled console application vs. running that same app in debug mode? Are there ever times whe...
It's great that you're advocating for best practices when it comes to running production applications. Here are some talking points you can use to convince your coworkers that running a production application in debug mode is not advisable: ### 1. **Performance Overhead:** - **Debug Mode Slower Execution:** Debug m...
16,718
[ { "from": "human", "value": "I'm looking for a few talking points I could use to convince coworkers that it's NOT OK to run a 24/7 production application by simply opening Visual Studio and running the app in debug mode.\nWhat's different about running a compiled console application vs. running that same ap...
For years I've been using ShellExecute() API to launch the default web browser from within my applications. Like this: ShellExecute( hwnd, _T("open"), _T("http://www.winability.com/home/"), NULL, NULL, SW_NORMAL ); It's been working fine until a couple of weeks ago, when Google released its Chrome browser. N...
It seems you've been facing issues with the `ShellExecute` API after the installation of Google Chrome. This is a known issue with Chrome in some versions where it may not correctly handle certain commands for launching URLs through the `ShellExecute` API. Here's a refined approach to using the `ShellExecute` API whil...
17,651
[ { "from": "human", "value": "For years I've been using ShellExecute() API to launch the default web browser from within my applications. Like this:\nShellExecute( hwnd, _T(\"open\"), \n _T(\"http://www.winability.com/home/\"), \n NULL, NULL, SW_NORMAL );\n\nIt's been working fine until a couple of wee...
In https://bugs.java.com/bugdatabase/view_bug?bug_id=6525150 it says Release Fixed 7(b14), 6u2(b01) (Bug ID:2147561) What does 6u2 mean? (Am I right in assuming it as 1.6.0_02 ?)
Yes, you are correct. The notation "6u2" refers to version 1.6.0_02 of the Java Development Kit (JDK). In this context, "6" indicates the major version (Java 6), "u" stands for "update," and "2" indicates the second update of that major version. So, 6u2 is indeed equivalent to version 1.6.0_02.
22,944
[ { "from": "human", "value": "In\nhttps://bugs.java.com/bugdatabase/view_bug?bug_id=6525150\nit says\nRelease Fixed 7(b14), 6u2(b01) (Bug ID:2147561)\nWhat does 6u2 mean? (Am I right in assuming it as 1.6.0_02 ?)\n" }, { "from": "gpt", "value": "Yes, you are correct. The notation \"6u2\" refers t...
Using the default TWebBrowser makes things easy to embed a web browser. Unfortunately the one that comes in by default is IE<n>. I'm wondering how does one integrate a Gecko or WebKit one. Are there VCL examples somewhere? If not, how would one go about doing it? Where's the best place to find the core for Gecko and/o...
Integrating alternative web browsers like Gecko (from Firefox) or WebKit (used in browsers like Safari and earlier versions of Chrome) into Delphi applications is certainly possible but requires more effort than using the default `TWebBrowser`, which is tied to Internet Explorer. ### Using Gecko with Delphi For Gecko...
14,961
[ { "from": "human", "value": "Using the default TWebBrowser makes things easy to embed a web browser. Unfortunately the one that comes in by default is IE<n>.\nI'm wondering how does one integrate a Gecko or WebKit one.\n\nAre there VCL examples somewhere?\nIf not, how would one go about doing it?\nWhere's t...
The Matrix in SSRS (SQL Server Reporting Services 2005) seems to have issues with certain the border styles when exporting to XLS (but not PDF or web view; maybe other formats, not sure?). For example: Create a matrix and set the Matrix border style to Black Solid 1px, but all 4 of the cells to have a border style of B...
This is a known issue with SSRS 2005 when exporting matrices to Excel. The behavior you're experiencing is related to how SSRS renders borders and applies them to both the Matrix and its cells in various export formats. To achieve an outer border around the Matrix while avoiding borders on the individual cells during ...
19,931
[ { "from": "human", "value": "The Matrix in SSRS (SQL Server Reporting Services 2005) seems to have issues with certain the border styles when exporting to XLS (but not PDF or web view; maybe other formats, not sure?).\nFor example: Create a matrix and set the Matrix border style to Black Solid 1px, but all ...
What is the best way to free resources (in this case unlock the ReadWriteLock) when leaving the scope ? How to cover all possible ways (return, break, exceptions etc)?
When working with a `ReadWriteLock` in Java (or similar constructs in other languages), it's important to ensure that resources are properly released, regardless of how the control flow exits a block of code. This includes normal returns, breaks from loops, and exceptions. ### Using try-finally Block The recommended...
19,856
[ { "from": "human", "value": "What is the best way to free resources (in this case unlock the ReadWriteLock) when leaving the scope ? How to cover all possible ways (return, break, exceptions etc)?\n" }, { "from": "gpt", "value": "When working with a `ReadWriteLock` in Java (or similar constructs...
What are the implications of including a set of visual components released under a Mozilla Public License in a commercial application. Do I have any obligations?
Including visual components released under the Mozilla Public License (MPL) in a commercial application comes with specific obligations that you need to be aware of. Here are the key implications and requirements: 1. **Source Code Availability**: If you modify the MPL-licensed components, you must make the source code...
20,582
[ { "from": "human", "value": "What are the implications of including a set of visual components released under a Mozilla Public License in a commercial application.\nDo I have any obligations?\n" }, { "from": "gpt", "value": "Including visual components released under the Mozilla Public License (...
How do I get a list of all the tables defined for the database when using active record?
In Ruby on Rails, when you're using Active Record to interact with your database, you can easily get a list of all the tables defined in the database by querying the database schema. Here are a few methods you can use to achieve this: ### 1. Using Active Record's `connection` You can use the `ActiveRecord::Base.connec...
21,295
[ { "from": "human", "value": "How do I get a list of all the tables defined for the database when using active record?\n" }, { "from": "gpt", "value": "In Ruby on Rails, when you're using Active Record to interact with your database, you can easily get a list of all the tables defined in the data...
I have a .net application and i published in the local location. while installing from the published location the application need to install in "c:\temp" how can i do this in clickonce method?
ClickOnce deployment is designed to install applications in a user-specific location, typically under the user's profile (e.g., `C:\Users\<username>\AppData\Local\Apps\2.0`). It does not allow you to specify a custom installation directory like `C:\temp` directly. However, there are a few workarounds you might consid...
19,530
[ { "from": "human", "value": "I have a .net application and i published in the local location. while installing from the published location the application need to install in \"c:\\temp\" how can i do this in clickonce method?\n" }, { "from": "gpt", "value": "ClickOnce deployment is designed to i...
I have been using ASP.NET for years, but I can never remember when using the # and = are appropriate. For example: <%= Grid.ClientID %> or <%# Eval("FullName")%> Can someone explain when each should be used so I can keep it straight in my mind? Is # only used in controls that support databinding?
Certainly! The differences between `<%=` and `<%#` in ASP.NET are essential for understanding how to properly use them in your web applications. ### 1. `<%=` Syntax: - **Purpose**: The `<%=` syntax is used to output the value of an expression directly to the response stream. - **When to Use**: It is typically used for...
15,137
[ { "from": "human", "value": "I have been using ASP.NET for years, but I can never remember when using the # and = are appropriate.\nFor example:\n<%= Grid.ClientID %>\n\nor\n<%# Eval(\"FullName\")%>\n\nCan someone explain when each should be used so I can keep it straight in my mind? Is # only used in contr...
Microsoft Access is a slick way to access data in a MS SQL Server backend database, but I've always had problems accessing (so to speak) large tables of data, especially when trying to toggle between results and design mode in Access. Access gives me a number of nifty things, not the least of which is Crosstabs, but th...
Access can indeed struggle with performance when dealing with large datasets, particularly when connected to an MS SQL Server backend. Here are several strategies to optimize your ODBC connection and improve performance: ### 1. **Use Pass-Through Queries:** Instead of using standard Access queries that might pull larg...
19,476
[ { "from": "human", "value": "Microsoft Access is a slick way to access data in a MS SQL Server backend database, but I've always had problems accessing (so to speak) large tables of data, especially when trying to toggle between results and design mode in Access.\nAccess gives me a number of nifty things, n...
In several web application projects I've been a part of, the client asks to be able to create their own forms. The question arises on how to store their form definitions, and then how to store user inputted values into those custom forms. I've seen it done two ways: Assuming that the client only defines how many field...
The database model you've described is often referred to as a **"dynamic form"** or **"schema-less data model"**. It's essentially a way to allow for flexible data structures in a relational database, enabling clients to define custom forms with varying fields. ### Key Components of Your Proposed Model 1. **FormDefini...
17,833
[ { "from": "human", "value": "In several web application projects I've been a part of, the client asks to be able to create their own forms. The question arises on how to store their form definitions, and then how to store user inputted values into those custom forms.\nI've seen it done two ways:\n\nAssuming...
At the moment I check in all my files (including dll's, VS solution files, images, etc). I often need to checkout these files to a staging server or to a another developer and so having these files there means the project is setup there all ready to go. Whats the best practice here? EDIT: If I don't add the generated f...
In software development, especially when using version control systems (VCS) like Git, it's important to follow best practices regarding which files to include in your repository. This helps maintain a clean, efficient, and manageable project structure. Here's a breakdown of best practices regarding your situation: ##...
19,778
[ { "from": "human", "value": "At the moment I check in all my files (including dll's, VS solution files, images, etc). I often need to checkout these files to a staging server or to a another developer and so having these files there means the project is setup there all ready to go.\nWhats the best practice ...
I'm not the best programmer so I found it was much easier to write a program as several separate executables, which occasionally call each other. But now I need an easy way to actually run them without writing detailed instructions like Run file one, wait until its completed and no longer in process manager before run...
Creating a simple way to orchestrate the execution of multiple executables can indeed be achieved through various tools. Here are several options you might consider: ### 1. **Batch Scripts (Windows)** You can create a batch file (`.bat` or `.cmd`) that contains all the commands to run your executables in the required ...
16,720
[ { "from": "human", "value": "I'm not the best programmer so I found it was much easier to write a program as several separate executables, which occasionally call each other. But now I need an easy way to actually run them without writing detailed instructions like Run file one, wait until its completed an...
I've got the following user control: <TabItem x:Name="Self" x:Class="App.MyTabItem" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:app="clr-namespace:App" > <TabItem.Header> <!-- This works --> <...
The issue you are experiencing is a known limitation in WPF related to how the `TabControl` manages its `TabItem` templates and data contexts. When you define a `DataTemplate` for a `TabItem`, WPF does not retain the data context of the `TabItem` within that template, which is why your binding to the `ShortLabel` prope...
17,026
[ { "from": "human", "value": "I've got the following user control:\n<TabItem \n x:Name=\"Self\"\n x:Class=\"App.MyTabItem\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n xmlns:app=\"clr-namespace:App\"\n >\...
What is code coverage and how do YOU measure it? I was asked this question regarding our automating testing code coverage. It seems to be that, outside of automated tools, it is more art than science. Are there any real-world examples of how to use code coverage?
Code coverage is a metric used to evaluate the extent to which the source code of a program is executed when a particular test suite runs. It helps identify which parts of the code are being tested and which are not, allowing teams to improve their testing efforts and reduce potential bugs. Code coverage is typically e...
18,734
[ { "from": "human", "value": "What is code coverage and how do YOU measure it?\nI was asked this question regarding our automating testing code coverage. It seems to be that, outside of automated tools, it is more art than science. Are there any real-world examples of how to use code coverage?\n" }, { ...
I'm running VS2008 and have used SystemParametersInfo to activate "Focus Follows Mouse" and "Do not Raise On Focus." Sadly though, VS2008 (with and without SP1) doesn't honour the "Do not Raise" part and eagerly pushes into the foreground every time the pointer touches its window. A while ago I complained about that on...
The issue you're encountering with Visual Studio 2008 not honoring the "Do Not Raise On Focus" setting when using "Focus Follows Mouse" is a known problem, particularly with older versions of Visual Studio. Here are some potential workarounds you might consider: ### 1. Use a Different IDE While this may not be a direc...
18,489
[ { "from": "human", "value": "I'm running VS2008 and have used SystemParametersInfo to activate \"Focus Follows Mouse\" and \"Do not Raise On Focus.\" Sadly though, VS2008 (with and without SP1) doesn't honour the \"Do not Raise\" part and eagerly pushes into the foreground every time the pointer touches its...
How do you add a JAR file to an already existing Java library in Eclipse? Note that this is not a user library. That is, if you look at the Java Build Path for a Java project and click on the Libraries tab, you will see the list of libraries used by the project. If you expand a given library, you will see a list of J...
To add a JAR file to an existing Java library in Eclipse (specifically for Eclipse version 3.4.0), follow these steps: 1. **Open Your Java Project**: In the Eclipse workspace, locate and open the Java project to which you want to add the JAR file. 2. **Access Java Build Path**: Right-click on your project in the Proj...
18,444
[ { "from": "human", "value": "How do you add a JAR file to an already existing Java library in Eclipse? Note that this is not a user library.\nThat is, if you look at the Java Build Path for a Java project and click on the Libraries tab, you will see the list of libraries used by the project. If you expand...
I've got a machine I'm going to be using for development, and it has two 7200 RPM 160 GB SATA HDs in it. The information I've found on the net so far seems to be a bit conflicted about which things (OS, Swap files, Programs, Solution/Source code/Other data) I should be installing on how many partitions on which drives ...
Setting up your development machine optimally involves a balance between performance, convenience, and usability. Given your hardware configuration of two 7200 RPM 160 GB SATA hard drives, here’s a recommended partitioning strategy: ### Drive Configuration #### Drive 1: OS and Applications - **Partition 1: OS (C:)** ...
16,994
[ { "from": "human", "value": "I've got a machine I'm going to be using for development, and it has two 7200 RPM 160 GB SATA HDs in it.\nThe information I've found on the net so far seems to be a bit conflicted about which things (OS, Swap files, Programs, Solution/Source code/Other data) I should be installi...
I'm moving from Java Development to a MSFT environment. The app is currently written in VB6 and while its going to go to VB.NET/C# in the future, I need to find a way to pick up VB6 now. I'm told its old, and there will be no books on it available these days. Any tips? Sites?
Transitioning from Java to a legacy language like VB6 can be a challenge, but it's certainly manageable with the right resources. Although VB6 is considered outdated and not widely used anymore, you can still find materials to help you learn it. Here are some tips and resources to get you started: ### Tips for Learnin...
19,153
[ { "from": "human", "value": "I'm moving from Java Development to a MSFT environment. The app is currently written in VB6 and while its going to go to VB.NET/C# in the future, I need to find a way to pick up VB6 now. I'm told its old, and there will be no books on it available these days. \nAny tips? Sit...
Is it possible to, for instance, replace and free a TEdit with a subclassed component instantiated (conditionally) at runtime? If so, how and when it should be done? I've tried to set the parent to nil and to call free() in the form constructor and AfterConstruction methods but in both cases I got a runtime error. Bei...
Yes, it is possible to replace a `TEdit` with a subclassed component at runtime in Delphi, but it must be done carefully to avoid access violations or other runtime errors. Here’s a detailed explanation and the steps to do this properly. ### Steps to Replace a `TEdit` with a Subclassed Component at Runtime 1. **Creat...
16,582
[ { "from": "human", "value": "Is it possible to, for instance, replace and free a TEdit with a subclassed component instantiated (conditionally) at runtime? If so, how and when it should be done? I've tried to set the parent to nil and to call free() in the form constructor and AfterConstruction methods but ...
For PHP I have a date I want line wrapped. I have $date = '2008-09-28 9:19 pm'; I need the first space replaced with a br to become 2008-09-28<br>9:19 pm If it wasn't for that second space before PM, I would just str_replace() it.
To replace only the first space in your date string while keeping the second space intact, you can use the `strpos` function to find the position of the first space and then use `substr_replace` to replace it with `<br>`. Here's how you can do it in PHP: ```php $date = '2008-09-28 9:19 pm'; // Find the position of th...
21,687
[ { "from": "human", "value": "For PHP\nI have a date I want line wrapped.\nI have $date = '2008-09-28 9:19 pm';\nI need the first space replaced with a br\n to become \n2008-09-28<br>9:19 pm\n\nIf it wasn't for that second space before PM, I would just str_replace() it. \n" }, { "from": "gpt", "...
I have been trying to change the background color of Eclipse's windows to black and customize the font colors. There doesn't seem to be a way to do this, at least not in an obvious way. I am using version 3.3. How do I do this or are there any plugin's that might be able to assist in doing this?
Eclipse version 3.3 is quite old, and customizing the appearance can be limited compared to newer versions. However, you can still change the background color and font colors by following these steps: ### Changing Background and Font Colors in Eclipse 3.3 1. **Open Preferences**: - Go to `Window` in the menu bar. ...
19,568
[ { "from": "human", "value": "I have been trying to change the background color of Eclipse's windows to black and customize the font colors. There doesn't seem to be a way to do this, at least not in an obvious way. I am using version 3.3.\nHow do I do this or are there any plugin's that might be able to ass...
I need to set up an instance of SQL Server 2005 with SQL_Latin1_General_CP850_Bin as the server collation (the vendor did not take into accounting looking at DB collation for a bunch of things so stored procedures and temp tables default to the server level and the default collation will not work). During the install f...
It seems you want to change the collation of an existing SQL Server 2005 instance, but the command you're running isn't doing what you expect. Here are a few steps to help you resolve the situation: ### 1. Check the Collation Setting First, confirm that your SQL Server instance is currently set to the collation you m...
16,858
[ { "from": "human", "value": "I need to set up an instance of SQL Server 2005 with SQL_Latin1_General_CP850_Bin as the server collation (the vendor did not take into accounting looking at DB collation for a bunch of things so stored procedures and temp tables default to the server level and the default colla...
What is the best open source java workflow framework (e.g. OSWorkflow, jBPM, XFlow etc.)?
Choosing the "best" open-source Java workflow framework depends on your specific use case, requirements, and preferences. However, several popular open-source workflow frameworks are widely recognized in the Java community: 1. **jBPM**: - jBPM is a flexible Business Process Management (BPM) suite. It allows users ...
12,567
[ { "from": "human", "value": "What is the best open source java workflow framework (e.g. OSWorkflow, jBPM, XFlow etc.)?\n" }, { "from": "gpt", "value": "Choosing the \"best\" open-source Java workflow framework depends on your specific use case, requirements, and preferences. However, several pop...
I created a class derived from System.Configuration.Install for my installer. But the code in Uninstall() is being called when I try to update the application. How can I detect that the user is trying to update instead of uninstall? Maybe this post explains it better than me: My problem boils down to: when the user ...
When using a custom installer derived from `System.Configuration.Install.Installer`, it's important to correctly differentiate between an uninstall and an update operation, especially since the uninstall method can be invoked during an update process. Unfortunately, the `Uninstall()` method does not provide any built-...
18,377
[ { "from": "human", "value": "I created a class derived from System.Configuration.Install for my installer.\nBut the code in Uninstall() is being called when I try to update the application.\nHow can I detect that the user is trying to update instead of uninstall?\nMaybe this post explains it better than me:...
We are in the process of developing a .NET based IIS hosted web application as part of a re-platforming project. The original web app is on a Netscape server, in the process of migration we need to point the dns to the IIS server so that the requests are responded by IIS. at the same time we would still need the Netsca...
Migrating from an older technology stack to a .NET-based IIS-hosted web application requires careful planning to ensure a smooth transition. Here are some best practices and recommendations to guide you through the process: ### 1. **Dual-Hosting Strategy** - **Set Up Both Servers:** Before making DNS changes, ensu...
14,930
[ { "from": "human", "value": "We are in the process of developing a .NET based IIS hosted web application as part of a re-platforming project. The original web app is on a Netscape server, in the process of migration we need to point the dns to the IIS server so that the requests are responded by IIS. at the...
What are the C++ rules for calling the base class constructor from a derived class? For example, I know in Java, you must do it as the first line of the subclass constructor (and if you don't, an implicit call to a no-arg super constructor is assumed - giving you a compile error if that's missing).
In C++, calling the base class constructor from a derived class is somewhat different from how it's done in Java. Here are the key points regarding base class constructor calls in C++: 1. **Initialization List**: In C++, you must explicitly call the base class constructor in the initialization list of the derived clas...
16,587
[ { "from": "human", "value": "What are the C++ rules for calling the base class constructor from a derived class?\nFor example, I know in Java, you must do it as the first line of the subclass constructor (and if you don't, an implicit call to a no-arg super constructor is assumed - giving you a compile erro...
I'm trying to extend the TextBox, ComboBox and Panel controls using IExtenderProvider but I cannot get it to work properly. I'm starting to believe that I haven't understood the concept completely. Does anybody know any good resources on the web (with examples) on how IExtenderProvider is used?
Using `IExtenderProvider` in WinForms can be a bit tricky if you're not familiar with how it's designed to work. The `IExtenderProvider` interface allows you to create extender properties for existing controls, providing additional functionality without the need to subclass the controls themselves. Here are the key co...
16,020
[ { "from": "human", "value": "I'm trying to extend the TextBox, ComboBox and Panel controls using IExtenderProvider but I cannot get it to work properly. I'm starting to believe that I haven't understood the concept completely.\nDoes anybody know any good resources on the web (with examples) on how IExtender...
I am putting together a SVN demonstration using a WinXP Virtual PC image, and am unable to see my host machine from within the VPC guest OS. This demo will be performed while disconnected from our LAN, so I installed the Microsoft Loopback adapter on my laptop. In the TCP/IP settings I manually set the IP address to 1...
Setting up network communication between a host machine and a Virtual PC guest can sometimes be tricky, especially when using a loopback adapter. Here are a few steps and troubleshooting tips you can follow to ensure that the network communication is established correctly: 1. **IP Configuration**: Confirm that both th...
20,682
[ { "from": "human", "value": "I am putting together a SVN demonstration using a WinXP Virtual PC image, and am unable to see my host machine from within the VPC guest OS.\nThis demo will be performed while disconnected from our LAN, so I installed the Microsoft Loopback adapter on my laptop. In the TCP/IP s...
I'm looking for a cross-browser method of detecting that a client web browser is scrolled all the way to the bottom (or top) of the screen. Really, the top is fairly easy, as scrY = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop is zero if you're at the top. The problem is that scr...
To detect if a user has scrolled to the bottom (or top) of a webpage in a cross-browser compatible way, you can use the following JavaScript code. This approach accounts for different scenarios where `window`, `document`, and their respective properties might be used differently across browsers. Here’s how you can det...
18,718
[ { "from": "human", "value": "I'm looking for a cross-browser method of detecting that a client web browser is scrolled all the way to the bottom (or top) of the screen.\nReally, the top is fairly easy, as\nscrY = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop\nis zero if...
any bit of info will be helpful here. or does anybody else huge do something interesting here too?
It seems like you're looking for information or insights on a specific topic, but it's not entirely clear what that topic is. If you could provide a bit more detail about what you're interested in—such as a particular subject, event, or field—I'd be happy to help! Additionally, if you're looking for examples of interes...
21,367
[ { "from": "human", "value": "any bit of info will be helpful here. or does anybody else huge do something interesting here too?\n" }, { "from": "gpt", "value": "It seems like you're looking for information or insights on a specific topic, but it's not entirely clear what that topic is. If you c...
I'm changing my site to show friendly URLs like this: www.example.com/folder/topic Works fine! But when I add a parameter to the URL: www.example.com/folder/topic?page=2 $_GET stops working. It doesn't recognise the parameter at all. Am I missing something? The parameter worked fine before using full URLs.
When you switch to friendly URLs like `www.example.com/folder/topic`, you might be using a URL rewriting technique (commonly done with `.htaccess` in Apache or similar methods in other web servers). However, if you're adding a parameter (like `page=2`) and your application is not recognizing it, there are a few things ...
14,317
[ { "from": "human", "value": "I'm changing my site to show friendly URLs like this:\nwww.example.com/folder/topic\n\nWorks fine!\nBut when I add a parameter to the URL:\nwww.example.com/folder/topic?page=2\n\n$_GET stops working. It doesn't recognise the parameter at all. Am I missing something? The paramete...
I'm working on a project for my school on rails (don't worry this is not graded on code) and I'm looking for a clean way to traverse relationships in ActiveRecord. I have ActiveRecord classes called Users, Groups and Assignments. Users and Groups have a HABTM relationship as well as Groups and Assignments. Now what I n...
Certainly! You can optimize your `get_group` method to leverage ActiveRecord’s associations more effectively, avoiding the need for iteration or complex queries. Given that Users have a HABTM relationship with Groups, and Groups have a HABTM relationship with Assignments, you can use joins to directly query the associa...
21,238
[ { "from": "human", "value": "I'm working on a project for my school on rails (don't worry this is not graded on code) and I'm looking for a clean way to traverse relationships in ActiveRecord.\nI have ActiveRecord classes called Users, Groups and Assignments. Users and Groups have a HABTM relationship as we...
Is there a way of changing/adding to the windows Open/Save common dialog to add extra functionality? At work we have an area on a server with hundreds of 'jobfolders'- just ordinary windows folders created/managed automatically by the database application to house information about a job (emails/scanned faxes/Word docs...
Customizing the Windows Open/Save Common Dialogs or creating a completely custom dialog that can be used across all applications is quite challenging. Here are some approaches you could consider: ### 1. Custom Dialog Implementation You can create your own dialog for selecting job folders, but it won't be a direct rep...
16,446
[ { "from": "human", "value": "Is there a way of changing/adding to the windows Open/Save common dialog to add extra functionality?\nAt work we have an area on a server with hundreds of 'jobfolders'- just ordinary windows folders created/managed automatically by the database application to house information a...
Can anyone suggest a tutorial or sample code that implements a nested set (or similar ordered tree structure) with associated Javascript that facilitates drag and drop? I'm looking for both the display code (view) as well as the AJAX backend controller which writes the tree to the database on change. I want it to repre...
Creating a nested set structure with drag-and-drop functionality is a multi-step process, which involves both front-end (JavaScript) and back-end (AJAX with a server-side language) implementation. Below, I'll provide a basic example using HTML, jQuery (for drag-and-drop), and a simple Node.js/Express.js back-end for ha...
18,528
[ { "from": "human", "value": "Can anyone suggest a tutorial or sample code that implements a nested set (or similar ordered tree structure) with associated Javascript that facilitates drag and drop? I'm looking for both the display code (view) as well as the AJAX backend controller which writes the tree to t...
I guess the question is self-explanatory, but I'm wondering whether HTML qualifies as a programming language (obviously the "L" stands for language). The reason for asking is more pragmatic—I'm putting together a resume and don't want to look like a fool for listing things like HTML and XML under languages, but can't...
HTML (HyperText Markup Language) and XML (eXtensible Markup Language) are indeed considered markup languages rather than programming languages. They are used to structure and present data on the web, but they do not have the capabilities of a programming language, such as logic, control flow, or variable manipulation. ...
23,469
[ { "from": "human", "value": "I guess the question is self-explanatory, but I'm wondering whether HTML qualifies as a programming language (obviously the \"L\" stands for language). \nThe reason for asking is more pragmatic—I'm putting together a resume and don't want to look like a fool for listing things ...