instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
How do I access parameters passed into an Oracle Form via a URL.
Eg given the url:
http://example.com/forms90/f90servlet?config=cust&form='a_form'&p1=something&p2=else
This will launch the 'a_form' form, using the 'cust' configuration, but I can't work how (or even if it's possible) to access p1 (with value of 'some... | In Oracle Forms, you can access parameters passed in via a URL using the `FND:FORM` built-in functions or through the Forms built-in `GET_PARAMETER` function. When you pass parameters in the URL, they can be captured and processed within the form.
Here’s how you can access the parameters you mentioned (`p1` and `p2`) ... | 12,086 | [
{
"from": "human",
"value": "How do I access parameters passed into an Oracle Form via a URL.\nEg given the url:\n\nhttp://example.com/forms90/f90servlet?config=cust&form='a_form'&p1=something&p2=else\n\nThis will launch the 'a_form' form, using the 'cust' configuration, but I can't work how (or even if it... |
Suppose I have a string 'nvarchar(50)', which is for example the T-SQL string segment used in creating a table of that type. How do I best convert that to an enum representation of System.Data.DbType?
Could it handle the many different possible ways of writing the type in T-SQL, such as:
[nvarchar](50)
nvarchar 50
@J... | In .NET, there isn't a built-in function or library that directly converts T-SQL string representations like `nvarchar(50)` into `System.Data.DbType` enums. However, you can create a custom method to handle different variations of the SQL types and map them to the corresponding `DbType` enum values.
To account for the... | 10,295 | [
{
"from": "human",
"value": "Suppose I have a string 'nvarchar(50)', which is for example the T-SQL string segment used in creating a table of that type. How do I best convert that to an enum representation of System.Data.DbType?\nCould it handle the many different possible ways of writing the type in T-SQL... |
I have a SQL Server 2000, C# & ASP.net web app. We want to control access to it by using Active Directory groups. I can get authentication to work if the group I put in is a 'Global' but not if the group is 'Universal'.
How can I make this work with 'Universal' groups an well?
Here's my authorization block:
<auth... | In ASP.NET, when you are using Windows Authentication and trying to authorize users based on Active Directory groups, you might encounter issues when working with Universal groups. This can happen due to various reasons related to how the groups are recognized in the application.
Here are some steps and considerations... | 8,279 | [
{
"from": "human",
"value": "I have a SQL Server 2000, C# & ASP.net web app. We want to control access to it by using Active Directory groups. I can get authentication to work if the group I put in is a 'Global' but not if the group is 'Universal'. \nHow can I make this work with 'Universal' groups an we... |
The MSDN states that the method returns
true if the method is successfully
queued; NotSupportedException is
thrown if the work item is not queued.
For testing purposes how to get the method to return false? Or it is just a "suboptimal" class design?
| It sounds like you're referring to a method from the Task Parallel Library (TPL) or a related asynchronous programming model in .NET, possibly involving work items being queued for execution (like `ThreadPool.QueueUserWorkItem`, `Task.Run`, etc.). To clarify, in most of these cases, the method will typically return `tr... | 13,410 | [
{
"from": "human",
"value": "The MSDN states that the method returns\n\ntrue if the method is successfully\n queued; NotSupportedException is\n thrown if the work item is not queued.\n\nFor testing purposes how to get the method to return false? Or it is just a \"suboptimal\" class design?\n"
},
{
... |
I need to install amp on a windows2003 production server. I'd like, if possible, an integrated install/management tool so I don't have to install/integrate the components of amp separately. Those that I've found are 'development' servers. Are there any packages out there that install amp in a production ready (locked d... | Installing an AMP (Apache, MySQL/MariaDB, PHP) stack on Windows Server 2003, especially for a production environment, can be challenging due to the age of the operating system and the potential lack of support for newer software. However, there are some integrated solutions that you might consider to simplify the insta... | 10,220 | [
{
"from": "human",
"value": "I need to install amp on a windows2003 production server. I'd like, if possible, an integrated install/management tool so I don't have to install/integrate the components of amp separately. Those that I've found are 'development' servers. Are there any packages out there that in... |
Why isn't Visual Studio 2005 generating a serialization setting when I set the project setting "Generate Serialization Assembly" to "On"?
| If Visual Studio 2005 is not generating a serialization assembly when you set the project setting "Generate Serialization Assembly" to "On," here are some potential reasons and solutions to consider:
1. **Assembly Attributes**: Ensure that your classes are properly marked with the `[Serializable]` attribute. Only clas... | 14,179 | [
{
"from": "human",
"value": "Why isn't Visual Studio 2005 generating a serialization setting when I set the project setting \"Generate Serialization Assembly\" to \"On\"?\n"
},
{
"from": "gpt",
"value": "If Visual Studio 2005 is not generating a serialization assembly when you set the project se... |
I am currently using TortoiseSVN to manage a couple of the projects that I have on the go at the moment. When I first moved everything into source control I wasn't really sure how everything should be laid out so I ended up putting each project into its own repository.
I was wondering would it be a good idea for me j... | When it comes to organizing projects in source control systems like SVN, there are pros and cons to both having multiple repositories versus a single repository with multiple project folders. Here are some factors to consider for your situation:
### Advantages of a Single Repository
1. **Simplified Management**: Mana... | 13,863 | [
{
"from": "human",
"value": "I am currently using TortoiseSVN to manage a couple of the projects that I have on the go at the moment. When I first moved everything into source control I wasn't really sure how everything should be laid out so I ended up putting each project into its own repository. \nI was ... |
I have been trying to produce a statically linked "single binary" version of my game for windows. I want to link with sdl, sdl_image and sdl_mixer which in turn pull in a few support libraries. Unfortunately I haven't found a way to get them all to compile and link using cygwin/mingw/gcc. As far as I can tell all exist... | Creating a statically linked binary for your game using SDL, SDL_image, and SDL_mixer in a Windows environment using MinGW can be a bit tricky due to dependencies and how these libraries are commonly distributed. Here's a step-by-step guide to help you produce a statically linked binary:
### Step 1: Download and Build... | 9,289 | [
{
"from": "human",
"value": "I have been trying to produce a statically linked \"single binary\" version of my game for windows. I want to link with sdl, sdl_image and sdl_mixer which in turn pull in a few support libraries. Unfortunately I haven't found a way to get them all to compile and link using cygwi... |
After our Ruby on Rails application has run for a while, it starts throwing 500s with "MySQL server has gone away". Often this happens overnight. It's started doing this recently, with no obvious change in our server configuration.
Mysql::Error: MySQL server has gone away: SELECT * FROM `widgets`
Restarting the mongr... | The "MySQL server has gone away" error can be a common issue in applications using MySQL, especially in long-running applications. It often occurs when the MySQL connection is idle for too long, and the server closes the connection. Here are some steps you can take to diagnose and fix the problem:
### 1. Increase `wai... | 9,597 | [
{
"from": "human",
"value": "After our Ruby on Rails application has run for a while, it starts throwing 500s with \"MySQL server has gone away\". Often this happens overnight. It's started doing this recently, with no obvious change in our server configuration.\n Mysql::Error: MySQL server has gone away: S... |
I have a graphical app that needs to test the resolution of the display it is starting up on in Mac OS X to ensure it is not larger than the resolution. This is done before the window itself is initialized.
If there is more than one display, it needs to be the primary display. This is the display that hardware acce... | To determine the resolution of the primary display in macOS, you can use the `NSScreen` class from the Cocoa framework. This allows you to access information about the connected displays, including their resolutions. Here's how you can get the resolution of the primary display before initializing your graphical app's w... | 11,960 | [
{
"from": "human",
"value": "I have a graphical app that needs to test the resolution of the display it is starting up on in Mac OS X to ensure it is not larger than the resolution. This is done before the window itself is initialized. \nIf there is more than one display, it needs to be the primary displa... |
The point of const-correctness is to be able to provide a view of an instance that can't be altered or deleted by the user. The compiler supports this by pointing out when you break constness from within a const function, or try to use a non-const function of a const object. So without copying the const approach, is th... | In C#, while the language does not have a direct equivalent of C++'s `const` keyword, you can achieve similar goals of const-correctness and immutability through various design patterns and practices. Here are some methodologies that can help you ensure that certain instances or parts of your code are not altered or mo... | 9,120 | [
{
"from": "human",
"value": "The point of const-correctness is to be able to provide a view of an instance that can't be altered or deleted by the user. The compiler supports this by pointing out when you break constness from within a const function, or try to use a non-const function of a const object. So ... |
Can someone explain the pros and cons of it and any math involved with it?
| It seems like you might be asking about a specific concept or technology, but you haven't specified what "it" refers to. Could you please clarify what you would like to know more about? Examples could include financial instruments, programming languages, technologies, or even concepts in mathematics or science. Once yo... | 16,544 | [
{
"from": "human",
"value": "Can someone explain the pros and cons of it and any math involved with it?\n"
},
{
"from": "gpt",
"value": "It seems like you might be asking about a specific concept or technology, but you haven't specified what \"it\" refers to. Could you please clarify what you w... |
i've been working on Provision of an organization for quite a few days , and had faced few issues which i was successful in resolving them.Let me explain abt the issues i faced, the MSCrmServices is a process that is running under the Network Service.
When I call the 'Execute' method on the service from a console appl... | It sounds like you are dealing with a complex issue related to the configuration of your Microsoft Dynamics CRM deployment. The errors you’re encountering point towards permissions and service account issues. Here are a few troubleshooting steps and solutions that may help you resolve the problems:
### 1. **Service Ac... | 12,270 | [
{
"from": "human",
"value": "i've been working on Provision of an organization for quite a few days , and had faced few issues which i was successful in resolving them.Let me explain abt the issues i faced, the MSCrmServices is a process that is running under the Network Service.\nWhen I call the 'Execute'... |
I understand that the function is not allowed to change the state of the object, but I thought I read somewhere that the compiler was allowed to assume that if the function was called with the same arguments, it would return the same value and thus could reuse a cached value if it was available. e.g.
class object
{
... | What you're referring to involves two separate concepts in C++: the **`const` qualifier** and the **compiler's optimization capabilities**.
### `const` Qualifier
When you mark a member function with the `const` keyword, it promises that the function will not modify the state of the object on which it's called. This me... | 12,109 | [
{
"from": "human",
"value": "I understand that the function is not allowed to change the state of the object, but I thought I read somewhere that the compiler was allowed to assume that if the function was called with the same arguments, it would return the same value and thus could reuse a cached value if ... |
How can you strip non-ASCII characters from a string? (in C#)
| In C#, you can strip non-ASCII characters from a string using various methods. One common approach is to use LINQ to filter out characters that are outside the ASCII range (0 to 127). Below is an example of how you can achieve this:
### Method 1: Using LINQ
```csharp
using System;
using System.Linq;
class Program
{
... | 14,484 | [
{
"from": "human",
"value": "How can you strip non-ASCII characters from a string? (in C#)\n"
},
{
"from": "gpt",
"value": "In C#, you can strip non-ASCII characters from a string using various methods. One common approach is to use LINQ to filter out characters that are outside the ASCII range ... |
I want to run a command as soon as a certain text appears in a log file. How do I do that in Bash?
| To run a command as soon as a certain text appears in a log file in Bash, you can use the `tail` command in combination with `grep`. This method utilizes `tail -f` to follow the log file in real-time and `grep` to filter the output for the specific text you are interested in.
Here's a basic example of how you can do t... | 13,206 | [
{
"from": "human",
"value": "I want to run a command as soon as a certain text appears in a log file. How do I do that in Bash?\n"
},
{
"from": "gpt",
"value": "To run a command as soon as a certain text appears in a log file in Bash, you can use the `tail` command in combination with `grep`. Th... |
Basically I want to pass a string which contains Spanish text that could be in one of several encodings (Latin-1, CP-1252, or UTF-8 to name a few). Once it gets to the XMLRPC I can detect the encoding, but I won't know it before then. C#, by default seems to be killing any characters outside of ASCII. I've gotten ar... | To handle various text encodings when passing strings to XML-RPC using C#, you need to ensure that your string is properly managed to avoid data loss, especially when dealing with characters outside the ASCII range. Since you mentioned using the `CookComputing.XmlRpc` library, here's how you can approach the problem wi... | 10,671 | [
{
"from": "human",
"value": "Basically I want to pass a string which contains Spanish text that could be in one of several encodings (Latin-1, CP-1252, or UTF-8 to name a few). Once it gets to the XMLRPC I can detect the encoding, but I won't know it before then. C#, by default seems to be killing any cha... |
Has anybody used C# to write a sample screen scraper for IBM as400?
| Yes, C# can be used to create a screen scraper for IBM AS/400 (now known as IBM i). A screen scraper typically involves capturing the text displayed on a terminal emulator and then processing that data programmatically. Here's a basic overview of how you can approach creating a simple screen scraper for an IBM AS/400 s... | 11,227 | [
{
"from": "human",
"value": "Has anybody used C# to write a sample screen scraper for IBM as400?\n"
},
{
"from": "gpt",
"value": "Yes, C# can be used to create a screen scraper for IBM AS/400 (now known as IBM i). A screen scraper typically involves capturing the text displayed on a terminal emu... |
How can i stop the host machine entering standby mode while my application is running?
Is there any win32 api call to do this?
| Yes, you can prevent the host machine from entering standby mode while your application is running by using the Win32 API function `SetThreadExecutionState`. This function allows you to inform the operating system that your application is currently executing a task and that it should not enter sleep mode.
Here's a sim... | 14,444 | [
{
"from": "human",
"value": "How can i stop the host machine entering standby mode while my application is running?\nIs there any win32 api call to do this?\n"
},
{
"from": "gpt",
"value": "Yes, you can prevent the host machine from entering standby mode while your application is running by usin... |
Is it possible to modify the title of the message box the confirm() function opens in JavaScript?
I could create a modal popup box, but I would like to do this as minimalistic as possible.
I would like to do something like this:
confirm("This is the content of the message box", "Modified title");
The default title in... | The `confirm()` function in JavaScript does not allow you to modify the title of the message box it opens. The appearance and behavior of the native browser dialogs (including alert, confirm, and prompt) are controlled by the browser, and there are security and consistency reasons for this.
Because of these constraint... | 10,195 | [
{
"from": "human",
"value": "Is it possible to modify the title of the message box the confirm() function opens in JavaScript? \nI could create a modal popup box, but I would like to do this as minimalistic as possible.\nI would like to do something like this:\nconfirm(\"This is the content of the message b... |
On my current project, we've been using Struts 1 for the last few years, and ... ahem ... Struts is showing its age. We're slowly migrating our front-end code to an Ajax client that consumes XML from the servers. I'm wondering if any of you have migrated a legacy Struts application to a different framework, and what ch... | Migrating a legacy Struts 1 application to a more modern framework can be a complex task, but it can also offer significant improvements in performance, maintainability, and scalability. Here are some challenges you might face during the migration process, along with suggestions on how to address them:
### 1. **Unders... | 6,055 | [
{
"from": "human",
"value": "On my current project, we've been using Struts 1 for the last few years, and ... ahem ... Struts is showing its age. We're slowly migrating our front-end code to an Ajax client that consumes XML from the servers. I'm wondering if any of you have migrated a legacy Struts applicat... |
I've noticed that a handful of WCF applications choose to "break" their objects apart; that is, a project might have a DataObjects assembly that contains DataContracts/Members in addition to a meaningful class library that performs business logic.
Is this an unnecessary level of abstraction? Is there any inherent evil ... | Breaking objects apart into different assemblies, such as separating DataContracts from business logic in WCF applications, is a common practice that can have its benefits and drawbacks. Let's explore both aspects as well as how to handle errors in WCF services.
### Separation of DataContracts and Business Logic
####... | 3,655 | [
{
"from": "human",
"value": "I've noticed that a handful of WCF applications choose to \"break\" their objects apart; that is, a project might have a DataObjects assembly that contains DataContracts/Members in addition to a meaningful class library that performs business logic.\nIs this an unnecessary level... |
I have a Silverlight 2 application that is consuming a WCF service. As such, it uses asynchronous callbacks for all the calls to the methods of the service. If the service is not running, or it crashes, or the network goes down, etc before or during one of these calls, an exception is generated as you would expect. ... | In Silverlight, handling exceptions from asynchronous WCF service calls can indeed be a bit tricky due to the nature of the asynchronous pattern and how exceptions propagate. However, you can manage these scenarios effectively by using the error-handling capabilities built into the asynchronous pattern.
### Key Points... | 13,099 | [
{
"from": "human",
"value": "I have a Silverlight 2 application that is consuming a WCF service. As such, it uses asynchronous callbacks for all the calls to the methods of the service. If the service is not running, or it crashes, or the network goes down, etc before or during one of these calls, an exce... |
When I installed Windows Server 2008 I didn't have the (activation) key. Now that I have it I can't find where to enter it. Anybody know?
| To enter your Windows Server 2008 activation key, follow these steps:
1. **Open the Start Menu**: Click on the Start button at the bottom left of your screen.
2. **Access the System Properties**:
- Right-click on "Computer" and then select "Properties."
- Alternatively, you can press **Windows Key + Pause/Break... | 15,809 | [
{
"from": "human",
"value": "When I installed Windows Server 2008 I didn't have the (activation) key. Now that I have it I can't find where to enter it. Anybody know?\n"
},
{
"from": "gpt",
"value": "To enter your Windows Server 2008 activation key, follow these steps:\n\n1. **Open the Start Men... |
I'm building the world's simplest library application. All I want to be able to do is scan in a book's UPC (barcode) using a typical scanner (which just types the numbers of the barcode into a field) and then use it to look up data about the book... at a minimum, title, author, year published, and either the Dewey Deci... | Building a simple library application that uses a UPC barcode to look up book data is a great project! You can use a combination of existing APIs to accomplish this. Below, I’ll outline the steps to achieve this, along with some code snippets to get you started.
### Step 1: Choose an API
You can use the **Open Librar... | 7,219 | [
{
"from": "human",
"value": "I'm building the world's simplest library application. All I want to be able to do is scan in a book's UPC (barcode) using a typical scanner (which just types the numbers of the barcode into a field) and then use it to look up data about the book... at a minimum, title, author, ... |
I'm looking to run a Jabber server on a Windows 2003 server(web farm) and like some practical advice from anyone who has run a live environment with ~500 concurrent users.
Criteria for comment:
Performance
Capacity (ie ~number of concurrent users)
Stability
| Running a Jabber server (now more commonly known as XMPP server) on Windows Server 2003 can be a bit challenging, especially considering the age of the OS and its limited support. However, if you're set on this environment, here are some practical tips based on experience with live deployments for around 500 concurrent... | 11,659 | [
{
"from": "human",
"value": "I'm looking to run a Jabber server on a Windows 2003 server(web farm) and like some practical advice from anyone who has run a live environment with ~500 concurrent users.\nCriteria for comment:\n\nPerformance\nCapacity (ie ~number of concurrent users)\nStability\n\n"
},
{
... |
More and more mobile devices are consuming content on my eCommerce sites. IPhones, Blackberries, PSPs, Windows Mobile, etc and I need some ideas how to handle repurposing my data using CSS templates for these devices. Any ideas would be great.
| Absolutely! When it comes to optimizing your eCommerce site for a variety of mobile devices, leveraging responsive web design techniques and CSS is essential. Here are some strategies you can implement to repurpose your data effectively for mobile devices:
### 1. **Responsive Design:**
- **Media Queries:** Use CSS ... | 8,321 | [
{
"from": "human",
"value": "More and more mobile devices are consuming content on my eCommerce sites. IPhones, Blackberries, PSPs, Windows Mobile, etc and I need some ideas how to handle repurposing my data using CSS templates for these devices. Any ideas would be great. \n"
},
{
"from": "gpt",
... |
I am trying to display a live word count in the vim statusline. I do this by setting my status line in my .vimrc and inserting a function into it. The idea of this function is to return the number of words in the current buffer. This number is then displayed on the status line. This should work nicely as the statusline... | To create a fast word count function for displaying in the Vim statusline, we want to minimize the overhead and leverage Vim's built-in capabilities to avoid unnecessary processing. One efficient way to count words is to use the `getline()` function along with some clever string manipulation.
Here's a sample function ... | 10,734 | [
{
"from": "human",
"value": "I am trying to display a live word count in the vim statusline. I do this by setting my status line in my .vimrc and inserting a function into it. The idea of this function is to return the number of words in the current buffer. This number is then displayed on the status line. ... |
What do the clever programmers here do to keep track of handy programming tricks and useful information they pick up over their many years of experience? Things like useful compiler arguments, IDE short-cuts, clever code snippets, etc.
I sometimes find myself frustrated when looking up something that I used to know a y... | It's a common challenge for many programmers to keep track of useful information and tips accumulated over time. Here are several strategies that clever programmers often use to organize and retain valuable programming tricks and information:
1. **Personal Knowledge Management Systems (PKM):**
- Use tools like Noti... | 7,117 | [
{
"from": "human",
"value": "What do the clever programmers here do to keep track of handy programming tricks and useful information they pick up over their many years of experience? Things like useful compiler arguments, IDE short-cuts, clever code snippets, etc.\nI sometimes find myself frustrated when lo... |
What is the smartest way to design a math parser? What I mean is a function that takes a math string (like: "2 + 3 / 2 + (2 * 5)") and returns the calculated value?
| Designing a math parser to evaluate mathematical expressions from a string involves several steps, including tokenization, parsing, and evaluation. A common approach is to use the **Shunting Yard Algorithm** for parsing and constructing an Abstract Syntax Tree (AST) that represents the expression. Finally, we can evalu... | 11,359 | [
{
"from": "human",
"value": "What is the smartest way to design a math parser? What I mean is a function that takes a math string (like: \"2 + 3 / 2 + (2 * 5)\") and returns the calculated value?\n"
},
{
"from": "gpt",
"value": "Designing a math parser to evaluate mathematical expressions from a... |
I work with quite a bit of multi-platform C/C++ code, separated by common #defines (#if WIN, #if UNIX, etc). It would be nice if I could have vim automatically fold the sections I'm currently not interested in when I open a file. I've searched through the vim script archives, but I haven't found anything useful. Any... | Automatically folding sections of multi-platform C/C++ code based on `#define` directives in Vim can greatly enhance your workflow. Here’s a step-by-step approach to achieve this.
### Step 1: Set Up Vim for Folding
First, ensure that Vim is set to use syntax-based folding. You can do this by adding the following to y... | 9,673 | [
{
"from": "human",
"value": "I work with quite a bit of multi-platform C/C++ code, separated by common #defines (#if WIN, #if UNIX, etc). It would be nice if I could have vim automatically fold the sections I'm currently not interested in when I open a file. I've searched through the vim script archives, ... |
How many messages does the queue for a standard window hold? What happens when the queue overflows?
The documentation for GetMessage and relatives doesn't say anything about this, and PeekMessage only gives you a yes/no for certain classes of messages, not a message count.
This page says that the queues are implemented... | In the context of Windows messaging, a standard window message queue does not have a strict fixed limit on the number of messages it can hold. Instead, it can grow dynamically, limited primarily by the available system memory. This means that as long as there is enough memory, messages can be queued up without a specif... | 14,477 | [
{
"from": "human",
"value": "How many messages does the queue for a standard window hold? What happens when the queue overflows?\nThe documentation for GetMessage and relatives doesn't say anything about this, and PeekMessage only gives you a yes/no for certain classes of messages, not a message count.\nThi... |
Is there a SAPI module for PHP 5 for supporting the thttpd web server?
Oddly, the one included on PHP 5.2.6 source is for PHP 4.x.
Thanks,
Kenneth
| As of my last knowledge update in October 2023, PHP 5 does not have an officially supported SAPI (Server API) module for the thttpd web server. The SAPI module that comes with the PHP 5.2.6 source is indeed geared towards PHP 4.x, and PHP 5 generally does not maintain compatibility with PHP 4's SAPI modules.
If you sp... | 14,839 | [
{
"from": "human",
"value": "Is there a SAPI module for PHP 5 for supporting the thttpd web server?\nOddly, the one included on PHP 5.2.6 source is for PHP 4.x.\nThanks,\nKenneth\n"
},
{
"from": "gpt",
"value": "As of my last knowledge update in October 2023, PHP 5 does not have an officially su... |
I have a small app which references the Microsoft.SqlServer.Smo assembly (so I can display to the user a list of servers & databases to which they can connect).
My application originally referenced Microsoft.SqlServer.Smo and Microsoft.SqlServer.ConnectionInfo. Things worked as expected on my dev box.
When I installed ... | Yes, you are correct. When working with the Microsoft.SqlServer.Smo (SQL Server Management Objects) library, there are several dependent assemblies that may be required for your application to run successfully on machines where the SQL Server feature set is not installed.
Here's a breakdown of the assemblies you menti... | 12,400 | [
{
"from": "human",
"value": "I have a small app which references the Microsoft.SqlServer.Smo assembly (so I can display to the user a list of servers & databases to which they can connect).\nMy application originally referenced Microsoft.SqlServer.Smo and Microsoft.SqlServer.ConnectionInfo. Things worked as... |
I'd like to automatically generate database scripts on a regular basis. Is this possible.
| Yes, it is possible to automatically generate database scripts on a regular basis. This can be achieved using various methods, depending on your specific requirements, the type of database you are using, and the environment in which your database operates. Here are some common approaches:
### 1. **Database Backup Tool... | 10,021 | [
{
"from": "human",
"value": "I'd like to automatically generate database scripts on a regular basis. Is this possible.\n"
},
{
"from": "gpt",
"value": "Yes, it is possible to automatically generate database scripts on a regular basis. This can be achieved using various methods, depending on your... |
I know I once know how to do this but... how do you run a script (bash is OK) on login in unix?
| To run a script on login in a Unix-like system, you have several options depending on the shell you are using and the way you want to execute the script. Here are a few common methods for both interactive and non-interactive shells:
### For Bash Shell
1. **Using `.bash_profile` or `.bashrc`:**
- If you're using `b... | 9,086 | [
{
"from": "human",
"value": "I know I once know how to do this but... how do you run a script (bash is OK) on login in unix?\n"
},
{
"from": "gpt",
"value": "To run a script on login in a Unix-like system, you have several options depending on the shell you are using and the way you want to exec... |
When a class field is accessed via a getter method by multiple threads, how do you maintain thread safety? Is the synchronized keyword sufficient?
Is this safe:
public class SomeClass {
private int val;
public synchronized int getVal() {
return val;
}
private void setVal(int val) {
thi... | When you have a class with a getter method that is synchronized, as shown in your example, you are making sure that when one thread is executing the `getVal` method, no other thread can execute that method on the same instance of `SomeClass` at the same time. This provides thread safety for the `getVal` method.
Howeve... | 11,314 | [
{
"from": "human",
"value": "When a class field is accessed via a getter method by multiple threads, how do you maintain thread safety? Is the synchronized keyword sufficient?\nIs this safe:\npublic class SomeClass {\n private int val;\n\n public synchronized int getVal() {\n return val;\n }... |
I have been searching on the web for some example code on how we can write a custom ActiveX Control for use in Excel using .NET but so far I have found old articles suggesting that it is not supported.
The application we are building uses Excel as a report writer so we which to add some custom controls to the workshee... | Creating custom ActiveX controls for use in Excel via .NET is a complex and somewhat deprecated process. Historically, Microsoft had support for creating ActiveX controls with .NET, but this has become increasingly limited, particularly as Excel and the .NET framework have evolved.
As of the .NET Framework 2.0, the s... | 9,609 | [
{
"from": "human",
"value": "I have been searching on the web for some example code on how we can write a custom ActiveX Control for use in Excel using .NET but so far I have found old articles suggesting that it is not supported. \nThe application we are building uses Excel as a report writer so we which t... |
I need to communicate with an XML-RPC server from a .NET 2.0 client. Can you recommend any libraries?
EDIT: Having tried XML-RPC.Net, I like the way it generates dynamic proxies, it is very neat. Unfortunately, as always, things are not so simple. I am accessing an XML-RPC service which uses the unorthodox technique of... | If you're looking for a simple way to make XML-RPC calls in .NET 2.0 without the complexity of attributes and dynamic proxies, you might consider using the `CookComputing.XmlRpcV2` library. Here's how you can use it to achieve what you need:
1. **Download and Reference the Library**: First, you need to download the `C... | 11,479 | [
{
"from": "human",
"value": "I need to communicate with an XML-RPC server from a .NET 2.0 client. Can you recommend any libraries?\nEDIT: Having tried XML-RPC.Net, I like the way it generates dynamic proxies, it is very neat. Unfortunately, as always, things are not so simple. I am accessing an XML-RPC serv... |
How much of a performance hit will running everything over TLS do to my server? I would assume this is completely ignorable in this day and age? I heard once that servers today could encrypt gigabytes of data per second, is that true? And if so, is it linearly scalable so that if top speed is 10GB/second, encrypting 1G... | Running everything over TLS (Transport Layer Security) does introduce some overhead, but the performance impact is generally minimal in modern systems and is often considered negligible for most applications. Here are a few points to consider:
### Performance Impact
1. **CPU Overhead**: The primary performance hit fro... | 11,725 | [
{
"from": "human",
"value": "How much of a performance hit will running everything over TLS do to my server? I would assume this is completely ignorable in this day and age? I heard once that servers today could encrypt gigabytes of data per second, is that true? And if so, is it linearly scalable so that i... |
I wrote a script to export twitter friends as foaf rdf description. Now I'm looking for a tool to visualize the friend networks. I tried http://foafscape.berlios.de/ but for 300+ Nodes it is really slow and does a bad job on auto formatting.
Any hints for good graph visualization tools? It's ok if they do not support f... | It sounds like you're looking for robust tools for visualizing large friend networks with interactivity and the ability to use images for nodes. Here are some suggestions that align with your needs:
1. **Gephi**: This is a powerful open-source network visualization tool that can handle large datasets. It offers a vari... | 13,007 | [
{
"from": "human",
"value": "I wrote a script to export twitter friends as foaf rdf description. Now I'm looking for a tool to visualize the friend networks. I tried http://foafscape.berlios.de/ but for 300+ Nodes it is really slow and does a bad job on auto formatting.\nAny hints for good graph visualizati... |
I am looking for any good sources for geometric algorithms specifically;
The simple stuff like when two lines cross and so on is easy enough (and easy to find), but I would like to find somewhere with algorithms for the more tricky things, such as finding the shape formed by expanding a given polygon by some amount; f... | Certainly! Geometric algorithms can become quite complex, especially as you deal with curved shapes and advanced operations like polygon expansion. Here are some good sources you might find helpful:
### Books
1. **"Computational Geometry: Algorithms and Applications" by Mark de Berg, Otfried Cheong, Marc van Kreveld, ... | 11,205 | [
{
"from": "human",
"value": "I am looking for any good sources for geometric algorithms specifically; \nThe simple stuff like when two lines cross and so on is easy enough (and easy to find), but I would like to find somewhere with algorithms for the more tricky things, such as finding the shape formed by e... |
I have an ASP.NET 3.5 WebForm that leverages the frameworks Page.ClientScript.GetCallbackEventReference() method and I'd like some of the calls to be synchronous.
Now, the documentation says that the 5th parameter (see below) controls this. Specifically, when you pass 'false' it's supposed to be a non-asynchronous c... | In ASP.NET WebForms, the `Page.ClientScript.GetCallbackEventReference` method indeed generates JavaScript code for making a callback to the server. However, it's important to clarify the context of synchronous versus asynchronous calls within the WebForms paradigm and how it relates to the behavior of `GetCallbackEvent... | 13,375 | [
{
"from": "human",
"value": "I have an ASP.NET 3.5 WebForm that leverages the frameworks Page.ClientScript.GetCallbackEventReference() method and I'd like some of the calls to be synchronous. \nNow, the documentation says that the 5th parameter (see below) controls this. Specifically, when you pass 'false... |
The one-liner should:
solve a real-world problem
not be extensively cryptic (should be easy to understand and reproduce)
be worth the time it takes to write it (should not be too clever)
I'm looking for practical tips and tricks (complementary examples for perldoc perlrun).
| Here’s a simple one-liner using Perl that can help you clean up a text file by removing all blank lines. This is a common task when dealing with text data.
```bash
perl -i -ne 'print unless /^\s*$/' yourfile.txt
```
### Explanation:
- `perl`: Invokes the Perl interpreter.
- `-i`: Edits the file in-place.
- `-ne`: En... | 15,241 | [
{
"from": "human",
"value": "The one-liner should:\n\nsolve a real-world problem\nnot be extensively cryptic (should be easy to understand and reproduce)\nbe worth the time it takes to write it (should not be too clever)\n\nI'm looking for practical tips and tricks (complementary examples for perldoc perlru... |
I have a plug-in to an Eclipse RCP application that has a view. After an event occurs in the RCP application, the plug-in is instantiated, its methods are called to populate the plug-in's model, but I cannot find how to make the view appear without going to the "Show View..." menu.
I would think that there would be so... | In an Eclipse RCP application, you can programmatically show a view without relying on the "Show View..." menu. You can accomplish this by using the `IWorkbenchPage` interface, which allows you to manipulate views in the workbench. Here’s how you can do this:
1. **Get the Active Workbench Page**: You need to get a ref... | 15,222 | [
{
"from": "human",
"value": "I have a plug-in to an Eclipse RCP application that has a view. After an event occurs in the RCP application, the plug-in is instantiated, its methods are called to populate the plug-in's model, but I cannot find how to make the view appear without going to the \"Show View...\"... |
What are the naming conventions that you use while coding?
| Naming conventions are crucial for writing clean, maintainable, and understandable code. While specific conventions can vary by programming language and team standards, here are some general best practices that are widely accepted across many languages:
### 1. **Variable Names**
- **Descriptive**: Use meaningful names... | 10,417 | [
{
"from": "human",
"value": "What are the naming conventions that you use while coding?\n"
},
{
"from": "gpt",
"value": "Naming conventions are crucial for writing clean, maintainable, and understandable code. While specific conventions can vary by programming language and team standards, here a... |
If you had read my other question, you'll know I've spent this weekend putting together a 6502 CPU emulator as a programming exercise.
The CPU emulator is mostly complete, and seems to be fairly accurate from my limited testing, however it is running incredibly fast, and I want to throttle it down to the actual clock s... | To throttle your CPU emulator to run at a specific clock speed, you can implement a timing mechanism that introduces a delay between each executed instruction based on the targeted clock speed. Since the 6502 runs at approximately 1.79 MHz, this corresponds to a clock cycle duration of approximately 558 nanoseconds (1 ... | 9,813 | [
{
"from": "human",
"value": "If you had read my other question, you'll know I've spent this weekend putting together a 6502 CPU emulator as a programming exercise.\nThe CPU emulator is mostly complete, and seems to be fairly accurate from my limited testing, however it is running incredibly fast, and I want... |
Should I use a hand-written schema for my projected developed in a high-level language (such as Python, Ruby) or should I let my ORM solution auto-generate it?
Eventually I will need to migrate without destroying all the data. It's okay to be tied to a specific RDBMS but it would be nice if features such as constraints... | When deciding between a hand-written schema and allowing your ORM (Object-Relational Mapping) solution to auto-generate it, several factors should be taken into consideration, especially given your requirements regarding data migration and support for features like constraints and procedures.
### Hand-Written Schema
... | 9,918 | [
{
"from": "human",
"value": "Should I use a hand-written schema for my projected developed in a high-level language (such as Python, Ruby) or should I let my ORM solution auto-generate it?\nEventually I will need to migrate without destroying all the data. It's okay to be tied to a specific RDBMS but it wou... |
On the safari browser, the standard <asp:Menu> doesn't render well at all. How can this be fixed?
| Rendering issues with the `<asp:Menu>` control in Safari can occur due to various factors, including CSS styles, JavaScript compatibility, or even specific browser quirks. Here are some potential solutions to help you address the rendering issues:
1. **Update Styles and Scripts**: Ensure you are using the latest versi... | 11,123 | [
{
"from": "human",
"value": "On the safari browser, the standard <asp:Menu> doesn't render well at all. How can this be fixed?\n"
},
{
"from": "gpt",
"value": "Rendering issues with the `<asp:Menu>` control in Safari can occur due to various factors, including CSS styles, JavaScript compatibilit... |
RFC 1738 specifies the syntax for URL's, and mentions that
URLs are written only with the graphic
printable characters of the
US-ASCII coded character set. The
octets 80-FF hexadecimal are not
used in US-ASCII, and the octets 00-1F
and 7F hexadecimal represent
control characters; these must be
encoded.
... | You're correct that the original specifications, including RFC 1738 and RFC 2396, did not define a standard mechanism for character encoding in URIs that include non-ASCII characters. The situation has improved somewhat with more recent specifications, but ambiguity still exists.
### Current Best Practices
1. **UTF-8... | 12,868 | [
{
"from": "human",
"value": "RFC 1738 specifies the syntax for URL's, and mentions that\n\nURLs are written only with the graphic\n printable characters of the\n US-ASCII coded character set. The\n octets 80-FF hexadecimal are not\n used in US-ASCII, and the octets 00-1F\n and 7F hexadecimal represent\... |
I'm confused about what the various testing appliances in Ruby on Rails are for. I have been using the framework for about 6 months but I've never understood the testing part of it. The only testing I've used is JUnit3 in Java and that only briefly.
Everything I've read about it just shows testing validations. Shouldn'... | Your concerns about testing in Ruby on Rails (or any software development environment) are quite common, especially for developers transitioning from a less test-focused environment like Java with JUnit. Let’s unpack the various aspects of testing in Rails and address your concerns:
### 1. **Understanding the Purpose ... | 11,327 | [
{
"from": "human",
"value": "I'm confused about what the various testing appliances in Ruby on Rails are for. I have been using the framework for about 6 months but I've never understood the testing part of it. The only testing I've used is JUnit3 in Java and that only briefly.\nEverything I've read about i... |
OpenID is all good... UNTIL the provider goes down. At that point you're potentially locked out of EVERYTHING (since you jumped on the bandwagon and applied OpenID everywhere you could).
This question came up because I can't, for the life of me, login with my myopenid.com provider. :-(
| You're right that using an OpenID provider can present a significant risk if that provider experiences downtime or goes out of business. Here are some strategies to mitigate the risks associated with relying solely on OpenID:
1. **Use Multiple Providers**: Instead of relying on a single OpenID provider, consider setti... | 13,331 | [
{
"from": "human",
"value": "OpenID is all good... UNTIL the provider goes down. At that point you're potentially locked out of EVERYTHING (since you jumped on the bandwagon and applied OpenID everywhere you could).\nThis question came up because I can't, for the life of me, login with my myopenid.com prov... |
A basic problem I run into quite often, but ever found a clean solution to, is one where you want to code behaviour for interaction between different objects of a common base class or interface. To make it a bit concrete, I'll throw in an example;
Bob has been coding on a strategy game which supports "cool geographical... | You’re encountering a classic problem in software design, often referred to as the **Visitor Pattern** or the **Double Dispatch** problem, where you want to decouple the interactions between two sets of objects—in your case, units and terrain types—without introducing extensive conditional logic that becomes cumbersome... | 9,477 | [
{
"from": "human",
"value": "A basic problem I run into quite often, but ever found a clean solution to, is one where you want to code behaviour for interaction between different objects of a common base class or interface. To make it a bit concrete, I'll throw in an example;\nBob has been coding on a strat... |
I just upgraded a VS 2005 project to VS 2008 and was examining the changes. I noticed one of the .Designer.cs files had changed significantly. The majority of the changes were simply replacements of System with global::System. For example,
protected override System.Data.DataTable CreateInstance()
became
protected ov... | The changes you observed in the .Designer.cs files, specifically the replacement of `System` with `global::System`, are related to the way that the C# language resolves namespaces. This change is typically introduced to avoid naming conflicts and clarify the scope of the types being referenced.
### Explanation of the ... | 14,621 | [
{
"from": "human",
"value": "I just upgraded a VS 2005 project to VS 2008 and was examining the changes. I noticed one of the .Designer.cs files had changed significantly. The majority of the changes were simply replacements of System with global::System. For example,\nprotected override System.Data.DataT... |
Microsoft WPF? Adobe AIR/Flex? Adobe Flash? Curl programming language?
How does AJAX fit in?
Given a server written in C++ .NET.
| Let’s break down the technologies you've mentioned and see how AJAX fits into the mix, especially with a C++ .NET server.
### Microsoft WPF (Windows Presentation Foundation)
WPF is a UI framework for building desktop applications on Windows. It provides a rich user interface with support for data binding, templates, a... | 12,212 | [
{
"from": "human",
"value": "Microsoft WPF? Adobe AIR/Flex? Adobe Flash? Curl programming language?\nHow does AJAX fit in?\nGiven a server written in C++ .NET.\n"
},
{
"from": "gpt",
"value": "Let’s break down the technologies you've mentioned and see how AJAX fits into the mix, especially with ... |
We have been looking at g++ versions 3.2.3 and 4.2.4. With 4.2.4, the performance improvements on some of our code base is significant.
I've tried searching the gcc buzilla database to find hints as to what bugs may have had such a dramatic improvement but I didn't find any individual bug that stood out as being a can... | The performance improvements you observed when upgrading from g++ 3.2.3 to g++ 4.2.4 are likely a result of several factors, rather than a single major change. The GCC (GNU Compiler Collection) has undergone significant enhancements between these versions, and many small optimizations and improvements can add up to sub... | 12,525 | [
{
"from": "human",
"value": "We have been looking at g++ versions 3.2.3 and 4.2.4. With 4.2.4, the performance improvements on some of our code base is significant.\nI've tried searching the gcc buzilla database to find hints as to what bugs may have had such a dramatic improvement but I didn't find any in... |
Is there a way to bind a MemoryStream to asp:image control?
| The `asp:image` control (which is an ASP.NET Web Forms control) typically requires a URL for the `ImageUrl` property, which means it can't directly bind to a `MemoryStream`. However, you can achieve this by creating a temporary file or converting the `MemoryStream` to a base64 string and setting that as the `ImageUrl`.... | 12,428 | [
{
"from": "human",
"value": "Is there a way to bind a MemoryStream to asp:image control?\n"
},
{
"from": "gpt",
"value": "The `asp:image` control (which is an ASP.NET Web Forms control) typically requires a URL for the `ImageUrl` property, which means it can't directly bind to a `MemoryStream`. ... |
I am planning on creating a small website for my personal book collection. To automate the process a little bit, I would like to create the following functionality:
The website will ask me for the ISBN number of the book and will then automatically fetch the title and add it to my database.
Although I am mainly interes... | Creating a website to manage your personal book collection is a great project! To automate the process of fetching book titles using their ISBN numbers, you can follow these steps. Below, I'll provide a language-agnostic overview, followed by PHP-specific and Java-specific implementations.
### Language-Agnostic Approa... | 6,889 | [
{
"from": "human",
"value": "I am planning on creating a small website for my personal book collection. To automate the process a little bit, I would like to create the following functionality:\nThe website will ask me for the ISBN number of the book and will then automatically fetch the title and add it to... |
I'd like to be able to create a large (say 20,000 x 20,000) pixel bitmap in a C++ MFC application, using a CDC derived class to write to the bitmap. I've tried using memory DCs as described in the MSDN docs, but these appear to be restricted to sizes compatible with the current display driver.
I'm currently using a bi... | Creating a large bitmap (like 20,000 x 20,000 pixels) in a C++ MFC application can indeed be challenging due to GDI limitations and potential performance issues. Since you're looking for a way to draw directly to a bitmap without the overhead of spooling or metafiles, you have a couple of options to consider:
### 1. U... | 11,480 | [
{
"from": "human",
"value": "I'd like to be able to create a large (say 20,000 x 20,000) pixel bitmap in a C++ MFC application, using a CDC derived class to write to the bitmap. I've tried using memory DCs as described in the MSDN docs, but these appear to be restricted to sizes compatible with the current... |
I need some software to explore and modify some SQLite databases. Does anything similar to SQL Server Management Studio or MySQLAdmin exist for it?
| Yes, there are several software tools available that can help you explore and modify SQLite databases, similar to SQL Server Management Studio or phpMyAdmin for MySQL. Here are some popular options:
1. **DB Browser for SQLite**:
- A high-quality, open-source tool that provides a user-friendly interface for creating... | 13,544 | [
{
"from": "human",
"value": "I need some software to explore and modify some SQLite databases. Does anything similar to SQL Server Management Studio or MySQLAdmin exist for it?\n"
},
{
"from": "gpt",
"value": "Yes, there are several software tools available that can help you explore and modify ... |
Hy, I'm developing a Grails app which has to communicate with an existing Java EE application (built with EJB2).
Both the "legacy" app and the new Grails app will offer services and consume them.
For intercompatibility reasons, I'm thinking of communicating using WebServices. Now I'm wondering which frameworks I should... | Using web services for communication between your Grails app and your existing Java EE (EJB2) application is a solid choice, especially given the potential interoperability requirements.
### Recommendations
#### Java EE Application (EJB2 Side)
1. **JAX-WS**: Since you're using JDK 5 and EJB 2, you can indeed utilize... | 11,906 | [
{
"from": "human",
"value": "Hy, I'm developing a Grails app which has to communicate with an existing Java EE application (built with EJB2).\nBoth the \"legacy\" app and the new Grails app will offer services and consume them.\nFor intercompatibility reasons, I'm thinking of communicating using WebServices... |
I need to generate thumbnails from a set of jpg's that need to have a small white border so that they appear to be "photos" when displayed on a map. Getting the thumbnails themselves is easy but I can't figure out how to get the border.
| You can easily add a border to your thumbnails using Python's PIL (Pillow) library. Here's a step-by-step guide to help you generate thumbnails with a small white border around them:
1. **Install the Pillow library** (if you haven't already):
```bash
pip install Pillow
```
2. **Use the following Python scri... | 13,006 | [
{
"from": "human",
"value": "I need to generate thumbnails from a set of jpg's that need to have a small white border so that they appear to be \"photos\" when displayed on a map. Getting the thumbnails themselves is easy but I can't figure out how to get the border.\n"
},
{
"from": "gpt",
"valu... |
When I try to execute a view that includes tables from different schemas an ORA-001031 Insufficient privileges is thrown. These tables have execute permission for the schema where the view was created. If I execute the view's SQL Statement it works. What am I missing?
| The `ORA-01031: insufficient privileges` error typically indicates that the current user does not have the necessary privileges to execute an operation, even if the individual SQL statements work when executed directly. This is especially common when dealing with views that access objects from different schemas.
Here ... | 13,439 | [
{
"from": "human",
"value": "When I try to execute a view that includes tables from different schemas an ORA-001031 Insufficient privileges is thrown. These tables have execute permission for the schema where the view was created. If I execute the view's SQL Statement it works. What am I missing?\n"
},... |
I'm playing with ASP.NET MVC for the last few days and was able to build a small site. Everything works great.
Now, I need to pass the page's META tags (title, description, keywords, etc.) via the ViewData. (i'm using a master page).
How you're dealing with this? Thank you in advance.
| Passing META tags like title, description, and keywords through `ViewData` in an ASP.NET MVC application is a common approach when you are using a master page (or a layout page). You can achieve this by setting these values in your controller actions and then rendering them in your layout page.
Here's a step-by-step g... | 12,116 | [
{
"from": "human",
"value": "I'm playing with ASP.NET MVC for the last few days and was able to build a small site. Everything works great. \nNow, I need to pass the page's META tags (title, description, keywords, etc.) via the ViewData. (i'm using a master page).\nHow you're dealing with this? Thank you in... |
In an attempt to add some parameter validation and correct usage semantics to our application, we are trying to add correct exception handling to our .NET applications.
My question is this: When throwing exceptions in ADO.NET if a particular query returns no data or the data could not be found, what type of exception s... | In ADO.NET, when you're working with data retrieval operations, it's important to use the correct exception types to enhance clarity and maintainability in your application. Your pseudocode suggests that you're throwing a general `Exception` when no data is found. While this is valid, it's generally better practice to ... | 11,633 | [
{
"from": "human",
"value": "In an attempt to add some parameter validation and correct usage semantics to our application, we are trying to add correct exception handling to our .NET applications.\nMy question is this: When throwing exceptions in ADO.NET if a particular query returns no data or the data co... |
There are several plugin options for building a search engine into your Ruby on Rails application. Which of these is the best?
Thinking Sphinx
UltraSphinx
Sphincter
acts_as_sphinx
acts_as_ferret
Ferret
acts_as_xapian
acts_as_solr
Hyper Estraier
| The best plugin option for building a search engine into your Ruby on Rails application depends on your specific use case, requirements, and preferences. Here's a brief overview of some of the options you listed:
1. **Thinking Sphinx**: This is one of the most popular choices for integrating Sphinx search into Rails a... | 9,488 | [
{
"from": "human",
"value": "There are several plugin options for building a search engine into your Ruby on Rails application. Which of these is the best?\n\nThinking Sphinx\nUltraSphinx\nSphincter\nacts_as_sphinx\nacts_as_ferret\nFerret\nacts_as_xapian\nacts_as_solr\nHyper Estraier\n\n"
},
{
"fro... |
I have migrated a couple of project from Subversion to git. It work really well but when I clone my repository, it's really long because I have all the history of a lot of .jar file included in the transfer.
Is there a way to keep only the latest version of certain type of file in my main repository. I mainly want to d... | When migrating from Subversion to Git, it's common to end up with large binary files, like `.jar` files, cluttering your history. If you want to reduce the size of your repository by keeping only the latest version of certain types of files while removing all previous versions from the Git history, you can use a combin... | 9,892 | [
{
"from": "human",
"value": "I have migrated a couple of project from Subversion to git. It work really well but when I clone my repository, it's really long because I have all the history of a lot of .jar file included in the transfer.\nIs there a way to keep only the latest version of certain type of file... |
When using IF statements in Python, you have to do the following to make the "cascade" work correctly.
if job == "mechanic" or job == "tech":
print "awesome"
elif job == "tool" or job == "rock":
print "dolt"
Is there a way to make Python accept multiple values when checking for "equals to"? For example... | Yes, there is a more concise way to check if a variable is equal to multiple values in Python using the `in` keyword. This allows you to use a list or a tuple to hold the possible values you want to check against. Here’s how you can simplify your `if` statement using `in`:
```python
if job in ("mechanic", "tech"):
... | 15,583 | [
{
"from": "human",
"value": "When using IF statements in Python, you have to do the following to make the \"cascade\" work correctly.\nif job == \"mechanic\" or job == \"tech\":\n print \"awesome\"\nelif job == \"tool\" or job == \"rock\":\n print \"dolt\"\n\nIs there a way to make Python acce... |
The situation:
I want to play around with IRC bots as general communications interfaces to other code I am investigating. The server hardware would be old and low-memory, but running on a relatively up-to-date Debian GNU/Linux install. I don't expect more than a hundred users at a time, tops, and probably in the sing... | When choosing an IRC server for your scenario, especially with constraints like low hardware resources and a desire for simplicity, it's important to consider the ease of setup, resource usage, and maintenance. Here’s a brief overview of the top contenders you mentioned, with an emphasis on their characteristics releva... | 12,095 | [
{
"from": "human",
"value": "The situation:\nI want to play around with IRC bots as general communications interfaces to other code I am investigating. The server hardware would be old and low-memory, but running on a relatively up-to-date Debian GNU/Linux install. I don't expect more than a hundred users... |
There is a well-known debate in Java (and other communities, I'm sure) whether or not trivial getter/setter methods should be tested. Usually, this is with respect to code coverage. Let's agree that this is an open debate, and not try to answer it here.
There have been several blog posts on using Java reflection to au... | As of my last knowledge update in October 2023, JUnit itself does not provide a built-in feature or annotation that directly supports auto-testing all getters and setters in a class via reflection. However, the idea of testing getters and setters automatically is indeed valuable and can be implemented with some custom ... | 9,751 | [
{
"from": "human",
"value": "There is a well-known debate in Java (and other communities, I'm sure) whether or not trivial getter/setter methods should be tested. Usually, this is with respect to code coverage. Let's agree that this is an open debate, and not try to answer it here.\nThere have been several... |
I use AutoHotKey for Windows macros. Most commonly I use it to define hotkeys that start/focus particular apps, and one to send an instant email message into my ToDo list. I also have an emergency one that kills all of my big memory-hogging apps (Outlook, Firefox, etc).
So, does anyone have any good AHK macros to sha... | Absolutely! AutoHotKey (AHK) is incredibly versatile and can streamline many tasks. Here are a few useful AHK scripts that you might find helpful:
### 1. Open Applications with Hotkeys
You can define hotkeys to quickly open your frequently used applications.
```ahk
; Open Notepad
^n:: ; Ctrl + N
Run, notepad.exe
... | 11,461 | [
{
"from": "human",
"value": "I use AutoHotKey for Windows macros. Most commonly I use it to define hotkeys that start/focus particular apps, and one to send an instant email message into my ToDo list. I also have an emergency one that kills all of my big memory-hogging apps (Outlook, Firefox, etc).\nSo, d... |
I would like to write an Emacs major mode for a 4GL.
Can someone show me a tutorial?
As far as I googled I was able to find only this broken:
link http://two-wugs.net/emacs/mode-tutorial.html
| Creating a custom major mode in Emacs for a 4GL (Fourth Generation Language) can be a rewarding task, allowing you to define syntax highlighting, indentation, and other editing behaviors specific to that language. Here’s a simplified tutorial to help you get started with creating an Emacs major mode.
### Step 1: Basic... | 10,532 | [
{
"from": "human",
"value": "I would like to write an Emacs major mode for a 4GL.\nCan someone show me a tutorial?\nAs far as I googled I was able to find only this broken:\nlink http://two-wugs.net/emacs/mode-tutorial.html\n"
},
{
"from": "gpt",
"value": "Creating a custom major mode in Emacs f... |
I'm trying to change the background color of a single subplot in a MATLAB figure.
It's clearly feasible since the UI allows it, but I cannot find the function to automate it.
I've looked into whitebg, but it changes the color scheme of the whole figure, not just the current subplot.
(I'm using MATLAB Version 6.1 by th... | In MATLAB, you can change the background color of a specific subplot using the `set` function to modify the properties of that subplot's axes. Even in older versions like MATLAB 6.1, you can achieve this by accessing the axes properties directly.
Here's a simple way to change the background color of a specific subplot... | 13,478 | [
{
"from": "human",
"value": "I'm trying to change the background color of a single subplot in a MATLAB figure.\nIt's clearly feasible since the UI allows it, but I cannot find the function to automate it.\nI've looked into whitebg, but it changes the color scheme of the whole figure, not just the current su... |
Could anyone recommend to me a good online guide to PowerPoint VBA? Also, does anyone has advice on how to record a macro in PowerPoint?
| Certainly! Here are some recommendations for online guides to PowerPoint VBA:
### Online Guides:
1. **Microsoft Official Documentation**: The official Microsoft documentation provides a comprehensive overview of VBA in PowerPoint. You can find information on the object model, how to write code, and examples.
- [Pow... | 9,939 | [
{
"from": "human",
"value": "Could anyone recommend to me a good online guide to PowerPoint VBA? Also, does anyone has advice on how to record a macro in PowerPoint? \n"
},
{
"from": "gpt",
"value": "Certainly! Here are some recommendations for online guides to PowerPoint VBA:\n\n### Online Guid... |
In our project we have a standard auto-generated designer.cs file, linked to a DBML file, that contains all our object classes that map onto our database tables.
We want to pass these objects directly through a WCF Service and so they need decorating with the [DataContract] and [DataMember] attributes where appropriate... | To address the issue of decorating the auto-generated classes in the `designer.cs` file with `[DataContract]` and `[DataMember]` attributes, while also avoiding the risk of losing your changes when the file is regenerated, you can take the following approach:
### 1. Use Partial Classes
You can indeed use partial class... | 9,907 | [
{
"from": "human",
"value": "In our project we have a standard auto-generated designer.cs file, linked to a DBML file, that contains all our object classes that map onto our database tables.\nWe want to pass these objects directly through a WCF Service and so they need decorating with the [DataContract] and... |
I've typed around 75wpm for the last few years but I've always wondered how people type +100wpm.
I've searched but I primarily find typing tutors that teach you to type.. not teach you to type faster. So far the only tip I've come across is to learn dvorak.
Are there exercises or tips to help break through the 75wpm ... | Reaching and exceeding 100 words per minute (wpm) is definitely achievable with practice and the right techniques. Here are some tips and exercises to help you improve your typing speed:
1. **Proper Technique**: Ensure you’re using the correct finger placement and posture. Your fingers should rest lightly on the home ... | 9,807 | [
{
"from": "human",
"value": "I've typed around 75wpm for the last few years but I've always wondered how people type +100wpm. \nI've searched but I primarily find typing tutors that teach you to type.. not teach you to type faster. So far the only tip I've come across is to learn dvorak. \nAre there exercis... |
I want to get started on HMM's, but don't know how to go about it. Can people here, give me some basic pointers, where to look?
More than just the theory, I like to do a lot of hands-on. So, would prefer resources, where I can write small code snippets to check my learning, rather than just dry text.
| Hidden Markov Models (HMMs) are a fascinating topic in machine learning and statistics, and it's great that you're looking for hands-on resources to learn about them! Here are some pointers to get you started:
### 1. **Basic Understanding and Theory**
- **Online Courses**: Consider taking online courses that cover ... | 8,747 | [
{
"from": "human",
"value": "I want to get started on HMM's, but don't know how to go about it. Can people here, give me some basic pointers, where to look?\nMore than just the theory, I like to do a lot of hands-on. So, would prefer resources, where I can write small code snippets to check my learning, rat... |
I need to convert a value which is in a DateTime variable into a varchar variable formatted as yyyy-mm-dd format (without time part).
How do I do that?
| To convert a `DateTime` variable to a `varchar` in the `yyyy-mm-dd` format, you can use the `FORMAT` function (if you are using SQL Server 2012 or later) or the `CONVERT` function. Here are examples for both methods:
### Using the FORMAT function (SQL Server 2012+):
```sql
DECLARE @dateTimeValue DATETIME = GETDATE();... | 13,605 | [
{
"from": "human",
"value": "I need to convert a value which is in a DateTime variable into a varchar variable formatted as yyyy-mm-dd format (without time part).\nHow do I do that?\n"
},
{
"from": "gpt",
"value": "To convert a `DateTime` variable to a `varchar` in the `yyyy-mm-dd` format, you c... |
For a project I built a custom DataGridView column which contains NumericUpDown controls. It is implemented similar to the suggestion from Microsoft
The column works fine under Windows XP. It accepts the entered digits and decimal separator.
Under Windows Vista I have the odd problem that the control only accepts the d... | It's great to hear that you found a solution to the issue with your custom `DataGridView` column containing `NumericUpDown` controls! Your troubleshooting process demonstrates a solid understanding of how to work with custom controls in Windows Forms.
For those who might encounter a similar issue, let me summarize the... | 13,199 | [
{
"from": "human",
"value": "For a project I built a custom DataGridView column which contains NumericUpDown controls. It is implemented similar to the suggestion from Microsoft\nThe column works fine under Windows XP. It accepts the entered digits and decimal separator.\nUnder Windows Vista I have the odd ... |
UI Virtualization is an awkward terminology that describes WPF UI controls that load and and dispose child elements on demand (based on their visibility) to reduce memory footprint. ListBox and ListView use a class called VirtualizingStackPanel by default to achieve higher performance.
I found this control, which is r... | Yes, UI virtualization is an important technique for optimizing performance in applications with large data sets or complex UIs. Here are several resources, guides, and examples of WPF controls and techniques that deal with UI virtualization, along with a few examples from other languages and toolkits.
### WPF Control... | 10,889 | [
{
"from": "human",
"value": "UI Virtualization is an awkward terminology that describes WPF UI controls that load and and dispose child elements on demand (based on their visibility) to reduce memory footprint. ListBox and ListView use a class called VirtualizingStackPanel by default to achieve higher perfo... |
I am writing a program which has two panes (via CSplitter), however I am having problems figuring out out to resize the controls in each frame. For simplicity, can someone tell me how I would do it for a basic frame with a single CEdit control?
I'm fairly sure it is to do with the CEdit::OnSize() function... But I'm n... | To resize controls like a `CEdit` control within a `CSplitter` in an MFC (Microsoft Foundation Classes) application, you can indeed use the `OnSize` function. This function is called when the window is resized, allowing you to adjust the size of your controls accordingly. Here's how you can implement it for a simple fr... | 10,550 | [
{
"from": "human",
"value": "I am writing a program which has two panes (via CSplitter), however I am having problems figuring out out to resize the controls in each frame. For simplicity, can someone tell me how I would do it for a basic frame with a single CEdit control? \nI'm fairly sure it is to do with... |
I'm trying to do the following in infopath: I have to choose between 2 options (with bullets), and depending on this, if we choose Option1, I need to display a text field to enter more details, but if Option2 is chosen, I don't need this additional field.
I'm not sure about how to enter a Rule to define this :-(
Anyone... | Sure! You can achieve this functionality in InfoPath by using rules to control the visibility of the text field based on the option selected. Here’s a step-by-step guide on how to set this up:
### Step 1: Create Your Choices
1. **Open your InfoPath form** and go to the section where you want to add the choice options... | 12,039 | [
{
"from": "human",
"value": "I'm trying to do the following in infopath: I have to choose between 2 options (with bullets), and depending on this, if we choose Option1, I need to display a text field to enter more details, but if Option2 is chosen, I don't need this additional field.\nI'm not sure about how... |
I am looking for a Dataflow / Concurrent Programming API for Java.
I know there's DataRush, but it's not free. What I'm interested in specifically is multicore data processing, and not distributed, which rules out MapReduce or Hadoop.
Any thoughts?
Thanks,
Rollo
| Hi Rollo,
If you're looking for a Java API for concurrent or dataflow programming that is focused on multicore data processing and is free, there are several options you might consider:
1. **Java Streams API**: Since Java 8, the Java Streams API allows you to process sequences of elements in a functional style. The S... | 14,120 | [
{
"from": "human",
"value": "I am looking for a Dataflow / Concurrent Programming API for Java.\nI know there's DataRush, but it's not free. What I'm interested in specifically is multicore data processing, and not distributed, which rules out MapReduce or Hadoop.\nAny thoughts?\nThanks,\nRollo\n"
},
{
... |
I want to attach an xslt stylesheet to an XML document that I build with XMLBuilder. This is done with a Processing Instruction that looks like
<?xml-stylesheet type='text/xsl' href='/stylesheets/style.xslt' ?>
Normally, I'd use the instruct! method, but :xml-stylesheet is not a valid Ruby symbol.
XMLBuilder has a so... | In XMLBuilder, while there is indeed a method `tag!` for creating elements with non-standard names, there is no direct equivalent for adding processing instructions. However, you can use a slightly different approach by using the `instruct!` method, but since `:xml-stylesheet` is not a valid Ruby symbol, you can pass t... | 15,130 | [
{
"from": "human",
"value": "I want to attach an xslt stylesheet to an XML document that I build with XMLBuilder. This is done with a Processing Instruction that looks like\n<?xml-stylesheet type='text/xsl' href='/stylesheets/style.xslt' ?>\n\nNormally, I'd use the instruct! method, but :xml-stylesheet is ... |
Can anyone recommend good simulation software for mobile devices? I am most interested in Nokia smart phones.
| For simulating mobile devices, particularly Nokia smartphones, there are a few options you can consider:
1. **Nokia Simulator (Nokia Developer Tools)**: Nokia used to provide an SDK with an emulator for its Series 40 and Series 60 platforms. While these are less relevant for modern smartphones, if you're working with ... | 13,076 | [
{
"from": "human",
"value": "Can anyone recommend good simulation software for mobile devices? I am most interested in Nokia smart phones.\n"
},
{
"from": "gpt",
"value": "For simulating mobile devices, particularly Nokia smartphones, there are a few options you can consider:\n\n1. **Nokia Simu... |
How much traffic can one web server handle? What's the best way to see if we're beyond that?
I have an ASP.Net application that has a couple hundred users. Aspects of it are fairly processor intensive, but thus far we have done fine with only one server to run both SqlServer and the site. It's running Windows Server 20... | To determine how much traffic your web server can handle and whether you are experiencing performance issues due to server overload or application inefficiencies, you should consider the following steps:
### 1. **Monitor Server Performance:**
Use built-in performance monitoring tools in Windows Server to track the fol... | 9,227 | [
{
"from": "human",
"value": "How much traffic can one web server handle? What's the best way to see if we're beyond that?\nI have an ASP.Net application that has a couple hundred users. Aspects of it are fairly processor intensive, but thus far we have done fine with only one server to run both SqlServer an... |
I want to create some text in a canvas:
myText = self.canvas.create_text(5, 5, anchor=NW, text="TEST")
Now how do I find the width and height of myText?
| In a Tkinter canvas, you can use the `bbox()` method to get the bounding box of the text that you've created. The `bbox()` method returns a tuple containing the coordinates of the bounding box for the specified item. These coordinates are in the form `(x1, y1, x2, y2)`, where `(x1, y1)` is the top-left corner and `(x2,... | 15,463 | [
{
"from": "human",
"value": "I want to create some text in a canvas:\nmyText = self.canvas.create_text(5, 5, anchor=NW, text=\"TEST\")\n\nNow how do I find the width and height of myText?\n"
},
{
"from": "gpt",
"value": "In a Tkinter canvas, you can use the `bbox()` method to get the bounding bo... |
Will Subclipse 1.4.4 work safely with Subversion 1.3.2?
I am confused because its changelog says
NOTE: As of Subclipse 1.3.0, the minimum Subversion JavaHL requirement is 1.5.0.
| Subclipse 1.4.4 is indeed designed to work with Subversion JavaHL 1.5.0 and above. This means that if you are using Subversion 1.3.2, it is not recommended to use Subclipse 1.4.4, as there may be compatibility issues due to the differences in the underlying libraries and APIs.
The changelog note you mentioned indicate... | 16,102 | [
{
"from": "human",
"value": "Will Subclipse 1.4.4 work safely with Subversion 1.3.2?\nI am confused because its changelog says\n\nNOTE: As of Subclipse 1.3.0, the minimum Subversion JavaHL requirement is 1.5.0.\n\n"
},
{
"from": "gpt",
"value": "Subclipse 1.4.4 is indeed designed to work with Su... |
I've been creating snapins with the new MMC 3.0 classes and C#. I can't seem to find any examples of how to get rid of the "Console Root" node when creating the *.msc files. I looked through the examples in the SDK, but I can't seem to find anything for this.
I have seen other snapins that do what I want, but I can't t... | To remove the "Console Root" node in a Microsoft Management Console (MMC) snap-in using the MMC 3.0 classes in C#, you need to manipulate the root node's properties in your implementation of the `ISnapin` interface. Specifically, you will want to customize the root node's behavior so that it does not appear as a separa... | 11,857 | [
{
"from": "human",
"value": "I've been creating snapins with the new MMC 3.0 classes and C#. I can't seem to find any examples of how to get rid of the \"Console Root\" node when creating the *.msc files. I looked through the examples in the SDK, but I can't seem to find anything for this.\nI have seen othe... |
Running VS2003/05 under Vista makes the former screw up the display at least 50% of the time - you start debugging, VS kicks in and you see the windows/docking panes screwed up, not refreshing, etc... I've contacted Microsoft about this, but they weren't much help, I was wondering if someone knows any fixes?
I'm runnin... | Running Visual Studio 2003/2005 on Windows Vista can indeed present several compatibility issues due to the significant differences between the operating systems. Here are some steps you can try to help mitigate the display issues you're experiencing:
1. **Run as Administrator**: Right-click on the Visual Studio execu... | 11,132 | [
{
"from": "human",
"value": "Running VS2003/05 under Vista makes the former screw up the display at least 50% of the time - you start debugging, VS kicks in and you see the windows/docking panes screwed up, not refreshing, etc... I've contacted Microsoft about this, but they weren't much help, I was wonderi... |
Is there a way to collect (e.g. in a List) multiple 'generic' objects that don't share a common super class? If so, how can I access their common properties?
For example:
class MyObject<T>
{
public T Value { get; set; }
public string Name { get; set; }
public MyObject(string name, T value)
{
Name = n... | In C#, if you want to collect multiple objects that don't share a common base class but have common properties (like `Name` in your example), you can define an interface that specifies the common properties or methods. Then, you can implement this interface in your `MyObject<T>` class.
Here's how you can do it:
1. De... | 12,652 | [
{
"from": "human",
"value": "Is there a way to collect (e.g. in a List) multiple 'generic' objects that don't share a common super class? If so, how can I access their common properties?\nFor example:\nclass MyObject<T>\n{\n public T Value { get; set; }\n public string Name { get; set; }\n\n public My... |
I've set up DAV in apache2, which works great. The thing is, all read/write operations are done with the apache user's credentials. Instead I want to use the HTTP authenticated user's credentials. If I authenticate as "john", all read and write operations should use the system user john's credentials (from /etc/pas... | To allow Apache to use the HTTP authenticated user's credentials for read and write operations on a WebDAV server, you'll need to configure Apache to authenticate users and use their system user credentials for file operations. This is typically done using the `mod_dav` and `mod_auth_basic` modules, along with a method... | 9,490 | [
{
"from": "human",
"value": "I've set up DAV in apache2, which works great. The thing is, all read/write operations are done with the apache user's credentials. Instead I want to use the HTTP authenticated user's credentials. If I authenticate as \"john\", all read and write operations should use the sy... |
I am wondering, what goes into the creation of a GUID. I don't mean what is used to create a GUID in a specific language (NewID() in SQL Server, Guid.NewGuid() in C#), I mean when you call those methods/functions, what do they do to make the GUID?
| A GUID (Globally Unique Identifier), also known as a UUID (Universally Unique Identifier), is a 128-bit number used to uniquely identify information in computer systems. The creation of a GUID involves certain algorithms and standards defined by the RFC 4122 specification. Here’s a breakdown of the common methods used ... | 6,967 | [
{
"from": "human",
"value": "I am wondering, what goes into the creation of a GUID. I don't mean what is used to create a GUID in a specific language (NewID() in SQL Server, Guid.NewGuid() in C#), I mean when you call those methods/functions, what do they do to make the GUID?\n"
},
{
"from": "gpt",
... |
I'm trying to stream binary data to the standard output in .NET. However you can only write char using the Console class. I want to use it with redirection. Is there a way to do this?
| In .NET, when using the `Console` class, you're right that it is primarily designed for character-based output. However, if you want to write binary data to the standard output (for example, to redirect it to a file or another process), you can use the `Console.OpenStandardOutput` method to get a `Stream` that you can ... | 11,157 | [
{
"from": "human",
"value": "I'm trying to stream binary data to the standard output in .NET. However you can only write char using the Console class. I want to use it with redirection. Is there a way to do this?\n"
},
{
"from": "gpt",
"value": "In .NET, when using the `Console` class, you're ri... |
What is the web interface tool that Debian or Ubuntu use for publicizing their custom repositories on the web?
Like packages.debian.org
Is such tool open sourced, so that it could be re-used for a custom repository?
| The web interface tool used by Debian and Ubuntu to publicize their package repositories is called **Reprepro**. It is a tool to manage a Debian repository and generate the necessary metadata for a custom repository. However, the web interface you see, such as `packages.debian.org`, is actually built on top of a few di... | 14,340 | [
{
"from": "human",
"value": "What is the web interface tool that Debian or Ubuntu use for publicizing their custom repositories on the web?\nLike packages.debian.org\nIs such tool open sourced, so that it could be re-used for a custom repository?\n"
},
{
"from": "gpt",
"value": "The web interfac... |
I am using informix database, I want a query which you could also generate a row number along with the query
Like
select row_number(),firstName,lastName
from students;
row_number() firstName lastName
1 john mathew
2 ricky pointing
3 sachin tendulkar
Here firstName, lastNa... | In Informix, you can generate a row number for your query results using the `ROW_NUMBER()` function, but it needs to be used within a `SELECT` statement in conjunction with an `OVER()` clause. Here’s how you can write your query to include a row number along with the first name and last name from the `students` table:
... | 13,812 | [
{
"from": "human",
"value": "I am using informix database, I want a query which you could also generate a row number along with the query\nLike\nselect row_number(),firstName,lastName \nfrom students;\n\nrow_number() firstName lastName\n1 john mathew\n2 ricky pointing\n3 ... |
Is there a Delphi equivalent of the C# #if(DEBUG) compiler directive?
| Yes, Delphi has a similar mechanism for conditional compilation, which you can use to include or exclude code based on certain conditions. In Delphi, you can use the `{$IFDEF}` directive to achieve functionality similar to C#'s `#if(DEBUG)`.
Here's how you can use it in Delphi:
1. You define a conditional symbol at t... | 14,582 | [
{
"from": "human",
"value": "Is there a Delphi equivalent of the C# #if(DEBUG) compiler directive?\n"
},
{
"from": "gpt",
"value": "Yes, Delphi has a similar mechanism for conditional compilation, which you can use to include or exclude code based on certain conditions. In Delphi, you can use th... |
How can I consistently get the absolute, fully-qualified root or base url of the site regardless of whether the site is in a virtual directory and regardless of where my code is in the directory structure? I've tried every variable and function I can think of and haven't found a good way.
I want to be able to get the u... | To obtain the absolute, fully-qualified root or base URL of your site regardless of whether it's hosted in a virtual directory, you can construct the URL using the `Request` object in ASP.NET. The goal is to combine the scheme (HTTP or HTTPS), the host (domain), and the application path, if any. Here’s how to do that:
... | 14,132 | [
{
"from": "human",
"value": "How can I consistently get the absolute, fully-qualified root or base url of the site regardless of whether the site is in a virtual directory and regardless of where my code is in the directory structure? I've tried every variable and function I can think of and haven't found a... |
Using the Windows API, how can I get a list of domains on my network?
| To get a list of domains on your network using the Windows API, you can utilize a combination of Windows functions such as `NetDomainEnum` from the Netapi32 library, or you might choose to use Active Directory services if your network is Active Directory-integrated.
### Using Netapi32 Library
The `NetDomainEnum` func... | 5,567 | [
{
"from": "human",
"value": "Using the Windows API, how can I get a list of domains on my network?\n"
},
{
"from": "gpt",
"value": "To get a list of domains on your network using the Windows API, you can utilize a combination of Windows functions such as `NetDomainEnum` from the Netapi32 library... |
This might be an interesting question. I need to test that if I can successfully upload and fetch the PDF file. This works for the text based files but I just wanted to check for PDF. For this unit test to run I need a PDF file. There are couple of options. I can create a dummy PDF file and store it some folder and rea... | When it comes to unit testing and ensuring that tests can run independently of external resources, it's generally best to avoid dependencies on external files. Here are the options you mentioned, along with recommendations based on common best practices:
1. **Creating a Dummy PDF File Manually**: This approach does al... | 13,586 | [
{
"from": "human",
"value": "This might be an interesting question. I need to test that if I can successfully upload and fetch the PDF file. This works for the text based files but I just wanted to check for PDF. For this unit test to run I need a PDF file. There are couple of options. I can create a dummy ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.