instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I know you can use PowerShell to make things like the registry a drive letter. There are other objects in PowerShell to treat other objects in this way. Does anyone know of any cmdlets to access IIS logs in this manner?
| In PowerShell, while you can't natively treat IIS logs as a drive letter in the same way you can with the registry or file system, you can use PowerShell cmdlets and some functionalities to access and manipulate IIS logs efficiently.
### Accessing IIS Logs
IIS logs are typically stored in text files in a directory (c... | 9,701 | [
{
"from": "human",
"value": "I know you can use PowerShell to make things like the registry a drive letter. There are other objects in PowerShell to treat other objects in this way. Does anyone know of any cmdlets to access IIS logs in this manner?\n"
},
{
"from": "gpt",
"value": "In PowerShell,... |
I'd like to create a hotkey to search for files under a specific folder in Windows XP; I'm using AutoHotkey to create this shortcut.
Problem is that I need to know a command-line statement to run in order to open the standard Windows "Find Files/Folders" dialog. I've googled for a while and haven't found any page indic... | In Windows XP, you can open the "Find Files/Folders" dialog using the command `explorer` with specific parameters. While it doesn't have a direct command-line switch that exactly replicates the dialog as you see it, you can open a search for a specific folder using a URL format.
Here’s how you can do it:
1. You can o... | 9,044 | [
{
"from": "human",
"value": "I'd like to create a hotkey to search for files under a specific folder in Windows XP; I'm using AutoHotkey to create this shortcut.\nProblem is that I need to know a command-line statement to run in order to open the standard Windows \"Find Files/Folders\" dialog. I've googled ... |
Is it possible to do like this:
interface IDBBase {
DataTable getDataTableSql(DataTable curTable,IDbCommand cmd);
...
}
class DBBase : IDBBase {
public DataTable getDataTableSql(DataTable curTable, SqlCommand cmd) {
...
}
}
I want to use the interface to implement to d/t providers (MS-SQL... | Your intention to create an interface for database operations that can be implemented for multiple database providers (like MS SQL and Oracle) is valid. However, the way you're trying to implement generics and interfaces has some issues that we can address.
### Interface and Implementation
1. **Generics in Interfaces... | 8,993 | [
{
"from": "human",
"value": "Is it possible to do like this:\ninterface IDBBase {\n DataTable getDataTableSql(DataTable curTable,IDbCommand cmd);\n ...\n}\n\nclass DBBase : IDBBase {\n public DataTable getDataTableSql(DataTable curTable, SqlCommand cmd) {\n ...\n }\n}\n\nI want to us... |
I'm looking for a way to change the hostname and IP address of a Windows XP system that is mounted via a loop-back image on a Linux system. So basically I have access to the Windows XP system on a file level, but I cannot execute any programs on it. A way similar to editing the /etc/hostname and whatever network config... | Changing the hostname and IP address of a Windows XP system that is mounted as a loop-back image on a Linux system can be done by directly modifying the relevant files and registry settings in the Windows XP filesystem. Since you cannot boot or execute programs on the Windows XP instance, you'll need to manually edit s... | 8,816 | [
{
"from": "human",
"value": "I'm looking for a way to change the hostname and IP address of a Windows XP system that is mounted via a loop-back image on a Linux system. So basically I have access to the Windows XP system on a file level, but I cannot execute any programs on it. A way similar to editing the ... |
How can I specify the filename when dumping data into the response stream?
Right now I'm doing the following:
byte[] data= GetFoo();
Response.Clear();
Response.Buffer = true;
Response.ContentType = "application/pdf";
Response.BinaryWrite(data);
Response.End();
With the code above, I get "foo.aspx.pdf" as t... | To specify a custom filename for the file being downloaded in an HTTP response, you can set the `Content-Disposition` header in your response. This header allows you to define how the file should be handled by the browser, including providing a filename for the saved file.
You can modify your code as follows:
```csha... | 12,904 | [
{
"from": "human",
"value": "How can I specify the filename when dumping data into the response stream?\nRight now I'm doing the following:\nbyte[] data= GetFoo();\nResponse.Clear();\nResponse.Buffer = true;\nResponse.ContentType = \"application/pdf\"; \nResponse.BinaryWrite(data);\nResponse.End(... |
I'd like to display 100 floating cubes using DirectX or OpenGL.
I'm looking for either some sample source code, or a description of the technique. I have trouble getting more one cube to display correctly.
I've combed the net for a good series of tutorials and although they talk about how to do 3D primitives, what I c... | Displaying multiple 3D primitives like floating cubes in OpenGL or DirectX requires an understanding of how to efficiently manage and render these objects. Below, I will outline a general approach and provide sample code snippets in both OpenGL and DirectX, focusing on the concept of instancing and transformation for m... | 3,435 | [
{
"from": "human",
"value": "I'd like to display 100 floating cubes using DirectX or OpenGL.\nI'm looking for either some sample source code, or a description of the technique. I have trouble getting more one cube to display correctly.\nI've combed the net for a good series of tutorials and although they t... |
I have noticed that setting row height in DataGridView control is slow. Is there a way to make it faster?
| Setting the row height in a `DataGridView` control can indeed be slow, especially when you're working with a large number of rows. Here are several strategies you can employ to improve performance:
1. **Suspend Layout**: Before making bulk updates to your `DataGridView`, you can suspend the layout of the control. This... | 8,636 | [
{
"from": "human",
"value": "I have noticed that setting row height in DataGridView control is slow. Is there a way to make it faster?\n"
},
{
"from": "gpt",
"value": "Setting the row height in a `DataGridView` control can indeed be slow, especially when you're working with a large number of row... |
I really like DevX components, but they are pretty expensive, maybe anyone knows free equivalents ? or web site where I can look for some kind of free visual component for .NET
| If you're looking for free alternatives to DevExpress components for .NET, there are several open-source libraries and tools that you can consider. Here are some popular options:
1. **WinForms & WPF:**
- **Material Design In XAML Toolkit**: A toolkit that brings Material Design principles to WPF applications.
... | 5,226 | [
{
"from": "human",
"value": "I really like DevX components, but they are pretty expensive, maybe anyone knows free equivalents ? or web site where I can look for some kind of free visual component for .NET\n"
},
{
"from": "gpt",
"value": "If you're looking for free alternatives to DevExpress com... |
Using c#, VS2005, and .NET 2.0. (XP 32 bit) This is a Winforms app that gets called by a VBA addin (.xla) via Interop libraries. This app has been around for a while and works fine when the assembly is compiled and executed anywhere other than my dev machine. On dev it crashes hard (in debugger and just running the ob... | Given the scenario you described, it seems likely that the issue could be environmental, particularly since the code works on other machines but crashes on your development machine. Below are a few troubleshooting steps and considerations that may help you identify the cause of the crashes:
### 1. **Check for COM Regi... | 8,185 | [
{
"from": "human",
"value": "Using c#, VS2005, and .NET 2.0. (XP 32 bit) This is a Winforms app that gets called by a VBA addin (.xla) via Interop libraries. This app has been around for a while and works fine when the assembly is compiled and executed anywhere other than my dev machine. On dev it crashes ... |
C#: What is a good Regex to parse hyperlinks and their description?
Please consider case insensitivity, white-space and use of single quotes (instead of double quotes) around the HREF tag.
Please also consider obtaining hyperlinks which have other tags within the <a> tags such as <b> and <i>.
... | To create a regex pattern that can effectively parse hyperlinks (`<a>` tags) with descriptions while considering your requirements (case insensitivity, single quotes, whitespace, and nested tags), we can craft a regex pattern as follows.
Here's a regex pattern that should work for your needs:
```csharp
using System;
... | 4,131 | [
{
"from": "human",
"value": "C#: What is a good Regex to parse hyperlinks and their description?\nPlease consider case insensitivity, white-space and use of single quotes (instead of double quotes) around the HREF tag.\nPlease also consider obtaining hyperlinks which have other tags within the <a> tags such... |
I'm trying to use “rusage” statistics in my program to get data similar to that of the time tool. However, I'm pretty sure that I'm doing something wrong. The values seem about right but can be a bit weird at times. I didn't find good resources online. Does somebody know how to do it better?
Sorry for the long code.
cl... | Your `StopWatch` class implementation using `getrusage` to obtain resource usage statistics is mostly on the right track. However, there are a few potential issues and improvements you might want to consider:
1. **Incorrect `timeval` Division in Formatting**: The `format_time` function is incorrectly modifying the mic... | 5,309 | [
{
"from": "human",
"value": "I'm trying to use “rusage” statistics in my program to get data similar to that of the time tool. However, I'm pretty sure that I'm doing something wrong. The values seem about right but can be a bit weird at times. I didn't find good resources online. Does somebody know how to ... |
I'm porting a C++ 32 bit application to 64 bit on windows. The application is a client of IBM WebSphere MQ. It uses the MQ client API.
Now, as the port progresses, I'm trying to find a 64 bit client. So far, no luck.
Does anyone here happen to know if where I can find one or confirm that there isn't one?
| To use IBM WebSphere MQ (now called IBM MQ) in a 64-bit application on Windows, you will indeed need the appropriate 64-bit client libraries. IBM provides a 64-bit version of the MQ client, but it might not be included in the standard installation or package you initially downloaded.
Here are the steps you can take to... | 10,254 | [
{
"from": "human",
"value": "I'm porting a C++ 32 bit application to 64 bit on windows. The application is a client of IBM WebSphere MQ. It uses the MQ client API.\nNow, as the port progresses, I'm trying to find a 64 bit client. So far, no luck.\nDoes anyone here happen to know if where I can find one or c... |
I'd like to use a different icon for the demo version of my game, and I'm building the demo with a different build config than I do for the full verison, using a preprocessor define to lockout some content, use different graphics, etc. Is there a way that I can make Visual Studio use a different icon for the app Icon ... | Yes, you can use Visual Studio to set up different application icons for different build configurations (such as a demo version and a full version of your game). Here's how you can do that:
### Step-by-Step Guide
1. **Create Two Icon Files:**
- Create an icon file for the full version (e.g., `app_full.ico`).
- ... | 7,494 | [
{
"from": "human",
"value": "I'd like to use a different icon for the demo version of my game, and I'm building the demo with a different build config than I do for the full verison, using a preprocessor define to lockout some content, use different graphics, etc. Is there a way that I can make Visual Stud... |
Is there a version of memset() which sets a value that is larger than 1 byte (char)? For example, let's say we have a memset32() function, so using it we can do the following:
int32_t array[10];
memset32(array, 0xDEADBEEF, sizeof(array));
This will set the value 0xDEADBEEF in all the elements of array. Currently it se... | C does not provide a built-in function like `memset()` that can set values larger than one byte. However, you can create a custom function that operates similarly to `memset()` but for larger data types, such as `int32_t`, `int64_t`, etc.
Here's how you can create a `memset32()` and `memset64()` function to set values... | 10,112 | [
{
"from": "human",
"value": "Is there a version of memset() which sets a value that is larger than 1 byte (char)? For example, let's say we have a memset32() function, so using it we can do the following:\nint32_t array[10];\nmemset32(array, 0xDEADBEEF, sizeof(array));\n\nThis will set the value 0xDEADBEEF ... |
My C# program has a list of files that can be dragged from it and dropped into another program. My requirements are that the file be copied to a different directory first.
So, can I be notified of the drop operation so that I can only copy the file if operation succeeds? I'd rather wait till I know it needs to be copie... | To achieve your requirements of handling drag-and-drop operations and notifying the user before copying the file, you'll have to manage a few things with Windows Drag-and-Drop API. Below is a simplified explanation and a sample implementation using C# that will meet your needs.
### Steps to Implement Drag-and-Drop wit... | 3,142 | [
{
"from": "human",
"value": "My C# program has a list of files that can be dragged from it and dropped into another program. My requirements are that the file be copied to a different directory first.\nSo, can I be notified of the drop operation so that I can only copy the file if operation succeeds? I'd ra... |
I have a question about using streams in .NET to load files from disk. I am trying to pinpoint a performance problem and want to be sure it's where I think it is.
Dim provider1 As New MD5CryptoServiceProvider
Dim stream1 As FileStream
stream1 = New FileStream(FileName, FileMode.Open, FileAccess.Read, FileShare.Read)
... | In the code you provided, the bytes are read from the disk when the `ComputeHash` method of the `MD5CryptoServiceProvider` is invoked. The `FileStream` object itself is created when you call `New FileStream(...)`, but at that point, it does not read any data from the disk. It simply opens a handle to the file, establis... | 10,629 | [
{
"from": "human",
"value": "I have a question about using streams in .NET to load files from disk. I am trying to pinpoint a performance problem and want to be sure it's where I think it is.\nDim provider1 As New MD5CryptoServiceProvider\nDim stream1 As FileStream\n\nstream1 = New FileStream(FileName, Fil... |
I am trying to merge a directory in subversion, but I get the following error when I do so:
svn: Working copy '[directory name]' not locked'
I tried deleting the working directory and doing a fresh update, but that did not solve the issue. I also did a cleanup on the directory.
Does anyone know how to fix this?
In th... | The error message `svn: Working copy '[directory name]' not locked` typically indicates that Subversion believes there are issues with locks in your working copy, possibly due to an incomplete operation or some corruption in the metadata.
Here are some steps you can take to resolve this issue:
1. **Cleanup the Workin... | 9,067 | [
{
"from": "human",
"value": "I am trying to merge a directory in subversion, but I get the following error when I do so:\nsvn: Working copy '[directory name]' not locked'\n\nI tried deleting the working directory and doing a fresh update, but that did not solve the issue. I also did a cleanup on the directo... |
My DataView is acting funny and it is sorting things alphabetically and I need it to sort things numerically. I have looked all across the web for this one and found many ideas on how to sort it with ICompare, but nothing really solid.
So my questions are
How do I implement ICompare on a DataView (Looking for code h... | To achieve natural sorting for your DataView, especially when dealing with columns that are represented as strings (including numbers with commas), you can implement the `IComparer` interface to customize the sorting behavior.
Here's a step-by-step implementation, including how to create a custom comparer for your Dat... | 5,969 | [
{
"from": "human",
"value": "My DataView is acting funny and it is sorting things alphabetically and I need it to sort things numerically. I have looked all across the web for this one and found many ideas on how to sort it with ICompare, but nothing really solid.\nSo my questions are \n\nHow do I implemen... |
I am creating a Windows Service in C# that processes messages from a queue. I want to give ops the flexibility of partitioning the service in production according to properties of the message. For example, they should be able to say that one instance processes web orders from Customer A, another batch orders from Custo... | Your current approach of using separate queues for each customer/source combination can certainly work, but it does become difficult to manage as the number of customers or sources grows. If you are looking for a more scalable and flexible approach, you might consider a few alternative solutions. Here are some ideas yo... | 6,321 | [
{
"from": "human",
"value": "I am creating a Windows Service in C# that processes messages from a queue. I want to give ops the flexibility of partitioning the service in production according to properties of the message. For example, they should be able to say that one instance processes web orders from Cu... |
Is it possible to change a Sharepoint 2007 Site Theme through a Web Service? I know it can be done through the Object Model with (i think) SPWeb.ApplyTheme, but I did not see anything in the available Web Services, apart from CustomizeCss in Webs.asmx, which does not seem to be exactly what I need.
| In SharePoint 2007, while the object model provides methods like `SPWeb.ApplyTheme` to change the site theme directly, the available web services are somewhat limited in this regard. You are correct that the `Webs.asmx` web service offers the `CustomizeCss` method, but this method allows for customization of CSS rather... | 10,911 | [
{
"from": "human",
"value": "Is it possible to change a Sharepoint 2007 Site Theme through a Web Service? I know it can be done through the Object Model with (i think) SPWeb.ApplyTheme, but I did not see anything in the available Web Services, apart from CustomizeCss in Webs.asmx, which does not seem to be ... |
I've got a standard Rails app with Nginx and Mongrel running at http://mydomain. I need to run a Wordpress blog at http://mydomain.com/blog. My preference would be to host the blog in Apache running on either the same server or a separate box but I don't want the user to see a different server in the URL. Is that pos... | Yes, it is definitely possible to run a WordPress blog at `http://mydomain.com/blog` while keeping your Rails app running on the same domain using Nginx and Mongrel, or you can do this by proxying requests to an Apache server. Here are a few methods to achieve this:
### Method 1: Reverse Proxy with Nginx
Since you’re... | 5,685 | [
{
"from": "human",
"value": "I've got a standard Rails app with Nginx and Mongrel running at http://mydomain. I need to run a Wordpress blog at http://mydomain.com/blog. My preference would be to host the blog in Apache running on either the same server or a separate box but I don't want the user to see a... |
Are there any tools available for calculating the average number of lines of code per method?
I want to know the average size of each method, not just the total number of lines in the project. The per method count will allow me to measure how simple each method is.
This will be calculated as part of the build process, ... | Calculating the average number of lines of code per method is a useful metric for assessing code complexity and maintainability. Here are some tools and approaches that you can use to achieve this as part of your build process and display it on a dashboard:
### Static Analysis Tools
1. **SonarQube**:
- SonarQube i... | 9,776 | [
{
"from": "human",
"value": "Are there any tools available for calculating the average number of lines of code per method?\nI want to know the average size of each method, not just the total number of lines in the project. The per method count will allow me to measure how simple each method is.\nThis will b... |
I have two threads, one updating an int and one reading it. This is a statistic value where the order of the reads and writes is irrelevant.
My question is, do I need to synchronize access to this multi-byte value anyway? Or, put another way, can part of the write be complete and get interrupted, and then the read hap... | When dealing with multi-byte values such as an `int` in a multi-threaded context, synchronization is a crucial consideration. The concern you raised is valid: without proper synchronization, it is possible for one thread's write operation to be interrupted, leading to a read operation by another thread seeing a partial... | 8,570 | [
{
"from": "human",
"value": "I have two threads, one updating an int and one reading it. This is a statistic value where the order of the reads and writes is irrelevant.\nMy question is, do I need to synchronize access to this multi-byte value anyway? Or, put another way, can part of the write be complete ... |
Should I keep project filesm like Eclipse's .project, .classpath, .settings, under version control (e.g. Subversion, GitHub, CVS, Mercurial, etc)?
| When managing project files in version control systems like Git, Subversion, or others, it's important to decide which files to include based on their role in your project. Specifically for Eclipse projects, the files you mentioned—`.project`, `.classpath`, and `.settings`—have specific purposes:
1. **`.project`**: Th... | 9,915 | [
{
"from": "human",
"value": "Should I keep project filesm like Eclipse's .project, .classpath, .settings, under version control (e.g. Subversion, GitHub, CVS, Mercurial, etc)?\n"
},
{
"from": "gpt",
"value": "When managing project files in version control systems like Git, Subversion, or others,... |
We have a suite of interlinked .Net 3.5 applications. Some are web sites, some are web services, and some are windows applications. Each app currently has its own configuration file (app.config or web.config), and currently there are some duplicate keys across the config files (which at the moment are kept in sync manu... | To manage the configuration of multiple .NET applications efficiently while allowing for shared configuration values and environment-specific settings, you can consider implementing a centralized configuration management approach. Below are several strategies you can adopt to achieve this:
### 1. **Centralized Configu... | 9,371 | [
{
"from": "human",
"value": "We have a suite of interlinked .Net 3.5 applications. Some are web sites, some are web services, and some are windows applications. Each app currently has its own configuration file (app.config or web.config), and currently there are some duplicate keys across the config files (... |
Hi i need to generate 9 digit unique account numbers. Here is my pseudocode:
function generateAccNo()
generate an account number between 100,000,000 and 999,999,999
if the account number already exists in the DB
call generateAccNo() /* recursive call */
else
return new accout number
... | Using a recursive approach for generating a unique 9-digit account number can work, but it does have some potential drawbacks, especially regarding memory usage and the risk of hitting maximum recursion limits.
### Concerns with Recursion:
1. **Stack Overflow**: If a significant number of account numbers already exist... | 11,394 | [
{
"from": "human",
"value": "Hi i need to generate 9 digit unique account numbers. Here is my pseudocode:\nfunction generateAccNo()\n\n generate an account number between 100,000,000 and 999,999,999\n\n if the account number already exists in the DB \n call generateAccNo() /* recursive call ... |
I've had some discussions recently at work about switching from Subversion to a DVCS like bazaar, and I would like to get other people's opinion.
I've managed to crystallize my reluctance to do so into a simple parallel.
Version Control can be used well or badly.
The 'light side' of version control is when you use i... | Your analysis of the pros and cons of version control systems, particularly the distinction between Subversion and distributed version control systems (DVCS) like Bazaar, is quite insightful. Your concern about ensuring that developers use the new DVCS effectively, staying on the "light side," is valid. Transitioning t... | 9,033 | [
{
"from": "human",
"value": "I've had some discussions recently at work about switching from Subversion to a DVCS like bazaar, and I would like to get other people's opinion.\nI've managed to crystallize my reluctance to do so into a simple parallel.\n\nVersion Control can be used well or badly. \n\nThe 'li... |
Does anyone know why in Oracle 11g when you do a Count(1) with more than one natural join it does a cartesian join and throws the count way off?
Such as
SELECT Count(1) FROM record NATURAL join address NATURAL join person WHERE status=1
AND code = 1 AND state = 'TN'
This pulls back like 3 million rows when
SELECT * F... | The behavior you're observing with the `NATURAL JOIN` and the unexpected results with `COUNT(1)` in Oracle 11g can be attributed to how `NATURAL JOIN` operates. A `NATURAL JOIN` combines rows from two or more tables based on all columns that have the same name. If your tables have multiple columns with the same name, i... | 8,044 | [
{
"from": "human",
"value": "Does anyone know why in Oracle 11g when you do a Count(1) with more than one natural join it does a cartesian join and throws the count way off?\nSuch as \nSELECT Count(1) FROM record NATURAL join address NATURAL join person WHERE status=1\nAND code = 1 AND state = 'TN'\n\nThis ... |
I already have an entity model in a separate dll that contains various objects that I need to use. I don't really want to create or duplicate entities using the EF designer. Instead I would like to configure it so that when I call a stored procedure it will map certain columns to specific properties.
I know you can do ... | To achieve the goal of mapping the results of a stored procedure directly to your entity model, including mapping certain columns to complex types, you can utilize Entity Framework (EF) with a combination of manual mapping and `Dapper` or a combination of raw SQL with Entity Framework.
Here's an approach to consider:
... | 5,963 | [
{
"from": "human",
"value": "I already have an entity model in a separate dll that contains various objects that I need to use. I don't really want to create or duplicate entities using the EF designer. Instead I would like to configure it so that when I call a stored procedure it will map certain columns t... |
Is it possible to launch a new window in JavaScript using the window.Open function, then set the focus to that tab?
Here's what I'm doing today:
var winRef = window.open(outUrl,wName,'left='+ wX +',top=' + wY + ',height=' + wH + ',width=' + wW + args);
try {
// Not all window t... | Yes, using `window.open()` in JavaScript will allow you to open a new window or tab, and subsequently, you can attempt to set focus to that window/tab with `focus()`. However, there are several factors that influence whether the new window or tab will actually receive focus:
1. **User Interaction**: Most modern web br... | 8,103 | [
{
"from": "human",
"value": "Is it possible to launch a new window in JavaScript using the window.Open function, then set the focus to that tab?\nHere's what I'm doing today:\n\n\n var winRef = window.open(outUrl,wName,'left='+ wX +',top=' + wY + ',height=' + wH + ',width=' + wW + args);\n ... |
I was going to Ask a Question earlier today when I was presented to a surprising functionality in Stackoverflow. When I wrote my question title stackoverflow suggested me several related questions and I found out that there was already two similar questions. That was stunning!
Then I started thinking how I would imple... | The functionality you're describing for suggesting related questions on Stack Overflow is indeed quite sophisticated, and while it can be implemented with relatively simple techniques, there are more complex algorithms and methodologies that can improve accuracy and relevancy significantly.
### Implementation Workflow... | 4,102 | [
{
"from": "human",
"value": "I was going to Ask a Question earlier today when I was presented to a surprising functionality in Stackoverflow. When I wrote my question title stackoverflow suggested me several related questions and I found out that there was already two similar questions. That was stunning! \... |
How to implement a web page that scales when the browser window is resized?
I can lay out the elements of the page using either a table or CSS float sections, but i want the display to rescale when the browser window is resized
i have a working solution using AJAX PRO and DIVs with overflow:auto and an onwindowresize h... | To create a web page that scales when the browser window is resized, it's best to use a responsive design approach that relies on CSS rather than AJAX and JavaScript, which can become cumbersome. Here’s a step-by-step guide on how to achieve a fluid, liquid layout using CSS Flexbox or Grid, which automatically adjusts ... | 6,591 | [
{
"from": "human",
"value": "How to implement a web page that scales when the browser window is resized?\nI can lay out the elements of the page using either a table or CSS float sections, but i want the display to rescale when the browser window is resized\ni have a working solution using AJAX PRO and DIVs... |
I found an example in the VS2008 Examples for Dynamic LINQ that allows you to use a SQL-like string (e.g. OrderBy("Name, Age DESC")) for ordering. Unfortunately, the method included only works on IQueryable<T>. Is there any way to get this functionality on IEnumerable<T>?
| Yes, you can achieve similar functionality for `IEnumerable<T>` by implementing your own version of dynamic ordering using reflection and expression trees. While `IQueryable<T>` supports dynamic LINQ queries directly using the `OrderBy` method, you'll need to create an extension method for `IEnumerable<T>` that allows ... | 6,198 | [
{
"from": "human",
"value": "I found an example in the VS2008 Examples for Dynamic LINQ that allows you to use a SQL-like string (e.g. OrderBy(\"Name, Age DESC\")) for ordering. Unfortunately, the method included only works on IQueryable<T>. Is there any way to get this functionality on IEnumerable<T>?\n"
... |
I got pretty big webflow definition, which I do not want to copy/paste for reusing. There are references to action bean in XML, which is kind natural.
I want to use same flow definiton twice: second time with actions configured differently (inject different implementation of service to it).
Is there easy way to do thi... | To reuse a Webflow definition with different service implementations without resorting to copying and pasting, you can leverage the following strategies:
1. **Spring Profiles**: If your application is using Spring, consider using Spring profiles to conditionally load different beans based on the active profile. You ca... | 10,245 | [
{
"from": "human",
"value": "I got pretty big webflow definition, which I do not want to copy/paste for reusing. There are references to action bean in XML, which is kind natural.\nI want to use same flow definiton twice: second time with actions configured differently (inject different implementation of se... |
I have a usercontrol that has several public properties. These properties automatically show up in the properties window of the VS2005 designer under the "Misc" category. Except two of the properties which are enumerations don't show up correctly.
The first on uses the following enum:
public enum VerticalControlAlign... | The issues you are experiencing with your user control properties in Visual Studio 2005's designer can usually be resolved with a couple of modifications. Below are some steps you can take to ensure that your enumeration properties show up correctly in the properties window:
### 1. Ensure Public Access
Make sure your... | 6,262 | [
{
"from": "human",
"value": "I have a usercontrol that has several public properties. These properties automatically show up in the properties window of the VS2005 designer under the \"Misc\" category. Except two of the properties which are enumerations don't show up correctly.\nThe first on uses the foll... |
How do I take a set of polygons which contain arbitrary values and create a corresponding bitmap where each pixel contains the value of the polygon at that location?
To put the question into context, my polygons contain information about the average number of people per square kilometre within the polygon. I need to cr... | To create a raster bitmap from a set of non-overlapping polygons where each pixel represents the value associated with the polygon, you can follow these steps:
### Steps to Create the Raster Bitmap:
1. **Define the Raster Grid**:
- Determine the spatial extent of the area that contains your polygons. This will def... | 6,344 | [
{
"from": "human",
"value": "How do I take a set of polygons which contain arbitrary values and create a corresponding bitmap where each pixel contains the value of the polygon at that location?\nTo put the question into context, my polygons contain information about the average number of people per square ... |
GNU/Linux text console, X11 not involved, indeed not even
installed. Keyboard is US layout, keymap US default. Kernel
version 2.20.x or later.
An application written in C is getting keyboard input in
translation mode, i.e. XLATE or UNICODE. When a key is
pressed, the application receives the corresponding
keystring. As... | In a typical GNU/Linux text console environment, when an application is running in translation mode, it doesn't have direct access to raw scancodes. However, you can retrieve scancodes by using the terminal's event or key press signals, depending on your setup. Here's a conceptual approach using `ioctl` and `termios` t... | 8,969 | [
{
"from": "human",
"value": "GNU/Linux text console, X11 not involved, indeed not even\ninstalled. Keyboard is US layout, keymap US default. Kernel\nversion 2.20.x or later.\nAn application written in C is getting keyboard input in\ntranslation mode, i.e. XLATE or UNICODE. When a key is\npressed, the applic... |
Is there a tool that allows one to monitor GDI calls?
| Yes, there are several tools available that can help you monitor GDI (Graphics Device Interface) calls in Windows applications. Some popular options include:
1. **Microsoft Spy++**: This is a tool that comes with Visual Studio and can be used to monitor window messages and GDI calls. You can track windows, processes, ... | 10,912 | [
{
"from": "human",
"value": "Is there a tool that allows one to monitor GDI calls?\n"
},
{
"from": "gpt",
"value": "Yes, there are several tools available that can help you monitor GDI (Graphics Device Interface) calls in Windows applications. Some popular options include:\n\n1. **Microsoft Spy+... |
I am attempting to provide a general solution for the migration of data from one schema version to another. A problem arises when the column data type from the source schema does not match that of the destination. I would like to create a query that will perform a preliminary compare on the columns data types to return... | To compare the data types of columns between two different schemas (or catalogs) in a database, you can write a query against the `information_schema.columns` table. To do this, you'll need to ensure that you can access both schemas.
If you're using PostgreSQL, for example, you can connect to the database and then qu... | 3,966 | [
{
"from": "human",
"value": "I am attempting to provide a general solution for the migration of data from one schema version to another. A problem arises when the column data type from the source schema does not match that of the destination. I would like to create a query that will perform a preliminary co... |
I am using 3D maths in my application extensively. How much speed-up can I achieve by converting my vector/matrix library to SSE, AltiVec or a similar SIMD code?
| The potential speed-up you can achieve by converting your vector/matrix library to use SIMD (Single Instruction, Multiple Data) instructions like SSE (Streaming SIMD Extensions) or AltiVec can vary significantly based on several factors, including:
1. **Nature of the Operations**: If your application frequently perfor... | 8,762 | [
{
"from": "human",
"value": "I am using 3D maths in my application extensively. How much speed-up can I achieve by converting my vector/matrix library to SSE, AltiVec or a similar SIMD code?\n"
},
{
"from": "gpt",
"value": "The potential speed-up you can achieve by converting your vector/matrix ... |
In a .NET Win console application, I would like to access an App.config file in a location different from the console application binary. For example, how can C:\bin\Text.exe get its settings from C:\Test.exe.config?
| In a .NET console application, the default behavior is to read the configuration settings from the `App.config` file that is transformed into `YourAppName.exe.config` during the build process. However, if you want to load configuration settings from a custom location (e.g., `C:\Test.exe.config`), you can manually read ... | 7,959 | [
{
"from": "human",
"value": "In a .NET Win console application, I would like to access an App.config file in a location different from the console application binary. For example, how can C:\\bin\\Text.exe get its settings from C:\\Test.exe.config?\n"
},
{
"from": "gpt",
"value": "In a .NET cons... |
I am writing some code to determine whether a network domain is registered. For example, I want to check if "Google123.com" is available. There are at least two ways I can do this programmatically, but I'm not sure which is more valid:
A) In linux/cygwin, I can launch the
whois command to see if a domain is
in use.
B... | Your questions touch on important aspects of domain name registration and DNS resolution. Let's break it down.
### A) Using `whois`
The `whois` command is the most direct and reliable way to check whether a domain name is registered. When you run a `whois` query on a domain, it contacts the WHOIS database, which conta... | 7,014 | [
{
"from": "human",
"value": "I am writing some code to determine whether a network domain is registered. For example, I want to check if \"Google123.com\" is available. There are at least two ways I can do this programmatically, but I'm not sure which is more valid:\n\nA) In linux/cygwin, I can launch the\n... |
I am working through the book Learning WCF by Michele Bustamante, and trying to do it using Visual Studio C# Express 2008. The instructions say to use WCF project and item templates, which are not included with VS C# Express. There are templates for these types included with Visual Studio Web Developer Express, and I... | Unfortunately, Visual Studio C# Express 2008 does not natively support WCF project and item templates since WCF is part of the features available in the full versions of Visual Studio. The Express versions are streamlined and do not include all the advanced features and templates that come with the full IDEs.
Here are... | 8,576 | [
{
"from": "human",
"value": "I am working through the book Learning WCF by Michele Bustamante, and trying to do it using Visual Studio C# Express 2008. The instructions say to use WCF project and item templates, which are not included with VS C# Express. There are templates for these types included with V... |
My automated script for starting and stopping VMWare Server virtual machines has stopped working. vmware-cmd has started raising the error:
The ordinal 3288 could not be located in the dynamic link library LIBEAY32.dll.
I am not aware of any specific change or update when this started happening.
I have found a bunch... | The error message you are seeing, "The ordinal 3288 could not be located in the dynamic link library LIBEAY32.dll," typically indicates that there is an issue with the OpenSSL libraries used by VMWare or another application that relies on them. This can happen due to various reasons, such as a library update, a corrupt... | 9,607 | [
{
"from": "human",
"value": "My automated script for starting and stopping VMWare Server virtual machines has stopped working. vmware-cmd has started raising the error: \n\nThe ordinal 3288 could not be located in the dynamic link library LIBEAY32.dll.\n\nI am not aware of any specific change or update when... |
So if I'm using branches that are remote (tracked) branches, and I want to get the lastest, I'm still unclear if I should be doing git pull or git rebase. I thought I had read that doing git rebase when working on a branch with other users, it can screw them up when they pull or rebase. Is that true? Should we all be u... | When working with Git, it's important to understand the distinction between `git pull`, `git rebase`, and `git merge`, especially when collaborating with others on a shared repository.
### Git Pull
`git pull` is essentially a combination of two commands: `git fetch` followed by `git merge`. When you run `git pull`, Gi... | 9,726 | [
{
"from": "human",
"value": "So if I'm using branches that are remote (tracked) branches, and I want to get the lastest, I'm still unclear if I should be doing git pull or git rebase. I thought I had read that doing git rebase when working on a branch with other users, it can screw them up when they pull or... |
I am investigating security plugins using SFAuthorizationPluginView under Mac OSX and as a first step looking at the NameAndPassword sample application. The app builds OK but I cannot get it to authenticate. So does anyone have any experience of SFAuthorizationPluginView or any other examples.
| The `SFAuthorizationPluginView` is part of the macOS security framework and is used to implement custom authorization plugins. If you're having trouble getting the `NameAndPassword` sample application to authenticate, here are some steps and considerations that may help you troubleshoot the issue:
### Steps to Trouble... | 10,366 | [
{
"from": "human",
"value": "I am investigating security plugins using SFAuthorizationPluginView under Mac OSX and as a first step looking at the NameAndPassword sample application. The app builds OK but I cannot get it to authenticate. So does anyone have any experience of SFAuthorizationPluginView or any ... |
Is there a way to add some custom font on a website without using images, Flash or some other graphics?
For example, I was working on a wedding website, and I found a lot of nice fonts for that subject. But I can't find the right way to add that font on the server. And how do I include that font with CSS into the HTML?... | Yes, you can add custom fonts to a website without using images or Flash. The most common and widely supported method is to use the CSS `@font-face` rule, or you can use web font services like Google Fonts or Adobe Fonts. Here’s how you can do it using both methods:
### Method 1: Using `@font-face`
1. **Obtain the Fo... | 8,322 | [
{
"from": "human",
"value": "Is there a way to add some custom font on a website without using images, Flash or some other graphics?\nFor example, I was working on a wedding website, and I found a lot of nice fonts for that subject. But I can't find the right way to add that font on the server. And how do I... |
How do I tell Subversion (svn) to treat a file as a binary file?
| In Subversion (svn), you can tell it to treat a file as a binary file by setting the appropriate property on that file. This is done using the `svn propset` command to set the `svn:mime-type` property. For binary files, you typically set the MIME type to a value such as `application/octet-stream`, but you can also use ... | 11,449 | [
{
"from": "human",
"value": "How do I tell Subversion (svn) to treat a file as a binary file?\n"
},
{
"from": "gpt",
"value": "In Subversion (svn), you can tell it to treat a file as a binary file by setting the appropriate property on that file. This is done using the `svn propset` command to s... |
Currently I am using NetTiers to generate my data access layer and service layer. I have been using NetTiers for over 2 years and have found it to be very useful. At some point I need to look at LINQ so my questions are...
Has anyone else gone from NetTiers to LINQ To SQL?
Was this switch over a good or bad thing?
Is ... | Transitioning from NetTiers to LINQ to SQL can be a significant change in your data access layer, and whether it's a good decision depends on several factors. Below are some insights that might help you make an informed choice:
### Has anyone else gone from NetTiers to LINQ To SQL?
Yes, many developers have transitio... | 6,364 | [
{
"from": "human",
"value": "Currently I am using NetTiers to generate my data access layer and service layer. I have been using NetTiers for over 2 years and have found it to be very useful. At some point I need to look at LINQ so my questions are...\n\nHas anyone else gone from NetTiers to LINQ To SQL?\nW... |
I'm used to Atlas where the preferred (from what I know) method is to use XML comments such as:
/// <summary>
/// Method to calculate distance between two points
/// </summary>
///
/// <param name="pointA">First point</param>
/// <param name="pointB">Second point</param>
///
function calculatePointDistance(pointA, po... | In JavaScript, the two common styles of comments you've encountered are known as XML comments (often used with tools like JSDoc) and block comments (often used for general comments). Both can be useful depending on your needs.
### XML Comments (JSDoc style)
Using JSDoc, as you've illustrated, is a powerful way to docu... | 10,086 | [
{
"from": "human",
"value": "I'm used to Atlas where the preferred (from what I know) method is to use XML comments such as:\n/// <summary>\n/// Method to calculate distance between two points\n/// </summary>\n///\n/// <param name=\"pointA\">First point</param>\n/// <param name=\"pointB\">Second point</pa... |
Suppose I attach an blur function to an HTML input box like this:
<input id="myInput" onblur="function() { ... }"></input>
Is there a way to get the ID of the element which caused the blur event to fire (the element which was clicked) inside the function? How?
For example, suppose I have a span like this:
<span id="my... | You can accomplish this by using a global variable to track the last clicked element before the blur event fires. Here’s how you can implement this:
1. Create a variable to store the ID of the last clicked element.
2. Attach an `onclick` event to the clickable element (e.g., your span) to set that variable.
3. In the ... | 10,617 | [
{
"from": "human",
"value": "Suppose I attach an blur function to an HTML input box like this:\n<input id=\"myInput\" onblur=\"function() { ... }\"></input>\n\nIs there a way to get the ID of the element which caused the blur event to fire (the element which was clicked) inside the function? How?\nFor examp... |
The following code is in the /Courses/Detail action:
[AcceptVerbs("GET")]
public ActionResult Detail(int id)
{
ViewData["Title"] = "A View Title";
return View(tmdc.GetCourseById(id));
}
The tmdc.GetCourseById(id) method returns an instance of type Course for the View. In the View I am ... | Yes, the behavior you are experiencing is expected. When you use the `HTML.TextBox` helper method, it looks for a model property or value by the name you provide. In your case, `HTML.TextBox("Title")` looks for a property called `Title` in the model passed to the view. Since `ViewData["Title"]` is a different storage f... | 8,917 | [
{
"from": "human",
"value": "The following code is in the /Courses/Detail action:\n [AcceptVerbs(\"GET\")]\n public ActionResult Detail(int id)\n {\n ViewData[\"Title\"] = \"A View Title\";\n return View(tmdc.GetCourseById(id));\n }\n\nThe tmdc.GetCourseById(id) method returns an i... |
What semantic web frameworks are there, and what are the advantages / disadvantages of each? I've made extensive use of Jena, and I have looked at Sesame briefly. Are there others I should consider as well?
| There are several semantic web frameworks available, each with its own advantages and disadvantages. Here’s a list of some popular ones, including Apache Jena and RDF4J (formerly Sesame), along with their key features:
### 1. **Apache Jena**
- **Overview**: A popular Java framework for building Semantic Web and Linked... | 3,718 | [
{
"from": "human",
"value": "What semantic web frameworks are there, and what are the advantages / disadvantages of each? I've made extensive use of Jena, and I have looked at Sesame briefly. Are there others I should consider as well?\n"
},
{
"from": "gpt",
"value": "There are several semantic ... |
I have an application written in flash (actually it is written in Haxe and run under SHWX but it doesn't matter here). I have a pretty complex task that consumes a lot of CPU power and sometimes executes for more that 15 seconds. If that happens, I've got an error saying 'A script has executed for longer than the defau... | In the context of Flash and ActionScript, the default timeout for scripts is indeed set to 15 seconds, and unfortunately, there is no way to directly extend this timeout period in the Flash Player. This behavior is designed to prevent scripts from hanging indefinitely and adversely affecting the user experience.
Howev... | 10,884 | [
{
"from": "human",
"value": "I have an application written in flash (actually it is written in Haxe and run under SHWX but it doesn't matter here). I have a pretty complex task that consumes a lot of CPU power and sometimes executes for more that 15 seconds. If that happens, I've got an error saying 'A scri... |
I'd like to encourage our users of our RCP application to send the problem details to our support department. To this end, I've added a "Contact support" widget to our standard error dialogue.
I've managed to use URI headers to send a stacktrace using Java 6's JDIC call: Desktop.getDesktop().mail(java.net.URI). This wi... | Given your requirements and constraints, here are some thoughts and options regarding handling support requests in your RCP application:
### Sending Email with Attachments
1. **Using EML Files**: As you mentioned, creating an `.eml` file is a feasible option. This is a plain text file formatted according to the MIME ... | 7,768 | [
{
"from": "human",
"value": "I'd like to encourage our users of our RCP application to send the problem details to our support department. To this end, I've added a \"Contact support\" widget to our standard error dialogue.\nI've managed to use URI headers to send a stacktrace using Java 6's JDIC call: Desk... |
When a client makes a web service request, how does asp.net assign an instance of the service class to handle that request?
Is a new instance of the service class created per request or is there pooling happening or is there a singleton instance used to handle all requests?
| In ASP.NET, the handling of instances for web service requests largely depends on the specific technology and configuration being used, such as whether you're using ASP.NET Web API, ASP.NET Core, or traditional ASP.NET. Here’s an overview of how instances are managed in these contexts:
### ASP.NET Web API
1. **Instan... | 9,713 | [
{
"from": "human",
"value": "When a client makes a web service request, how does asp.net assign an instance of the service class to handle that request?\nIs a new instance of the service class created per request or is there pooling happening or is there a singleton instance used to handle all requests?\n"
... |
I want to link to bookmark on a page (mysite.com/mypage.htm#bookmark) AND visually highlight the item that was bookmarked (maybe having a red border). Naturally, there would be multiple items bookmarked. So that if someone clicked on #bookmark2 then that other area would be highlighted).
I can see how to do that wi... | You can achieve the effect of highlighting a section of a webpage when navigating to a specific bookmark using a combination of CSS and JavaScript. This method does not require server-side processing (like ASP or ASPX) and keeps things straightforward.
Here’s a step-by-step guide on how to implement this:
### HTML St... | 9,211 | [
{
"from": "human",
"value": "I want to link to bookmark on a page (mysite.com/mypage.htm#bookmark) AND visually highlight the item that was bookmarked (maybe having a red border). Naturally, there would be multiple items bookmarked. So that if someone clicked on #bookmark2 then that other area would be hi... |
I'm a pretty new C# and .NET developer. I recently created an MMC snapin using C# and was gratified by how easy it was to do, especially after hearing a lot of horror stories by some other developers in my organisation about how hard it is to do in C++.
I pretty much went through the whole project at some point and mad... | Welcome to the world of C# and .NET development! It's great to hear that you've successfully created an MMC snap-in and found the experience rewarding.
When it comes to the visibility of classes and methods in C#, the choice between `public` and `internal` depends on the intended use case and design of your applicatio... | 7,200 | [
{
"from": "human",
"value": "I'm a pretty new C# and .NET developer. I recently created an MMC snapin using C# and was gratified by how easy it was to do, especially after hearing a lot of horror stories by some other developers in my organisation about how hard it is to do in C++.\nI pretty much went throu... |
I have an Eclipse RCP app running on Java 6. When I try to run the product configuration from within Eclipse, it silently terminates almost immediately. No error is reported in the console. I've tried setting breakpoints in the IApplication and in the Activator, and neither are reached.
I know I don't have much spec... | When an Eclipse RCP application silently terminates without any errors or exceptions being reported, it can be quite challenging to diagnose the issue. Here are some steps and pointers to help you troubleshoot the problem:
1. **Check the Error Log**:
- Look at the Eclipse Error Log view (`Window -> Show View -> Err... | 6,991 | [
{
"from": "human",
"value": "I have an Eclipse RCP app running on Java 6. When I try to run the product configuration from within Eclipse, it silently terminates almost immediately. No error is reported in the console. I've tried setting breakpoints in the IApplication and in the Activator, and neither a... |
How do you check if a one-character String is a letter - including any letters with accents?
I had to work this out recently, so I'll answer it myself, after the recent VB6 question reminded me.
| To check if a one-character string is a letter (including any letters with accents) in various programming languages, you can use Unicode properties or specific library functions that account for characters beyond the basic ASCII range.
### Here are examples in different languages:
#### Python
You can use the `str.is... | 9,635 | [
{
"from": "human",
"value": "How do you check if a one-character String is a letter - including any letters with accents?\nI had to work this out recently, so I'll answer it myself, after the recent VB6 question reminded me.\n"
},
{
"from": "gpt",
"value": "To check if a one-character string is ... |
Here is an example of what I've got going on:
CREATE TABLE Parent (id BIGINT NOT NULL,
PRIMARY KEY (id)) ENGINE=InnoDB;
CREATE TABLE Child (id BIGINT NOT NULL,
parentid BIGINT NOT NULL,
PRIMARY KEY (id),
KEY (parentid),
CONSTRAINT fk_parent FOREIGN KEY (parentid) REFERENCES Parent (id) ON DELETE CASCADE) ENG... | What you are experiencing is the expected behavior of InnoDB regarding foreign key constraints. The foreign key constraints enforce referential integrity, and they do not have a mechanism to automatically handle cascading deletions across multiple relationships in the way you are describing.
Here's a breakdown of what... | 9,561 | [
{
"from": "human",
"value": "Here is an example of what I've got going on:\nCREATE TABLE Parent (id BIGINT NOT NULL,\n PRIMARY KEY (id)) ENGINE=InnoDB;\n\nCREATE TABLE Child (id BIGINT NOT NULL,\n parentid BIGINT NOT NULL,\n PRIMARY KEY (id),\n KEY (parentid),\n CONSTRAINT fk_parent FOREIGN KEY (parent... |
We are currently developing a server whereby a client requests interest in changes to specific data elements and when that data changes the server pushes the data back to the client. There has vigorous debate at work about whether or not it would be better for the client to poll for this data.
What is considered to be... | In a near real-time environment, choosing between a push or pull (polling) model for data transfer involves considering various factors such as performance, scalability, and network load. Here’s a breakdown of both approaches:
### 1. Push Model (Server-Sent Events, WebSockets, or Long Polling)
#### Advantages:
- **Im... | 6,505 | [
{
"from": "human",
"value": "We are currently developing a server whereby a client requests interest in changes to specific data elements and when that data changes the server pushes the data back to the client. There has vigorous debate at work about whether or not it would be better for the client to poll... |
PHP5 has a "magic method" __call()that can be defined on any class that is invoked when an undefined method is called -- it is roughly equivalent to Ruby's method_missing or Perl's AUTOLOAD. Is it possible to do something like this in older versions of PHP?
| In older versions of PHP, specifically before PHP 5, there was no built-in mechanism like the `__call()` magic method for handling calls to undefined methods. However, you could simulate a similar behavior by using some alternative techniques. Below are a couple of approaches that could be used to achieve a similar eff... | 8,875 | [
{
"from": "human",
"value": "PHP5 has a \"magic method\" __call()that can be defined on any class that is invoked when an undefined method is called -- it is roughly equivalent to Ruby's method_missing or Perl's AUTOLOAD. Is it possible to do something like this in older versions of PHP?\n"
},
{
"fr... |
I would like to automatically convert between tabs and spaces for indentation when I commit/update code to/from our repository. I have found the AnyEdit plugin for eclipse, which can convert directories of files. Not bad for a start, but does anybody have more expierience on how to handle this? Or maybe know of an Ant ... | Automatically converting between tabs and spaces for indentation during commits or updates in your code repository is a common requirement in many development environments. Here are a few approaches you can consider, including an Ant script option, to handle this efficiently:
### 1. **Git Hooks**
You can utilize Git h... | 8,454 | [
{
"from": "human",
"value": "I would like to automatically convert between tabs and spaces for indentation when I commit/update code to/from our repository. I have found the AnyEdit plugin for eclipse, which can convert directories of files. Not bad for a start, but does anybody have more expierience on how... |
I have a string which contain tags in the form < tag >. Is there an easy way for me to programmatically replace instances of these tags with special ascii characters? e.g. replace a tag like "< tab >" with the ascii equivelent of '/t'?
| Yes, you can programmatically replace instances of tags in a string with their ASCII character equivalents using a programming language like Python. Below is a simple way to achieve this using Python's `str.replace()` method.
First, you'll want to define a mapping of tags to their ASCII equivalents, and then use a lo... | 11,300 | [
{
"from": "human",
"value": "I have a string which contain tags in the form < tag >. Is there an easy way for me to programmatically replace instances of these tags with special ascii characters? e.g. replace a tag like \"< tab >\" with the ascii equivelent of '/t'?\n"
},
{
"from": "gpt",
"value... |
I'm working on a document "wizard" for the company that I work for. It's a .dot file with a header consisting of some text and some form fields, and a lot of VBA code. The body of the document is pulled in as an OLE object from a separate .doc file.
Currently, this is being done as a Shape, rather than an InlineShape. ... | In Word 97, positioning an `InlineShape` can be somewhat limited because `InlineShape` objects are treated as part of the text flow. However, you can work around this limitation by using a combination of margins, alignment, and potentially creating a new paragraph after the `InlineShape` to adjust its position.
Here’s... | 8,842 | [
{
"from": "human",
"value": "I'm working on a document \"wizard\" for the company that I work for. It's a .dot file with a header consisting of some text and some form fields, and a lot of VBA code. The body of the document is pulled in as an OLE object from a separate .doc file.\nCurrently, this is being d... |
Possible Duplicate:
Stored procedures/DB schema in source control
What's the best way to version control my tables, views, sprocs, etc? Preferably automated or at least semi-automated :)
Thanks
| Version controlling your database schema (tables, views, stored procedures, etc.) is an important practice that helps maintain consistency and allows for easier collaboration among team members. Here are some best practices for achieving this, along with tools and techniques that can help automate or semi-automate the ... | 4,712 | [
{
"from": "human",
"value": "\nPossible Duplicate:\nStored procedures/DB schema in source control \n\nWhat's the best way to version control my tables, views, sprocs, etc? Preferably automated or at least semi-automated :)\nThanks\n"
},
{
"from": "gpt",
"value": "Version controlling your databas... |
Has anyone found a way to run Selenium RC / Selenium Grid tests, written in C# in parallel?
I've currently got a sizable test suite written using Selenium RC's C# driver. Running the entire test suite takes a little over an hour to complete. I normally don't have to run the entire suite so it hasn't been a concern up t... | Running Selenium tests in parallel can significantly reduce the overall execution time, especially when dealing with a sizable test suite. Given that you're using Selenium RC (which is quite old and deprecated), I would recommend considering an upgrade to Selenium WebDriver if possible. This will provide better support... | 8,107 | [
{
"from": "human",
"value": "Has anyone found a way to run Selenium RC / Selenium Grid tests, written in C# in parallel?\nI've currently got a sizable test suite written using Selenium RC's C# driver. Running the entire test suite takes a little over an hour to complete. I normally don't have to run the ent... |
I want to use a file to store the current version number for a piece of customer software which can be used by a start-up script to run the binary in the correct directory.
For Example, if the run directory looks like this:
.
..
1.2.1
1.2.2
1.3.0
run.sh
current_version
And current_version contains:
1.2.2
I want run.s... | To create a more robust solution for your `run.sh` script that handles various edge cases such as file existence, multiple lines, leading spaces, commented lines, and blank files, you can implement the following improvements. Below is an enhanced version of the shell script along with an example using Perl.
### Improv... | 5,705 | [
{
"from": "human",
"value": "I want to use a file to store the current version number for a piece of customer software which can be used by a start-up script to run the binary in the correct directory.\nFor Example, if the run directory looks like this:\n.\n..\n1.2.1\n1.2.2\n1.3.0\nrun.sh\ncurrent_version\n... |
I have an exe file generated with py2exe. In the setup.py I specify an icon to be embedded in the exe:
windows=[{'script': 'my_script.py','icon_resources': [(0, 'my_icon.ico')], ...
I tried loading the icon using:
hinst = win32api.GetModuleHandle(None)
hicon = win32gui.LoadImage(hinst, 0, win32con.IMAGE_ICON, 0, 0, wi... | When loading an icon from your executable using the Windows API via PyWin32, you should make sure you are referencing the icon resource correctly.
In your `setup.py`, you seem to have embedded an icon in your executable correctly using `py2exe`. However, when you try to load this icon using `LoadImage`, there are a c... | 9,203 | [
{
"from": "human",
"value": "I have an exe file generated with py2exe. In the setup.py I specify an icon to be embedded in the exe:\nwindows=[{'script': 'my_script.py','icon_resources': [(0, 'my_icon.ico')], ...\n\nI tried loading the icon using:\nhinst = win32api.GetModuleHandle(None)\nhicon = win32gui.Loa... |
Is it possible to clone a virtual machine using VMware Fusion on Mac OS X? I'm trying the 30 day evaluation version but there doesn't appear to be a clone feature. I tried using the Finder to copy a VM's package structure but the copy didn't appear in the Virtual Machine Library.
| Yes, it is possible to clone a virtual machine using VMware Fusion on macOS, although the method may not be immediately obvious, especially if you're using the evaluation version. Here are the steps you can follow to clone a virtual machine:
### Cloning a VM via VMware Fusion:
1. **Open VMware Fusion**: Start VMware ... | 10,093 | [
{
"from": "human",
"value": "Is it possible to clone a virtual machine using VMware Fusion on Mac OS X? I'm trying the 30 day evaluation version but there doesn't appear to be a clone feature. I tried using the Finder to copy a VM's package structure but the copy didn't appear in the Virtual Machine Library... |
I need a list of integers from 1 to x where x is set by the user. I could build it with a for loop eg assuming x is an integer set previously:
List<int> iList = new List<int>();
for (int i = 1; i <= x; i++)
{
iList.Add(i);
}
This seems dumb, surely there's a more elegant way to do this, something like the PHP ran... | Yes, there is a more elegant way to create a list of integers from 1 to `x` in C#. You can use LINQ (Language Integrated Query) to achieve this in a more concise manner. Here's how you can do it:
```csharp
using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
static void Main()
{
... | 9,548 | [
{
"from": "human",
"value": "I need a list of integers from 1 to x where x is set by the user. I could build it with a for loop eg assuming x is an integer set previously:\nList<int> iList = new List<int>();\nfor (int i = 1; i <= x; i++)\n{\n iList.Add(i);\n}\n\nThis seems dumb, surely there's a more el... |
When launching a process from Java, both stderr and stdout can block on output if I don't read from the pipes. Currently I have a thread that pro-actively reads from one and the main thread blocks on the other.
Is there an easy way to join the two streams or otherwise cause the subprocess to continue while not losing ... | Yes, there are several ways to manage output from a subprocess in Java to ensure that you can handle both standard output (stdout) and error output (stderr) without blocking. One common approach is to use separate threads to read from both streams. However, if you want to join the streams or simplify the handling, here... | 5,555 | [
{
"from": "human",
"value": "When launching a process from Java, both stderr and stdout can block on output if I don't read from the pipes. Currently I have a thread that pro-actively reads from one and the main thread blocks on the other.\nIs there an easy way to join the two streams or otherwise cause th... |
Assuming a map where you want to preserve existing entries. 20% of the time, the entry you are inserting is new data. Is there an advantage to doing std::map::find then std::map::insert using that returned iterator? Or is it quicker to attempt the insert and then act based on whether or not the iterator indicates the... | When considering whether to use `std::map::find` followed by `std::map::insert` versus directly attempting to insert the entry and acting based on the result, both methods have their pros and cons. However, given the condition that 20% of the time the entry you are inserting is new data (meaning that 80% of the time, i... | 8,853 | [
{
"from": "human",
"value": "Assuming a map where you want to preserve existing entries. 20% of the time, the entry you are inserting is new data. Is there an advantage to doing std::map::find then std::map::insert using that returned iterator? Or is it quicker to attempt the insert and then act based on ... |
I have a working copy of my project, checked out using Subversion 1.5.1. When I attempt to run StatSVN against it, I get the following error:
Sep 18, 2008 12:25:22 PM net.sf.statsvn.util.JavaUtilTaskLogger info
INFO: StatSVN - SVN statistics generation
Sep 18, 2008 12:25:22 PM net.sf.statsvn.util.JavaUtilTaskLogger ... | The error message you're encountering suggests that StatSVN cannot recognize your current directory as a valid Subversion working copy. Here are a few troubleshooting steps to help you resolve the issue:
1. **Confirm the Working Copy Status**:
- Ensure that you are indeed in a Subversion working directory. Navigate... | 10,509 | [
{
"from": "human",
"value": "I have a working copy of my project, checked out using Subversion 1.5.1. When I attempt to run StatSVN against it, I get the following error:\n\nSep 18, 2008 12:25:22 PM net.sf.statsvn.util.JavaUtilTaskLogger info\n INFO: StatSVN - SVN statistics generation\nSep 18, 2008 12:25:... |
XmlElement.Attributes.Remove* methods are working fine for arbitrary attributes resulting in the removed attributes being removed from XmlDocument.OuterXml property. Xmlns attribute however is different. Here is an example:
XmlDocument doc = new XmlDocument();
doc.InnerXml = @"<Element1 attr1=""value1"" xmlns=""http://... | In .NET XML API, specifically with the `XmlDocument` class, the handling of the `xmlns` attribute is indeed special due to its role in XML namespaces. Unlike other attributes, the `xmlns` attribute is not treated like a regular attribute; instead, it signifies the namespace of the element and, as a result, it cannot be... | 9,230 | [
{
"from": "human",
"value": "XmlElement.Attributes.Remove* methods are working fine for arbitrary attributes resulting in the removed attributes being removed from XmlDocument.OuterXml property. Xmlns attribute however is different. Here is an example:\nXmlDocument doc = new XmlDocument();\ndoc.InnerXml = @... |
We have a whole bunch of queries that "search" for clients, customers, etc. You can search by first name, email, etc. We're using LIKE statements in the following manner:
SELECT *
FROM customer
WHERE fname LIKE '%someName%'
Does full-text indexing help in the scenario? We're using SQL Server 2005.
| In SQL Server 2005, using `LIKE '%someName%'` for searching can lead to performance issues, especially when dealing with large datasets. This is because using a leading wildcard (`%`) prevents SQL Server from utilizing any indexes, which means it will have to perform a full table scan.
Full-text indexing could indeed... | 9,506 | [
{
"from": "human",
"value": "We have a whole bunch of queries that \"search\" for clients, customers, etc. You can search by first name, email, etc. We're using LIKE statements in the following manner: \nSELECT * \nFROM customer \nWHERE fname LIKE '%someName%'\n\nDoes full-text indexing help in the scenari... |
How do you update your SQL sever database when installing your product's update? Are there any tools that will integrate with windows installer?
My typical schema changes are:
Adding/removing columns
Adding/removing tables.
Adding views.
Adding/alter indexs.
| Updating an SQL Server database when installing a product update typically involves several steps, and there are various strategies and tools you can use to accomplish this. Below are some common methods and tools that integrate well with the Windows Installer.
### Common Approaches to Update SQL Server Database
1. *... | 8,814 | [
{
"from": "human",
"value": "How do you update your SQL sever database when installing your product's update? Are there any tools that will integrate with windows installer?\nMy typical schema changes are:\n\nAdding/removing columns\nAdding/removing tables.\nAdding views.\nAdding/alter indexs.\n\n"
},
... |
What Direct3D render states should be used to implement Java's Porter-Duff compositing rules (CLEAR, SRC, SRCOVER, etc.)?
| Implementing Java's Porter-Duff compositing rules using Direct3D involves configuring render states and potentially using blending operations. Direct3D provides the means to achieve various blending effects through the use of blend states.
Here is a mapping of the Porter-Duff compositing rules to Direct3D blend states... | 1,827 | [
{
"from": "human",
"value": "What Direct3D render states should be used to implement Java's Porter-Duff compositing rules (CLEAR, SRC, SRCOVER, etc.)?\n"
},
{
"from": "gpt",
"value": "Implementing Java's Porter-Duff compositing rules using Direct3D involves configuring render states and potentia... |
I need a very fast algorithm for the following task. I have already implemented several algorithms that complete it, but they're all too slow for the performance I need. It should be fast enough that the algorithm can be run at least 100,000 times a second on a modern CPU. It will be implemented in C++.
I am working wi... | To achieve your goal of merging two vectors of spans efficiently in linear time, we can leverage the sorted property of both vectors and directly perform a merge operation while simultaneously widening the spans from the `src` vector. This approach avoids unnecessary memory allocations and copying and ensures that we m... | 5,546 | [
{
"from": "human",
"value": "I need a very fast algorithm for the following task. I have already implemented several algorithms that complete it, but they're all too slow for the performance I need. It should be fast enough that the algorithm can be run at least 100,000 times a second on a modern CPU. It wi... |
I am aware of this command:
cvs log -N -w<userid> -d"1 day ago"
Unfortunately this generates a formatted report with lots of newlines in it, such that the file-path, the file-version, and the comment-text are all on separate lines. Therefore it is difficult to scan it for all occurrences of comment text, (eg, grep), an... | If you're looking to modify the output of the `cvs log` command to make it more suitable for scanning or grep-ing, you can pipe the output to a script or use tools like `awk` or `sed` to reformat it.
Here’s an example of how to use `awk` to format the output so that each entry for the file shows the file path, version... | 11,251 | [
{
"from": "human",
"value": "I am aware of this command:\ncvs log -N -w<userid> -d\"1 day ago\"\nUnfortunately this generates a formatted report with lots of newlines in it, such that the file-path, the file-version, and the comment-text are all on separate lines. Therefore it is difficult to scan it for al... |
I'd like to have some rails apps over different servers sharing the same session. I can do it within the same server but don't know if it is possible to share over different servers. Anyone already did or knows how to do it?
Thanks
| Yes, it is definitely possible to share sessions across different Rails applications running on different servers. There are several approaches you can take to achieve this. Below are some common methods:
### 1. **Using a Shared Database**
One of the simplest ways to share sessions across multiple Rails applications ... | 7,625 | [
{
"from": "human",
"value": "I'd like to have some rails apps over different servers sharing the same session. I can do it within the same server but don't know if it is possible to share over different servers. Anyone already did or knows how to do it?\nThanks\n"
},
{
"from": "gpt",
"value": "Y... |
I'm having a little bit of a problem scaling my images to a properly predefined size. I was wondering - since it is purely mathematics, if there's some sort of common logical algorithm that works in every language (PHP, ActionScript, Javascript etc.) to scale images proportionally.
I'm using this at the moment:
var ma... | The problem you're experiencing comes from the fact that the code currently only checks one dimension (height or width) at a time, which may lead to cases where neither dimension fits within the maximum size constraints. To fix this, you should calculate the scaling ratio based on both dimensions, and then apply the sm... | 8,909 | [
{
"from": "human",
"value": "I'm having a little bit of a problem scaling my images to a properly predefined size. I was wondering - since it is purely mathematics, if there's some sort of common logical algorithm that works in every language (PHP, ActionScript, Javascript etc.) to scale images proportional... |
I'm wondering what is the quickest and most reliable way to forward mail from an IMAP account.
My university does not allow our student-mailbox to forward to a private e-mail account (everybody uses either Gmail or Hotmail here). It's a political thing, not technical. We do have IMAP access to the mailbox. I would like... | Your project sounds interesting, and you're right to consider several aspects of email forwarding with IMAP access. Let's tackle your concerns and explore possible solutions:
### Addressing Your Concerns
1. **Reassembling Email Parts**:
- When downloading and reassembling email parts, using libraries like `PHPMai... | 7,740 | [
{
"from": "human",
"value": "I'm wondering what is the quickest and most reliable way to forward mail from an IMAP account.\nMy university does not allow our student-mailbox to forward to a private e-mail account (everybody uses either Gmail or Hotmail here). It's a political thing, not technical. We do hav... |
Has anybody experience in building a custom style in Qt? What I have in my mind is a complete new style that affects all kind of widgets. I have seen some examples in the web for a custom combo box. But I have no idea how much time and code it takes to build a "complete" new custom style ... maybe someone can give me a... | Creating a custom style in Qt can be quite a complex task, but it can also be rewarding if you want your application to have a unique look and feel. Here are some insights and guidance to help you get started:
### Understanding Qt Styles
Qt's widget styling is handled through the QStyle class, which provides an interf... | 7,343 | [
{
"from": "human",
"value": "Has anybody experience in building a custom style in Qt? What I have in my mind is a complete new style that affects all kind of widgets. I have seen some examples in the web for a custom combo box. But I have no idea how much time and code it takes to build a \"complete\" new c... |
I received the following exception when I was using the Regex class with the regular expression: (?'named a'asdf)
System.ArgumentException: parsing \"(?'named a'asdf)\" - Invalid group name: Group names must begin with a word character.
What is the problem with my regular expression?
| The issue with your regular expression `(?'named a'asdf)` is related to how you are defining the named group in the pattern. In .NET regular expressions, named groups are specified using the syntax `(?<name>...)`, where `name` must start with a word character (which includes letters, digits, and underscores).
Here are... | 12,854 | [
{
"from": "human",
"value": "I received the following exception when I was using the Regex class with the regular expression: (?'named a'asdf)\nSystem.ArgumentException: parsing \\\"(?'named a'asdf)\\\" - Invalid group name: Group names must begin with a word character.\n\nWhat is the problem with my regula... |
Are there any noted differences in appearance rendering of HTML and XHTML in Google Chrome from Firefox? From IE? From other browsers? What browser does it render the code the most similar to?
| When it comes to rendering HTML and XHTML, different browsers may exhibit subtle differences in how they handle certain aspects of the markup language. Here's a general overview of how Google Chrome, Firefox, Internet Explorer (IE), and other browsers might differ in rendering:
### HTML vs. XHTML Rendering Differences... | 8,565 | [
{
"from": "human",
"value": "Are there any noted differences in appearance rendering of HTML and XHTML in Google Chrome from Firefox? From IE? From other browsers? What browser does it render the code the most similar to?\n"
},
{
"from": "gpt",
"value": "When it comes to rendering HTML and XHTML... |
Has anyone been able to get a variable record length text file (CSV) into SQL Server via SSIS?
I have tried time and again to get a CSV file into a SQL Server table, using SSIS, where the input file has varying record lengths. For this question, the two different record lengths are 63 and 326 bytes. All record lengt... | Importing a variable-length text file (CSV) into SQL Server via SSIS can indeed be tricky, especially when dealing with files that have records of differing lengths. Here are some potential approaches and workarounds you can try to get the data into your SQL Server table:
### 1. Use a Script Component
You can use a Sc... | 5,515 | [
{
"from": "human",
"value": "Has anyone been able to get a variable record length text file (CSV) into SQL Server via SSIS?\nI have tried time and again to get a CSV file into a SQL Server table, using SSIS, where the input file has varying record lengths. For this question, the two different record length... |
Is there any easy to install/use (on unix) database migration tools like Rails Migrations? I really like the idea, but installing ruby/rails purely to manage my database migrations seems overkill.
| Yes, there are several lightweight database migration tools available that you can use on Unix without needing to install Ruby on Rails. Here are a few popular options that you might consider:
1. **Flyway**:
- A popular open-source database migration tool.
- Supports SQL-based migrations and Java-based migration... | 8,216 | [
{
"from": "human",
"value": "Is there any easy to install/use (on unix) database migration tools like Rails Migrations? I really like the idea, but installing ruby/rails purely to manage my database migrations seems overkill.\n"
},
{
"from": "gpt",
"value": "Yes, there are several lightweight da... |
I've been developing modules for DNN since version 2 and back then I was able to easily able to run my module as I developed it on my environment and still easily deploy my module as a DLL.
When version 4 came out and used the web site solution (rather than the Web Application solution). It seems like there was someth... | When it comes to developing modules for DNN (DotNetNuke), particularly with the transition from version 3 to version 4 (which introduced the website project model), it can indeed be a bit more challenging to organize development, especially in a multi-developer environment. Here are some best practices you can follow t... | 7,262 | [
{
"from": "human",
"value": "I've been developing modules for DNN since version 2 and back then I was able to easily able to run my module as I developed it on my environment and still easily deploy my module as a DLL.\nWhen version 4 came out and used the web site solution (rather than the Web Application ... |
The situation is this:
You have a Hibernate context with an
object graph that has some lazy
loading defined.
You want to use
the Hibernate objects in your UI as
is without having to copy the data
somewhere.
There are different UI
contexts that require different
amounts of data.
The data is too
big to just eager ... | In a scenario where you have a Hibernate context with lazy loading enabled, and you need to configure the loading of an object graph based on different UI requirements, you can use a combination of strategies to efficiently load the necessary data without hitting the database repeatedly. Here are some of the approaches... | 9,307 | [
{
"from": "human",
"value": "The situation is this:\n\nYou have a Hibernate context with an\nobject graph that has some lazy\nloading defined. \nYou want to use\nthe Hibernate objects in your UI as\nis without having to copy the data\nsomewhere. \nThere are different UI\ncontexts that require different\na... |
I am looking into an image processing problem for semi-real time detection of certain scenarios. My goal is to have the live video arrive as Motion JPEG frames in my Java code somehow.
I am familiar with the Java Media Framework and, sadly, I think we can consider that an effectively dead API. I am also familiar wi... | It sounds like you have a well-defined set of criteria for your image processing problem, and your inclination towards appliances like Axis video encoders is understandable given your requirements. Here’s some feedback on your specific points of interest and a few potential alternatives to consider:
### 1. Latency
- *... | 9,308 | [
{
"from": "human",
"value": "I am looking into an image processing problem for semi-real time detection of certain scenarios. My goal is to have the live video arrive as Motion JPEG frames in my Java code somehow. \nI am familiar with the Java Media Framework and, sadly, I think we can consider that an ef... |
I'm currently modifying a Java script in Rational Functional Tester and I'm trying to tell RFT to wait for an object with a specified set of properties to appear. Specifically, I want to wait until a table with X number of rows appear. The only way I have been able to do it so far is to add a verification point that ju... | In Rational Functional Tester (RFT), if you want to wait for a specific object (like a table) to appear with a specified number of rows, you can achieve this more elegantly than using a verification point. Instead of verification points, you can use a loop with the `waitForObject` method along with a custom check for t... | 9,286 | [
{
"from": "human",
"value": "I'm currently modifying a Java script in Rational Functional Tester and I'm trying to tell RFT to wait for an object with a specified set of properties to appear. Specifically, I want to wait until a table with X number of rows appear. The only way I have been able to do it so f... |
I am working with an API that provides bus arrival data. For every request, I get back (among other things) a list of which routes serve the stop in question. For example, if the list includes result for bus route #1, 2, and 5, then I know that those serve this stop.
I have a many-to-many relationship set up between Ro... | Yes, you can definitely improve the efficiency of your database operations by reducing the number of queries and using bulk insertions or updates where applicable. Here are some strategies you can employ to optimize your code:
### 1. Batch Queries
Instead of querying for each route in the loop, fetch all existing rout... | 5,416 | [
{
"from": "human",
"value": "I am working with an API that provides bus arrival data. For every request, I get back (among other things) a list of which routes serve the stop in question. For example, if the list includes result for bus route #1, 2, and 5, then I know that those serve this stop.\nI have a m... |
I'm trying to find LONG UserAgent strings with LogParser.exe in my IIS logs. This example searches for entries with the string 'poo' in them.
LogParser.exe -i:IISW3C
"SELECT COUNT(cs(User-Agent)) AS Client
FROM *.log WHERE cs(User-Agent) LIKE '%poo%'"
I'm trying to say "How many entries have a User-Agent that is lon... | To count the number of entries in your IIS logs where the User-Agent string length exceeds a specific threshold, you can use the `LENGTH` function in LogParser. Here's how you can modify your query to filter based on the length of the User-Agent string.
For example, if you want to count entries with a User-Agent longe... | 12,426 | [
{
"from": "human",
"value": "I'm trying to find LONG UserAgent strings with LogParser.exe in my IIS logs. This example searches for entries with the string 'poo' in them.\nLogParser.exe -i:IISW3C \n\"SELECT COUNT(cs(User-Agent)) AS Client \nFROM *.log WHERE cs(User-Agent) LIKE '%poo%'\"\n\nI'm trying to say... |
LINQ simplifies database programming no doubt, but does it have a downside? Inline SQL requires one to communicate with the database in a certain way that opens the database to injections. Inline SQL must also be syntax-checked, have a plan built, and then executed, which takes precious cycles. Stored procedures hav... | LINQ (Language Integrated Query) indeed simplifies database programming by allowing developers to write queries directly in their programming language (like C#) without needing to switch contexts or deal with the complexities of SQL syntax directly. However, while LINQ offers numerous advantages, there are some downsid... | 6,211 | [
{
"from": "human",
"value": "LINQ simplifies database programming no doubt, but does it have a downside? Inline SQL requires one to communicate with the database in a certain way that opens the database to injections. Inline SQL must also be syntax-checked, have a plan built, and then executed, which take... |
Is it possible to set code behind a resource dictionary in WPF. For example in a usercontrol for a button you declare it in XAML. The event handling code for the button click is done in the code file behind the control. If I was to create a data template with a button how can I write the event handler code for it's but... | In WPF, you can indeed create a resource dictionary that defines styles, templates, and other resources for your controls. However, handling events such as button clicks directly from within a resource dictionary can be a bit tricky because resource dictionaries don't have code-behind in the same way that UserControls ... | 7,797 | [
{
"from": "human",
"value": "Is it possible to set code behind a resource dictionary in WPF. For example in a usercontrol for a button you declare it in XAML. The event handling code for the button click is done in the code file behind the control. If I was to create a data template with a button how can I ... |
I've used poderosa(a .NET terminal app) to monitor logs on multiple linux/solaris servers. This application is NOT getting currently maintained and I've had several problems with it.
I'm wondering what other users do to simultaneously monitor several logs in real-time(as in tail -f logfile). I would like to be able to ... | If you're looking for alternatives to Poderosa for monitoring logs in real-time on multiple Linux/Solaris servers, there are several options you might consider. Here are some popular tools and techniques that can help you achieve simultaneous monitoring of logs across different servers:
### 1. **tmux or screen**
- **t... | 6,976 | [
{
"from": "human",
"value": "I've used poderosa(a .NET terminal app) to monitor logs on multiple linux/solaris servers. This application is NOT getting currently maintained and I've had several problems with it.\nI'm wondering what other users do to simultaneously monitor several logs in real-time(as in tai... |
Situation: A PHP application with multiple installable modules creates a new table in database for each, in the style of mod_A, mod_B, mod_C etc. Each has the column section_id.
Now, I am looking for all entries for a specific section_id, and I'm hoping there's another way besides "Select * from mod_a, mod_b, mod_c ...... | In situations where your PHP application has multiple tables for different modules, and you want to query all of them for a specific `section_id`, there are a few approaches you can consider that can make your queries more manageable and efficient.
### 1. Use a UNION Query
You can use a `UNION` query to combine result... | 8,955 | [
{
"from": "human",
"value": "Situation: A PHP application with multiple installable modules creates a new table in database for each, in the style of mod_A, mod_B, mod_C etc. Each has the column section_id.\nNow, I am looking for all entries for a specific section_id, and I'm hoping there's another way besi... |
What tools, preferably open source, are recommended for driving an automated test suite on a FLEX based web application? The same tool also having built in capabilities to drive Web Services would be nice.
| For automating tests on a Flex-based web application, you'll need tools that can handle Flash content, as well as potentially interact with web services. Here are some open-source tools that you might consider for these requirements:
### 1. **Selenium**
- **Overview**: Selenium is widely used for automating web applic... | 6,667 | [
{
"from": "human",
"value": "What tools, preferably open source, are recommended for driving an automated test suite on a FLEX based web application? The same tool also having built in capabilities to drive Web Services would be nice.\n"
},
{
"from": "gpt",
"value": "For automating tests on a Fl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.