instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I'm having a hard time getting an array fixture to work.
Origanlly the test was written as a rowfixture, Requirements later changed and now the order of the results matters.
It seems you have to pass the data into the base arrayfixture constructor but I don't see how that is possible or how you pass arguments into the ... | Certainly! In FitNesse, when you switch from a RowFixture to an ArrayFixture, you must ensure that your fixture class is designed to work with the data structure of an array. The ArrayFixture allows you to return an array of arrays, where each inner array represents a row in the FitNesse table.
Here’s a basic example ... | 25,155 | [
{
"from": "human",
"value": "I'm having a hard time getting an array fixture to work.\nOriganlly the test was written as a rowfixture, Requirements later changed and now the order of the results matters.\nIt seems you have to pass the data into the base arrayfixture constructor but I don't see how that is p... |
Is it possible to have all the computing capacity of all the hardware nodes allocated to one instance (for eg. one basic linux installation)?
How to manage the cloud?
| Yes, it is technically possible to allocate all the computing capacity of hardware nodes to a single instance, but doing so involves certain trade-offs and considerations. Below are some strategies and practices to manage cloud resources effectively while ensuring high performance for a single instance:
### 1. **Choos... | 28,702 | [
{
"from": "human",
"value": "Is it possible to have all the computing capacity of all the hardware nodes allocated to one instance (for eg. one basic linux installation)?\nHow to manage the cloud?\n"
},
{
"from": "gpt",
"value": "Yes, it is technically possible to allocate all the computing capa... |
The standalone flashplayer takes no arguments other than a .swf file when you launch it from the command line. I need the player to go full screen, no window borders and such. This can be accomplished by hitting ctrl+f once the program has started. I want to do this programmatically as I need it to launch into full scr... | It looks like you've already found a workaround using `xsendkey` to simulate the `Ctrl+F` keystroke to make the Adobe Flash Player go full screen. If you're interested in a more detailed explanation or alternative approaches, here are some options you might consider:
### Using `xdotool`
You can use `xdotool` to simul... | 30,840 | [
{
"from": "human",
"value": "The standalone flashplayer takes no arguments other than a .swf file when you launch it from the command line. I need the player to go full screen, no window borders and such. This can be accomplished by hitting ctrl+f once the program has started. I want to do this programmatic... |
I run VPC 2007 on my Vista business laptop with 4 gig RAM. I use VPC to run windows XP and maintain a VS2003 web project. At first everything was great. I assigned the VPC 512MB and did my work as usual. I also run Resharper and Visual SVN. Lately, the act of scrolling in a page causes the CPU to spike above 50, s... | It sounds like you're encountering some performance issues with your setup, which can be frustrating. Here are a few suggestions that may help improve the situation:
1. **Adjust Virtual Machine Resources**:
- While you've already tried changing the allocated memory, make sure that you're using an appropriate config... | 26,002 | [
{
"from": "human",
"value": "I run VPC 2007 on my Vista business laptop with 4 gig RAM. I use VPC to run windows XP and maintain a VS2003 web project. At first everything was great. I assigned the VPC 512MB and did my work as usual. I also run Resharper and Visual SVN. Lately, the act of scrolling in a... |
How can I use WIA and Twain in C#? The TWIAIN/C# example found at http://www.codeproject.com/KB/dotnet/twaindotnet.aspx Throws an exception at line 59 on TwainLib.cs "an attempt was made to load a program with an incorrect format." on Vista 64.
I would use WIA but it does not have support for all of the devices I want ... | Using TWAIN and WIA (Windows Image Acquisition) in C# can be a bit tricky, particularly due to differences in device support and API design. Here's a brief overview of each approach and how you can use them.
### Using TWAIN in C#
To use TWAIN, you can either directly use a library or write your own wrapper for it. A ... | 29,652 | [
{
"from": "human",
"value": "How can I use WIA and Twain in C#? The TWIAIN/C# example found at http://www.codeproject.com/KB/dotnet/twaindotnet.aspx Throws an exception at line 59 on TwainLib.cs \"an attempt was made to load a program with an incorrect format.\" on Vista 64.\nI would use WIA but it does not... |
Given two absolute paths, e.g.
/var/data/stuff/xyz.dat
/var/data
How can one create a relative path that uses the second path as its base? In the example above, the result should be: ./stuff/xyz.dat
| To create a relative path from one absolute path to another, you can follow these steps:
1. **Identify the Base and Target Paths**:
- Base Path: `/var/data`
- Target Path: `/var/data/stuff/xyz.dat`
2. **Remove the Base Path from the Target Path**:
- The target path `/var/data/stuff/xyz.dat` can be transforme... | 33,189 | [
{
"from": "human",
"value": "Given two absolute paths, e.g.\n/var/data/stuff/xyz.dat\n/var/data\n\nHow can one create a relative path that uses the second path as its base? In the example above, the result should be: ./stuff/xyz.dat\n"
},
{
"from": "gpt",
"value": "To create a relative path from... |
How do I escape a string in SQL Server's stored procedure so that it is safe to use in LIKE expression.
Suppose I have an NVARCHAR variable like so:
declare @myString NVARCHAR(100);
And I want to use it in a LIKE expression:
... WHERE ... LIKE '%' + @myString + '%';
How do I escape the string (more specifically, char... | To safely use a string in a `LIKE` expression in SQL Server while escaping special characters, you'll need to replace the wildcard characters `%` and `_` with their escape sequences. In SQL Server, the `%` character represents zero or more characters, and the `_` character represents a single character in the `LIKE` ex... | 33,736 | [
{
"from": "human",
"value": "How do I escape a string in SQL Server's stored procedure so that it is safe to use in LIKE expression.\nSuppose I have an NVARCHAR variable like so:\ndeclare @myString NVARCHAR(100);\n\nAnd I want to use it in a LIKE expression:\n... WHERE ... LIKE '%' + @myString + '%';\n\nHow... |
I am learning to use LabVIEW as part of my honours project, and was wondering what benefits the graphical programming language has over a textual one?
| LabVIEW (Laboratory Virtual Instrument Engineering Workbench) is a graphical programming language particularly popular in engineering and scientific fields for its unique approach to programming. Here are several benefits of using LabVIEW over traditional textual programming languages:
1. **Visual Representation**: La... | 32,358 | [
{
"from": "human",
"value": "I am learning to use LabVIEW as part of my honours project, and was wondering what benefits the graphical programming language has over a textual one?\n"
},
{
"from": "gpt",
"value": "LabVIEW (Laboratory Virtual Instrument Engineering Workbench) is a graphical progra... |
I have what I imagine to be a pretty standard web-interface.
There are 4 different ListViews (grid controls) which are accessed by a series of Tabs on the top.
I have implemented this as follows:
alt text http://img402.imageshack.us/img402/1530/pagedu8.jpg
Tab 1 will load Page 1 containing Grid 1 into Frame 2, Tab 2 ... | Your current approach with frames is functional, but using frames can lead to various issues, including challenges with navigation, SEO, and user experience. Instead, consider using a single-page application (SPA) approach, or a more dynamic loading strategy with a modern front-end framework or technology stack. Here a... | 27,190 | [
{
"from": "human",
"value": "I have what I imagine to be a pretty standard web-interface.\nThere are 4 different ListViews (grid controls) which are accessed by a series of Tabs on the top. \nI have implemented this as follows:\nalt text http://img402.imageshack.us/img402/1530/pagedu8.jpg\nTab 1 will load ... |
The activity monitor in sql2k8 allows us to see the most expensive queries. Ok, that's cool, but is there a way I can log this info or get this info via query analyser? I don't really want to have the Sql Management console open and me looking at the activity monitor dashboard.
I want to figure out which queries are po... | Yes, you can retrieve information about expensive queries in SQL Server 2008 without using the Activity Monitor GUI. There are several methods you can use to log or analyze the performance of queries through T-SQL queries or by utilizing Dynamic Management Views (DMVs). Here are some approaches:
### 1. Using Dynamic M... | 29,671 | [
{
"from": "human",
"value": "The activity monitor in sql2k8 allows us to see the most expensive queries. Ok, that's cool, but is there a way I can log this info or get this info via query analyser? I don't really want to have the Sql Management console open and me looking at the activity monitor dashboard.\... |
I am trying to come up with the best data structure for use in a high throughput C++ server. The data structure will be used to store anything from a few to several million objects, and no sorting is required (though a unique sort key can be provided very cheaply).
The requirements are that it can support efficient ins... | Given your requirements for a high-throughput C++ server with the need for thread-safe operations that can handle a large number of objects while allowing concurrent reads and modifications, here are a few potential data structure designs that may meet your criteria:
### 1. **Lock-Free Linked List**
A lock-free linked... | 30,281 | [
{
"from": "human",
"value": "I am trying to come up with the best data structure for use in a high throughput C++ server. The data structure will be used to store anything from a few to several million objects, and no sorting is required (though a unique sort key can be provided very cheaply).\nThe requirem... |
I have an app where I create many uiviews and add them to the self.view of the UIViewController. My app is running really slowly. I am releasing all of my objects and have no memory leaks (I ran the performance tool). Can anyone tell me what could be making my app so slow? (code is below)
[EDIT] The array has around 30... | There are several potential issues in your `loadView` method that might be contributing to the slowdown of your app. Let's go through them one by one:
1. **Releasing Objects in the Loop**:
- You are releasing `item` within the loop, but `item` is a string from `arrayTitles` and you should not be releasing it. It is... | 26,340 | [
{
"from": "human",
"value": "I have an app where I create many uiviews and add them to the self.view of the UIViewController. My app is running really slowly. I am releasing all of my objects and have no memory leaks (I ran the performance tool). Can anyone tell me what could be making my app so slow? (code... |
I am currently porting a lot of code from an MFC-based application to a DLL for client branding purposes.
I've come across an unusual problem. This bit of code is the same in both systems:
// ...
CCommsProperties props;
pController->GetProperties( props );
if (props.handshake != HANDSHAKE_RTS_CTS)
{
... | It sounds like you are experiencing an issue with how the `CCommsProperties` object is being handled or modified between the two different environments (MFC application vs DLL). Let's consider some potential causes and solutions for this problem:
### Possible Causes
1. **Initialization of `CCommsProperties`:**
- ... | 25,675 | [
{
"from": "human",
"value": "I am currently porting a lot of code from an MFC-based application to a DLL for client branding purposes.\nI've come across an unusual problem. This bit of code is the same in both systems:\n// ...\n CCommsProperties props;\n\n pController->GetProperties( props );\n if ... |
I'm using a web service that returns a dataset. in this dataset there are 5 table, let's say table A, B, C, D, E. I use table A.
So
DataTable dt = new DataTable()
dt = dataset.Table["A"]
Now in this datatable there are columns a1,a2,a3,a4,a5,a6,a7.
Let's say I only want to get columns a3 and a4 then bind it to my dat... | To bind specific columns from a `DataTable` to a `DataGrid`, you can create a new `DataTable` that only contains the columns you need (in this case, `a3` and `a4`). After that, you can set the `DataGrid`'s `ItemsSource` to this new `DataTable`.
Here's an example of how to achieve this in C#:
```csharp
// Assuming you... | 32,123 | [
{
"from": "human",
"value": "I'm using a web service that returns a dataset. in this dataset there are 5 table, let's say table A, B, C, D, E. I use table A.\nSo \nDataTable dt = new DataTable()\ndt = dataset.Table[\"A\"]\n\nNow in this datatable there are columns a1,a2,a3,a4,a5,a6,a7.\nLet's say I only wan... |
How do implement the iterator pattern in VB.NET, which does not have the yield keyword?
| The iterator pattern is a design pattern that allows sequential access to the elements of a collection without exposing the underlying structure. Although VB.NET does not have the `yield` keyword like C#, you can still implement the iterator pattern using the `IEnumerable` and `IEnumerator` interfaces. Below, I'll guid... | 28,961 | [
{
"from": "human",
"value": "How do implement the iterator pattern in VB.NET, which does not have the yield keyword?\n"
},
{
"from": "gpt",
"value": "The iterator pattern is a design pattern that allows sequential access to the elements of a collection without exposing the underlying structure. ... |
How have you explained nested arrays to a programmer. I'm thinking someone that has an entry level understanding of programming, but is trying to do more complicated coding.
The array with array works, but they can't quite get their mind around the idea.
Edit: example of a nested array:
array(
'array1' => array(
... | Explaining nested arrays to someone with an entry-level understanding of programming can be approached by breaking down the concepts and using relatable analogies. Here’s how you might explain it:
### What is an Array?
First, ensure they understand what a basic array is. You can explain it like this:
- **Array**: Th... | 27,499 | [
{
"from": "human",
"value": "How have you explained nested arrays to a programmer. I'm thinking someone that has an entry level understanding of programming, but is trying to do more complicated coding.\nThe array with array works, but they can't quite get their mind around the idea.\nEdit: example of a nes... |
I have multiple processes monitoring an MSMQ queue. I want to do multi-step operations like first peek the message and then based on some criteria receive the message. A single message may pass the receiving criteria of multiple processes so that more than one process may try to receive the same message. Will these ope... | Using Microsoft Message Queuing (MSMQ), it's important to understand how message processing and locking work to maintain thread safety and avoid message duplication in a multi-process scenario.
### Understanding MSMQ Behavior
1. **Peek vs. Receive**:
- **Peek**: This operation allows you to read the message without... | 31,364 | [
{
"from": "human",
"value": "I have multiple processes monitoring an MSMQ queue. I want to do multi-step operations like first peek the message and then based on some criteria receive the message. A single message may pass the receiving criteria of multiple processes so that more than one process may try to... |
I have recently started working on a very large C++ project that, after completing 90% of the implementation, has determined that they need to demonstrate 100% branch coverage during testing. The project is hosted on an embedded platform (Green Hills Integrity). I'm looking for suggestions and experiences from others... | Achieving 100% branch coverage in a large C++ project, particularly in an embedded environment like Green Hills Integrity, can be quite a challenge. Here are some suggestions and considerations based on experiences from others who have worked with code coverage tools in similar contexts:
### 1. Choose the Right Tool
... | 31,838 | [
{
"from": "human",
"value": "I have recently started working on a very large C++ project that, after completing 90% of the implementation, has determined that they need to demonstrate 100% branch coverage during testing. The project is hosted on an embedded platform (Green Hills Integrity). I'm looking fo... |
OS: Vista enterprise
When i switch between my home and office network, i always face issues with getting connected to the network. Almost always I have to use the diagnostic service in 'Network and sharing center' and the problem gets solved when i use the reset network adapter option.
This takes a lot of time (3-4 min... | To quickly reset your network adapter in Windows Vista, you can create a batch file or use a simple command in the Command Prompt. Although Windows Vista does not have PowerShell, you can use the following batch commands to disable and enable your network adapter, which should effectively reset it.
Here's how to do it... | 31,841 | [
{
"from": "human",
"value": "OS: Vista enterprise\nWhen i switch between my home and office network, i always face issues with getting connected to the network. Almost always I have to use the diagnostic service in 'Network and sharing center' and the problem gets solved when i use the reset network adapter... |
After some time I wanted to update my git repo, and then something went wrong. What is the proper way out of this situation?
mblsha@siruba:~/src/psi/ $ git status
iris: needs merge
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: src/common.cpp
#
# Changed ... | From the output you've provided, it looks like you're in the middle of a merge conflict in your Git repository, particularly with the submodule `iris`. Let's break down the steps you can take to resolve the situation.
### Steps to Resolve Merge Conflicts
1. **Identify the Conflict**: You have an unmerged status for t... | 31,676 | [
{
"from": "human",
"value": "After some time I wanted to update my git repo, and then something went wrong. What is the proper way out of this situation?\nmblsha@siruba:~/src/psi/ $ git status\niris: needs merge\n# On branch master\n# Changes to be committed:\n# (use \"git reset HEAD <file>...\" to unstag... |
What's the easiest method people have found to monitor memcached on Windows? One method I've tried, which works decently:
telnet into the memcached port (11211) and enter the "stats" command. You'll get back a listing like this:
stats
STAT pid 2816
STAT uptime 791
STAT time 1225918895
STAT version 1.2.1
STAT pointer_si... | While using `telnet` to check memcached stats via the `stats` command is a common and straightforward method, there are a few alternative approaches that can make monitoring memcached on Windows easier and more automated. Here are some options:
1. **Using a GUI Tool**: There are graphical user interface (GUI) tools th... | 32,165 | [
{
"from": "human",
"value": "What's the easiest method people have found to monitor memcached on Windows? One method I've tried, which works decently:\ntelnet into the memcached port (11211) and enter the \"stats\" command. You'll get back a listing like this:\nstats\nSTAT pid 2816\nSTAT uptime 791\nSTAT ti... |
Does anyone know of a really simple way of publishing Java methods as web services? I don't really want the overhead of using Tomcat or Jetty or any of the other container frameworks.
Scenario: I've got a set of Java methods in a service type application that I want to access from other machines on the local LAN.
| If you want to publish Java methods as web services without the overhead of using a full-fledged application server like Tomcat or Jetty, you have a few lightweight options. Here are some straightforward approaches you can consider:
### 1. **Using Spark Java**
[**Spark Java**](http://sparkjava.com/) is a micro-framew... | 28,664 | [
{
"from": "human",
"value": "Does anyone know of a really simple way of publishing Java methods as web services? I don't really want the overhead of using Tomcat or Jetty or any of the other container frameworks.\nScenario: I've got a set of Java methods in a service type application that I want to access f... |
I have a custom class that implements ICollection, and this class is readonly, ie. IsReadOnly returns true (as opposed to using the readonly keyword), and all functions that would normally modify the data in the collection throw InvalidOperationException's.
Now, given such a construct, and a quick skim over the thread-... | Returning a new `Object()` instance for the `SyncRoot` property in your implementation of `ICollection` does indeed create several potential issues, even in a readonly collection. Let's discuss the implications and alternatives:
### 1. **Thread Safety**
When implementing the `SyncRoot` property, it is crucial to provi... | 31,409 | [
{
"from": "human",
"value": "I have a custom class that implements ICollection, and this class is readonly, ie. IsReadOnly returns true (as opposed to using the readonly keyword), and all functions that would normally modify the data in the collection throw InvalidOperationException's.\nNow, given such a co... |
I've created a copy utility in c# (.NET 2.0 Framework) that copies files, directories and recursive sub directories etc. The program has a GUI that shows the current file being copied, the current file number (sequence), the total number of files to be copied and the percentage completed for the copy operations. There ... | Given your constraints (using .NET 2.0 and needing to track progress for large file copies), the best solution is to implement a custom file copy method that allows you to track the number of bytes copied. Unfortunately, the `FileInfo.CopyTo` method does not provide progress callbacks or events, so you will need to man... | 26,499 | [
{
"from": "human",
"value": "I've created a copy utility in c# (.NET 2.0 Framework) that copies files, directories and recursive sub directories etc. The program has a GUI that shows the current file being copied, the current file number (sequence), the total number of files to be copied and the percentage ... |
I have started using Presentation Model w/ ASP.NET webforms and like the pattern quite a bit. What I am really having an issue with is where to instantiate some of my classes, mostly the presentation model, my business object, and things like the data for drop down lists. So I could use some tips or a complete example ... | The Presentation Model pattern is an excellent choice for ASP.NET Web Forms applications as it helps separate concerns, making your codebase more maintainable and testable. In this pattern, the Presentation Model acts as a mediator between the View (ASP.NET Web Forms UI) and the Model (business logic and data).
Below ... | 26,292 | [
{
"from": "human",
"value": "I have started using Presentation Model w/ ASP.NET webforms and like the pattern quite a bit. What I am really having an issue with is where to instantiate some of my classes, mostly the presentation model, my business object, and things like the data for drop down lists. So I c... |
I am connecting to CRM with the intention of retrieving a list of picklist values. On my development machine I am working under my own login name and all works fine. On the test server, the code executes under the NETWORK SERVICE account. When it connects to the CRM web service everything is great. When it connects to ... | The `401 Unauthorized` error you're encountering when trying to access the CRM Metadata service typically indicates that the service account under which your application is running (in this case, the `NETWORK SERVICE` account) does not have sufficient permissions to access the CRM metadata.
Here are some potential rea... | 30,198 | [
{
"from": "human",
"value": "I am connecting to CRM with the intention of retrieving a list of picklist values. On my development machine I am working under my own login name and all works fine. On the test server, the code executes under the NETWORK SERVICE account. When it connects to the CRM web service ... |
I'm looking for a similar control to the InputFormSection control in Sharepoint that I want to use in a regular web page that doesn't run in the context of Sharepoint. Here's how the inputformsection looks like : http://graegert.com/wp-content/uploads/2008/01/moss_adminarea_page_structure1.png
| If you're looking to replicate the functionality and visual style of the SharePoint `InputFormSection` control on a regular web page, you can create a similar section using HTML, CSS, and JavaScript. The `InputFormSection` is often used to group input fields and organize forms into visually distinct sections, typically... | 26,647 | [
{
"from": "human",
"value": "I'm looking for a similar control to the InputFormSection control in Sharepoint that I want to use in a regular web page that doesn't run in the context of Sharepoint. Here's how the inputformsection looks like : http://graegert.com/wp-content/uploads/2008/01/moss_adminarea_page... |
I have an XML document which looks like this:
<xconnect>
<type>OK</type>
<response/>
<report>
<id>suppressionlist_get</id>
<name>Suppression List Get</name>
<timestamp>24 Oct 08 @ 10:16AM</timestamp>
<records type=\"user\"/>
<records type=\"client\"/>
<records type=\"group\">
<record>
... | To bind the XML data to a GridView in ASP.NET, you'll want to make sure that your XML structure is parsed correctly so that you can extract the records you need for display. Since your XML has a hierarchy and you're mainly interested in the `<record>` elements under `<records type="group">`, you can follow these steps:... | 28,727 | [
{
"from": "human",
"value": "I have an XML document which looks like this:\n<xconnect>\n<type>OK</type>\n<response/>\n<report>\n <id>suppressionlist_get</id>\n <name>Suppression List Get</name>\n <timestamp>24 Oct 08 @ 10:16AM</timestamp>\n <records type=\\\"user\\\"/>\n <records type=\\\"cli... |
I'm looking to convert the following mod_rewrite rule to the Nginx equivalent:
RewriteRule ^foo/(.*)$ /bar/index.php?title=$1 [PT,L,QSA]
RewriteRule ^foo/*$ /bar/index.php [L,QSA]
So far I have:
rewrite ^foo/(.*)$ /bar/index.php?title=$1&$query_string last;
rewrite ^foo/?$ /bar/index.php?$query_string break;
The prob... | In Nginx, handling query strings in rewrite rules is done a bit differently compared to Apache's mod_rewrite. The `QSA` (Query String Append) functionality in Apache can be replicated in Nginx by explicitly including the `$query_string` variable in the target URI.
Here’s how you can convert your mod_rewrite rules into... | 33,046 | [
{
"from": "human",
"value": "I'm looking to convert the following mod_rewrite rule to the Nginx equivalent:\nRewriteRule ^foo/(.*)$ /bar/index.php?title=$1 [PT,L,QSA]\nRewriteRule ^foo/*$ /bar/index.php [L,QSA]\n\nSo far I have:\nrewrite ^foo/(.*)$ /bar/index.php?title=$1&$query_string last;\nrewrite ^foo/?... |
I have several server processes that once in a while respond to messages from the clients and perform read-only transactions.
After about a few days that the servers are running, they stop working correctly and when I check it turns out that there's a whole bunch of messages about the connection being closed.
When I ch... | It sounds like you're dealing with connection issues related to your database and Hibernate configuration. Here are several suggestions that might help you address the problem of connections being closed after a certain period:
1. **Connection Pool Configuration**: Ensure that your c3p0 connection pool is configured p... | 30,794 | [
{
"from": "human",
"value": "I have several server processes that once in a while respond to messages from the clients and perform read-only transactions.\nAfter about a few days that the servers are running, they stop working correctly and when I check it turns out that there's a whole bunch of messages ab... |
In Joel's article for Inc. entitled How Hard Could It Be?: The Unproven Path, he wrote:
...it turns out that Jeff and his
programmers were so good that they
built a site that could serve 80,000
visitors a day (roughly 755,000 page
views)
How would I go about figuring out the maximum load my server(s) can hand... | Determining the maximum load your server(s) can handle involves several steps. Here’s a process you can follow to figure it out:
### 1. **Understand Your Application:**
- Identify the nature of your application (e.g., static vs. dynamic content, database interactions).
- Know the average resources (CPU, RAM, Dis... | 30,660 | [
{
"from": "human",
"value": "In Joel's article for Inc. entitled How Hard Could It Be?: The Unproven Path, he wrote:\n\n...it turns out that Jeff and his\n programmers were so good that they\n built a site that could serve 80,000\n visitors a day (roughly 755,000 page\n views)\n\nHow would I go about fi... |
Is there a built in VB.NET function to format a number as an Ordinal or do I have to write my own?
There isn't in C# so I'm thinking there isn't :(
| VB.NET does not have a built-in function specifically for formatting numbers as ordinals, similar to C#. However, you can easily create your own function to achieve this. Below is a simple example of how to create a function that converts an integer to its ordinal representation:
```vb.net
Public Function ToOrdinal(By... | 34,270 | [
{
"from": "human",
"value": "Is there a built in VB.NET function to format a number as an Ordinal or do I have to write my own?\nThere isn't in C# so I'm thinking there isn't :( \n"
},
{
"from": "gpt",
"value": "VB.NET does not have a built-in function specifically for formatting numbers as ordi... |
I'm trying to write an import rakefile for Redmine. It uses ruby on rails. I'm not a rails developer but we do like using redmine for project and issues management.
require 'rubygmes'
require 'fastercsv'
# csv issues import for redmine
# Will convert a csv into a issues bulkloader into redmine
# Column names
# row[0]=... | You're encountering several issues in your Rakefile, both syntactical and logical. Let's address them step by step and provide a corrected version of your script.
### Key Issues to Address
1. **Require Statements**:
- You have a typo in `require 'rubygmes'`. It should be `require 'rubygems'`.
- Since you're usi... | 29,433 | [
{
"from": "human",
"value": "I'm trying to write an import rakefile for Redmine. It uses ruby on rails. I'm not a rails developer but we do like using redmine for project and issues management.\nrequire 'rubygmes'\nrequire 'fastercsv'\n\n# csv issues import for redmine\n# Will convert a csv into a issues bu... |
I have just installed the Krypton Toolkit 3.0.6 from component Factory.
I find that in the create new Project Dialog Box , Krypton Form does not show up as an option. I am sure it used to show up ( and I have actually used it in an earlier version of krypton toolkit).But after the new install it does not.
| It sounds like you're experiencing an issue with the Krypton Toolkit not displaying the Krypton Form option in the "Create New Project" dialog. Here are a few troubleshooting steps you can take to resolve this issue:
1. **Check Installation**: Make sure that the Krypton Toolkit installation was completed successfully.... | 33,638 | [
{
"from": "human",
"value": "I have just installed the Krypton Toolkit 3.0.6 from component Factory.\nI find that in the create new Project Dialog Box , Krypton Form does not show up as an option. I am sure it used to show up ( and I have actually used it in an earlier version of krypton toolkit).But after ... |
Java process control is notoriously bad - primarily due to inadequate support by the Java VM/JDK classes (e.g. java.lang.Process).
I am wondering, are there any good open source libraries out there that are reliable.
The requirements would be:
OSS
Start/Stop processes
Manage STDIN and STDOUT
cross platform (at least L... | There are several open-source libraries that provide more advanced process control capabilities compared to the basic `java.lang.Process`. Here are a few options that you might consider:
1. **Apache Commons Exec**:
- **URL**: [Apache Commons Exec](https://commons.apache.org/proper/commons-exec/)
- **Description*... | 27,505 | [
{
"from": "human",
"value": "Java process control is notoriously bad - primarily due to inadequate support by the Java VM/JDK classes (e.g. java.lang.Process).\nI am wondering, are there any good open source libraries out there that are reliable.\nThe requirements would be:\n\nOSS\nStart/Stop processes\nMan... |
What is the difference between the CIL instructions "Call" and "Callvirt"?
| In Common Intermediate Language (CIL), which is the low-level programming language used by the .NET framework, there are two instructions for invoking methods: `call` and `callvirt`. The key difference between them lies in how they handle method dispatch and their applicability to instance methods.
### `call`
- **Use ... | 30,445 | [
{
"from": "human",
"value": "What is the difference between the CIL instructions \"Call\" and \"Callvirt\"?\n"
},
{
"from": "gpt",
"value": "In Common Intermediate Language (CIL), which is the low-level programming language used by the .NET framework, there are two instructions for invoking meth... |
I want a method of the class: "One" ("AccessibleWithinSameNamespace") to be accessible by the class: "Two", without having "Two" extending "One".
Both classes are in the same namespace, so I'm thinking that maybe there's an access-modifier that emulates the "protected" modifyer, but for namespaces.
Some code:
namespace... | In C#, there isn't a specific access modifier that allows you to expose class members only to other classes in the same namespace while being more restrictive than `public` and less so than `protected`. However, you can achieve similar functionality using the `internal` access modifier.
The `internal` modifier allows... | 32,612 | [
{
"from": "human",
"value": "I want a method of the class: \"One\" (\"AccessibleWithinSameNamespace\") to be accessible by the class: \"Two\", without having \"Two\" extending \"One\".\nBoth classes are in the same namespace, so I'm thinking that maybe there's an access-modifier that emulates the \"protecte... |
Im building a web application which is a process management app. Several different employee types will be shown a list of Tasks to do and as each one completes a task then it is moved on to the next employee to work on.
The Task hierarchy is Batch > Load > Assembly > Part > Task. There are currently 8 rules for determ... | Given your requirements and concerns, there are several approaches you could take for implementing the task management system. I'll outline a few options, including their benefits and potential drawbacks, to help you make an informed decision.
### Option 1: Database-Driven Rules (T-SQL)
**Benefits:**
- **Performance:... | 26,179 | [
{
"from": "human",
"value": "Im building a web application which is a process management app. Several different employee types will be shown a list of Tasks to do and as each one completes a task then it is moved on to the next employee to work on.\nThe Task hierarchy is Batch > Load > Assembly > Part > Tas... |
I am developing a java web app using servlet, in order to prevent user from hitting the back button to see previous users' info, I have the following code :
protected void processRequest(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException
{
HttpSessi... | To prevent users from being able to view previous users' information when they hit the back button in a Java web application, you need to ensure that sensitive pages are not cached by the browser. The code you have implemented is a good start, but there are a few additional points to consider to make sure that the back... | 27,027 | [
{
"from": "human",
"value": "I am developing a java web app using servlet, in order to prevent user from hitting the back button to see previous users' info, I have the following code :\n protected void processRequest(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOE... |
Let's make a list of answers where you post your excellent and favorite extension methods.
The requirement is that the full code must be posted and a example and an explanation on how to use it.
Based on the high interest in this topic I have setup an Open Source Project called extensionoverflow on Codeplex.
Please m... | Here's a useful extension method that I think would be a great addition to the extensionoverflow project: a method for converting a string to title case. This can be particularly helpful for formatting strings for display, such as in user interfaces or reports.
### Title Case Extension Method
```csharp
using System;
... | 32,143 | [
{
"from": "human",
"value": "Let's make a list of answers where you post your excellent and favorite extension methods. \nThe requirement is that the full code must be posted and a example and an explanation on how to use it.\nBased on the high interest in this topic I have setup an Open Source Project call... |
I want the most performat way to read and parse a file.
Is it possible to read a file in .NET, but not load the entire file into memory? i.e. just load the file line by line as I parse the content of each row?
Does XmlTextReader load the entire file into memory or does it stream the file into memory as it reads the fi... | In .NET, you can read and parse a file line by line without loading the entire file into memory by using classes such as `StreamReader` or `FileStream`. These classes allow you to read the file incrementally, which is particularly useful for large files. Here's a brief overview of how you can achieve this:
### Using `... | 29,009 | [
{
"from": "human",
"value": "I want the most performat way to read and parse a file.\nIs it possible to read a file in .NET, but not load the entire file into memory? i.e. just load the file line by line as I parse the content of each row?\nDoes XmlTextReader load the entire file into memory or does it str... |
My screenshot http://dl.getdropbox.com/u/240752/stars.gif
I want to have it so that only the text is underlined. The only way I can see of doing this is this:
.no-underline {
text-decoration:none;
}
.underline {
text-decoration:underline;
}
<a href="#" class="no-underline"><span class="underline">Average customer... | Your approach is a common way to achieve the desired effect of underlining only the text while excluding the image, and it works well. However, there is a more streamlined way to achieve this without needing two separate classes. You can simply use the `text-decoration` property directly on the text element, which is a... | 33,512 | [
{
"from": "human",
"value": "My screenshot http://dl.getdropbox.com/u/240752/stars.gif\nI want to have it so that only the text is underlined. The only way I can see of doing this is this:\n.no-underline {\n text-decoration:none;\n}\n.underline {\n text-decoration:underline;\n}\n\n<a href=\"#\" class=\"n... |
What is appropriate way to integrate SpringSecurity with Capcha ?
I have following use case :
When user will tries to login, if we he failed to login N times, captcha will be displayed, so authentication will be using three parameters : username, password, captcha. But Spring Security doesn't support built in Captcha ... | Integrating CAPTCHA with Spring Security for login attempts can be a great way to enhance security and mitigate brute force attacks. You're on the right track with your thoughts on how to implement this, and there are several ways to approach it. Below, I’ll outline your options and some recommendations.
### Options f... | 21,804 | [
{
"from": "human",
"value": "What is appropriate way to integrate SpringSecurity with Capcha ? \nI have following use case :\nWhen user will tries to login, if we he failed to login N times, captcha will be displayed, so authentication will be using three parameters : username, password, captcha. But Spring... |
I have a class that stores a serialized value and a type. I want to have a property/method returning the value already casted:
public String Value { get; set; }
public Type TheType { get; set; }
public typeof(TheType) CastedValue { get { return Convert.ChangeType(Value, typeof(_Type)); }
Is this possible in C#?
| Yes, you can achieve this in C#, but there are a few issues in your code that need to be corrected.
1. You can't use `typeof(TheType)` in your property since `TheType` is a variable, not a type at compile-time.
2. You should use `Convert.ChangeType(Value, TheType)` to convert the string to the type specified in `TheTy... | 31,956 | [
{
"from": "human",
"value": "I have a class that stores a serialized value and a type. I want to have a property/method returning the value already casted:\npublic String Value { get; set; }\n\npublic Type TheType { get; set; }\n\npublic typeof(TheType) CastedValue { get { return Convert.ChangeType(Value, t... |
I'm using the GGeoXml object to overlay KML on an embedded Google Map. I need to customize the popup balloon for placemarks, so I'm trying to use the <BalloonStyle> element:
<?xml version="1.0" encoding="utf-8"?>
<Document xmlns="http://earth.google.com/kml/2.0">
<name>Concessions</name>
<Style id="masterPolySt... | Unfortunately, the Google Maps JavaScript API, specifically when using the GGeoXml object, does not fully support KML features like `<BalloonStyle>`. While your KML might render correctly in Google Earth, certain elements such as customized balloon popups are ignored by the Google Maps API.
If you want to maintain a ... | 24,755 | [
{
"from": "human",
"value": "I'm using the GGeoXml object to overlay KML on an embedded Google Map. I need to customize the popup balloon for placemarks, so I'm trying to use the <BalloonStyle> element:\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Document xmlns=\"http://earth.google.com/kml/2.0\">\n <n... |
Is there a way to set the initial path for the FileUpload widget in GWT.
So the next time the user presses the browse button he is put to the location he has been the last time (if existent).
| In GWT (Google Web Toolkit), the `FileUpload` widget does not have a direct method to set the initial path or to remember the last used directory for the file selection dialog. This limitation is due to security reasons; web browsers do not allow JavaScript (and thus GWT) to access the local file system directly or to ... | 32,193 | [
{
"from": "human",
"value": "Is there a way to set the initial path for the FileUpload widget in GWT.\nSo the next time the user presses the browse button he is put to the location he has been the last time (if existent).\n"
},
{
"from": "gpt",
"value": "In GWT (Google Web Toolkit), the `FileUpl... |
There are all sorts of advantages to using Emacs, but for someone comfortable with the usual Win32 applications it comes with a wall-like learning curve. With most other editors it’s possible to just start using them and then learn about their other features and enhancements as you go along.
How to just get on with us... | Getting comfortable with Emacs can indeed be challenging for users accustomed to more traditional text editors, but with a few strategies and a bit of customization, you can accelerate your learning and start to enjoy the unique advantages that Emacs has to offer. Here are some tips to help you transition smoothly and ... | 28,776 | [
{
"from": "human",
"value": "There are all sorts of advantages to using Emacs, but for someone comfortable with the usual Win32 applications it comes with a wall-like learning curve. With most other editors it’s possible to just start using them and then learn about their other features and enhancements as ... |
I'm looking for a Java library that is geared towards network math and already tested. Nothing particularly fancy, just something to hold ips and subnets, and do things like print a subnet mask or calculate whether an IP is within a given subnet.
Should I roll my own, or is there already a robust library for this?
| You don't need to roll your own library for handling network math in Java, as there are existing libraries that are well-tested and can accomplish what you're looking for. Here are a few popular Java libraries that deal with IP addresses, subnets, and related network calculations:
1. **Apache Commons Net**:
- This... | 33,524 | [
{
"from": "human",
"value": "I'm looking for a Java library that is geared towards network math and already tested. Nothing particularly fancy, just something to hold ips and subnets, and do things like print a subnet mask or calculate whether an IP is within a given subnet. \nShould I roll my own, or is ... |
I have an application that is made up of the following:
A central database containing 100k+ records
A number of "client" databases each containing around 10-20k records
The client databases contain details of contacts that each have a unique ID (contactID).
The central database contains some of these contacts identifie... | To optimize the synchronization between your client databases and the central database while minimizing the number of web service calls, your proposed approach of using batch file processing is a sound strategy. Here’s a step-by-step outline of how to implement this efficiently:
### 1. File Generation
- **Create Expor... | 29,468 | [
{
"from": "human",
"value": "I have an application that is made up of the following:\nA central database containing 100k+ records\nA number of \"client\" databases each containing around 10-20k records\nThe client databases contain details of contacts that each have a unique ID (contactID).\nThe central dat... |
Possible Duplicate:
Big integers in C#
I want to be able to process arbitrarily large numbers in C#.
I can live with just integers.
Are there established algorithms for this kind of thing?
Or is there a good 3rd-party library?
I might consider changing language if there really is no good way to do it in C#.
Th... | In C#, you can handle arbitrarily large integers using the built-in `BigInteger` type provided by the `System.Numerics` namespace. The `BigInteger` structure can represent integers of any size, limited only by the available memory of your machine.
Here’s how you can use `BigInteger` in C#:
1. First, ensure that you h... | 28,799 | [
{
"from": "human",
"value": "\nPossible Duplicate:\nBig integers in C# \n\nI want to be able to process arbitrarily large numbers in C#.\nI can live with just integers. \nAre there established algorithms for this kind of thing?\nOr is there a good 3rd-party library? \nI might consider changing language if... |
When upgrading MySQL, I first create a backup of the database. Then I will uninstall the current version installed, and delete all the files that were left by the installer. Then I install the latest GA version, and restore the created back-up, using the MySQL Administrator.
Is there a better way of doing an upgrade of... | Upgrading MySQL can be a critical task, especially in a production environment. Your current process involves uninstalling the old version and then reinstalling the new one, which can be quite disruptive and may lead to additional manual reconfiguration. Fortunately, there are more efficient methods to upgrade MySQL th... | 26,344 | [
{
"from": "human",
"value": "When upgrading MySQL, I first create a backup of the database. Then I will uninstall the current version installed, and delete all the files that were left by the installer. Then I install the latest GA version, and restore the created back-up, using the MySQL Administrator.\nIs... |
We're trying to track down some .Net assembly dependency problems.
On Windows XP, does the .Net 3.5 installer include 3.0 SP2 automatically?
| Yes, the .NET Framework 3.5 installer on Windows XP includes .NET Framework 3.0 and .NET Framework 2.0, which means that it also includes Service Pack 2 (SP2) for .NET Framework 3.0 automatically. When you install .NET Framework 3.5, it installs the necessary components of the previous versions (2.0 and 3.0) as part of... | 35,336 | [
{
"from": "human",
"value": "We're trying to track down some .Net assembly dependency problems.\nOn Windows XP, does the .Net 3.5 installer include 3.0 SP2 automatically?\n"
},
{
"from": "gpt",
"value": "Yes, the .NET Framework 3.5 installer on Windows XP includes .NET Framework 3.0 and .NET Fra... |
I have an MS Access 2002 database with password security.
When I exit the application, the password dialog box reappears. Now, after this I can only exit the application if I give in the password again or press Cancel.
I don't know why this dialog appears on exit.
| The issue you're experiencing with the password dialog box reappearing when you try to exit your MS Access 2002 application could be due to several reasons related to how the application is managing security and the database. Here are some potential causes and solutions you can explore:
### Possible Causes and Solutio... | 29,580 | [
{
"from": "human",
"value": "I have an MS Access 2002 database with password security. \nWhen I exit the application, the password dialog box reappears. Now, after this I can only exit the application if I give in the password again or press Cancel.\nI don't know why this dialog appears on exit.\n"
},
{... |
Dumb question I'm sure, but why does Entity Framework EntityDataSource object require the where clause to contain 'it' as the first part of the object selector?
The documentation for the where clause (http://msdn.microsoft.com/en-us/library/cc488531.aspx) states that the string is passed directly to the ObjectQuery(T),... | This is a great question and not a dumb one at all! The requirement to use `it` in the `where` clause of an `EntityDataSource` is indeed specific to how Entity Framework works with the LINQ to Entities query language.
When you are working with `EntityDataSource`, the `where` clause that you specify is translated into ... | 32,456 | [
{
"from": "human",
"value": "Dumb question I'm sure, but why does Entity Framework EntityDataSource object require the where clause to contain 'it' as the first part of the object selector?\nThe documentation for the where clause (http://msdn.microsoft.com/en-us/library/cc488531.aspx) states that the string... |
Is there a way to get the count of rows in all tables in a MySQL database without running a SELECT count() on each table?
| Yes, you can retrieve the row counts for all tables in a MySQL database without executing a `SELECT COUNT(*)` on each table individually by querying the `information_schema` database. Specifically, you can access the `TABLES` table within `information_schema`, which contains metadata about all tables in your database, ... | 33,499 | [
{
"from": "human",
"value": "Is there a way to get the count of rows in all tables in a MySQL database without running a SELECT count() on each table?\n"
},
{
"from": "gpt",
"value": "Yes, you can retrieve the row counts for all tables in a MySQL database without executing a `SELECT COUNT(*)` on... |
the problem I have is that I have two sets of values in a drop down list. If type 'A' is selected I want a text box to be populated with a value from the database and be read only. If Type 'B' is selected the box is to be empty and editable.
My original code is written in jsp/struts and I have sort of achieved this by ... | To achieve your requirements without having to reload the entire JSP page or use AJAX, you can utilize JavaScript to dynamically update the behavior of the text box based on the selected dropdown value. By using client-side JavaScript, you can manipulate the DOM to control whether the text box is read-only or editable ... | 31,641 | [
{
"from": "human",
"value": "the problem I have is that I have two sets of values in a drop down list. If type 'A' is selected I want a text box to be populated with a value from the database and be read only. If Type 'B' is selected the box is to be empty and editable.\nMy original code is written in jsp/s... |
All the PHP files in my workspace are encoded in Unicode (UTF-8, no BOM). I often duplicate an existing source file to use as a base for a new script. Invariably (with Path Finder or the original Finder), OS X will convert the encoding of the duplicate file to Western (Mac OS Roman).
Is there any way to make OS X behav... | Unfortunately, macOS does not provide a built-in way to change the default text encoding for files based on their extension when duplicating files. However, there are a couple of workarounds that you might find helpful:
### 1. Use Terminal to Create Duplicates
Instead of using Finder, you can use the Terminal to dupl... | 31,282 | [
{
"from": "human",
"value": "All the PHP files in my workspace are encoded in Unicode (UTF-8, no BOM). I often duplicate an existing source file to use as a base for a new script. Invariably (with Path Finder or the original Finder), OS X will convert the encoding of the duplicate file to Western (Mac OS Ro... |
I am trying to connect to 2 databases on the same instance of MySQL from 1 PHP script.
At the moment the only way I've figured out is to connect to both databases with a different user for each.
I am using this in a migration script where I am grabbing data from the original database and inserting it into the new one, ... | When dealing with multiple databases in MySQL from a single PHP script, you have a few options that can help you manage the connections more efficiently. Here are some suggestions:
### 1. Single Connection with Database Switching
You can establish a single connection and switch the database context using SQL commands.... | 24,514 | [
{
"from": "human",
"value": "I am trying to connect to 2 databases on the same instance of MySQL from 1 PHP script.\nAt the moment the only way I've figured out is to connect to both databases with a different user for each.\nI am using this in a migration script where I am grabbing data from the original d... |
I am looking to automate the conversion of an excel sheet into a pdf document (I do not want to manually print the report generated in excel as a pdf document every morning). For now, I would like to create a button in excel that will run the macro to automatically generate the pdf document, but this button will event... | Automating the conversion of an Excel sheet to a PDF document can be done using VBA (Visual Basic for Applications) in Excel. You don't need the Acrobat SDK for this task, as Excel has built-in functionalities to export sheets directly to PDF format.
Here’s a simple way to create a macro that converts the active sheet... | 32,572 | [
{
"from": "human",
"value": "I am looking to automate the conversion of an excel sheet into a pdf document (I do not want to manually print the report generated in excel as a pdf document every morning). For now, I would like to create a button in excel that will run the macro to automatically generate the... |
I believe I'm getting bitten by some combination of nested scoping rules and list comprehensions. Jeremy Hylton's blog post is suggestive about the causes, but I don't really understand CPython's implementation well-enough to figure out how to get around this.
Here is an (overcomplicated?) example. If people have a ... | The problem you are encountering is a classic issue with mutable default arguments and the way you are using the `counter` class's state management within your list comprehensions. Here's a breakdown of what's happening:
1. **Mutable Default Arguments**: Your `self.display` list is mutable. When you modify `self.displ... | 30,479 | [
{
"from": "human",
"value": "I believe I'm getting bitten by some combination of nested scoping rules and list comprehensions. Jeremy Hylton's blog post is suggestive about the causes, but I don't really understand CPython's implementation well-enough to figure out how to get around this. \nHere is an (ove... |
I was watching a tutorial on Rails and was very impressed that you could so easily create an editing system for a class just by defining it.
Can this be done in ASP.NET?
I know there are ORMs out there, but do they come with an editing system?
To explain what I mean by an editing system, consider a class for defining p... | ASP.NET provides several ways to create web applications with capabilities for creating and editing data, but it doesn't come with an out-of-the-box feature that mirrors the simplicity of the "CreateEditAbleClass" concept you mentioned in Rails. However, there are frameworks and libraries within the ASP.NET ecosystem t... | 31,767 | [
{
"from": "human",
"value": "I was watching a tutorial on Rails and was very impressed that you could so easily create an editing system for a class just by defining it.\nCan this be done in ASP.NET?\nI know there are ORMs out there, but do they come with an editing system?\nTo explain what I mean by an edi... |
I just downloaded and installed the latest Adventure Works database from http://www.codeplex.com/MSFTDBProdSamples/Release/ProjectReleases.aspx?ReleaseId=16040 to do some more playing around with LINQ and found that there are some data types that are not natively supported within Visual Studio 2008. I get the "One or m... | In SQL Server 2008, there were several data types that were not natively supported by Visual Studio 2008’s Data Tools. Some of these data types include:
1. **Spatial Data Types**: As you mentioned, the `geometry` and `geography` types are used for spatial data storage but are not supported by the Visual Studio designe... | 31,162 | [
{
"from": "human",
"value": "I just downloaded and installed the latest Adventure Works database from http://www.codeplex.com/MSFTDBProdSamples/Release/ProjectReleases.aspx?ReleaseId=16040 to do some more playing around with LINQ and found that there are some data types that are not natively supported withi... |
I am looking for an easy way to get the SID for the current Windows user account. I know I can do it through WMI, but I don't want to go that route.
Apologies to everybody that answered in C# for not specifying it's C++. :-)
| If you want to retrieve the Security Identifier (SID) for the current Windows user account using C++, you can utilize the Windows API. Here’s a simple example that demonstrates how to achieve this:
```cpp
#include <windows.h>
#include <sddl.h>
#include <iostream>
int main() {
// Get the current user's token
H... | 31,780 | [
{
"from": "human",
"value": "I am looking for an easy way to get the SID for the current Windows user account. I know I can do it through WMI, but I don't want to go that route.\nApologies to everybody that answered in C# for not specifying it's C++. :-)\n"
},
{
"from": "gpt",
"value": "If you w... |
I've got a collection (List<Rectangle>) which I need to sort left-right. That part's easy. Then I want to iterate through the Rectangles in their original order, but easily find their index in the sorted collection. indexOf() won't work, since I may have a number of equal objects. I can't help feeling there should be a... | Certainly! You can achieve this by using a combination of sorting and maintaining a mapping of the original indices of the `Rectangle` objects in the list. Here's a step-by-step approach:
1. Create a custom class that holds both the `Rectangle` and its original index.
2. Sort this list based on the `Rectangle` propert... | 29,698 | [
{
"from": "human",
"value": "I've got a collection (List<Rectangle>) which I need to sort left-right. That part's easy. Then I want to iterate through the Rectangles in their original order, but easily find their index in the sorted collection. indexOf() won't work, since I may have a number of equal object... |
I enabled PHP5 on my website and my webhost needs me to add the following to .htaccess files for PHP5 to work:
AddHandler application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml
AddType application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml
Locally, I am running XAMPP to develop code, but XAMPP does not... | XAMPP uses a different configuration for PHP than your web host, which is why the `.htaccess` directives for PHP5 don't seem to work locally. The `AddHandler` and `AddType` directives with `application/x-httpd-php5` are specific to your web host's server configuration and are not recognized by XAMPP.
To resolve this i... | 29,427 | [
{
"from": "human",
"value": "I enabled PHP5 on my website and my webhost needs me to add the following to .htaccess files for PHP5 to work:\n\nAddHandler application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml\n AddType application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml \n\nLocally, I am run... |
Our customers application seems to hang with the following stack trace:
java.lang.Thread.State: RUNNABLE
at java.io.UnixFileSystem.getBooleanAttributes0(Native Method)
at java.io.UnixFileSystem.getBooleanAttributes(Unknown Source)
at java.io.File.isFile(Unknown Source)
at org.tmatesoft.svn.core.intern... | The stack trace you provided indicates that the application hangs in the `isFile()` method of the `java.io.File` class, which ultimately calls the native method `getBooleanAttributes0()`. This hanging behavior is likely related to file system operations.
### Potential Causes of Hanging in `isFile()`
1. **File System ... | 32,531 | [
{
"from": "human",
"value": "Our customers application seems to hang with the following stack trace:\n java.lang.Thread.State: RUNNABLE\n at java.io.UnixFileSystem.getBooleanAttributes0(Native Method)\n at java.io.UnixFileSystem.getBooleanAttributes(Unknown Source)\n at java.io.File.isFile(Unknown... |
i got a client side javascript function which is triggered on a button click (basically, its a calculator!!). Sometimes, due to enormous data on the page, the javascript calculator function take to long & makes the page appear inactive to the user. I was planning to display a transparent div over entire page, maybe wit... | To achieve a loading overlay while your calculator function is running, you can use a combination of CSS and JavaScript. The key here is to ensure that you don't block the main thread with your time-consuming calculation, which can make the page feel unresponsive. You can use `setTimeout` or `requestAnimationFrame` to ... | 26,382 | [
{
"from": "human",
"value": "i got a client side javascript function which is triggered on a button click (basically, its a calculator!!). Sometimes, due to enormous data on the page, the javascript calculator function take to long & makes the page appear inactive to the user. I was planning to display a tr... |
I was asked for a comprehensive breakdown on space used within a specific database.
I know I can use sys.dm_db_partition_stats in SQL Server 2005 to figure out how much space each table in a database is using, but is there any way to determine the individual and total size of the stored procedures in a database? (Shor... | In SQL Server, stored procedures are compiled into an execution plan and stored in the `sys.procedures` catalog view, but they do not take up space in the same way that tables do (i.e., they do not store data rows). Instead, their definitions are stored in the database's metadata. Therefore, the space consumed by indiv... | 31,496 | [
{
"from": "human",
"value": "I was asked for a comprehensive breakdown on space used within a specific database. \nI know I can use sys.dm_db_partition_stats in SQL Server 2005 to figure out how much space each table in a database is using, but is there any way to determine the individual and total size of ... |
I read a little of the help for my advanced installer 6.5.1 and couldn't find a way to change the version string except by hand.
| In Advanced Installer, the version string of your installation package is usually managed through the project's properties. Here's how you can change the version string without editing it by hand:
1. **Open your project** in Advanced Installer.
2. **Go to the "Product Details"** page. You can find this in the left-ha... | 32,634 | [
{
"from": "human",
"value": "I read a little of the help for my advanced installer 6.5.1 and couldn't find a way to change the version string except by hand.\n"
},
{
"from": "gpt",
"value": "In Advanced Installer, the version string of your installation package is usually managed through the pro... |
My C# application includes an embedded web browser, which is made possible by the System.Windows.Forms.WebBrowser class. Users are able to navigate to websites using the app, however, when they encounter a page that includes a pop-up window, the pop-up window is opened by Internet Explorer.
Does anyone know how to s... | Certainly! To handle pop-ups in the `System.Windows.Forms.WebBrowser` control and prevent them from opening in Internet Explorer, you need to handle the `WebBrowser` control's `NewWindow` event. This event is triggered whenever the web browser tries to open a new window, such as a pop-up.
You can suppress the default ... | 32,570 | [
{
"from": "human",
"value": "My C# application includes an embedded web browser, which is made possible by the System.Windows.Forms.WebBrowser class. Users are able to navigate to websites using the app, however, when they encounter a page that includes a pop-up window, the pop-up window is opened by Inter... |
I am sitting down to define my first web service and have what is probably a basic question about the accessibility requirements of namespace definitions?
When a consumer of these web services identifies message elements as belonging to my namespace, must the URI reference for this namespace be available at the time ... | Great question! When defining a web service and its associated XML schema (or WSDL), you use namespaces to distinguish elements and types. However, the accessibility of the namespace URI is a common point of confusion.
### Key Points about Namespace Accessibility:
1. **Namespace URI Availability**: The URI referenced... | 27,675 | [
{
"from": "human",
"value": "I am sitting down to define my first web service and have what is probably a basic question about the accessibility requirements of namespace definitions? \nWhen a consumer of these web services identifies message elements as belonging to my namespace, must the URI reference fo... |
Is there a simple way to retrieve the length of an associative array (implemented as an Object) in ActionScript 3.0?
I understand that there are two primary ways of creating associative arrays in AS3:
Use a Dictionary object; especially handy when the key does not need to be a string
Use an Object, and simply create p... | In ActionScript 3.0, if you're using an `Object` to represent an associative array (where you are adding properties dynamically), there isn't a built-in method to directly retrieve the length of that object like there would be with an array. However, you can determine the number of properties (which function as the key... | 33,436 | [
{
"from": "human",
"value": "Is there a simple way to retrieve the length of an associative array (implemented as an Object) in ActionScript 3.0?\nI understand that there are two primary ways of creating associative arrays in AS3:\n\nUse a Dictionary object; especially handy when the key does not need to be... |
A class I am taking currently requires us to do all of our coding in smalltalk (it's a Design class). On one of our projects, I am looking to do some things, and am having a tough time finding how to do them. It seems that what most people do is modify their own version of smalltalk to do what they need it to do. I am ... | In Smalltalk, you can simplify both your random number generation and your logical conditions using the built-in methods more efficiently. Here's how you can tackle both issues:
### Random Number Generation
To generate a random number between 1 and 1000 in one command, you can use the `nextInt:` method from the `Rand... | 32,142 | [
{
"from": "human",
"value": "A class I am taking currently requires us to do all of our coding in smalltalk (it's a Design class). On one of our projects, I am looking to do some things, and am having a tough time finding how to do them. It seems that what most people do is modify their own version of small... |
Platform: IIS 6, ASP.Net 2.0 (.Net 3.5), Server 2003.
I'm building an application that accepts files from a user, processes them, and returns a result. The file is uploaded using HTTP POST to an ASP.Net web form. The application is expecting some large files (hundreds of MB).
I'm using SWFUpload to accomplish the uploa... | It seems you've already made several important changes to accommodate larger file uploads in your ASP.NET application, but you are still encountering a 404 error. Let's address a few potential issues that could cause this and ensure you've configured everything correctly.
1. **IIS Configuration**:
In addition to th... | 29,365 | [
{
"from": "human",
"value": "Platform: IIS 6, ASP.Net 2.0 (.Net 3.5), Server 2003.\nI'm building an application that accepts files from a user, processes them, and returns a result. The file is uploaded using HTTP POST to an ASP.Net web form. The application is expecting some large files (hundreds of MB).\n... |
I need to convert a bundle of static HTML documents into a single PDF file programmatically on the server side on a Java/J2EE platform using a batch process preferably. The pdf files would be distributed to site users for offline browsing of the web pages.
The major points of the requirements are:
The banner at the t... | Yes, you can achieve this requirement using several open-source libraries in the Java ecosystem. Below are the general steps and libraries you can use to convert a bundle of static HTML documents into a single PDF file with the specific features you need:
### Libraries to Use:
1. **Apache PDFBox**: For creating and m... | 28,049 | [
{
"from": "human",
"value": "I need to convert a bundle of static HTML documents into a single PDF file programmatically on the server side on a Java/J2EE platform using a batch process preferably. The pdf files would be distributed to site users for offline browsing of the web pages. \nThe major points of ... |
Is it possible to build an email reader for the Zune through XNA ?
Version 3.0 allows us to connect to the Market place and download music directly from the Zune hence the nature of my question.
Edit: Buy a ZuneHD
| Creating an email reader for the Zune through XNA would be quite challenging, primarily due to the limitations of the Zune's platform and the XNA framework. The Zune HD uses a custom operating system and does not support third-party applications in the same way as more open platforms like smartphones or PCs. Here are s... | 33,987 | [
{
"from": "human",
"value": "Is it possible to build an email reader for the Zune through XNA ?\nVersion 3.0 allows us to connect to the Market place and download music directly from the Zune hence the nature of my question.\nEdit: Buy a ZuneHD\n"
},
{
"from": "gpt",
"value": "Creating an email ... |
How to do svn update of multiple files located across different directories ?
For committing multiple files from different directories, we can put them all up in a text file and give that file as an argument to svn commit and it will happily commit all those files. But update ?
EDIT: Mr. Fooz's answer is definitely an... | Subversion (SVN) does not provide a built-in option to update multiple files across different directories by specifying a list of files in a text file, like you can do with `svn commit`. The `svn update` command is typically executed in the context of a working copy directory, and it operates at the directory level, me... | 30,852 | [
{
"from": "human",
"value": "How to do svn update of multiple files located across different directories ? \nFor committing multiple files from different directories, we can put them all up in a text file and give that file as an argument to svn commit and it will happily commit all those files. But update ... |
Is it possible to do Web form without using server control or set runat attribute on html control? How do you call the code behind function?
| Yes, it is possible to create a web form without using server controls or setting the `runat` attribute on HTML controls. In this case, you would be using standard HTML and JavaScript to handle user interactions, and you can make requests to the server using AJAX (Asynchronous JavaScript and XML) to call code-behind fu... | 30,611 | [
{
"from": "human",
"value": "Is it possible to do Web form without using server control or set runat attribute on html control? How do you call the code behind function?\n"
},
{
"from": "gpt",
"value": "Yes, it is possible to create a web form without using server controls or setting the `runat`... |
Are there any libraries out there that do this? Playing around with Common Lisp it seems like this would be one of the most useful things to lower barrier of entry for newcomers. ASDF seems mostly designed for deployment, not for rapid prototyping and development. Following threads on comp.lang.lisp it seems like peo... | You raise an interesting point about the Common Lisp package and system management landscape. Many Lisp developers recognize that while the Common Lisp package system is powerful, it can indeed present a steep learning curve for newcomers compared to more straightforward systems like Python's module system.
That said,... | 30,163 | [
{
"from": "human",
"value": "Are there any libraries out there that do this? Playing around with Common Lisp it seems like this would be one of the most useful things to lower barrier of entry for newcomers. ASDF seems mostly designed for deployment, not for rapid prototyping and development. Following th... |
I'm wondering if there's any way to have Firefox 3 (or IE 7 or safari 3.1 or Opera) flag that a redirect has occurred (i.e. any deltas between the hyperlink or URL entered into address bar, and the page you land on), whether you've arrived from a hyperlink or entering URL into address bar.
I've googled some, looked at ... | Tracking redirects and flagging changes in the URL from a hyperlink or the address bar directly within the browser without any additional steps (like right-clicking) can be a bit challenging, especially in older browsers like Firefox 3, IE 7, Safari 3.1, or Opera. However, you can create a simple bookmarklet that monit... | 32,791 | [
{
"from": "human",
"value": "I'm wondering if there's any way to have Firefox 3 (or IE 7 or safari 3.1 or Opera) flag that a redirect has occurred (i.e. any deltas between the hyperlink or URL entered into address bar, and the page you land on), whether you've arrived from a hyperlink or entering URL into a... |
I have created a setup project using Visual Studio 2008. After the application is finished installing, I would like to have it start up immediately. Any thoughts on how this can be done?
| To have your application start automatically after installation using a setup project in Visual Studio 2008, you can follow these steps:
### Method 1: Use a Custom Action
1. **Create a Custom Action**: You can create a custom action that runs your application after the installation completes.
- In your setup p... | 30,524 | [
{
"from": "human",
"value": "I have created a setup project using Visual Studio 2008. After the application is finished installing, I would like to have it start up immediately. Any thoughts on how this can be done?\n"
},
{
"from": "gpt",
"value": "To have your application start automatically a... |
I'm working in a small company and weeks away from deploying a web-app that will be used a lot. Everyone at one location will have to learn to use it, and although I think it's pretty easy and intuitive I may be biased.
I've written a help guide with plenty of screenshots that's available on every page, but I'll still... | Deploying a new web application, especially in a small company where everyone will be using it, is an exciting but challenging task. Here are some strategies to effectively train your colleagues and ensure they understand the application:
### 1. **Structured Training Sessions**
- **Schedule Training Sessions:** Org... | 29,595 | [
{
"from": "human",
"value": "I'm working in a small company and weeks away from deploying a web-app that will be used a lot. Everyone at one location will have to learn to use it, and although I think it's pretty easy and intuitive I may be biased.\nI've written a help guide with plenty of screenshots that... |
On Windows Mobile, I am displaying my output in HTML. This includes lots of user-generated strings. Occasionally there are situations where a really large string is part of the output that has no whitespaces or punctuation.
Unfortunately the Windows Mobile's HTML view (htmlview.dll, based on Pocket Internet Explorer) ... | When dealing with long, unbroken strings in HTML on Windows Mobile's HTML view (which is based on Pocket Internet Explorer), you have limited options. Since traditional CSS properties like `word-wrap` and `overflow-wrap` may not be fully supported, you need to explore alternative solutions. Here are some suggestions:
... | 29,263 | [
{
"from": "human",
"value": "On Windows Mobile, I am displaying my output in HTML. This includes lots of user-generated strings. Occasionally there are situations where a really large string is part of the output that has no whitespaces or punctuation. \nUnfortunately the Windows Mobile's HTML view (htmlvie... |
I'm writing an iPhone app that takes a photo and then uploads it to a server. How do I upload a photo to a server with Cocoa? I suppose I use NSUrl somewhere.
Thanks!
| To upload a photo to a server in an iPhone app using Cocoa (specifically Swift), you can use `URLSession` along with `URLRequest` to handle the networking. Here's a simple step-by-step example of how to take a photo using the `UIImagePickerController`, convert the image to JPEG data, and then upload it to a server.
1.... | 25,385 | [
{
"from": "human",
"value": "I'm writing an iPhone app that takes a photo and then uploads it to a server. How do I upload a photo to a server with Cocoa? I suppose I use NSUrl somewhere.\nThanks!\n"
},
{
"from": "gpt",
"value": "To upload a photo to a server in an iPhone app using Cocoa (spec... |
I researched this a while ago and can't remember how to do it. I want to be able to prevent Firefox from running it's spell-checking functionality on certain input fields from within the page. I know it's possible but can't remember how to set it up.
| To prevent Firefox (and other browsers) from performing spell-checking on specific input fields, you can use the `spellcheck` attribute in your HTML. By setting the `spellcheck` attribute to "false", you can disable spell-checking for that input field.
Here is how to do it for various input elements:
### For Text Inp... | 24,355 | [
{
"from": "human",
"value": "I researched this a while ago and can't remember how to do it. I want to be able to prevent Firefox from running it's spell-checking functionality on certain input fields from within the page. I know it's possible but can't remember how to set it up.\n"
},
{
"from": "gpt... |
I knew stackoverflow would help me for other than know what is the "favorite programming cartoon" :P
This was the accepted answer by:
Bill Karwin
Thanks to all for the help ( I would like to double vote you all )
My query ended up like this ( this is the real one )
SELECT
accepted.folio,
COALESCE( inprog.ac... | It looks like you're on the right track with your SQL query to find tickets that are either in progress or new, while also identifying the participants associated with those tickets. However, there are a couple of adjustments needed in your approach to ensure you're getting the results you want.
The key here is to use... | 31,734 | [
{
"from": "human",
"value": "I knew stackoverflow would help me for other than know what is the \"favorite programming cartoon\" :P \nThis was the accepted answer by:\nBill Karwin\nThanks to all for the help ( I would like to double vote you all ) \nMy query ended up like this ( this is the real one ) \nSEL... |
Can someone recommend a secure FTP implementation that works well on Windows Server 2000? I'm uploading files into virtual directories and web applications under IIS and the existing provider, obviously, isn't secure or encrypted.
| For securing FTP on Windows Server 2000, you have a few options to consider, but it's important to note that Windows Server 2000 is quite outdated and may pose security risks. However, if you must use it, here are a couple of options for secure FTP implementations:
1. **FileZilla Server**:
- FileZilla Server is a f... | 33,119 | [
{
"from": "human",
"value": "Can someone recommend a secure FTP implementation that works well on Windows Server 2000? I'm uploading files into virtual directories and web applications under IIS and the existing provider, obviously, isn't secure or encrypted.\n"
},
{
"from": "gpt",
"value": "For... |
I need to let end users specify a time range, to be stored and used internally as a starting date/time and ending date/time. The range could be minutes or it could be days.
Has anyone discovered an interactive control that can handle this elegantly?
Most GUI toolkits have a calendar control, so I could specify "start"... | Certainly! Designing an intuitive and efficient user interface for selecting a time range can significantly enhance user experience. Here are a few suggestions and concepts that might address your concerns more elegantly than traditional methods:
### 1. **Date/Time Range Picker**
Many modern UI frameworks have built-i... | 29,068 | [
{
"from": "human",
"value": "I need to let end users specify a time range, to be stored and used internally as a starting date/time and ending date/time. The range could be minutes or it could be days.\nHas anyone discovered an interactive control that can handle this elegantly?\nMost GUI toolkits have a c... |
How do I get the complete request URL (including query string) in my controller? Is it a matter of concatenating my URL and form parameters or is there a better way.
I checked this question, but it seems not to be applicable to MVC.
Correct me if I'm wrong.
Some more detailed information:
My call to my SearchControll... | To obtain the complete request URL, including the query string in an ASP.NET MVC controller, you can use the `Request.Url` property along with `Request.QueryString`. Here is a clean and effective way to achieve what you want:
### Example Code:
```csharp
public ActionResult AdvancedSearch(/* Your parameters here */)
{... | 28,071 | [
{
"from": "human",
"value": "How do I get the complete request URL (including query string) in my controller? Is it a matter of concatenating my URL and form parameters or is there a better way.\nI checked this question, but it seems not to be applicable to MVC. \nCorrect me if I'm wrong.\nSome more detail... |
I need to have a single instance application (as per this answer), but it needs to be deployed via click once.
The problem is that I require that click once doesn't automatically detect an update an attempt to load a newer version while the application is running. If it is running, then I need the other instance to be... | In a ClickOnce application, managing updates and preventing multiple instances of the application from running can be a bit tricky, especially if you want to customize the default update behavior. However, you can achieve the functionality you are looking for by following these steps:
### Steps to Manage Single Instan... | 25,801 | [
{
"from": "human",
"value": "I need to have a single instance application (as per this answer), but it needs to be deployed via click once.\nThe problem is that I require that click once doesn't automatically detect an update an attempt to load a newer version while the application is running. If it is run... |
Hi I want to have two tables each have an INT "id" column which will auto-increment but I don't want either "id" columns to ever share the same number. What is this called and what's the best way to do it? Sequence? Iterator? Index? Incrementor?
Motivation: we're migrating from one schema to a another and have a web-pa... | In SQL Server, the requirement you're describing can be addressed using **sequences**. A sequence is a database object that generates a sequential number and can be used to provide unique values across multiple tables, ensuring that no two tables will ever share the same "id" value.
Here's how you can implement this i... | 28,336 | [
{
"from": "human",
"value": "Hi I want to have two tables each have an INT \"id\" column which will auto-increment but I don't want either \"id\" columns to ever share the same number. What is this called and what's the best way to do it? Sequence? Iterator? Index? Incrementor?\nMotivation: we're migrating ... |
Windows XP Disk Defragmenter report shows a constant gap in disk usage on a number of disk partitions on my system. I'm not referring to the little transitory gaps that occur. In disk D below, the gap in question is the one under the word "defragmentation". In disk P below, the gap is the one under "usage before def... | It sounds like you're experiencing a persistent issue with disk fragmentation or unallocated space that remains after defragmentation on your D and P partitions in Windows XP. Here are several potential reasons and solutions for the gaps you're observing:
### Potential Reasons for the Gaps:
1. **Unmovable Files**: So... | 30,171 | [
{
"from": "human",
"value": "Windows XP Disk Defragmenter report shows a constant gap in disk usage on a number of disk partitions on my system. I'm not referring to the little transitory gaps that occur. In disk D below, the gap in question is the one under the word \"defragmentation\". In disk P below,... |
Can you provide examples of applications today that are procedural and maintain a high level of integrity and efficiency? Are there any books, tutorials or links that provide examples of how to successfully build and maintain an imperative system? If you were to give guidance in this area, what tips would you give on h... | Certainly! Procedural programming is still a valuable paradigm for building systems that prioritize integrity and efficiency. Below are examples of applications that demonstrate the effectiveness of procedural programming, along with resources to help you understand and implement these concepts.
### Examples of Proced... | 29,382 | [
{
"from": "human",
"value": "Can you provide examples of applications today that are procedural and maintain a high level of integrity and efficiency? Are there any books, tutorials or links that provide examples of how to successfully build and maintain an imperative system? If you were to give guidance in... |
I want subversion to commit a file even if it's unchanged. Is there a way to do this?
| In Subversion (SVN), the usual behavior is that it will not allow you to commit a file if it has not changed since the last commit. However, if you want to force a commit even for unchanged files, there is a common workaround you can use:
### Method: Use `svn propset` to Change a Property
You can modify a property of... | 30,029 | [
{
"from": "human",
"value": "I want subversion to commit a file even if it's unchanged. Is there a way to do this?\n"
},
{
"from": "gpt",
"value": "In Subversion (SVN), the usual behavior is that it will not allow you to commit a file if it has not changed since the last commit. However, if you... |
I'm looking for the concept to spawn a process such that:
it has only access to certain libraries/APIs
it cannot acess the file system or only specific parts
it can do least harm should malicious code run in it
This concept is known as sandbox or jail.
It is required to do this for each major Operating system (Window... | Creating a sandbox or jail to restrict a process's capabilities is an important aspect of security on modern operating systems. Below is a conceptual overview of how to achieve this on Windows, macOS, and Linux, along with specific APIs and techniques that can be used for each system.
### 1. **Linux**
Linux provides s... | 27,134 | [
{
"from": "human",
"value": "I'm looking for the concept to spawn a process such that:\n\nit has only access to certain libraries/APIs\nit cannot acess the file system or only specific parts\nit can do least harm should malicious code run in it\n\nThis concept is known as sandbox or jail.\nIt is required to... |
Apple strongly recommends using the binary plist format when reading large XML-based data sets into iPhone apps. Among their reasoning is the fact that XML parsing is very taxing on the iPhone. However, this requires that files residing on the remote web server be converted first.
For frequently-changing content, it is... | Yes, there are publicly available libraries and algorithms that can help you convert XML property lists (plists) to binary format programmatically without needing to call command-line tools like `plutil`. Here are a few options you can consider:
1. **Python with `plistlib`**: Python’s built-in `plistlib` module allows... | 31,268 | [
{
"from": "human",
"value": "Apple strongly recommends using the binary plist format when reading large XML-based data sets into iPhone apps. Among their reasoning is the fact that XML parsing is very taxing on the iPhone. However, this requires that files residing on the remote web server be converted firs... |
I'd like to stress test some of my SQL queries and find out about bad query plans and bottlenecks. I plan to fill some tables with random test data.
Are there tools or a set of scripts available for this purpose, preferably for SQL Server?
Thanks!
UPDATE: Sorry, didn't know these two question already existed:
Data gen... | Stress testing SQL queries and identifying bottlenecks is an important step in optimizing database performance. In SQL Server, there are a few tools and methods you can use to generate random test data and analyze your query performance.
### Data Generation Tools
1. **SQL Server Management Studio (SSMS) Built-in Tool... | 30,066 | [
{
"from": "human",
"value": "I'd like to stress test some of my SQL queries and find out about bad query plans and bottlenecks. I plan to fill some tables with random test data.\nAre there tools or a set of scripts available for this purpose, preferably for SQL Server?\nThanks!\nUPDATE: Sorry, didn't know t... |
I'm trying to drag a CALayer in an iOS app.
As soon as I change its position property it tries to animate to the new position and flickers all over the place:
layer.position = CGPointMake(x, y)
How can I move CALayers instantly? I can't seem to get my head around the Core Animation API.
| To move a `CALayer` instantly without animations in iOS, you need to ensure that the layer's `position` property is updated directly without involving implicit animations. Core Animation performs implicit animations by default for many property changes, including `position`.
To achieve an instant change without anima... | 33,901 | [
{
"from": "human",
"value": "I'm trying to drag a CALayer in an iOS app.\nAs soon as I change its position property it tries to animate to the new position and flickers all over the place:\n layer.position = CGPointMake(x, y)\n\nHow can I move CALayers instantly? I can't seem to get my head around the Core ... |
I'm wondering if it is possible to add methods in main program to an existing class defined in header file.
For example:
There is class CFun defined in file CFun.hpp, but in our party.cpp we want to add a method void hello() {cout << "hello" << endl;};without editing CFun.hpp
Obviously (unfortunately) construction:
#in... | In C++, you cannot directly add methods to an existing class defined in a header file without modifying that class's original definition in the header file. However, there are a couple of techniques that you can use to achieve similar functionality without editing the original header file, but they do require some form... | 25,730 | [
{
"from": "human",
"value": "I'm wondering if it is possible to add methods in main program to an existing class defined in header file.\nFor example:\nThere is class CFun defined in file CFun.hpp, but in our party.cpp we want to add a method void hello() {cout << \"hello\" << endl;};without editing CFun.hp... |
If I'm using Apache with a pool of worker processes, and one of those launches its own long-running process, what happens to that worker? Will Apache kill it eventually, killing the child process? Will that worker be permanently unavailable, but keep running? How does it differ if it starts a thread instead of a pro... | When you have Apache configured with a pool of worker processes (like with the `mpm_worker` or `mpm_event` Multi-Processing Modules), and one of those worker processes launches a long-running child process, several scenarios and behaviors can occur based on how the system is configured. Here are the key considerations:... | 26,509 | [
{
"from": "human",
"value": "If I'm using Apache with a pool of worker processes, and one of those launches its own long-running process, what happens to that worker? Will Apache kill it eventually, killing the child process? Will that worker be permanently unavailable, but keep running? How does it diff... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.