instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
In ASP.NET, I am exporting some data to Excel by simply binding a DataSet to a GridView and then setting the ContentType to Excel.
My ASPX page is very simple and looks like this:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ExamExportReport.aspx.cs" Inherits="Cabi.CamCentral.Web.Pages.Utility.ExamExportRe... | The issue of having a blank first row in your exported Excel file when using a GridView in ASP.NET is a common problem. This behavior often arises due to the rendering of the GridView and the HTML markup that is generated.
Here are some steps you can take to resolve the issue:
1. **Render the GridView without any sur... | 18,000 | [
{
"from": "human",
"value": "In ASP.NET, I am exporting some data to Excel by simply binding a DataSet to a GridView and then setting the ContentType to Excel.\nMy ASPX page is very simple and looks like this:\n<%@ Page Language=\"C#\" AutoEventWireup=\"true\" CodeBehind=\"ExamExportReport.aspx.cs\" Inherit... |
I would like to handle an OracleException thrown when my network/database connection is interrupted, where can I find out what error codes I might can receive?
I guess since we are talking about a connection interruption these would be technically TNS errors such as ORA-12560 "TNS:protocol adapter error." But I have no... | To handle `OracleException` errors related to network or database connection interruptions, you can refer to the Oracle documentation, which provides a comprehensive list of error codes, including TNS (Transparent Network Substrate) errors.
### Common TNS Errors
Here are some common TNS errors related to connection i... | 19,348 | [
{
"from": "human",
"value": "I would like to handle an OracleException thrown when my network/database connection is interrupted, where can I find out what error codes I might can receive?\nI guess since we are talking about a connection interruption these would be technically TNS errors such as ORA-12560 \... |
I am working on developing an on-screen keyboard with java. This keyboard has a JComponent for every possible key. When a mouse down is detected on the button, I want to send a specific keyboard code to the application currently on focus. The keyboard itself is within a JFrame with no decorations and set to always-o... | Creating an on-screen keyboard in Java that sends key presses to another application while remaining "always-on-top" and without focus can be quite challenging. However, the Java `Robot` class can indeed be used to generate key events at the operating system level, but it requires that the window is not receiving focus... | 13,112 | [
{
"from": "human",
"value": "I am working on developing an on-screen keyboard with java. This keyboard has a JComponent for every possible key. When a mouse down is detected on the button, I want to send a specific keyboard code to the application currently on focus. The keyboard itself is within a JFram... |
I'm having a strange problem.
I have to use GetPostBackEventRefence to force a Postback, but it works the first time, after the first postback, the .NET function is not rendered... any ideas?
This is what I'm missing after the postback:
<script language="javascript" type="text/javascript">
<!--
function __doPostBack(ev... | It looks like you're encountering an issue where the JavaScript function responsible for handling postbacks (`__doPostBack`) is not being rendered after the first postback in an ASP.NET Web Forms application. This can happen for a few reasons. Here are some potential causes and solutions:
### 1. ViewState or ScriptMan... | 20,708 | [
{
"from": "human",
"value": "I'm having a strange problem.\nI have to use GetPostBackEventRefence to force a Postback, but it works the first time, after the first postback, the .NET function is not rendered... any ideas?\nThis is what I'm missing after the postback:\n<script language=\"javascript\" type=\"... |
Which is faster, python webpages or php webpages?
Does anyone know how the speed of pylons(or any of the other frameworks) compares to a similar website made with php?
I know that serving a python base webpage via cgi is slower than php because of its long start up every time.
I enjoy using pylons and I would still ... | The speed of web applications written in Python (using frameworks like Pylons, Flask, Django, etc.) versus PHP can depend on various factors, including the specific application, the complexity of the code, the server setup, and the way each language and framework handles requests.
### General Considerations:
1. **Sta... | 13,190 | [
{
"from": "human",
"value": "Which is faster, python webpages or php webpages?\nDoes anyone know how the speed of pylons(or any of the other frameworks) compares to a similar website made with php? \nI know that serving a python base webpage via cgi is slower than php because of its long start up every ti... |
I want a checkbox on a web page. When I click it, it sends an ajax request to the server. When the server replies, I want the checkbox to change. I can fix everything except the fact that the checkbox immediately changes state when clicked.
| To create a checkbox that sends an AJAX request to the server when clicked, without changing its state immediately upon clicking, you'll want to use JavaScript to handle the click event. You'll prevent the default behavior of the checkbox from occurring immediately and only update the checkbox state based on the server... | 17,951 | [
{
"from": "human",
"value": "I want a checkbox on a web page. When I click it, it sends an ajax request to the server. When the server replies, I want the checkbox to change. I can fix everything except the fact that the checkbox immediately changes state when clicked. \n"
},
{
"from": "gpt",
"v... |
I'm considering using reporting services 05 SP2 with share point integration on a new reporting project.
In this project's reports users can only see records they own. I was thinking a simple userId parameter on the report would allow me to filter the report's results to only these "owned" records.
I'm curious: Can I... | Using SQL Server Reporting Services (SSRS) integrated with SharePoint to restrict report data based on the current user's ID is a common scenario, and you can achieve this by passing parameters securely. Here's how you can set it up:
### Step 1: Capture the Current User's ID
In a SharePoint integrated environment, SS... | 19,052 | [
{
"from": "human",
"value": "I'm considering using reporting services 05 SP2 with share point integration on a new reporting project. \nIn this project's reports users can only see records they own. I was thinking a simple userId parameter on the report would allow me to filter the report's results to only ... |
I use an XML file in App_Data in conjunction with a Repeater on the main page of an intranet application allow me to display messages to users when they logon about application status, maintenance, etc. To test the functionality, it would be nice to have the file in the App_Data folder under development, but if I do t... | When working with XML files (or any other type of data file) in an ASP.NET application, it's important to manage how these files are published to avoid overwriting production data with development data.
Here are a few strategies to prevent the XML file from being overwritten during deployment, without needing to switc... | 20,550 | [
{
"from": "human",
"value": "I use an XML file in App_Data in conjunction with a Repeater on the main page of an intranet application allow me to display messages to users when they logon about application status, maintenance, etc. To test the functionality, it would be nice to have the file in the App_Dat... |
I am already excited about document databases and especially about CouchDB's simplicity. But I have a hard time understanding if such databases are a viable option for multi user systems. Since those systems require some kind of relations between records which document databases do not provide.
Is it completely the wro... | Document databases like CouchDB are indeed viable options for multi-user systems, and their flexibility makes them suitable for a range of applications, especially when dealing with semi-structured data. The way you model your data and manage relationships is crucial when using such databases.
### 1. Handling Relation... | 14,883 | [
{
"from": "human",
"value": "I am already excited about document databases and especially about CouchDB's simplicity. But I have a hard time understanding if such databases are a viable option for multi user systems. Since those systems require some kind of relations between records which document databases... |
I'm using PHP's PDO layer for data access in a project, and I've been reading up on it and seeing that it has good innate support for persistent DB connections. I'm wondering when/if I should use them. Would I see performance benefits in a CRUD-heavy app? Are there downsides to consider, perhaps related to security?
If... | Using persistent database connections with PHP's PDO can be a beneficial choice in certain scenarios, especially in a CRUD-heavy application. However, there are also important considerations to keep in mind regarding their use.
### Benefits of Persistent Connections
1. **Performance Improvement**:
- **Connection ... | 18,947 | [
{
"from": "human",
"value": "I'm using PHP's PDO layer for data access in a project, and I've been reading up on it and seeing that it has good innate support for persistent DB connections. I'm wondering when/if I should use them. Would I see performance benefits in a CRUD-heavy app? Are there downsides to ... |
Something else perhaps?
I am already using nHibernate, but I get occasional issues where a lazy initialized proxy object won't actually initialize. I'm thinking of trying something else. The site has user accounts, user posts and photos, and filtering of those to certain location names and title/description matches. No... | If you're facing issues with NHibernate's lazy loading and are considering alternatives, there are several approaches you can take. Below are some suggestions that address both the ORM choice and architectural considerations to improve your application's performance and reliability:
### 1. Alternative ORMs
If you're l... | 17,153 | [
{
"from": "human",
"value": "Something else perhaps?\nI am already using nHibernate, but I get occasional issues where a lazy initialized proxy object won't actually initialize. I'm thinking of trying something else. The site has user accounts, user posts and photos, and filtering of those to certain locati... |
I have what must be a typical catch-22 problem. I have a .NET WinForm control that contains a textbox and a checkbox. Both controls are data bound to properties on a data class instance. The textbox is for price, the check box to indicate that the price is a price override. Also on the data class is a property that... | You've described a common scenario when working with data binding in WinForms, where two controls need to influence each other's behavior but can end up triggering a cyclic update due to the data binding mechanism. Here’s a strategy to handle this situation more effectively:
### Approach
1. **Use Flags to Control Even... | 19,996 | [
{
"from": "human",
"value": "I have what must be a typical catch-22 problem. I have a .NET WinForm control that contains a textbox and a checkbox. Both controls are data bound to properties on a data class instance. The textbox is for price, the check box to indicate that the price is a price override. ... |
I have a legacy VB6 executable that runs on Vista. This executable shells out another legacy MFC C++ executable.
In our early Vista testing, this call would display the typical UAC message to get the user's permission before running the second executable. This wasn't perfect, but acceptable. However, it now looks lik... | When dealing with UAC (User Account Control) in Windows Vista, certain applications may exhibit behavior that depends on how they were coded and the system's UAC settings. If your VB6 executable is not prompting the UAC dialog when it tries to shell out to the MFC C++ executable, there are a few strategies you can cons... | 13,675 | [
{
"from": "human",
"value": "I have a legacy VB6 executable that runs on Vista. This executable shells out another legacy MFC C++ executable.\nIn our early Vista testing, this call would display the typical UAC message to get the user's permission before running the second executable. This wasn't perfect,... |
I have named_scope which is reused in multiple ActiveRecord models.
For example:
named_scope :limit, lambda {|limit| {:limit => limit}}
What is the best practice to extract this code to be shared across models.
Is it possible to extract it to a module or should I rather reopen ActiveRecord::Base class?
| To share a `named_scope` (now called a `scope` in Rails 3 and later) across multiple ActiveRecord models, the best practice is to extract it to a module. This way, you can include or extend the module in any model where you want to use the shared scope. Reopening `ActiveRecord::Base` is generally not recommended becaus... | 19,542 | [
{
"from": "human",
"value": "I have named_scope which is reused in multiple ActiveRecord models.\nFor example:\n named_scope :limit, lambda {|limit| {:limit => limit}} \n\nWhat is the best practice to extract this code to be shared across models.\nIs it possible to extract it to a module or should I rat... |
#include <vector>
std::vector<long int> as;
long int a(size_t n){
if(n==1) return 1;
if(n==2) return -2;
if(as.size()<n+1)
as.resize(n+1);
if(as[n]<=0)
{
as[n]=-4*a(n-1)-4*a(n-2);
}
return mod(as[n], 65535);
}
The above code sample using memoization to calculate a recursive formula based on some... | Let's break down the code and your questions about how memoization works and how it's implemented in this specific case.
### Understanding the Code
The code you've provided implements a recursive function with memoization to compute values based on a recurrence relation. Here's a brief explanation of the key parts:
... | 13,258 | [
{
"from": "human",
"value": "#include <vector>\nstd::vector<long int> as;\n\nlong int a(size_t n){\n if(n==1) return 1;\n if(n==2) return -2;\n if(as.size()<n+1)\n as.resize(n+1);\n if(as[n]<=0)\n {\n as[n]=-4*a(n-1)-4*a(n-2);\n }\n return mod(as[n], 65535);\n}\n\nThe above code sample using me... |
I have a connection string being passed to a function, and I need to create a DbConnection based object (i.e. SQLConnection, OracleConnection, OLEDbConnection etc) based on this string.
Is there any inbuilt functionality to do this, or any 3rd party libraries to assist. We are not necessarily building this connection ... | Creating a `DbConnection`-derived object based on a connection string can be complex, especially if the format of the connection string varies and does not follow a specific standard that can be easily parsed to determine its type. However, there are a couple of approaches you can take, using both built-in functionalit... | 17,124 | [
{
"from": "human",
"value": "I have a connection string being passed to a function, and I need to create a DbConnection based object (i.e. SQLConnection, OracleConnection, OLEDbConnection etc) based on this string.\nIs there any inbuilt functionality to do this, or any 3rd party libraries to assist. We are... |
I would like to dynamically create a minimal transparent bar graph to display over a canvas.
I was thinking of using a custom renderer for a JButton or a JLabel; but how do I draw my bar graph in this renderer?
| To dynamically create a minimal transparent bar graph in a custom renderer for a `JButton` or `JLabel`, you'll want to override the `paintComponent` method of your component. In this method, you can use the `Graphics` object to draw the bars of your graph.
Below is an example of how to implement a custom `JPanel` that... | 17,412 | [
{
"from": "human",
"value": "I would like to dynamically create a minimal transparent bar graph to display over a canvas.\nI was thinking of using a custom renderer for a JButton or a JLabel; but how do I draw my bar graph in this renderer?\n"
},
{
"from": "gpt",
"value": "To dynamically create ... |
What are some guidelines for factoring of web services? On one extreme you have different procedures for every operation, and expose all types through WSDL. This seems to result in the WS interface changing as often as the business logic. On the other, a generic interface where the types and validation are performed... | Factoring web services is indeed a nuanced process, and there are valid arguments for both extremes you've described. Here are some guidelines and considerations that can help you make more informed decisions about how to structure your web service interfaces:
### 1. **Understand Business Requirements**
- **Stable ... | 15,921 | [
{
"from": "human",
"value": "What are some guidelines for factoring of web services? On one extreme you have different procedures for every operation, and expose all types through WSDL. This seems to result in the WS interface changing as often as the business logic. On the other, a generic interface whe... |
3-Tier design has been my standard design philosophy for years for database driven applications, and it has never failed me. For those who practice it, describe your layers.
I've found that many people muddle up the business tier and the data access tier, making it more like a 2.5-Tier design.
I prefer to move the data... | I appreciate your interest in a deeper discussion of the 3-tier architecture beyond just definitions. Here’s an overview of how I approach a 3-tier design for database-driven applications, along with specific implementations, particularly around the use of stored procedures, the handling of circular dependencies, and m... | 15,872 | [
{
"from": "human",
"value": "3-Tier design has been my standard design philosophy for years for database driven applications, and it has never failed me. For those who practice it, describe your layers.\nI've found that many people muddle up the business tier and the data access tier, making it more like a ... |
I have the following JSP code, that protects my web page and displays it only to know IP's
String ip_h = request.getRemoteAddr();
String host_h = request.getRemoteHost();
String iplist[] = new String[1];
iplist[0] = "127.0.0.1";
iplist[1] = "10.217.106.248";
int count = iplist.length;
boolean flag = false;... | To check whether an IP address belongs to a specific subnet (like `10.217.0.0/16`), you can use a combination of bitwise operations to compare the IP address against the subnet mask.
Here's how to do it in your JSP code:
1. **Convert the IP address to an integer**.
2. **Create a method to check if the IP is in the s... | 17,427 | [
{
"from": "human",
"value": "I have the following JSP code, that protects my web page and displays it only to know IP's\nString ip_h = request.getRemoteAddr(); \nString host_h = request.getRemoteHost(); \nString iplist[] = new String[1]; \niplist[0] = \"127.0.0.1\"; \niplist[1] = \"10.217.106.248\"; \n... |
This might be an odd question, but when I scale my image in C# I need it to be pixelated and not anti-aliased. Just like in MSpaint when you scale.
I hope images anti-alias by default in C#, or else I changed something I didn't want to.
I've tried playing around with the Graphics.InterpolationMode but no luck there. I'... | To achieve pixelated scaling of images in C#, you will need to use the correct `InterpolationMode` setting and ensure that the `Graphics` object is set up properly for drawing the image. In particular, for a pixelated effect (similar to what you would see in MS Paint), you should use `InterpolationMode.NearestNeighbor`... | 18,472 | [
{
"from": "human",
"value": "This might be an odd question, but when I scale my image in C# I need it to be pixelated and not anti-aliased. Just like in MSpaint when you scale.\nI hope images anti-alias by default in C#, or else I changed something I didn't want to.\nI've tried playing around with the Graph... |
Ok, this is a weird one. The junk data isn't random either, it appears to be substrings of the executable itself.
private void Form1_Load(object sender, EventArgs e)
{
string s = GetValue();
// at this point, s == "400". Why isn't really relevant (dumbed down a test)
if (s != "18446744073709551615")
... | It sounds like you're encountering a situation where the string `s` is being corrupted or altered, possibly due to memory corruption or an issue with how the `GetValue` method is implemented. This is an interesting problem, and there are a few potential causes to consider:
1. **Buffer Overflows**: If there is an overf... | 18,838 | [
{
"from": "human",
"value": "Ok, this is a weird one. The junk data isn't random either, it appears to be substrings of the executable itself.\nprivate void Form1_Load(object sender, EventArgs e)\n{\n string s = GetValue();\n // at this point, s == \"400\". Why isn't really relevant (dumbed down a tes... |
I need to add full web search to my site. I need something like Google Custom Search but with no ads and it has to be free. Any recommendation of a web service or open source project that can index my site and allow me to search it will be helpful.
My site is made in ruby on rails, if that helps.
I'll make this questio... | To add a full web search feature to your Ruby on Rails site without ads and at no cost, you have several options. Here are some recommendations for open-source projects and web services:
### Open Source Search Engines
1. **Elasticsearch**:
- **Description**: A powerful search engine based on the Lucene library tha... | 18,430 | [
{
"from": "human",
"value": "I need to add full web search to my site. I need something like Google Custom Search but with no ads and it has to be free. Any recommendation of a web service or open source project that can index my site and allow me to search it will be helpful.\nMy site is made in ruby on ra... |
Over the years as I have gone through school and been working in the industry I have often asked people for advice on commenting. Sadly, as we all know, commenting with many developers is something that is taken as a side note and not much else. With that said I usually get a fairly general answer. Really this does ... | Commenting is an essential aspect of writing maintainable code, especially in a collaborative environment like software development. In C#, using Visual Studio, here are some best practices and structures for effective commenting:
### 1. Use XML Documentation Comments
For public classes, methods, and properties, consi... | 16,777 | [
{
"from": "human",
"value": "Over the years as I have gone through school and been working in the industry I have often asked people for advice on commenting. Sadly, as we all know, commenting with many developers is something that is taken as a side note and not much else. With that said I usually get a ... |
A friend of mine claims that in a typical database, using (for example) nvarchar[256] will give marginally better performance than nvarchar[200] or nvarchar[250] because of the granularity of page allocations.
Is there any truth to this whatsoever?
Thanks!
| Your friend's claim has some truth, but it's essential to understand the details about how SQL Server (and other relational databases) handle variable-length data types like `nvarchar`.
1. **Variable Length**: The `nvarchar` type is variable-length, meaning it can store strings of varying lengths. However, the maximum... | 20,497 | [
{
"from": "human",
"value": "A friend of mine claims that in a typical database, using (for example) nvarchar[256] will give marginally better performance than nvarchar[200] or nvarchar[250] because of the granularity of page allocations.\nIs there any truth to this whatsoever?\nThanks!\n"
},
{
"fro... |
tempfile.mkstemp() returns:
a tuple containing an OS-level handle to an open file (as would be returned by os.open()) and the absolute pathname of that file, in that order.
How do I convert that OS-level handle to a file object?
The documentation for os.open() states:
To wrap a file descriptor in a "file
object",... | When you use `tempfile.mkstemp()`, it returns a tuple containing a file descriptor and the absolute pathname of the file. The issue you're encountering arises because the file descriptor (`tup[0]`) is being closed automatically when the `mkstemp` function returns. To avoid this, you need to ensure that you're managing ... | 22,478 | [
{
"from": "human",
"value": "tempfile.mkstemp() returns:\n\na tuple containing an OS-level handle to an open file (as would be returned by os.open()) and the absolute pathname of that file, in that order.\n\nHow do I convert that OS-level handle to a file object?\nThe documentation for os.open() states: \n\... |
How can I check the umask of a program which is currently running?
[update: another process, not the current process.]
| To check the umask of a running program (another process), you generally have to look at the file descriptor settings of that process, as umask affects how new files are created (specifically, the permissions of those files).
Here are a couple of methods to check the umask of a running process:
### Method 1: Using `s... | 18,817 | [
{
"from": "human",
"value": "How can I check the umask of a program which is currently running?\n[update: another process, not the current process.]\n"
},
{
"from": "gpt",
"value": "To check the umask of a running program (another process), you generally have to look at the file descriptor setti... |
I have a large project that I want to start using visual studio 2005 to edit. I want to tell it "Here are all the files I want you to track, now get on with it" and have them displayed as a directory tree, for example:
Folder 1
- File A
- File B
- File C
Folder 2
- Folder 3
- File X
- File Y
- File D
- File... | In Visual Studio 2005, organizing your project files in a way that reflects the directory structure on your disk can be a bit cumbersome, as it doesn’t automatically create a project structure based on the folder structure. However, you can achieve a structured view in the Solution Explorer by using a few approaches:
... | 18,600 | [
{
"from": "human",
"value": "I have a large project that I want to start using visual studio 2005 to edit. I want to tell it \"Here are all the files I want you to track, now get on with it\" and have them displayed as a directory tree, for example:\nFolder 1\n - File A\n - File B\n - File C\nFolder 2\n - F... |
Wondering if I need to do something in my swf to be able to access the assets on a different server, meaning more than just specify the url to the asset. Will flash handle the 'go get crossdomain.xml and authenticate everything' behind the scenes or do I need to include some special code beyond simply requesting the sw... | When accessing assets hosted on a different server from your SWF file, you need to consider the security model of Adobe Flash, which includes cross-domain access restrictions. To allow your SWF to load assets (like images, audio, or data) from a different domain, you will indeed require a `crossdomain.xml` file on the ... | 21,307 | [
{
"from": "human",
"value": "Wondering if I need to do something in my swf to be able to access the assets on a different server, meaning more than just specify the url to the asset. Will flash handle the 'go get crossdomain.xml and authenticate everything' behind the scenes or do I need to include some spe... |
I've used recursion quite a lot during my many years of programming to solve simple problems, but I'm fully aware that sometimes you need iteration due to memory/speed problems.
So, sometime in the very far past I went to try and find if there existed any "pattern" or text-book way of transforming a common recursion ap... | Transforming recursive algorithms into iterative ones can indeed follow some general patterns and rules. Here are some guidelines and techniques that may help you understand how to convert a recursive approach to an iterative one:
### 1. **Use a Stack**
Recursion implicitly uses a call stack to keep track of function... | 18,711 | [
{
"from": "human",
"value": "I've used recursion quite a lot during my many years of programming to solve simple problems, but I'm fully aware that sometimes you need iteration due to memory/speed problems.\nSo, sometime in the very far past I went to try and find if there existed any \"pattern\" or text-bo... |
How do I set the background colour of a listbox? I have a listbox with textblocks in it and there does not appear to be anyway that actually works to set the background colour of these controls, why is this seemingly so hard?
In the interests of full disclosure I asked a similar question earlier
| To set the background color of a ListBox in WPF (Windows Presentation Foundation), you generally want to style the ListBox and its items. If you're using TextBlocks within the ListBox, you may need to set the background for the ListBox and possibly adjust the DataTemplate used for its items. Here’s how you can do it.
... | 19,419 | [
{
"from": "human",
"value": "How do I set the background colour of a listbox? I have a listbox with textblocks in it and there does not appear to be anyway that actually works to set the background colour of these controls, why is this seemingly so hard?\nIn the interests of full disclosure I asked a simila... |
Okay, this is just a crazy idea I have. Stack Overflow looks very structured and integrable into development applications. So would it be possible, even useful, to have a Stack Overflow plugin for, say, Eclipse?
Which features of Stack Overflow would you like to have directly integrated into your IDE so you can use it... | Integrating Stack Overflow (SO) into an IDE like Eclipse could certainly provide useful features for developers, making it easier to access community-driven help and resources without needing to switch contexts. Here are some potential features that could enhance this integration:
### Suggested Features for a Stack Ov... | 17,869 | [
{
"from": "human",
"value": "Okay, this is just a crazy idea I have. Stack Overflow looks very structured and integrable into development applications. So would it be possible, even useful, to have a Stack Overflow plugin for, say, Eclipse? \nWhich features of Stack Overflow would you like to have directly ... |
Is there a web service of some sort (or any other way) to pull a current time zone settings for a (US) city. For the parts of the country that don't follow the Daylight Saving Time and basically jump timezones when everyone else is switching summer/winter time... I don't fancy creating own database of the places that d... | Yes, there are several web services and APIs that can provide you with the current timezone settings for US cities, including whether they observe Daylight Saving Time (DST). Here are a few popular options:
1. **Time Zone Database API (timezonedb.com)**:
- TimeZoneDB offers an API where you can get the current time... | 13,136 | [
{
"from": "human",
"value": "Is there a web service of some sort (or any other way) to pull a current time zone settings for a (US) city. For the parts of the country that don't follow the Daylight Saving Time and basically jump timezones when everyone else is switching summer/winter time... I don't fancy c... |
I have an .asmx in a folder in my application and I keep getting a 401 trying to access it.
I have double and triple checked the setting including the directory security settings. It allows anonymous. I turned off Windows Authentication.
If I delete the application and the folder its in, then redeploy it under the sa... | It sounds like you are experiencing a persistent configuration issue with IIS, where old settings related to your application continue to affect new deployments under the same name. Here are steps you can take to resolve the 401 Unauthorized errors and get IIS to "forget" the previous settings:
### 1. **Check Applicat... | 13,816 | [
{
"from": "human",
"value": "I have an .asmx in a folder in my application and I keep getting a 401 trying to access it.\nI have double and triple checked the setting including the directory security settings. It allows anonymous. I turned off Windows Authentication.\nIf I delete the application and the f... |
I have the following string and I would like to remove <bpt *>*</bpt> and <ept *>*</ept> (notice the additional tag content inside them that also needs to be removed) without using a XML parser (overhead too large for tiny strings).
The big <bpt i="1" x="1" type="bold"><b></bpt>black<ept i="1"></b></ept> <bpt i="2" x=... | You can achieve this by using a regular expression to match the `<bpt ...>*</bpt>` and `<ept ...>*</ept>` tags, including their contents. Below is a C# example that demonstrates how to remove these tags from your string:
### C# Example
```csharp
using System;
using System.Text.RegularExpressions;
class Program
{
... | 11,465 | [
{
"from": "human",
"value": "I have the following string and I would like to remove <bpt *>*</bpt> and <ept *>*</ept> (notice the additional tag content inside them that also needs to be removed) without using a XML parser (overhead too large for tiny strings).\nThe big <bpt i=\"1\" x=\"1\" type=\"bold\"><... |
Does anyone know of a simple way to compare two strings together to generate the "amount of difference" between the two? (in a numeric value) I have been crawling google with little luck on this. And after doing some coding it's not as simple as I had thought. Any clues?
| Comparing two strings and generating a numeric value that reflects their "amount of difference" can be approached in several ways, depending on how you define "difference." Here are some common methods:
### 1. Levenshtein Distance
The Levenshtein distance (or edit distance) is a measure of how many single-character e... | 16,927 | [
{
"from": "human",
"value": "Does anyone know of a simple way to compare two strings together to generate the \"amount of difference\" between the two? (in a numeric value) I have been crawling google with little luck on this. And after doing some coding it's not as simple as I had thought. Any clues?\n"
... |
Can someone provide a regular expression for parsing name/value pairs from a string? The pairs are separated by commas, and the value can optionally be enclosed in quotes. For example:
AssemblyName=foo.dll,ClassName="SomeClass",Parameters="Some,Parameters"
| To parse name/value pairs from a string where pairs are separated by commas and values can optionally be enclosed in quotes, you can use the following regular expression:
```regex
(\w+)=("([^"]*|[^"]*,"[^"]*")|"([^",]*)")
```
### Breakdown of the Regular Expression:
- `(\w+)` captures the name part of the pair (whic... | 19,110 | [
{
"from": "human",
"value": "Can someone provide a regular expression for parsing name/value pairs from a string? The pairs are separated by commas, and the value can optionally be enclosed in quotes. For example:\nAssemblyName=foo.dll,ClassName=\"SomeClass\",Parameters=\"Some,Parameters\"\n\n"
},
{
... |
So, I have a nice domain model built. Repositories handle the data access and what not. A new requirements has popped up that indicates that reasons need to be logged with deletes. Up until now, deletes have been fairly simple => Entity.Children.Remove(child). No internal change tracking was happening as my ORM too... | The requirement to log reasons for deletes introduces a new layer of complexity to your existing domain model. Here are a few approaches you could consider, including the two you've mentioned:
### 1. Use a Deleted Children Collection in the Parent Entity
This approach is viable and involves extending your current par... | 16,532 | [
{
"from": "human",
"value": "So, I have a nice domain model built. Repositories handle the data access and what not. A new requirements has popped up that indicates that reasons need to be logged with deletes. Up until now, deletes have been fairly simple => Entity.Children.Remove(child). No internal ch... |
When we add a variable to ASP.NET Session, where are those variables actually stored on the client side?
| In ASP.NET, session variables are stored on the server side, not on the client side. When you add a variable to the ASP.NET Session, it is stored in memory on the server (or in some configuration on a session state provider, such as a SQL Server database or a state server).
However, to maintain the session between req... | 22,938 | [
{
"from": "human",
"value": "When we add a variable to ASP.NET Session, where are those variables actually stored on the client side?\n"
},
{
"from": "gpt",
"value": "In ASP.NET, session variables are stored on the server side, not on the client side. When you add a variable to the ASP.NET Sessi... |
I'm trying to use the combobox component for Flash. I can't get the change event to fire. My code is pretty much straight of of the adobe site (link below). The box gets populated but changing the value produces no trace output. What am I doing wrong?
http://livedocs.adobe.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/js/ht... | It looks like you're trying to listen for the change event on a ComboBox component in Flash, but you're not getting the expected output. Let's make sure everything is set up correctly.
First, check a few things:
1. **Correctly Referencing the ComboBox**: Ensure that `myCombo` is properly instantiated and pointing to ... | 16,423 | [
{
"from": "human",
"value": "I'm trying to use the combobox component for Flash. I can't get the change event to fire. My code is pretty much straight of of the adobe site (link below). The box gets populated but changing the value produces no trace output. What am I doing wrong?\nhttp://livedocs.adobe.com/... |
Let's say you have a profile page that can only be accessed by the owner of that profile. This profile page is located at:
User/Profile/{userID}
Now, I imagine in order to prevent access to this page by other users, you could structure your UserController class's Profile function to check the current session's identit... | Unit testing controllers that depend on `HttpContext` can be challenging since `HttpContext` is tightly coupled to the ASP.NET infrastructure and is not easily mockable. To make your `UserController` more testable, it's a good idea to refactor your code to use dependency injection.
Here are the steps you can take to ... | 17,679 | [
{
"from": "human",
"value": "Let's say you have a profile page that can only be accessed by the owner of that profile. This profile page is located at:\nUser/Profile/{userID}\nNow, I imagine in order to prevent access to this page by other users, you could structure your UserController class's Profile func... |
I need to copy some records from our SQLServer 2005 test server to our live server. It's a flat lookup table, so no foreign keys or other referential integrity to worry about.
I could key-in the records again on the live server, but this is tiresome. I could export the test server records and table data in its entire... | You can achieve this by using SQL Server Management Studio (SSMS) to generate the appropriate SQL insert statements for the records you want to copy from your test server to the live server. Here's a step-by-step guide on how to do this:
### Step 1: Select the Records You Want to Copy
1. **Connect to your test SQL Ser... | 19,488 | [
{
"from": "human",
"value": "I need to copy some records from our SQLServer 2005 test server to our live server. It's a flat lookup table, so no foreign keys or other referential integrity to worry about.\nI could key-in the records again on the live server, but this is tiresome. I could export the test s... |
Every class that wants to use java.util.logging generally needs to declare a logger like this:
public class MyClass {
private static Logger _log = Logger.getLogger(MyClass.class.getName());
}
How do you avoid this MyClass.class.getName() boilerplate code?
| To avoid the boilerplate code of specifying `MyClass.class.getName()` when declaring a logger in each class, you can utilize a static method to encapsulate the creation of the logger. This way, you can simply call this method to retrieve the logger instance without repeating the boilerplate code in every class. Here’s ... | 20,668 | [
{
"from": "human",
"value": "Every class that wants to use java.util.logging generally needs to declare a logger like this:\npublic class MyClass {\n private static Logger _log = Logger.getLogger(MyClass.class.getName());\n}\n\nHow do you avoid this MyClass.class.getName() boilerplate code?\n"
},
{
... |
Site 1 has dll's for x amount of object and data calls. Can Site 2 (a separate .net web app) call the objects/dll's of Site 1 ?
| In general, a .NET web application (Site 2) cannot directly call the DLLs of another application (Site 1) unless certain conditions are met. Here are some ways you can enable communication between the two sites:
1. **Web Services**: The most common approach is to create a web service (e.g., RESTful API or SOAP) on Sit... | 10,524 | [
{
"from": "human",
"value": "Site 1 has dll's for x amount of object and data calls. Can Site 2 (a separate .net web app) call the objects/dll's of Site 1 ?\n"
},
{
"from": "gpt",
"value": "In general, a .NET web application (Site 2) cannot directly call the DLLs of another application (Site 1)... |
Does anyone know if it possible to define the equivalent of a "java custom class loader" in .NET?
To give a little background:
I am in the process of developing a new programming language that targets the CLR, called "Liberty". One of the features of the language is its ability to define "type constructors", which are ... | Yes, while .NET does not have a direct equivalent to Java's custom class loaders, you can simulate a similar behavior through several different approaches, leveraging the dynamic features of the CLR and the capabilities provided by the Reflection.Emit namespace.
### Approach 1: Reflection.Emit
You can use the `System... | 18,700 | [
{
"from": "human",
"value": "Does anyone know if it possible to define the equivalent of a \"java custom class loader\" in .NET?\nTo give a little background:\nI am in the process of developing a new programming language that targets the CLR, called \"Liberty\". One of the features of the language is its ab... |
Consider this problem: I have a program which should fetch (let's say) 100 records from a database, and then for each one it should get updated information from a web service. There are two ways to introduce parallelism in this scenario:
I start each request to the web service on a new Thread. The number of simultaneo... | The decision between launching individual requests in separate threads for each record versus batching records into smaller groups to be processed in separate threads depends on several factors, including resource management, complexity, and performance considerations. Here’s a breakdown of the two approaches:
### App... | 4,910 | [
{
"from": "human",
"value": "Consider this problem: I have a program which should fetch (let's say) 100 records from a database, and then for each one it should get updated information from a web service. There are two ways to introduce parallelism in this scenario:\n\nI start each request to the web servic... |
This could be weird, Have you ever come across a blog which you wanted to read in the chronological order? And that blog could be old, with several hundred posts. When i add this feed to my feed reader, say googlereader, the latest feed comes on top and as i scroll down further, the older posts appear. This could be fr... | Reading a blog in chronological order can indeed be a challenge with standard feed readers, which typically display the latest posts at the top. If you're interested in creating a custom solution to achieve this, I can guide you through the process using C#.
### Approach to the Problem
1. **Fetch the RSS Feed**: You... | 15,689 | [
{
"from": "human",
"value": "This could be weird, Have you ever come across a blog which you wanted to read in the chronological order? And that blog could be old, with several hundred posts. When i add this feed to my feed reader, say googlereader, the latest feed comes on top and as i scroll down further,... |
My SQL is a bit rusty -- is there a SQL way to project an input table that looks something like this:
Name SlotValue Slots
---- --------- -----
ABC 3 1
ABC 4 2
ABC 6 ... | You can achieve the desired transformation using SQL by combining a few techniques, including a recursive Common Table Expression (CTE) for generating the enumerated slots, along with a join operation to compute the sums.
Here is one way to accomplish the task:
```sql
WITH RECURSIVE SlotNumbers AS (
SELECT 1 AS S... | 20,033 | [
{
"from": "human",
"value": "My SQL is a bit rusty -- is there a SQL way to project an input table that looks something like this:\nName SlotValue Slots\n---- --------- -----\nABC 3 1\nABC 4 ... |
How can I test sending email from my application without flooding my inbox?
Is there a way to tell IIS/ASP.NET how to deliver email to a local folder for inspection?
| Yes, there are a few ways to test sending email from your application without flooding your inbox. Here are some strategies you can consider, especially in an IIS/ASP.NET environment:
### 1. **Use a Local SMTP Server**
You can set up a local SMTP server that captures emails without actually delivering them to an exter... | 17,119 | [
{
"from": "human",
"value": "How can I test sending email from my application without flooding my inbox? \nIs there a way to tell IIS/ASP.NET how to deliver email to a local folder for inspection?\n"
},
{
"from": "gpt",
"value": "Yes, there are a few ways to test sending email from your applicat... |
What does the "bus error" message mean, and how does it differ from a segmentation fault?
| A "bus error" and a "segmentation fault" are both types of errors that indicate a problem with memory access in a computer program, but they occur under different circumstances.
### Bus Error:
- **Definition**: A bus error occurs when a program attempts to access memory in a way that the underlying hardware cannot phy... | 20,543 | [
{
"from": "human",
"value": "What does the \"bus error\" message mean, and how does it differ from a segmentation fault?\n"
},
{
"from": "gpt",
"value": "A \"bus error\" and a \"segmentation fault\" are both types of errors that indicate a problem with memory access in a computer program, but th... |
Input: A positive integer K and a big text. The text can actually be viewed as word sequence. So we don't have to worry about how to break down it into word sequence.
Output: The most frequent K words in the text.
My thinking is like this.
use a Hash table to record all words' frequency while traverse the whole word ... | Your approach to finding the most frequent K words in a text using a hash table and a heap is quite sound and follows a common pattern in handling frequency-based problems. Below, I will go through your steps, validate your logic, and suggest a slight improvement for step 1) if possible.
### Breakdown of Steps
1. **... | 18,171 | [
{
"from": "human",
"value": "Input: A positive integer K and a big text. The text can actually be viewed as word sequence. So we don't have to worry about how to break down it into word sequence.\nOutput: The most frequent K words in the text.\nMy thinking is like this. \n\nuse a Hash table to record all wo... |
Like in Windows Forms:
Dim myForm as New AForm(Constr-arg1, Constr-arg2)
myForm.Show
... is there a similar way to Load a Page in ASP.Net. I would like to overload the Page Constructor and instantiate the correct Page Contructor depending on the situation.
| In ASP.NET Web Forms, the page lifecycle is different from Windows Forms, and you can't directly overload a page's constructor in the same way due to the way ASP.NET handles page instantiation and lifecycle. Instead, the ASP.NET runtime creates page instances and does not allow for direct instantiation with custom cons... | 12,998 | [
{
"from": "human",
"value": "Like in Windows Forms:\nDim myForm as New AForm(Constr-arg1, Constr-arg2)\nmyForm.Show\n... is there a similar way to Load a Page in ASP.Net. I would like to overload the Page Constructor and instantiate the correct Page Contructor depending on the situation.\n"
},
{
"fr... |
I'm trying to output a list of string values into a 2 column format. The standard way of making a list of strings into "normal text" is by using the string.join method. However, it only takes 2 arguments so I can only make a single column using "\n". I thought trying to make a loop that would simply add a tab between c... | To format the list of strings into a two-column format, you can iterate through the `skills_defs` list in pairs and then align them with some spacing. Here's a simple way to achieve that in Python:
```python
skills_defs = [
"ACM:Aircraft Mechanic", "BC:Body Combat", "BIO:Biology",
"CBE:Combat Engineer", "CHM:C... | 15,022 | [
{
"from": "human",
"value": "I'm trying to output a list of string values into a 2 column format. The standard way of making a list of strings into \"normal text\" is by using the string.join method. However, it only takes 2 arguments so I can only make a single column using \"\\n\". I thought trying to mak... |
I have a search form with a query builder. The builder is activated by a button. Something like this
<h:form id="search_form">
<h:outputLabel for="expression" value="Expression"/>
<h:inputText id="expression" required="true" value="#{searcher.expression}"/>
<button onclick="openBuilder(); return false;">Open Buil... | The issue you’re experiencing is due to how forms handle submit events in HTML. When the user presses the "Enter" key while an input field is focused, the browser tries to submit the form. The behavior can vary based on how the buttons are defined and which button has the focus.
In your case, the HTML structure includ... | 16,393 | [
{
"from": "human",
"value": "I have a search form with a query builder. The builder is activated by a button. Something like this\n<h:form id=\"search_form\">\n <h:outputLabel for=\"expression\" value=\"Expression\"/>\n <h:inputText id=\"expression\" required=\"true\" value=\"#{searcher.expression}\"/>\n ... |
I have seen a few (old) posts on the 'net about hacking together some support for pre-compiled headers in CMake. They all seem a bit all-over the place and everyone has their own way of doing it. What is the best way of doing it currently?
| As of my last knowledge update in October 2023, CMake does indeed support precompiled headers (PCH) in a more straightforward manner than it did in the past. The support has improved over time, and it’s now easier to handle PCH in your CMake projects without resorting to hacks or workarounds.
### Using CMake's Built-i... | 16,725 | [
{
"from": "human",
"value": "I have seen a few (old) posts on the 'net about hacking together some support for pre-compiled headers in CMake. They all seem a bit all-over the place and everyone has their own way of doing it. What is the best way of doing it currently?\n"
},
{
"from": "gpt",
"val... |
If I create a J# Application is there any way I can execute it on JVM as well
| J# is a Microsoft language that was designed to be compatible with Java and to allow developers to transition Java applications to the .NET Framework. However, J# compiles to .NET Intermediate Language (MSIL) rather than Java bytecode, which means that J# applications are intended to run on the .NET runtime (Common Lan... | 21,565 | [
{
"from": "human",
"value": "If I create a J# Application is there any way I can execute it on JVM as well\n"
},
{
"from": "gpt",
"value": "J# is a Microsoft language that was designed to be compatible with Java and to allow developers to transition Java applications to the .NET Framework. Howev... |
Is there a way to retrieve the time zone choices in Windows Mobile in order to display them in a GUI? It would be much better not to have to show every 15 minutes just to be
able to display GMT+5:45 for Kathmandu.
| In Windows Mobile, you can retrieve the time zone choices programmatically using the appropriate APIs. If you're developing a GUI for your application, you can fetch the time zones and present them in a user-friendly format without having to show every 15-minute increment. Here’s a general approach to achieve this:
##... | 16,853 | [
{
"from": "human",
"value": "Is there a way to retrieve the time zone choices in Windows Mobile in order to display them in a GUI? It would be much better not to have to show every 15 minutes just to be\nable to display GMT+5:45 for Kathmandu.\n"
},
{
"from": "gpt",
"value": "In Windows Mobile, ... |
I need to implement an in-memory tuple-of-strings matching feature in C. There will be large list of tuples associated with different actions and a high volume of events to be matched against the list.
List of tuples:
("one", "four")
("one")
("three")
("four", "five")
("six")
event ("one", "two", "three", "four")... | Your requirement to implement an in-memory tuple-of-strings matching feature in C can certainly be optimized for efficient matching against a list of tuples. Given the characteristics of your matching problem, there are a few approaches you could consider. Below, I'll outline a classic method that can help you achieve ... | 8,843 | [
{
"from": "human",
"value": "I need to implement an in-memory tuple-of-strings matching feature in C. There will be large list of tuples associated with different actions and a high volume of events to be matched against the list.\nList of tuples:\n(\"one\", \"four\")\n(\"one\")\n(\"three\")\n(\"four\", \"... |
How does one automatically find categories for text based on content?
| Automatically finding categories for text based on content is a common task in Natural Language Processing (NLP) known as text classification or topic categorization. This involves several steps and can utilize various techniques, including machine learning and deep learning. Here’s a structured approach to achieve thi... | 15,586 | [
{
"from": "human",
"value": "How does one automatically find categories for text based on content?\n"
},
{
"from": "gpt",
"value": "Automatically finding categories for text based on content is a common task in Natural Language Processing (NLP) known as text classification or topic categorizatio... |
Should it be on the development servers or a Subversion server?
I suppose this could be expanded to any client-server version control system.
| When deciding whether to use development servers or a dedicated Subversion (SVN) server (or any client-server version control system), several factors should be considered. Here are some considerations for each approach:
### Development Servers
**Pros:**
1. **Simplicity**: Setting up a version control system on a deve... | 17,404 | [
{
"from": "human",
"value": "Should it be on the development servers or a Subversion server?\nI suppose this could be expanded to any client-server version control system.\n"
},
{
"from": "gpt",
"value": "When deciding whether to use development servers or a dedicated Subversion (SVN) server (or... |
How do I convert a utf-8 string to a utf-16 string in PHP?
| To convert a UTF-8 string to a UTF-16 string in PHP, you can use the `mb_convert_encoding` function. This function allows you to convert strings between different character encodings.
Here’s an example of how to do this:
```php
<?php
// Example UTF-8 string
$utf8String = "Hello, World!"; // This is a UTF-8 encoded st... | 21,495 | [
{
"from": "human",
"value": "How do I convert a utf-8 string to a utf-16 string in PHP?\n"
},
{
"from": "gpt",
"value": "To convert a UTF-8 string to a UTF-16 string in PHP, you can use the `mb_convert_encoding` function. This function allows you to convert strings between different character en... |
I am writing a simple Python web application that consists of several pages of business data formatted for the iPhone. I'm comfortable programming Python, but I'm not very familiar with Python "idiom," especially regarding classes and objects. Python's object oriented design differs somewhat from other languages I've w... | Your approach to implementing a simple Python web application that retrieves and processes data is on the right track, but there are several improvements you can make to adhere more closely to Pythonic idioms and improve the structure, readability, and maintainability of your code. Here are some suggestions:
### 1. Us... | 13,573 | [
{
"from": "human",
"value": "I am writing a simple Python web application that consists of several pages of business data formatted for the iPhone. I'm comfortable programming Python, but I'm not very familiar with Python \"idiom,\" especially regarding classes and objects. Python's object oriented design d... |
I'm developing a an eclipse plugin that uses an SWT interface. I need to display text, and within that text there needs to be links. The only two widgets that I've found that will allow me to include clickable links in text are Link and Browser. Browser, however, is overkill for my needs, and I couldn't properly cus... | Hi Brian,
Flickering issues in SWT widgets, particularly with the `Link` widget, can be quite common, especially when they are redrawn or resized. Here are a few suggestions that may help mitigate the flickering or offer alternative solutions for clickable links:
### 1. Reduce Flickering with Double Buffering
You ca... | 15,852 | [
{
"from": "human",
"value": "I'm developing a an eclipse plugin that uses an SWT interface. I need to display text, and within that text there needs to be links. The only two widgets that I've found that will allow me to include clickable links in text are Link and Browser. Browser, however, is overkill ... |
I'm tired of using:
tail -f development.log
To keep track of my rails logs. Instead I would like something that displays the info in a grid and allows my to sort, filter and look at stack traces per log message.
Does anyone know of a GUI tool for displaying rails logs. Ideally I would like a standalone app (not somet... | There are several GUI tools that can help you manage and visualize your Rails logs in a more user-friendly way than `tail -f`. Here are a few options you might consider:
1. **Log Viewer**:
- There are standalone log viewer applications such as **LogViewer**, which can help you read and analyze log files in a more s... | 17,657 | [
{
"from": "human",
"value": "I'm tired of using: \ntail -f development.log\n\nTo keep track of my rails logs. Instead I would like something that displays the info in a grid and allows my to sort, filter and look at stack traces per log message.\nDoes anyone know of a GUI tool for displaying rails logs. Ide... |
Martin Fowler says that we should do refactoring before adding new features (given that the original program is not well-structured).
So we all want to refactor this dirty codebase, that's for sure. We also know that without unit-testing code it's very easy to introduce subtle bugs.
But it's a large codebase. Adding a ... | Refactoring a large codebase without a complete suite of unit tests can indeed be challenging. However, there are strategic steps you can take to safely refactor while gradually building up a testing framework. Here’s a structured approach:
1. **Assess the Codebase**: Identify the most critical parts of the code that ... | 18,404 | [
{
"from": "human",
"value": "Martin Fowler says that we should do refactoring before adding new features (given that the original program is not well-structured).\nSo we all want to refactor this dirty codebase, that's for sure. We also know that without unit-testing code it's very easy to introduce subtle ... |
I have a web project where I must import text and images from a user-supplied document, and one of the possible formats is Microsoft Office 2007. There's also a need to generate documents in this format.
The server runs CentOS 5.2 and has PHP/Perl/Python installed. I can execute local binaries and shell scripts if I mu... | To handle Microsoft Office 2007 documents (which primarily use the DOCX format), you have several options for both importing and generating documents in your web project. Here are some suggestions tailored to your stack:
### Importing Text and Images from DOCX Files
1. **PHP Libraries**:
- **PhpWord**: This is a p... | 16,656 | [
{
"from": "human",
"value": "I have a web project where I must import text and images from a user-supplied document, and one of the possible formats is Microsoft Office 2007. There's also a need to generate documents in this format.\nThe server runs CentOS 5.2 and has PHP/Perl/Python installed. I can execut... |
Does MS Access 2007 support internal foreign keys within the same table?
| Yes, MS Access 2007 does support internal foreign keys within the same table. This is often referred to as a self-referencing or self-joining foreign key.
For example, if you have a table called `Employees`, you might have a column called `ManagerID` that references the `EmployeeID` within the same table. This allows... | 22,305 | [
{
"from": "human",
"value": "Does MS Access 2007 support internal foreign keys within the same table?\n"
},
{
"from": "gpt",
"value": "Yes, MS Access 2007 does support internal foreign keys within the same table. This is often referred to as a self-referencing or self-joining foreign key. \n\nFo... |
I need to put video playback to my game, and the video must be in a texture so that it is played inside the game world.
I am using Java (Java3D, JOGL). Any idea on how I can do this?
| To implement video playback in a texture within a Java3D game using JOGL, you will generally follow these steps:
1. **Video Playback Library**: Since Java does not have built-in video playback support, you will need a library that can handle video decoding. Libraries like JavaFX, VLCJ, or JCodec can help you play vide... | 15,936 | [
{
"from": "human",
"value": "I need to put video playback to my game, and the video must be in a texture so that it is played inside the game world. \nI am using Java (Java3D, JOGL). Any idea on how I can do this?\n"
},
{
"from": "gpt",
"value": "To implement video playback in a texture within a... |
I would like to create XML Schema for this chunk of xml, I would like to restrict the values of "name" attribute, so that in output document on and only one instance of day is allowed for each week day:
<a>
<day name="monday" />
<day name="tuesday" />
<day name="wednesday" />
</a>
I have tried to use this:
<xs:... | The error you encountered arises because XML Schema does not allow you to define multiple elements with the same name (`day`) within the same sequence or choice. To achieve the goal of allowing only one instance of each weekday while using the same element name, you can use an `xs:choice` and provide the valid enumerat... | 17,054 | [
{
"from": "human",
"value": "I would like to create XML Schema for this chunk of xml, I would like to restrict the values of \"name\" attribute, so that in output document on and only one instance of day is allowed for each week day:\n<a>\n <day name=\"monday\" />\n <day name=\"tuesday\" />\n <day name=\... |
What's the best open source LINQ provider (in terms of completeness)?
I'm developing an open source LINQ provider myself and I'd like to borrow as many ideas as I can, avoid common pitfalls, etc.
Do not restrict yourself to database LINQ providers, any provider suggestion is welcome.
| When evaluating open-source LINQ providers for completeness and design quality, several noteworthy options stand out. These projects vary in their focus and implementation, but studying them can provide valuable insights for developing your own LINQ provider.
1. **LINQ to SQL**:
- While it's not strictly open-sourc... | 15,757 | [
{
"from": "human",
"value": "What's the best open source LINQ provider (in terms of completeness)? \nI'm developing an open source LINQ provider myself and I'd like to borrow as many ideas as I can, avoid common pitfalls, etc.\nDo not restrict yourself to database LINQ providers, any provider suggestion is ... |
This is a minor style question, but every bit of readability you add to your code counts.
So if you've got:
if (condition) then
{
// do stuff
}
else
{
// do other stuff
}
How do you decide if it's better like that, or like this:
if (!condition) then
{
// do other stuff
{
else
{
// do stu... | Your heuristics are quite sensible and align with common practices in writing readable and maintainable code. Here's a breakdown of your points and some additional considerations:
1. **Keep the condition positive**:
- Positive conditions tend to be easier to read and understand. When you read `if (condition)`, it ... | 19,929 | [
{
"from": "human",
"value": "This is a minor style question, but every bit of readability you add to your code counts.\nSo if you've got:\nif (condition) then\n{\n // do stuff\n}\nelse\n{\n // do other stuff\n}\n\nHow do you decide if it's better like that, or like this:\n if (!condition) then\n {\n... |
im currently overiding the WM_NCPAINT, WM_NCCALCSIZE and WM_NCACTIVATE to paint my own color/themed title bar for an application im working on. Now this is working great however the min, max and close buttons still are xp default theme.
I looked into what controls them and the mouse messages do. However they also conto... | To customize the appearance of the Minimize, Maximize, and Close buttons on the title bar in a Windows application, especially on Windows XP using MFC (Microsoft Foundation Classes), you'll need to perform a few steps. This is a bit tricky since the buttons are drawn by the system theme, but it is possible to override ... | 14,968 | [
{
"from": "human",
"value": "im currently overiding the WM_NCPAINT, WM_NCCALCSIZE and WM_NCACTIVATE to paint my own color/themed title bar for an application im working on. Now this is working great however the min, max and close buttons still are xp default theme.\nI looked into what controls them and the ... |
I'm looking for a built-in function/extended function in T-SQL for string manipulation similar to the String.Format method in .NET.
| In T-SQL, there is no direct equivalent to .NET's `String.Format` method. However, you can achieve similar string formatting by using various T-SQL string functions such as `CONCAT`, `FORMAT`, `REPLACE`, or a combination of string concatenation and placeholders.
### Using `FORMAT`
If you are using SQL Server 2012 or l... | 18,683 | [
{
"from": "human",
"value": "I'm looking for a built-in function/extended function in T-SQL for string manipulation similar to the String.Format method in .NET.\n"
},
{
"from": "gpt",
"value": "In T-SQL, there is no direct equivalent to .NET's `String.Format` method. However, you can achieve sim... |
I have an unmanaged C dll I call from a C# class library that encrypts a string value into an encrypted string that contains non-ascii characters. I need to take the data and write its binary values to a file, but C# treats text as string rather than a byte[].
The encrypted value commonly contains special characters ... | To work with the encrypted data from your unmanaged C DLL in C#, the goal is to avoid converting the encrypted string to a regular C# string, which can cause issues with non-ASCII characters and special characters. Instead, you can handle the data as a byte array.
Here are the steps you can take to achieve this:
### ... | 18,198 | [
{
"from": "human",
"value": "I have an unmanaged C dll I call from a C# class library that encrypts a string value into an encrypted string that contains non-ascii characters. I need to take the data and write its binary values to a file, but C# treats text as string rather than a byte[]. \nThe encrypted v... |
Is there a way to get more useful information on validation error? XmlSchemaException provides the line number and position of the error which makes little sense to me. Xml document after all is not about its transient textual representation. I'd like to get an enumerated error (or an error code) specifying what when w... | When working with XML documents and validating them against an XML Schema Definition (XSD), encountering validation errors can indeed be challenging, especially if the errors are reported only by line number and position. While `XmlSchemaException` gives some useful details, it often lacks context to help you quickly u... | 16,708 | [
{
"from": "human",
"value": "Is there a way to get more useful information on validation error? XmlSchemaException provides the line number and position of the error which makes little sense to me. Xml document after all is not about its transient textual representation. I'd like to get an enumerated error ... |
Code I am trying to run:
$query = "DESCRIBE TABLE TABLENAME";
$result = odbc_exec($h, $query);
The result:
PHP Warning: odbc_exec(): SQL error: [unixODBC][IBM][iSeries Access
ODBC Driver][DB2 UDB]SQL0104 - Token TABLENAME was not valid. Valid
tokens: INTO., SQL state 37000 in SQLExecDirect in ...
There were no ... | Yes, the error you're encountering is indeed related to a syntax issue in your SQL query. The `DESCRIBE TABLE` statement is not standard SQL, and the DB2 UDB (which is used by the IBM iSeries Access ODBC Driver) does not recognize it as a valid command.
In DB2, if you want to retrieve information about the structure ... | 19,114 | [
{
"from": "human",
"value": "Code I am trying to run:\n$query = \"DESCRIBE TABLE TABLENAME\";\n$result = odbc_exec($h, $query);\n\nThe result:\n\nPHP Warning: odbc_exec(): SQL error: [unixODBC][IBM][iSeries Access\n ODBC Driver][DB2 UDB]SQL0104 - Token TABLENAME was not valid. Valid\n tokens: INTO., SQL ... |
I keep reading about how great this new Canvas element for HTML5 is and I see amazing demos done with just javascript and no flash. Where can I find some good information on how to some of these things myself?
| The HTML5 `<canvas>` element is indeed a powerful tool for creating graphics and animations directly in the browser using JavaScript, without the need for Flash. There are plenty of resources available to help you learn how to use the Canvas API effectively. Here are some good places to start:
### Tutorials and Docume... | 18,435 | [
{
"from": "human",
"value": "I keep reading about how great this new Canvas element for HTML5 is and I see amazing demos done with just javascript and no flash. Where can I find some good information on how to some of these things myself?\n"
},
{
"from": "gpt",
"value": "The HTML5 `<canvas>` el... |
I would like to use Emacs to edit some VB6 files but Emacs does not appear to have any of built-in niceties of other languages such as syntax highlighting, etc.
Any plugins/extensions? What else can I do to make Emacs an acceptable and comfortable IDE for VB?
| Emacs can be configured to work with VB6 files, even though it doesn't come with built-in support for Visual Basic 6 syntax highlighting and other IDE features. Here are several steps you can take to enhance your Emacs experience for VB6 development:
### 1. Syntax Highlighting
You can use a major mode for Visual Basi... | 17,738 | [
{
"from": "human",
"value": "I would like to use Emacs to edit some VB6 files but Emacs does not appear to have any of built-in niceties of other languages such as syntax highlighting, etc. \nAny plugins/extensions? What else can I do to make Emacs an acceptable and comfortable IDE for VB?\n"
},
{
"... |
I'm using Exchange Web Services to Find, Create, Update, and Delete appointments from the calendars for one or more people. The application would be used by a manager to view employees' vacation time, as well as assign appointments based on availability.
In order for this to all work, an authenticated user's credential... | In scenarios where impersonation and passing user credentials directly are not viable options, you can consider using OAuth 2.0 for authentication with Exchange Web Services (EWS). This is a more secure and modern approach to accessing resources and performing operations on behalf of users without requiring their passw... | 18,547 | [
{
"from": "human",
"value": "I'm using Exchange Web Services to Find, Create, Update, and Delete appointments from the calendars for one or more people. The application would be used by a manager to view employees' vacation time, as well as assign appointments based on availability.\nIn order for this to al... |
If I have a script tag like this:
<script
id = "myscript"
src = "http://www.example.com/script.js"
type = "text/javascript">
</script>
I would like to get the content of the "script.js" file. I'm thinking about something like document.getElementById("myscript").text but it doesn't work in this case.
| The `script` tag with a `src` attribute does not contain the JavaScript code directly within the tag itself; instead, it references an external script file. Therefore, attempting to access the contents of the script using `document.getElementById("myscript").text` will not work, as there is no text content inside the t... | 16,318 | [
{
"from": "human",
"value": "If I have a script tag like this:\n<script\n id = \"myscript\"\n src = \"http://www.example.com/script.js\"\n type = \"text/javascript\">\n</script>\n\nI would like to get the content of the \"script.js\" file. I'm thinking about something like document.getElementById(\... |
I'm sure there's some trivial one-liner with perl, ruby, bash whatever that would let me run a command in a loop until I observe some string in stdout, then stop. Ideally, I'd like to capture stdout as well, but if it's going to console, that might be enough.
The particular environment in question at the moment is R... | You can accomplish this task using several scripting languages available in a typical Unix-like environment. Below are examples using Bash and Python, as they are generally available on most Linux and macOS systems.
### Using Bash
You can create a loop using a simple Bash one-liner. This example will run `your_comman... | 20,094 | [
{
"from": "human",
"value": "I'm sure there's some trivial one-liner with perl, ruby, bash whatever that would let me run a command in a loop until I observe some string in stdout, then stop. Ideally, I'd like to capture stdout as well, but if it's going to console, that might be enough. \nThe particular ... |
We implemented a server application available on Windows only. Now we like to port it to Linux, HP-UX and AIX, too. This application provides internal statistics through performance counters into the Windows Performance Monitor.
To be more precise: The application is a data base, and we like to provide information like... | To monitor performance metrics on Linux, HP-UX, and AIX, you have several options. However, each operating system has its own tools and frameworks for performance monitoring. Here's an overview:
### Linux
1. **Prometheus and Grafana**: A very popular open-source monitoring solution. Prometheus collects metrics and st... | 17,771 | [
{
"from": "human",
"value": "We implemented a server application available on Windows only. Now we like to port it to Linux, HP-UX and AIX, too. This application provides internal statistics through performance counters into the Windows Performance Monitor.\nTo be more precise: The application is a data bas... |
I have my winform application gathering data using databinding. Everything looks fine except that I have to link the property with the textedit using a string:
Me.TextEdit4.DataBindings.Add(New System.Windows.Forms.Binding("EditValue", Me.MyClassBindingSource, "MyClassProperty", True))
This works fine but if I change... | You can use reflection to obtain the property name dynamically, which allows you to avoid hardcoding the property name as a string. One way to achieve this is by using an `Expression<Func<T>>` to specify the property you want. This allows you to obtain the property name at compile time, which prevents the problems asso... | 21,747 | [
{
"from": "human",
"value": "I have my winform application gathering data using databinding. Everything looks fine except that I have to link the property with the textedit using a string:\n\nMe.TextEdit4.DataBindings.Add(New System.Windows.Forms.Binding(\"EditValue\", Me.MyClassBindingSource, \"MyClassProp... |
I am about to finalize the design of my webapplication, i am building it as an n-tier architecture and i am posed with the question of using DLinq vs EFM. I would appreciate if someone could give me some expert advice on it.
| When deciding between DLINQ (LINQ to SQL) and EFM (Entity Framework), it's important to understand the strengths and weaknesses of each technology, especially in the context of your web application using an n-tier architecture.
### DLINQ (LINQ to SQL)
**Strengths:**
1. **Simplicity:** LINQ to SQL is generally simpler ... | 16,481 | [
{
"from": "human",
"value": "I am about to finalize the design of my webapplication, i am building it as an n-tier architecture and i am posed with the question of using DLinq vs EFM. I would appreciate if someone could give me some expert advice on it.\n"
},
{
"from": "gpt",
"value": "When dec... |
I'm working on a loosely coupled cluster for some data processing. The network code and processing code is in place, but we are evaluating different methodologies in our approach. Right now, as we should be, we are I/O bound on performance issues, and we're trying to decrease that bottleneck. Obviously, faster switches... | Great question! When evaluating whether to use message passing libraries (like MPI) versus raw sockets for communication in a loosely coupled cluster, there are several factors to consider. Each method has its advantages and disadvantages, and the performance difference can vary based on your specific use case.
### Be... | 17,695 | [
{
"from": "human",
"value": "I'm working on a loosely coupled cluster for some data processing. The network code and processing code is in place, but we are evaluating different methodologies in our approach. Right now, as we should be, we are I/O bound on performance issues, and we're trying to decrease th... |
In JavaScript, you can do this:
var a = null;
var b = "I'm a value";
var c = null;
var result = a || b || c;
And 'result' will get the value of 'b' because JavaScript short-circuits the 'or' operator.
I want a one-line idiom to do this in ColdFusion and the best I can come up with is:
<cfif LEN(c) GT 0><cfset result=c... | In ColdFusion, you can create a more concise expression to achieve the same behavior as JavaScript's short-circuiting `||` operator by using the `ListFirst` function along with `ArrayAppend` or by using conditional expressions. Here are two one-liners that can help you achieve the desired functionality:
### Using an A... | 21,142 | [
{
"from": "human",
"value": "In JavaScript, you can do this:\nvar a = null;\nvar b = \"I'm a value\";\nvar c = null;\nvar result = a || b || c;\n\nAnd 'result' will get the value of 'b' because JavaScript short-circuits the 'or' operator.\nI want a one-line idiom to do this in ColdFusion and the best I can ... |
Basically, I'm trying to create an object of unique objects, a set. I had the brilliant idea of just using a JavaScript object with objects for the property names. Such as,
set[obj] = true;
This works, up to a point. It works great with string and numbers, but with other objects, they all seem to "hash" to the same va... | In JavaScript, when you use an object as a key in another object (like you're trying to do with `set[obj] = true;`), JavaScript will convert that object to a string. The default behavior for objects is that they convert to the string `"[object Object]"`, which is why all object keys are effectively the same, causing th... | 18,588 | [
{
"from": "human",
"value": "Basically, I'm trying to create an object of unique objects, a set. I had the brilliant idea of just using a JavaScript object with objects for the property names. Such as,\nset[obj] = true;\n\nThis works, up to a point. It works great with string and numbers, but with other obj... |
I'm attempting to use File.Move to move a file from one UNC location to another. This blows up if the UNC path for the destination happens to be the local machine (error: Access to the path is denied). Example File.Move(@"\\someServer\path\file.txt", @"\\blah2\somewhere\file.txt"). This assumes there's a network sha... | When you're using `File.Move` in C# to move a file from one UNC path to another, you may run into issues if the destination is a UNC path that points back to the local machine. This can happen due to permission issues, as the system may interpret it as trying to access the file locally when it’s actually on a network p... | 18,904 | [
{
"from": "human",
"value": "I'm attempting to use File.Move to move a file from one UNC location to another. This blows up if the UNC path for the destination happens to be the local machine (error: Access to the path is denied). Example File.Move(@\"\\\\someServer\\path\\file.txt\", @\"\\\\blah2\\somewh... |
My company has code that integrates with activedirectory/LDAP for centralized userid/password login. Currently, the configuration page can only show the LDAP server linked to the Exchange domain the current computer is on. I'd like to list all available LDAP servers, similar to when you go to Windows Explorer and vie... | To enumerate all available LDAP servers in a domain or across multiple domains, you typically have a few different approaches to consider. However, please note that there may not be a direct equivalent to "browsing" through LDAP servers like you would in Windows Explorer. Instead, you can utilize the following methods ... | 20,509 | [
{
"from": "human",
"value": "My company has code that integrates with activedirectory/LDAP for centralized userid/password login. Currently, the configuration page can only show the LDAP server linked to the Exchange domain the current computer is on. I'd like to list all available LDAP servers, similar t... |
I need to find occurrences of "(+)" in my sql scripts, (i.e., Oracle outer join expressions). Realizing that "+", "(", and ")" are all special regex characters, I tried:
grep "\(\+\)" *
Now this does return occurrences of "(+)", but other lines as well. (Seemingly anything with open and close parens on the same line.... | The behavior you're observing with the `+` character in `grep` comes down to how basic and extended regular expressions work, along with the way `grep` interprets its patterns.
### Explanation of Behavior:
1. **Basic vs Extended Regular Expressions**:
- In the context of `grep`, there are two modes of regular expr... | 17,235 | [
{
"from": "human",
"value": "I need to find occurrences of \"(+)\" in my sql scripts, (i.e., Oracle outer join expressions). Realizing that \"+\", \"(\", and \")\" are all special regex characters, I tried:\n\ngrep \"\\(\\+\\)\" *\n\nNow this does return occurrences of \"(+)\", but other lines as well. (See... |
I'm looking for suggestions on Flash realtime servers. Currently, we use a combination of Moock's Unity and Red5, but there are a couple problems. First, we are moving to AS3, and Unity only supports AS2. Secondly, Red5 is pretty flaky for us, we'd prefer something more stable. We can't use the official Flash Media Ser... | It sounds like you're exploring some solid options for a Flash real-time server, and you have specific requirements that are quite common in real-time applications. Below, I'll provide some insights on ElectroServer and Wowza, as well as additional alternatives you might consider:
### ElectroServer
- **Pros:**
- Ele... | 18,663 | [
{
"from": "human",
"value": "I'm looking for suggestions on Flash realtime servers. Currently, we use a combination of Moock's Unity and Red5, but there are a couple problems. First, we are moving to AS3, and Unity only supports AS2. Secondly, Red5 is pretty flaky for us, we'd prefer something more stable. ... |
Since multiple inheritance is bad (it makes the source more complicated) C# does not provide such a pattern directly. But sometimes it would be helpful to have this ability.
For instance I'm able to implement the missing multiple inheritance pattern using interfaces and three classes like that:
public interface IFirst ... | In C#, multiple inheritance is not supported for classes, and while you can achieve some aspects of it using interfaces, it does come with the downside of needing to implement every method in the interface.
However, there are a few patterns and strategies you can adopt to make your code cleaner and reduce the overhead... | 17,580 | [
{
"from": "human",
"value": "Since multiple inheritance is bad (it makes the source more complicated) C# does not provide such a pattern directly. But sometimes it would be helpful to have this ability.\nFor instance I'm able to implement the missing multiple inheritance pattern using interfaces and three c... |
I have DocumentRoot /var/www/test in my .htaccess file. This is causing the apache server to give me a 500 internal server error.
The error log file shows:
alert] [client 127.0.0.1] /var/www/.htaccess: DocumentRoot not allowed here
AllowOveride All is set in my conf file.
Any idea why this is happening?
| The `DocumentRoot` directive is not allowed in the `.htaccess` file. The `DocumentRoot` setting specifies the directory that Apache serves files from, and it should only be defined in the main server configuration files (such as `httpd.conf` or the site-specific configuration files in `sites-available` or `sites-enable... | 20,323 | [
{
"from": "human",
"value": "I have DocumentRoot /var/www/test in my .htaccess file. This is causing the apache server to give me a 500 internal server error.\nThe error log file shows:\nalert] [client 127.0.0.1] /var/www/.htaccess: DocumentRoot not allowed here\nAllowOveride All is set in my conf file.... |
I'm just getting started with Custom User Controls in C# and I'm wondering if there are any examples out there of how to write one which accepts nested tags?
For example, when you create an asp:repeater you can add a nested tag for itemtemplate.
| Creating a custom user control in ASP.NET that accepts nested tags involves creating a custom control that can interpret and handle nested controls or tags. Below, I'll provide you with a simple example of how to create a custom user control that accepts nested tags similar to how `asp:Repeater` works with `ItemTemplat... | 17,774 | [
{
"from": "human",
"value": "I'm just getting started with Custom User Controls in C# and I'm wondering if there are any examples out there of how to write one which accepts nested tags?\nFor example, when you create an asp:repeater you can add a nested tag for itemtemplate.\n"
},
{
"from": "gpt",
... |
I'm trying to think of clever, clear, and simple ways to write code that describes the sequence of integers in a given range.
Here's an example:
IEnumerable<int> EnumerateIntegerRange(int from, int to)
{
for (int i = from; i <= to; i++)
{
yield return i;
}
}
| Your implementation of `EnumerateIntegerRange` using `yield return` is a great example of how to create an enumerable sequence of integers within a specified range. If you want to explore other clever, clear, and simple ways to achieve similar functionality, here are a few alternatives:
### 1. Using `Enumerable.Range`... | 18,163 | [
{
"from": "human",
"value": "I'm trying to think of clever, clear, and simple ways to write code that describes the sequence of integers in a given range. \nHere's an example:\nIEnumerable<int> EnumerateIntegerRange(int from, int to)\n{\n for (int i = from; i <= to; i++)\n {\n yield return i;\... |
I've seen N/A (always caps) used most often but I don't know if there is a standard. My data will be seen on Google so I would like to use the most recognized value.
| The abbreviation "N/A" stands for "Not Applicable" and is indeed commonly used in various contexts to indicate that a particular value or piece of information does not apply to the situation at hand. In terms of standardization, "N/A" (in all caps) is the most widely recognized and accepted form, especially in formal w... | 24,175 | [
{
"from": "human",
"value": "I've seen N/A (always caps) used most often but I don't know if there is a standard. My data will be seen on Google so I would like to use the most recognized value.\n"
},
{
"from": "gpt",
"value": "The abbreviation \"N/A\" stands for \"Not Applicable\" and is indee... |
A question about different methods of outputting html from PHP; what are the performance differences between these:
Method 1 - variable concatenation
$html = '';
$html .= '<ul>';
for ($k = 1; $k < = 1000; $k++){
$html .= '<li> This is list item #'.$k.'</li>';
}
$html .= '</ul>';
echo $html;
Method 2 - output buffe... | When comparing the two methods you've outlined for generating HTML in PHP—variable concatenation and output buffering—there are indeed performance differences to consider. Let's break down each method:
### Method 1: Variable Concatenation
```php
$html = '';
$html .= '<ul>';
for ($k = 1; $k <= 1000; $k++){
$html .... | 18,965 | [
{
"from": "human",
"value": "A question about different methods of outputting html from PHP; what are the performance differences between these:\nMethod 1 - variable concatenation\n$html = '';\n$html .= '<ul>';\nfor ($k = 1; $k < = 1000; $k++){\n $html .= '<li> This is list item #'.$k.'</li>';\n}\n$html ... |
Eclipse 3.4[.x] - also known as Ganymede - comes with this new mechanism of provisioning called p2.
"Provisioning" is the process allowing to discover and update on demand some parts of an application, as explained in general in this article on the Sun Web site.
Eclipse has an extended wiki section in which p2 details... | To set up a local update site for Eclipse using the p2 provisioning mechanism, you will need to replicate the necessary files and structure from the remote update site to your local directory. This involves several steps, which I'll outline below:
### Step 1: Retrieve Components from the Remote Update Site
1. **Ident... | 17,403 | [
{
"from": "human",
"value": "Eclipse 3.4[.x] - also known as Ganymede - comes with this new mechanism of provisioning called p2.\n\"Provisioning\" is the process allowing to discover and update on demand some parts of an application, as explained in general in this article on the Sun Web site.\nEclipse has ... |
Is there a benefit to using one over the other? In Python 2, they both seem to return the same results:
>>> 6/3
2
>>> 6//3
2
| In Python 2, both the `/` operator (regular division) and the `//` operator (floor division) indeed behave similarly when both operands are integers, as you've shown in your examples. However, the way they handle different types of operands can differ:
1. **Regular Division `/`**:
- In Python 2, if both operands ar... | 19,580 | [
{
"from": "human",
"value": "Is there a benefit to using one over the other? In Python 2, they both seem to return the same results:\n>>> 6/3\n2\n>>> 6//3\n2\n\n"
},
{
"from": "gpt",
"value": "In Python 2, both the `/` operator (regular division) and the `//` operator (floor division) indeed beh... |
I've used ZenTest and autotest to work on Ruby projects before, and I used to using them for test-driven development a la this configuration. I have a project that I'm currently working on in Java, and I was wondering if there is something similar in the Java world to achieve the same effect.
| Yes, there are several tools and libraries in the Java ecosystem that can provide a similar experience to what you've used with ZenTest and autotest for Ruby projects, particularly for Test-Driven Development (TDD). Here are some popular options:
1. **JUnit**: This is the most widely used testing framework for Java. I... | 19,289 | [
{
"from": "human",
"value": "I've used ZenTest and autotest to work on Ruby projects before, and I used to using them for test-driven development a la this configuration. I have a project that I'm currently working on in Java, and I was wondering if there is something similar in the Java world to achieve th... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.