instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
How do you globally set the date format in ASP.NET?
My local machine and servers have Regional Settings set to "English (New Zealand)".
When I format a date with dd/MM/yyyy I expect to see 19/11/2008 for today for example.
Until recently, that is what I did in fact get from both my local machine and the servers.
Just r... | In ASP.NET, controlling the date format globally can be a bit tricky due to differences in culture settings across machines. However, you can enforce a specific date format in your application by modifying your `Global.asax` file, or by setting culture-specific options in your web application's configuration.
Here are... | 36,004 | [
{
"from": "human",
"value": "How do you globally set the date format in ASP.NET?\nMy local machine and servers have Regional Settings set to \"English (New Zealand)\".\nWhen I format a date with dd/MM/yyyy I expect to see 19/11/2008 for today for example.\nUntil recently, that is what I did in fact get from... |
I need to parse .c/.h files for the data declaration and extract the type declarations. For example, I might need to extract the variable declaration and it corresponding data type that might look like:
typedef union
{
struct
{
unsigned char OG15 : 1,
...
OG0 : 1;
}... | To parse C and C header files to extract type declarations and variable declarations in C#, you can follow these steps:
### 1. Data Structure for Storing Type Information
A good way to store the data type information is to create a class that can hold both the type and the variable name. You may also want to create a... | 34,771 | [
{
"from": "human",
"value": "I need to parse .c/.h files for the data declaration and extract the type declarations. For example, I might need to extract the variable declaration and it corresponding data type that might look like:\ntypedef union \n{\n struct\n {\n unsigned char OG15 : 1,\n ... |
We're all familiar with the horror that is C# event declaration. To ensure thread-safety, the standard is to write something like this:
public event EventHandler SomethingHappened;
protected virtual void OnSomethingHappened(EventArgs e)
{
var handler = SomethingHappened;
if (handler != null)
... | Using extension methods to raise events can make your code cleaner and easier to read, but there are some considerations and potential downsides to this approach. Let's break down the pros and cons, along with any missing aspects compared to the standard pattern.
### Pros
1. **Code Simplification**: The event raising ... | 35,897 | [
{
"from": "human",
"value": "We're all familiar with the horror that is C# event declaration. To ensure thread-safety, the standard is to write something like this:\npublic event EventHandler SomethingHappened;\nprotected virtual void OnSomethingHappened(EventArgs e)\n{ \n var handler = Somet... |
What is the best way to abstract the episerver infrastructure for easier testing?
| Abstracting the Episerver (now known as Optimizely) infrastructure for easier testing is an important aspect of developing applications that use this CMS platform. The goal of abstraction is to create a layer that decouples your business logic from the underlying Episerver infrastructure, allowing for easier unit testi... | 35,701 | [
{
"from": "human",
"value": "What is the best way to abstract the episerver infrastructure for easier testing?\n"
},
{
"from": "gpt",
"value": "Abstracting the Episerver (now known as Optimizely) infrastructure for easier testing is an important aspect of developing applications that use this CM... |
I'm writing a data structure in C# (a priority queue using a fibonacci heap) and I'm trying to use it as a learning experience for TDD which I'm quite new to.
I understand that each test should only test one piece of the class so that a failure in one unit doesn't confuse me with multiple test failures, but I'm not s... | It's great that you're diving into Test-Driven Development (TDD) with a Fibonacci heap implementation! Your understanding of testing principles is solid, and you've raised an important point about testing the behavior of your data structure while managing interdependencies between methods.
### Isolating Tests in TDD
... | 32,017 | [
{
"from": "human",
"value": "I'm writing a data structure in C# (a priority queue using a fibonacci heap) and I'm trying to use it as a learning experience for TDD which I'm quite new to. \nI understand that each test should only test one piece of the class so that a failure in one unit doesn't confuse me ... |
I try to write a simple client/server application (all application is a bluetooth service and client). The client code find the bluetooth devices and register in to the local db. But when the inquiry running, it's not discoverable. (The server code run on another thread). I the emulator it's work (the scan time is 0), ... | The issue you're facing with Bluetooth scanning on real devices often relates to how Bluetooth discovery and connection work on Android, especially in terms of discoverability and the time it takes for devices to scan for other Bluetooth devices. Here are some insights and potential solutions you can try:
### 1. Bluet... | 34,456 | [
{
"from": "human",
"value": "I try to write a simple client/server application (all application is a bluetooth service and client). The client code find the bluetooth devices and register in to the local db. But when the inquiry running, it's not discoverable. (The server code run on another thread). I the ... |
I want to use the new report builder 2.0, rather than the old VS2005 integrated report builder for the new features and ease of use, but source control integration is a must.
I don't see any ability to use TFS natively, and I have installed the TFS MSSCCI Provider, all with no love.
Does anyone know how to get them to ... | Integrating SQL Server Reporting Services (SSRS) reports with source control can be a challenge, especially when using tools like Report Builder 2.0 that do not natively support source control systems like TFS (Team Foundation Server). Here are some approaches and best practices that might help you effectively manage v... | 35,214 | [
{
"from": "human",
"value": "I want to use the new report builder 2.0, rather than the old VS2005 integrated report builder for the new features and ease of use, but source control integration is a must.\nI don't see any ability to use TFS natively, and I have installed the TFS MSSCCI Provider, all with no ... |
I am setting-up my DataGridView like this:
jobs = new List<DisplayJob>();
uxJobList.AutoGenerateColumns = false;
jobListBindingSource.DataSource = jobs;
uxJobList.DataSource = jobListBindingSource;
int newColumn;
newColumn = uxJobList.Columns.Add("Id", "Job No.");
... | The issue with sorting in a `DataGridView` often arises from the way the data source is structured. In your case, the `DisplayJob` class properties are marked as `private set`, which means they cannot be modified after the object is constructed. This can interfere with the binding and the sorting capabilities of the `D... | 35,440 | [
{
"from": "human",
"value": "I am setting-up my DataGridView like this:\n jobs = new List<DisplayJob>();\n\n uxJobList.AutoGenerateColumns = false;\n jobListBindingSource.DataSource = jobs;\n uxJobList.DataSource = jobListBindingSource;\n\n int newColumn;\n newColum... |
Title says what i'm trying to do. I can successfully generate an assembly if i don't specify the LinqOverTypedDatasets option, but i want my typed DataSet to support queries with LINQ.
My code outputs the error:
error CS0006: Metadata file 'System.Data.DataSetExtensions.dll' could not be found
The code:
//System.Data.... | It looks like you've resolved a part of your issue, but you're running into difficulties with the `System.Data.DataSetExtensions.dll` reference. Here's some additional information that could help clarify the situation:
### 1. **Location of `System.Data.DataSetExtensions.dll`:**
The `System.Data.DataSetExtensions.dl... | 36,157 | [
{
"from": "human",
"value": "Title says what i'm trying to do. I can successfully generate an assembly if i don't specify the LinqOverTypedDatasets option, but i want my typed DataSet to support queries with LINQ.\nMy code outputs the error:\nerror CS0006: Metadata file 'System.Data.DataSetExtensions.dll' ... |
I'd like to include custom .Net controls and .Net forms within MS Access.
It's possible but I was wondering if there was any new good articles on that subject.
Over time I've found a few related to the subject the but always found the process a bit cumbersome (see references below).
One of the issue is deployment:
my u... | Integrating .NET controls and forms within Microsoft Access can indeed be a cumbersome process, especially concerning deployment and user permissions. Here’s an overview of some approaches, considerations, and resources that might help streamline your development and deployment process.
### 1. **Using the Interop Form... | 35,559 | [
{
"from": "human",
"value": "I'd like to include custom .Net controls and .Net forms within MS Access.\nIt's possible but I was wondering if there was any new good articles on that subject.\nOver time I've found a few related to the subject the but always found the process a bit cumbersome (see references b... |
How to interact with embedded PDF documents in iframes through JavaScript?
Is it possible?
Is it possible in every main browsers?
if "yes", how can I...
...know that the document finished loading?
...trigger the print dialog?
...configure the zooming?
...configure the toolbars?
| Interacting with embedded PDF documents in iframes through JavaScript is somewhat limited due to the nature of how browsers handle PDF files. Most browsers have built-in PDF viewers that can display PDF content in an iframe, but they do not expose a comprehensive API for interacting with these documents. Below, I addre... | 32,050 | [
{
"from": "human",
"value": "How to interact with embedded PDF documents in iframes through JavaScript?\n\nIs it possible?\nIs it possible in every main browsers?\n\nif \"yes\", how can I...\n\n...know that the document finished loading?\n...trigger the print dialog?\n...configure the zooming?\n...configure... |
I have a ASP.NET/VB that had a GridView to display a list of users from the Users table.
I changed the primary key column name in the database from PKID to UserID and updated all the old references to PKID in the declarations and code behind. I also deleted the WebsiteCache folder which held the visual studio cache of ... | When you rename a column in your database and update your ASP.NET application accordingly, there are several steps and potential caching issues that could prevent the application from recognizing the new column name. Here are some steps to troubleshoot and resolve the issue you are experiencing:
1. **Check SQL DataSou... | 25,779 | [
{
"from": "human",
"value": "I have a ASP.NET/VB that had a GridView to display a list of users from the Users table.\nI changed the primary key column name in the database from PKID to UserID and updated all the old references to PKID in the declarations and code behind. I also deleted the WebsiteCache fol... |
I'm developing a client/server application in .Net 3.5 using WCF. Basically, a long running client service (on several machines) establish a duplex connection to the server over a netTcpBinding. The server then uses the callback contract of the client to perform certain on-demand oparations, to which the client respond... | Handling faulted duplex channels in WCF can be tricky since the connection involves both client and server callbacks. Here are some strategies to effectively manage faulted duplex channels and reconnect when necessary:
### 1. Handling Faults on the Client Side
On the client side, you can subscribe to the `ICommunicat... | 31,926 | [
{
"from": "human",
"value": "I'm developing a client/server application in .Net 3.5 using WCF. Basically, a long running client service (on several machines) establish a duplex connection to the server over a netTcpBinding. The server then uses the callback contract of the client to perform certain on-deman... |
I have a Windows GUI application that's using the Qt framework (currently version 3.3.5, might change to Qt4).
I want to combine other Windows GUI applications in the main application. I can't use the widgets directly in the main application due to several constrains which I can't control. The final layout should look ... | Integrating multiple GUI applications into a main application can be challenging, especially when dealing with constraints such as using different technologies or frameworks. Your current approach, where you host other applications as child windows and manage their HWNDs, is a valid solution, but there are indeed other... | 35,566 | [
{
"from": "human",
"value": "I have a Windows GUI application that's using the Qt framework (currently version 3.3.5, might change to Qt4).\nI want to combine other Windows GUI applications in the main application. I can't use the widgets directly in the main application due to several constrains which I ca... |
I have two lists of custom objects and want to update a field for all objects in one list if there is an object in the other list which matches on another pair of fields.
This code explains the problem better and produces the results I want. However for larger lists 20k, and a 20k list with matching objects, this takes... | Yes, you can significantly optimize the performance of your operation by using a dictionary to store the adjustment values. This approach eliminates the need for repeated searches through the adjustment list, resulting in a much faster solution. Here’s how you can implement it:
1. Create a dictionary from the `adjList... | 33,254 | [
{
"from": "human",
"value": "I have two lists of custom objects and want to update a field for all objects in one list if there is an object in the other list which matches on another pair of fields.\nThis code explains the problem better and produces the results I want. However for larger lists 20k, and a ... |
I'd like to hear what is the motivation behind the bulk of sealed classes in the .Net framework. What is the benefit of sealing a class? I cannot fathom how not allowing inheritance can be useful and most likely not the only one fighting these classes.
So, why is the framework designed this way and wouldn't it be unbre... | Sealed classes in .NET, as in other object-oriented programming languages, are designed with specific purposes and benefits in mind. Understanding the motivation behind sealing classes can help clarify why certain classes in the .NET framework are defined this way and how it can be advantageous.
### Motivation Behind ... | 33,700 | [
{
"from": "human",
"value": "I'd like to hear what is the motivation behind the bulk of sealed classes in the .Net framework. What is the benefit of sealing a class? I cannot fathom how not allowing inheritance can be useful and most likely not the only one fighting these classes.\nSo, why is the framework ... |
I have an aspx page,where the user will enter a valid image url(ex : https://stackoverflow.com/Content/Img/stackoverflow-logo-250.png).
I need the program to upload this image to the Server.
How can i do this ?
| To upload an image from a given URL to your server using an ASP.NET Web Forms application, you can follow these steps:
1. **Create an ASPX Page**: Create an ASPX page with a TextBox for the URL input and a Button to trigger the upload process.
2. **Write Code in the Code-Behind**: Use `WebClient` to download the imag... | 35,253 | [
{
"from": "human",
"value": "I have an aspx page,where the user will enter a valid image url(ex : https://stackoverflow.com/Content/Img/stackoverflow-logo-250.png).\nI need the program to upload this image to the Server.\nHow can i do this ? \n"
},
{
"from": "gpt",
"value": "To upload an image... |
SQL databases seem to be the cornerstone of most software. However, it seems optimized for textual data. In fact when doing any queries involving numerical data, integers specifically, it seems inefficient that the numbers are getting converted to text and then back to native formats both ways between the application a... | You've raised an important topic regarding the handling of data types, especially numerical data and binary large objects (BLOBs), when working with SQL databases. The inefficiencies you've noted in type conversion can impact performance, especially with large datasets or complex queries. However, there are ways to min... | 32,428 | [
{
"from": "human",
"value": "SQL databases seem to be the cornerstone of most software. However, it seems optimized for textual data. In fact when doing any queries involving numerical data, integers specifically, it seems inefficient that the numbers are getting converted to text and then back to native fo... |
I wonder if it is possible to create an executable module from a Python script. I need to have the most performance and the flexibility of Python script, without needing to run in the Python environment. I would use this code to load on demand user modules to customize my application.
| Yes, it is indeed possible to create an executable module from a Python script while retaining performance and flexibility. There are several ways to achieve this, depending on your requirements and use case. Here are some options:
### 1. **Compiling to C with Cython**
Cython is a programming language that makes writi... | 34,637 | [
{
"from": "human",
"value": "I wonder if it is possible to create an executable module from a Python script. I need to have the most performance and the flexibility of Python script, without needing to run in the Python environment. I would use this code to load on demand user modules to customize my applic... |
What I would like to do is the following. I have a single table, Products, containing a private key ProductID. Instead of having SQL Server auto-increment ProductID on inserts, I want to increment it in the DataContext partial method "InsertProduct":
Partial Public Class MyDataContext
Private Sub InsertProduct(ByV... | Yes, the issue you're experiencing is due to the way you're retrieving the maximum `ProductID` in your `InsertProduct` method. When you call `Me.Products.Max(...)`, it calculates the maximum `ProductID` based on the current in-memory collection of products. If the `context.Products` list has not yet been refreshed afte... | 35,581 | [
{
"from": "human",
"value": "What I would like to do is the following. I have a single table, Products, containing a private key ProductID. Instead of having SQL Server auto-increment ProductID on inserts, I want to increment it in the DataContext partial method \"InsertProduct\":\nPartial Public Class MyDa... |
I'm pivoting data in MS SQL stored procedure. Columns which are pivoted are dynamically created using stored procedure parameter (for exampe: "location1,location2,location3,") so number of columns which will be generated is not known. Output should look like (where locations are taken from stored procedure parameter):
... | When you create a stored procedure in SQL Server that generates a pivot table dynamically, as you are doing with `proc_StatsDay`, it can be challenging to integrate that stored procedure with LINQ to SQL because the result set is not fixed. LINQ to SQL expects a specific return type that can be mapped to a data model, ... | 32,980 | [
{
"from": "human",
"value": "I'm pivoting data in MS SQL stored procedure. Columns which are pivoted are dynamically created using stored procedure parameter (for exampe: \"location1,location2,location3,\") so number of columns which will be generated is not known. Output should look like (where locations a... |
Is there a way to query the current DATEFORMAT SQLServer 2005 is currently using with T-SQL?
I have an application that reads pregenerated INSERT-statements and executes them against a database. To make the data to be inserted culture independent I store datetime-values represented in the invariant culture (month/day/y... | In SQL Server, you cannot directly query the current `DATEFORMAT` setting using a built-in function or system view. However, you can use a workaround by executing a simple query that attempts to retrieve the current date format indirectly through the `@@DATEFIRST` function.
Here's how you can do it:
1. **Check Curre... | 37,372 | [
{
"from": "human",
"value": "Is there a way to query the current DATEFORMAT SQLServer 2005 is currently using with T-SQL?\nI have an application that reads pregenerated INSERT-statements and executes them against a database. To make the data to be inserted culture independent I store datetime-values represe... |
In a Flex / Java app stack using remoting (via BlazeDS), classes to hold data passed back and forth between client and server need to be maintained in both the client (in ActionScript) and server (in Java).
I want a way to maintain theses classes in Java only, and have the corresponding ActionScript value object classe... | To maintain data classes in Java and automatically generate the corresponding ActionScript value object classes for a Flex/Java application stack using BlazeDS, you can follow these steps:
### Step 1: Use a Code Generation Tool
You can use a code generation tool like **Apache Flex** with a Maven plugin or a custom sc... | 32,668 | [
{
"from": "human",
"value": "In a Flex / Java app stack using remoting (via BlazeDS), classes to hold data passed back and forth between client and server need to be maintained in both the client (in ActionScript) and server (in Java).\nI want a way to maintain theses classes in Java only, and have the corr... |
I have a single templated column in a DataGrid, in an ASP.NET 2 web sites. The DataGrid is paged, with ten rows per page.
In Firefox, all is good, as nearly always, but when I view the site trough IE, I get the following exception:
Invalid postback or callback argument. Event validation is enabled using in config... | The error message you're encountering, "Invalid postback or callback argument," typically indicates that ASP.NET is not able to validate the data sent back during a postback operation. This is often related to the `EnableEventValidation` setting, which is used to ensure that the data submitted during a postback is vali... | 31,727 | [
{
"from": "human",
"value": "I have a single templated column in a DataGrid, in an ASP.NET 2 web sites. The DataGrid is paged, with ten rows per page. \nIn Firefox, all is good, as nearly always, but when I view the site trough IE, I get the following exception:\n\nInvalid postback or callback argument. ... |
How can I dynamically invoke a class method in PHP? The class method is not static. It appears that
call_user_func(...)
only works with static functions?
Thanks.
| In PHP, you can dynamically invoke a non-static method of a class by using the `call_user_func()` function, but you need to pass an instance of the class along with the method name. Here’s how you can do that:
### Using `call_user_func`
1. **Create an instance of the class**.
2. **Use `call_user_func()` to call the i... | 37,198 | [
{
"from": "human",
"value": "How can I dynamically invoke a class method in PHP? The class method is not static. It appears that \ncall_user_func(...)\n\nonly works with static functions?\nThanks.\n"
},
{
"from": "gpt",
"value": "In PHP, you can dynamically invoke a non-static method of a class ... |
I'm working on a Linux machine through SSH (Putty). I need to leave a process running during the night, so I thought I could do that by starting the process in background (with an ampersand at the end of the command) and redirecting stdout to a file.
To my surprise, that doesn't work. As soon as I close the Putty windo... | When you start a process in the background using an ampersand (`&`), it will still be tied to the terminal session. If you close your SSH session (like closing your Putty window), it sends a hangup signal (SIGHUP) to all child processes, causing them to terminate.
To prevent this from happening, you can use one of th... | 33,867 | [
{
"from": "human",
"value": "I'm working on a Linux machine through SSH (Putty). I need to leave a process running during the night, so I thought I could do that by starting the process in background (with an ampersand at the end of the command) and redirecting stdout to a file.\nTo my surprise, that doesn'... |
How do I get the HTTP status code (eg 200 or 500) after calling curl_easy_perform?
| To retrieve the HTTP status code after performing a request with `curl_easy_perform`, you can use the `curl_easy_getinfo` function with the `CURLINFO_RESPONSE_CODE` option. Here is a step-by-step example in C:
1. Set up your curl handle with `curl_easy_init`.
2. Set your options (such as the URL).
3. Call `curl_easy_p... | 35,247 | [
{
"from": "human",
"value": "How do I get the HTTP status code (eg 200 or 500) after calling curl_easy_perform? \n"
},
{
"from": "gpt",
"value": "To retrieve the HTTP status code after performing a request with `curl_easy_perform`, you can use the `curl_easy_getinfo` function with the `CURLINFO... |
Consider the following two alternatives:
console.log("double");
console.log('single');
The former uses double quotes around the string, whereas the latter uses single quotes around the string.
I see more and more JavaScript libraries out there using single quotes when handling strings.
Are these two usages interchang... | Yes, in JavaScript, both single quotes (`'`) and double quotes (`"`) can be used interchangeably to define string literals. There is no functional difference between the two in terms of how they behave or how the JavaScript engine interprets them. You can use either style depending on your preference or the coding stan... | 36,498 | [
{
"from": "human",
"value": "Consider the following two alternatives:\n\nconsole.log(\"double\");\nconsole.log('single');\n\nThe former uses double quotes around the string, whereas the latter uses single quotes around the string.\nI see more and more JavaScript libraries out there using single quotes when ... |
I would like to start a small part time business other than my full time programming job. Have you guys done that before? I know programmers who teach in evening schools after work. But then again, that is not business. What would you recommend to get another income stream going?
| Starting a small part-time business alongside your full-time programming job can be a great way to diversify your income streams. Here are several ideas that might resonate with your skills and interests:
1. **Freelance Programming**: Offer your programming skills on a freelance basis. Platforms like Upwork, Fiverr, a... | 36,165 | [
{
"from": "human",
"value": "I would like to start a small part time business other than my full time programming job. Have you guys done that before? I know programmers who teach in evening schools after work. But then again, that is not business. What would you recommend to get another income stream going... |
What is the best way to encode URL strings such that they are rfc2396 compliant and to decode a rfc2396 compliant string such that for example %20 is replaced with a space character?
edit:
URLEncoder and URLDecoder classes do not encode/decode rfc2396 compliant URLs, they encode to a MIME type of application/x-www-form... | RFC 2396 has been superseded by RFC 3986, which provides the guidelines for the syntax of URIs. When working with URLs, it’s important to use the proper encoding and decoding methods that adhere to these standards.
### Encoding URLs
To encode a URL so that it is RFC 3986 compliant, you should convert reserved charact... | 36,216 | [
{
"from": "human",
"value": "What is the best way to encode URL strings such that they are rfc2396 compliant and to decode a rfc2396 compliant string such that for example %20 is replaced with a space character?\nedit:\nURLEncoder and URLDecoder classes do not encode/decode rfc2396 compliant URLs, they enco... |
I installed SQL Server 2005 sometime ago and forgot the administrator password I set during setup. How can I connect to SQL server now?
EDIT: I think I only allowed Sql Server Authentication. Login with integrated security also does not work.
| If you have forgotten the SQL Server administrator password and you are using SQL Server Authentication only, you can regain access to your SQL Server instance by following these steps:
### Method 1: Using SQL Server in Single-User Mode
1. **Stop SQL Server Service**:
- Open the SQL Server Configuration Manager.
... | 33,127 | [
{
"from": "human",
"value": "I installed SQL Server 2005 sometime ago and forgot the administrator password I set during setup. How can I connect to SQL server now?\nEDIT: I think I only allowed Sql Server Authentication. Login with integrated security also does not work.\n"
},
{
"from": "gpt",
... |
Every night I need to trim back a table to only contain the latest 20,000 records. I could use a subquery:
delete from table WHERE id NOT IN (select TOP 20000 ID from table ORDER BY date_added DESC)
But that seems inefficient, especially if we later decide to keep 50,000 records. I'm using SQL 2005, and thought I co... | You're correct in considering that using a subquery can be inefficient for this operation, especially as your data grows. The `ROW_NUMBER()` function can indeed be used for this purpose, and it can help you achieve the result in a more efficient manner.
In SQL Server 2005, you can use a Common Table Expression (CTE) a... | 37,875 | [
{
"from": "human",
"value": "Every night I need to trim back a table to only contain the latest 20,000 records. I could use a subquery:\ndelete from table WHERE id NOT IN (select TOP 20000 ID from table ORDER BY date_added DESC)\n\nBut that seems inefficient, especially if we later decide to keep 50,000 re... |
Java is the key here. I need to be able to delete files but users expect to be able to "undelete" from the recycle bin. As far as I can tell this isn't possible. Anyone know otherwise?
| In Java, there is no built-in functionality to directly interact with the operating system's Recycle Bin or Trash for file deletion and restoration. When you delete a file using Java's standard file handling mechanisms (like `File.delete()`), it permanently removes the file from the file system, bypassing the Recycle B... | 34,352 | [
{
"from": "human",
"value": "Java is the key here. I need to be able to delete files but users expect to be able to \"undelete\" from the recycle bin. As far as I can tell this isn't possible. Anyone know otherwise?\n"
},
{
"from": "gpt",
"value": "In Java, there is no built-in functionality t... |
Links to point me in the correct direction, or sample code will be appreciated.
| Of course! To better assist you, could you please specify what topic or programming language you're interested in? Here are a few areas where I can provide resources or sample code:
1. **Web Development** (HTML, CSS, JavaScript, React, etc.)
2. **Mobile Development** (iOS, Android, Flutter)
3. **Backend Development** ... | 39,372 | [
{
"from": "human",
"value": "Links to point me in the correct direction, or sample code will be appreciated.\n"
},
{
"from": "gpt",
"value": "Of course! To better assist you, could you please specify what topic or programming language you're interested in? Here are a few areas where I can provid... |
On IIS 6, is it possible to have multiple domain names pointing to the same web application, and conditionally serve CSS from within the web application based on the domain name?
I need to host hundreds of different "skins" on the same web application, with the skin being dependent upon the domain name, and I really do... | Yes, it is possible to have multiple domain names pointing to the same web application on IIS 6 and conditionally serve different CSS (or other resources) based on the domain name. Here's a general approach to accomplish this:
### Setting Up Multiple Domains
1. **DNS Configuration**: Make sure that all your domain na... | 36,841 | [
{
"from": "human",
"value": "On IIS 6, is it possible to have multiple domain names pointing to the same web application, and conditionally serve CSS from within the web application based on the domain name?\nI need to host hundreds of different \"skins\" on the same web application, with the skin being dep... |
Given a couple of simple tables like so:
create table R(foo text);
create table S(bar text);
If I were to union them together in a query, what do I call the column?
select T.????
from (
select foo
from R
union
select bar
from S) as T;
Now, in mysql, I can apparently refer to the column of T as 'fo... | In SQL, when you perform a `UNION` operation, the resulting column names are generally taken from the first query in the union. This means that in your case, the column in the result set of `T` will be named after the first column in the first query, which is `foo`.
Here's how your query looks:
```sql
SELECT T.foo
F... | 38,136 | [
{
"from": "human",
"value": "Given a couple of simple tables like so:\ncreate table R(foo text);\ncreate table S(bar text);\n\nIf I were to union them together in a query, what do I call the column?\nselect T.????\nfrom (\n select foo\n from R\n union\n select bar\n from S) as T;\n\nNow, in m... |
If I am evaluating two variables and not two method calls does it matter weather I use "&&" or "&"
//some logic that sets bool values
boolean X = true;
boolean Y = true;
if (X & Y){
// perform some operation
}
if (X && Y){
// perform some operation
}
Further a book I am using for C# 3.0 / .NET 3.5 only makes ... | In C#, the `&&` (logical AND) and `&` (bitwise AND) operators have different behaviors, especially when used with boolean values. Here’s a breakdown:
1. **Short-circuiting**:
- The `&&` operator is a **short-circuit** logical AND. This means that if the first operand (`X`) evaluates to `false`, the second operand (... | 34,979 | [
{
"from": "human",
"value": "If I am evaluating two variables and not two method calls does it matter weather I use \"&&\" or \"&\"\n//some logic that sets bool values\n\nboolean X = true;\nboolean Y = true;\n\nif (X & Y){\n // perform some operation\n}\n\nif (X && Y){\n // perform some operation\n}\n\n... |
I'm creating a public internet facing website which contains the email address of their salespeople.
What kind of programming options do I have to generate the "mailto" and display the email from that address but limit the spambots from picking up the address?
| To help prevent spambots from harvesting email addresses on your public-facing website, you can use several programming techniques to obfuscate the email addresses while still allowing users to click on them to send an email. Here are some popular options:
### 1. **JavaScript Obfuscation**
Using JavaScript to construc... | 35,601 | [
{
"from": "human",
"value": "I'm creating a public internet facing website which contains the email address of their salespeople. \nWhat kind of programming options do I have to generate the \"mailto\" and display the email from that address but limit the spambots from picking up the address? \n"
},
... |
I'm trying to programmatically reject a call on a BlackBerry, with Java + JDE.
I'm intercepting the callIncoming event, and in there I need to do something to reject a call from a specific number.
Does anyone know how to do that?
| To programmatically reject a call on a BlackBerry device using Java and JDE, you will need to intercept the `callIncoming` event and utilize the appropriate API to reject the call. The BlackBerry API provides ways to handle incoming calls through the `CallListener` interface, but there are some limitations based on the... | 36,401 | [
{
"from": "human",
"value": "I'm trying to programmatically reject a call on a BlackBerry, with Java + JDE.\nI'm intercepting the callIncoming event, and in there I need to do something to reject a call from a specific number.\nDoes anyone know how to do that?\n"
},
{
"from": "gpt",
"value": "To... |
Last time I create WAS profile and WASService then I try to config and run many script for learn how to config WAS, Finally it crash so i use wasprofile delete this profile and forgot delete WASService.
Now I found IBM Webphere Application Server service display in services.msc list, so I tried to delete it with WASSer... | It sounds like you're dealing with a service that has been marked for deletion but is still showing up in the services list. This situation can happen if the service was in the process of being deleted when a new operation attempted to access it.
Here are some steps you can follow to resolve this issue:
1. **Reboot Y... | 36,393 | [
{
"from": "human",
"value": "Last time I create WAS profile and WASService then I try to config and run many script for learn how to config WAS, Finally it crash so i use wasprofile delete this profile and forgot delete WASService.\nNow I found IBM Webphere Application Server service display in services.msc... |
How can I make this java generic cast ?
public interface IField {
}
class Field implements IField { // package private class
}
public class Form {
private List<Field> fields;
public List<IField> getFields() {
return this.fields;
}
}
The return statement throws a compiler error (I know the reason - I... | In Java, you cannot directly assign a `List<Field>` to a `List<IField>` because of the way generics work; specifically, generics are invariant in Java. This means that `List<Field>` is not considered a subtype of `List<IField>`, even though `Field` is a subtype of `IField`.
To achieve the desired behavior without comp... | 36,681 | [
{
"from": "human",
"value": "How can I make this java generic cast ?\npublic interface IField {\n\n}\n\n\nclass Field implements IField { // package private class\n\n}\n\npublic class Form {\n private List<Field> fields;\n\n\n public List<IField> getFields() {\n return this.fields;\n\n }\n\n}\n\nThe r... |
I would like to begin developing for the Blackberry platform and, specifically, the Bold and also the Storm device which is coming out soon. Do I need to get into Java and J2ME or can I develop sites in ASP.NET and just keep utilizing the skills I already have?
I am completely new to mobile platform development and ... | To develop for the BlackBerry platform, especially for devices like the Bold and Storm, you'll need to consider a few different options based on the capabilities of those devices and your existing skills.
### Java and J2ME Development
1. **Java and J2ME**: The primary development framework for BlackBerry devices trad... | 34,877 | [
{
"from": "human",
"value": "I would like to begin developing for the Blackberry platform and, specifically, the Bold and also the Storm device which is coming out soon. Do I need to get into Java and J2ME or can I develop sites in ASP.NET and just keep utilizing the skills I already have? \nI am complete... |
Could point me to some good links, or share experiences of the differences / similarities between the JBI and SCA specifications?
Many thanks :-)
| The JBI (JavaBeans Interface) and SCA (Service Component Architecture) specifications are both significant in their respective domains of Java-based application development and service-oriented architecture. Here are some insights into their differences and similarities:
### Similarities:
1. **Component-Based Archite... | 34,095 | [
{
"from": "human",
"value": "Could point me to some good links, or share experiences of the differences / similarities between the JBI and SCA specifications?\nMany thanks :-)\n"
},
{
"from": "gpt",
"value": "The JBI (JavaBeans Interface) and SCA (Service Component Architecture) specifications a... |
I want to allow users to paste <embed> and <object> HTML fragments (video players) via an HTML form. The server-side code is PHP. How can I protect against malicious pasted code, JavaScript, etc? I could parse the pasted code, but I'm not sure I could account for all variations. Is there a better way?
| Allowing users to submit HTML fragments, especially those that could execute JavaScript or other harmful content, can be risky. When working with `<embed>` and `<object>` tags, you need to ensure that your application is secure and resilient against potential cross-site scripting (XSS) attacks.
Here are some strategie... | 33,644 | [
{
"from": "human",
"value": "I want to allow users to paste <embed> and <object> HTML fragments (video players) via an HTML form. The server-side code is PHP. How can I protect against malicious pasted code, JavaScript, etc? I could parse the pasted code, but I'm not sure I could account for all variations.... |
I'm writing a small page to show the employees in our company. I've written a query to pull the info from our database. Then I'm binding that to a GridView to do the dirty work. Here is the query.
"SELECT tblEmpID.empid AS [Empl ID], tblEmpID.posno AS [Pos #], [name] & ""<br />"" & [jcn] & ""("" & [jcc] & "")"" AS [... | It looks like you've found a solution to your problem by utilizing the `RowDataBound` event to decode the HTML entities in your GridView cells. This approach is effective because it allows you to manipulate the rendered output of each cell after the data has been bound but before it gets displayed on the page.
Howeve... | 35,270 | [
{
"from": "human",
"value": "I'm writing a small page to show the employees in our company. I've written a query to pull the info from our database. Then I'm binding that to a GridView to do the dirty work. Here is the query.\n\"SELECT tblEmpID.empid AS [Empl ID], tblEmpID.posno AS [Pos #], [name] & \"\"<br... |
I am mostly use to using Subversion for my source control. However, my current position has me using TFS. The UI of the TFS explorer and its integration with Visual Studio has me a little disoriented. I miss having tools like SmartSVN where I could see at a glance what I've modified and is pending checkin.
What tool se... | Transitioning from Subversion to TFS (Team Foundation Server, now known as Azure DevOps Server) can indeed be a bit disorienting, especially when you are accustomed to certain features and visualizations. Here are some recommendations for tools and approaches that can help improve your experience with TFS:
### 1. **Vi... | 33,896 | [
{
"from": "human",
"value": "I am mostly use to using Subversion for my source control. However, my current position has me using TFS. The UI of the TFS explorer and its integration with Visual Studio has me a little disoriented. I miss having tools like SmartSVN where I could see at a glance what I've modi... |
I have a web application that I'm writing (C#, MSSQL) and I need to store the timestamp when a record is stored in the system. Normally, I would just do this with SQL and the DATETIME function. However, the server is located in a different time zone than our company is located... AND we may change to another server i... | To effectively handle timestamps in a situation where your application and database may be in different time zones, the recommended approach is to use UTC (Coordinated Universal Time) for storing timestamps. This allows you to have a standard time representation regardless of the server's local time zone.
Here's a sim... | 34,936 | [
{
"from": "human",
"value": "I have a web application that I'm writing (C#, MSSQL) and I need to store the timestamp when a record is stored in the system. Normally, I would just do this with SQL and the DATETIME function. However, the server is located in a different time zone than our company is located... |
I have a solution containing several projects that have migrated from VS 2003, 2005, 2008. When compiling all the projects for the RELEASE configuration, VS 2008 creates PDB files for some projects, but not others. Why?
In the Build tab of the Properties page for each project, I can see they all have "Define DEBUG cons... | When working with Visual Studio projects that have been migrated from older versions like VS 2003, 2005, and 2008, it's important to consider several factors that could affect the generation of PDB (Program Database) files in the RELEASE configuration. Since you've mentioned that all projects are set to "Define DEBUG c... | 35,390 | [
{
"from": "human",
"value": "I have a solution containing several projects that have migrated from VS 2003, 2005, 2008. When compiling all the projects for the RELEASE configuration, VS 2008 creates PDB files for some projects, but not others. Why?\nIn the Build tab of the Properties page for each project, ... |
It's rare that I hear someone using Inversion of Control (Ioc) principle with .Net. I have some friends that work with Java that use a lot more Ioc with Spring and PicoContainer.
I understand the principle of removing dependencies from your code... but I have a doubt that it's so much better.
Why do .Net programmers no... | Inversion of Control (IoC) is a design principle that helps manage dependencies within an application, enabling more flexible and maintainable code. While it is a core principle used extensively in Java with frameworks like Spring, .NET also has robust support for IoC and Dependency Injection (DI) through various frame... | 34,408 | [
{
"from": "human",
"value": "It's rare that I hear someone using Inversion of Control (Ioc) principle with .Net. I have some friends that work with Java that use a lot more Ioc with Spring and PicoContainer.\nI understand the principle of removing dependencies from your code... but I have a doubt that it's ... |
I have an SSRS report where I need to collapse data into a summary column like so:
+Program
-Program2
Program2DataElement1 | Program2DataElement2 | etc.
How does one doe this? I see it in other reports, but can't for the life of me find the area to set it up. When I put in a group, I get something like this on all ... | To create a collapsible summary column in SQL Server Reporting Services (SSRS) reports, you can follow these general steps. It seems like you're trying to achieve a hierarchical grouping that allows for expanding and collapsing details under a summary header. Here’s how to do it:
### Step-by-Step Guide
1. **Create a ... | 33,615 | [
{
"from": "human",
"value": "I have an SSRS report where I need to collapse data into a summary column like so:\n+Program\n-Program2\n Program2DataElement1 | Program2DataElement2 | etc.\nHow does one doe this? I see it in other reports, but can't for the life of me find the area to set it up. When I put ... |
Recently I made a bunch of changes to my local svn config file. Mainly I corrected svn:mime-type properties of about 15 different file types. Now I need reset all previously checked in files according to this new configuration. SVN seems to trigger auto-prop only for ADDs and IMPORTs. So how do I do this without going ... | To update the `svn:mime-type` properties for multiple files in your repository according to your new configuration, you can use a combination of `svn propget` to retrieve the current properties and `svn propset` to set the new values.
Here's a step-by-step method to apply your changes without having to update each fil... | 35,560 | [
{
"from": "human",
"value": "Recently I made a bunch of changes to my local svn config file. Mainly I corrected svn:mime-type properties of about 15 different file types. Now I need reset all previously checked in files according to this new configuration. SVN seems to trigger auto-prop only for ADDs and IM... |
Has anyone seen this type of IE display problem?
Example http://xs133.xs.to/xs133/08465/ie_problem910.jpg.xs.jpg
Note that it is doing some sort of word-wrap/duplication when it renders.
The code for the brown box and the text that should be in it is:
<div class='span-23'>
<div class='span-7'>
<div class='i... | It sounds like you're experiencing an issue with Internet Explorer's rendering of the layout, particularly with word wrapping and duplication within your `info_box`. This kind of problem can often arise from a combination of CSS styles and how different browsers interpret those styles.
Here are a few potential solutio... | 34,681 | [
{
"from": "human",
"value": "Has anyone seen this type of IE display problem?\nExample http://xs133.xs.to/xs133/08465/ie_problem910.jpg.xs.jpg\nNote that it is doing some sort of word-wrap/duplication when it renders.\nThe code for the brown box and the text that should be in it is:\n<div class='span-23'>\n... |
Is there a major difference between the Multiview control in ASP.NET 2.0 and the Tab control in the AjaxToolkit?
Other than the built in visuals of the tab control, is there anything different in the way they handle the hiding/showing of controls?
| Yes, there are some key differences between the Multiview control in ASP.NET 2.0 and the Tab control in the Ajax Control Toolkit, beyond just the built-in visuals. Here’s a breakdown of their features and behaviors:
### 1. **Basic Functionality**:
- **Multiview Control**:
- The Multiview control is designed to hol... | 35,037 | [
{
"from": "human",
"value": "Is there a major difference between the Multiview control in ASP.NET 2.0 and the Tab control in the AjaxToolkit? \nOther than the built in visuals of the tab control, is there anything different in the way they handle the hiding/showing of controls?\n"
},
{
"from": "gpt"... |
Is there a generic makefile i can use to build a simple c++ project? on windows?
i modified a working wii makefile to win32 but could not build properly (difference in make? the make app and the makefile seem to be found). I did a little hack and made a copy of mingw32-make as make.
-edit-
export PATH seem to be the re... | Sure, I can help you create a simple Makefile for a C++ project on Windows using MinGW. Below is a generic example of a Makefile that you can use to build a simple C++ project. Make sure to adapt it to the structure of your project.
### Example Makefile
```Makefile
# Compiler
CXX = g++
# Compiler flags
CXXFLAGS = -Wa... | 34,580 | [
{
"from": "human",
"value": "Is there a generic makefile i can use to build a simple c++ project? on windows?\ni modified a working wii makefile to win32 but could not build properly (difference in make? the make app and the makefile seem to be found). I did a little hack and made a copy of mingw32-make as ... |
I'm converting some Actionscript code from AS2 tp AS3, and I've eventually managed to get most of it to work again (it's allmost a totally different language, sharing just a little syntax similarity). One of the last things that still doesn't work, is the code for loading an external image.
Perhaps this has changed in ... | In ActionScript 3 (AS3), loading images is done using the `Loader` class rather than `URLLoader`. The `URLLoader` class is used for loading text-based data, like XML or text files, while `Loader` is specifically designed for loading images and SWF files.
Here’s how you can properly load an external image in AS3 using ... | 37,574 | [
{
"from": "human",
"value": "I'm converting some Actionscript code from AS2 tp AS3, and I've eventually managed to get most of it to work again (it's allmost a totally different language, sharing just a little syntax similarity). One of the last things that still doesn't work, is the code for loading an ext... |
I'm using Microsoft's DSOFramer control to allow me to embed an Excel file in my dialog so the user can choose his sheet, then select his range of cells; it's used with an import button on my dialog.
The problem is that when I call the DSOFramer's OPEN function, if I have Excel open in another window, it closes the Exc... | It looks like you've been through a significant troubleshooting process with the DSOFramer control for embedding Excel, and you've identified several key areas of concern related to COM interactions, particularly with Excel documents that might be open in other instances or with unsaved data.
Here are a few thoughts o... | 36,171 | [
{
"from": "human",
"value": "I'm using Microsoft's DSOFramer control to allow me to embed an Excel file in my dialog so the user can choose his sheet, then select his range of cells; it's used with an import button on my dialog.\nThe problem is that when I call the DSOFramer's OPEN function, if I have Excel... |
Host: GoDaddy Shared Hosting
Trust Level: Medium
The following happens after I submit a valid user/pass. The database has read/write permissions and when I remove the login requirement on an admin page that updates the database work as expected.
Has anyone else had this issue or know what the problem is?
Anyone?
Serve... | The error message you are encountering indicates that your ASP.NET application is trying to perform an operation that it does not have permission to execute, specifically related to file I/O operations. This is typically associated with the application's trust level settings.
Here are a few things to consider and pote... | 35,793 | [
{
"from": "human",
"value": "Host: GoDaddy Shared Hosting\nTrust Level: Medium\nThe following happens after I submit a valid user/pass. The database has read/write permissions and when I remove the login requirement on an admin page that updates the database work as expected.\nHas anyone else had this issue... |
Why whenever I compile and run the following code in Visual Studio 2008:
double value1 = 10.5;
double value2 = 15.5;
int whole_number = value1 + value2;
Console::WriteLine(whole_number);
I get an incorrect value of 26 while the answer is 25.
However when I use static casts on the doubles, I get the right answer which ... | The issue you're encountering stems from the way floating-point numbers (such as `double`) are handled in C++. When you perform arithmetic operations involving `double`, the result is also a `double`. In your code:
```cpp
double value1 = 10.5;
double value2 = 15.5;
int whole_number = value1 + value2; // Implicit conv... | 35,977 | [
{
"from": "human",
"value": "Why whenever I compile and run the following code in Visual Studio 2008:\ndouble value1 = 10.5;\ndouble value2 = 15.5;\nint whole_number = value1 + value2;\nConsole::WriteLine(whole_number);\n\nI get an incorrect value of 26 while the answer is 25.\nHowever when I use static cas... |
For a web application, I want to build a WHERE clause AND submit it to the server. There I will append it to a query. The clause will be something like
LASTNAME LIKE 'Pep%' AND (DOB BETWEEN '19600101' AND '19601231 OR SALARY<35000)
Can you propose a regular expression to validate the clause before submitting it to SQL... | Creating a regular expression to validate SQL `WHERE` clauses can be quite complex, especially considering the diverse structures that such clauses can have. Below is a regex that attempts to capture the essence of the `WHERE` clause you provided, focusing on validating fields, conditions, and operators. However, keep ... | 33,159 | [
{
"from": "human",
"value": "For a web application, I want to build a WHERE clause AND submit it to the server. There I will append it to a query. The clause will be something like\nLASTNAME LIKE 'Pep%' AND (DOB BETWEEN '19600101' AND '19601231 OR SALARY<35000)\n\nCan you propose a regular expression to val... |
I've read everywhere about how great they are, but for some reason I can't seem to figure out how exactly I'm supposed to test something. Could someone perhaps post a piece of example code and how they would test it? If it's not too much trouble :)
| Certainly! Let's go through a simple example of how to write a piece of code and how to test it. For this demonstration, I'll use Python and the `unittest` framework, which is built into Python.
### Example Code: A Simple Calculator
Let's create a simple calculator with basic operations: addition, subtraction, multi... | 33,538 | [
{
"from": "human",
"value": "I've read everywhere about how great they are, but for some reason I can't seem to figure out how exactly I'm supposed to test something. Could someone perhaps post a piece of example code and how they would test it? If it's not too much trouble :)\n"
},
{
"from": "gpt",... |
How can I call a C++ function from C# .NET?
| To call a C++ function from C# .NET, you can use Platform Invocation Services (P/Invoke) or create a C++/CLI wrapper. Below are the steps for both methods:
### Method 1: Using P/Invoke
This method is suitable if you have a simple C++ function in a DLL.
1. **Create a C++ DLL:**
Create a C++ project in Visual Stud... | 35,061 | [
{
"from": "human",
"value": "How can I call a C++ function from C# .NET?\n"
},
{
"from": "gpt",
"value": "To call a C++ function from C# .NET, you can use Platform Invocation Services (P/Invoke) or create a C++/CLI wrapper. Below are the steps for both methods:\n\n### Method 1: Using P/Invoke\n\... |
This might be a silly question:
Does HTTP ever use the User Datagram Protocol?
For example:
If one is streaming MP3 or video using HTTP, does it internally use UDP for transport?
| It's not a silly question at all! To clarify:
HTTP (Hypertext Transfer Protocol) typically operates over TCP (Transmission Control Protocol) rather than UDP (User Datagram Protocol). TCP is a connection-oriented protocol that ensures reliable delivery of data, which is crucial for web page requests, form submissions, ... | 38,063 | [
{
"from": "human",
"value": "This might be a silly question:\n\nDoes HTTP ever use the User Datagram Protocol? \n\nFor example: \n\nIf one is streaming MP3 or video using HTTP, does it internally use UDP for transport?\n\n"
},
{
"from": "gpt",
"value": "It's not a silly question at all! To cla... |
I've created an excel sheet with Delphi 6. Now I have to add a picture to my sheet. Anybody knows how to do that?
| To add a picture to an Excel sheet using Delphi 6, you typically have to use the Excel OLE Automation interface to interact with Excel. Here’s a basic outline of how to add a picture to an Excel sheet. Make sure you have the Excel OLE server available and that you have included the necessary units in your Delphi applic... | 30,109 | [
{
"from": "human",
"value": "I've created an excel sheet with Delphi 6. Now I have to add a picture to my sheet. Anybody knows how to do that?\n"
},
{
"from": "gpt",
"value": "To add a picture to an Excel sheet using Delphi 6, you typically have to use the Excel OLE Automation interface to int... |
In C++, is (int) ch equivalent to int(ch).
If not, what's the difference?
| In C++, `(int) ch` and `int(ch)` are both ways to convert a character `ch` to an integer, but they represent different styles of type conversion.
1. **C-style cast: `(int) ch`**:
- This is a traditional C-style cast. It converts the value of `ch` to an `int` type. This cast does not provide any additional safety ch... | 36,173 | [
{
"from": "human",
"value": "In C++, is (int) ch equivalent to int(ch). \nIf not, what's the difference?\n"
},
{
"from": "gpt",
"value": "In C++, `(int) ch` and `int(ch)` are both ways to convert a character `ch` to an integer, but they represent different styles of type conversion.\n\n1. **C-st... |
I have following situation:
I have loged user, standard authentication with DB table
$authAdapter = new Zend_Auth_Adapter_DbTable(Zend_Db_Table::getDefaultAdapter());
$authAdapter->setTableName('users');
$authAdapter->setIdentityColumn('user_name');
$authAdapter->setCredentialColumn('password');
When user edits h... | Yes, you can update the storage of the authenticated user's information in the session when they edit their profile. Since you're using `Zend_Auth_Storage_Session`, you'll need to retrieve the current identity from the session, modify it with the new data, and then save it back to the session. Here’s a step-by-step app... | 36,333 | [
{
"from": "human",
"value": "I have following situation:\nI have loged user, standard authentication with DB table \n$authAdapter = new Zend_Auth_Adapter_DbTable(Zend_Db_Table::getDefaultAdapter()); \n$authAdapter->setTableName('users'); \n$authAdapter->setIdentityColumn('user_name'); \n$authAdapter->setCre... |
I have a container filled with pairs. I want to iterate in it using the STL generic algorithms (in my case it would be inner_product, but consider it as a generic problem).
The algorithm I am using expects iterators first and last. Can I provide special iterators first and last that will iterate not on the pairs but on... | Yes, you can achieve this with a clever one-liner by using the `std::transform_iterator` from the C++ Standard Library, which allows you to create an iterator that applies a function to the elements it iterates over.
To iterate over only the first elements of pairs in a container (e.g., a `std::vector<std::pair<int, i... | 35,688 | [
{
"from": "human",
"value": "I have a container filled with pairs. I want to iterate in it using the STL generic algorithms (in my case it would be inner_product, but consider it as a generic problem).\nThe algorithm I am using expects iterators first and last. Can I provide special iterators first and last... |
I am adding objects into a java Vector using its add(Object) method.
In my example, the first 5 objects are identical, followed by 2 instances different from the first five.
For some reasons, as soon as I insert the first one that is different, it changes the entire vector to that value!
'values' is an iterator contain... | The issue you're experiencing with the `Vector` in Java is likely due to the fact that you are adding references to the same object rather than creating new instances of that object. In Java, when you add an object to a collection, you are storing a reference to that object. If you later modify the object (or if the sa... | 33,782 | [
{
"from": "human",
"value": "I am adding objects into a java Vector using its add(Object) method.\nIn my example, the first 5 objects are identical, followed by 2 instances different from the first five.\nFor some reasons, as soon as I insert the first one that is different, it changes the entire vector to ... |
There are a dozen Rails plugins whose goal is to replace fixtures in testing. Here are a few I can think of:
fixture replacement
factory girl
factories and workers
rails scenarios
fixture-scenarios
object daddy
There are probably others. Which of these plugins do you prefer and why?
| While I don't have personal preferences, I can provide an overview of some of these Rails plugins and their characteristics, which might help you decide which one suits your needs best.
1. **Factory Girl (now known as Factory Bot)**:
- **Pros**: Factory Bot is widely used and well-documented. It allows for defini... | 31,835 | [
{
"from": "human",
"value": "There are a dozen Rails plugins whose goal is to replace fixtures in testing. Here are a few I can think of:\n\nfixture replacement\nfactory girl\nfactories and workers\nrails scenarios\nfixture-scenarios\nobject daddy\n\nThere are probably others. Which of these plugins do you ... |
I studied TSP in college in the context of NP Completeness. I have never actually had a situation where it would apply to a practical problem. A little bit of research shows that it has been used to pick the cheapest path to move a drill around, that is making holes in circuit boards. That is pretty much all I co... | The Traveling Salesman Problem (TSP) is a classic optimization problem in combinatorial optimization and computer science. While it is primarily known as a theoretical problem in the context of NP-completeness, it has several practical applications across various fields. Here are some notable applications of TSP beyond... | 36,988 | [
{
"from": "human",
"value": "I studied TSP in college in the context of NP Completeness. I have never actually had a situation where it would apply to a practical problem. A little bit of research shows that it has been used to pick the cheapest path to move a drill around, that is making holes in circ... |
I've been using usenet searches since about 1995 to get programming information, mostly for microsoft APIs. First searching via dejanews, and now google "groups" which bought out dejanews. Over the last few years I've noticed a steady decline in the quantity of search results for usenet from google, and today I find I'... | It seems you're experiencing difficulty with Google Groups' ability to search Usenet archives, which can indeed be frustrating, especially when you're used to finding specific information through older methods like DejaNews. The Google Groups interface has changed over the years, and it may not support complex searches... | 37,537 | [
{
"from": "human",
"value": "I've been using usenet searches since about 1995 to get programming information, mostly for microsoft APIs. First searching via dejanews, and now google \"groups\" which bought out dejanews. Over the last few years I've noticed a steady decline in the quantity of search results ... |
I've read many times and agree with avoiding the use of globals to keep code orthogonal. Does the use of the config file to keep read only information that your program uses similar to using Globals?
| Using a configuration file to store read-only information for your program is a common practice, and it can be seen as different from using global variables in several key ways. Let’s break this down:
### 1. **Scope and Accessibility**
- **Global Variables**: When you use global variables, they can be accessed and mod... | 32,904 | [
{
"from": "human",
"value": "I've read many times and agree with avoiding the use of globals to keep code orthogonal. Does the use of the config file to keep read only information that your program uses similar to using Globals?\n"
},
{
"from": "gpt",
"value": "Using a configuration file to sto... |
What's the best way to initialize an array in PowerShell?
For example, the code
$array = @()
for($i=0; $i -lt 5;$i++)
{
$array[$i] = $FALSE
}
generates the error
Array assignment failed because index '0' was out of range.
At H:\Software\PowerShell\TestArray.ps1:4 char:10
+ $array[$ <<<< i] = $FALSE
| In PowerShell, initializing an array and then trying to assign values to it can lead to confusion, especially if the array is empty when you first try to assign values using an index.
In your example, you initially declare `$array` as an empty array using `$array = @()`. This means that the array has no predefined siz... | 36,613 | [
{
"from": "human",
"value": "What's the best way to initialize an array in PowerShell?\nFor example, the code\n$array = @()\nfor($i=0; $i -lt 5;$i++)\n{\n $array[$i] = $FALSE\n}\n\ngenerates the error\nArray assignment failed because index '0' was out of range.\nAt H:\\Software\\PowerShell\\TestArray.ps1... |
Got into a situation where in a schema i have a table, say table ACTION , while i got a synonym called ACTION as well which refers to another table to another schema.
Now, when i run the query
select * from ACTION
it will select the records from the table, but not the synonym.
Anyway for me to select from the synonym A... | In SQL, when you have a table and a synonym with the same name, the query will default to the table when you use that name in your `SELECT` statement. If you want to select from both the table and the synonym in the same query, you can do so using an alias to distinguish between them. Here’s how you can do that:
### E... | 38,053 | [
{
"from": "human",
"value": "Got into a situation where in a schema i have a table, say table ACTION , while i got a synonym called ACTION as well which refers to another table to another schema.\nNow, when i run the query\nselect * from ACTION\nit will select the records from the table, but not the synonym... |
Is there any way to create an Access / Jet database from within Linux?
I'm trying to feed data from a linux application server (mysql backend) and have not found any tools that let me do this - it seems there should be something.
If I can't create a database, is there a way to insert into an existing Access database fi... | Creating or manipulating Microsoft Access (Jet) databases from Linux can be challenging since Access is primarily a Windows-based application and uses a proprietary file format (.accdb or .mdb). However, there are some approaches you can consider to create or interact with Access databases from a Linux environment.
##... | 34,960 | [
{
"from": "human",
"value": "Is there any way to create an Access / Jet database from within Linux?\nI'm trying to feed data from a linux application server (mysql backend) and have not found any tools that let me do this - it seems there should be something.\nIf I can't create a database, is there a way to... |
It seems like deployment of VSTO code is very cumbersome.
My use case is I need to enforce a certain content structure in word. Am I better of doing it all in VBA?
| When considering whether to use Visual Studio Tools for Office (VSTO) or VBA for enforcing a content structure in Word, it is essential to weigh the benefits and drawbacks of each approach:
### VSTO
**Pros:**
1. **Rich User Interface**: VSTO allows for the creation of more complex and visually appealing user interface... | 34,374 | [
{
"from": "human",
"value": "It seems like deployment of VSTO code is very cumbersome.\nMy use case is I need to enforce a certain content structure in word. Am I better of doing it all in VBA?\n"
},
{
"from": "gpt",
"value": "When considering whether to use Visual Studio Tools for Office (VSTO... |
I have some code doing this :
var changes = document.getElementsByName(from);
for (var c=0; c<changes.length; c++) {
var ch = changes[c];
var current = new String(ch.innerHTML);
etc.
}
This works fine in FF and Chrome but not in IE7. Presumably because getElementsByName isn't working in IE. What's the best... | You're correct that `document.getElementsByName()` may not work as expected in older versions of Internet Explorer, such as IE7. One workaround is to use `document.getElementsByTagName()` or `document.querySelectorAll()` to achieve similar functionality.
Here’s a general approach that uses `document.querySelectorAll()... | 32,587 | [
{
"from": "human",
"value": "I have some code doing this :\n var changes = document.getElementsByName(from);\n for (var c=0; c<changes.length; c++) {\n var ch = changes[c];\n var current = new String(ch.innerHTML);\n etc.\n }\n\nThis works fine in FF and Chrome but not in IE7. Presumably because getEl... |
I have a Java Swing application, developed on Mac OS X 10.5 using Java 1.5.
I'm trying to make a custom cursor appear when the user moves the mouse over some text in a dialog. The cursor never changes, though.
When I don't use a JFrame instead of a JDialog, the cursor does change. But then I'll have to write all the d... | The issue you're experiencing is due to the fact that the `JOptionPane` and `JDialog` do not handle mouse events properly in certain scenarios. Specifically, setting the cursor on a label within a `JOptionPane` may not trigger the cursor change as expected.
To resolve this, you can use a `JPanel` to hold your label an... | 36,565 | [
{
"from": "human",
"value": "I have a Java Swing application, developed on Mac OS X 10.5 using Java 1.5.\nI'm trying to make a custom cursor appear when the user moves the mouse over some text in a dialog. The cursor never changes, though. \nWhen I don't use a JFrame instead of a JDialog, the cursor does ch... |
I've found an issue with ASP.NET that I know at least has stumped one other person out there. We were trying to use an HttpModule to handle wildcard
requests to a web application. The generated url is dynamic and could
potentially be several hundred characters long. Unfortunately there
appears to be a limitation ... | The issue you are encountering with the `aspnet_isapi.dll` and the `MAX_PATH` limitation of 260 characters for URL paths is a known limitation in older versions of ASP.NET when using IIS with the ISAPI extension. Here are some potential workarounds to address this limitation:
1. **Switch to ASP.NET Core**: If it's fea... | 36,486 | [
{
"from": "human",
"value": "I've found an issue with ASP.NET that I know at least has stumped one other person out there. We were trying to use an HttpModule to handle wildcard \nrequests to a web application. The generated url is dynamic and could \npotentially be several hundred characters long. Unfor... |
I have following string
String str = "replace :) :) with some other string";
And I want to replace first occurance of :) with some other string
And I used str.replaceFirst(":)","hi");
it gives following exception
"Unmatched closing ')'"
I tried using replace function but it replaced all occurance of :).
| The issue you're encountering is due to the fact that the `replaceFirst` method interprets the first argument as a regular expression (regex). In regex, the `)` character is special and needs to be escaped with a double backslash (`\\`) to treat it as a literal character.
You can replace the first occurrence of `:)` i... | 39,607 | [
{
"from": "human",
"value": "I have following string\nString str = \"replace :) :) with some other string\";\n\nAnd I want to replace first occurance of :) with some other string\nAnd I used str.replaceFirst(\":)\",\"hi\");\nit gives following exception\n\n\"Unmatched closing ')'\"\n\nI tried using replace ... |
I am trying to run PartCover to test the coverage of some tests with Gallio on windows x64. However trying to run it gives the following error.
Retrieving the COM class factory for component with CLSID
{FB20430E-CDC9-45D7-8453-272268002E08} failed due to the following error: 80040153.
Edit: I am using PartCover 2.... | The error message you're encountering when trying to use PartCover indicates a problem with the registration of a COM component, specifically the CLSID mentioned in the error. The error code `80040153` typically means "Class not registered," suggesting that the necessary component cannot be found or registered properly... | 34,172 | [
{
"from": "human",
"value": "I am trying to run PartCover to test the coverage of some tests with Gallio on windows x64. However trying to run it gives the following error.\n\nRetrieving the COM class factory for component with CLSID\n {FB20430E-CDC9-45D7-8453-272268002E08} failed due to the following err... |
Can anyone help me to put a vertical scroll bar for an <asp:CheckBoxList>?
| You can add a vertical scroll bar to an `<asp:CheckBoxList>` by enclosing it in a `<div>` element with specific CSS styles that control its height and overflow properties. Here's how you can do it:
1. **Wrap the CheckBoxList in a div**: This div will control the height and provide the scroll bar.
2. **Apply CSS Styles... | 34,589 | [
{
"from": "human",
"value": "Can anyone help me to put a vertical scroll bar for an <asp:CheckBoxList>?\n"
},
{
"from": "gpt",
"value": "You can add a vertical scroll bar to an `<asp:CheckBoxList>` by enclosing it in a `<div>` element with specific CSS styles that control its height and overflow... |
What's the difference between
var A = function () {
this.x = function () {
//do something
};
};
and
var A = function () { };
A.prototype.x = function () {
//do something
};
| The two code snippets you provided define a function `A` in different ways, affecting how the method `x` is associated with instances of `A`. Here's the breakdown of the differences:
### First Snippet:
```javascript
var A = function () {
this.x = function () {
// do something
};
};
```
In this version:... | 37,437 | [
{
"from": "human",
"value": "What's the difference between\nvar A = function () {\n this.x = function () {\n //do something\n };\n};\n\nand\nvar A = function () { };\nA.prototype.x = function () {\n //do something\n};\n\n"
},
{
"from": "gpt",
"value": "The two code snippets you p... |
Usually, I've seen it with forms, but I've found it helpful to group related sets of data (eg when you have multiple tables on a page, using a fieldset around each table or group of related tables to define a visible meaning and a group name (legend)). Is this abusing the fieldset tag to the point where, in my uses, it... | Using the `<fieldset>` tag in HTML is intended for grouping related elements within a form, primarily to enhance semantic meaning and accessibility. The accompanying `<legend>` tag provides a caption or title for that group of elements, which helps users understand the context better, especially in forms.
When it come... | 36,993 | [
{
"from": "human",
"value": "Usually, I've seen it with forms, but I've found it helpful to group related sets of data (eg when you have multiple tables on a page, using a fieldset around each table or group of related tables to define a visible meaning and a group name (legend)). Is this abusing the fields... |
I'd like to commit just a part of a file using TortoiseSVN, is there some way to do that?
I'll give an example to make it clearer why I want to do that.
I have a file with some defines that are replaced in the build process, something like this:
#define SOME_PATH "[SOME_PATH]"
This [SOME_PATH] tag is replaced in the b... | TortoiseSVN does not support partial commits directly, meaning you can't tell it to ignore specific lines in a file during the commit process. However, there are several strategies you can use to manage your situation more effectively. Here are a few options you might consider:
### 1. Use a Local Configuration File
I... | 36,701 | [
{
"from": "human",
"value": "I'd like to commit just a part of a file using TortoiseSVN, is there some way to do that?\nI'll give an example to make it clearer why I want to do that.\nI have a file with some defines that are replaced in the build process, something like this:\n#define SOME_PATH \"[SOME_PATH... |
How can I replace Line Breaks within a string in C#?
| In C#, you can replace line breaks within a string using the `String.Replace` method. Line breaks can be represented in different ways depending on the operating system:
- For Windows, line breaks are represented by the combination of carriage return (`\r`) and line feed (`\n`), which is `"\r\n"`.
- For Unix/Linux, li... | 37,193 | [
{
"from": "human",
"value": "How can I replace Line Breaks within a string in C#?\n"
},
{
"from": "gpt",
"value": "In C#, you can replace line breaks within a string using the `String.Replace` method. Line breaks can be represented in different ways depending on the operating system:\n\n- For Wi... |
Is possible to insert a line break where the cursor is in Vim without entering into insert mode? Here's an example ([x] means cursor is on x):
if (some_condition) {[ ]return; }
Occasionally, I might want to enter some more code. So I'd press i to get into insert mode, press Enter to insert the line break and then dele... | Yes, you can insert a line break at the cursor's position in Vim without entering insert mode by using the `:put` command. Here’s how you can do it:
1. Position your cursor where you want the line break (like in your example before the `return` statement).
2. Press `Esc` to ensure you're in normal mode.
3. Type `o` to... | 35,561 | [
{
"from": "human",
"value": "Is possible to insert a line break where the cursor is in Vim without entering into insert mode? Here's an example ([x] means cursor is on x):\nif (some_condition) {[ ]return; }\n\nOccasionally, I might want to enter some more code. So I'd press i to get into insert mode, press ... |
By this, I don't mean PC-based development environments (like Visual Studio) for developing and deploying Windows Mobile applications. Rather, I mean an IDE that runs on Windows Mobile devices and lets you write and test code there.
| Developing directly on a Windows Mobile device can be quite challenging due to the limited tools available compared to traditional desktop environments. However, there are a few options you can consider for coding on Windows Mobile devices:
1. **Microsoft Visual Studio 2005/2008 with Windows Mobile SDK**: While this i... | 37,565 | [
{
"from": "human",
"value": "By this, I don't mean PC-based development environments (like Visual Studio) for developing and deploying Windows Mobile applications. Rather, I mean an IDE that runs on Windows Mobile devices and lets you write and test code there.\n"
},
{
"from": "gpt",
"value": "... |
Is there a cookie automatically placed on the user's machine? Or is it somehow associated with the requester's IP address? Or maybe in the ViewState? Elementary question, I know, but I've had a hard time finding an answer.
| Cookies are small pieces of data that are stored on a user's machine by the web browser at the request of a web server. When you visit a website, the server can send cookies to your browser, which can then store them and send them back to the server with future requests.
Here's a brief overview of the different mecha... | 36,696 | [
{
"from": "human",
"value": "Is there a cookie automatically placed on the user's machine? Or is it somehow associated with the requester's IP address? Or maybe in the ViewState? Elementary question, I know, but I've had a hard time finding an answer.\n"
},
{
"from": "gpt",
"value": "Cookies ... |
PL/Ruby is a loadable procedural language for Postgres that lets you use Ruby to write user defined functions for the database.
Anyone know of an equivalent way of writing user defined functions for MySQL in Ruby?
| As of my last knowledge update in October 2023, MySQL does not have a direct equivalent to PL/Ruby for creating user-defined functions (UDFs) using Ruby. However, there are a few approaches you can consider if you want to integrate Ruby with MySQL for user-defined functionalities:
1. **Using MySQL UDFs in C/C++**: MyS... | 36,606 | [
{
"from": "human",
"value": "PL/Ruby is a loadable procedural language for Postgres that lets you use Ruby to write user defined functions for the database.\nAnyone know of an equivalent way of writing user defined functions for MySQL in Ruby?\n"
},
{
"from": "gpt",
"value": "As of my last knowl... |
I have been trying for an hour or so and cannot get this right. I have a Visual Studio project which reads an Excel file, which I have added to the VS solution. When I run the project in VS, the file can be opened successfully. However, when I publish the project, the file does not get included, and therefore cannot be... | It's great that you're getting into Windows Application development! Including additional files, such as an Excel file, in your Visual Studio project's output is a common task that can sometimes be a bit confusing. Here are steps to ensure your Excel file is included in your deployment package:
### Step 1: Set the Fil... | 33,289 | [
{
"from": "human",
"value": "I have been trying for an hour or so and cannot get this right. I have a Visual Studio project which reads an Excel file, which I have added to the VS solution. When I run the project in VS, the file can be opened successfully. However, when I publish the project, the file does ... |
I have a class which looks something like this:
public class Test {
private static final Object someObject = new Object();
public void doSomething()
{
synchronized (someObject) {
System.out.println(someObject.toString());
}
}
}
Can I consider the object to be synchronized, or is there a problem sinc... | Yes, you can consider the `someObject` in your `Test` class to be synchronized. Here's how synchronization works in this context:
1. **Static and Instance Context**: The `someObject` is declared as `static`, which means it is shared among all instances of the `Test` class. Thus, it serves as a single lock across all i... | 37,086 | [
{
"from": "human",
"value": "I have a class which looks something like this:\npublic class Test {\n\nprivate static final Object someObject = new Object();\n\npublic void doSomething()\n{\n synchronized (someObject) {\n System.out.println(someObject.toString());\n }\n}\n\n}\n\nCan I consider th... |
I just happened to read jQuery Intellisense Updates from Microsoft and was wondering if there was any editor or eclipse plugin available which provides intellisense complete or code assist. Are there any?
| Yes, there are several options for adding IntelliSense or code completion for jQuery in Eclipse and other editors. Below are some recommendations:
### For Eclipse
1. **JSDT (JavaScript Development Tools)**:
- JSDT is part of the Eclipse IDE and provides support for JavaScript development, including basic code comp... | 37,135 | [
{
"from": "human",
"value": "I just happened to read jQuery Intellisense Updates from Microsoft and was wondering if there was any editor or eclipse plugin available which provides intellisense complete or code assist. Are there any?\n"
},
{
"from": "gpt",
"value": "Yes, there are several option... |
I have very basic knowledge of Javascript and now I am looking forward to learn Ext JS and implement in in my ASP.NET application.
If anyone can guide me on how to start and which book I should follow, I'd be thankful.
| Getting started with Ext JS and integrating it into your ASP.NET application is a great way to enhance your front-end development skills. Below are some steps and resources to help you along the way.
### Steps to Get Started
1. **Understand Ext JS Basics:**
- Start by familiarizing yourself with the core concepts ... | 31,797 | [
{
"from": "human",
"value": "I have very basic knowledge of Javascript and now I am looking forward to learn Ext JS and implement in in my ASP.NET application. \nIf anyone can guide me on how to start and which book I should follow, I'd be thankful.\n"
},
{
"from": "gpt",
"value": "Getting start... |
I'm looking for a script or application that tidies up and reformats SQL queries. I've found some good online SQL formatters (see here) , as well as some downloadable commercial applications. I'm cautious about using an online service as I don't want to risk copies of these queries being stored somewhere they might be... | It's great to hear that you've found SQLInform useful for formatting your SQL queries. Here are a few additional open-source or freeware options that you might find helpful for SQL tidying and reformatting:
1. **SQL Formatter** - There are several SQL formatter scripts available on GitHub. For example, [sql-formatter]... | 36,351 | [
{
"from": "human",
"value": "I'm looking for a script or application that tidies up and reformats SQL queries. I've found some good online SQL formatters (see here) , as well as some downloadable commercial applications. I'm cautious about using an online service as I don't want to risk copies of these que... |
if __name__=='__main__':
parser = OptionParser()
parser.add_option("-i", "--input_file",
dest="input_filename",
help="Read input from FILE", metavar="FILE")
(options, args) = parser.parse_args()
print options
result is
$ python convert.py -i video_*
{'input_f... | The behavior you're experiencing is due to how the shell (your command line environment) handles wildcard characters, specifically the asterisk (`*`). When you use the command:
```bash
python convert.py -i video_*
```
the shell expands the wildcard `video_*` before passing the arguments to your script. This means tha... | 35,651 | [
{
"from": "human",
"value": "if __name__=='__main__':\n parser = OptionParser()\n parser.add_option(\"-i\", \"--input_file\", \n dest=\"input_filename\",\n help=\"Read input from FILE\", metavar=\"FILE\")\n\n (options, args) = parser.parse_args()\n print o... |
I am confused about the licensing model for Microsoft PerformancePoint Server.
When I look at
http://www.microsoft.com/business/performancepoint/howtobuy/default.aspx
I see a 20,000 USD Server License, plus a 200 USD CAL license. But the language is a bit vague about what this means-- is CAl required for any user look... | Hello Peter,
The licensing model for Microsoft PerformancePoint Server can indeed be a bit confusing.
1. **Server License**: The server license, priced at approximately $20,000, is the cost for the server software itself. This license is required to run the PerformancePoint Server on your infrastructure.
2. **Clien... | 39,108 | [
{
"from": "human",
"value": "I am confused about the licensing model for Microsoft PerformancePoint Server.\nWhen I look at \nhttp://www.microsoft.com/business/performancepoint/howtobuy/default.aspx\nI see a 20,000 USD Server License, plus a 200 USD CAL license. But the language is a bit vague about what th... |
I am trying to get the DataGridView to render the "insert new row" row as the first row in the grid instead of the last row. How do I go about doing that, is it even possible in the control?
| In a Windows Forms `DataGridView`, the "Insert New Row" feature typically appears as the last row of the grid. Unfortunately, the default behavior does not allow you to move the "Insert New Row" to the top of the grid directly. However, you can achieve the desired effect by utilizing some workarounds.
Here’s one appro... | 35,767 | [
{
"from": "human",
"value": "I am trying to get the DataGridView to render the \"insert new row\" row as the first row in the grid instead of the last row. How do I go about doing that, is it even possible in the control?\n"
},
{
"from": "gpt",
"value": "In a Windows Forms `DataGridView`, the \"... |
Possible Duplicate:
What Ruby IDE do you prefer?
I'm making a simple script using ruby on a Windows 2003 Server.
My questions are:
How can I connect to a database through ODBC? I will be connecting to both Sybase on Solaris and MSSQL Server.
How can I send emails through an Exchange Server 2003?
Update
What's t... | To address your questions:
### Connecting to a Database through ODBC in Ruby
To connect to a database using ODBC in Ruby, you can use the `dbi` and `dbd-odbc` gems. Here's how you can do it:
1. **Install the required gems**:
Make sure you have Ruby installed, and then install the necessary gems by running:
`... | 34,453 | [
{
"from": "human",
"value": "\nPossible Duplicate:\nWhat Ruby IDE do you prefer? \n\nI'm making a simple script using ruby on a Windows 2003 Server.\nMy questions are:\n\nHow can I connect to a database through ODBC? I will be connecting to both Sybase on Solaris and MSSQL Server.\nHow can I send emails th... |
Javascript Developer Tools (JSDT) for Eclipse provides a nice outline view of Javascript classes, with a little symbol next to them to indicate visibility.
Looking at Preferences->Javascript->Appearance->Members Sort Order, it seems able to indicate whether a method is public, private or protected, but all of my use t... | In Eclipse's JavaScript Development Tools (JSDT), the visibility markers for methods (public, private, protected) are determined primarily by conventions used in the JavaScript code, rather than explicitly defined access modifiers, since JavaScript doesn't have built-in access modifiers in the same way that languages l... | 36,686 | [
{
"from": "human",
"value": "Javascript Developer Tools (JSDT) for Eclipse provides a nice outline view of Javascript classes, with a little symbol next to them to indicate visibility. \nLooking at Preferences->Javascript->Appearance->Members Sort Order, it seems able to indicate whether a method is public,... |
I'm using Excel 2007 to create a log-scale chart of numbers (specifically the Zimbabwean dollar exchange rate) over time. I'm using an x-y scatterplot and noticing one odd quirk.
The range of y values (numbers) spans a factor of about 10^30. On every chart I make using this data, half the gridlines are missing. Specifi... | This issue with missing gridlines in log-scaled charts in Excel 2007 can be attributed to how Excel handles logarithmic scales, particularly when the range of data spans a very wide range (like 10^30). While Excel does support log scales, its ability to display gridlines is somewhat limited, especially when the data ra... | 37,716 | [
{
"from": "human",
"value": "I'm using Excel 2007 to create a log-scale chart of numbers (specifically the Zimbabwean dollar exchange rate) over time. I'm using an x-y scatterplot and noticing one odd quirk.\nThe range of y values (numbers) spans a factor of about 10^30. On every chart I make using this dat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.