instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I'd like to use a C# program to poll a gmail account and automatically download new messages. I know you can use gmail as an outbound SMTP server, but is there any way to access new messages sent to the account?
EDIT: Thanks for the rapid feedback....so I have two options, POP or IMAP.
Which one should I use? And why?... | You are correct that there are two main protocols to access Gmail messages: POP (Post Office Protocol) and IMAP (Internet Message Access Protocol). Here’s a brief overview of both, and why IMAP might be the better choice for your use case:
### POP vs. IMAP
1. **POP (Post Office Protocol)**:
- Downloads emails from... | 45,532 | [
{
"from": "human",
"value": "I'd like to use a C# program to poll a gmail account and automatically download new messages. I know you can use gmail as an outbound SMTP server, but is there any way to access new messages sent to the account?\nEDIT: Thanks for the rapid feedback....so I have two options, POP ... |
There are several ways to do burn down charts in Scrum.
Some people suggest using the story points of unfinished stories left as your burn down charts in Scrum.
Pro: Only finished stories lower the chart
Contra: Chart doesn't move down in the beginning and then rapidly falls off
Others suggest to use the number of task... | Using both a story points chart and a tasks chart can provide a more comprehensive view of the team's progress in Scrum. Each approach has its own merits and drawbacks, and utilizing both can help balance the information they convey.
### Advantages of Having Both Charts:
1. **Holistic View of Progress**:
- **Story... | 47,064 | [
{
"from": "human",
"value": "There are several ways to do burn down charts in Scrum.\nSome people suggest using the story points of unfinished stories left as your burn down charts in Scrum.\nPro: Only finished stories lower the chart\nContra: Chart doesn't move down in the beginning and then rapidly falls ... |
I have a requirement to send some 100 bytes data over internet .My machine is connected to internet.
I can do this with HTTP by sending requests and receiving responses.
But my requirement is just to send data not receive response.
I am thinking of doing this using UDP Client server program. But to do that I need to ho... | To send data over the internet without the need for a response, you have several options beyond just using a UDP client-server model. Here are some approaches you could consider:
### 1. **Using UDP:**
You can create a UDP client that sends data to a known server IP address and port. While you typically need a server l... | 45,570 | [
{
"from": "human",
"value": "I have a requirement to send some 100 bytes data over internet .My machine is connected to internet.\nI can do this with HTTP by sending requests and receiving responses.\nBut my requirement is just to send data not receive response.\nI am thinking of doing this using UDP Client... |
Does anyone know how to create a ClickOnce publication for a CD with the publish task in MSBuild?
VS2008 has a 'publish wizard' with a publish to CD radio button choice. It publishes a click once install to a local folder that is suitable for burning to a CD.
We are following a scheduled MSBuild with post processing s... | Creating a ClickOnce publication suitable for a CD using MSBuild can indeed be a bit tricky, especially since the graphical Publish Wizard in Visual Studio hides several details and settings that are not immediately obvious when using MSBuild directly. However, it is possible to automate the publication process with a ... | 42,394 | [
{
"from": "human",
"value": "Does anyone know how to create a ClickOnce publication for a CD with the publish task in MSBuild?\nVS2008 has a 'publish wizard' with a publish to CD radio button choice. It publishes a click once install to a local folder that is suitable for burning to a CD.\nWe are following... |
By "fixed vector" I mean a static list of values, like 1 through 24.
The current query looks like this (simplified)
SELECT Period, Profit FROM Projections
But the data is "sparse" — so there's not a row for every period.
What query will give me a row for peiods 1-24 every time, with zeros (or NULLs) where there's no d... | To achieve the desired output of a static list of values for periods 1 through 24, with a corresponding `Profit` value from your `Projections` table (and `0` or `NULL` where there’s no data), you can use a Common Table Expression (CTE) or a temporary table to generate the fixed vector of periods, and then perform a `LE... | 46,258 | [
{
"from": "human",
"value": "By \"fixed vector\" I mean a static list of values, like 1 through 24.\nThe current query looks like this (simplified)\nSELECT Period, Profit FROM Projections\n\nBut the data is \"sparse\" — so there's not a row for every period.\nWhat query will give me a row for peiods 1-24 ev... |
Using Lucene, one can retrieve the terms contained within in an index, i.e. the unique, stemmed words, excluding stop-words, that documents in the index contain. This is useful for generating autocomplete suggestions amongst other things. Is something similar possible with MS SQL Server full text indices?
| Yes, Microsoft SQL Server does provide features for full-text search that can be used to retrieve unique terms (or keywords) from a full-text index. Although SQL Server’s full-text search capabilities do not directly expose a list of unique terms like Lucene does, you can achieve similar functionality using SQL queries... | 47,718 | [
{
"from": "human",
"value": "Using Lucene, one can retrieve the terms contained within in an index, i.e. the unique, stemmed words, excluding stop-words, that documents in the index contain. This is useful for generating autocomplete suggestions amongst other things. Is something similar possible with MS SQ... |
I'm in the trade of developing business web applications. They are mostly internal-use, sometimes with a partner zone, but rarely available to the public internet. They are applications that help companies run their business.
For some time now I have an idea bugging me - why not use Flash for them? Up to now it's been ... | Your idea of using Flash for internal web applications is interesting, but there are several key reasons why it hasn't been widely adopted, especially in recent years. Here are some of the most important factors to consider:
1. **End of Life for Flash**: Adobe Flash Player reached its end of life on December 31, 2020.... | 48,601 | [
{
"from": "human",
"value": "I'm in the trade of developing business web applications. They are mostly internal-use, sometimes with a partner zone, but rarely available to the public internet. They are applications that help companies run their business.\nFor some time now I have an idea bugging me - why no... |
I've got a node struct
struct Node{CString text, int id;};
in a sorted vector.
I'm wondering if there's a function in algorithm that will do a binary search of the vector and find an element.
| Yes, you can use the `std::lower_bound` function from the C++ Standard Library to perform a binary search on a sorted vector to find an element. However, since you're using a custom struct, you need to provide a way to compare the elements.
First, make sure your struct looks something like this:
```cpp
#include <vect... | 46,365 | [
{
"from": "human",
"value": "I've got a node struct\nstruct Node{CString text, int id;};\n\nin a sorted vector. \nI'm wondering if there's a function in algorithm that will do a binary search of the vector and find an element. \n"
},
{
"from": "gpt",
"value": "Yes, you can use the `std::lower_bo... |
I am trying to write a function that will pull the name of a property and the type using syntax like below:
private class SomeClass
{
Public string Col1;
}
PropertyMapper<Somewhere> propertyMapper = new PropertyMapper<Somewhere>();
propertyMapper.MapProperty(x => x.Col1)
Is there any way to pass the property thro... | Certainly! You can achieve this in C# using expressions. The idea is to create a `PropertyMapper` class that takes an expression representing the property, and then you can extract the property name and type from that expression.
Below is a sample implementation of `PropertyMapper` that demonstrates how to achieve wha... | 46,098 | [
{
"from": "human",
"value": "I am trying to write a function that will pull the name of a property and the type using syntax like below:\nprivate class SomeClass\n{\n Public string Col1;\n}\n\nPropertyMapper<Somewhere> propertyMapper = new PropertyMapper<Somewhere>();\npropertyMapper.MapProperty(x => x.C... |
How long should it take to run
ALTER DATABASE [MySite] SET READ_COMMITTED_SNAPSHOT ON
I just ran it and it's taken 10 minutes.
How can I check if it is applied?
| The `ALTER DATABASE [MySite] SET READ_COMMITTED_SNAPSHOT ON` command is typically a fast operation in SQL Server, as it mainly involves changing a configuration setting for the database. However, the duration of this operation can vary depending on several factors, such as database size, active transactions, and locks ... | 43,369 | [
{
"from": "human",
"value": "How long should it take to run \nALTER DATABASE [MySite] SET READ_COMMITTED_SNAPSHOT ON\n\nI just ran it and it's taken 10 minutes.\nHow can I check if it is applied?\n"
},
{
"from": "gpt",
"value": "The `ALTER DATABASE [MySite] SET READ_COMMITTED_SNAPSHOT ON` comman... |
For some reason I'm not getting this. (Example model below) If I write:
var property = typeof(sedan).GetProperty("TurningRadius");
Attribute.GetCustomAttributes(property,typeof(MyAttribute), false)
the call will return MyAttribute(2) despite indicating I don't want to search the inheritance chain. Does anyone know wh... | The issue you are encountering arises from how the `GetProperty` method and the attribute retrieval methods work in C#. When you call `GetProperty("TurningRadius")` on the `Sedan` class, you are getting the property from the `Car` class, which has the `MyAttribute(2)`. This is why you are seeing that attribute, despite... | 46,118 | [
{
"from": "human",
"value": "For some reason I'm not getting this. (Example model below) If I write: \nvar property = typeof(sedan).GetProperty(\"TurningRadius\");\nAttribute.GetCustomAttributes(property,typeof(MyAttribute), false)\n\nthe call will return MyAttribute(2) despite indicating I don't want to se... |
I need to make a pop-up window for users to log-in to my website from other websites.
I need to use a pop-up window to show the user the address bar so that they know it is a secure login, and not a spoof. For example, if I used a floating iframe, websites could spoof my login window and record the user's login inform... | To create a secure pop-up login window similar to the Facebook Connect functionality, you'll want to follow a few key steps. The idea is to open a new browser window (or tab) for the login process, ensuring that it is a separate and secure context where users can verify the URL. Here’s how you can implement this:
### ... | 45,346 | [
{
"from": "human",
"value": "I need to make a pop-up window for users to log-in to my website from other websites.\nI need to use a pop-up window to show the user the address bar so that they know it is a secure login, and not a spoof. For example, if I used a floating iframe, websites could spoof my login... |
I'm seeing a lot of Javascript errors in IE8 on pages which worked fine in IE7 (and Firefox, Chrome, and Safari). I know that IE made some changes to things like Javascript security. Some of these don't give clear error messages - things like cross-domain violations can end up throwing very vague exceptions.
Let's make... | Certainly! Here's a checklist of common issues and changes in JavaScript handling that can lead to errors in Internet Explorer 8 (IE8) as compared to Internet Explorer 7 (IE7):
### Checklist of Common JavaScript Offenders in IE8
1. **Strict Mode Enforcement**:
- **Change**: IE8 began enforcing stricter parsing of... | 44,459 | [
{
"from": "human",
"value": "I'm seeing a lot of Javascript errors in IE8 on pages which worked fine in IE7 (and Firefox, Chrome, and Safari). I know that IE made some changes to things like Javascript security. Some of these don't give clear error messages - things like cross-domain violations can end up t... |
Periodically (during autosave) and at close i get:
Problems saving workspace
(X) Problems occurred while trying to save the state of the workbench.
Details >>
Could not write metadata for '/projectname'.
encoded string too long: 123456 bytes
Can't find a reason or solution for this using the usual means. Any ide... | The error message you're encountering in Eclipse indicates that there is an issue with saving the workspace metadata, specifically due to an encoded string being too long. This can happen for a variety of reasons, and here are some steps you can take to resolve the issue:
### 1. **Clean the Workspace**
Sometimes, ther... | 47,695 | [
{
"from": "human",
"value": "Periodically (during autosave) and at close i get:\nProblems saving workspace\n(X) Problems occurred while trying to save the state of the workbench.\n\nDetails >>\n Could not write metadata for '/projectname'. \n encoded string too long: 123456 bytes\n\nCan't find a reason or... |
I have a gridview control that can get loaded with multiple pages worth of data. When I switch pages, the columns widths will change to accommodate the largest value in the column for that page.
If possible, I would like to set the widths of each column to the widest necessary width for the entire dataset.
| To set the column widths of a GridView control based on the widest content in the entire dataset rather than just the currently displayed page, you can follow these steps:
### Steps to Set Column Widths
1. **Calculate Maximum Widths**: Iterate through all the rows of your entire dataset before binding it to the GridV... | 46,244 | [
{
"from": "human",
"value": "I have a gridview control that can get loaded with multiple pages worth of data. When I switch pages, the columns widths will change to accommodate the largest value in the column for that page.\nIf possible, I would like to set the widths of each column to the widest necessary... |
I'm using a WPF WebBrowser control to preview HTML typed by the user.
example...
WPF TextBox and WebBrowser controls http://img411.imageshack.us/img411/2296/appbz9.jpg
But, how do I made the WebBrowser control read-only? I don't want the user to be clicking links in there and navigating away from the preview page.
I w... | To make the `WebBrowser` control in WPF read-only, you can handle the navigation events and suppress navigation actions, effectively making it behave like a read-only control. Here’s how you can do it:
1. **Prevent Navigation**: You can handle the `Navigating` event of the `WebBrowser` control to cancel any navigation... | 47,841 | [
{
"from": "human",
"value": "I'm using a WPF WebBrowser control to preview HTML typed by the user.\nexample...\nWPF TextBox and WebBrowser controls http://img411.imageshack.us/img411/2296/appbz9.jpg\nBut, how do I made the WebBrowser control read-only? I don't want the user to be clicking links in there an... |
I have an .Net Froms application that displays web pages through a WebBrowser control.
Is there anyway that I can detect if the control shows a 'Page not found' or 'Cannot display webpage' error?
There doesn't seem to be any error event handlers.
| In a .NET Windows Forms application using the `WebBrowser` control, detecting specific error pages like "Page not found" or "Cannot display webpage" can be tricky, as there are no built-in error event handlers for these conditions. However, you can work around this limitation by monitoring the `DocumentCompleted` event... | 45,136 | [
{
"from": "human",
"value": "I have an .Net Froms application that displays web pages through a WebBrowser control.\nIs there anyway that I can detect if the control shows a 'Page not found' or 'Cannot display webpage' error?\nThere doesn't seem to be any error event handlers.\n"
},
{
"from": "gpt",... |
Is it possible to go back and tie work items to code that's already been checked into TFS? For example . . . A developer picks the wrong work item, or forgets to pick a work item? I can see work item details for ChangeSets, but the work item page is read-only.
| Yes, it is indeed possible to associate work items with existing changesets in Team Foundation Server (TFS), even if the changesets have already been checked in. However, the method you use may depend on the version of TFS you are using and the permissions you have.
Here’s how you can link work items to changesets tha... | 45,306 | [
{
"from": "human",
"value": "Is it possible to go back and tie work items to code that's already been checked into TFS? For example . . . A developer picks the wrong work item, or forgets to pick a work item? I can see work item details for ChangeSets, but the work item page is read-only.\n"
},
{
"f... |
I have a syntax highlighting function in vb.net. I use regular expressions to match "!IF" for instance and then color it blue. This works perfect until I tried to figure out how to do comments.
The language I'm writing this for a comment can either be if the line starts with a single quote ' OR if anywhere in the lin... | To handle the comment highlighting in your VB.NET syntax highlighting function, you can modify your regular expression to match comments that start with a single quote `'` at the beginning of the line or two single quotes `''` anywhere in the line. Here’s how you can achieve that:
1. **Match comments starting with a s... | 46,315 | [
{
"from": "human",
"value": "I have a syntax highlighting function in vb.net. I use regular expressions to match \"!IF\" for instance and then color it blue. This works perfect until I tried to figure out how to do comments. \nThe language I'm writing this for a comment can either be if the line starts with... |
Windows Server 2008 / IIS 7...
I am trying to setup and CI environment using TeamCity 4. So far so good, VisualSVN Server / Subversion repository is all set, TeamCity is monitoring it, and firing off the build. I can use the TeamCity Webapp via http:localhost:8080 with no problem. My issue is that I can't access the... | To resolve the issue of accessing the TeamCity webapp remotely on your Windows Server 2008 machine, you'll need to check several configurations, including firewall settings and the TeamCity server configuration itself. Here are some steps to troubleshoot and potentially resolve the issue:
### 1. Check TeamCity Server ... | 46,378 | [
{
"from": "human",
"value": "Windows Server 2008 / IIS 7...\nI am trying to setup and CI environment using TeamCity 4. So far so good, VisualSVN Server / Subversion repository is all set, TeamCity is monitoring it, and firing off the build. I can use the TeamCity Webapp via http:localhost:8080 with no pro... |
Say a class
Person
+Name: string
+Contacts: List<Person>
I want to be able to check if a person has a contact with a certain name without having to create a dummy Person instance.
person.Contacts.Contains<string>("aPersonName");
This should check all persons in the Contacts list if their Name.Equals("aPersonName... | To achieve the functionality you described, you can implement a custom method in your `Person` class that checks whether the `Contacts` list contains a `Person` with a specific name. The `List<T>.Contains` method is used to check for object equality, but since you want to search by a property of the objects (in this ca... | 48,020 | [
{
"from": "human",
"value": "Say a class \nPerson \n+Name: string \n+Contacts: List<Person>\n\nI want to be able to check if a person has a contact with a certain name without having to create a dummy Person instance.\nperson.Contacts.Contains<string>(\"aPersonName\");\n\nThis should check all persons in ... |
I am trying to use regular expressions to find a UK postcode within a string.
I have got the regular expression working inside RegexBuddy, see below:
\b[A-Z]{1,2}[0-9][A-Z0-9]? [0-9][ABD-HJLNP-UW-Z]{2}\b
I have a bunch of addresses and want to grab the postcode from them, example below:
123 Some Road Name Town, City ... | To extract UK postcodes from a string in Python using regular expressions, you can use the `re` module, which provides support for regular expressions. Below is a complete example that demonstrates how to do this using your regex pattern.
```python
import re
# Define the regex pattern for UK postcodes
postcode_patter... | 49,699 | [
{
"from": "human",
"value": "I am trying to use regular expressions to find a UK postcode within a string.\nI have got the regular expression working inside RegexBuddy, see below:\n\\b[A-Z]{1,2}[0-9][A-Z0-9]? [0-9][ABD-HJLNP-UW-Z]{2}\\b\n\nI have a bunch of addresses and want to grab the postcode from them,... |
What is the best way to create a DataTable with the same structure as a table in my SqlServer database? At present, I am using SqlDataAdapter.Fill() with a query that brings back the columns but no rows. That's works fine, but it seems klutzy.
Is there a better way?
| Using `SqlDataAdapter.Fill()` to create a `DataTable` with the same structure as a SQL Server table is a common approach, but there are indeed more direct methods to achieve this, which can streamline your code and reduce the complexity. Here are a few alternatives to consider:
### 1. Using `SqlCommandBuilder`
You ca... | 47,425 | [
{
"from": "human",
"value": "What is the best way to create a DataTable with the same structure as a table in my SqlServer database? At present, I am using SqlDataAdapter.Fill() with a query that brings back the columns but no rows. That's works fine, but it seems klutzy. \nIs there a better way?\n"
},
... |
I am having problems when connecting to my SQL server 2008 and think it might be a problem related to MDAC. Is there a download to re-install these?
| MDAC (Microsoft Data Access Components) is a set of components that allows applications to access data from a variety of sources. SQL Server 2008 typically uses a version of MDAC that is integrated into Windows. However, if you believe that MDAC might be causing issues with your SQL Server connection, you can take a fe... | 49,011 | [
{
"from": "human",
"value": "I am having problems when connecting to my SQL server 2008 and think it might be a problem related to MDAC. Is there a download to re-install these?\n"
},
{
"from": "gpt",
"value": "MDAC (Microsoft Data Access Components) is a set of components that allows applicatio... |
This afternoon, upon noticing a broken build and the fact that some files looked like very old versions (about 2 weeks old), I checked the svn log. Apparently just this afternoon, 1 of the developers did an "svn copy" of a directory from an older revision to the same directory. Thus it appears that the latest version... | Yes, you're on the right track! When you perform an `svn copy`, it creates a new revision based on the source you're copying from, and it effectively overwrites the target directory with the older state. As a result, your latest version and history appear as if they've been reverted to an older state.
To recover from ... | 48,168 | [
{
"from": "human",
"value": "This afternoon, upon noticing a broken build and the fact that some files looked like very old versions (about 2 weeks old), I checked the svn log. Apparently just this afternoon, 1 of the developers did an \"svn copy\" of a directory from an older revision to the same director... |
I have a tab page that should be hidden if a property (BlahType) is set to 1 and shown if set to 0. This is what I WANT to do:
<TabItem Header="Blah">
<TabItem.Triggers>
<DataTrigger Binding="{Binding BlahType}" Value="0">
<Setter Property="TabItem.Visibility" Value="Hidden" />
</DataTri... | The error you are encountering occurs because you are trying to add a `DataTrigger` directly to the `TabItem.Triggers` collection, which only accepts `EventTrigger` items. To achieve the functionality you want (showing and hiding the `TabItem` based on the value of `BlahType`), you can use a `Style` with a `DataTrigger... | 49,542 | [
{
"from": "human",
"value": "I have a tab page that should be hidden if a property (BlahType) is set to 1 and shown if set to 0. This is what I WANT to do:\n<TabItem Header=\"Blah\">\n <TabItem.Triggers>\n <DataTrigger Binding=\"{Binding BlahType}\" Value=\"0\">\n <Setter Property=\"Tab... |
I'm building an outlook control for an application, and am populating a treelist by recursively adding child folders. These folders are declared as Outlook.MAPIFolder. But the application only allows import from actual emails, so I want to exclude folders containing calendar items. I can right click on those folders... | In order to determine the type of a folder programmatically in VB.Net, you can check the `DefaultItemType` property of the `MAPIFolder` object. This property will tell you what kind of items are stored in the folder (e.g., mail items, calendar items, etc.).
In Outlook, the `DefaultItemType` can take on several values... | 48,951 | [
{
"from": "human",
"value": "I'm building an outlook control for an application, and am populating a treelist by recursively adding child folders. These folders are declared as Outlook.MAPIFolder. But the application only allows import from actual emails, so I want to exclude folders containing calendar i... |
This is in reference to the question previously asked
The problem here is, each slider controls the other. It results in feedback.
How do I possibly stop it?
$(function() {
$("#slider").slider({ slide: moveSlider2 });
$("#slider1").slider({ slide: moveSlider1 });
function moveSlider2( e, ui )
{
... | The issue you're facing is due to the fact that each slider is calling the other slider's move function, which creates a feedback loop. To solve this, you can introduce a flag that indicates whether a slider is currently being updated programmatically or manually. This will allow you to prevent the sliders from affecti... | 49,536 | [
{
"from": "human",
"value": "This is in reference to the question previously asked\nThe problem here is, each slider controls the other. It results in feedback. \nHow do I possibly stop it?\n$(function() {\n $(\"#slider\").slider({ slide: moveSlider2 });\n $(\"#slider1\").slider({ slide: moveSlider1 }... |
I'm playing with an embedded Linux device and looking for a way to get my application code to communicate with a web interface. I need to show some status information from the application on the devices web interface and also would like to have a way to inform the application of any user actions like uploaded files etc... | When developing an application for an embedded Linux device with a web interface, choosing the right method for communication between the web interface and the application is crucial for ease of implementation and performance. Here’s an overview of your options along with some recommendations:
### 1. **Sockets**
- **P... | 44,824 | [
{
"from": "human",
"value": "I'm playing with an embedded Linux device and looking for a way to get my application code to communicate with a web interface. I need to show some status information from the application on the devices web interface and also would like to have a way to inform the application of... |
For a web application I'm developing, I need to store a large number of records. Each record will consist of a primary key and a single (short-ish) string value. I expect to have about 100GB storage available and would like to be able to use it all.
The records will be inserted, deleted and read frequently and I must u... | For your web application requirements, storing a large number of records with a focus on performance while using MySQL, there are several considerations to keep in mind:
### 1. **Storage Engine Selection**
MySQL offers several storage engines, but for your use case, **InnoDB** is typically the best choice, even though... | 42,794 | [
{
"from": "human",
"value": "For a web application I'm developing, I need to store a large number of records. Each record will consist of a primary key and a single (short-ish) string value. I expect to have about 100GB storage available and would like to be able to use it all.\nThe records will be inserted... |
I have a bunch of controls on my window. One of them is a refresh button that performs a cumbersome task on a background thread.
When the user clicks the refresh button, I put the cursor in a wait (hourglass) status and disable the whole window -- Me.IsEnabled = False.
I'd like to support cancellation of the refresh a... | Yes, there is a more elegant approach to achieve what you want without having to disable and enable each control individually. You can use a combination of a `CancellationToken` and a modal dialog or a background operation with a busy indicator.
### Approach 1: Use a Modal Dialog with a Cancel Button
Instead of disab... | 45,040 | [
{
"from": "human",
"value": "I have a bunch of controls on my window. One of them is a refresh button that performs a cumbersome task on a background thread.\nWhen the user clicks the refresh button, I put the cursor in a wait (hourglass) status and disable the whole window -- Me.IsEnabled = False.\nI'd li... |
How do I maintain the scroll position of the parent page when I open new window using window.open()? The parent page returns to the top of the page.
Here is my current code:
<a href="#" onclick="javascript: window.open('myPage.aspx');">
Open New Window
</a>
| When you open a new window using `window.open()`, the default behavior of the browser is to navigate the parent window to the top of the page. To maintain the scroll position of the parent page, you can use JavaScript to save the current scroll position before opening the new window and then restore it after the new wi... | 46,245 | [
{
"from": "human",
"value": "How do I maintain the scroll position of the parent page when I open new window using window.open()? The parent page returns to the top of the page.\nHere is my current code:\n<a href=\"#\" onclick=\"javascript: window.open('myPage.aspx');\">\n Open New Window\n</a>\n\n"
},... |
Is possible to set an image as an iPhone application unique icon in code instead of adding a PNG format image file and naming it Icon.png?
| No, it is not possible to set an image as an iPhone application's unique icon directly in code. iOS applications require a specific set of image files to be included in the project bundle, and these images must adhere to certain naming conventions and sizes.
Here are the general steps to set an app icon in an iOS appl... | 49,955 | [
{
"from": "human",
"value": "Is possible to set an image as an iPhone application unique icon in code instead of adding a PNG format image file and naming it Icon.png?\n"
},
{
"from": "gpt",
"value": "No, it is not possible to set an image as an iPhone application's unique icon directly in code.... |
I am calling an executable in C#. When the executable runs, it writes out to the console so the C# code is getting the console output and writing it to a text file. When the crash happens a couple of things occur.
1) The output of the text file is not completely written out.
2) The executable process seems to run compl... | It seems like you're experiencing an issue with capturing the output of a process in C# and possibly experiencing some resource management problems leading to inconsistent output files. Here are several suggestions to improve the robustness of your code and potentially resolve the issues you're facing.
### 1. Ensure P... | 42,775 | [
{
"from": "human",
"value": "I am calling an executable in C#. When the executable runs, it writes out to the console so the C# code is getting the console output and writing it to a text file. When the crash happens a couple of things occur.\n1) The output of the text file is not completely written out.\n2... |
I have an existing standalone application which is going to be extended by a 3rd-party, using a network protocol. The capabilities are already implemented, all I need is to expose them to the outside.
Assuming the transport protocol is already chosen (UDP), are there any resources that will help me to design my applica... | Designing an application protocol, especially over a transport protocol like UDP, requires careful consideration to ensure efficient communication, robustness, and ease of integration. Here are some resources and guidelines to help you with your protocol design:
### Key Considerations for Protocol Design
1. **Message... | 46,135 | [
{
"from": "human",
"value": "I have an existing standalone application which is going to be extended by a 3rd-party, using a network protocol. The capabilities are already implemented, all I need is to expose them to the outside.\nAssuming the transport protocol is already chosen (UDP), are there any resour... |
I have what seems like a typical usage scenario for users downloading, editing and uploading a document from a web page.
User clicks a link to download a document
User edits downloaded file
User saves the file
User goes back to the web page and uploads the new file with the changes
The problem is that downloaded file... | You’re right to be concerned about the potential difficulties non-technical users may face when downloading, editing, and re-uploading documents. Here are several strategies you could consider to streamline the process:
### 1. **Web-Based Document Editing Tools**
Using online document editing tools like Google Docs, M... | 47,335 | [
{
"from": "human",
"value": "I have what seems like a typical usage scenario for users downloading, editing and uploading a document from a web page.\n\nUser clicks a link to download a document\nUser edits downloaded file\nUser saves the file\nUser goes back to the web page and uploads the new file with th... |
I am building application that required some data from iPhone's Call log(read only).
The call log is a sqlite db located at "/User/Library/CallHistory/call_history.db". I used a jailbroken device to extract the log.
However trying to open this location using the sqlite_open3() command I get a SQLITE_ERROR error, which ... | Accessing the call history database on iOS devices, especially on jailbroken devices, can indeed be tricky. Here are some insights and suggestions that might help you with your issue:
1. **File Paths**: Ensure you are using the correct path to the call history database. The path you mentioned (`/User/Library/CallHisto... | 42,944 | [
{
"from": "human",
"value": "I am building application that required some data from iPhone's Call log(read only).\nThe call log is a sqlite db located at \"/User/Library/CallHistory/call_history.db\". I used a jailbroken device to extract the log.\nHowever trying to open this location using the sqlite_open3... |
Is there a better way to develop Java Swing applications?
SWIXML? JavaFX? Anything else that developers out here have liked and recommend?
| Yes, there are several alternatives and enhancements for developing Java Swing applications, as well as options beyond Swing itself. Here are some popular ones:
### 1. JavaFX
- **Overview**: JavaFX is a modern GUI toolkit for Java that provides a more sophisticated and flexible framework for building desktop applicati... | 43,930 | [
{
"from": "human",
"value": "Is there a better way to develop Java Swing applications?\nSWIXML? JavaFX? Anything else that developers out here have liked and recommend?\n"
},
{
"from": "gpt",
"value": "Yes, there are several alternatives and enhancements for developing Java Swing applications, a... |
I have an app that run on many computers and connect to sql server
I want to log the machine names of that computers in a table every time they connect how can I do that
I want to know if there is a command like that
"Select @@MachineName"
| In SQL Server, there isn't a built-in function like `@@MachineName` to directly retrieve the machine name of the client that is connected to the database. However, you can achieve this by using a combination of a connection string property and some SQL commands.
Here’s how you can log the machine names of computers co... | 44,785 | [
{
"from": "human",
"value": "I have an app that run on many computers and connect to sql server\nI want to log the machine names of that computers in a table every time they connect how can I do that\nI want to know if there is a command like that\n\"Select @@MachineName\"\n"
},
{
"from": "gpt",
... |
The following doesn't work, because it doesn't wait until the process is finished:
import subprocess
p = subprocess.Popen('start /WAIT /B MOZILL~1.LNK', shell=True)
p.wait()
Any idea how to run a shortcut and wait that the subprocess returns ?
Edit: originally I was trying this without the shell option in my post, whi... | The issue you're experiencing with the `subprocess.Popen` command is due to how Windows handles the `start` command. When you use `start` with the `/WAIT` option in a shell command, it creates a new command window to run the command, and `Popen` doesn't have a direct way to wait for that process to complete.
A common ... | 47,527 | [
{
"from": "human",
"value": "The following doesn't work, because it doesn't wait until the process is finished:\nimport subprocess\np = subprocess.Popen('start /WAIT /B MOZILL~1.LNK', shell=True)\np.wait()\n\nAny idea how to run a shortcut and wait that the subprocess returns ?\nEdit: originally I was tryin... |
Since PHP is a dynamic language what's the best way of checking to see if a provided field is empty?
I want to ensure that:
null is considered an empty string
a white space only string is considered empty
that "0" is not considered empty
This is what I've got so far:
$question = trim($_POST['question']);
if ("" === ... | To check if a provided field in PHP is empty while adhering to your specific requirements, you can simplify your check by combining `trim()` with `empty()`. However, since you want to treat `null` and whitespace-only strings as empty but still consider `"0"` as a valid input, you can customize your check.
Here’s a str... | 47,686 | [
{
"from": "human",
"value": "Since PHP is a dynamic language what's the best way of checking to see if a provided field is empty?\nI want to ensure that:\n\nnull is considered an empty string\na white space only string is considered empty\nthat \"0\" is not considered empty\n\nThis is what I've got so far:\... |
I'm working on an AJAXy project (Dojo and Rails, if the particulars matter). There are several places where the user should be able to sort, group, and filter results. There are also places where a user fills out a short form and the resulting item gets added to a list on the same page.
The non-AJAXy implementation w... | You've raised a very common challenge in modern web development: achieving a balance between server-side rendering and client-side interactivity without duplicating code. Let's address each of your questions one by one.
### Question Part One: JavaScript MVC Frameworks
For a more maintainable way to handle client-side... | 41,981 | [
{
"from": "human",
"value": "I'm working on an AJAXy project (Dojo and Rails, if the particulars matter). There are several places where the user should be able to sort, group, and filter results. There are also places where a user fills out a short form and the resulting item gets added to a list on the ... |
I have a Windows CGI created with Delphi 2007 using CGIExpert that I need to debug.
Is there any simply way to run it from within the IDE while passing parameters to it? I tried setting the Host Application to iexplore.exe (Run|Parameters) and entering some text on the Parameters field but it just can't seem to pass an... | Debugging a CGI application directly from the Delphi IDE can be a bit tricky due to the nature of how CGI programs are executed (typically by a web server). However, you can use a few different methods to pass parameters and run the CGI application from within the IDE. Here are a couple of approaches you can try:
### ... | 45,312 | [
{
"from": "human",
"value": "I have a Windows CGI created with Delphi 2007 using CGIExpert that I need to debug.\nIs there any simply way to run it from within the IDE while passing parameters to it? I tried setting the Host Application to iexplore.exe (Run|Parameters) and entering some text on the Paramete... |
Let's say have something like:
SELECT energy_produced, energy_consumed, timestamp1 AS timestamp FROM (
SELECT max(energy_produced) AS energy_produced, mid(timestamp, 1, 10) AS timestamp1 FROM tbl_energy
WHERE site_id = 1366 AND mid(timestamp, 1, 10) >= DATE_SUB(curdate(),INTERVAL 1 day)
group by mid(timestamp1, 1, 10)... | Yes, you can store the SQL query in a variable and then execute it using a database connection in PHP. If you're using a framework like Zend Framework or another that has an abstraction layer for database operations, you can prepare your query and execute it as follows:
Here's an example of how you might implement it:... | 45,063 | [
{
"from": "human",
"value": "Let's say have something like:\nSELECT energy_produced, energy_consumed, timestamp1 AS timestamp FROM (\nSELECT max(energy_produced) AS energy_produced, mid(timestamp, 1, 10) AS timestamp1 FROM tbl_energy\nWHERE site_id = 1366 AND mid(timestamp, 1, 10) >= DATE_SUB(curdate(),INT... |
I need to do a LINQ2DataSet query that does a join on more than one field (as
var result = from x in entity
join y in entity2
on x.field1 = y.field1
and
x.field2 = y.field2
I have yet found a suitable solution (I can add the extra constraints to a where clause, but this is far from a suitable solut... | In LINQ, you can perform joins on multiple fields using anonymous types as you mentioned. This is a common and effective way to perform equijoins on multiple keys. Let's summarize your findings and clarify how to approach this.
### Joining on Multiple Fields
You can achieve joining on multiple fields by creating anon... | 46,845 | [
{
"from": "human",
"value": "I need to do a LINQ2DataSet query that does a join on more than one field (as\nvar result = from x in entity\njoin y in entity2 \n on x.field1 = y.field1 \nand \n x.field2 = y.field2\n\nI have yet found a suitable solution (I can add the extra constraints to a whe... |
I have the following method in my code:
private bool GenerateZipFile(List<FileInfo> filesToArchive, DateTime archiveDate)
{
try
{
using (ZipOutputStream zipStream = new ZipOutputStream(File.Create(GetZipFileName(archiveDate))))
{
zipStream.SetLevel(9); // maximum compression.
... | The issue you're encountering with the ZIP file indicating that each file is 4 TB in size is likely due to not correctly setting the file size for each `ZipEntry` before adding it to the `ZipOutputStream`.
In your current code, you create a `ZipEntry` and set its properties but do not explicitly set the size of the f... | 48,446 | [
{
"from": "human",
"value": "I have the following method in my code:\nprivate bool GenerateZipFile(List<FileInfo> filesToArchive, DateTime archiveDate)\n{\n try\n {\n using (ZipOutputStream zipStream = new ZipOutputStream(File.Create(GetZipFileName(archiveDate))))\n {\n zipStr... |
My company is trying to find a tool that will track serial keys for software we have purchased (such as Office), as well as software that we write and sell.
We want software that will allows us to associate a particular computer with the software on that computer and the serial key(s) and license(s) for that software. ... | It sounds like you're looking for a comprehensive asset and license management tool that can specifically handle serial keys for both purchased and internally developed software. Here are some tools and solutions that might meet your requirements:
1. **FlexNet Manager**: This is a robust asset management solution that... | 48,688 | [
{
"from": "human",
"value": "My company is trying to find a tool that will track serial keys for software we have purchased (such as Office), as well as software that we write and sell.\nWe want software that will allows us to associate a particular computer with the software on that computer and the serial... |
I am having a problem trying to simply sum some values using XSLT. I a template online and have modified it for my needs. (link text)
No matter how I try, I cannot get the template to sum the numbers. I either end up with a total of "0" or a concatenation of the numbers I want summed. If someone could take a look and p... | It looks like there are a few issues in your XSLT code that are causing the sum of `Duration` values to not work correctly.
Here’s a corrected version of your XSLT code that should help you get the total sum of the `Duration` elements under the `Parts` element:
```xml
<xsl:template match="Parts">
<root>
... | 47,951 | [
{
"from": "human",
"value": "I am having a problem trying to simply sum some values using XSLT. I a template online and have modified it for my needs. (link text)\nNo matter how I try, I cannot get the template to sum the numbers. I either end up with a total of \"0\" or a concatenation of the numbers I wan... |
I don't need to validate that the IP address is reachable or anything like that. I just want to validate that the string is in dotted-quad (xxx.xxx.xxx.xxx) IPv4 format, where xxx is between 0 and 255.
| To validate that a string is in the correct dotted-quad IPv4 format (i.e., `xxx.xxx.xxx.xxx` where each `xxx` is between `0` and `255`), you can use a regular expression. Here’s a simple regex pattern you can use for this validation:
```regex
^(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}... | 46,681 | [
{
"from": "human",
"value": "I don't need to validate that the IP address is reachable or anything like that. I just want to validate that the string is in dotted-quad (xxx.xxx.xxx.xxx) IPv4 format, where xxx is between 0 and 255.\n"
},
{
"from": "gpt",
"value": "To validate that a string is in... |
Say I do this (a contrived example):
#include <iostream>
#include <fstream>
using namespace std;
int main(int argc, char* argv[])
{
ifstream ifs(argv[1]);
char ch;
while(ifs.read(&ch, 1)) {
cout << ch;
}
}
I assume(hope) that the iostream library does some internal buffering here and doesn't... | Your assumption is correct that the `iostream` library does some internal buffering, which means that when you read data using the `ifstream`, it does not directly translate to individual system calls for each byte read. Instead, it reads larger chunks of data, which helps optimize performance, especially when dealing ... | 45,672 | [
{
"from": "human",
"value": "Say I do this (a contrived example):\n#include <iostream>\n#include <fstream>\n\nusing namespace std;\n\nint main(int argc, char* argv[])\n{\n ifstream ifs(argv[1]);\n\n char ch;\n while(ifs.read(&ch, 1)) {\n cout << ch;\n }\n}\n\nI assume(hope) that the iostr... |
I have a load of user-submitted content. It is HTML, and may contain URLs. Some of them will be <a>'s already (if the user is good) but sometimes users are lazy and just type www.something.com or at best http://www.something.com.
I can't find a decent regex to capture URLs but ignore ones that are immediately to the ri... | Certainly! You can use a regex pattern that captures URLs while ensuring that they are not preceded by either a double quote (`"`) or a greater-than symbol (`>`). Below is a regex pattern that can help you accomplish this:
```regex
(?<!["'>])\b(?:(?:https?://|www\.)[^\s<>"']+|(?:www\.)[^\s<>"']+|https?://[^\s<>"']+)
`... | 47,902 | [
{
"from": "human",
"value": "I have a load of user-submitted content. It is HTML, and may contain URLs. Some of them will be <a>'s already (if the user is good) but sometimes users are lazy and just type www.something.com or at best http://www.something.com.\nI can't find a decent regex to capture URLs but ... |
If I have the following nvarchar variable - BTA200, how can I extract just the BTA from it?
Also, if I have varying lengths such as BTA50, BTA030, how can I extract just the numeric part?
| To extract the specific parts from the `nvarchar` variable in SQL Server, you can use the following methods.
1. **Extracting "BTA" from "BTA200":**
Since "BTA" is a fixed string at the beginning of the value, you can use the `LEFT` function combined with `PATINDEX` or a specific length. Assuming "BTA" always consis... | 49,056 | [
{
"from": "human",
"value": "If I have the following nvarchar variable - BTA200, how can I extract just the BTA from it?\nAlso, if I have varying lengths such as BTA50, BTA030, how can I extract just the numeric part?\n"
},
{
"from": "gpt",
"value": "To extract the specific parts from the `nvarc... |
We are currently using database to maintain state information (in a separate table) for the user. We fetch that information from the database every time user access the application (sends request) and update it in the database back after processing the request.
This has worked very well for us in many of our projects a... | Yes, there are several alternatives to using a traditional database for maintaining user state information, which can reduce the overhead associated with frequent database calls. Here are some options you can consider:
### 1. **In-Memory Caching Solutions:**
- **Redis or Memcached**: These are in-memory data stores... | 46,215 | [
{
"from": "human",
"value": "We are currently using database to maintain state information (in a separate table) for the user. We fetch that information from the database every time user access the application (sends request) and update it in the database back after processing the request.\nThis has worked ... |
I need to decide on a GUI/Widget toolkit to use with Python for a new project. The target platforms will be Linux with KDE and Windows XP (and probably Vista). What Python GUI toolkit looks best and consistent with the native look and feel of the run time platform?
If possible, cite strengths and weaknesses of the sugg... | When it comes to choosing a GUI/Widget toolkit for Python that is consistent with the native look and feel of both Linux (particularly KDE) and Windows XP/Vista, there are a few main contenders you might consider:
### 1. PyQt / PySide
**Strengths:**
- **Cross-Platform**: PyQt and PySide (the official set of bindings ... | 46,039 | [
{
"from": "human",
"value": "I need to decide on a GUI/Widget toolkit to use with Python for a new project. The target platforms will be Linux with KDE and Windows XP (and probably Vista). What Python GUI toolkit looks best and consistent with the native look and feel of the run time platform?\nIf possible,... |
I have a couple of tables which are used to log user activity for an application. The tables looks something like this (pseudo code from memory, may not be syntactically correct):
create table activity (
sessionid uniqueidentifier not null,
created smalldatetime not null default getutcdate()
);
create table activi... | You can indeed simplify the process of populating the `activity_summary` table by using a single `INSERT` statement with a `GROUP BY` clause along with `JOIN` operations to get the first and last activity descriptions. This will make the code cleaner and potentially more efficient.
Here’s how you can do it using Comm... | 49,392 | [
{
"from": "human",
"value": "I have a couple of tables which are used to log user activity for an application. The tables looks something like this (pseudo code from memory, may not be syntactically correct):\ncreate table activity (\n sessionid uniqueidentifier not null,\n created smalldatetime not null ... |
Simplified for example, I have two tables, groups and items.
items (
id,
groupId,
title
)
groups (
id,
groupTitle,
externalURL
)
The regular query I'm goes something like this:
SELECT
i.`id`,
i.`title`,
g.`id` as 'groupId',
g.`groupTitle`,
g.`externalURL`
FROM
items i I... | Yes, you can achieve the desired output using a combination of a `LEFT JOIN` and a `UNION`. The `LEFT JOIN` will allow you to get all the groups along with their respective items where they exist, and the `UNION` will allow you to include the groups that have an `externalURL` but no corresponding items.
Here's how you... | 43,931 | [
{
"from": "human",
"value": "Simplified for example, I have two tables, groups and items.\nitems (\n id,\n groupId,\n title\n)\n\ngroups (\n id,\n groupTitle,\n externalURL\n)\n\nThe regular query I'm goes something like this:\nSELECT\n i.`id`,\n i.`title`,\n g.`id` as 'groupId',\... |
I have a base class vehicle and some children classes like car, motorbike etc.. inheriting from vehicle.
In each children class there is a function Go();
now I want to log information on every vehicle when the function Go() fires, and on that log I want to know which kind of vehicle did it.
Example:
public class vehicl... | To achieve your goal of logging which derived class (e.g., `car`, `motorbike`, etc.) called the `Go()` method, you can use the `GetType()` method within the base class. The idea is to log the name of the calling class when the `Go()` method is executed. Here is an example of how you can implement this:
### C# Code Exa... | 48,345 | [
{
"from": "human",
"value": "I have a base class vehicle and some children classes like car, motorbike etc.. inheriting from vehicle.\nIn each children class there is a function Go();\nnow I want to log information on every vehicle when the function Go() fires, and on that log I want to know which kind of v... |
So I have started playing around with FxCop lately and one thing I've noticed is it insists that any method attached to an event should be in the form
void Callback(object sender, EventArgs args) { ...}
and to be attached with
MyObject.Event += new EventHandler(Callback);
Now that was all well and good back in the .N... | Your observation about using Action delegates in .NET 3.5 and later is indeed a valid one, and many developers share your sentiment regarding the verbosity of the traditional event handling pattern with `object sender` and `EventArgs`. Here are some thoughts to consider regarding your concerns with FxCop and event hand... | 45,420 | [
{
"from": "human",
"value": "So I have started playing around with FxCop lately and one thing I've noticed is it insists that any method attached to an event should be in the form\nvoid Callback(object sender, EventArgs args) { ...}\n\nand to be attached with\nMyObject.Event += new EventHandler(Callback);\n... |
I want to use a Simulink mdl to generate C files in an automated fashion. I am currently trying to use an m-script and a dos command shell, but I am having issues with a "do you want to save" dialog hanging the m-script. By experimentation I know that the mdl is being modified when the "set_param" line is run (i.e. n... | To automate the process of generating C code from a Simulink model without encountering the "do you want to save" dialog, you can modify your m-script to include the `set_param` function with additional options that prevent the dialog from appearing. Here are the steps you can take:
1. **Use the `set_param` with the `... | 48,835 | [
{
"from": "human",
"value": "I want to use a Simulink mdl to generate C files in an automated fashion. I am currently trying to use an m-script and a dos command shell, but I am having issues with a \"do you want to save\" dialog hanging the m-script. By experimentation I know that the mdl is being modifi... |
I'd like to implement a UITableView which displays say 20 rows at a time. But given the fact that I might actually have say 120 items to present, I'd like to handle this using some sort of paging:
Populate table with first 20 items. When the user does a right-to-left swipe, reload the UITableView with the next 20 items... | To achieve the desired functionality of paging in a `UITableView` through horizontal swipes, you can implement gesture recognizers instead of subclassing `UITableView`. This approach will allow you to detect swipes without interfering with the standard tap behavior that selects rows.
Here's how you can implement this:... | 43,724 | [
{
"from": "human",
"value": "I'd like to implement a UITableView which displays say 20 rows at a time. But given the fact that I might actually have say 120 items to present, I'd like to handle this using some sort of paging:\nPopulate table with first 20 items. When the user does a right-to-left swipe, rel... |
I have a custom control that has the following prototype.
Type.registerNamespace('Demo');
Demo.CustomTextBox = function(element) {
Demo.CustomTextBox.initializeBase(this, [element]);
}
Demo.CustomTextBox.prototype = {
initialize: function() {
Demo.CustomTextBox.callBaseMethod(this, 'initialize');
... | To raise a postback event to the server from the `_onBlur` method in your `Demo.CustomTextBox` control, you can use a `__doPostBack` function that is typically available in ASP.NET Web Forms applications. This function is used to trigger postbacks programmatically.
Here's how you can modify your `_onBlur` method to pe... | 47,529 | [
{
"from": "human",
"value": "I have a custom control that has the following prototype.\nType.registerNamespace('Demo');\n\nDemo.CustomTextBox = function(element) {\n Demo.CustomTextBox.initializeBase(this, [element]);\n}\n\nDemo.CustomTextBox.prototype = {\n\n initialize: function() {\n Demo.Custom... |
We use MKS Integrity for our source control. I have no control over that -- I just have to use it.
What are some "gotchas" that I should know about and avoid? And, are there any neat things about the software that will allow me to use it better?
I've already hit cases where the tree structure in the source control ... | Using MKS Integrity (now known as Micro Focus Integrity) can indeed come with its own set of challenges and intricacies. Here are some common "gotchas" to watch out for and some tips for better usage:
### Common Gotchas:
1. **Tree Structure Mismatch**:
- As you've noted, the tree structure in your workspace (sandb... | 44,944 | [
{
"from": "human",
"value": "We use MKS Integrity for our source control. I have no control over that -- I just have to use it. \nWhat are some \"gotchas\" that I should know about and avoid? And, are there any neat things about the software that will allow me to use it better?\nI've already hit cases wh... |
I think that it used to the be the case that in Liferay 4, if a war contained both a portlet and a servlet, the servlet was initialized before the portlet. Now with Liferay 5 I notice that the opposite is going on. How can I setup my web application, or Liferay to always have the servlets initialized before the portlet... | In Liferay, the initialization order of servlets and portlets can indeed vary between versions and configurations. As you've noted, in some cases, servlets might be initialized before portlets and vice versa, which can impact your application if there are dependencies between them.
To ensure that your servlets are ini... | 47,333 | [
{
"from": "human",
"value": "I think that it used to the be the case that in Liferay 4, if a war contained both a portlet and a servlet, the servlet was initialized before the portlet. Now with Liferay 5 I notice that the opposite is going on. How can I setup my web application, or Liferay to always have th... |
We're having a bit of fun here at work. It all started with one of the guys setting up a Hackintosh and we were wondering whether it was faster than a Windows Box of (nearly) same specs that we have. So we decided to write a little test for it. Just a simple Prime number calculator. It's written in Java and tells us th... | It sounds like you're having a lot of fun with your Prime number calculation challenge! The optimizations you have applied are definitely a step in the right direction, especially using the square root method to reduce the number of iterations.
Here are some additional optimizations you could consider implementing to ... | 44,862 | [
{
"from": "human",
"value": "We're having a bit of fun here at work. It all started with one of the guys setting up a Hackintosh and we were wondering whether it was faster than a Windows Box of (nearly) same specs that we have. So we decided to write a little test for it. Just a simple Prime number calcula... |
I have a web part with links to e.g. "Manage Users" i SharePoint (2003)
I also have a http module, that must add some JavaScript to the aspx pages served through the sharePoint site. This runs well for normal user served pages but when clicking these admin pages, served by the web part...
What can be wrong and how do ... | In SharePoint 2003, if your HTTP module is not injecting JavaScript into admin pages served by a web part but works for standard user pages, there could be several factors at play, especially since SharePoint has a distinct structure for serving different types of pages and handling requests.
Here's a breakdown of wha... | 48,237 | [
{
"from": "human",
"value": "I have a web part with links to e.g. \"Manage Users\" i SharePoint (2003)\nI also have a http module, that must add some JavaScript to the aspx pages served through the sharePoint site. This runs well for normal user served pages but when clicking these admin pages, served by th... |
I recently got a Dell XPS 64-bit Vista for myself. Eclipse doesn't have their 64-bit version, but I've read on forums that they download Eclipse and work with Java 1.5 on the Vista with only some problems. I have Java 1.6 and Netbeans was easily downloadable.
What's the basic/big difference that I'll notice if I shift ... | Switching from Eclipse to NetBeans can introduce several differences in your development experience, as both IDEs have distinct features and user interfaces. Here are some of the key differences you may notice:
1. **User Interface**:
- Eclipse has a more modular and customizable interface. You can rearrange perspe... | 47,351 | [
{
"from": "human",
"value": "I recently got a Dell XPS 64-bit Vista for myself. Eclipse doesn't have their 64-bit version, but I've read on forums that they download Eclipse and work with Java 1.5 on the Vista with only some problems. I have Java 1.6 and Netbeans was easily downloadable.\nWhat's the basic/b... |
We know that Python provides a lot of productivity over any compiled languages. We have programming in C# & need to write the unit test cases in C# itself. If we see the amount of code we write for unit test is approximately ten times more than the original code.
Is it ideal choice to write unit test cases in IronPyt... | Using IronPython for writing unit test cases in a C# project is an interesting idea, but there are several considerations you should take into account before proceeding. Here’s a breakdown of the pros and cons, as well as suggestions for moving forward:
### Pros of Using IronPython for Unit Tests:
1. **Reduced Code C... | 44,800 | [
{
"from": "human",
"value": "We know that Python provides a lot of productivity over any compiled languages. We have programming in C# & need to write the unit test cases in C# itself. If we see the amount of code we write for unit test is approximately ten times more than the original code. \nIs it ideal ... |
I'm trying to create a simple AJAX to Telnet client for the web. I may be re-inventing the wheel by doing this, but it is a learning project for myself. At the moment I haven't written anything, I'm just trying to get the idea wrapped around my brain. It doesn't necessarily have to be PHP.
If I have a telnet client tha... | Creating an AJAX to Telnet client involves a few steps, especially if you want to communicate between a web client and a running Telnet client process. Since Telnet itself is a network protocol, you'll need a way to manage interactions between your web server, the Telnet client, and the browser.
### High-Level Overvie... | 43,519 | [
{
"from": "human",
"value": "I'm trying to create a simple AJAX to Telnet client for the web. I may be re-inventing the wheel by doing this, but it is a learning project for myself. At the moment I haven't written anything, I'm just trying to get the idea wrapped around my brain. It doesn't necessarily have... |
From a previous question, I learn that Linq to SQL is not able to eager load only certain files of foreingKey tables.
So I'm asking what .net ORM can support including this type of statement inside a entity class, with only one DB call and without manually mapping the result with the object.
-- simplified for clarity... | If you're looking for a simple .NET ORM that can handle the scenario you described — eager loading specific properties from foreign key tables in a single database call — then **Entity Framework (EF Core)** could be a good choice for you. EF Core allows you to perform eager loading with specific properties using the `.... | 47,567 | [
{
"from": "human",
"value": "From a previous question, I learn that Linq to SQL is not able to eager load only certain files of foreingKey tables.\nSo I'm asking what .net ORM can support including this type of statement inside a entity class, with only one DB call and without manually mapping the result wi... |
I am generating a return url link so when the user hits the close button on this page they return to this ReturnUrl.
ie
http://localhost:42605/Search.aspx?ReturnUrl=http%3A%2F%2Flocalhost%3A42605%2FStuff%2FViewStuff.aspx%3FProjectId%3D2246
This works fine in dev environment, but in uat environment I have
http://app-uat... | When generating a ReturnUrl that needs to be consistent across different environments (like development and UAT), you should avoid hardcoding or relying solely on the server's `Request.Url` if it varies significantly between environments. The presence of an extra component in the UAT environment's URL suggests that the... | 47,702 | [
{
"from": "human",
"value": "I am generating a return url link so when the user hits the close button on this page they return to this ReturnUrl.\nie\nhttp://localhost:42605/Search.aspx?ReturnUrl=http%3A%2F%2Flocalhost%3A42605%2FStuff%2FViewStuff.aspx%3FProjectId%3D2246\nThis works fine in dev environment, ... |
I have a sqlite (v3) table with this column definition:
"timestamp" DATETIME DEFAULT CURRENT_TIMESTAMP
The server that this database lives on is in the CST time zone. When I insert into my table without including the timestamp column, sqlite automatically populates that field with the current timestamp in GMT, not CS... | When working with SQLite, it's important to remember that it stores `DATETIME` values as UTC (GMT) by default when using `CURRENT_TIMESTAMP`. This means that even though your server is in the CST time zone, the timestamps stored in your SQLite database will be in UTC.
### Inserting Timestamps
If you wish to insert a ... | 47,744 | [
{
"from": "human",
"value": "I have a sqlite (v3) table with this column definition:\n\"timestamp\" DATETIME DEFAULT CURRENT_TIMESTAMP\n\nThe server that this database lives on is in the CST time zone. When I insert into my table without including the timestamp column, sqlite automatically populates that f... |
I am currently working on a C++/COM project using ArcEngine(From ESRI). Aside from the fact that there is little to no support in terms of documentation (SDK is there.) Anyways, i am wondering if anyone here has had any experience in making the initialization process of ArcEngine faster. Right now it takes 30-35 second... | When working with ArcGIS Engine (ArcEngine) in a C++/COM environment, optimizing the initialization time can be challenging, especially given the proprietary nature of the software and limited documentation. However, there are several general strategies you might consider to potentially reduce the initialization time:
... | 40,504 | [
{
"from": "human",
"value": "I am currently working on a C++/COM project using ArcEngine(From ESRI). Aside from the fact that there is little to no support in terms of documentation (SDK is there.) Anyways, i am wondering if anyone here has had any experience in making the initialization process of ArcEngin... |
I have a div with two nested divs inside, the (float:left) one is the menu bar, and the right (float:right) should display whatever content the page has, it works fine when the window is at a maximum, but when i resize it the content is collapsed until it can no longer has any space, at which it is forced to be display... | To achieve the desired layout where the right content remains fixed in width, allowing for horizontal scrolling instead of collapsing beneath the left menu bar when the browser window is resized, you can use a combination of CSS properties like `overflow` and `display`. Since you mentioned that you only need this to wo... | 46,636 | [
{
"from": "human",
"value": "I have a div with two nested divs inside, the (float:left) one is the menu bar, and the right (float:right) should display whatever content the page has, it works fine when the window is at a maximum, but when i resize it the content is collapsed until it can no longer has any s... |
Is it possible to verify which source safe project is bound to my vs.net solution?
When I checkout a file in vs.net, then look up the file in source safe, it seems to be checking out a file from another project. When I look at the directory in 'set working folder' it seems to be ok.
| Yes, it is possible to verify which SourceSafe project is bound to your Visual Studio .NET solution. Sometimes projects can become incorrectly bound to SourceSafe, which can lead to issues like checking out files from the wrong project. Here's how to check the binding:
### Steps to Verify SourceSafe Binding
1. **Chec... | 47,419 | [
{
"from": "human",
"value": "Is it possible to verify which source safe project is bound to my vs.net solution?\nWhen I checkout a file in vs.net, then look up the file in source safe, it seems to be checking out a file from another project. When I look at the directory in 'set working folder' it seems to ... |
Trying to build a dashboard using Oracle's Brio. I have to access 6 different databases to grab the same type of data, aggregate it and display it. Except that when I do it, Brio grabs the data from the first source just fine. When I grab the data from the second data source, Brio replaces the original data with the... | To build a dashboard in Oracle's Brio (now known as Oracle Business Intelligence), and successfully aggregate data from multiple databases, you will need to ensure that each data source is treated correctly in your data model. Here are some strategies you can consider:
1. **Create Separate Queries for Each Data Source... | 47,098 | [
{
"from": "human",
"value": "Trying to build a dashboard using Oracle's Brio. I have to access 6 different databases to grab the same type of data, aggregate it and display it. Except that when I do it, Brio grabs the data from the first source just fine. When I grab the data from the second data source,... |
I have been developing an event handler to clean up the RolesAssignments of the new item of a document library in MOSS. I’ve searched for a method that could clean all the RolesAssignments efficiently, although the best way I found seams to be loop through the RolesAssignments and delete one by one? Is there another ... | In Microsoft Office SharePoint Server (MOSS), the `RoleAssignments` collection does not provide a direct method to clear all role assignments in a single call. The method you're currently using, where you loop through the `RoleAssignments` collection in reverse to remove each assignment, is actually a common approach.
... | 48,158 | [
{
"from": "human",
"value": "I have been developing an event handler to clean up the RolesAssignments of the new item of a document library in MOSS. I’ve searched for a method that could clean all the RolesAssignments efficiently, although the best way I found seams to be loop through the RolesAssignments ... |
Im currently using the following function to load an image, however i could not figure out a way to find the width of the loaded image, which i intend to use before placing the next image using the same function.
Note that q is a a variable (a number) which is used to load differant images.
=X i need help obtainning t... | To obtain the width of the loaded image in your `LoadImage` function, you'll need to listen for the `Event.COMPLETE` event from the `Loader` object. This event is dispatched once the image has finished loading, at which point you can access the `width` property of the loaded image.
Here’s how you can modify your funct... | 49,441 | [
{
"from": "human",
"value": "Im currently using the following function to load an image, however i could not figure out a way to find the width of the loaded image, which i intend to use before placing the next image using the same function. \nNote that q is a a variable (a number) which is used to load dif... |
Can anyone tell me how to display all the selected value of my multi value parameter in SSRS report. When giving parameter.value option it gives error.
| In SQL Server Reporting Services (SSRS), if you have a multi-value parameter and want to display all selected values, you need to concatenate the selected values into a single string, as the default `Parameter.Value` method will not work directly.
Here's how you can do it:
1. **Use an Expression to Concatenate Values... | 49,840 | [
{
"from": "human",
"value": "Can anyone tell me how to display all the selected value of my multi value parameter in SSRS report. When giving parameter.value option it gives error.\n"
},
{
"from": "gpt",
"value": "In SQL Server Reporting Services (SSRS), if you have a multi-value parameter and w... |
I found this in the code I'm working on at the moment and thought it was the cause of some problems I'm having.
In a header somewhere:
enum SpecificIndexes{
//snip
INVALID_INDEX = -1
};
Then later - initialization:
nextIndex = INVALID_INDEX;
and use
if(nextIndex != INVALID_INDEX)
{
//do stuff
}
Debugging... | Yes, you are on the right track regarding the behavior you are observing with the `nextIndex` variable, the `INVALID_INDEX` enum value, and how type conversions work in C/C++.
Here's a breakdown of what's happening:
1. **Enum Definition**: You defined an enum `SpecificIndexes` with a value `INVALID_INDEX` that is set... | 42,264 | [
{
"from": "human",
"value": "I found this in the code I'm working on at the moment and thought it was the cause of some problems I'm having.\nIn a header somewhere:\nenum SpecificIndexes{\n //snip\n INVALID_INDEX = -1\n};\n\nThen later - initialization:\nnextIndex = INVALID_INDEX;\n\nand use\nif(nextI... |
I set up my svn in assembla, and I code and test on my local machine that is set up identical to the production server. THen, I commit changes to assembla svn and also ftp upload to my production server.
How can I improve my workflow? I would like to keep my svn on assembla because I can often move to another productio... | Improving your workflow can significantly enhance your development efficiency, reduce errors, and ensure a smoother deployment process. Here are several suggestions to optimize your current setup using Assembla SVN:
### 1. **Automate Your Deployment**
Consider using deployment scripts to automate the FTP upload proces... | 45,185 | [
{
"from": "human",
"value": "I set up my svn in assembla, and I code and test on my local machine that is set up identical to the production server. THen, I commit changes to assembla svn and also ftp upload to my production server.\nHow can I improve my workflow? I would like to keep my svn on assembla bec... |
I have developed a web application using internationalization best practices such as putting all my displayable strings in property files, etc, etc.
I would like to have the strings in the property files translated into 5 different languages.
Does anyone have any experience using Mechanical Turk or another crowd sourci... | Using crowdsourcing services like Amazon Mechanical Turk (MTurk) for translation can be an effective way to obtain multilingual content, especially for projects that require ongoing updates and API integration. Here are some insights and recommendations for using MTurk or similar platforms for translation:
### Using A... | 45,679 | [
{
"from": "human",
"value": "I have developed a web application using internationalization best practices such as putting all my displayable strings in property files, etc, etc.\nI would like to have the strings in the property files translated into 5 different languages.\nDoes anyone have any experience us... |
Say I've got a generic vertical market application and I want to package it as two separate programs aaa.exe and bbb.exe. Is there any way to use the Delphi linker to create an EXE/DLL file that doesn't have the same name as the DPR?
I can't just rename the file because I get this error
bbb.exe - Unable to to lo... | In Delphi, the name of the output executable file is typically determined by the project file (.dpr) name. However, you can change the name of the output file using some techniques. Here are a couple of methods you can use to achieve this in Delphi 7, and similar principles apply for later versions like Delphi 2007/200... | 48,587 | [
{
"from": "human",
"value": "Say I've got a generic vertical market application and I want to package it as two separate programs aaa.exe and bbb.exe. Is there any way to use the Delphi linker to create an EXE/DLL file that doesn't have the same name as the DPR? \nI can't just rename the file because I get ... |
I have a WCF service that is hosted in a windows application. The service uses netMsmqBinding. The client and the host are in different domains. My question is how do I configure the security settings?
The data that is transferred is sensitive so I would like to secure the communication between the client and the host... | To secure your WCF service using `netMsmqBinding` without using certificates, especially in a workgroup environment, you have a few options to consider for securing the communication. Here are some suggestions:
### 1. Transport Security with Windows Authentication
Although you're in a workgroup mode (not a domain), i... | 48,452 | [
{
"from": "human",
"value": "I have a WCF service that is hosted in a windows application. The service uses netMsmqBinding. The client and the host are in different domains. My question is how do I configure the security settings? \nThe data that is transferred is sensitive so I would like to secure the com... |
On Windows Mobile (but I guess it's the same on Windows) in a native C++ app, how would I go about setting a SYSTEMTIME structure correctly? Assuming I have
int year, month, dayOfMonth, hour, minute, second;
I obviously should set the wHour, wYear, etc members of the SYSTEMTIME structure, but what happens with wDayOf... | To set up a `SYSTEMTIME` structure in a native C++ app, you can manually assign the values for `wYear`, `wMonth`, `wDay`, `wHour`, `wMinute`, and `wSecond` based on your input. As you correctly noted, the `wDayOfWeek` member needs to be calculated, since it is not directly provided when creating a `SYSTEMTIME` structur... | 45,096 | [
{
"from": "human",
"value": "On Windows Mobile (but I guess it's the same on Windows) in a native C++ app, how would I go about setting a SYSTEMTIME structure correctly? Assuming I have \nint year, month, dayOfMonth, hour, minute, second;\n\nI obviously should set the wHour, wYear, etc members of the SYSTEM... |
Using Microsoft's SAPI 5.3 Speech API on Vista, how do you programatically do acoustic model training of a RecoProfile? More concretely, if you have a text file, and an audio file of a user speaking that text, what sequence of SAPI calls would you make to train the user's profile using that text and audio?
Update:
Mor... | To train an acoustic model for a RecoProfile using Microsoft's SAPI 5.3 on Windows Vista, you need to follow a specific sequence of calls to the SAPI interfaces. Here’s a general outline of how to do this programmatically:
### Step-by-step Procedure for Acoustic Model Training
1. **Initialize the COM Library**: You m... | 45,149 | [
{
"from": "human",
"value": "Using Microsoft's SAPI 5.3 Speech API on Vista, how do you programatically do acoustic model training of a RecoProfile? More concretely, if you have a text file, and an audio file of a user speaking that text, what sequence of SAPI calls would you make to train the user's profi... |
Hannuka, Chanukah, Hanukkah...Due to transliteration from another language and character set, there are many ways to spell the name of this holiday. How many legitimate spellings can you come up with?
Now, write a regular expression that will recognise all of them.
| The holiday "Hanukkah" can indeed be spelled in multiple ways due to variations in transliteration from Hebrew to English. Here are some common spellings:
1. Hanukkah
2. Chanukah
3. Hannukah
4. Hanuka
5. Chanuka
6. Hanukah
7. Channukah
8. Chanukkah
9. Hanukkah
10. Hanukkha
Note that some variations depend on phonetic... | 48,922 | [
{
"from": "human",
"value": "Hannuka, Chanukah, Hanukkah...Due to transliteration from another language and character set, there are many ways to spell the name of this holiday. How many legitimate spellings can you come up with?\nNow, write a regular expression that will recognise all of them.\n"
},
... |
TeX/LaTeX is great, I use it in many ways. Some of its advantages are:
it uses text files, this way the input-files can be diffed and many tools exist to work with text
it is very flexible
it has a stable layout: if I change something at the start of the document, it doesn't affect other things at the end of the docum... | Yes, there are several alternatives and successors to LaTeX that aim to keep its advantages while addressing some of its drawbacks. Here are some noteworthy contenders:
1. **Markdown with Extensions**:
- **Pandoc**: A universal document converter that supports Markdown and can output LaTeX, PDF, HTML, and more. It ... | 48,659 | [
{
"from": "human",
"value": "TeX/LaTeX is great, I use it in many ways. Some of its advantages are:\n\nit uses text files, this way the input-files can be diffed and many tools exist to work with text\nit is very flexible\nit has a stable layout: if I change something at the start of the document, it doesn'... |
In Delphi 2007, in a mouse move event, I try to change the mouse cursor with:
procedure TFr_Board_Display.PaintBox_Proxy_BoardMouseMove(Sender: TObject;
Shift: TShiftState; X, Y: Integer);
begin
if left_mouse_button_down then begin
if some_condition then begin
Cursor := crDrag;
end
else begin
... | The issue you're encountering in Delphi 2007 is due to the way mouse events and cursor changes interact when the left mouse button is pressed. When a mouse button is down, the mouse events are typically processed in a way that may prevent certain cursor changes from taking effect. To address this, you can use the `Appl... | 48,397 | [
{
"from": "human",
"value": "In Delphi 2007, in a mouse move event, I try to change the mouse cursor with:\nprocedure TFr_Board_Display.PaintBox_Proxy_BoardMouseMove(Sender: TObject;\n Shift: TShiftState; X, Y: Integer);\nbegin\n\n if left_mouse_button_down then begin \n if some_condition then begin\n... |
I want to extend a CFC in a different directory and I have a couple of options, but can't figure out how to do this:
A) Use a dynamic mapping (this will have to be dynamic based on the site, e.g. for the live site it would be cfc.myPackage.MyCFC but on a dev site it would be myCfcRoot.myPackage.MyCFC) - I've tried putt... | In ColdFusion, the `extends` attribute in the `<cfcomponent>` tag must be a static path at the time the component is compiled, which means that you cannot use dynamic expressions or variables in the `extends` attribute directly. However, you can work around this limitation using some techniques.
### Option A: Dynamic ... | 48,267 | [
{
"from": "human",
"value": "I want to extend a CFC in a different directory and I have a couple of options, but can't figure out how to do this:\nA) Use a dynamic mapping (this will have to be dynamic based on the site, e.g. for the live site it would be cfc.myPackage.MyCFC but on a dev site it would be my... |
I could really do with updating a user's session variables from within my HTTPModule, but from what I can see, it isn't possible.
UPDATE: My code is currently running inside the OnBeginRequest () event handler.
UPDATE: Following advice received so far, I tried adding this to the Init () routine in my HTTPModule:
AddHan... | Updating session variables in an ASP.NET HTTP module can be a bit tricky, especially due to the lifecycle of HTTP requests and how session state is handled. Since you're attempting to modify session variables, it's important to ensure that you're doing it at the right stage in the request lifecycle.
### Key Points:
1.... | 47,477 | [
{
"from": "human",
"value": "I could really do with updating a user's session variables from within my HTTPModule, but from what I can see, it isn't possible.\nUPDATE: My code is currently running inside the OnBeginRequest () event handler.\nUPDATE: Following advice received so far, I tried adding this to t... |
What are all the other things the new operator does other than allocating memory and calling a constructor?
| In C++, the `new` operator is primarily used for dynamic memory allocation and for calling constructors, but it also has several other important aspects and behaviors:
1. **Type Safety**: The `new` operator ensures that the type of the object being created is correctly aligned and properly sized for the requested type... | 48,503 | [
{
"from": "human",
"value": "What are all the other things the new operator does other than allocating memory and calling a constructor?\n"
},
{
"from": "gpt",
"value": "In C++, the `new` operator is primarily used for dynamic memory allocation and for calling constructors, but it also has sever... |
I have got a template class as follows:
class MyClass<T>
{
T field;
public void myMethod()
{
field = new T(); // gives compiler error
}
}
How do I create a new instance of T in my class?
| In Java, you cannot directly create a new instance of a generic type parameter like `T` using `new T()`, because Java's type erasure does not retain information about the type parameters at runtime.
To create a new instance of a generic type `T`, you typically have a few options:
### Option 1: Pass a Class<T> to the ... | 47,169 | [
{
"from": "human",
"value": "I have got a template class as follows:\nclass MyClass<T>\n{\n T field;\n public void myMethod()\n {\n field = new T(); // gives compiler error\n }\n}\n\nHow do I create a new instance of T in my class?\n"
},
{
"from": "gpt",
"value": "In Java, you ... |
Update 1:
Cannot reproduce this on a co-worker's computer (same setup as mine) so I assume this is a problem with my workstation and not a general one.
I'd appreciate it if someone would close this question as I don't have enough reputation to do it myself.
@MatthewMartin. Thanks for your comments :-)
Update 2:
Un... | It sounds like you're facing an issue with the `onresize` event in Internet Explorer 6 when running your ASP.NET application through the ASP.NET Development Server (also known as Cassini) as opposed to accessing it through IIS. This is indeed a bit tricky, especially given the peculiarities of older versions of Interne... | 44,621 | [
{
"from": "human",
"value": "Update 1:\nCannot reproduce this on a co-worker's computer (same setup as mine) so I assume this is a problem with my workstation and not a general one. \nI'd appreciate it if someone would close this question as I don't have enough reputation to do it myself. \n@MatthewMartin... |
Is it possible to change the connection string of a bound dataset during runtime?
I have created an application in my laptop, and the server host of my connection is localhost, but when I deploy it in another computer, I wanted my application to a database that resides in another server.
| Yes, it is possible to change the connection string of a bound dataset at runtime in many programming environments. Here are general steps and considerations you would typically follow:
### Steps to Change the Connection String at Runtime
1. **Store Connection Strings Externally**: Instead of hardcoding the connectio... | 46,840 | [
{
"from": "human",
"value": "Is it possible to change the connection string of a bound dataset during runtime?\nI have created an application in my laptop, and the server host of my connection is localhost, but when I deploy it in another computer, I wanted my application to a database that resides in anoth... |
Is it possible to store encrypted connection string so it can be used from server-side vbscript?
Was there an equivalent of web.config in 'the good old days'?
| Yes, it is possible to store encrypted connection strings in a server-side VBScript environment, although it is more common and straightforward to do this in more modern frameworks like ASP.NET, which has built-in mechanisms for encrypting configuration sections in the `web.config` file. In classic ASP (which is typica... | 46,755 | [
{
"from": "human",
"value": "Is it possible to store encrypted connection string so it can be used from server-side vbscript?\nWas there an equivalent of web.config in 'the good old days'?\n"
},
{
"from": "gpt",
"value": "Yes, it is possible to store encrypted connection strings in a server-side... |
I am very curious about the possibility of providing immutability for java beans (by beans here I mean classes with an empty constructor providing getters and setters for members). Clearly these classes are not immutable and where they are used to transport values from the data layer this seems like a real problem.
... | Your approach of using two classes—`Immutable` and `Mutable`—that implement a common interface for Java beans is an interesting way to provide immutability while maintaining the flexibility of mutable objects. Here are some thoughts and potential considerations regarding your pattern:
### Pros
1. **Separation of Conc... | 45,435 | [
{
"from": "human",
"value": "I am very curious about the possibility of providing immutability for java beans (by beans here I mean classes with an empty constructor providing getters and setters for members). Clearly these classes are not immutable and where they are used to transport values from the da... |
How would one change the view on the screen programmatically in an iPhone app?
I've been able to create navigation view's and programmatically push/pop them to produce this behaviour, but if I wanted to simply change the current view (not using a UINavigation controller object), what is the neatest way to achieve this?... | To change the view programmatically in an iPhone app without using a `UINavigationController`, you can simply replace the currently displayed view within a `UIViewController` by adding and removing subviews.
### Step-by-step guide
1. **Create your views**: First, create the views that you want to switch between as s... | 48,510 | [
{
"from": "human",
"value": "How would one change the view on the screen programmatically in an iPhone app?\nI've been able to create navigation view's and programmatically push/pop them to produce this behaviour, but if I wanted to simply change the current view (not using a UINavigation controller object)... |
Help with using the xapian php wrapper.
I have a couple of custom exception handlers for different categories of errors (I'm thinking of seperating them out more).
Xapian handles errors by throwing standard Exception objects.
I would like to use a custom exception handler for these though. How do I go about using a cu... | To handle exceptions thrown by the Xapian PHP wrapper using custom exception classes, you can catch the standard `Exception` thrown by Xapian and then rethrow it as a custom exception. Here’s how you can implement a custom exception handler that wraps the standard `Exception` from Xapian into your custom exception.
##... | 48,793 | [
{
"from": "human",
"value": "Help with using the xapian php wrapper.\nI have a couple of custom exception handlers for different categories of errors (I'm thinking of seperating them out more).\nXapian handles errors by throwing standard Exception objects. \nI would like to use a custom exception handler fo... |
I have a text area and a function to do syntax highlighting on it. Right now it reads the entire RichTextBox. How would I get a string variable containing the current line? Below is the code i currently have.
Private Sub HighLight()
Dim rm As System.Text.RegularExpressions.MatchCollection
Dim m As System.Text.R... | To highlight the syntax for only the current line in a `RichTextBox`, you first need to get the text of the current line. You can use the `GetLineFromCharIndex` method to find the current line index based on the current selection start position, and then use `Lines` property of the `RichTextBox` to retrieve the text of... | 47,675 | [
{
"from": "human",
"value": "I have a text area and a function to do syntax highlighting on it. Right now it reads the entire RichTextBox. How would I get a string variable containing the current line? Below is the code i currently have.\nPrivate Sub HighLight()\n Dim rm As System.Text.RegularExpressions... |
I have the odd problem that I am not able to open the properties of my .NET projects in Visual Studio. If I try to open it by clicking on the Properties tree node in the Solution Explorer I get the following message:
There is no editor available for '....csproj'. Make sure the application for the file type (.csproj) i... | Hi Michael,
It sounds like you're facing an issue with Visual Studio 2008 where it's unable to recognize or open the project file properties. Here are a few troubleshooting steps you can take to resolve the issue:
1. **Check the file association**: Since the error message suggests that there may not be an editor avai... | 45,177 | [
{
"from": "human",
"value": "I have the odd problem that I am not able to open the properties of my .NET projects in Visual Studio. If I try to open it by clicking on the Properties tree node in the Solution Explorer I get the following message:\n\nThere is no editor available for '....csproj'. Make sure th... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.