instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
Hitting debug will deploy the application to \program files\AppNamespace\AppName.exe and attach to it. However, my app runs on the storage card \SD-MMC Card.
This means I'm debugging and running in different places, so I have a slight maintenance headache.
Therefore the question is, anyone know if you can specify the f... | In Visual Studio, you can specify the folder or path where your application should be deployed during debugging, particularly for applications that are intended to run on a storage card or a specific directory. Here are a few approaches you can take depending on your project type and setup:
### 1. Modify the Project S... | 38,035 | [
{
"from": "human",
"value": "Hitting debug will deploy the application to \\program files\\AppNamespace\\AppName.exe and attach to it. However, my app runs on the storage card \\SD-MMC Card.\nThis means I'm debugging and running in different places, so I have a slight maintenance headache.\nTherefore the qu... |
When creating web parts for Sharepoint, is it better to create an actual web part, or is using and ASP.NET User Control (.ascx) just as good?
I already know how to create the user controls that I need, so it seems like the extra effort of creating a web part is just unnecessary leg work.
What are the advantages of usin... | When considering whether to create a SharePoint web part or simply use an ASP.NET User Control (.ascx), there are several factors to consider. Here’s a comparison of the two approaches, along with the advantages of using a web part:
### Advantages of Using Web Parts:
1. **Integration with SharePoint's Web Part Framew... | 38,207 | [
{
"from": "human",
"value": "When creating web parts for Sharepoint, is it better to create an actual web part, or is using and ASP.NET User Control (.ascx) just as good?\nI already know how to create the user controls that I need, so it seems like the extra effort of creating a web part is just unnecessary... |
Say I have a form like:
class GeneralForm(forms.Form):
field1 = forms.IntegerField(required=False)
field2 = forms. IntegerField(required=False)
And I want to show it twice on a page within one form tag each time with a different prefix e.g.,:
rest of page ...
<form ..>
GeneralForm(data,prefix="form1").as_table... | To handle a situation where you want to display the same Django form twice on a page, each with a different prefix, and then validate and redisplay the forms upon submission, you can follow the steps below.
### Step 1: Define the Form
You've already defined the `GeneralForm`. No changes are needed there:
```python
f... | 35,256 | [
{
"from": "human",
"value": "Say I have a form like:\nclass GeneralForm(forms.Form):\n field1 = forms.IntegerField(required=False)\n field2 = forms. IntegerField(required=False)\n\nAnd I want to show it twice on a page within one form tag each time with a different prefix e.g.,:\nrest of page ...\n<fo... |
Say I have entities organized in a hierarchy with Parent being the root entity and Child being a subclass of Parent. I'd like to setup an NSArrayController to fetch only entities of Parent, but not Child.
If you set the Entity Name of the array controller in Interface Builder to Parent, it fetches all Parent and Child... | To fetch only entities of type `Parent` and exclude those of type `Child` when using Core Data with a SQLite store, you need to ensure that your fetch request explicitly targets only the `Parent` entity, as using the entity name predicate you've described won’t work as intended with SQLite.
Here’s how you can set this... | 38,685 | [
{
"from": "human",
"value": "Say I have entities organized in a hierarchy with Parent being the root entity and Child being a subclass of Parent. I'd like to setup an NSArrayController to fetch only entities of Parent, but not Child.\nIf you set the Entity Name of the array controller in Interface Builder ... |
I wanted to pass calendar1.Selecteddate in a query string from gridview in one page to another gridview (I have written sqlquery in that gridview) in another page. As seen in the below code I tried passing it but this did not work. Can anyone tell me how to pass the selected date from calendar in query string
<as... | It looks like you're trying to pass a selected date from a calendar control in your GridView to another page via a query string in an ASP.NET application. However, the way you're using `Calendar1.SelectedDate` inside the `DataNavigateUrlFormatString` is incorrect because `Calendar1` is not available in that context.
H... | 37,424 | [
{
"from": "human",
"value": "I wanted to pass calendar1.Selecteddate in a query string from gridview in one page to another gridview (I have written sqlquery in that gridview) in another page. As seen in the below code I tried passing it but this did not work. Can anyone tell me how to pass the selected dat... |
I'm not sure how to search for this answer, so I'll go ahead and ask it.
In my rails project I have a User model and a foo model. A user can have one or more foo models assigned to it. I have accomplished this by adding
has_many :foo, :through => :user_foo
in my user model.
Now, over in my view, I want to display a ... | To display a list of all `Foo` models in your user view, you need to ensure that you are actually retrieving all `Foo` records from the database in your controller action. If you are seeing an error indicating that `@foos` is nil, it likely means that you haven't assigned any value to it in your controller.
Here's how... | 39,329 | [
{
"from": "human",
"value": "I'm not sure how to search for this answer, so I'll go ahead and ask it.\nIn my rails project I have a User model and a foo model. A user can have one or more foo models assigned to it. I have accomplished this by adding \nhas_many :foo, :through => :user_foo\n\nin my user model... |
How do I get:
id Name Value
1 A 4
1 B 8
2 C 9
to
id Column
1 A:4, B:8
2 C:9
| To transform your data from the original format to the desired format, you can use programming languages like Python with Pandas or SQL queries if your data is in a database. Below, I'll show you both methods.
### Method 1: Using Python with Pandas
1. Install the Pandas library if you haven't already:
```bash
... | 37,858 | [
{
"from": "human",
"value": "How do I get:\nid Name Value\n1 A 4\n1 B 8\n2 C 9\n\nto\nid Column\n1 A:4, B:8\n2 C:9\n\n"
},
{
"from": "gpt",
"value": "To transform your data from the original format to th... |
What's the best .NET PDF editing library available, and why?
It needs to be used on an IIS web-server.
Specifically, I need to edit a PDF which was generated by reporting services.
Factors I'm interested in:
Speed
Memory Consumption
Price
Quality of documentation
Library stability
Size of library
Whatever else you thi... | When looking for the best .NET PDF editing library suitable for use on an IIS web server, especially for editing PDFs generated by SQL Server Reporting Services, a few options stand out based on your criteria. The most popular and widely recommended libraries are **iText7**, **PDFsharp**, and **Syncfusion PDF Library**... | 33,444 | [
{
"from": "human",
"value": "What's the best .NET PDF editing library available, and why?\nIt needs to be used on an IIS web-server.\nSpecifically, I need to edit a PDF which was generated by reporting services.\nFactors I'm interested in:\n\nSpeed\nMemory Consumption\nPrice\nQuality of documentation\nLibra... |
I was wondering if there was some kind of J tool in the java swing library that opens up a file browser window and allows a user to choose a file. Then the ouput of the file would be the absolute path of the chosen file.
Thanks in advance,
| Yes, in the Java Swing library, you can use the `JFileChooser` class to open a file browser window that allows the user to choose a file. Once the user selects a file, you can retrieve its absolute path.
Here's an example of how you can implement this:
```java
import javax.swing.*;
import java.io.File;
public class ... | 39,062 | [
{
"from": "human",
"value": "I was wondering if there was some kind of J tool in the java swing library that opens up a file browser window and allows a user to choose a file. Then the ouput of the file would be the absolute path of the chosen file.\nThanks in advance,\n"
},
{
"from": "gpt",
"va... |
I'm trying to send email to Active Directory distribution groups.
I know you can send mail using something like:
mail.From = new MailAddress("steveb@microsoft.com");
mail.To.Add("billg@microsoft.com");
//set the content
mail.Subject = "This is an email";
mail.Body = "this is a sample body with html in it.";
mai... | When sending emails to an Active Directory distribution group, you need to use the group's email address rather than its display name. The display name (like "My Test Group") is not a valid email address that can be used in the `MailAddress` class or SMTP sending process.
To do this, you should:
1. **Find the Email A... | 36,313 | [
{
"from": "human",
"value": "I'm trying to send email to Active Directory distribution groups. \nI know you can send mail using something like:\n mail.From = new MailAddress(\"steveb@microsoft.com\");\n mail.To.Add(\"billg@microsoft.com\");\n\n //set the content\n mail.Subject = \"This is an email\";\n mail... |
I am trying to pull data from an ACD call data system, Nortel Contact Center 6.0 to be exact, and if you use that particular system what I am trying to capture is the daily call by call data. However when I use this code
(sCW is a common word string that equals eCallByCallStat and
sDate is
dDate = Format(Month(deffD... | It sounds like you're encountering a frustrating issue with your Excel macro that pulls data from the Nortel Contact Center system. The error you're experiencing is typically associated with issues in the connection string, SQL query, or the way that Excel is attempting to refresh the QueryTable. Here are some suggesti... | 34,431 | [
{
"from": "human",
"value": "I am trying to pull data from an ACD call data system, Nortel Contact Center 6.0 to be exact, and if you use that particular system what I am trying to capture is the daily call by call data. However when I use this code\n(sCW is a common word string that equals eCallByCallStat... |
After I've seen this PDC session I wanted to try to learn a bit of F#. So I thought the best way would be to rewrite in F# something I've already done in C# but my brain just refuses to think in functional mode.
I have this abstract class that has some abstract methods and some virtual methods. I would like to overrid... | To implement an abstract class defined in C# from F# and override its methods, you can follow these steps. Below is an example based on your provided C# abstract class `MyAbstractClass`.
### Step 1: Define Your C# Abstract Class
Make sure you have your C# abstract class compiled into a DLL. The example C# class you p... | 37,085 | [
{
"from": "human",
"value": "After I've seen this PDC session I wanted to try to learn a bit of F#. So I thought the best way would be to rewrite in F# something I've already done in C# but my brain just refuses to think in functional mode. \nI have this abstract class that has some abstract methods and som... |
I'm not sure how "tests first" works and I'd like to hear arguments about when and why one would take this approach.
I hear that it's often recommended to write tests and mock things before writing a single line of implementation. However, I can't help but think that it doesn't fit every situation.
For instance, say I... | Your approach of quickly prototyping to validate ideas before writing formal tests is quite common, especially in early stages of development or when exploring new concepts. This method can be very effective for a variety of reasons. However, let’s explore the "test first" approach, its benefits, and when it might be m... | 37,796 | [
{
"from": "human",
"value": "I'm not sure how \"tests first\" works and I'd like to hear arguments about when and why one would take this approach.\nI hear that it's often recommended to write tests and mock things before writing a single line of implementation. However, I can't help but think that it doesn... |
Is Software Testing really given its importance at the academic level?
I believe there is a need in universities offering Software Engineering (and probably even Computer Science) to treat Software Testing as a separate course and topic in itself, rather than as part of a general topic of Software Engineering. Irrespec... | Your observations about the importance of software testing in academic curricula, particularly in Software Engineering and Computer Science programs, are quite valid and widely shared among professionals in the field. Here are some points to consider regarding the status of software testing in academia:
### 1. **Criti... | 37,357 | [
{
"from": "human",
"value": "Is Software Testing really given its importance at the academic level?\nI believe there is a need in universities offering Software Engineering (and probably even Computer Science) to treat Software Testing as a separate course and topic in itself, rather than as part of a gener... |
I'm looking for techniques to generate 'neighbours' (people with similar taste) for users on a site I am working on; something similar to the way last.fm works.
Currently, I have a compatibilty function for users which could come into play. It ranks users on having 1) rated similar items 2) rated the item similarly. Th... | Creating a system to generate "neighbours" for users based on their preferences is a common problem in recommendation systems, often tackled with various algorithms and approaches. Here are several techniques you can consider to optimize the process of finding similar users while keeping efficiency in mind.
### 1. **U... | 27,842 | [
{
"from": "human",
"value": "I'm looking for techniques to generate 'neighbours' (people with similar taste) for users on a site I am working on; something similar to the way last.fm works.\nCurrently, I have a compatibilty function for users which could come into play. It ranks users on having 1) rated sim... |
I've been looking at Dojo, and it has some nice tricks, however its quite huge IMHO. Basically when viewing my test my slow machine (600mhz), just loading Dojo was kind of painful, and can imagine lots of mobile devices will also not be happy with it.
Is there a slim version or something like that available?
| Dojo Toolkit is indeed a powerful and feature-rich JavaScript framework, but its size can be a concern for performance, especially on slower machines or mobile devices. Fortunately, there are ways to optimize its use and make it lighter:
1. **Use Dojo's Build System**: Dojo comes with a build tool that allows you to c... | 36,909 | [
{
"from": "human",
"value": "I've been looking at Dojo, and it has some nice tricks, however its quite huge IMHO. Basically when viewing my test my slow machine (600mhz), just loading Dojo was kind of painful, and can imagine lots of mobile devices will also not be happy with it.\nIs there a slim version or... |
I would like to implement a telnet server in C. How would I proceed with this? Which RFCs should I look at? This is important to me, and I would appreciate any help.
| Implementing a Telnet server in C involves several steps, including setting up a TCP server, handling Telnet protocol specifics, and managing client connections. Here’s a structured approach to help you get started, along with the relevant RFCs.
### Step-by-Step Guide to Implement a Telnet Server in C
1. **Understand... | 30,833 | [
{
"from": "human",
"value": "I would like to implement a telnet server in C. How would I proceed with this? Which RFCs should I look at? This is important to me, and I would appreciate any help.\n"
},
{
"from": "gpt",
"value": "Implementing a Telnet server in C involves several steps, including ... |
Scott Gu just posted about a new set of charting controls being distributed by the .NET team. They look incredible: http://weblogs.asp.net/scottgu/archive/2008/11/24/new-asp-net-charting-control-lt-asp-chart-runat-quot-server-quot-gt.aspx
The million dollar question is ... will they work with MVC, and if so, when?
| The new ASP.NET Charting Controls that Scott Gu posted about were primarily designed for Web Forms, but many developers sought to use them in ASP.NET MVC applications as well. While the controls were not built specifically for MVC, you could still use them within MVC projects by rendering the charts in a way that integ... | 38,065 | [
{
"from": "human",
"value": "Scott Gu just posted about a new set of charting controls being distributed by the .NET team. They look incredible: http://weblogs.asp.net/scottgu/archive/2008/11/24/new-asp-net-charting-control-lt-asp-chart-runat-quot-server-quot-gt.aspx\nThe million dollar question is ... will... |
I have an Asp.Net 1.1 application that uses the following code to write out an image file to a pop up web page.
Response.ContentType="image/tiff" 'Only for Tif files
Dim objStream As Object
objStream = Server.CreateObject("ADODB.Stream")
objStream.open()
objStream.type = 1
objStream.loadfromfi... | The issue you're experiencing with displaying TIFF files in IE7 while they work in IE6 and Safari may be related to how the browser handles TIFF image types. While IE6 was more lenient, IE7 introduced stricter compliance with standards, which could affect how certain types of files are displayed.
Here are a few sugges... | 37,747 | [
{
"from": "human",
"value": "I have an Asp.Net 1.1 application that uses the following code to write out an image file to a pop up web page.\n Response.ContentType=\"image/tiff\" 'Only for Tif files\n Dim objStream As Object\n objStream = Server.CreateObject(\"ADODB.Stream\")\n objStream.open(... |
Here's what I'm trying to do, and failing...
I have a File model which has a generic-relation to other objects:
class File(models.Model):
content_type = models.ForeignKey(ContentType)
object_id = models.PositiveIntegerField()
content_object = generic.GenericForeignKey()
file = models.FileField(upload_to... | You've encountered a common issue when using Django's generic relations with multi-table inheritance. The root of the problem is that Django's generic inlines expect a one-to-one relationship with a single model, and when you inherit from a base model, the behavior changes.
Here's a couple of approaches to solve the i... | 37,791 | [
{
"from": "human",
"value": "Here's what I'm trying to do, and failing...\nI have a File model which has a generic-relation to other objects:\nclass File(models.Model):\n content_type = models.ForeignKey(ContentType)\n object_id = models.PositiveIntegerField()\n content_object = generic.GenericFore... |
Sometimes it's difficult to describe some of the things that "us programmers" may think are simple to non-programmers and management types.
So...
How would you describe the difference between Managed Code (or Java Byte Code) and Unmanaged/Native Code to a Non-Programmer?
| Explaining the difference between managed code and unmanaged/native code to a non-programmer can be challenging, but using simple analogies can help clarify the concepts. Here’s a way to break it down:
### Managed Code
**Analogy:** Think of managed code like a dinner prepared in a restaurant.
- **What Happens:** In... | 37,376 | [
{
"from": "human",
"value": "Sometimes it's difficult to describe some of the things that \"us programmers\" may think are simple to non-programmers and management types.\nSo...\nHow would you describe the difference between Managed Code (or Java Byte Code) and Unmanaged/Native Code to a Non-Programmer?\n"
... |
I am seeing a strange problem:
I have a linux machine, installed JDK1.6 on that machine, and some business went on, and some days later had to change the IP address of the machine. and now after some months... i am trying to get some spring application to work... and it seems the RMI Server is starting at my old ip add... | It looks like your Spring application is trying to connect to an RMI (Remote Method Invocation) service that is bound to an old IP address (192.168.13.55) that your machine no longer uses after the change in IP address.
Here’s a brief overview of what might be going on:
1. **RMI Registry Binding**: When a Java RMI se... | 36,106 | [
{
"from": "human",
"value": "I am seeing a strange problem:\nI have a linux machine, installed JDK1.6 on that machine, and some business went on, and some days later had to change the IP address of the machine. and now after some months... i am trying to get some spring application to work... and it seems t... |
To add a svg graphics in html page, it is common to use object tag to wrap it like this:
<object id="svgid" data="mysvg.svg" type="image/svg+xml"
wmode="transparent" width="100" height="100">
this browser is not able to show SVG: <a linkindex="3"
href="http://getfirefox.com">http://getfirefox.com</a>
is free and d... | You can indeed retrieve the size of an SVG file using JavaScript, but there are a couple of approaches you can consider.
### Approach 1: Inspect the SVG file directly
You can load the SVG file and inspect the dimensions set in the `<svg>` tag. The dimensions are usually specified with `width` and `height` attributes ... | 38,102 | [
{
"from": "human",
"value": "To add a svg graphics in html page, it is common to use object tag to wrap it like this:\n<object id=\"svgid\" data=\"mysvg.svg\" type=\"image/svg+xml\" \n wmode=\"transparent\" width=\"100\" height=\"100\">\n\nthis browser is not able to show SVG: <a linkindex=\"3\"\nhref=\"ht... |
I tend to do a lot of projects on short deadlines and with lots of code that will never be used again, so there's always pressure/temptation to cut corners. One rule I always stick to is encapsulation/loose coupling, so I have lots of small classes rather than one giant God class. But what else should I never compromis... | When working on short-deadline projects where the code may not be reused, it's easy to slip into the habit of cutting corners. However, maintaining a few key coding standards can help ensure that your projects remain manageable, understandable, and functional, even if they are short-lived. Here are some essential pract... | 36,766 | [
{
"from": "human",
"value": "I tend to do a lot of projects on short deadlines and with lots of code that will never be used again, so there's always pressure/temptation to cut corners. One rule I always stick to is encapsulation/loose coupling, so I have lots of small classes rather than one giant God clas... |
What's wrong with the following snippet ?
#include <tr1/functional>
#include <functional>
#include <iostream>
using namespace std::tr1::placeholders;
struct abc
{
typedef void result_type;
void hello(int)
{ std::cout << __PRETTY_FUNCTION__ << std::endl; }
void hello(int) const
{ std::cout << __P... | The issue you're facing stems from how overloaded functions and `std::tr1::bind` interact in C++. When you have overloaded member functions (like your two `hello` functions in the `abc` struct), the compiler cannot automatically resolve which version of the function you are trying to bind. This ambiguity leads to the e... | 36,730 | [
{
"from": "human",
"value": "What's wrong with the following snippet ?\n#include <tr1/functional>\n#include <functional>\n#include <iostream>\n\nusing namespace std::tr1::placeholders;\n\nstruct abc\n{\n typedef void result_type;\n\n void hello(int)\n { std::cout << __PRETTY_FUNCTION__ << std::endl... |
I've got the bare minimum to handle the Linux/MySQL parts of the stack, but I want to have a basic grasp of PHP before I dive in. I'll be working on WordPress plugins, in case there's anything specifically interesting for that.
PS - any recommendations regarding recommended source control/IDEs would also be great, but... | It’s great that you’re diving into PHP, especially for WordPress plugin development! Here’s a breakdown of what you should focus on to gain a basic grasp of PHP and some recommendations regarding source control and IDEs.
### Learning PHP Basics
1. **Syntax and Basics**:
- Understand PHP syntax (variables, data ty... | 35,090 | [
{
"from": "human",
"value": "I've got the bare minimum to handle the Linux/MySQL parts of the stack, but I want to have a basic grasp of PHP before I dive in. I'll be working on WordPress plugins, in case there's anything specifically interesting for that.\nPS - any recommendations regarding recommended so... |
When you are monitoring the TFS build from Visual Studio (2008 or 2005), you can see where it is up to.
The issue is that I have some Post-Build custom steps I would like the developer to be able to see directly throught the UI. Those steps take some times and we can also get a "timing" of the build step.
Any idea how ... | To display post-build custom steps in the TFS (Team Foundation Server) build process, especially in older versions like Visual Studio 2005 and 2008, you have a few options. Here's a general approach that might help you achieve your goal of providing visibility into the timing and status of these custom post-build steps... | 37,854 | [
{
"from": "human",
"value": "When you are monitoring the TFS build from Visual Studio (2008 or 2005), you can see where it is up to.\nThe issue is that I have some Post-Build custom steps I would like the developer to be able to see directly throught the UI. Those steps take some times and we can also get a... |
I would like to get the path to the execution directory of a Windows Forms application. (That is, the directory in which the executable is located.)
Does anyone know of a built-in method in .NET to do this?
| Yes, you can easily obtain the path to the execution directory of a Windows Forms application using the `AppDomain.CurrentDomain.BaseDirectory` property in .NET. This property gives you the base directory that the application is running in, which is typically the same directory where the executable is located.
Here is... | 39,481 | [
{
"from": "human",
"value": "I would like to get the path to the execution directory of a Windows Forms application. (That is, the directory in which the executable is located.)\nDoes anyone know of a built-in method in .NET to do this?\n"
},
{
"from": "gpt",
"value": "Yes, you can easily obtain... |
this c# code is probably not the most efficient but gets what I want done.
How do I accomplish the same thing in F# code?
string xml = " <EmailList> " +
" <Email>test@email.com</Email> " +
" <Email>test2@email.com</Email> " +
" </EmailList> ";
XmlDocumen... | You can accomplish the same task in F# using the `System.Xml` namespace for XML manipulation. Below is an equivalent F# code snippet that processes the XML string and extracts the email addresses in a similar manner to your C# code:
```fsharp
open System
open System.Xml
let xml =
"<EmailList> " +
" <Ema... | 39,952 | [
{
"from": "human",
"value": "this c# code is probably not the most efficient but gets what I want done. \nHow do I accomplish the same thing in F# code?\n string xml = \" <EmailList> \" +\n \" <Email>test@email.com</Email> \" +\n \" <Email>test2@email.com</Email> \"... |
I have a table with some duplicate rows. I want to modify only the duplicate rows as follows.
Before:
id col1
------------
1 vvvv
2 vvvv
3 vvvv
After:
id col1
------------
1 vvvv
2 vvvv-2
3 vvvv-3
Col1 is appended with a hyphen and the value of id column.
| To modify the duplicate rows in your table as you described, you can use an SQL query that identifies duplicates and then updates them accordingly. Here's a step-by-step approach to achieve this using SQL.
Assuming your table is named `your_table`, you can use a common table expression (CTE) along with a row number fu... | 38,080 | [
{
"from": "human",
"value": "I have a table with some duplicate rows. I want to modify only the duplicate rows as follows.\nBefore:\nid col1\n------------\n1 vvvv\n2 vvvv\n3 vvvv\n\nAfter:\nid col1\n------------\n1 vvvv\n2 vvvv-2\n3 vvvv-3\n\nCol1 is appended with a hyp... |
Can WebPartManager be used with web parts constructed from mobile web controls? If possible, should it be done?
| The `WebPartManager` is primarily designed to manage web parts within ASP.NET Web Forms applications and is part of the ASP.NET Web Parts infrastructure. Web parts are typically used with standard ASP.NET server controls, including but not limited to controls that are part of the ASP.NET Web Forms framework.
### Using... | 39,438 | [
{
"from": "human",
"value": "Can WebPartManager be used with web parts constructed from mobile web controls? If possible, should it be done?\n"
},
{
"from": "gpt",
"value": "The `WebPartManager` is primarily designed to manage web parts within ASP.NET Web Forms applications and is part of the A... |
I'm new to .NET and I would like to participate with .NET community to grow my skills (selfish, I know), contribute something (not so selfish) and I thought its just nice to be part of a community.
I can start a blog but considering I'm a beginner I can't possibly post anything worthwhile. How about opensource projects... | Welcome to the .NET community! It's great that you're eager to participate and grow your skills. There are plenty of ways to get involved, especially in open source projects. Here are some suggestions to help you get started:
### 1. **Find Open Source Projects**
There are many repositories for .NET projects that welco... | 37,883 | [
{
"from": "human",
"value": "I'm new to .NET and I would like to participate with .NET community to grow my skills (selfish, I know), contribute something (not so selfish) and I thought its just nice to be part of a community.\nI can start a blog but considering I'm a beginner I can't possibly post anything... |
I am using struts to build an image uploading module.
However, I am encountering the problem of user not able to see the file they upload until I manually refresh the package explorer on eclipse.
Any one know how to solve this?
Thanks!
| It seems like you're facing an issue with the Eclipse IDE where changes made in the file system (like uploading an image) are not immediately reflected in the Package Explorer. This can often happen due to Eclipse not automatically refreshing its workspace when external changes occur. Here are a few methods you can try... | 38,229 | [
{
"from": "human",
"value": "I am using struts to build an image uploading module.\nHowever, I am encountering the problem of user not able to see the file they upload until I manually refresh the package explorer on eclipse.\nAny one know how to solve this?\nThanks!\n"
},
{
"from": "gpt",
"valu... |
My application is pretty simple: it starts up with a view controller that holds a table view (in grouped view layout) with a few options. When the user taps on one of the options, I push another view controller onto my navigation controller.
This second view controller simply displays a UIImageView, and the user can ch... | It sounds like you're encountering an issue with the layout of your first view controller after returning from the second view controller when it was in landscape orientation. This is a common issue when transitioning between different orientations in a UINavigationController. Here are a few steps you can take to help ... | 36,922 | [
{
"from": "human",
"value": "My application is pretty simple: it starts up with a view controller that holds a table view (in grouped view layout) with a few options. When the user taps on one of the options, I push another view controller onto my navigation controller.\nThis second view controller simply d... |
I have two SQL scripts which get called within a loop that accept a number parameter. Here is what I'm currently using:
for /l %%i in (1, 1, 51) do (
sqlplus u/p@name @script.sql a%%i.html %%i
sqlplus u/p@name @script.sql b%%i.html %%i
)
Everything works fine, but it seems like a waste of time and resources to... | You can certainly optimize your SQL*Plus calls by logging in only once and executing your scripts in a loop. To do this, you can create a SQL script that contains your loop logic and the `@script.sql` calls, and then execute that script from a single `sqlplus` session. Here's how you can do it:
1. Create a new SQL scr... | 37,346 | [
{
"from": "human",
"value": "I have two SQL scripts which get called within a loop that accept a number parameter. Here is what I'm currently using:\nfor /l %%i in (1, 1, 51) do (\n sqlplus u/p@name @script.sql a%%i.html %%i\n sqlplus u/p@name @script.sql b%%i.html %%i\n)\n\nEverything works fine, but... |
What are some ways that I can query the local machine's specifications (a range of things from CPU specs, OS version, graphics card specs and drivers, etc.) through a programmatic interface? We're writing a simple app in C# to test compatibility of our main app and want to have it dump out some system metrics, but I c... | You're on the right track with Windows Management Instrumentation (WMI). It's a powerful way to query various system metrics programmatically in C#. WMI allows you to access a wide range of system information, including CPU specs, OS version, graphics card specs, drivers, and more.
Here are some specific ways you can ... | 31,853 | [
{
"from": "human",
"value": "What are some ways that I can query the local machine's specifications (a range of things from CPU specs, OS version, graphics card specs and drivers, etc.) through a programmatic interface? We're writing a simple app in C# to test compatibility of our main app and want to have... |
Is there a way to get a list ordered by two fields, say last and first names?
I know .listOrderByLastAndFirst and .list(sort:'last, first') won't work.
| In many programming contexts, especially when dealing with databases or collections, sorting by multiple fields can usually be achieved through a specific method or function.
If you're dealing with a database, the SQL syntax for ordering by two fields would look something like this:
```sql
SELECT * FROM your_table
OR... | 39,115 | [
{
"from": "human",
"value": "Is there a way to get a list ordered by two fields, say last and first names?\nI know .listOrderByLastAndFirst and .list(sort:'last, first') won't work.\n"
},
{
"from": "gpt",
"value": "In many programming contexts, especially when dealing with databases or collectio... |
I am using Crystal Reports 10. In the report I have two prompts.
How can I give this report to users such that they can enter the parameters on the web?
Thx in advance,
S.Gyazuddin
| To allow users to enter parameters for a Crystal Report 10 over the web, you'll need to implement a web interface that interacts with Crystal Reports. Here are the general steps to achieve this:
### 1. **Use Crystal Reports in a Web Application:**
You'll need a web application where users can access the report. Com... | 37,934 | [
{
"from": "human",
"value": "I am using Crystal Reports 10. In the report I have two prompts.\nHow can I give this report to users such that they can enter the parameters on the web?\nThx in advance,\nS.Gyazuddin\n"
},
{
"from": "gpt",
"value": "To allow users to enter parameters for a Crystal ... |
When programming a large transaction (lots of inserts, deletes, updates) and thereby violating a constraint in Informix (v10, but should apply to other versions too) I get a not very helpful message saying, for example, I violated constraint r190_710. How can I find out which table(s) and key(s) are covered by a certai... | In Informix, when you encounter a constraint violation message that only provides the constraint name (e.g., `r190_710`), you can find out more information about the constraint, including the tables and keys associated with it, by querying the system catalog tables.
You can use the following SQL queries to gather inf... | 38,160 | [
{
"from": "human",
"value": "When programming a large transaction (lots of inserts, deletes, updates) and thereby violating a constraint in Informix (v10, but should apply to other versions too) I get a not very helpful message saying, for example, I violated constraint r190_710. How can I find out which ta... |
How do I discover classes at runtime in the classpath which implements a defined interface?
ServiceLoader suits well (I think, I haven't used it), but I need do it in Java 1.5.
| In Java 1.5, you don’t have the luxury of using the `ServiceLoader` mechanism, which was introduced in Java 6. However, you can achieve a similar effect by leveraging classpath scanning libraries or creating your own classpath scanning logic. Here’s a general approach to discovering classes that implement a specified i... | 32,068 | [
{
"from": "human",
"value": "How do I discover classes at runtime in the classpath which implements a defined interface?\nServiceLoader suits well (I think, I haven't used it), but I need do it in Java 1.5.\n"
},
{
"from": "gpt",
"value": "In Java 1.5, you don’t have the luxury of using the `Ser... |
When using the pImpl idiom is it preferable to use a boost:shared_ptr instead of a std::auto_ptr? I'm sure I once read that the boost version is more exception friendly?
class Foo
{
public:
Foo();
private:
struct impl;
std::auto_ptr<impl> impl_;
};
class Foo
{
public:
Foo();
private:
struct impl;
... | Yes, it is generally preferable to use `boost::shared_ptr` (or `std::shared_ptr` in modern C++) instead of `std::auto_ptr`. Here are some reasons why:
1. **Ownership Semantics**:
- `std::auto_ptr` has non-standard ownership semantics that can lead to unexpected behavior. When `std::auto_ptr` is copied, it transfers... | 37,658 | [
{
"from": "human",
"value": "When using the pImpl idiom is it preferable to use a boost:shared_ptr instead of a std::auto_ptr? I'm sure I once read that the boost version is more exception friendly?\nclass Foo\n{\npublic:\n Foo();\nprivate:\n struct impl;\n std::auto_ptr<impl> impl_;\n};\n\nclass ... |
How can we handel key pressed event in asp.net
| Handling key press events in an ASP.NET application can be approached in several ways, depending on whether you are working with a Web Forms application or an ASP.NET MVC application, and whether you want to handle the event on the client-side (using JavaScript) or on the server-side.
Here’s a summary of how you can h... | 28,155 | [
{
"from": "human",
"value": "How can we handel key pressed event in asp.net\n"
},
{
"from": "gpt",
"value": "Handling key press events in an ASP.NET application can be approached in several ways, depending on whether you are working with a Web Forms application or an ASP.NET MVC application, and... |
The ASP.NET calendar always displays 6 weeks of dates in a 7x6 grid. My problem is that the first day of the target month does not necessarily appear in the first row... in some cases, the entire first row displays dates from the previous month. In other cases, the entire last row displays dates from the next row.
Is ... | To determine the range of dates that will be displayed by an ASP.NET Calendar control for a specific month and year, you can follow these steps:
1. **Identify the first day of the month**: Create a `DateTime` object for the first day of the target month and year.
2. **Determine the day of the week**: Use the `DayOfWe... | 34,990 | [
{
"from": "human",
"value": "The ASP.NET calendar always displays 6 weeks of dates in a 7x6 grid. My problem is that the first day of the target month does not necessarily appear in the first row... in some cases, the entire first row displays dates from the previous month. In other cases, the entire last r... |
I know we are really behind the times here, but we are just about to upgrade from .NET 1.1 to .NET 2.0.
Thank you for your sympathy.
Anyhow, are there any gotchas we should look out for?
Do you have any general advice before we jump in?
Please do not post telling me to go straight to 3.5: 2.0 is all we're allow... | Upgrading from .NET 1.1 to .NET 2.0 can bring significant improvements and features, but there are also some important considerations and potential gotchas to keep in mind. Here are some key points and advice to help you with the transition:
### Key Changes and Features in .NET 2.0
1. **Generics**: .NET 2.0 introduce... | 33,278 | [
{
"from": "human",
"value": "I know we are really behind the times here, but we are just about to upgrade from .NET 1.1 to .NET 2.0. \nThank you for your sympathy. \nAnyhow, are there any gotchas we should look out for?\nDo you have any general advice before we jump in? \nPlease do not post telling me t... |
I need to know how to add a custom, dynamic Autotext entry for Microsoft Word. I want to be able to Insert>Autotext>Header/Footer>"Last Friday" and have last Friday's date show up in the spot and keep it updated like inserting the Date Autotext updates each time the document is opened.
I have the VB code necessary to ... | To create a custom, dynamic AutoText entry in Microsoft Word that will display "Last Friday's" date and update whenever the document is opened, you can use VBA to create a field that calculates this date.
Here's how to achieve that:
### Step 1: Create a VBA Function to Calculate Last Friday's Date
1. Press `ALT + F1... | 37,010 | [
{
"from": "human",
"value": "I need to know how to add a custom, dynamic Autotext entry for Microsoft Word. I want to be able to Insert>Autotext>Header/Footer>\"Last Friday\" and have last Friday's date show up in the spot and keep it updated like inserting the Date Autotext updates each time the document ... |
I've been a Delphi (D7) developer for many sometime already, I've always been wondering about the .NET + C# stuffs. What I mean are about not the "Delphi for .NET" or "Oxygene" tech/plugin, but clean .NET/C#.
How much different is it from Delphi? And some other questions...
Is Mono/SharpDevelop (any others that I shou... | It's great to hear that you're interested in expanding your knowledge beyond Delphi into .NET and C#. Let's dive into your questions:
### Differences Between Delphi and C#
1. **Language Syntax and Structure**:
- C# is a C-style language, while Delphi uses Object Pascal. If you're familiar with languages like C, Ja... | 36,446 | [
{
"from": "human",
"value": "I've been a Delphi (D7) developer for many sometime already, I've always been wondering about the .NET + C# stuffs. What I mean are about not the \"Delphi for .NET\" or \"Oxygene\" tech/plugin, but clean .NET/C#.\nHow much different is it from Delphi? And some other questions...... |
I'm working on deploying a small community site. User registration requires nothing more than a username, email address, and password. I'm not even asking for a name, and certainly not storing any sensitive data.
Should I still invest in an SSL certificate? Would it be considered terrible practice to transmit a user's ... | Yes, you should definitely invest in an SSL certificate for your community site, even if it's a personal project and you're not handling sensitive data. Here are several reasons why using SSL is important:
1. **Security**: SSL encrypts the data transmitted between your users and your server. This means that if someone... | 39,024 | [
{
"from": "human",
"value": "I'm working on deploying a small community site. User registration requires nothing more than a username, email address, and password. I'm not even asking for a name, and certainly not storing any sensitive data.\nShould I still invest in an SSL certificate? Would it be consider... |
I have a RVDS project for a certain video decoder (its all C code),
created for ARM926EJ-S target, executed using the RVDS 2.2 simulator.
I am not using any scatterload / <configuration file> / <map file> to
mention the various memory segments in the code like Stack segment,
Heap, Data segment, Code Segment for RVDS Si... | The behavior you're observing could indeed be related to stack corruption, memory segment overflow, or issues related to undefined behavior in your C code. Here are some potential causes and ways to investigate the issue further:
### Potential Causes:
1. **Stack Corruption**: If you have local variables that are too ... | 36,954 | [
{
"from": "human",
"value": "I have a RVDS project for a certain video decoder (its all C code),\ncreated for ARM926EJ-S target, executed using the RVDS 2.2 simulator.\nI am not using any scatterload / <configuration file> / <map file> to\nmention the various memory segments in the code like Stack segment,\... |
currently i am forcing my WPF app to use the luna theme no matter what, with this XAML code
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Styles.xaml" />
<ResourceDictionary Source="NavigationCommands.xaml" />
... | Yes, you can extend the styles of controls in WPF while still using a specific theme, like the Luna theme, by using the `BasedOn` property to inherit from the original styles. In your case, you want to create a custom `Style` for the `TextBox` that uses the Luna theme as its base.
To do this, you can create a new `Sty... | 37,924 | [
{
"from": "human",
"value": "currently i am forcing my WPF app to use the luna theme no matter what, with this XAML code\n<Application.Resources>\n <ResourceDictionary>\n <ResourceDictionary.MergedDictionaries>\n <ResourceDictionary Source=\"Styles.xaml\" />\n <ResourceDictio... |
I want to display the "infinity" symbol using
CGContextSelectFont(context, "HelveticaNeue", textSize, kCGEncodingMacRoman);
CGContextShowTextAtPoint(context, myCenter.x, myCenter.y + textHeight, [sName cStringUsingEncoding:NSMacOSRomanStringEncoding], [sName length]);
It is displayed as a square box, or a ci... | The issue you're encountering with displaying the "infinity" symbol (∞) using `CGContextShowTextAtPoint` is likely related to both the font you are using and the text encoding. The `CGContextShowTextAtPoint` function works with simple font rendering and may not support certain special characters directly, especially if... | 37,566 | [
{
"from": "human",
"value": "I want to display the \"infinity\" symbol using \nCGContextSelectFont(context, \"HelveticaNeue\", textSize, kCGEncodingMacRoman); \nCGContextShowTextAtPoint(context, myCenter.x, myCenter.y + textHeight, [sName cStringUsingEncoding:NSMacOSRomanStringEncoding], [sName lengt... |
What are some tiny open source operating systems? I'm looking for something several orders of magnitude smaller than Puppy Linux, Feather Linux, DSL, etc. I want to run a command-line text editor and compiler; anything else is extraneous. I'm looking for a system I can take apart and acquire a fairly good understanding... | If you're looking for extremely lightweight open-source operating systems that are significantly smaller than Puppy Linux, Feather Linux, or Damn Small Linux (DSL), here are some options that might fit your criteria:
1. **Tiny Core Linux**:
- **Size**: About 11 MB for the base system.
- **Description**: Tiny Cor... | 35,800 | [
{
"from": "human",
"value": "What are some tiny open source operating systems? I'm looking for something several orders of magnitude smaller than Puppy Linux, Feather Linux, DSL, etc. I want to run a command-line text editor and compiler; anything else is extraneous. I'm looking for a system I can take apar... |
We have an internal application that is using a service account and fine-grained table and field control is controlled by permissions tables in the application.
If we wanted to use pass-through security with Active Directory, we have a problem in that a user with odbc access could modify tables outside of business rul... | When using pass-through security with Active Directory, managing access to your application while preventing direct database access via ODBC can be challenging. Here are some strategies to consider:
1. **Restrict ODBC Access on the Database Level**:
- You can prevent users from accessing the database directly via O... | 38,867 | [
{
"from": "human",
"value": "We have an internal application that is using a service account and fine-grained table and field control is controlled by permissions tables in the application.\nIf we wanted to use pass-through security with Active Directory, we have a problem in that a user with odbc access c... |
In the past, when I've worked on long-running C++ daemons I've had to deal with heap fragmentation issues. Tricks like keeping a pool of my large allocations were necessary to keep from running out of contiguous heap space.
Is this still an issue with a 64 bit address space? Perf is not a concern for me, so I would... | Heap fragmentation can still be a concern, even in a 64-bit address space, though the severity and implications can vary based on a number of factors, such as the allocation patterns of your application and the memory management implementation of the underlying platform. Here’s a breakdown of the issue and consideratio... | 37,483 | [
{
"from": "human",
"value": "In the past, when I've worked on long-running C++ daemons I've had to deal with heap fragmentation issues. Tricks like keeping a pool of my large allocations were necessary to keep from running out of contiguous heap space. \nIs this still an issue with a 64 bit address space?... |
I'm uploading files to my public/files folder of a Rails application on a constant basis through a web interface.
I don't want to keep these in source control since they go for almost 2 GBs, so every time I do a cap deploy it will save those files away in releases/ and replace the directory with the pristine copy store... | When dealing with large files that you don't want to include in version control or affect your deployment process in a Rails application, it's important to have a strategy that keeps these files intact while also allowing your deployment process to work smoothly.
Here are a couple of common approaches you can consider... | 36,650 | [
{
"from": "human",
"value": "I'm uploading files to my public/files folder of a Rails application on a constant basis through a web interface.\nI don't want to keep these in source control since they go for almost 2 GBs, so every time I do a cap deploy it will save those files away in releases/ and replace ... |
I'm using ASP.NET Preview 5 (will upgrade soon to Beta) with LINQ2SQL on my recently launched tiny webapp.
I was so proud of my work until Silverlight.net featured it on the first page and it started receiving a more than humble number of visitors.
For some reason, users are sometimes getting "Specified cast invalid" t... | In ASP.NET MVC, the `[OutputCache]` attribute does not provide a built-in option to vary caching by user authentication status directly. However, there are several approaches you can take to achieve similar functionality for your scenario.
### Option 1: Custom Caching Logic
You can implement custom caching logic with... | 34,382 | [
{
"from": "human",
"value": "I'm using ASP.NET Preview 5 (will upgrade soon to Beta) with LINQ2SQL on my recently launched tiny webapp.\nI was so proud of my work until Silverlight.net featured it on the first page and it started receiving a more than humble number of visitors.\nFor some reason, users are s... |
Is it possible to change a sql server instance name? Or is it something that can only be set during installation?
| Yes, it is possible to change the name of a SQL Server instance, but it is not a straightforward process and requires several steps. Here’s a general outline of how you can rename a SQL Server instance:
### Method to Rename a SQL Server Instance:
1. **Backup**: Always start with a complete backup of your databases an... | 39,289 | [
{
"from": "human",
"value": "Is it possible to change a sql server instance name? Or is it something that can only be set during installation?\n"
},
{
"from": "gpt",
"value": "Yes, it is possible to change the name of a SQL Server instance, but it is not a straightforward process and requires s... |
I've got a Windows Forms application with two ListBox controls on the same form.
They both have their SelectionMode set to 'MultiExtended'.
When I change the selection of one the selection of the other changes.
Now I thought I'd done something stupid with my SelectedIndexChanged handlers so I removed them and re-wrote... | It sounds like you're experiencing an unexpected interaction between the two `ListBox` controls in your Windows Forms application. However, based on the standard behavior of `ListBox` controls, they should operate independently of one another. The fact that selecting items in one list affects the selection in the other... | 36,468 | [
{
"from": "human",
"value": "I've got a Windows Forms application with two ListBox controls on the same form.\nThey both have their SelectionMode set to 'MultiExtended'. \nWhen I change the selection of one the selection of the other changes.\nNow I thought I'd done something stupid with my SelectedIndexCha... |
I am trying to get a simple demo started with ActiveMQ that will demonstrate a TCP to TCP route. I am coding the endpoints and routes in a camel context in my activemq.xml configuration file.
<camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
<package>org.myorg.codec</package>
<e... | Your current configuration has some issues that prevent it from working as intended. Let's clarify how to set up a basic TCP to TCP routing using Apache ActiveMQ with Apache Camel.
### Key Issues
1. **Endpoints Definition**: The endpoints you defined are using the `mina` component (which is correct for TCP communicati... | 37,729 | [
{
"from": "human",
"value": "I am trying to get a simple demo started with ActiveMQ that will demonstrate a TCP to TCP route. I am coding the endpoints and routes in a camel context in my activemq.xml configuration file.\n<camelContext id=\"camel\" xmlns=\"http://activemq.apache.org/camel/schema/spring\">\n... |
I need help with a constraint:
Constraints = new RouteValueDictionary(new { filename = @"" })
It has to be only numeric (no letters, slashes etc).
| To create a constraint for a route parameter that only accepts numeric values, you can define a custom route constraint. Here's how you can implement it in ASP.NET MVC or ASP.NET Core.
### Step 1: Create a Numeric Route Constraint
You need to create a custom route constraint that checks if a parameter is numeric.
``... | 36,061 | [
{
"from": "human",
"value": "I need help with a constraint:\nConstraints = new RouteValueDictionary(new { filename = @\"\" })\n\nIt has to be only numeric (no letters, slashes etc).\n"
},
{
"from": "gpt",
"value": "To create a constraint for a route parameter that only accepts numeric values, yo... |
I am thinking it is a best practice to declare them as static, as it makes them invisible outside of the module.
What are your thoughts on this?
| Declaring variables or functions as `static` in a module (or file) can indeed be a best practice in certain contexts, particularly in languages like C, C++, or even when dealing with modules in languages like JavaScript. Here are some points to consider regarding the use of `static`:
### Advantages of Using `static`:
... | 37,075 | [
{
"from": "human",
"value": "I am thinking it is a best practice to declare them as static, as it makes them invisible outside of the module.\nWhat are your thoughts on this?\n"
},
{
"from": "gpt",
"value": "Declaring variables or functions as `static` in a module (or file) can indeed be a best ... |
I want to send an email from my iPhone application. I have heard that the iOS SDK doesn't have an email API. I don't want to use the following code because it will exit my application:
NSString *url = [NSString stringWithString: @"mailto:foo@example.com?cc=bar@example.com&subject=Greetings%20from%20Cupertino!&body=Wish... | You're correct that iOS does not provide a direct email sending API that allows you to send emails programmatically without user interaction. However, you can present the user with a pre-composed email using the `MFMailComposeViewController` class from the MessageUI framework. This allows you to compose and send an ema... | 37,475 | [
{
"from": "human",
"value": "I want to send an email from my iPhone application. I have heard that the iOS SDK doesn't have an email API. I don't want to use the following code because it will exit my application:\nNSString *url = [NSString stringWithString: @\"mailto:foo@example.com?cc=bar@example.com&subj... |
Does someone have a link where I can read on how to access my remote server's sql server '08 installation?
update
I want to access sql server 2008 from management studio on a remote server.
Remote access is disabled by default!
| To access a SQL Server 2008 installation on a remote server using SQL Server Management Studio (SSMS), you'll need to ensure that several configurations are properly set up, since remote access is disabled by default. Here are the steps you can follow to enable remote access and connect to your SQL Server instance:
##... | 37,204 | [
{
"from": "human",
"value": "Does someone have a link where I can read on how to access my remote server's sql server '08 installation?\nupdate\nI want to access sql server 2008 from management studio on a remote server.\nRemote access is disabled by default!\n"
},
{
"from": "gpt",
"value": "To ... |
I'm trying to make an SVN post-commit script that makes backups to a Gmail drive. Blat doesn't seem to support TLS. Are there any good scripting programs on windows that can send an email via TLS?
| If you're looking for a way to send emails via TLS from a post-commit script on Windows, there are several options you can consider. Here are a few tools and libraries you can use:
### 1. **PowerShell**
PowerShell can be used to send emails using SMTP with TLS. Here's an example script that demonstrates how to send an... | 35,396 | [
{
"from": "human",
"value": "I'm trying to make an SVN post-commit script that makes backups to a Gmail drive. Blat doesn't seem to support TLS. Are there any good scripting programs on windows that can send an email via TLS?\n"
},
{
"from": "gpt",
"value": "If you're looking for a way to send... |
Am I doing something wrong or is it not possible to specify a generic class as a constraint to a generic method?
I have been playing around with generics and db4o (open source object database) and am writing a test program (see code below) to store and retrieve some user defined generic collections.
I am attempting to ... | The issue you are encountering stems from the constraint you've placed on the generic method `GetCollectionFromDb<T>`. The constraint `where T : MyCollectionBase<T>` implies that the type parameter `T` must be a subclass of `MyCollectionBase<T>`, which is not the case for your `MyCollection1` and `MyCollection2` classe... | 35,880 | [
{
"from": "human",
"value": "Am I doing something wrong or is it not possible to specify a generic class as a constraint to a generic method?\nI have been playing around with generics and db4o (open source object database) and am writing a test program (see code below) to store and retrieve some user define... |
I am a big time user of using double quotes in PHP so that I can interpolate variables rather than concatenating strings. As a result, when I am generating HTML I often use single quotes for setting tag fields. For example:
$html = "<input type='text' name='address' value='$address'>";
Now this is far more readable to... | In HTML, both single quotes (`'`) and double quotes (`"`) are valid for enclosing attribute values. According to the HTML specifications, using single quotes for attribute values is perfectly acceptable and supported by all modern web browsers. This means that browsers such as Chrome, Firefox, Safari, and Edge will cor... | 39,265 | [
{
"from": "human",
"value": "I am a big time user of using double quotes in PHP so that I can interpolate variables rather than concatenating strings. As a result, when I am generating HTML I often use single quotes for setting tag fields. For example:\n$html = \"<input type='text' name='address' value='$ad... |
Is it less efficient to use TEXT than varchar in an SQL database?
If so why?
If not why would you not just always use TEXT?
I'm not targetting a specific database here but oracle is probably the most relevant, although I'm testing on MySQL for the time being as part of a proof of concept.
| Using `TEXT` versus `VARCHAR` in SQL databases can have different performance and usability implications, and the choice between them often depends on the specific use case and the database system in question. Here’s a breakdown of the considerations related to efficiency, storage, and performance:
### Differences Bet... | 37,153 | [
{
"from": "human",
"value": "Is it less efficient to use TEXT than varchar in an SQL database?\nIf so why?\nIf not why would you not just always use TEXT?\nI'm not targetting a specific database here but oracle is probably the most relevant, although I'm testing on MySQL for the time being as part of a proo... |
How can i clean and modify data from a form in django. I would like to define it on a per field basis for each model, much like using ModelForms.
What I want to achieve is automatically remove leading and trailing spaces from defined fields, or turn a title (from one field) into a slug (which would be another field).
| In Django, you can clean and modify data at the field level by overriding the `clean()` method of a `ModelForm` or using the `pre_save` signal in a model’s `save` method. For the specific tasks you've mentioned (removing leading and trailing spaces and converting a title into a slug), you can accomplish this by customi... | 37,465 | [
{
"from": "human",
"value": "How can i clean and modify data from a form in django. I would like to define it on a per field basis for each model, much like using ModelForms.\nWhat I want to achieve is automatically remove leading and trailing spaces from defined fields, or turn a title (from one field) int... |
We have a web application, which involves a lot of documents. In a typical use case, a document will be generated from our web application. The user download the generated document to the local file system and modify it. After this work, the user upload the modified document back to the web application.
I need an easi... | To achieve a seamless document editing experience in your web application without relying on temporary local storage, you have several options. Here are some approaches that you might consider:
### 1. **WebDAV Integration**
WebDAV (Web Distributed Authoring and Versioning) allows users to collaboratively edit and mana... | 35,750 | [
{
"from": "human",
"value": "We have a web application, which involves a lot of documents. In a typical use case, a document will be generated from our web application. The user download the generated document to the local file system and modify it. After this work, the user upload the modified document bac... |
I know there is some similar issue.
But, still the question is not answered! I need to modify the connection string not add a new one.
| To modify an existing connection string, you generally need to identify where the connection string is stored in your application or configuration files, and then update it accordingly. The exact steps depend on the technology stack you're using. Here are some common scenarios:
### 1. **Web Applications (e.g., ASP.NET... | 36,637 | [
{
"from": "human",
"value": "I know there is some similar issue.\nBut, still the question is not answered! I need to modify the connection string not add a new one.\n"
},
{
"from": "gpt",
"value": "To modify an existing connection string, you generally need to identify where the connection strin... |
I have seen posts that show three ways to reset the DMV views:
Reset the SQL Service
Detatch the database
Close the database
All of these methods seem to require taking the system off-line for a few moments. Is there a way to reset the statistics on demand without interrupting use of the database? When we have odd ... | Yes, you can reset the SQL Server Dynamic Management Views (DMVs) that provide statistics without taking the entire database offline. However, it is important to note that DMVs are essentially read-only views that reflect the current state and performance of the SQL Server instance, and they are not designed to be rese... | 38,684 | [
{
"from": "human",
"value": "I have seen posts that show three ways to reset the DMV views:\n\nReset the SQL Service\nDetatch the database\nClose the database\n\nAll of these methods seem to require taking the system off-line for a few moments. Is there a way to reset the statistics on demand without inter... |
Seeking a method to:
Take whitespace separated tokens in a String; return a suggested Word
ie:
Google Search can take "fonetic wrd nterpreterr",
and atop of the result page it shows "Did you mean: phonetic word interpreter"
A solution in any of the C* languages or Java would be preferred.
Are there any existing Open ... | There are several approaches you can take to implement a functionality similar to the "Did you mean" feature you see in Google Search. Here’s a breakdown of possible solutions:
### 1. **Using Open Libraries:**
Several libraries can help with spelling correction and suggestions in Java or C#. Here are a few you can exp... | 27,053 | [
{
"from": "human",
"value": "Seeking a method to:\nTake whitespace separated tokens in a String; return a suggested Word\n\nie:\nGoogle Search can take \"fonetic wrd nterpreterr\",\nand atop of the result page it shows \"Did you mean: phonetic word interpreter\"\nA solution in any of the C* languages or Jav... |
In Java, is there a way to have a window that is "Always on top" regardless if the user switches focus to another application? I've searched the web, and all of the solutions lean to some sort of JNI interface with native bindings. Truly this can't be the only way to do it?.. or is it?
| In Java, the Swing library provides a way to create windows, but it does not directly support creating "Always on Top" windows that can maintain focus over other applications in the same way that some native platforms do. The Java `JFrame` class allows you to create a window that stays on top of other windows using the... | 37,770 | [
{
"from": "human",
"value": "In Java, is there a way to have a window that is \"Always on top\" regardless if the user switches focus to another application? I've searched the web, and all of the solutions lean to some sort of JNI interface with native bindings. Truly this can't be the only way to do it?.... |
I am using the Google AJAX API loader and want to get all the information in German so I am loading the maps API like this
google.load("maps", "2", {language : "de"});
I have tried deu, ger, de, de_DE and even en and ja_JPbut no success.
For those who don't understand my problem:
http://dl.getdropbox.com/u/5910/Jing/2... | It seems like you're trying to load the Google Maps API with the German language setting, but it's not displaying the map in German as expected. The Google Maps JavaScript API v2 you are using is quite outdated and has been deprecated. Google now recommends using the latest version of the Google Maps JavaScript API (v3... | 36,712 | [
{
"from": "human",
"value": "I am using the Google AJAX API loader and want to get all the information in German so I am loading the maps API like this\ngoogle.load(\"maps\", \"2\", {language : \"de\"});\n\nI have tried deu, ger, de, de_DE and even en and ja_JPbut no success.\nFor those who don't understand... |
I am trying to update an old JavaScript function used to detect support for AJAX (i.e. the XmlHttpRequest object). I've looked online (including SO) and found various solutions but I'm not sure which is the most efficient for simply detecting support.
The current function is:
function IsSyncAJAXSupported()
{
... | To check for support of `XMLHttpRequest` in modern browsers while maintaining compatibility with Internet Explorer (IE) 6 and above, you can streamline your function significantly. Here’s a simplified version that works across all specified browsers without relying on any legacy code.
```javascript
function isAJAXSupp... | 38,468 | [
{
"from": "human",
"value": "I am trying to update an old JavaScript function used to detect support for AJAX (i.e. the XmlHttpRequest object). I've looked online (including SO) and found various solutions but I'm not sure which is the most efficient for simply detecting support.\nThe current function is:\n... |
Background: we have an application that generates reports from HTML (that may or may not have inline scripting). The HTML source is normally stored as a blob in the database.
There is now the need to hard-code a particular report into the application (i.e. so that it is not database dependent). I first tried it the bru... | Using a string to store large HTML content in your application can be challenging, especially when dealing with inline scripting and maintaining readability. Here are a few approaches you might consider to achieve your goal more elegantly:
### 1. Use a Multi-line String Literal (if available)
If your programming langu... | 39,223 | [
{
"from": "human",
"value": "Background: we have an application that generates reports from HTML (that may or may not have inline scripting). The HTML source is normally stored as a blob in the database.\nThere is now the need to hard-code a particular report into the application (i.e. so that it is not dat... |
Visual Studio likes to be helpful when typing:
Event +=
by generating code like:
Event += new EventHandler(EventClassName_Event);
void EventClassName_Event(object sender, EventArgs e)
{
throw new System.NotImplementedException();
}
Ideally I would like to remove the explicit delegate and add an explicit private.... | In Visual Studio, the default event subscription syntax does indeed include creating a new instance of the event handler. Unfortunately, there isn't a built-in snippet to change this behavior, but you can achieve your desired syntax using the following methods:
### Manual Update
1. **Event Subscription**: When you are... | 39,269 | [
{
"from": "human",
"value": "Visual Studio likes to be helpful when typing:\nEvent +=\n\nby generating code like:\nEvent += new EventHandler(EventClassName_Event);\n\nvoid EventClassName_Event(object sender, EventArgs e)\n{\n throw new System.NotImplementedException();\n}\n\nIdeally I would like to remov... |
Any web service to get the monthly min/max temperatures for cities over a period of time?
| Yes, there are several web services and APIs that provide historical weather data, including monthly minimum and maximum temperatures for cities over a specified period. Here are a few popular options:
1. **OpenWeatherMap**:
- OpenWeatherMap offers a Historical Weather Data API that allows you to access historical ... | 38,209 | [
{
"from": "human",
"value": "Any web service to get the monthly min/max temperatures for cities over a period of time?\n"
},
{
"from": "gpt",
"value": "Yes, there are several web services and APIs that provide historical weather data, including monthly minimum and maximum temperatures for cities... |
I am forking a number of processes and I want to measure how long it takes to complete the whole task, that is when all processes forked are completed. Please advise how to make the parent process wait until all child processes are terminated? I want to make sure that I stop the timer at the right moment.
Here is as a ... | To ensure that your parent process waits for all child processes to finish before stopping the timer, you can use the `waitpid` function (or just `wait` for all child processes). You should call this after all the child processes have been forked. This way, the parent will wait for each of its children to exit before p... | 37,089 | [
{
"from": "human",
"value": "I am forking a number of processes and I want to measure how long it takes to complete the whole task, that is when all processes forked are completed. Please advise how to make the parent process wait until all child processes are terminated? I want to make sure that I stop the... |
Does anyone know what this means. Getting this in C# winforms applications:
Not a legal OleAut date
| The error message "Not a legal OleAut date" typically occurs in C# WinForms applications when you're working with date values that are expected to conform to the OLE Automation date format. OLE Automation dates are represented as double-precision floating-point numbers, where the integer part represents the number of d... | 37,186 | [
{
"from": "human",
"value": "Does anyone know what this means. Getting this in C# winforms applications:\n\nNot a legal OleAut date\n\n"
},
{
"from": "gpt",
"value": "The error message \"Not a legal OleAut date\" typically occurs in C# WinForms applications when you're working with date values t... |
I have a space delimited list of files names, where spaces in the file names are prefixed by '\'
e.g. "first\ file second\ file"
How can I get my regex to match each file name?
| To match file names in a space-delimited list where spaces in the file names are prefixed by a backslash (`\`), you can use a regex pattern that accounts for both the escaped spaces and regular spaces.
Here’s a suitable regex pattern to achieve this:
```regex
(?:[^\\ ]|\\.)+
```
### Explanation:
- `(?: ... )` is a ... | 36,523 | [
{
"from": "human",
"value": "I have a space delimited list of files names, where spaces in the file names are prefixed by '\\'\ne.g. \"first\\ file second\\ file\"\nHow can I get my regex to match each file name?\n"
},
{
"from": "gpt",
"value": "To match file names in a space-delimited list wher... |
I'm building a GUI class for C++ and dealing a lot with pointers. An example call:
mainGui.activeWindow->activeWidget->init();
My problem here is that I want to cast the activeWidget pointer to another type. activeWidget is of type GUI_BASE. Derived from BASE I have other classes, such as GUI_BUTTON and GUI_TEXTBOX... | Your issue seems to stem from operator precedence in C++. The cast is being applied only to `mainGui.activeWindow->activeWidget` and not the entire expression including the function call. To make sure the casting works as expected, you should group the cast and the method call correctly.
Here's how you can do it:
```... | 39,086 | [
{
"from": "human",
"value": "I'm building a GUI class for C++ and dealing a lot with pointers. An example call:\nmainGui.activeWindow->activeWidget->init();\n\nMy problem here is that I want to cast the activeWidget pointer to another type. activeWidget is of type GUI_BASE. Derived from BASE I have other... |
I've noticed, using visual studio 2003, that I can "comment out" my comments to make them no longer be comments. This one needs an example:
If I have:
/*
int commented_out = 0;
*/
I can comment out the /* and */ with // and code within the /* and */ is no longer "commented out" (the text changes to non-comment color a... | What you've observed in Visual Studio 2003 is indeed an interesting behavior, but it's not a standard feature of C++. Instead, it’s more of a quirk related to how some editors (including Visual Studio) handle comments.
In C++, comments can be created using two styles:
- Single-line comments, which start with `//`. Eve... | 36,872 | [
{
"from": "human",
"value": "I've noticed, using visual studio 2003, that I can \"comment out\" my comments to make them no longer be comments. This one needs an example:\nIf I have:\n/*\nint commented_out = 0;\n*/\n\nI can comment out the /* and */ with // and code within the /* and */ is no longer \"comme... |
I've worked on a number of CMS systems using the .NET platform (the CMS management system is in ASP.NET, and the site which renders the content is both ASP.NET and PHP).
I've traditionally stored the generated content in classes that serialize to XML, which is stored in MSSQL 2005/2008 in a varchar(max) field. This ha... | Your current approach of using XML serialized classes stored in a `varchar(max)` field in SQL Server has its merits, especially in terms of flexibility for different consumers and ease of binding to classes. However, there are several factors to consider when evaluating your strategy and potentially looking for alterna... | 36,007 | [
{
"from": "human",
"value": "I've worked on a number of CMS systems using the .NET platform (the CMS management system is in ASP.NET, and the site which renders the content is both ASP.NET and PHP).\nI've traditionally stored the generated content in classes that serialize to XML, which is stored in MSSQL 2... |
I'm under the impression that the Dot '.' (wild card) character is dangerous to use. Is my fear unfounded? Thanks
| Your concern about the use of the dot (`.`) character as a wildcard is not unfounded, but whether it is "dangerous" largely depends on the context in which you are using it.
### When the Dot is Considered Dangerous:
1. **File System Operations**: In file system operations, using a wildcard that includes the dot can l... | 35,862 | [
{
"from": "human",
"value": "I'm under the impression that the Dot '.' (wild card) character is dangerous to use. Is my fear unfounded? Thanks\n"
},
{
"from": "gpt",
"value": "Your concern about the use of the dot (`.`) character as a wildcard is not unfounded, but whether it is \"dangerous\" la... |
I've always preferred using XSD.exe/VS.Net to generate schema, generate classes off the schema, deserialize xml file into object tree to parse an XML file. [Well, most of my requirements thus far have made this a perfect choice].
I've a crib though: The class names generated by XSD.exe are weird - meaning XSD.exe stri... | You're right; XSD.exe generates class names by concatenating parent node names to maintain uniqueness, which can sometimes lead to less readable or unwieldy names. Unfortunately, XSD.exe itself does not provide a built-in mechanism for customizing the generated class names directly. However, there are a few approaches ... | 33,327 | [
{
"from": "human",
"value": "I've always preferred using XSD.exe/VS.Net to generate schema, generate classes off the schema, deserialize xml file into object tree to parse an XML file. [Well, most of my requirements thus far have made this a perfect choice].\nI've a crib though: The class names generated b... |
My understanding is that you have to write unit tests that isolate functionality. So given a repository class that has this method:
Entity GetById(Guid id)
and a fake implementation (using a Dictionary for storage), how would you write a test without first adding an entity? Is it ok to use a known set of guids for tes... | Welcome to the world of unit testing! You're correct that unit tests should isolate functionality and test a specific aspect of your code. Let's go through how you can test the `GetById(Guid id)` method of your repository class with a fake implementation using a `Dictionary<Guid, Entity>` for storage.
### Setting Up t... | 36,618 | [
{
"from": "human",
"value": "My understanding is that you have to write unit tests that isolate functionality. So given a repository class that has this method:\nEntity GetById(Guid id)\n\nand a fake implementation (using a Dictionary for storage), how would you write a test without first adding an entity? ... |
Some examples I found that apparently worked with older versions of mvc suggest that there was a length parameter of sorts:
<%=Html.TextBox("test", 50)%>
But that may have been mistakenly setting the value.
How do this work in the current release? Passing in the style doesn't appear to have any effect.
| In ASP.NET MVC, the `Html.TextBox` helper method does allow you to specify a value and some additional parameters such as HTML attributes. However, the syntax you provided (`<%= Html.TextBox("test", 50) %>`) might be confused with setting a default value rather than specifying the length of the input field.
If you wan... | 39,972 | [
{
"from": "human",
"value": "Some examples I found that apparently worked with older versions of mvc suggest that there was a length parameter of sorts:\n<%=Html.TextBox(\"test\", 50)%>\n\nBut that may have been mistakenly setting the value.\nHow do this work in the current release? Passing in the style doe... |
I am trying to setup a failover location for MOSS. The current farm is built on 32 bit Windows 2003. The servers ar the failover location are all 64 bit Windows 2008.
Is there any way to make these two environments talk and stay in sync? I have considered a "stretched" farm configuration, but that won't work unles the ... | Setting up a failover solution for your MOSS (Microsoft Office SharePoint Server) environment, especially when you're dealing with different operating system architectures (32-bit vs. 64-bit), can be challenging. Here are some considerations and approaches to address the situation:
### Challenges
1. **Compatibility**:... | 33,247 | [
{
"from": "human",
"value": "I am trying to setup a failover location for MOSS. The current farm is built on 32 bit Windows 2003. The servers ar the failover location are all 64 bit Windows 2008.\nIs there any way to make these two environments talk and stay in sync? I have considered a \"stretched\" farm c... |
I realize that far is compiler specific, but my expectation is that the placement of the far specifier should make sense to those who really understand pointers.
So, I have two applications that share the processor's entire memory space.
App A needs to call function foo that exists in app B.
I know the memory location ... | In the context of your application on the Freescale S12XEQ device, using the `__far` specifier is indeed crucial for ensuring the correct handling of far pointers, especially given the segmented/banked architecture of the device. Let’s break down your concerns one by one.
### 1. Placement of the `__far` Specifier
The... | 36,189 | [
{
"from": "human",
"value": "I realize that far is compiler specific, but my expectation is that the placement of the far specifier should make sense to those who really understand pointers.\nSo, I have two applications that share the processor's entire memory space.\nApp A needs to call function foo that e... |
I'm looking to find a way to access the .net query string contained in the standard ASP.NET request object inside a web service. In other words if I set a SOAP web service to this url:
http://localhost/service.asmx?id=2
Can I access the ID Get variable?
| Yes, you can access the query string parameters from the standard ASP.NET request object inside a SOAP web service (ASMX). In an ASMX web service, you can utilize the `HttpContext` to access the `Request` object, which contains the query string.
Here's how you can retrieve the `id` query parameter in your web service ... | 39,545 | [
{
"from": "human",
"value": "I'm looking to find a way to access the .net query string contained in the standard ASP.NET request object inside a web service. In other words if I set a SOAP web service to this url:\nhttp://localhost/service.asmx?id=2\nCan I access the ID Get variable?\n"
},
{
"from":... |
I have to do a college project using C++ that requires a GUI. I want to use Perl/Tk for the GUI, but I am not sure how to link the C++ to the Perl. The project requires being able to pass variables back and forth. Could anyone point me in the direction of some good tutorials/books for linking the two, or any ideas on h... | Linking C++ and Perl using Perl/Tk for the GUI is a great project idea! While there aren't many direct tutorials for integrating C++ with Perl/Tk, there are a few approaches you can consider that will allow you to pass data between the two languages.
### Approaches to Link C++ and Perl
1. **Using XS or SWIG**:
- *... | 32,245 | [
{
"from": "human",
"value": "I have to do a college project using C++ that requires a GUI. I want to use Perl/Tk for the GUI, but I am not sure how to link the C++ to the Perl. The project requires being able to pass variables back and forth. Could anyone point me in the direction of some good tutorials/boo... |
Do any one know why an application that always ran on Windows XP now suddenly crashes the msvcrt.dll?
There were only minor changes made to the threading classes, which was done under Vista in VC++ 6.
For all our libraries to work we are Dynamically linking to the MFC dlls.
A newer version of msvcrt does not solve the... | The issue you're encountering with an application that used to run on Windows XP but is now crashing related to `msvcrt.dll` (Microsoft Visual C++ Runtime Library) could be due to several factors. Here are some possibilities and troubleshooting steps you could consider:
1. **Compatibility Issues**: Windows XP and newe... | 38,087 | [
{
"from": "human",
"value": "Do any one know why an application that always ran on Windows XP now suddenly crashes the msvcrt.dll?\nThere were only minor changes made to the threading classes, which was done under Vista in VC++ 6.\nFor all our libraries to work we are Dynamically linking to the MFC dlls. \n... |
Question for anyone who's used Mechanical Turk: Is it possible to take an HTML template created on Mechanical Turk's website, and then create more HITs based on that template from the command line tools or API?
According to the API docs, it's not possible to create new HTML and add it...from the API. However, what I ... | Yes, you can definitely create new HITs based on an existing HIT template that you've already created on Mechanical Turk, but you will need to follow a specific approach since the API does not allow you to directly reference an HTML template.
Here’s how you can achieve this:
1. **Use the HIT Type ID**: When you creat... | 37,577 | [
{
"from": "human",
"value": "Question for anyone who's used Mechanical Turk: Is it possible to take an HTML template created on Mechanical Turk's website, and then create more HITs based on that template from the command line tools or API? \n\nAccording to the API docs, it's not possible to create new HTML ... |
LearnWPF.com posted this article about converting bitmap images to XAML and using them in your applications.
The outer element of the XAML image is a Canvas. However, the Window.Icon property only accepts an ImageSource object. Does anyone know how I can 'wrap' the Canvas in an ImageSource so I can use it as a window... | In WPF, you cannot directly use a `Canvas` (or any other XAML element) as a window icon since the `Window.Icon` property expects an `ImageSource` type. However, you can convert your `Canvas` or any visual element to an `ImageSource` using a `RenderTargetBitmap`. This allows you to render the visual tree of the `Canvas`... | 38,245 | [
{
"from": "human",
"value": "LearnWPF.com posted this article about converting bitmap images to XAML and using them in your applications.\nThe outer element of the XAML image is a Canvas. However, the Window.Icon property only accepts an ImageSource object. Does anyone know how I can 'wrap' the Canvas in ... |
I have extensively used Prototype before and it helped us add considerable interactivity to our web applications. However we are looking at making the move to use jQuery in order to standardize on something better supported in Visual Studio.
I understand that we can use the jQuery.noConflict to run it alongside Prototy... | Migrating from Prototype to jQuery can certainly streamline your web development process, especially with jQuery's widespread support and documentation. While there isn’t a single, official resource dedicated to this migration, several guides and tips can assist you in transitioning your scripts from Prototype to jQuer... | 37,622 | [
{
"from": "human",
"value": "I have extensively used Prototype before and it helped us add considerable interactivity to our web applications. However we are looking at making the move to use jQuery in order to standardize on something better supported in Visual Studio.\nI understand that we can use the jQu... |
To send a message I usually press ctrl + enter. What other shortcuts do you think are important to implement into your webapplications?
Edit:
What buttons do you think are interessting to catch with js because they aren't used by the browser?
I am not thinking of ctrl + z f.e. because the browser uses those maybe shif... | When designing web applications, implementing keyboard shortcuts can enhance user experience by allowing more efficient navigation and interaction. Here are some suggestions for shortcuts and key combinations that might be useful:
### Suggested Keyboard Shortcuts
1. **Navigation Shortcuts**:
- `Alt + Arrow Keys`: ... | 37,864 | [
{
"from": "human",
"value": "To send a message I usually press ctrl + enter. What other shortcuts do you think are important to implement into your webapplications?\nEdit:\nWhat buttons do you think are interessting to catch with js because they aren't used by the browser? \nI am not thinking of ctrl + z f.... |
Is it possible to write a user interface in Java for an application written in C#?
I am working on a user interface of a project that is written in C#, but I have no experience with C# and I am an avid Java user. Is it possible to build the user interface in Java using Java's Swing and AWT libraries that operates an ap... | It's not a stupid question at all! The integration of different programming languages can sometimes be complex, and there are a few points to consider when thinking about building a user interface in Java for a C# application.
### 1. **Cross-Language Communication**
Java and C# do not natively interoperate because the... | 36,198 | [
{
"from": "human",
"value": "Is it possible to write a user interface in Java for an application written in C#?\nI am working on a user interface of a project that is written in C#, but I have no experience with C# and I am an avid Java user. Is it possible to build the user interface in Java using Java's S... |
On my website I want a small flash banner which the user can activate somehow and it grows a lot larger to display a lot more information.
I've seen advertising banners which annoyingly do this when you mouse over them although I'd want to ask the user to click a specific "more" button.
I can think of two ways
1) Make ... | Both of the methods you've outlined have their merits and challenges. However, as Flash is no longer widely supported, it's advisable to consider alternatives such as HTML5, CSS, and JavaScript for your banner functionality. Here’s a suggestion for an approach that would provide the desired functionality without relyin... | 37,611 | [
{
"from": "human",
"value": "On my website I want a small flash banner which the user can activate somehow and it grows a lot larger to display a lot more information.\nI've seen advertising banners which annoyingly do this when you mouse over them although I'd want to ask the user to click a specific \"mor... |
I am trying to autoreload my page after every 20 seconds. I am using JavaScript for this instead of the <meta>.
I have <body onload="SetTimer()">
and here is my JavaScript function
function SetTimer(){
setTimeout('window.location.replace(window.location.pathname)', 20000)
}
Now my problem is I also pas... | To solve the issue of reloading the page with the original query string parameters intact, you can modify your `SetTimer` function. Instead of using `window.location.pathname`, you should use `window.location.href`, which includes both the path and the query string.
Here’s how you can adjust your JavaScript function:... | 35,112 | [
{
"from": "human",
"value": "I am trying to autoreload my page after every 20 seconds. I am using JavaScript for this instead of the <meta>.\nI have <body onload=\"SetTimer()\">\nand here is my JavaScript function\n function SetTimer(){\n setTimeout('window.location.replace(window.location.pathnam... |
In the last 3 companies I've worked at, the phone number columns are of type varchar(n). The reason being that they might want to store extensions (ext. 333). But in every case, the "-" characters are stripped out when inserting and updating. I don't understand why the ".ext" characters are okay to store but not the "-... | The approach you've encountered regarding phone number storage can be influenced by several factors, including formatting preferences, data validation, and use cases. Let’s break down your questions and concerns:
### 1. **Why allow ".ext" but not "-"?**
The decision to allow the "ext" designation while stripping out ... | 34,889 | [
{
"from": "human",
"value": "In the last 3 companies I've worked at, the phone number columns are of type varchar(n). The reason being that they might want to store extensions (ext. 333). But in every case, the \"-\" characters are stripped out when inserting and updating. I don't understand why the \".ext\... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.