instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
My understanding is that C# and java differ with respect to generics in some ways, one of which is that generic type parameters are available at runtime in C#/.NET but not in Java. Why did the Java language designers do it this way?
| The difference in how C# and Java handle generics stems from their design philosophies and the goals of the respective languages when generics were introduced.
### 1. Type Erasure in Java
Java uses a concept known as **type erasure** for generics, which means that generic type information is only available at compile... | 46,750 | [
{
"from": "human",
"value": "My understanding is that C# and java differ with respect to generics in some ways, one of which is that generic type parameters are available at runtime in C#/.NET but not in Java. Why did the Java language designers do it this way? \n"
},
{
"from": "gpt",
"value": "... |
Hi I have a JSON object that is a 2-dimentional array and I need to pass it to PHP using Ajax.Request (only way I know how). ...Right now I manually serialized my array using a js function...and get the data in this format: s[]=1&d[]=3&[]=4 etc. ....
my question is: Is there a way to pass the JSON object more directly/... | Yes, you can pass a JSON object directly in an Ajax request without the need for manual serialization. Here's how you can do it using the `XMLHttpRequest` or `fetch` API to send the data to your PHP script.
### Using `XMLHttpRequest`
Here’s an example using `XMLHttpRequest`:
```javascript
var data = [
[1, 3],
... | 47,443 | [
{
"from": "human",
"value": "Hi I have a JSON object that is a 2-dimentional array and I need to pass it to PHP using Ajax.Request (only way I know how). ...Right now I manually serialized my array using a js function...and get the data in this format: s[]=1&d[]=3&[]=4 etc. ....\nmy question is: Is there a ... |
I'm using Crystal Reports 11 (and VB6) to open a report file, load the data from an Access database and either print the report to a printer or export the report to another .rpt file (for later printing without the database)
Even for small amounts of data the process is somewhat slow. Profiling showed about 1.5 seconds... | Improving the performance of Crystal Reports can be quite nuanced, especially when you're using older versions like Crystal Reports 11 with VB6. Here are several strategies you can consider to speed up the process of opening reports, loading data, and exporting or printing them:
### 1. Optimize the Database Query:
- *... | 43,873 | [
{
"from": "human",
"value": "I'm using Crystal Reports 11 (and VB6) to open a report file, load the data from an Access database and either print the report to a printer or export the report to another .rpt file (for later printing without the database)\nEven for small amounts of data the process is somewha... |
I am trying to create an array starting with today and going back the last 30 days with PHP and I am having trouble. I can estimate but I don’t know a good way of doing it and taking into account the number of days in the previous month etc. Does anyone have a good solution? I can’t get close but I need to make sure ... | You can create an array of dates starting from today and going back for the last 30 days using PHP's `DateTime` class. This approach ensures that you accurately account for different month lengths and leap years. Below is a sample code snippet to help you achieve this:
```php
<?php
// Create an array to hold the dates... | 47,650 | [
{
"from": "human",
"value": "I am trying to create an array starting with today and going back the last 30 days with PHP and I am having trouble. I can estimate but I don’t know a good way of doing it and taking into account the number of days in the previous month etc. Does anyone have a good solution? I... |
I'm trying to figure out if there's a reasonably efficient way to perform a lookup in a dictionary (or a hash, or a map, or whatever your favorite language calls it) where the keys are regular expressions and strings are looked up against the set of keys. For example (in Python syntax):
>>> regex_dict = { re.compile(r... | When dealing with the problem of efficiently matching a string against a set of regular expressions, achieving O(1) lookup time is not feasible since regular expressions inherently require time proportional to the length of the input string. However, there are ways to optimize the matching process such that you can red... | 42,226 | [
{
"from": "human",
"value": "I'm trying to figure out if there's a reasonably efficient way to perform a lookup in a dictionary (or a hash, or a map, or whatever your favorite language calls it) where the keys are regular expressions and strings are looked up against the set of keys. For example (in Python... |
I've got a SQLServer Database and an application (.NET) that configures data on that database. On the other hand, I've got an application (VC++) that reads that data from the database and must be 'informed' a soon as possible of any change in the data saved on the database.
I would like to receive a signal from the dat... | In SQL Server, you can use several mechanisms to inform your VC++ application of changes made to the database by the .NET application. Here are a few approaches you can consider:
### 1. SQL Server Service Broker
Service Broker is a feature in SQL Server that allows you to send and receive messages between different a... | 38,128 | [
{
"from": "human",
"value": "I've got a SQLServer Database and an application (.NET) that configures data on that database. On the other hand, I've got an application (VC++) that reads that data from the database and must be 'informed' a soon as possible of any change in the data saved on the database.\nI w... |
I am developing an Adobe AIR application which stores data locally using a SQLite database.
At any time, I want the end user to synchronize his/her local data to a central MySQL database.
Any tips, advice for getting this right?
Performance and stability is the key (besides security ;))
| Synchronizing local data from an Adobe AIR application using SQLite to a central MySQL database requires careful consideration of several factors, including data integrity, performance, security, and conflict resolution. Here are some tips and best practices to help you achieve a successful synchronization process:
##... | 41,026 | [
{
"from": "human",
"value": "I am developing an Adobe AIR application which stores data locally using a SQLite database.\nAt any time, I want the end user to synchronize his/her local data to a central MySQL database.\nAny tips, advice for getting this right?\nPerformance and stability is the key (besides s... |
Outlook 2007 shows pictures of contacts on the right hand side of the mail form. This only works for your personal contacts and if you have photos.
Is there a way to hook that picture up to the GAL or AD for the company so that all employees photos show automatically? Hopefully without having to write and deploy a new... | In Outlook 2007, the contact pictures on the right-hand side of the mail form typically rely on the user’s personal contact information. Unfortunately, there is no out-of-the-box functionality in Outlook 2007 that automatically displays photos from the Global Address List (GAL) or Active Directory (AD) for company empl... | 47,730 | [
{
"from": "human",
"value": "Outlook 2007 shows pictures of contacts on the right hand side of the mail form. This only works for your personal contacts and if you have photos.\nIs there a way to hook that picture up to the GAL or AD for the company so that all employees photos show automatically? Hopefull... |
I have an SSRS report
where the date should be grouped by project category
the project code in the category is repeating in side the group how do I suppress the value
Please help me to get an idea.
Thanks,brijit
| To suppress repeating values in an SSRS (SQL Server Reporting Services) report grouped by a specific category (like project category), you can use the "Hide Duplicates" feature on the textbox that displays the project code. Here’s how you can do that:
### Steps to Suppress Repeating Values in SSRS:
1. **Open Your Rep... | 45,494 | [
{
"from": "human",
"value": "I have an SSRS report\nwhere the date should be grouped by project category\nthe project code in the category is repeating in side the group how do I suppress the value\nPlease help me to get an idea.\nThanks,brijit\n"
},
{
"from": "gpt",
"value": "To suppress repeat... |
I am looking to make a web control where I can register client startup scripts inline with my aspx because I hate registering in the codebehind!
An example of what I have so far:
<Ben:StartupScript runat="server">
var form = document.getElementById("<% =form1.ClientID %>");
</Ben:StartupScript>
Currently, I am o... | Creating a custom web control that allows inline registration of startup scripts while preventing child controls can be a bit challenging, but it's certainly feasible. Your approach seems reasonable, but there are some considerations and potential improvements you can make.
### Solution Overview
1. **Prevent Child Co... | 40,667 | [
{
"from": "human",
"value": "I am looking to make a web control where I can register client startup scripts inline with my aspx because I hate registering in the codebehind!\nAn example of what I have so far:\n<Ben:StartupScript runat=\"server\">\n\n var form = document.getElementById(\"<% =form1.ClientI... |
My question is similar to "What is the difference between include and extend in Ruby?".
What's the difference between require and include in Ruby? If I just want to use the methods from a module in my class, should I require it or include it?
| In Ruby, `require` and `include` serve different purposes, and it's important to understand their distinctions when working with modules and files.
### `require`
- **Purpose**: The `require` method is used to load external files or libraries into your Ruby program. This is typically done for Ruby files or libraries t... | 45,747 | [
{
"from": "human",
"value": "My question is similar to \"What is the difference between include and extend in Ruby?\".\nWhat's the difference between require and include in Ruby? If I just want to use the methods from a module in my class, should I require it or include it?\n"
},
{
"from": "gpt",
... |
I'm using the obout grid control in c# and not to sure how to throw an error from the code behind!
I am catching the error in the code behind with a try catch block (which i can see it doing using break points in visual studio) which I am creating on purpose from the database(creating another record with the same ident... | To display an error message from the code behind when using the Obout Grid control in C#, you'll want to handle the error in your catch block and then inform the client-side JavaScript to show the error message, typically using a `ClientScript` method to execute a JavaScript function.
Here’s how you can modify your `I... | 41,225 | [
{
"from": "human",
"value": "I'm using the obout grid control in c# and not to sure how to throw an error from the code behind!\nI am catching the error in the code behind with a try catch block (which i can see it doing using break points in visual studio) which I am creating on purpose from the database(c... |
This has just come up as a question where I worked so I did a little digging and the answer is a ExpertsExchange one. So I hand you over to the original question asker, Manchung:
I have a project written in pure C which is to be used in embedded system. So, I use pure C to minimize the code size.
When I compile the pr... | In standard C (including ANSI C), the only comment style permitted is the C-style comment (`/* comment */`). The C++-style comment (`// comment`) was introduced with C++, and it is not part of the C standard until C99, where it was officially included.
If you want to use C99 features, including C++-style comments, you... | 46,970 | [
{
"from": "human",
"value": "This has just come up as a question where I worked so I did a little digging and the answer is a ExpertsExchange one. So I hand you over to the original question asker, Manchung:\n\nI have a project written in pure C which is to be used in embedded system. So, I use pure C to mi... |
I'm creating a log shipping configuration between two sql server 2005 instances. I'm shipping the logs of a single database and I'm not using a Monitor service (for the time being). When I run the SQL Server Log Shipping Wizard on the database, the script executes as it should and claims there are no errors. But whe... | In SQL Server log shipping, the setup typically includes three main jobs: the backup job on the primary server, the copy job on the secondary server, and the restore job on the secondary server. Here’s a breakdown of your questions:
### a) Should there be a job added to the primary server?
Yes, there should be a backu... | 41,688 | [
{
"from": "human",
"value": "I'm creating a log shipping configuration between two sql server 2005 instances. I'm shipping the logs of a single database and I'm not using a Monitor service (for the time being). When I run the SQL Server Log Shipping Wizard on the database, the script executes as it should... |
EDIT: I found out that I can get it to compile if I cast the IMetadataType object to the TMetadata type. Why do I need to do this?
EDIT #2: The "Values" property is a .NET dictionary of type <TMetadata, TData>.
I have this generic method:
private void FillMetadata<TMetadata, TData>
(Metadata<TMetadata, TData> oM... | The issue you're encountering is related to how generics and covariance/contravariance work in C#.
In your method, you have the following constraint:
```csharp
where TMetadata : IMetadataType
```
This means that `TMetadata` must be some type that implements the `IMetadataType` interface. However, this does not mean ... | 44,479 | [
{
"from": "human",
"value": "EDIT: I found out that I can get it to compile if I cast the IMetadataType object to the TMetadata type. Why do I need to do this?\nEDIT #2: The \"Values\" property is a .NET dictionary of type <TMetadata, TData>.\nI have this generic method:\nprivate void FillMetadata<TMetad... |
When running FindBugs on my project, I got a few instances of the error described above.
Namely, my overriding versions of equals cast the RHS object into the same type as the object in which the overriding version is defined.
However, I'm not sure whether a better design is possible, since AFAIK Java does not allow va... | When implementing the `equals` method in Java, it's crucial to adhere to a few fundamental rules that ensure the method behaves correctly and as expected, especially when it comes to type safety and comparison logic.
### Correct Implementation of `equals`
The standard implementation of the `equals` method should foll... | 44,927 | [
{
"from": "human",
"value": "When running FindBugs on my project, I got a few instances of the error described above.\nNamely, my overriding versions of equals cast the RHS object into the same type as the object in which the overriding version is defined.\nHowever, I'm not sure whether a better design is p... |
I've got some trouble with jQuery script on my Asp.net page. During first load it works well, after postback it does not. Initially I thought that it is because script is not load again, but alert told me that script runs as I use function pageLoad() instead of $(document).ready(function().
In script I just read value ... | It sounds like you're encountering a common issue with ASP.NET Web Forms where JavaScript event handlers need to be reattached after a postback. In ASP.NET, the `pageLoad` function runs whenever the page is loaded, but after a postback, the controls may be re-rendered and your jQuery event handlers may no longer be bou... | 46,057 | [
{
"from": "human",
"value": "I've got some trouble with jQuery script on my Asp.net page. During first load it works well, after postback it does not. Initially I thought that it is because script is not load again, but alert told me that script runs as I use function pageLoad() instead of $(document).ready... |
I know you can combine multiple table-selects using a Join statement but is there a way to combine these two queries into one?
SELECT Statistics.StatisticID
FROM Statistics
ORDER BY `SubmittedTime` DESC
LIMIT 0, 10
And this one?
SELECT COUNT(Votes.StatisticID)
FROM Votes
WHERE Votes.StatisticID = ?
(fluff removed)
A... | Yes, you can combine the two queries to achieve the desired results using a single query with a `LEFT JOIN`. The problem you are facing with the incorrect count of votes is due to how aggregation works in SQL when there’s no `GROUP BY` clause.
To get the correct count of votes for each statistic, you should use `GROU... | 47,991 | [
{
"from": "human",
"value": "I know you can combine multiple table-selects using a Join statement but is there a way to combine these two queries into one?\nSELECT Statistics.StatisticID\nFROM Statistics\nORDER BY `SubmittedTime` DESC\nLIMIT 0, 10\n\nAnd this one?\nSELECT COUNT(Votes.StatisticID)\nFROM Vot... |
Long ago, I wrote a style 'normalizer' program to scan the ASP/HTML code of a big pile of classic ASP pages (most of which were originally generated from MS-Word documents, so naturally they were littered with superflous stylesheets and massive one-off styles). The style normalizer generated a minimal set of stylesheet... | Your idea for a style normalizer program is intriguing and certainly fills a niche that is not commonly addressed by existing tools. Let’s break down your questions one by one:
### 1. Is there such a tool already, commercial or otherwise?
Currently, there are several tools designed for cleaning up HTML and CSS, but m... | 43,405 | [
{
"from": "human",
"value": "Long ago, I wrote a style 'normalizer' program to scan the ASP/HTML code of a big pile of classic ASP pages (most of which were originally generated from MS-Word documents, so naturally they were littered with superflous stylesheets and massive one-off styles). The style normali... |
Suppose I am entering validation code into my model of multi-language publication database. The database needs either an English or a Japanese title for a particular journal. So I need to validate_presence_of at least one of the two. Right now I can easily check that both exists, but am stumped on the case of "at least... | To validate the presence of at least one of two fields in a Rails model, you can use a custom validation method. In your case, you want to ensure that either `journal_title` or `journal_title_ja` is present. Here's how you can implement it:
```ruby
class Article < ActiveRecord::Base
belongs_to :publication
valida... | 46,919 | [
{
"from": "human",
"value": "Suppose I am entering validation code into my model of multi-language publication database. The database needs either an English or a Japanese title for a particular journal. So I need to validate_presence_of at least one of the two. Right now I can easily check that both exists... |
I ported a Delphi 6 application to Delphi 2007 and it uses BDE to connect to
an Oracle 9i database. I am getting an
ORA-01426: numeric overflow exception
When I execute a stored procedure. This happens randomly and if I
re-run the stored procedure through the application with the same parameters
the exception does no... | The "ORA-01426: numeric overflow exception" error you are encountering after porting your Delphi application from Delphi 6 to Delphi 2007 when using BDE (Borland Database Engine) to connect to an Oracle 9i database can be caused by several factors. Here are some possible causes and solutions to consider:
1. **Data Typ... | 44,710 | [
{
"from": "human",
"value": "I ported a Delphi 6 application to Delphi 2007 and it uses BDE to connect to\nan Oracle 9i database. I am getting an\n\nORA-01426: numeric overflow exception\n\nWhen I execute a stored procedure. This happens randomly and if I\nre-run the stored procedure through the application... |
My company needs a PDF viewer with Java API with the additional requirement on being able to use FDF form data.
The only one i found was JPedal which promises to feature everything we need, but it costs a bunch. So what are my options? Is there another tool to do it?
edit:
I found iText to be an easy way to merge FDF d... | When it comes to working with PDF files and FDF form data in Java, you have a few options, especially if you're looking for alternatives to JPedal and iText (especially considering licensing and cost). Here are some libraries you might consider:
### 1. **Apache PDFBox**
Apache PDFBox is an open-source Java library for... | 44,692 | [
{
"from": "human",
"value": "My company needs a PDF viewer with Java API with the additional requirement on being able to use FDF form data.\nThe only one i found was JPedal which promises to feature everything we need, but it costs a bunch. So what are my options? Is there another tool to do it?\nedit:\nI ... |
I have a web application which has a Sql Server database on the backend. As the site will be rolled out to different clients (or different virtual directories in IIS), each client derivative of the site will use the same backend.
There is an admin page where text on the site can be changed (enter text in a listview, an... | To achieve your goal of isolating client-specific data in your web application using ASP.NET with a SQL Server backend, you'll want to follow a structured approach. This includes storing the `accountId` in the session after user authentication, retrieving it on your admin page, and using it to filter the data displayed... | 39,708 | [
{
"from": "human",
"value": "I have a web application which has a Sql Server database on the backend. As the site will be rolled out to different clients (or different virtual directories in IIS), each client derivative of the site will use the same backend.\nThere is an admin page where text on the site ca... |
According to the documentation, a prepared query provides a significant performance benefit if you're running a query multiple times because the overhead of the MySQL server parsing the query only happens once. I'm wondering what exactly they mean by "multiple times" there.
I.e., say you have a web page that runs a que... | The concept of prepared queries in MySQL, particularly when using PHP's `mysqli` or PDO, refers to the ability to optimize the execution of a SQL statement that you plan to run multiple times with possibly different parameter values. Here’s how it works and how it applies to your scenario:
### What "Multiple Times" Me... | 46,309 | [
{
"from": "human",
"value": "According to the documentation, a prepared query provides a significant performance benefit if you're running a query multiple times because the overhead of the MySQL server parsing the query only happens once. I'm wondering what exactly they mean by \"multiple times\" there.\nI... |
I have made a Windows client application where I use the AxAcroPDF control
to display a pdf-file on a form.
It seems to me that after I have upgraded my Acrobat reader from version 8 to version 9 the LoadFile method returns true when the file is opened correctly, where version 8 returned false. Is this a correct observ... | It's possible that the behavior of the `LoadFile` method in the `AxAcroPDF` control changed between versions 8 and 9 of Adobe Acrobat Reader. The `LoadFile` method is responsible for loading a PDF file into the control, and changes in the underlying API or the control's implementation could lead to variations in its re... | 42,365 | [
{
"from": "human",
"value": "I have made a Windows client application where I use the AxAcroPDF control\nto display a pdf-file on a form.\nIt seems to me that after I have upgraded my Acrobat reader from version 8 to version 9 the LoadFile method returns true when the file is opened correctly, where version... |
I have build server inside our domain (and it needs to be because it also talks to other boxes in the domain), and a webserver that is in the DMZ.
As part of our build scripts, I would like to deploy websites to the webserver in the DMZ, using the Nant copy task. The problem is, that Nant is invoked from TeamCity whic... | To deploy websites from your build server in the domain to a web server in the DMZ using Nant under the TeamCity environment, you have a few options to work around the limitations you mentioned:
### 1. Use PSExec
You can use [PSExec](https://docs.microsoft.com/en-us/sysinternals/downloads/psexec) to run commands as a ... | 41,462 | [
{
"from": "human",
"value": "I have build server inside our domain (and it needs to be because it also talks to other boxes in the domain), and a webserver that is in the DMZ.\nAs part of our build scripts, I would like to deploy websites to the webserver in the DMZ, using the Nant copy task. The problem i... |
i am trying to produce clouds effect in my flash animation using as3
i am able to generate clouds through action script but the real problem is how to make them be generated at one end of the screen and travel diagonally to the other end...
any thoughts?
| To create a cloud effect in your Flash animation using ActionScript 3 (AS3), you can follow these steps to generate clouds that move diagonally across the screen.
1. **Create a Cloud Class**: Start by creating a class that represents your cloud. This class will handle the display and movement of the cloud.
```actions... | 45,568 | [
{
"from": "human",
"value": "i am trying to produce clouds effect in my flash animation using as3\ni am able to generate clouds through action script but the real problem is how to make them be generated at one end of the screen and travel diagonally to the other end... \nany thoughts?\n"
},
{
"from... |
Is it better to use a stored procedure or doing it the old way with a connection string and all that good stuff? Our system has been running slow lately and our manager wants us to try to see if we can speed things up a little and we were thinking about changing some of the old database calls over to stored procedures.... | When considering whether to use stored procedures versus direct SQL queries in your application, there are several factors to weigh. Here’s a breakdown of the potential benefits and considerations for using stored procedures:
### Benefits of Using Stored Procedures:
1. **Performance**:
- Stored procedures are prec... | 44,840 | [
{
"from": "human",
"value": "Is it better to use a stored procedure or doing it the old way with a connection string and all that good stuff? Our system has been running slow lately and our manager wants us to try to see if we can speed things up a little and we were thinking about changing some of the old ... |
I am using cvs -tag -b "abcdefg" command to tag-branch in my CVS. My CSV repo has an empty directory "obj" in every folder.
Whenever I use the command cvs co -r "abcdefg" REPO, I get a complete repo minus the empty folders. I tried using -f option too but it did not work. What is the way to get out of this?
| In CVS (Concurrent Versions System), when you check out a repository, it does not automatically create empty directories if they do not contain any files. This is a limitation of CVS, as it only tracks files and not directories in the same way that some other version control systems do.
However, you can work around th... | 45,743 | [
{
"from": "human",
"value": "I am using cvs -tag -b \"abcdefg\" command to tag-branch in my CVS. My CSV repo has an empty directory \"obj\" in every folder. \nWhenever I use the command cvs co -r \"abcdefg\" REPO, I get a complete repo minus the empty folders. I tried using -f option too but it did not work... |
I'm looking for a good ocaml parsing library that isn't a derivative of flex/bison. Ideally, I'd like a monadic combinator library along the lines of parsec, but I can't find anything.
I would use haskell, but making llvm bindings for haskell is proving more tiresome than I originally thought.
Cheers,
Duane
| Hi Duane,
If you're looking for a monadic parsing library in OCaml that resembles Haskell's Parsec, you might want to check out **Angstrom**. Angstrom is a fast, combinator-based parsing library that allows you to define your parsers in a clear and composable way, similar to Parsec in Haskell. It is not a derivative o... | 48,108 | [
{
"from": "human",
"value": "I'm looking for a good ocaml parsing library that isn't a derivative of flex/bison. Ideally, I'd like a monadic combinator library along the lines of parsec, but I can't find anything.\nI would use haskell, but making llvm bindings for haskell is proving more tiresome than I ori... |
Is there a way to set the default buffer size for JSPs in Tomcat? I know I can set them on every page, but am hoping there's a global option somewhere.
| In Apache Tomcat, the default buffer size for JSPs can be configured globally by modifying the `web.xml` file of your web application. You can set the `buffer` attribute of the `jsp` servlet. Here is how to do it:
1. Locate the `web.xml` file for your web application. It is usually found in the `WEB-INF` directory of ... | 49,003 | [
{
"from": "human",
"value": "Is there a way to set the default buffer size for JSPs in Tomcat? I know I can set them on every page, but am hoping there's a global option somewhere.\n"
},
{
"from": "gpt",
"value": "In Apache Tomcat, the default buffer size for JSPs can be configured globally by ... |
when reading data through serial port
VARIANT data;
BSTR k;
if(m_mscom.GetCommEvent() == 2)
{
data = m_mscom.GetInput();
k = data.bstrVal;
}
What is BSTR k; and
what do you mean k=data.bstrVal? What is bstrVal?
| In your code snippet, you are working with COM (Component Object Model) programming in a context that involves serial communication. Let's break down the concepts you asked about.
### BSTR
1. **Definition**: `BSTR` (Basic String) is a string data type used in COM programming, which is designed to be used with differe... | 46,930 | [
{
"from": "human",
"value": "when reading data through serial port \nVARIANT data;\nBSTR k;\nif(m_mscom.GetCommEvent() == 2)\n{\n data = m_mscom.GetInput(); \n k = data.bstrVal;\n }\n\nWhat is BSTR k; and\nwhat do you mean k=data.bstrVal? What is bstrVal?\n"
},
{
"from": "gpt",
"va... |
I want to perform this CODE equivlant in the castle xml config file.
// Foo(string name)
IFoo f = new Foo(StaticBarClass.Name);
XML
Now for the XML, I know everything (e.g. the blah) except for the stuff inside the parameter part.
What would the parameter part look like?
<component id="blah"
service="blah"... | To configure a component in Castle Windsor XML that corresponds to the `Foo(string name)` constructor you provided, you need to ensure that the parameter is set correctly in the XML configuration file.
If you want to pass a static value for the `name` parameter which is coming from a static class (like `StaticBarClass... | 48,005 | [
{
"from": "human",
"value": "I want to perform this CODE equivlant in the castle xml config file.\n// Foo(string name)\nIFoo f = new Foo(StaticBarClass.Name);\n\n\nXML\nNow for the XML, I know everything (e.g. the blah) except for the stuff inside the parameter part.\nWhat would the parameter part look like... |
I would like to know whether I am missing something:
//this is test.idl
typedef foo foo_t;
// end of test.idl
When I compile test.idl with the following command:
midl /W4 test.idl
I get this output
Microsoft (R) 32b/64b MIDL Compiler Version 6.00.0366
Copyright (c) Microsoft Corporation 1991-2002. All rights reserved... | The behavior you're encountering with the MIDL (Microsoft Interface Definition Language) compiler is indeed unexpected based on your assumptions.
When you define `typedef foo foo_t;` in your IDL file and `foo` is not a previously defined type, you would typically expect the MIDL compiler to issue an error regarding t... | 46,610 | [
{
"from": "human",
"value": "I would like to know whether I am missing something:\n//this is test.idl\ntypedef foo foo_t;\n// end of test.idl\n\nWhen I compile test.idl with the following command:\nmidl /W4 test.idl\n\nI get this output\nMicrosoft (R) 32b/64b MIDL Compiler Version 6.00.0366\nCopyright (c) M... |
Is it possible to integrate Hudson with MS Test?
I am setting up a smaller CI server on my development machine with Hudson right now, just so that I can have some statistics (ie. FxCop and compiler warnings). Of course, it would also be nice if it could just run my unit tests and present their output.
Up to now, I have... | Yes, it is possible to integrate MS Test with Hudson (now known as Jenkins) to some extent, although it requires some additional steps since Jenkins does not natively support the TRX result files generated by MSTest.
### Steps to Integrate MS Test with Hudson/Jenkins
1. **Run MSTest**: As you've already done, you can... | 46,156 | [
{
"from": "human",
"value": "Is it possible to integrate Hudson with MS Test?\nI am setting up a smaller CI server on my development machine with Hudson right now, just so that I can have some statistics (ie. FxCop and compiler warnings). Of course, it would also be nice if it could just run my unit tests a... |
I'm having some trouble running a groovy servlet (groovlet) in tomcat that imports a library class. When I don't import anything the groovlet works correctly, but if I do import something that I expect to be on the classpath (I can import the same class successfully in a regular servlet), I see the following error:
gro... | It seems like you're encountering a class resolution issue with Groovy scripts running in Tomcat, particularly with your groovlet trying to import a class from a JAR that you have placed in `shared/lib`. This is not uncommon, and can often be resolved with a few adjustments. Here are several suggestions to troubleshoot... | 43,342 | [
{
"from": "human",
"value": "I'm having some trouble running a groovy servlet (groovlet) in tomcat that imports a library class. When I don't import anything the groovlet works correctly, but if I do import something that I expect to be on the classpath (I can import the same class successfully in a regular... |
I'm going to be including some code in a word document. Specifically some sql statements but this question applies to any sort of language. I'd like to make the code look a bit nicer and easier to read with some highlighting.
Is there any tool that will do syntax highlighting on some code and allow me to copy the resul... | Yes, there are several tools and online services that can help you achieve syntax highlighting for your SQL statements (or other code) and then allow you to copy the result into Microsoft Word without losing formatting. Here are some options:
### 1. **Online Syntax Highlighters**
There are several websites that provid... | 45,500 | [
{
"from": "human",
"value": "I'm going to be including some code in a word document. Specifically some sql statements but this question applies to any sort of language. I'd like to make the code look a bit nicer and easier to read with some highlighting.\nIs there any tool that will do syntax highlighting o... |
I'm using ganymede but I can't find the option to change mirror for the update sites. Is there a way to change this?
| In Eclipse Ganymede, you can change the update site mirror by following these steps:
1. **Open the Software Updates dialog:**
- Go to `Help` in the menu bar.
- Select `Software Updates`.
- Click on `Find and Install`.
2. **Manage update sites:**
- In the "Update" dialog that appears, look for an option ca... | 47,281 | [
{
"from": "human",
"value": "I'm using ganymede but I can't find the option to change mirror for the update sites. Is there a way to change this? \n"
},
{
"from": "gpt",
"value": "In Eclipse Ganymede, you can change the update site mirror by following these steps:\n\n1. **Open the Software Updat... |
When you rotate an image using canvas, it'll get cut off - how do I avoid this? I already made the canvas element bigger then the image, but it's still cutting off the edges.
Example:
<html>
<head>
<title>test</title>
<script type="text/javascript">
function startup() {
v... | When you rotate an image using a canvas in JavaScript, the origin point of rotation is (0, 0) by default, which means that the rotation will happen around the top-left corner of the canvas. This can cause parts of the image to be cut off if they extend beyond the canvas boundaries after rotation.
To avoid cutting off ... | 45,394 | [
{
"from": "human",
"value": "When you rotate an image using canvas, it'll get cut off - how do I avoid this? I already made the canvas element bigger then the image, but it's still cutting off the edges.\nExample:\n<html>\n <head>\n <title>test</title>\n <script type=\"text/javascript\">\n ... |
I have a UserControl Library solution which has the following
UserControl
---UserControl project
---UserControl Test Project
IN my test project, I am able to add my usercontrol to the tool box. When i drag it and drop it in my forms, it fails. I put in logging and found out that my usercontrol reads a config ... | The issue you're facing is due to how the executing assembly location is resolved when you drag your UserControl from the toolbox onto a form in the Visual Studio designer. In that context, the UserControl is being loaded from a temporary directory created by the designer, which is not necessarily where your build outp... | 44,461 | [
{
"from": "human",
"value": "I have a UserControl Library solution which has the following \nUserControl\n ---UserControl project\n ---UserControl Test Project\n\nIN my test project, I am able to add my usercontrol to the tool box. When i drag it and drop it in my forms, it fails. I put in logging and... |
How can I get the current system status (current CPU, RAM, free disk space, etc.) in Python? Ideally, it would work for both Unix and Windows platforms.
There seems to be a few possible ways of extracting that from my search:
Using a library such as PSI (that currently seems not actively developed and not supported on... | Yes, there is a well-supported and widely-used library called `psutil` that can help you gather system information such as CPU usage, memory usage, and disk space on both Unix and Windows platforms. `psutil` is actively maintained and offers a simple API to access system details in a cross-platform manner.
Here’s how ... | 44,589 | [
{
"from": "human",
"value": "How can I get the current system status (current CPU, RAM, free disk space, etc.) in Python? Ideally, it would work for both Unix and Windows platforms.\nThere seems to be a few possible ways of extracting that from my search:\n\nUsing a library such as PSI (that currently seems... |
What is the best practice for importing text into html from a multipage InDesign document, from designer to non-designer. Document designed on a mac going to CMS on PC - hand off the InDesign File or strip text into word file? Supplying all images and pdf as go-by?
| When importing text from a multi-page InDesign document into HTML, especially when transitioning from a designer (Mac) to a non-designer (PC), there are a few best practices to ensure a smooth handoff. Here are some recommendations:
1. **Export Text to a Readable Format**:
- **Plain Text or Word Document**: Strip t... | 45,051 | [
{
"from": "human",
"value": "What is the best practice for importing text into html from a multipage InDesign document, from designer to non-designer. Document designed on a mac going to CMS on PC - hand off the InDesign File or strip text into word file? Supplying all images and pdf as go-by?\n"
},
{
... |
I noticed that doxygen uses the graphviz library for creating diagrams. Have you ever used graphviz for generating documentation? Is it worth learning the graphviz for documentation purposes outside the scope of doxygen? Or am I better off to sticking with a standard data modeling package like Visio?
I understand the m... | Graphviz is indeed a powerful tool for creating diagrams and visual representations, and it's commonly used in documentation tools like Doxygen. However, whether it's worth learning Graphviz for your specific documentation needs depends on several factors:
### Advantages of Graphviz:
1. **Text-Based**: Graphviz uses ... | 46,477 | [
{
"from": "human",
"value": "I noticed that doxygen uses the graphviz library for creating diagrams. Have you ever used graphviz for generating documentation? Is it worth learning the graphviz for documentation purposes outside the scope of doxygen? Or am I better off to sticking with a standard data modeli... |
I have a .Net program that I want to install on a terminal server. In the past I've created installer projects and generated an MSI. However, terminal servers require all users be bumped off before running an MSI and I want to avoid that. Is there a way to do an install without a MSI?
Sometimes for some user account... | Installing a .NET application on a terminal server without using an MSI can be a bit challenging, especially considering the need for proper registration and handling of dependencies. However, you can take a few approaches to deploy your application without requiring a full MSI installation:
### 1. **Using ClickOnce D... | 39,405 | [
{
"from": "human",
"value": "I have a .Net program that I want to install on a terminal server. In the past I've created installer projects and generated an MSI. However, terminal servers require all users be bumped off before running an MSI and I want to avoid that. Is there a way to do an install witho... |
How does operating system know what filesystem a partition is using? In other words, how are FAT16/32, NTFS, ext2/3 etc. distinguished from each other?
| Operating systems can determine the filesystem type of a partition through various methods, primarily by examining filesystem-specific signatures, metadata structures, or the partition table. Here are the key ways they achieve this:
### 1. **Superblocks and Boot Sectors**
Different filesystems have unique identifiers ... | 47,073 | [
{
"from": "human",
"value": "How does operating system know what filesystem a partition is using? In other words, how are FAT16/32, NTFS, ext2/3 etc. distinguished from each other?\n"
},
{
"from": "gpt",
"value": "Operating systems can determine the filesystem type of a partition through variou... |
I place the following statements in the second row of my grid in the xaml:
<ScrollViewer VerticalScrollBarVisibility="Auto" Grid.Row="1">
<ListView Name="listView" Margin="5" Grid.Row="1">
<ListView.View>
<GridView AllowsColumnReorder="True">
<GridViewCo... | The issue you're experiencing with the `ScrollViewer` not displaying a vertical scrollbar in your `ListView` is likely due to the structure of the XAML. When you wrap a `ListView` with a `ScrollViewer`, the `ListView`'s built-in scrolling capabilities may conflict with the `ScrollViewer`.
In WPF, the `ListView` is al... | 45,708 | [
{
"from": "human",
"value": "I place the following statements in the second row of my grid in the xaml:\n<ScrollViewer VerticalScrollBarVisibility=\"Auto\" Grid.Row=\"1\">\n <ListView Name=\"listView\" Margin=\"5\" Grid.Row=\"1\">\n\n <ListView.View>\n <GridView AllowsC... |
Is there a way to link to another View that displays search results without having to use a querystring? For example, I know that I can do the following:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Index(string txtOrderNumber)
{
return RedirectToAction("OrderLookup", new { controller = "Report", id = txtOrde... | In ASP.NET MVC, if you want to link to another view while passing data without using a query string, you typically have a few options, such as using route parameters or a custom route. You can set up your routes to accept parameters in the URL without needing to use query strings.
Here’s how you can do that using rout... | 47,926 | [
{
"from": "human",
"value": "Is there a way to link to another View that displays search results without having to use a querystring? For example, I know that I can do the following:\n[AcceptVerbs(HttpVerbs.Post)]\npublic ActionResult Index(string txtOrderNumber)\n{\n return RedirectToAction(\"OrderLook... |
I have the following code for a UDF but it errors with the message:
Msg 156, Level 15, State 1, Procedure
CalendarTable, Line 39 Incorrect
syntax near the keyword 'OPTION'.
is it because of my WITH statement as I can run the same code fine in a stored procedure?
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
--... | The error you are encountering is due to the use of the `OPTION` clause within a Common Table Expression (CTE) in a User Defined Function (UDF). In T-SQL, the `OPTION` clause is only valid in the context of a stored procedure or a standalone `SELECT`, `INSERT`, `UPDATE`, or `DELETE` statement. It cannot be used directl... | 44,603 | [
{
"from": "human",
"value": "I have the following code for a UDF but it errors with the message:\n\nMsg 156, Level 15, State 1, Procedure\n CalendarTable, Line 39 Incorrect\n syntax near the keyword 'OPTION'.\n\nis it because of my WITH statement as I can run the same code fine in a stored procedure?\nSET... |
Excel 2007
I have a row of cells with variation of numbers and letters (which all mean something.. not random.)
It's basically a timesheet. If they take a sick day they put in S, if they take a partial sick day they put in PS. The problem is they also put in the hours they did work too. They put it in this format: (... | In Excel 2007, you can indeed manage the variations of input in your timesheet while keeping track of both sick days (S and PS) and the hours worked. Below, I'll outline how to achieve this, including counting the occurrences and summing the hours worked.
### Step 1: Counting "S" and "PS"
1. **Counting "S" Cells**: Y... | 44,511 | [
{
"from": "human",
"value": "Excel 2007\nI have a row of cells with variation of numbers and letters (which all mean something.. not random.)\nIt's basically a timesheet. If they take a sick day they put in S, if they take a partial sick day they put in PS. The problem is they also put in the hours they d... |
I would like to know how to change the colour of the equality sign and double quotes for html documents in the eclipse PDT IDE. I can change most colours in Preferences -> Web & XML -> HTML Files -> syntax coloring, but can't change the characters = or " e.g. in an anchor tag <a href="">.
How to change these colours?
| In Eclipse PDT (PHP Development Tools) or any Eclipse IDE that supports HTML editing, you can usually customize the colors for syntax highlighting through the preferences. However, specific characters like the equality sign (`=`) and double quotes (`"`) may not be directly configurable through the standard syntax color... | 45,633 | [
{
"from": "human",
"value": "I would like to know how to change the colour of the equality sign and double quotes for html documents in the eclipse PDT IDE. I can change most colours in Preferences -> Web & XML -> HTML Files -> syntax coloring, but can't change the characters = or \" e.g. in an anchor tag <... |
I'm working a piece of code to turn phone numbers into links for mobile phone - I've got it but it feels really dirty.
import re
from string import digits
PHONE_RE = re.compile('([(]{0,1}[2-9]\d{2}[)]{0,1}[-_. ]{0,1}[2-9]\d{2}[-_. ]{0,1}\d{4})')
def numbers2links(s):
result = ""
last_match_index = 0
for m... | Certainly! You can simplify your code by using `re.sub()` instead of manually constructing the result string. The `re.sub()` function allows you to define a replacement function that takes the match object as an argument, which makes it cleaner and easier to understand.
Here's how you could refactor your `numbers2link... | 48,172 | [
{
"from": "human",
"value": "I'm working a piece of code to turn phone numbers into links for mobile phone - I've got it but it feels really dirty.\nimport re\nfrom string import digits\n\nPHONE_RE = re.compile('([(]{0,1}[2-9]\\d{2}[)]{0,1}[-_. ]{0,1}[2-9]\\d{2}[-_. ]{0,1}\\d{4})')\n\ndef numbers2links(s):\... |
In the past, on Windows XP machines, I was able to install P4V (the stupid platform-independent Perforce visual client that Perforce tries to shove down your throats), then after that, install P4Win (the wonderful clean robust mature visual client that Perforce is stupidly trying to deprecate).
If I did the installs in... | Getting the Time Lapse View option to work in P4Win after installing P4V on Vista can sometimes be tricky due to how the installations interact with each other. Here’s a potential method you could try to get this functionality back:
1. **Uninstall Both Clients**: Start with a clean slate by uninstalling both P4V and P... | 46,173 | [
{
"from": "human",
"value": "In the past, on Windows XP machines, I was able to install P4V (the stupid platform-independent Perforce visual client that Perforce tries to shove down your throats), then after that, install P4Win (the wonderful clean robust mature visual client that Perforce is stupidly tryin... |
So I have this code for these Constructors of the Weapon class:
Weapon(const WeaponsDB * wepDB);
Weapon(const WeaponsDB * wepDB_, int * weaponlist);
~Weapon(void);
And I keep getting an error:
1>c:\users\owner\desktop\bosconian\code\bosconian\weapon.h(20) : error C2062: type 'int' unexpected
and ensuing errors (mor... | The errors you're experiencing appear to be related to the way you're defining your `Weapon` class and its constructors. From the snippets you've shared, there are a few potential issues that could be causing the compilation errors. Let's address them step by step.
### Problems Identified
1. **Macro Definition Issue*... | 46,126 | [
{
"from": "human",
"value": "So I have this code for these Constructors of the Weapon class:\nWeapon(const WeaponsDB * wepDB);\nWeapon(const WeaponsDB * wepDB_, int * weaponlist);\n~Weapon(void); \n\nAnd I keep getting an error:\n1>c:\\users\\owner\\desktop\\bosconian\\code\\bosconian\\weapon.h(20) : error... |
How can I remove the very first "1" from any string if that string starts with a "1"?
"1hello world" => "hello world"
"112345" => "12345"
I'm thinking of doing
string.sub!('1', '') if string =~ /^1/
but I' wondering there's a better way. Thanks!
| You can achieve this in a more straightforward way by using a regular expression with `sub` method in Ruby. This method allows you to replace only the first occurrence of the pattern that matches. In your case, you want to replace the "1" at the start of the string. Here’s how you can do it:
```ruby
def remove_first_o... | 49,414 | [
{
"from": "human",
"value": "How can I remove the very first \"1\" from any string if that string starts with a \"1\"?\n\"1hello world\" => \"hello world\"\n\"112345\" => \"12345\"\n\nI'm thinking of doing\nstring.sub!('1', '') if string =~ /^1/\n\nbut I' wondering there's a better way. Thanks!\n"
},
{
... |
I don't mind learning xaml and I'm sure I need to be familiar somewhat, but when I was first trying out Silverlight 1 with javascript it looked like a tremendous amount of overhead. I decided to wait until tools matured and asp.net was added. Well, asp.net has been added with Silverlight 2.0, and now I want to look a... | Using Silverlight and XAML can indeed feel like a lot of overhead when you first start, especially if you come from a background like Flash, where the development experience may feel more straightforward. However, once you get accustomed to XAML, you may find that it offers powerful features for building rich user inte... | 48,073 | [
{
"from": "human",
"value": "I don't mind learning xaml and I'm sure I need to be familiar somewhat, but when I was first trying out Silverlight 1 with javascript it looked like a tremendous amount of overhead. I decided to wait until tools matured and asp.net was added. Well, asp.net has been added with ... |
I've been looking for a while how to play sound on the iphone, and I think it's something along the lines of:
[[NSSound soundNamed:@"cat.mp3"] play];
But the NSSound is on the AppKit ... any suggestions ? I know there is a really simple answer to this, but today my searches are not rendering any result ...
| To play sound on an iPhone using Swift, you can use the `AVFoundation` framework, which is the recommended way to handle audio. Here's a simple way to play a sound file using `AVAudioPlayer`.
1. First, make sure to import the `AVFoundation` framework in your Swift file:
```swift
import AVFoundation
```
2. Then, you ... | 48,994 | [
{
"from": "human",
"value": "I've been looking for a while how to play sound on the iphone, and I think it's something along the lines of:\n[[NSSound soundNamed:@\"cat.mp3\"] play];\n\nBut the NSSound is on the AppKit ... any suggestions ? I know there is a really simple answer to this, but today my searche... |
I have found C++ FQA Lite very edificatory and would like to read more criticism. Could you recommend me something similar but concerning C#, please?
Thanks.
| If you're looking for a critical examination of C# similar to "C++ FAQ Lite," you might want to consider the following resources:
1. **"C# in Depth" by Jon Skeet** - While primarily an informative book, Jon Skeet offers insights into some of the design decisions in C# and discusses both strengths and weaknesses of the... | 48,255 | [
{
"from": "human",
"value": "I have found C++ FQA Lite very edificatory and would like to read more criticism. Could you recommend me something similar but concerning C#, please?\nThanks.\n"
},
{
"from": "gpt",
"value": "If you're looking for a critical examination of C# similar to \"C++ FAQ Lit... |
Just curious, did I overlook somewhere in the API to display a chat bubble type image as found in the iPhone's SMS application? There's a few applications out there that use bubbles that look verbatim to the iPhone's and I'm wondering if they're using a native widget or their own image.
This is also seen in the Tweetie... | In iOS development, there isn't a built-in native widget specifically designed to display chat bubbles like those seen in the iPhone's SMS application. Developers typically achieve this effect by using custom views or images.
Here are some common approaches to implement chat bubbles in an iOS application:
1. **Custom... | 45,698 | [
{
"from": "human",
"value": "Just curious, did I overlook somewhere in the API to display a chat bubble type image as found in the iPhone's SMS application? There's a few applications out there that use bubbles that look verbatim to the iPhone's and I'm wondering if they're using a native widget or their ow... |
What's your opinion for the best possible way to build asp.net multilingual localized web application (only UI localization of string resources). Especially this two things:
How to store resources? Xml files, resx files or something else?
How to handle URL's? I don't want to keep language parameter in query string all... | Building a multilingual localized web application in ASP.NET involves several best practices for managing string resources and handling URLs effectively. Below are some recommendations for both aspects:
### 1. How to Store Resources
**Resx Files**:
- **Recommendation**: Use `.resx` files for localization. This is the... | 40,935 | [
{
"from": "human",
"value": "What's your opinion for the best possible way to build asp.net multilingual localized web application (only UI localization of string resources). Especially this two things:\n\nHow to store resources? Xml files, resx files or something else?\nHow to handle URL's? I don't want to... |
I have no clue about trigonometry, despite learning it in school way back when, and I figure this should be pretty straightforward, but trawling through tons of trig stuff on the web makes my head hurt :) So maybe someone could help me...
The title explains exactly what I want to do, I have a line:
x1,y1 and x2,y2
an... | To find the coordinates \( (x_3, y_3) \) of the vertex of an isosceles triangle given the endpoints of the base \( (x_1, y_1) \) and \( (x_2, y_2) \), as well as the length of the altitude from the base to the vertex, you can follow these steps:
### Steps to Calculate \( (x_3, y_3) \)
1. **Calculate the Midpoint of t... | 42,060 | [
{
"from": "human",
"value": "I have no clue about trigonometry, despite learning it in school way back when, and I figure this should be pretty straightforward, but trawling through tons of trig stuff on the web makes my head hurt :) So maybe someone could help me...\nThe title explains exactly what I want ... |
So I have some XML in the following format:
<somenode>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title/>
</head>
<body>
<p>P one</p>
<p>Another p</p>
</body>
</html>
</somenode>
Nestled in there is some html, which I didn't think wou... | The issue you're encountering is related to how XML namespaces are handled in .NET. When you have an XML document that includes a namespace (as in your HTML), the XPath queries need to take that namespace into account.
Here's how you can select the contents of the `<body>` tag while properly considering the XML namesp... | 46,899 | [
{
"from": "human",
"value": "So I have some XML in the following format:\n<somenode>\n <html xmlns=\"http://www.w3.org/1999/xhtml\">\n <head>\n <title/>\n </head>\n <body>\n <p>P one</p>\n <p>Another p</p>\n </body>\n </html>\n</somenode>\n\... |
We are in the process of upgrading our projects from C# 2.0 / VS2005 to C# 3.0 / VS2008. As part of the upgrade, we are adding some items to our coding standards document.
How would (or did) you change your coding standards document when upgrading from C# 2.0 / VS2005 to C# 3.0 / VS2008?
| Upgrading from C# 2.0 / VS2005 to C# 3.0 / VS2008 introduces several new features and enhancements that can significantly improve code quality, maintainability, and developer productivity. Here are some suggested changes and additions to your coding standards document to incorporate the new capabilities of C# 3.0:
###... | 43,759 | [
{
"from": "human",
"value": "We are in the process of upgrading our projects from C# 2.0 / VS2005 to C# 3.0 / VS2008. As part of the upgrade, we are adding some items to our coding standards document.\nHow would (or did) you change your coding standards document when upgrading from C# 2.0 / VS2005 to C# 3.0... |
I'm using a QTreeWidget to display some simple items. I've set the list sortable by .setSortingEnabled(true) calling. In this way, the list is sorted only when the user press the title column, and not automatically whenever new item is inserted.
Is there a way to force the automatic sorting in a specified column withou... | In a `QTreeWidget`, while it automatically sorts when the user clicks on the header, it does not sort automatically when items are added unless you explicitly call `sortItems(column)`. Unfortunately, there isn't a built-in property to enable automatic sorting whenever a new item is added.
However, you can achieve your... | 45,901 | [
{
"from": "human",
"value": "I'm using a QTreeWidget to display some simple items. I've set the list sortable by .setSortingEnabled(true) calling. In this way, the list is sorted only when the user press the title column, and not automatically whenever new item is inserted.\nIs there a way to force the auto... |
Could anyone please help me with this. On the production site app_offline.htm works only till you start uploading dlls. As soon as you start uploading dlls it throws following error"Could not load file or assembly 'SubSonic' or one of its dependencies.
The process cannot access the file because it is being used by ano... | The issue you're experiencing suggests that the application is still processing requests even when the `app_offline.htm` file is present. The error message indicates that the application pool is still trying to access the assembly (in this case, 'SubSonic') while you're performing a deployment, which can lead to the er... | 46,844 | [
{
"from": "human",
"value": "Could anyone please help me with this. On the production site app_offline.htm works only till you start uploading dlls. As soon as you start uploading dlls it throws following error\"Could not load file or assembly 'SubSonic' or one of its dependencies. \nThe process cannot acce... |
Is it possible for an Subversion client to break a repository in any way? This could be any sort of destructive disruption, but it must be such that it cannot be recovered from without restoring the repository from a backup.
Obviously, deleting everything and then checking that it is easy to fix simply with a rollback,... | Yes, it is possible for a Subversion (SVN) client to break a repository in ways that could lead to data loss or corruption that cannot be easily fixed with a rollback or standard recovery techniques. Here are some scenarios where a destructive disruption can occur:
1. **Direct Manipulation of the Repository**: If some... | 45,732 | [
{
"from": "human",
"value": "Is it possible for an Subversion client to break a repository in any way? This could be any sort of destructive disruption, but it must be such that it cannot be recovered from without restoring the repository from a backup.\nObviously, deleting everything and then checking that... |
The sound for my iPhone app worked fine when I was running iPhone OS 2.0. I updated to OS 2.2 and now the sound only works with headphones. How can I make the sounds work for both headphones and the speaker again?
| If your iPhone app's sound is only working with headphones after updating to iPhone OS 2.2, it could be due to a few reasons. Here are some steps you can take to troubleshoot and resolve the issue:
1. **Check Audio Session Settings**: Ensure that your app is correctly configuring the audio session. You might want to s... | 45,476 | [
{
"from": "human",
"value": "The sound for my iPhone app worked fine when I was running iPhone OS 2.0. I updated to OS 2.2 and now the sound only works with headphones. How can I make the sounds work for both headphones and the speaker again?\n"
},
{
"from": "gpt",
"value": "If your iPhone app... |
I searched and found this question but did not like the answer.
Is there another way to get SVN to ignore config files that are checked in in-place (that you cannot check-in changed), but must be modified on your system.
This is a pretty severe failure of SVN, my first disappointment with the system actually. What I'm... | It's understandable to find working with config files in version control systems like SVN a bit frustrating, especially when you need to modify them locally but don't want those modifications to be tracked or affect the repository. Here are a few methods you can consider for handling this situation:
### 1. Use `svn:ig... | 44,747 | [
{
"from": "human",
"value": "I searched and found this question but did not like the answer.\nIs there another way to get SVN to ignore config files that are checked in in-place (that you cannot check-in changed), but must be modified on your system.\nThis is a pretty severe failure of SVN, my first disappo... |
How do I find out which directories are responsible for chewing up all my inodes?
Ultimately the root directory will be responsible for the largest number of inodes, so I'm not sure exactly what sort of answer I want..
Basically, I'm running out of available inodes and need to find a unneeded directory to cull.
Thanks,... | Running out of inodes can be a common issue, especially in systems with a large number of small files. To identify which directories are consuming the most inodes, you can use a combination of `find`, `ls`, and `du` commands in the terminal. Here's a step-by-step guide to help you identify those directories:
### Step ... | 44,539 | [
{
"from": "human",
"value": "How do I find out which directories are responsible for chewing up all my inodes?\nUltimately the root directory will be responsible for the largest number of inodes, so I'm not sure exactly what sort of answer I want..\nBasically, I'm running out of available inodes and need to... |
I have a .NET webform that has a file upload control that is tied to a regular expression validator. This validator needs to validate that only certain filetypes should be allowed for upload (jpg,gif,doc,pdf)
The current regular expression that does this is:
^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))(.jpg|.JPG|.gif|.... | The regular expression you provided is overly complex for your needs, especially since web uploads usually deal with file types in a more simplified manner. Additionally, your current regex also has issues that could prevent it from working as intended.
Here’s a simplified regular expression that should correctly vali... | 47,866 | [
{
"from": "human",
"value": "I have a .NET webform that has a file upload control that is tied to a regular expression validator. This validator needs to validate that only certain filetypes should be allowed for upload (jpg,gif,doc,pdf)\nThe current regular expression that does this is:\n\n\n^(([a-zA-Z]:)|... |
It seems that the choice to use string parsing vs. regular expressions comes up on a regular basis for me anytime a situation arises that I need part of a string, information about said string, etc.
The reason that this comes up is that we're evaluating a soap header's action, after it has been parsed into something ma... | When deciding whether to use string parsing (e.g., `Substring`, `IndexOf`, etc.) versus regular expressions (Regex), it's essential to consider various factors, such as complexity, readability, performance, and the specific requirements of your task. Here's a general guideline to help you make the decision:
### When t... | 45,365 | [
{
"from": "human",
"value": "It seems that the choice to use string parsing vs. regular expressions comes up on a regular basis for me anytime a situation arises that I need part of a string, information about said string, etc.\nThe reason that this comes up is that we're evaluating a soap header's action, ... |
Is there any way to create an array-like object in JavaScript, without using the built-in array? I'm specifically concerned with behavior like this:
var sup = new Array(5);
//sup.length here is 0
sup[0] = 'z3ero';
//sup.length here is 1
sup[1] = 'o3ne';
//sup.length here is 2
sup[4] = 'f3our';
//sup.length here... | In JavaScript, you can create an array-like object that behaves similarly to an array by using an object and overriding the `length` property using getters and setters. However, you cannot achieve the exact same behavior of modifying the `length` property simply by using the index operator (i.e., `obj[index]`). This be... | 45,608 | [
{
"from": "human",
"value": "Is there any way to create an array-like object in JavaScript, without using the built-in array? I'm specifically concerned with behavior like this:\nvar sup = new Array(5);\n//sup.length here is 0\nsup[0] = 'z3ero';\n//sup.length here is 1\nsup[1] = 'o3ne';\n//sup.length here i... |
I would like to programatically (using php) fill out an existing drupal form to create a content type that is included in a contributed module.
Details: The module is SimpleFeed and the content type is Feed. I would like to call the module's functions to accomplish this. The method I am interested in is hook_insert whi... | To programmatically create a content type (in your case, a "Feed" content type provided by the SimpleFeed module) in Drupal, you generally need to interact with Drupal's API to create nodes. The `hook_insert` function you're referring to is a hook that modules can implement to respond to the insertion of a node. The `v... | 40,941 | [
{
"from": "human",
"value": "I would like to programatically (using php) fill out an existing drupal form to create a content type that is included in a contributed module.\nDetails: The module is SimpleFeed and the content type is Feed. I would like to call the module's functions to accomplish this. The me... |
Is there a way to get the responde headers from a web service call on .net?
| Yes, you can retrieve response headers from a web service call in .NET using various methods, depending on which library you're using for the HTTP request. Below are examples for the most common libraries: `HttpClient`, `WebClient`, and `HttpWebRequest`.
### Using `HttpClient`
`HttpClient` is the preferred way to mak... | 44,627 | [
{
"from": "human",
"value": "Is there a way to get the responde headers from a web service call on .net?\n"
},
{
"from": "gpt",
"value": "Yes, you can retrieve response headers from a web service call in .NET using various methods, depending on which library you're using for the HTTP request. Be... |
Does anyone know how to show a asp:TreeView always expanded to the leaves? So if I have a 2-level tree, I want it to be expanded at all times. Is there a property on TreeView that does this or could you show the code snippet on how to do this?
Thank you very much!
Ray.
| To display a `TreeView` control in ASP.NET always expanded to its leaves, there isn't a built-in property that directly accomplishes this. However, you can achieve this by recursively expanding all nodes in the TreeView. You can accomplish this either during data binding or by writing a method that expands all nodes af... | 44,926 | [
{
"from": "human",
"value": "Does anyone know how to show a asp:TreeView always expanded to the leaves? So if I have a 2-level tree, I want it to be expanded at all times. Is there a property on TreeView that does this or could you show the code snippet on how to do this?\nThank you very much!\nRay.\n"
... |
I know what I'm looking for is probably a security hole, but since I managed to do it in Oracle and SQL Server, I'll give it a shot:
I'm looking for a way to execute a shell command from a SQL script on MySQL. It is possible to create and use a new stored procedure if necessary.
Notice: I'm not looking for the SYSTEM c... | Executing shell commands directly from SQL in MySQL is not a standard feature, and there are inherent security risks in enabling such functionality. MySQL does not provide a built-in command like `EXEC_OS` to execute shell commands directly. However, you can achieve similar functionality using a stored procedure in com... | 40,469 | [
{
"from": "human",
"value": "I know what I'm looking for is probably a security hole, but since I managed to do it in Oracle and SQL Server, I'll give it a shot:\nI'm looking for a way to execute a shell command from a SQL script on MySQL. It is possible to create and use a new stored procedure if necessary... |
I want to transfer data between a smart phone app and a website. What are the conventional and not-so-conventional ways of doing it?
Here's what I have thought of so far:
Simple HTTP GET/POST with data being represented as JSON array string, variations of this being encrypted/compressed string as parameter.
Webservic... | Transferring data between a smartphone app and a website can be achieved through various methods, each with its own set of advantages and disadvantages. Here’s a breakdown of some conventional and less conventional approaches:
### Conventional Methods
1. **HTTP API (GET/POST Requests)**:
- As you mentioned, using ... | 43,038 | [
{
"from": "human",
"value": "I want to transfer data between a smart phone app and a website. What are the conventional and not-so-conventional ways of doing it? \nHere's what I have thought of so far:\n\nSimple HTTP GET/POST with data being represented as JSON array string, variations of this being encrypt... |
[continued from Is there a way to tell whether two COM interface references point at the same instance?]
I've got references to Inspector objects from two different sources and need to be able to tell which item from one source corresponds to which item from the other source. However, none of the approaches I have been... | When dealing with COM interfaces and trying to identify whether two references point to the same instance, especially in the context of Outlook's Inspector objects, you face several challenges as you've outlined. Since typical methods of comparison (like using `IUnknown` or `EntryID`) aren't working reliably, here are ... | 43,936 | [
{
"from": "human",
"value": "[continued from Is there a way to tell whether two COM interface references point at the same instance?]\nI've got references to Inspector objects from two different sources and need to be able to tell which item from one source corresponds to which item from the other source. H... |
Is it possible to assign a blank string (i.e. "") as a Default Value in the Entity Framework's EDMX designer? The only technique I've found is to edit the edmx file manually using a text editor
| In the Entity Framework EDMX designer, there isn't a direct feature within the graphical interface to set a default value of a blank string (i.e., `""`) for an entity property. However, there are a couple of ways you can achieve this, including the manual editing approach you mentioned.
Here’s a summary of the approa... | 47,078 | [
{
"from": "human",
"value": "Is it possible to assign a blank string (i.e. \"\") as a Default Value in the Entity Framework's EDMX designer? The only technique I've found is to edit the edmx file manually using a text editor\n"
},
{
"from": "gpt",
"value": "In the Entity Framework EDMX designer,... |
I have many different branches/checkouts of the same project code on my development machine. Each one is virtually the same except for various maintenance bug fixes or improvements I'm working on within each project.
The problem comes when I use Find in Files inside Visual Studio to search through my code. VS2005 store... | Unfortunately, Visual Studio 2005 does not provide a built-in feature to directly set the default search directory for the "Find in Files" dialog on a per-project basis. However, you can consider the following workarounds to help you avoid the issue of accidentally searching in the wrong project:
### Workarounds:
1. ... | 45,952 | [
{
"from": "human",
"value": "I have many different branches/checkouts of the same project code on my development machine. Each one is virtually the same except for various maintenance bug fixes or improvements I'm working on within each project.\nThe problem comes when I use Find in Files inside Visual Stud... |
Is there a plain API to access Mercurial repositories from Java?
There are plugins for Netbeans and Eclipse, but unlike their Subversion counterparts, they do not use a common lower-level library but bring their own wrappers to call out to the Mercurial binary. Calling the binary would be okay (for now), but it seems v... | As of my last knowledge update in October 2023, there are limited options for accessing Mercurial repositories directly from Java with a straightforward API. While there are plugins for various IDEs, they generally encapsulate their functionality within the IDE environment and do not offer a standalone library that can... | 46,954 | [
{
"from": "human",
"value": "Is there a plain API to access Mercurial repositories from Java?\nThere are plugins for Netbeans and Eclipse, but unlike their Subversion counterparts, they do not use a common lower-level library but bring their own wrappers to call out to the Mercurial binary. Calling the bina... |
Is there a way to customize the post build event macros, I would like to move the new assembly to a sub folder in the same directory named by the version of the assembly i.e.
copy $(TargetDir)$(TargetFileName) $(TargetDir)$(ASSEMBLYVERSION)\$(TargetFileName)
However there is no such 'macro'.
Sort of building a executab... | In Visual Studio, the post-build event macros do not include a built-in macro for retrieving the assembly version directly. However, you can achieve your goal by using a combination of a custom executable or script that retrieves the assembly version and then use that information in the post-build event.
Here's a step... | 44,480 | [
{
"from": "human",
"value": "Is there a way to customize the post build event macros, I would like to move the new assembly to a sub folder in the same directory named by the version of the assembly i.e.\ncopy $(TargetDir)$(TargetFileName) $(TargetDir)$(ASSEMBLYVERSION)\\$(TargetFileName)\nHowever there is ... |
Is there a way in XAML to add padding around individual characters? Preferably before and after the character.
I have a textbox that I would like the input to be spaced out a bit more (so it aligns with a background image). It would be ideal to be able to do something like:
Any ideas how one can accomplish this?
It... | In XAML, there isn't a direct way to set padding for individual characters in a `TextBox` or other text controls like you can in MS Word. However, there are some creative workarounds that can help achieve a similar effect.
### Option 1: Using a `TextBlock` with `Run` Elements
If your goal is to display text with padd... | 46,269 | [
{
"from": "human",
"value": "Is there a way in XAML to add padding around individual characters? Preferably before and after the character.\nI have a textbox that I would like the input to be spaced out a bit more (so it aligns with a background image). It would be ideal to be able to do something like:\n... |
So I'm teaching myself Ruby on Rails, with a PHP background. I've written a sloppy, proof-of-concept PHP application called "2NDP." I want to re-create this in Ruby on Rails (but more basic, more clean, and with a better interface), so I can learn some of the basics.
2NDP is a website where you can basically write your... | In Ruby on Rails, you can achieve the "Choose-Your-Own-Adventure" structure you're describing by using a self-referential association for the `Page` model. This approach allows a single `Page` to reference multiple other `Page` instances without the need to create separate columns for each reference.
Here's how you ca... | 43,633 | [
{
"from": "human",
"value": "So I'm teaching myself Ruby on Rails, with a PHP background. I've written a sloppy, proof-of-concept PHP application called \"2NDP.\" I want to re-create this in Ruby on Rails (but more basic, more clean, and with a better interface), so I can learn some of the basics.\n2NDP is ... |
I'm building an ASP.NET MVC application with a form that needs validation. The majority of the form is static, but part of the form is dynamic.
I need to enable the user to enter n string/date combinations.
The string/date combos need to be validated server side, and I need to give feedback to the user preferably dir... | To handle dynamic input fields in an ASP.NET MVC application while still ensuring that you can perform server-side validation and provide feedback next to each combination, you will need to approach the issue by dynamically generating the input fields and their associated validation messages.
Here's a step-by-step gui... | 41,580 | [
{
"from": "human",
"value": "I'm building an ASP.NET MVC application with a form that needs validation. The majority of the form is static, but part of the form is dynamic. \nI need to enable the user to enter n string/date combinations.\nThe string/date combos need to be validated server side, and I need ... |
I'm wanting to use jQuery to wrap a mailto: anchor around an email address, but it's also grabbing the whitepace that the CMS is generating.
Here's the HTML I have to work with, the script as I have it and a copy of the output.
HTML
<div class="field field-type-text field-field-email">
<div class="field-item">
na... | To address the issue of unwanted whitespace being included when wrapping the email address with a `mailto:` link, you can use the `.trim()` method in jQuery. This method removes leading and trailing whitespace from a string. Here's how you can modify your script to achieve the desired output without any extra whitespac... | 45,505 | [
{
"from": "human",
"value": "I'm wanting to use jQuery to wrap a mailto: anchor around an email address, but it's also grabbing the whitepace that the CMS is generating.\nHere's the HTML I have to work with, the script as I have it and a copy of the output.\nHTML\n<div class=\"field field-type-text field-fi... |
Trying to create a random string, x characters in length using 0-9 and a-z/A-Z and can't seem to find a good example, any ideas?
| Certainly! Below are examples in several programming languages to generate a random string of a specified length using characters from 0-9, a-z, and A-Z.
### Python
```python
import random
import string
def generate_random_string(length):
characters = string.ascii_letters + string.digits
return ''.join(rando... | 44,246 | [
{
"from": "human",
"value": "Trying to create a random string, x characters in length using 0-9 and a-z/A-Z and can't seem to find a good example, any ideas?\n"
},
{
"from": "gpt",
"value": "Certainly! Below are examples in several programming languages to generate a random string of a specified... |
I have this code:
SELECT idcallhistory3, callid, starttime, answertime, endtime, duration,
is_answ, is_fail, is_compl, is_fromoutside, mediatype, from_no,
to_no, callerid, dialednumber, lastcallerid, lastdialednumber,
group_no, line_no
FROM "public".callhistory3
WHERE (starttim... | To achieve the functionality where you want to pass a specific value for one parameter and retrieve all results without filtering for others, you can modify your SQL query using conditional logic. One common approach is to use the SQL `OR` condition in your `WHERE` clause.
Here’s an updated version of your query that ... | 46,784 | [
{
"from": "human",
"value": "I have this code:\nSELECT idcallhistory3, callid, starttime, answertime, endtime, duration,\n is_answ, is_fail, is_compl, is_fromoutside, mediatype, from_no,\n to_no, callerid, dialednumber, lastcallerid, lastdialednumber,\n group_no, line_no\nFROM ... |
I have a customer who needs to send some direct mailing to his contacts which is being collected from trade shows etc. I am thinking about providing a web based solution for them on sending direct mailing material- however this kind of solution always face a major difficulty on having the server blacklisted. I would li... | Maintaining a healthy SMTP server for sending direct mail can indeed be challenging, especially if you want to avoid getting blacklisted. Here are several best practices and strategies you can implement to help ensure your SMTP server remains in good standing:
### 1. **Use Double Opt-In:**
- Ensure that your contac... | 43,362 | [
{
"from": "human",
"value": "I have a customer who needs to send some direct mailing to his contacts which is being collected from trade shows etc. I am thinking about providing a web based solution for them on sending direct mailing material- however this kind of solution always face a major difficulty on ... |
I'd like to be able to print the definition code of a lambda function.
Example if I define this function through the lambda syntax:
>>>myfunction = lambda x: x==2
>>>print_code(myfunction)
I'd like to get this output:
x==2
| To print the source code of a lambda function in Python, you can use the `inspect` module, which provides several useful functions to retrieve information about live objects. However, it's important to note that `inspect.getsource()` only works if the lambda function has been defined in a context where the source code ... | 47,240 | [
{
"from": "human",
"value": "I'd like to be able to print the definition code of a lambda function.\nExample if I define this function through the lambda syntax:\n>>>myfunction = lambda x: x==2\n>>>print_code(myfunction)\n\nI'd like to get this output:\nx==2\n\n"
},
{
"from": "gpt",
"value": "To... |
So it's trivial to create a Settings style table on the iPhone. The problem is, they add a great deal of code as your Settings have a gamut of options/styled cells. One section might have a check list, another might have cells with accessory disclosures to drill down further, another might be labels with UITextFields.
... | Creating a Settings-style table view in an iOS app can indeed become complex, especially as the requirements for different sections and cell types grow. There are several approaches to achieve a clean and maintainable design. Below, I outline some best practices and common patterns used by developers:
### 1. Use a Sin... | 40,840 | [
{
"from": "human",
"value": "So it's trivial to create a Settings style table on the iPhone. The problem is, they add a great deal of code as your Settings have a gamut of options/styled cells. One section might have a check list, another might have cells with accessory disclosures to drill down further, an... |
How do I create a .Net Web Service in IronPython?
Preferably dynamically without any pre- or post-processing.
| Creating a .NET web service using IronPython can be accomplished by leveraging the capabilities of ASP.NET to expose functionality via HTTP. Here's a basic guide to get you started with creating a simple web service dynamically in IronPython.
### Requirements
- **IronPython** installed on your machine. You can downloa... | 43,901 | [
{
"from": "human",
"value": "How do I create a .Net Web Service in IronPython?\nPreferably dynamically without any pre- or post-processing.\n"
},
{
"from": "gpt",
"value": "Creating a .NET web service using IronPython can be accomplished by leveraging the capabilities of ASP.NET to expose functi... |
Like all developers with OCD I try to organise my namespaces within our project so that they match where the file they are contained within sits of disk.
However after a pretty massive refactoring session within VS.NET I've moved files within projects and created new subfolders a plenty, leaving the refactoring of the ... | Visual Studio does not have a built-in feature that automatically syncs namespaces with folder structure across multiple files, but there are a few ways to achieve this with existing tools and extensions that can help simplify the process:
1. **ReSharper**: If you have ReSharper installed, you can use its features to ... | 46,322 | [
{
"from": "human",
"value": "Like all developers with OCD I try to organise my namespaces within our project so that they match where the file they are contained within sits of disk.\nHowever after a pretty massive refactoring session within VS.NET I've moved files within projects and created new subfolders... |
The project I'm working on requires access to the users source control. To do this we are wrapping the Perforce API and the Subversion API ( using P4.NET and SubversionSharp respectively ).
We would like to support as many as we can depending on user requirements and I've tried googling for an existing library but no ... | As of my last knowledge update in October 2023, there isn't a widely-recognized C# library that wraps multiple source control management (SCM) applications in a unified API. Most libraries tend to focus on a specific SCM, like Git, Subversion, or Perforce, and creating a unified API typically requires a fair amount of ... | 44,896 | [
{
"from": "human",
"value": "The project I'm working on requires access to the users source control. To do this we are wrapping the Perforce API and the Subversion API ( using P4.NET and SubversionSharp respectively ). \nWe would like to support as many as we can depending on user requirements and I've trie... |
In Visual Studio as most of you will have noticed that related file can be collapsed in to one. E.G.
Form1.cs
Form1.Designer.cs
I'm creating a DAL library and will be splitting partial classes in to several files such as:
SomeTableClass.cs
SomeTableClass.Generated.cs
SomeTableClass.SomethingElse.cs
Is there ... | In Visual Studio, you can utilize the concept of "partial classes" to achieve the behavior of collapsing related files into a single node in the Solution Explorer. However, for the collapsible effect to work as you desire, you must follow a specific naming convention, and the files must be properly defined as partial c... | 44,325 | [
{
"from": "human",
"value": "In Visual Studio as most of you will have noticed that related file can be collapsed in to one. E.G.\n\nForm1.cs\n\n\nForm1.Designer.cs\n\n\nI'm creating a DAL library and will be splitting partial classes in to several files such as:\n\nSomeTableClass.cs\n\n\nSomeTableClass.Ge... |
I have an invokeworkflow activity inside a replicator activity. The workflow that I'm trying to invoke requires 2 parameters to be passed to it, an integer and a string parameters, and these should be passed to the workflow by the replicator activity. Any ideas on how this could be done?
Thanks.
| To achieve this in a workflow with a `Replicator` activity invoking another workflow using the `InvokeWorkflow` activity, you need to structure your workflow in a way that allows you to pass parameters dynamically for each iteration of the replicator.
Here's how you can accomplish this:
### Step 1: Define Your Workfl... | 43,217 | [
{
"from": "human",
"value": "I have an invokeworkflow activity inside a replicator activity. The workflow that I'm trying to invoke requires 2 parameters to be passed to it, an integer and a string parameters, and these should be passed to the workflow by the replicator activity. Any ideas on how this could... |
Does anyone know of a CSS Adapter for the LinkButton control for ASP.Net 2?
Update:
We are trying to use CSS Buttons. We are using this approach: http://www.oscaralexander.com/tutorials/how-to-make-sexy-buttons-with-css.html For that we need to render the tags which the link button doesn't do.
Possible Solution using ... | It looks like you're on the right track with your custom adapter for the `LinkButton` control in ASP.NET 2. Adapters allow you to modify the rendering of existing controls to fit your design requirements, and in this case, you want to wrap the link button text in a `<span>` to apply CSS styles.
However, let's refine y... | 44,616 | [
{
"from": "human",
"value": "Does anyone know of a CSS Adapter for the LinkButton control for ASP.Net 2?\nUpdate:\nWe are trying to use CSS Buttons. We are using this approach: http://www.oscaralexander.com/tutorials/how-to-make-sexy-buttons-with-css.html For that we need to render the tags which the link ... |
Why would IE 7 display HTTP Error "Bad request" 400 on the same page that Firefox loads without complaining?
| The "HTTP Error 400: Bad Request" indicates that the server cannot process the request sent by the client (in this case, Internet Explorer 7). There are several reasons why IE 7 might display this error while Firefox loads the same page without issue. Here are some potential reasons:
1. **User-Agent String Differences... | 46,523 | [
{
"from": "human",
"value": "Why would IE 7 display HTTP Error \"Bad request\" 400 on the same page that Firefox loads without complaining?\n"
},
{
"from": "gpt",
"value": "The \"HTTP Error 400: Bad Request\" indicates that the server cannot process the request sent by the client (in this case, ... |
I need a thread to wait until a file is exist or created.
I have the following code so far:
while(!receivedDataFile.isFileExists("receiveddata.txt"))
{
try {
Thead.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
return null;
}
}
When I run it, the following exce... | The exception you're encountering, `java.lang.InterruptedException: sleep interrupted`, indicates that the thread was interrupted while it was sleeping. This generally happens when another thread calls the `interrupt()` method on the thread that is sleeping.
Here are a few suggestions to improve your code and handle t... | 44,760 | [
{
"from": "human",
"value": "I need a thread to wait until a file is exist or created.\nI have the following code so far:\nwhile(!receivedDataFile.isFileExists(\"receiveddata.txt\"))\n{\n try {\n Thead.sleep(1000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n retu... |
I am developing a State Machine Workflow using C# and WF in visual studio 2008. On one of my states I need to wait for multiple events to happen until the workflow can transition to the next state. As an example think of a unanimous voting scenario. I cannot find a way to do this. Does anyone have a solution or wor... | Creating a state machine workflow that waits for multiple events in Windows Workflow Foundation (WF) can be a bit tricky, especially in older versions like Visual Studio 2008. However, you can achieve this by leveraging some design patterns and components available in WF.
Here’s a general approach to implement a wait ... | 42,167 | [
{
"from": "human",
"value": "I am developing a State Machine Workflow using C# and WF in visual studio 2008. On one of my states I need to wait for multiple events to happen until the workflow can transition to the next state. As an example think of a unanimous voting scenario. I cannot find a way to do ... |
The canonical way to return multiple values in languages that support it is often tupling.
Option: Using a tuple
Consider this trivial example:
def f(x):
y0 = x + 1
y1 = x * 3
y2 = y0 ** y3
return (y0, y1, y2)
However, this quickly gets problematic as the number of values returned increases. What if you want t... | The best method for returning multiple values from a function largely depends on the context in which you are working, including the complexity of the data being returned, the importance of readability and maintainability, and the specific language features available. Here’s a breakdown of the options you presented:
1... | 43,616 | [
{
"from": "human",
"value": "The canonical way to return multiple values in languages that support it is often tupling.\nOption: Using a tuple\nConsider this trivial example:\ndef f(x):\n y0 = x + 1\n y1 = x * 3\n y2 = y0 ** y3\n return (y0, y1, y2)\n\nHowever, this quickly gets problematic as the numbe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.