instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I am trying to write a javascript program that can be called from either WScript or a browser (embedded in html). Many javascript functions are independent of the type of caller, but not the debugging functions, such as "window.write" or "WScript.alert".
I am aware that javascript functions can determine the name of t... | You can determine whether your JavaScript code is running in a WScript environment (Windows Script Host) or in a browser environment by checking for the existence of specific global objects that are unique to each environment.
Here's a simple way to distinguish between the two environments in your `sample.js` file:
`... | 49,497 | [
{
"from": "human",
"value": "I am trying to write a javascript program that can be called from either WScript or a browser (embedded in html). Many javascript functions are independent of the type of caller, but not the debugging functions, such as \"window.write\" or \"WScript.alert\".\nI am aware that ja... |
I am interested in enabling code folding in Vim for Python code. I have noticed multiple ways to do so.
Does anyone have a preferred way to do Python code folding in Vim? I.e,
Do you have a particular Vim plugin that you use and like?
Do you use manual folding or do you place markers in comments?
Any other recommende... | Enabling code folding in Vim for Python code can enhance your coding experience significantly. There are several approaches to consider, and the best one often depends on your workflow preferences. Below are some of the popular methods you might find useful:
### 1. **Using Vim's Built-in Folding Options**
Vim has seve... | 45,304 | [
{
"from": "human",
"value": "I am interested in enabling code folding in Vim for Python code. I have noticed multiple ways to do so.\nDoes anyone have a preferred way to do Python code folding in Vim? I.e, \n\nDo you have a particular Vim plugin that you use and like?\nDo you use manual folding or do you pl... |
I have a post-compilation step that manipulates the Java bytecode of generated classes. I'd like to make life as painless as possible for library consumers, so I'm looking at ways I can make this process automatic and (if possible) compiler agnostic.
The Annotation Processing API provides many of the desired features (... | Manipulating Java bytecode after compilation is indeed a challenging task, especially when aiming for a seamless experience for library consumers. Here are several strategies you could consider to achieve this, balancing ease of use, flexibility, and compatibility with different compilers:
### 1. Use a Custom Build To... | 46,592 | [
{
"from": "human",
"value": "I have a post-compilation step that manipulates the Java bytecode of generated classes. I'd like to make life as painless as possible for library consumers, so I'm looking at ways I can make this process automatic and (if possible) compiler agnostic.\nThe Annotation Processing A... |
We've probably all heard about the connecting lava lamps and ambient orbs to your continuous integration systems. I was curious to know what other interesting things people are using or have heard of for extreme feedback devices? Also, this Tux Droid seemed pretty sweet
| Extreme feedback devices can add a fun and engaging layer to continuous integration (CI) and development processes. Here are some interesting devices and ideas beyond lava lamps and ambient orbs:
1. **Drones**: Some teams have connected drones to their CI systems to fly when a build passes or fails. This can add an en... | 46,644 | [
{
"from": "human",
"value": "We've probably all heard about the connecting lava lamps and ambient orbs to your continuous integration systems. I was curious to know what other interesting things people are using or have heard of for extreme feedback devices? Also, this Tux Droid seemed pretty sweet\n"
},... |
I have this table in my SQL Express 2005 database:
CREATE TABLE [dbo].[test_sort_order](
[Col1] [int] IDENTITY(1,1) NOT NULL,
[Col2] [nchar](50) COLLATE French_CI_AS NULL,
CONSTRAINT [PK_test_sort_order] PRIMARY KEY CLUSTERED
(
[Col1] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY],
CONST... | The behavior you're experiencing when querying your SQL Server Express 2005 database is due to how SQL Server handles the ordering of result sets.
In SQL Server, when you execute a `SELECT` statement without an `ORDER BY` clause, the order of the returned rows is not guaranteed. This means that you cannot rely on the... | 48,616 | [
{
"from": "human",
"value": "I have this table in my SQL Express 2005 database:\nCREATE TABLE [dbo].[test_sort_order](\n [Col1] [int] IDENTITY(1,1) NOT NULL,\n [Col2] [nchar](50) COLLATE French_CI_AS NULL,\n CONSTRAINT [PK_test_sort_order] PRIMARY KEY CLUSTERED \n(\n [Col1] ASC\n)WITH (PAD_INDEX =... |
I'd like to display a repeating event on a date/time display in an app. This date time display can take the form of a calendar, but it could also just be a list of upcoming events.
What is the best way to handle tracking this event that can repeat?
For example: Should the event be stored once in the database and p... | When handling repeating events in an application, especially for display in a calendar or a list of upcoming events, it's essential to consider both storage efficiency and retrieval performance. Here are the two main approaches you've mentioned, along with their pros and cons:
### 1. Store the Event Once and Project i... | 44,779 | [
{
"from": "human",
"value": "I'd like to display a repeating event on a date/time display in an app. This date time display can take the form of a calendar, but it could also just be a list of upcoming events. \nWhat is the best way to handle tracking this event that can repeat? \nFor example: Should the... |
I have an ASP.net page. When I am closing the webpage I need to clear the session variables.
How to to handle this I need to maintain the timeout to 20 minutes.
If he closes and login for any number of times in the 20 minutes timed out time
Is there any possiblity for clearing the ASP.net session id
| In ASP.NET, the session management is primarily handled on the server-side, and when the user closes their web page, the server cannot automatically know that the user has closed the page. Sessions typically remain active on the server until either they time out or are explicitly abandoned.
To manage session timeouts ... | 46,316 | [
{
"from": "human",
"value": "I have an ASP.net page. When I am closing the webpage I need to clear the session variables.\nHow to to handle this I need to maintain the timeout to 20 minutes.\nIf he closes and login for any number of times in the 20 minutes timed out time\nIs there any possiblity for clearin... |
Background
I have made a Web Service in Visual Studio, and I'm trying to consume it using the automatically generated proxy class. The Web Service returns a class that I have implemented, containing a List.
Question
The proxy class has automatically generated methods to send the SOAP to the web service. It uses the Inv... | To handle the scenario you've described, you can convert the `DataSet` returned by the proxy method into the specific type you need (`UpdateList` in this case). Since you want to avoid modifying the auto-generated proxy class, you can implement a separate method that handles the conversion of the `DataSet` to the desir... | 46,426 | [
{
"from": "human",
"value": "Background\nI have made a Web Service in Visual Studio, and I'm trying to consume it using the automatically generated proxy class. The Web Service returns a class that I have implemented, containing a List.\nQuestion\nThe proxy class has automatically generated methods to send ... |
The situation is this:
1. Oracle database 10g on one server. Configured to accept connections.
2. Web service on different server (IIS), connecting to the database. This doesn't work.
3. Same web services running on the VS 2005 web server, work without a problem and can connect to the database.
The problem:
Do not kno... | The issue you're facing with your web service on IIS being unable to connect to an Oracle 10g database while it works fine on the Visual Studio 2005 development server can be attributed to a number of potential factors. Below are some troubleshooting steps and considerations that might help you identify and resolve the... | 47,117 | [
{
"from": "human",
"value": "The situation is this:\n1. Oracle database 10g on one server. Configured to accept connections.\n2. Web service on different server (IIS), connecting to the database. This doesn't work.\n3. Same web services running on the VS 2005 web server, work without a problem and can conne... |
I'm writing a simple program that's going to parse a logfile of a packet dump from wireshark into a more readable form. I'm doing this with python.
Currently I'm stuck on this part:
for i in range(len(linelist)):
if '### SERVER' in linelist[i]:
#do server parsing stuff
packet = linelist[i:find("\n\n", i, len(l... | You're on the right track with parsing a list of lines for specific markers. Instead of using `find()` (which is not applicable to lists), you can simply iterate through the list to gather the lines until you hit an empty line.
Here's a simple approach to do this:
1. Check for the occurrence of '### SERVER'.
2. Gath... | 47,318 | [
{
"from": "human",
"value": "I'm writing a simple program that's going to parse a logfile of a packet dump from wireshark into a more readable form. I'm doing this with python.\nCurrently I'm stuck on this part:\nfor i in range(len(linelist)):\nif '### SERVER' in linelist[i]:\n #do server parsing stuff\n... |
I'm overthinking this. I have colors stored in a database table, and I want to set the background of specific cells in a table to those colors. In other words:
<table>
<tr>
<td ???set color here???>
...content...
</td>
<td ???next color here???>
...next content...
... | To dynamically set the background color of the `<td>` elements in your HTML table based on values stored in your database, you can do this directly in your server-side code (such as PHP, ASP.NET, etc.). This way, you can retrieve the color values from the database and apply them to the appropriate table cells.
Here’s ... | 45,949 | [
{
"from": "human",
"value": "I'm overthinking this. I have colors stored in a database table, and I want to set the background of specific cells in a table to those colors. In other words:\n<table>\n <tr>\n <td ???set color here???>\n ...content...\n </td>\n <td ???next co... |
I think I've declared a Vector with an object correctly. But, I don't know how to access it's members when looping with Iterator.
In my code, the line --->> cout << " " << *Iter;
How do I print the contents of the members? Like *Iter.m_PackLine ???
Not sure if I used the correct terminology, but appreciate the help!... | You're on the right track with using a `vector` and an `iterator` to loop through your objects. However, there are a couple of issues in your code that need to be addressed, particularly in how you access the members of the `CFileInfo` class and how you're declaring your `vector`.
### Issues
1. **Vector Declaration**:... | 45,002 | [
{
"from": "human",
"value": "I think I've declared a Vector with an object correctly. But, I don't know how to access it's members when looping with Iterator.\nIn my code, the line --->> cout << \" \" << *Iter;\nHow do I print the contents of the members? Like *Iter.m_PackLine ???\nNot sure if I used the... |
What is classpath hell and is/was it really a problem for Java?
| Classpath hell, sometimes referred to as "JAR hell," is a term used to describe a set of problems related to Java's classpath that arise due to conflicts and ambiguities in loading classes and resources. This issue is particularly common in environments where multiple versions of libraries and dependencies are used. He... | 46,511 | [
{
"from": "human",
"value": "What is classpath hell and is/was it really a problem for Java? \n"
},
{
"from": "gpt",
"value": "Classpath hell, sometimes referred to as \"JAR hell,\" is a term used to describe a set of problems related to Java's classpath that arise due to conflicts and ambiguiti... |
I have 1 table called urltracker that holds information about the number of times a specific url has been clicked. The table is structured into 4 columns id, urlclicked, referrer and timestamp. The urltracker creates another entry in the table every time a url has been clicked.
What i would like to do is display a spec... | Your approach is generally on the right track. What you want to achieve can be accomplished with SQL queries and potentially with a frontend framework or application to display and manage the interaction between displaying distinct URLs and drilling down into their click details.
### 1. Display Distinct URLs with Clic... | 48,859 | [
{
"from": "human",
"value": "I have 1 table called urltracker that holds information about the number of times a specific url has been clicked. The table is structured into 4 columns id, urlclicked, referrer and timestamp. The urltracker creates another entry in the table every time a url has been clicked.\... |
I've come up with:
re.findall("([a-fA-F\d]*)", data)
but it's not very fool proof, is there a better way to grab all MD5-hash codes?
| Your current regex `([a-fA-F\d]*)` is quite broad and may match more than just valid MD5 hash codes. An MD5 hash is a 32-character hexadecimal string consisting only of the characters `0-9` and `a-f` (case-insensitive).
To specifically match valid MD5 hashes, you can improve your regex as follows:
```python
import r... | 46,512 | [
{
"from": "human",
"value": "I've come up with:\nre.findall(\"([a-fA-F\\d]*)\", data)\n\nbut it's not very fool proof, is there a better way to grab all MD5-hash codes?\n"
},
{
"from": "gpt",
"value": "Your current regex `([a-fA-F\\d]*)` is quite broad and may match more than just valid MD5 hash... |
How can I programmatically generate keypress events from Javascript code running in Safari? It looks like WebKit is using the DOM level 3 model for creating keyboard events from Javascript, and the DOM level 3 keyboard event model does not support the keypress event. Is there another way that I can use?
I'm looking f... | Unfortunately, due to security and consistency reasons, modern browsers, including Safari and WebKit, do not allow the manual setting of properties like `keyCode` and `charCode` on synthetic keyboard events. These properties are read-only as you've discovered, and trying to set them directly in a created event will not... | 48,079 | [
{
"from": "human",
"value": "How can I programmatically generate keypress events from Javascript code running in Safari? It looks like WebKit is using the DOM level 3 model for creating keyboard events from Javascript, and the DOM level 3 keyboard event model does not support the keypress event. Is there ... |
The site I'm working on is using a Databound asp:Menu control. When sending 1 menu item it renders HTML that is absolutely correct in Firefox (and IE), but really messed up code in Safari and Chrome. Below is the code that was sent to each browser. I've tested it a few browsers, and they are all pretty similarly ren... | The differences you're observing in how the `asp:Menu` control renders between browsers can be attributed to how the different browsers handle the rendering of HTML elements and styles, especially when using JavaScript for postbacks in ASP.NET.
To achieve consistent rendering across all browsers, including Safari and... | 44,212 | [
{
"from": "human",
"value": "The site I'm working on is using a Databound asp:Menu control. When sending 1 menu item it renders HTML that is absolutely correct in Firefox (and IE), but really messed up code in Safari and Chrome. Below is the code that was sent to each browser. I've tested it a few browse... |
I'm using the appengine webapp framework (link). Is it possible to add Django middleware? I can't find any examples. I'm currently trying to get the FirePython middleware to work (link).
| The App Engine webapp framework and Django are two different frameworks, and they are not directly compatible. The webapp framework is a lightweight framework provided by Google App Engine, while Django is a more full-featured web framework that has its own middleware system.
If you're using the App Engine webapp fram... | 46,801 | [
{
"from": "human",
"value": "I'm using the appengine webapp framework (link). Is it possible to add Django middleware? I can't find any examples. I'm currently trying to get the FirePython middleware to work (link).\n"
},
{
"from": "gpt",
"value": "The App Engine webapp framework and Django ar... |
I'm aware of the built in code generation and refactoring one can do with the "Source" and "Refactor" menu items in Eclipse.
I also use the Commonclipse plugin to easily make use of the Apache Commons classes that build hashCode, toString, equals methods.
What other plugins or tools should I be aware of for generating... | There are several plugins and tools available for Eclipse that can enhance your Java development experience, especially when it comes to generating and managing source code. Here are some notable ones you might find useful:
1. **Lombok**: Project Lombok is a popular library that helps reduce boilerplate code in Java. ... | 44,717 | [
{
"from": "human",
"value": "I'm aware of the built in code generation and refactoring one can do with the \"Source\" and \"Refactor\" menu items in Eclipse. \nI also use the Commonclipse plugin to easily make use of the Apache Commons classes that build hashCode, toString, equals methods.\nWhat other plugi... |
I have a real question.
I have a database with the schema as follows:
item
id
description
other junk
tag
id
name
item2tag
item_id
tag_id
count
Basically, each item is tagged as up to 10 things, with varying counts. There are 50,000 items and 50,000 tags, and about 500,000 entries in items2tag. I'd like to find... | To find the "most similar" item in your database based on the tag distribution and counts, you can follow these steps to implement a similarity measure:
1. **Extract Tag Counts for the Given Item**: Start by retrieving the tag counts for the item you want to compare against. You can use a SQL query like this:
```... | 44,474 | [
{
"from": "human",
"value": "I have a real question.\nI have a database with the schema as follows:\nitem\n\nid \ndescription\nother junk\n\ntag\n\nid\nname\n\nitem2tag\n\nitem_id\ntag_id\ncount\n\nBasically, each item is tagged as up to 10 things, with varying counts. There are 50,000 items and 50,000 tag... |
WinForms C#.. am getting some JSON in the format below (bottom of message) and trying to deserialise using:
using System.Web.Script.Serialization;
When I had simply this json returned:
{
"objects": [
{
"categoryid": "1",
"name": "funny",
"serverimageid": "1",
"dateuploaded": "2008-11... | To deserialize the new JSON structure you provided, you'll need to adjust your C# model classes to reflect the updated structure of the JSON. The new structure consists of two main parts: `categories` and `present`, both of which are nested under `objects`.
Here's how you can modify your C# classes to match this JSON ... | 41,518 | [
{
"from": "human",
"value": "WinForms C#.. am getting some JSON in the format below (bottom of message) and trying to deserialise using:\nusing System.Web.Script.Serialization;\nWhen I had simply this json returned:\n{\n\"objects\": [\n {\n \"categoryid\": \"1\",\n \"name\": \"funny\",\n ... |
Currently at my job, we are distributing installers for our windows base software via an apache web server on a Ubuntu server using apache authentication. When we initially started doing this we only had 3 projects to distribute and as such, 3 htpasswd files to manage. Since then, we have grown and are now distributi... | Given your requirements for a better system to manage password-protected access to large file sets, here are some potential solutions that could work well for you:
1. **Nextcloud**:
- **Description**: Nextcloud is a popular open-source self-hosted file sync and sharing solution that can work well for your needs.
... | 44,922 | [
{
"from": "human",
"value": "Currently at my job, we are distributing installers for our windows base software via an apache web server on a Ubuntu server using apache authentication. When we initially started doing this we only had 3 projects to distribute and as such, 3 htpasswd files to manage. Since t... |
Is there any built-in utility or helper to parse HttpContext.Current.User.Identity.Name, e.g. domain\user to get separately domain name if exists and user?
Or is there any other class to do so?
I understand that it's very easy to call String.Split("\") but just interesting
| In .NET, there isn't a built-in utility specifically designed to parse a string in the format of "domain\user" directly from `HttpContext.Current.User.Identity.Name`. However, using `String.Split("\\")` is indeed the simplest and most straightforward approach to extract the domain and user parts.
If you want a more st... | 46,974 | [
{
"from": "human",
"value": "Is there any built-in utility or helper to parse HttpContext.Current.User.Identity.Name, e.g. domain\\user to get separately domain name if exists and user?\nOr is there any other class to do so?\nI understand that it's very easy to call String.Split(\"\\\") but just interesting... |
I've use Moq to mock my repositories. However, someone recently said that they prefer to create hard-coded test implementations of their repository interfaces.
What are the pros and cons of each approach?
Edit: clarified meaning of repository with link to Fowler.
| Using Moq to create mocks of your repository interfaces and creating hard-coded test implementations both have their pros and cons. Here's a comparison of both approaches:
### Moq (Mocking Framework)
**Pros:**
1. **Isolation**: Mocks allow you to isolate the unit of work being tested, ensuring that external dependen... | 44,270 | [
{
"from": "human",
"value": "I've use Moq to mock my repositories. However, someone recently said that they prefer to create hard-coded test implementations of their repository interfaces.\nWhat are the pros and cons of each approach?\nEdit: clarified meaning of repository with link to Fowler.\n"
},
{
... |
I have a file that apparently contains some sort of dump of a keep-alive HTTP conversation, i.e. multiple GET requests and responses including headers, containing an HTML page and some images. However, there is some binary junk in between - maybe it's a dump on the TCP or even IP level (I'm not sure how to determine wh... | Yes, there are several free tools that can help you analyze and extract files from a raw dump of an HTTP conversation. Depending on the format of your file, here are a few approaches you can try:
1. **Wireshark**:
- **Usage**: Wireshark is a network protocol analyzer that can capture and display the data packets be... | 46,625 | [
{
"from": "human",
"value": "I have a file that apparently contains some sort of dump of a keep-alive HTTP conversation, i.e. multiple GET requests and responses including headers, containing an HTML page and some images. However, there is some binary junk in between - maybe it's a dump on the TCP or even I... |
I am facing a problem.
I would like to localize my action names in my project so french people can have clean urls with french names.
http://www.test.com/Home should be http://www.test.com/Accueil
It is a good thing too for google indexing.
Moreover I would like to be Restful on the application, so I would like too kee... | You're on the right track with your goal of localizing action names for clean URLs while maintaining the underlying structure in English for developers. Here's a general approach you can take to achieve this in an ASP.NET MVC application, along with some related considerations:
### 1. Using Route Localization
You can... | 40,868 | [
{
"from": "human",
"value": "I am facing a problem.\nI would like to localize my action names in my project so french people can have clean urls with french names.\nhttp://www.test.com/Home should be http://www.test.com/Accueil\nIt is a good thing too for google indexing.\nMoreover I would like to be Restfu... |
I need to make some code to talk to a SOAP web service. Unfortunately I'm unable to get a connection to the service as it requires a SSL connection encrypted with a special certificate. I've been given a pk12 certificate which when installed into my keychain allows me to access the SOAP service manually via Safari, b... | To connect to a SOAP web service using a PKCS#12 (p12) certificate in a macOS or iOS application, you'll need to follow a few steps to ensure that the certificate is properly loaded and that your HTTP requests use it. Below are the general steps to achieve this in Swift using `URLSession` for the network calls:
### St... | 43,140 | [
{
"from": "human",
"value": "I need to make some code to talk to a SOAP web service. Unfortunately I'm unable to get a connection to the service as it requires a SSL connection encrypted with a special certificate. I've been given a pk12 certificate which when installed into my keychain allows me to acces... |
Has anyone in the SO community had an opportunity to learn more about, or get any hands on exposure to Microsoft Kojax? It is way early, but are there any resources out there about this technology (Publicly available on the web)?
ZDNet Article on Kojax
From the article:
"Kojax is a mobile development platform, accordi... | As of my last knowledge update in October 2023, Microsoft Kojax seems to be a relatively under-the-radar project, and detailed information might not be widely available yet. The ZDNet article you mentioned points to Kojax being a mobile development platform that allows for the creation of applets in an Ajax-like manner... | 48,025 | [
{
"from": "human",
"value": "Has anyone in the SO community had an opportunity to learn more about, or get any hands on exposure to Microsoft Kojax? It is way early, but are there any resources out there about this technology (Publicly available on the web)?\nZDNet Article on Kojax\nFrom the article:\n\"Ko... |
I need to generate a tone that I can manipulate frequency and wave. The overall goal is to create a basic piano. Does anyone know how I can achieve this?
My development platform is the iPhone 2.x
| Creating a basic piano on the iPhone 2.x involves generating sound tones that can be manipulated for frequency and waveform. Here are some steps and tools you can use to achieve this:
### Step 1: Choose a Development Environment
For iPhone 2.x, you would typically use Xcode along with the iOS SDK available at that tim... | 43,640 | [
{
"from": "human",
"value": "I need to generate a tone that I can manipulate frequency and wave. The overall goal is to create a basic piano. Does anyone know how I can achieve this?\nMy development platform is the iPhone 2.x\n"
},
{
"from": "gpt",
"value": "Creating a basic piano on the iPhone ... |
This is a problem I have been dealing with for a while, and haven't been able to get a good answer (even from Microsoft). I'm using the generic dump filter to write hardware compressed MPEG files out to disk. In the graph, I also have a SampleGrabber filter that gets called on every frame. From the SampleGrabber cal... | Your issue with the SampleGrabber filter and the synchronization of the DirectShow timestamps with the SAMI subtitle file can arise from several factors. Here are a few suggestions and considerations to troubleshoot and potentially resolve the issues you're facing:
1. **Zero Timestamps**:
- The initial zero timest... | 46,776 | [
{
"from": "human",
"value": "This is a problem I have been dealing with for a while, and haven't been able to get a good answer (even from Microsoft). I'm using the generic dump filter to write hardware compressed MPEG files out to disk. In the graph, I also have a SampleGrabber filter that gets called on... |
We have a View (call it X) that is the base view called by 2 other views(call them Y and Z).
Today we made a change to view X, after that view Y and Z started bringing back data that was incorrect. When we were in Management Studio and ran SELECT * FROM Y(which is exactly how the view is called in code) it would get ba... | Yes, SQL Server (MSSQL) does cache the execution plans for views and stored procedures to improve performance. This can lead to situations where, after making changes to the underlying objects of a view, the cached execution plan might not reflect the most recent definition of the view, resulting in outdated or incorre... | 46,443 | [
{
"from": "human",
"value": "We have a View (call it X) that is the base view called by 2 other views(call them Y and Z).\nToday we made a change to view X, after that view Y and Z started bringing back data that was incorrect. When we were in Management Studio and ran SELECT * FROM Y(which is exactly how t... |
I am writing an automated test program using curl-loader, to send calculated requests to a client. I need to know if curl-loader supports HTTP 1.0, in order to code for a test case. In case it supports it, I'd like to know how to use it.
Thanks
| Yes, **Curl-loader** supports HTTP/1.0. By default, Curl-loader uses HTTP/1.1, but you can configure it to use HTTP/1.0 for your test cases.
To enable HTTP/1.0 in Curl-loader, you need to specify the `HTTP_VERSION` parameter in your configuration file or when you're using command line options.
Here’s how you can set ... | 48,403 | [
{
"from": "human",
"value": "I am writing an automated test program using curl-loader, to send calculated requests to a client. I need to know if curl-loader supports HTTP 1.0, in order to code for a test case. In case it supports it, I'd like to know how to use it.\nThanks\n"
},
{
"from": "gpt",
... |
I can split editor panes horizontally or vertically, but it does not seem possible to view code in two separate physical windows. I am aware that Idea can open multiple projects in separate windows, but I'd like to be able to do this for two files in a single project.
One answer suggested unpinning the tab, but I ha... | In IntelliJ IDEA, it is possible to open the same project in multiple windows, allowing you to view different files simultaneously. However, this feature may not be immediately obvious. Here’s how you can do it:
1. **Open a New Window for the Same Project**:
- Go to the menu bar and select `File > New Window`. This... | 47,551 | [
{
"from": "human",
"value": "I can split editor panes horizontally or vertically, but it does not seem possible to view code in two separate physical windows. I am aware that Idea can open multiple projects in separate windows, but I'd like to be able to do this for two files in a single project. \nOne an... |
I am writing a program that does a lot of writes to a Postgres database. In a typical scenario I would be writing say 100,000 rows to a table that's well normalized (three foreign integer keys, the combination of which is the primary key and the index of the table). I am using PreparedStatements and executeBatch(), y... | When dealing with batch inserts into a PostgreSQL database using JDBC, there are several factors that can affect performance significantly. Here are some tips and considerations that might help you improve the speed of your writes:
1. **Disable Autocommit**: Ensure that you're batching your inserts properly by disabli... | 45,528 | [
{
"from": "human",
"value": "I am writing a program that does a lot of writes to a Postgres database. In a typical scenario I would be writing say 100,000 rows to a table that's well normalized (three foreign integer keys, the combination of which is the primary key and the index of the table). I am using... |
How long does it take for an experienced Windows programmer to learn writing simple software for Mac OS X?
Where does one start and what tools will be necessary?
| The time it takes for an experienced Windows programmer to learn to write simple software for macOS (formerly OS X) can vary widely based on the individual’s familiarity with related concepts and technologies, but generally, an experienced developer could become comfortable with the basics in a few days to a couple of ... | 43,047 | [
{
"from": "human",
"value": "How long does it take for an experienced Windows programmer to learn writing simple software for Mac OS X? \nWhere does one start and what tools will be necessary?\n"
},
{
"from": "gpt",
"value": "The time it takes for an experienced Windows programmer to learn to wr... |
I have a bunch of C files that are generated by a collection of python programs that have a number of shared python modules and I need to account for this in my make system.
It is easy enough to enumerate which python program need to be run to generate each C file. What I can't find a good solution for is determining w... | Generating Makefile-style dependency rules for C files produced by Python scripts is a common challenge. Here’s a structured approach to help you achieve this.
### Step 1: Static Analysis for Dependencies
You can use static analysis tools to find dependencies between your Python files. The basic idea is to analyze th... | 41,714 | [
{
"from": "human",
"value": "I have a bunch of C files that are generated by a collection of python programs that have a number of shared python modules and I need to account for this in my make system.\nIt is easy enough to enumerate which python program need to be run to generate each C file. What I can't... |
Could you tell me, please, if it's possible to preview (or at least retroview, for example, in a kind of a log file) SQL commands which SQL Server Management Studio Express is about to execute (or has just executed)?
In the past I used Embarcadero DBArtisan which shows SQL queries to be executed before actually running... | In SQL Server Management Studio (SSMS), there isn't a built-in feature that directly previews all SQL commands (DML) before executing them in the same way that you might have experienced with other tools like Embarcadero DBArtisan. However, there are a few ways to achieve something similar:
### 1. **Using SQL Server P... | 45,382 | [
{
"from": "human",
"value": "Could you tell me, please, if it's possible to preview (or at least retroview, for example, in a kind of a log file) SQL commands which SQL Server Management Studio Express is about to execute (or has just executed)?\nIn the past I used Embarcadero DBArtisan which shows SQL quer... |
My company uses usenet groups on an internal nntp server and I would like to add a web server to this that would allow the usual browsing and searching but in addition provide an archive of old messages that may have expired on the server. This is mainly for searching the archives so ability to post is not important.
C... | There are several options for creating a web-based gateway for Usenet groups that can provide browsing, searching, and archiving capabilities. Here are a few recommendations:
1. **CNews or INN with a Web Interface:**
- You could use a traditional NNTP server like CNews or INN, and pair it with a web interface such ... | 44,798 | [
{
"from": "human",
"value": "My company uses usenet groups on an internal nntp server and I would like to add a web server to this that would allow the usual browsing and searching but in addition provide an archive of old messages that may have expired on the server. This is mainly for searching the archiv... |
During a recent load test, I've been getting some strange "Index Out of Range Exception"
Stack trace:
at System.Security.Cryptography.RijndaelManagedTransform.DecryptData(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[]& outputBuffer, Int32 outputOffset, PaddingMode paddingMode, Boolean fLast)
at... | The "Index Out of Range Exception" you’re encountering appears to stem from the decryption of data, which is often related to ViewState or SessionState in ASP.NET applications. Here are a few ideas and steps you can take to debug and potentially resolve this issue:
1. **ViewState Corruption**: It is possible that the ... | 45,545 | [
{
"from": "human",
"value": "During a recent load test, I've been getting some strange \"Index Out of Range Exception\" \nStack trace: \n at System.Security.Cryptography.RijndaelManagedTransform.DecryptData(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[]& outputBuffer, Int32 outputOffset, ... |
In javascript how do I get a handle on the frame that I'm in based on an element in that frame?
function myFunction(elementInFrame){
// here I want to get a handle on the frame that elementInFrame lives in
}
| To get a handle on the frame that an element resides in, you can use the `window` property of the element. The element's `ownerDocument` property will provide access to the document object, and from there you can access the `defaultView` property, which gives you a reference to the window (or frame) in which that docum... | 48,996 | [
{
"from": "human",
"value": "In javascript how do I get a handle on the frame that I'm in based on an element in that frame?\nfunction myFunction(elementInFrame){\n // here I want to get a handle on the frame that elementInFrame lives in\n}\n\n"
},
{
"from": "gpt",
"value": "To get a handle on... |
I have an application that changes the font of every control to SegoeUI when it is run in Vista. It works fine, except for headings of tabpages (the buttons to click when switching from one tab to another).
Tab page headings do not grow vertically to accommodate a larger font size, they always remain the same height.
... | In Windows Forms, the `TabControl` and its `TabPage` headings do not automatically resize based on the font size. The default behavior is that the height of the tab headers remains fixed regardless of the font size used. Unfortunately, there is no built-in property that will allow the `TabControl` to adjust the height ... | 45,474 | [
{
"from": "human",
"value": "I have an application that changes the font of every control to SegoeUI when it is run in Vista. It works fine, except for headings of tabpages (the buttons to click when switching from one tab to another). \nTab page headings do not grow vertically to accommodate a larger font ... |
Due to the way my serverside script outputs I receive multiple JSON objects. {jsonhere}{jsonhere1}{jsonhere2}{jsonhere3} etc.. They aren't seperated by anything. If I would do a split based }{ I would lose those brackets. So is there an outerloop I can put over the regular $.each loop to make this work?
Thank you,
Ice
| Yes, you can certainly parse multiple JSON objects that are concatenated without any separators by processing the string in a controlled way. Since each JSON object starts with `{` and ends with `}`, you can use regular expressions to extract each individual object and then parse them.
Here's a sample approach to achi... | 47,652 | [
{
"from": "human",
"value": "Due to the way my serverside script outputs I receive multiple JSON objects. {jsonhere}{jsonhere1}{jsonhere2}{jsonhere3} etc.. They aren't seperated by anything. If I would do a split based }{ I would lose those brackets. So is there an outerloop I can put over the regular $.eac... |
When I run the following test in Gallio's Icarus it passes, but when I step into it using TestDriven.NET (Test With->Debugger), it fails because the parameters are not set according to the Row attributes.
I was expecting that the method would be called once for each Row attribute applied.
What am I doing wrong? If noth... | The behavior you are experiencing is related to how different test runners handle parameterized tests. In your case, the Gallio Icarus runner is designed to recognize and execute the parameterized test correctly, while the TestDriven.NET integration may not be able to interpret the MbUnit (now known as Gallio) attribut... | 44,729 | [
{
"from": "human",
"value": "When I run the following test in Gallio's Icarus it passes, but when I step into it using TestDriven.NET (Test With->Debugger), it fails because the parameters are not set according to the Row attributes.\nI was expecting that the method would be called once for each Row attribu... |
What's the best way to protect system integrity while running possibly malicious third party executables?
I would like to allow a program to be able to store some information for its own use during execution, but disallow access to the network and to devices, and of course to other users' data and the overall system.
A... | Running potentially malicious executables while ensuring system integrity is a challenging task. Here are several strategies you can consider based on your constraints:
### 1. Use a Restricted-Privilege Windows User
- **Creating a Limited User Account**: You can create a new Windows user account with limited privilege... | 44,835 | [
{
"from": "human",
"value": "What's the best way to protect system integrity while running possibly malicious third party executables?\nI would like to allow a program to be able to store some information for its own use during execution, but disallow access to the network and to devices, and of course to o... |
do you know any good algorithms that match two strings and then return a percentage in how many percent those two strings match?
And are there some, that work with databases too?
| Yes, there are several algorithms and techniques you can use to compare two strings and return a percentage of how similar they are. Here are a few popular ones:
### 1. **Levenshtein Distance (Edit Distance)**
The Levenshtein distance measures the number of single-character edits (insertions, deletions, substitutions)... | 46,657 | [
{
"from": "human",
"value": "do you know any good algorithms that match two strings and then return a percentage in how many percent those two strings match?\nAnd are there some, that work with databases too?\n"
},
{
"from": "gpt",
"value": "Yes, there are several algorithms and techniques you c... |
What are the best practices and software tools for documenting software design and architecture for
PC based applications based on Java
or .NET?
Embedded Applications based on VxWorks or Embedded Linux or Windows CE?
One tool I have in mind is Enterprise Architect. Is it a good choice?
| Documenting software design and architecture is essential for maintaining quality, facilitating communication among team members, and ensuring that the software meets the necessary requirements. Here are some best practices and software tools suitable for different types of applications, including PC-based applications... | 38,652 | [
{
"from": "human",
"value": "What are the best practices and software tools for documenting software design and architecture for \n\nPC based applications based on Java\nor .NET?\nEmbedded Applications based on VxWorks or Embedded Linux or Windows CE?\n\nOne tool I have in mind is Enterprise Architect. Is i... |
Can this be done without MVC?
Is there an easy way to abstract or encapsulate navigational logic?
I currently have quite a lot of the following in my code behinds (and I know it's probably not the best thing to be doing):
protected void btnNext_Click(object sender, EventArgs e)
{
...
if (condition1)
{ Respo... | Yes, you can abstract or encapsulate your navigation logic without using the Model-View-Controller (MVC) pattern. One approach is to create a dedicated navigation helper class or utility that handles the redirection based on conditions. This allows you to keep your code-behind cleaner and maintainable. Here's an exampl... | 40,512 | [
{
"from": "human",
"value": "Can this be done without MVC?\nIs there an easy way to abstract or encapsulate navigational logic? \nI currently have quite a lot of the following in my code behinds (and I know it's probably not the best thing to be doing):\nprotected void btnNext_Click(object sender, EventArgs... |
I am new to Python, and I'm working on writing some database code using the cx_Oracle module. In the cx_Oracle documentation they have a code example like this:
import sys
import cx_Oracle
connection = cx_Oracle.Connection("user/pw@tns")
cursor = connection.cursor()
try:
cursor.execute("select 1 / 0 from dual")
... | The syntax you're encountering with the `, =` in the line `error, = exc.args` is an example of tuple unpacking in Python. When you use a comma on the left side of the assignment, Python treats the right-hand side as a sequence (such as a tuple or a list) and unpacks its elements into the variables on the left-hand side... | 46,956 | [
{
"from": "human",
"value": "I am new to Python, and I'm working on writing some database code using the cx_Oracle module. In the cx_Oracle documentation they have a code example like this:\nimport sys\nimport cx_Oracle\n\nconnection = cx_Oracle.Connection(\"user/pw@tns\")\ncursor = connection.cursor()\n\n... |
What other frameworks should ASP.Net programmers consult for code inspiration?
| ASP.NET programmers can benefit from exploring various frameworks and technologies for code inspiration, best practices, and architectural patterns. Here are some notable frameworks and tools:
1. **MVC Frameworks**:
- **Spring (Java)**: Although it's Java-based, Spring's approach to dependency injection, aspect-ori... | 46,213 | [
{
"from": "human",
"value": "What other frameworks should ASP.Net programmers consult for code inspiration?\n"
},
{
"from": "gpt",
"value": "ASP.NET programmers can benefit from exploring various frameworks and technologies for code inspiration, best practices, and architectural patterns. Here a... |
I use the "EPIC" plugin to Eclipse for Perl development, but in the "Explain Errors/Warnings" view there's no info at all, even though I have some compilation errors. Do I need to do anything special to get EPIC to display useful info in that view? What is that view for anyway?
| The "Explain Errors/Warnings" view in the EPIC plugin for Eclipse is designed to provide more detailed information about the errors and warnings detected in your Perl code. However, if you're not seeing any information in that view, there are a few things you can check or do to potentially resolve the issue:
1. **Ensu... | 46,651 | [
{
"from": "human",
"value": "I use the \"EPIC\" plugin to Eclipse for Perl development, but in the \"Explain Errors/Warnings\" view there's no info at all, even though I have some compilation errors. Do I need to do anything special to get EPIC to display useful info in that view? What is that view for anyw... |
I am working in the Linux environment, and I have a C++ program, what I want is when I cancel the program with ctrl+c I would like that the program executes a function, to close some files and print some sutff, is there any way to do this?. Thank you.
| Yes, you can handle the `SIGINT` signal (which is triggered by pressing `Ctrl+C`) in your C++ program to execute a specific function before the program exits. You can achieve this by using the `signal` function provided in the `<csignal>` header.
Here’s a step-by-step guide with an example:
1. **Include necessary hea... | 45,830 | [
{
"from": "human",
"value": "I am working in the Linux environment, and I have a C++ program, what I want is when I cancel the program with ctrl+c I would like that the program executes a function, to close some files and print some sutff, is there any way to do this?. Thank you. \n"
},
{
"from": "g... |
I am trying to run a java based tool using a command line syntax as the following: java -cp archive.jar archiveFolder.theMainClassName.Although the class I am searching for, a main class, "theMainClassName" is in the archive.jar and in the archiveFolder given at input, I keep getting the error that my class is not seen... | When running a Java program from the command line, it's essential to ensure that your classpath and package structure are correctly specified. Here are several steps to troubleshoot the issue:
1. **Verify Class Name and Package**:
Ensure that the `theMainClassName` class is indeed in the package `archiveFolder`. Th... | 43,986 | [
{
"from": "human",
"value": "I am trying to run a java based tool using a command line syntax as the following: java -cp archive.jar archiveFolder.theMainClassName.Although the class I am searching for, a main class, \"theMainClassName\" is in the archive.jar and in the archiveFolder given at input, I keep ... |
Does anyone know of some good tutorials that explain how to use the JQuery Slider.
I've found a few, but none of them really present what I need in clear terms. What I really need to figure out how to do is make the slider go from 1.0 - 5.0 (including all tenths) and when it changes set a hidden control based on that ... | Certainly! To create a jQuery slider that goes from 1.0 to 5.0 (including tenths) and updates a hidden input based on the slider's value, you can use the jQuery UI Slider widget. Here's a step-by-step guide to achieve this.
### Step 1: Include jQuery and jQuery UI
First, make sure you include jQuery and jQuery UI in ... | 40,938 | [
{
"from": "human",
"value": "Does anyone know of some good tutorials that explain how to use the JQuery Slider.\nI've found a few, but none of them really present what I need in clear terms. What I really need to figure out how to do is make the slider go from 1.0 - 5.0 (including all tenths) and when it c... |
On the left you will notice the google logo rendered by IE, I drew a black line at the top and bottom of the G which extends into the FF windows which rendered the same exact logo yet the FF version renders the image larger. There is NO css linked to this page, just plain and simple Html.
Can anyone tell me why this ... | The behavior you're experiencing with different renderings of the Google logo in Internet Explorer 7 (IE7) and Firefox 3 (FF3) is likely due to how these browsers handle image rendering, particularly with respect to the default settings and anti-aliasing.
Here are a few points that might help explain the difference an... | 45,903 | [
{
"from": "human",
"value": "\nOn the left you will notice the google logo rendered by IE, I drew a black line at the top and bottom of the G which extends into the FF windows which rendered the same exact logo yet the FF version renders the image larger. There is NO css linked to this page, just plain and ... |
I'm rewriting a PHP+MySQL site that averages 40-50 hits a day using Django.
Is SQLite a suitable database to use here? Are there any advantages/disadvantages between them?
I'm just using the db to store a blog and the users who can edit it. I am using fulltext search for the blog search, but no complex joins anywhere.... | Using SQLite for a Django project with low traffic (such as 40-50 hits a day) can be a suitable choice, especially if the database interactions are relatively simple and you don't expect a lot of concurrent writes. Here are some advantages and disadvantages of using SQLite compared to MySQL for your scenario:
### Adva... | 46,810 | [
{
"from": "human",
"value": "I'm rewriting a PHP+MySQL site that averages 40-50 hits a day using Django. \nIs SQLite a suitable database to use here? Are there any advantages/disadvantages between them?\nI'm just using the db to store a blog and the users who can edit it. I am using fulltext search for the ... |
Encrypted email - sounds like a great thing, right? Problem already solved, right? Well... I don't think so and I'm hoping I'm wrong!
To understand what I'm asking, please understand what I'm NOT asking: I am not asking how I encrypt and sign messages sent over public networks. This is a bit different.
I want to set up... | What you're looking to achieve is indeed a desirable setup, and it's understandable that the complexities of existing encryption solutions can lead to frustration. The encryption of email messages during transit—particularly between clients and a mail server—can enhance security, especially on untrusted networks. Let's... | 43,581 | [
{
"from": "human",
"value": "Encrypted email - sounds like a great thing, right? Problem already solved, right? Well... I don't think so and I'm hoping I'm wrong!\nTo understand what I'm asking, please understand what I'm NOT asking: I am not asking how I encrypt and sign messages sent over public networks.... |
When I try to build my project I get the following message in the build window :
========== Build: 0 succeeded or up-to-date, 0 failed, 1 skipped ==========
I tried rebuilding , then building again , but it doesn't help . Is there a way to view more detailed messages ? The "skipped" part doesn't give me any info on wha... | In Visual Studio 2005, when you see a build status of "0 succeeded or up-to-date, 0 failed, 1 skipped", it usually indicates that the build system determined that a project didn't need to be built because it is already up-to-date, or it was explicitly skipped due to dependencies or configurations.
Here are some steps ... | 45,682 | [
{
"from": "human",
"value": "When I try to build my project I get the following message in the build window :\n========== Build: 0 succeeded or up-to-date, 0 failed, 1 skipped ==========\nI tried rebuilding , then building again , but it doesn't help . Is there a way to view more detailed messages ? The \"s... |
The situation:
I need to convert our current development environment from Windows XP 32-bit to Windows Vista 64-bit (*). Naturally, I've run into plenty of places in our build system where hardcoded paths were problematic (e.g. "C:\Program Files" becoming "C:\Program Files (x86)"). Fortunately, there is a %ProgramFiles... | The behavior you're observing can be traced back to how Windows Vista (and later versions) handle the file system redirection for 32-bit and 64-bit processes. When you launch `cmd.exe` from different contexts (e.g., Start Menu, Run dialog), the system makes decisions based on whether the process is running in a 32-bit ... | 46,739 | [
{
"from": "human",
"value": "The situation:\nI need to convert our current development environment from Windows XP 32-bit to Windows Vista 64-bit (*). Naturally, I've run into plenty of places in our build system where hardcoded paths were problematic (e.g. \"C:\\Program Files\" becoming \"C:\\Program Files... |
I would like to do be able to follow and track redirects and the cookies that are set by the different webpages with Python (a bit like the tamper plugin for Firefox).
So if website1 redirects to website2 which then redirects to website3, I would like to follow that and also see what cookies each website sets. I have b... | To track redirects and capture cookies in Python, you can use the `requests` library, which provides a user-friendly way to handle HTTP requests, including redirects and cookies. Here's how you can achieve this:
1. **Install the requests library** (if you haven't already):
```bash
pip install requests
```
2... | 45,705 | [
{
"from": "human",
"value": "I would like to do be able to follow and track redirects and the cookies that are set by the different webpages with Python (a bit like the tamper plugin for Firefox).\nSo if website1 redirects to website2 which then redirects to website3, I would like to follow that and also se... |
Currently, we are using WebSphere Portal v5.1, and the URLs are about a un-friendly as a URL could get.
For example:
http://www.foo.com/wsps/portal/!ml/QjzQ0IhyR0UAkc39Aw!!/delta/base64xml/L3dJ82XzBfQ1A!
I have removed a bunch of the characters, but you get the idea.
One of our frustrations is that the URLs often end... | The issue you're experiencing with WebSphere Portal's URL structure is indeed a common one among older portal solutions. URL management and user-friendly URLs have become increasingly important as web applications evolve, especially with the emphasis on usability and SEO.
Here are some alternative portal products and ... | 48,307 | [
{
"from": "human",
"value": "Currently, we are using WebSphere Portal v5.1, and the URLs are about a un-friendly as a URL could get.\nFor example: \nhttp://www.foo.com/wsps/portal/!ml/QjzQ0IhyR0UAkc39Aw!!/delta/base64xml/L3dJ82XzBfQ1A! \nI have removed a bunch of the characters, but you get the idea.\nOne o... |
We have a large ASP.NET project consisting of several hundred reports. We are in the process of moving all the SQL Queries (running against an Oracle Database) into three web services. The web services are categorized by command, selections and report queries. We have to deploy a sub-set of our project using a SQL*S... | Hi Lorie,
You've raised some important points that many development teams encounter, particularly when dealing with large projects and multiple database backends. Here are some insights and best practices that might help you streamline your workflow and improve the management of your web services and branching strateg... | 42,520 | [
{
"from": "human",
"value": "We have a large ASP.NET project consisting of several hundred reports. We are in the process of moving all the SQL Queries (running against an Oracle Database) into three web services. The web services are categorized by command, selections and report queries. We have to depl... |
I have a set of conditions in my where clause like
WHERE
d.attribute3 = 'abcd*'
AND x.STATUS != 'P'
AND x.STATUS != 'J'
AND x.STATUS != 'X'
AND x.STATUS != 'S'
AND x.STATUS != 'D'
AND CURRENT_TIMESTAMP - 1 < x.CREATION_TIMESTAMP
Which of these conditions will be executed first? I am using oracle.
Will I get th... | In Oracle SQL, the order of evaluation of conditions in a `WHERE` clause is not strictly defined by the order they appear in the query. The Oracle optimizer determines the most efficient way to execute the query and may rearrange the order of condition evaluations based on statistics and other factors.
In your specifi... | 45,178 | [
{
"from": "human",
"value": "I have a set of conditions in my where clause like\nWHERE \nd.attribute3 = 'abcd*' \nAND x.STATUS != 'P' \nAND x.STATUS != 'J' \nAND x.STATUS != 'X' \nAND x.STATUS != 'S' \nAND x.STATUS != 'D' \nAND CURRENT_TIMESTAMP - 1 < x.CREATION_TIMESTAMP\n\nWhich of these conditions will ... |
I'm trying to get the MVCToolkit working with an ASP.NET MVC Beta application and ran into an unresolved reference to System.Web.Extensions version 3.6 (ASP.NET MVC Beta comes with System.Web.Extensions version 3.5). All my google searches seem to point to a broken download link on Microsoft's site: ASP.NET 3.5 Extensi... | It seems you're encountering a common issue when working with ASP.NET MVC Beta and the MVCToolkit, specifically regarding the version of `System.Web.Extensions`. Here are a few suggestions to resolve this issue:
1. **Check Your References**: Ensure that your project references are correctly pointing to the right versi... | 44,962 | [
{
"from": "human",
"value": "I'm trying to get the MVCToolkit working with an ASP.NET MVC Beta application and ran into an unresolved reference to System.Web.Extensions version 3.6 (ASP.NET MVC Beta comes with System.Web.Extensions version 3.5). All my google searches seem to point to a broken download link... |
Is it possible to pass a list constructor parameter when resolving a type? I want to use a programmatic configuration if possible. I've been playing around with the Parameters method as shown below, but I've not yet stumbled upon the answer.
container.Register(
Component
.For<IDoSomething>()
.ImplementedBy<... | Yes, you can pass a list as a constructor parameter when registering a component in a dependency injection container, such as Castle Windsor, which appears to be what you are using based on the `Component.For<T>()` syntax. To pass a list, you can use the `Parameters` method and specify the list as an array or as an IEn... | 45,704 | [
{
"from": "human",
"value": "Is it possible to pass a list constructor parameter when resolving a type? I want to use a programmatic configuration if possible. I've been playing around with the Parameters method as shown below, but I've not yet stumbled upon the answer.\ncontainer.Register(\n Component\n... |
I am using xmlrpclib.ServerProxy to make RPC calls to a remote server. If there is not a network connection to the server it takes the default 10 seconds to return a socket.gaierror to my program.
This is annoying when doing development without a network connection, or if the remote server is down. Is there a way to u... | The `xmlrpclib.ServerProxy` class does allow you to set a timeout for network operations, which can help reduce the wait time when the network connection is unavailable.
Starting from Python 2.6 and later, `ServerProxy` can accept a `timeout` parameter during initialization. This allows you to specify how long (in se... | 45,891 | [
{
"from": "human",
"value": "I am using xmlrpclib.ServerProxy to make RPC calls to a remote server. If there is not a network connection to the server it takes the default 10 seconds to return a socket.gaierror to my program. \nThis is annoying when doing development without a network connection, or if the ... |
I am evaluating BPEL engine for our high performance telecom application but performance seem to be very poor. We have evaluated Apache Ode, SunBPEL engine, Active BPEL etc. Do you know any faster BPEL engine implementation or BPEL implementation in C/C++ ?
| BPEL (Business Process Execution Language) engines can vary significantly in performance based on their architecture, implementation, and the specific use cases they are designed for. Here are some suggestions and alternatives you might consider for a high-performance telecom application:
1. **Camunda BPM**: While pri... | 42,638 | [
{
"from": "human",
"value": "I am evaluating BPEL engine for our high performance telecom application but performance seem to be very poor. We have evaluated Apache Ode, SunBPEL engine, Active BPEL etc. Do you know any faster BPEL engine implementation or BPEL implementation in C/C++ ?\n"
},
{
"fro... |
I'm testing a web application for browser memory leaks using Quick Test Professional (QTP) 9.5 and Internet Explorer 6. PerfMon works for monitoring the memory usage over time, but its data has to be synchronized to the testing results to find out which steps trigger the browser memory leak. Since QTP's scripting la... | To monitor the "Private Bytes" of the `IExplore.exe` process using VBScript in Quick Test Professional (QTP) 9.5, you can utilize the Windows Management Instrumentation (WMI) service to query performance counters. Below is a sample script that demonstrates how to do this. This script will allow you to capture the memor... | 41,329 | [
{
"from": "human",
"value": "I'm testing a web application for browser memory leaks using Quick Test Professional (QTP) 9.5 and Internet Explorer 6. PerfMon works for monitoring the memory usage over time, but its data has to be synchronized to the testing results to find out which steps trigger the brows... |
I found this question: How to find out which CVS tags cover which files and paths?
However, the results are not at all what I'm expecting.
I'm using the following:
cvs -n -q update -r ET30908
I'm looking for every file tagged with 'ET30908'.
| To find out which files are tagged with a specific CVS tag, like 'ET30908', you can use the `cvs` command to check the status of files in your working directory against the CVS repository. However, using the command you provided, `cvs -n -q update -r ET30908`, will not list all the files that are tagged with 'ET30908';... | 47,362 | [
{
"from": "human",
"value": "I found this question: How to find out which CVS tags cover which files and paths?\nHowever, the results are not at all what I'm expecting.\nI'm using the following:\ncvs -n -q update -r ET30908\n\nI'm looking for every file tagged with 'ET30908'.\n"
},
{
"from": "gpt",
... |
Is it possible to skip a couple of characters in a capture group in regular expressions? I am using .NET regexes but that shouldn't matter.
Basically, what I am looking for is:
[random text]AB-123[random text]
and I need to capture 'AB123', without the hyphen.
I know that AB is 2 or 3 uppercase characters and 123 is ... | Yes, you can achieve this using a regular expression in .NET by capturing the components separately while ignoring the hyphen in a single match. You can use non-capturing groups combined with capturing groups to create a regex pattern that matches your requirements.
Here’s how you can write the regex pattern to match ... | 47,712 | [
{
"from": "human",
"value": "Is it possible to skip a couple of characters in a capture group in regular expressions? I am using .NET regexes but that shouldn't matter.\nBasically, what I am looking for is:\n\n[random text]AB-123[random text]\n\nand I need to capture 'AB123', without the hyphen.\nI know tha... |
When I use Build->Publish Web Site in Visual Studio 2008, most of the time it compiles the site, and then simply asks me "All files in the target folder will be deleted. Continue?" (or something to that effect). On occasion, however, when publishing a project in Visual Studio, I would get a dialog box that would give m... | The behavior you're encountering with the "Publish Web Site" feature in Visual Studio 2008 is indeed tied to the specific project settings and the project type. Here's some insight that may help clarify the situation and offer potential solutions:
1. **Project Type**: The "Publish Web Site" functionality varies based ... | 45,200 | [
{
"from": "human",
"value": "When I use Build->Publish Web Site in Visual Studio 2008, most of the time it compiles the site, and then simply asks me \"All files in the target folder will be deleted. Continue?\" (or something to that effect). On occasion, however, when publishing a project in Visual Studio,... |
Does everyone just use XML in the message? Are there any good alternatives to XML? If you do use XML, do you define an XML Schema so clients know how to send messages to your service?
| XML (eXtensible Markup Language) has been widely used for data interchange due to its flexibility and self-descriptive nature, but it is not the only option available. Here are some alternatives to XML, along with a brief overview of their characteristics:
### Alternatives to XML
1. **JSON (JavaScript Object Notation... | 41,448 | [
{
"from": "human",
"value": "Does everyone just use XML in the message? Are there any good alternatives to XML? If you do use XML, do you define an XML Schema so clients know how to send messages to your service?\n"
},
{
"from": "gpt",
"value": "XML (eXtensible Markup Language) has been widely ... |
Can the iPhone use other databases besides SQLite, like MySQL?
| Yes, an iPhone can use databases other than SQLite, such as MySQL, but there are specific considerations to take into account:
1. **Local vs. Remote Databases**: SQLite is a local database that is integrated into the iOS app, making it suitable for local data storage. MySQL, on the other hand, is typically used as a r... | 48,836 | [
{
"from": "human",
"value": "Can the iPhone use other databases besides SQLite, like MySQL?\n"
},
{
"from": "gpt",
"value": "Yes, an iPhone can use databases other than SQLite, such as MySQL, but there are specific considerations to take into account:\n\n1. **Local vs. Remote Databases**: SQLite... |
Is there any existing code in Apache HttpClient or in the servlet API to parse Cookie header and obtain from a string that contains "name1=value1; name2=value2; ..." a list of Cookie? Writing code to parse this doesn't seem too hard, but if there is already some existing code, I'd like to use it.
| Yes, there are existing utilities in the Apache HttpClient library and the Servlet API that can help you parse the Cookie header string.
### 1. Apache HttpClient
In Apache HttpClient, you can use the `BasicCookieParser` class from the `org.apache.http.impl.cookie` package. The `BasicCookieParser` is responsible for p... | 46,929 | [
{
"from": "human",
"value": "Is there any existing code in Apache HttpClient or in the servlet API to parse Cookie header and obtain from a string that contains \"name1=value1; name2=value2; ...\" a list of Cookie? Writing code to parse this doesn't seem too hard, but if there is already some existing code,... |
I'm trying to write a html helper extension that outputs an image tag.
I need to access (within C# code) something like Razor's @Url.Content() helper to get the proper URL for the current context.
How does one do this?
| To create an HTML helper extension in C# that outputs an image tag and uses the current context to resolve the URL properly, you can utilize the `UrlHelper` class available in ASP.NET. The `UrlHelper` class provides methods to generate URLs based on the current request context.
Here’s a step-by-step guide on how to im... | 46,335 | [
{
"from": "human",
"value": "I'm trying to write a html helper extension that outputs an image tag.\nI need to access (within C# code) something like Razor's @Url.Content() helper to get the proper URL for the current context.\nHow does one do this?\n"
},
{
"from": "gpt",
"value": "To create an ... |
I'm following several tutorials and references trying to get my kernel set up. I've come across some unfamiliar code in a tutorial that isn't explaining it at all. It's code that I'm told maps the 16 IRQs (0-15) to ISR locations 32-47:
void irq_remap(void)
{
outportb(0x20, 0x11);
outportb(0xA0, 0x11);
outpo... | Certainly! The `irq_remap()` function is responsible for configuring the Programmable Interrupt Controllers (PICs) on an x86 system so that the IRQs (Interrupt Requests) are remapped to a new range of Interrupt Service Routines (ISRs). Let's break down the code step by step.
### Understanding the PICs
On x86 architec... | 41,425 | [
{
"from": "human",
"value": "I'm following several tutorials and references trying to get my kernel set up. I've come across some unfamiliar code in a tutorial that isn't explaining it at all. It's code that I'm told maps the 16 IRQs (0-15) to ISR locations 32-47:\nvoid irq_remap(void)\n{\n outportb(0x20... |
I have been trying to set up my Beta 1 MVC app on IIS 6 and cannot get it to run correctly. I have added a Wildcard mapping to the .net isapi DLL as suggested in other blog posts but get the following error when I access the root of the website:
The incoming request does not match any route.
..
[HttpException (0x800040... | Setting up an ASP.NET MVC application on IIS 6 can be challenging due to its limitations and the need for proper routing configurations. Below are steps to help you troubleshoot and resolve the issues you are facing:
1. **Ensure Wildcard Mapping**: Confirm that you have correctly set up wildcard mapping to the ASP.NET... | 42,512 | [
{
"from": "human",
"value": "I have been trying to set up my Beta 1 MVC app on IIS 6 and cannot get it to run correctly. I have added a Wildcard mapping to the .net isapi DLL as suggested in other blog posts but get the following error when I access the root of the website:\nThe incoming request does not ma... |
I have built a database in MS Access.
There I have a table called Customers which also has a cell called Employee type: integer.
I also built a program in C++ which controls all data.
Let's say I have a string like this:
string sqlString = "SELECT * FROM Customers Where Customers.Employee = '" + id + "' ";
Id passes t... | To construct your SQL query correctly when you're working with an integer in C++, you need to ensure that you are not wrapping your integer variable `id` in single quotes, as single quotes are used for string literals in SQL.
Here's how to format your SQL string correctly by treating `id` as an integer:
```cpp
#inclu... | 49,739 | [
{
"from": "human",
"value": "I have built a database in MS Access.\nThere I have a table called Customers which also has a cell called Employee type: integer.\nI also built a program in C++ which controls all data.\nLet's say I have a string like this:\nstring sqlString = \"SELECT * FROM Customers Where Cus... |
Socket has a constructor that takes a winsock SOCKET as parameter and stores it in a private variable:
Socket::Socket(SOCKET s) {
this->s = s;
}
I'm trying to make a class "GameSocket" that will parse data from my Socket class:
class GameSocket : public Socket {
protected:
void ParseData(unsigned char* data,... | The issue you're encountering stems from how the constructor of the derived class `GameSocket` is set up. When you create a class that inherits from another class (in this case, `Socket`), you need to ensure that the constructor of the base class (`Socket`) is properly called from the constructor of the derived class (... | 48,614 | [
{
"from": "human",
"value": "Socket has a constructor that takes a winsock SOCKET as parameter and stores it in a private variable:\nSocket::Socket(SOCKET s) {\n this->s = s;\n}\n\nI'm trying to make a class \"GameSocket\" that will parse data from my Socket class:\nclass GameSocket : public Socket {\n\n... |
What is the best way to send HTTP requests from Windows Powershell?
| In Windows PowerShell, you can send HTTP requests using several methods, but the most common and effective way is to use the `Invoke-RestMethod` or `Invoke-WebRequest` cmdlets. Here’s a brief overview of both methods:
### 1. Using `Invoke-RestMethod`
`Invoke-RestMethod` is a high-level cmdlet specifically designed fo... | 47,025 | [
{
"from": "human",
"value": "What is the best way to send HTTP requests from Windows Powershell?\n"
},
{
"from": "gpt",
"value": "In Windows PowerShell, you can send HTTP requests using several methods, but the most common and effective way is to use the `Invoke-RestMethod` or `Invoke-WebRequest... |
Type.GetType("System.String")
Is there a lookup for the aliases available somewhere?
Type.GetType("string")
returns null.
| In C#, the `Type.GetType` method requires the fully qualified name of the type to correctly locate it, which is why `Type.GetType("string")` returns `null`. The alias "string" is specific to C#; it is not recognized by `Type.GetType`, which expects the full namespace name.
For commonly used C# types, here are the alia... | 48,225 | [
{
"from": "human",
"value": "Type.GetType(\"System.String\")\n\nIs there a lookup for the aliases available somewhere?\nType.GetType(\"string\")\n\nreturns null.\n"
},
{
"from": "gpt",
"value": "In C#, the `Type.GetType` method requires the fully qualified name of the type to correctly locate it... |
I'd like to do something like the following in C#:
class Container {
//...
public void ForEach(Action method) {
foreach (MyClass myObj in sequence) myObj.method();
}
}
//...
containerObj.ForEach(MyClass.Method);
In C++ I would use something like std::mem_fun. How w... | In C#, you can achieve similar functionality using delegates, specifically by using the `Action` delegate to call methods on each instance of your objects in a collection.
However, you need to ensure that you are passing an instance method from the correct context. In your case, it looks like you're trying to call a ... | 48,135 | [
{
"from": "human",
"value": "I'd like to do something like the following in C#:\n class Container {\n //...\n public void ForEach(Action method) {\n foreach (MyClass myObj in sequence) myObj.method();\n }\n }\n\n //...\n containerObj.ForEach(MyClass.Method);\n\nIn... |
I'm having a problem with a Klondike Solitaire I'm programming. It's almost finished but now when I try to compile (I'm using Dr. Java, yeah I know), it keeps popping up with 2 errors.
Cannot find symbol: Variable event
Cannot find symbol: Method "findbunki" (java.awt.Point)
I've already imported java.awt, so that ca... | It sounds like you're running into a couple of issues in your Klondike Solitaire implementation. Let's break down the two errors you're seeing:
1. **Cannot find symbol: Variable event**
- This error typically means that you're trying to use a variable called `event` that hasn't been declared or is out of scope. Mak... | 48,198 | [
{
"from": "human",
"value": "I'm having a problem with a Klondike Solitaire I'm programming. It's almost finished but now when I try to compile (I'm using Dr. Java, yeah I know), it keeps popping up with 2 errors.\n\nCannot find symbol: Variable event\nCannot find symbol: Method \"findbunki\" (java.awt.Poin... |
I’m trying to run Google earth inside WPF but I don’t know how. Basically I have managed to run Google Earth in a Windows Form Control inside a Windows Form, everything was OK.
Trying to do the same thing in WPF, well, give strange result a small Google Earth screen placed anywhere in the form an not inside the User C... | Running Google Earth inside a WPF application can be a bit tricky since WPF and Windows Forms have different rendering models. Here’s a way to achieve this using Windows Forms Host in WPF. You'll be using the `WindowsFormsHost` control to host the Windows Forms control that embeds Google Earth.
1. **Add References**: ... | 44,980 | [
{
"from": "human",
"value": "I’m trying to run Google earth inside WPF but I don’t know how. Basically I have managed to run Google Earth in a Windows Form Control inside a Windows Form, everything was OK. \nTrying to do the same thing in WPF, well, give strange result a small Google Earth screen placed any... |
Given a data structure (e.g. a hash of hashes), what's the clean/recommended way to make a deep copy for immediate use? Assume reasonable cases, where the data's not particularly large, no complicated cycles exist, and readability/maintainability/etc. are more important than speed at all costs.
I know that I can use St... | When it comes to making a deep copy of data structures in Perl, especially when you prioritize readability and maintainability over performance, the recommended approach often involves using the `Storable` module. `Storable` provides a straightforward way to serialize and deserialize data structures, which effectively ... | 48,990 | [
{
"from": "human",
"value": "Given a data structure (e.g. a hash of hashes), what's the clean/recommended way to make a deep copy for immediate use? Assume reasonable cases, where the data's not particularly large, no complicated cycles exist, and readability/maintainability/etc. are more important than spe... |
I have the function
sublist(_,[_],_) :-
!.
sublist(X,[Y|T],Z) :-
R is X - Y,
sublist(X,T,[R|Z]).
an example call is sublist(2,[1,2,3],Z).
At the end of execution it just gives me 'yes', but i'd like to see the contents of Z.
I know it's something simple as i have other instructions that do similar things, ... | The issue you're encountering in your Prolog code is that the variable `Z` is not being unified with a final value after executing the `sublist/3` predicate. Instead, you're just getting the `yes` response, which means the predicate succeeded but didn't produce a meaningful output.
To get the contents of `Z`, you can ... | 49,289 | [
{
"from": "human",
"value": "I have the function\nsublist(_,[_],_) :-\n !.\nsublist(X,[Y|T],Z) :-\n R is X - Y,\n sublist(X,T,[R|Z]).\n\nan example call is sublist(2,[1,2,3],Z).\nAt the end of execution it just gives me 'yes', but i'd like to see the contents of Z.\nI know it's something simple as ... |
I am trying to create an upload control for ASP.NET MVC with jQuery progress bar. In ASP.NET the implementation works no problems, but in MVC the problem is that the server doesn't respond to my callbacks until the file is uploaded.
The upload control is based on html file upload element, and I cannot for the life of m... | To create an upload control for ASP.NET MVC that provides a jQuery progress bar, you can achieve a smoother user experience by using AJAX to upload files. The typical issue you're encountering—where the server does not respond to callbacks until the file upload is complete—occurs because the page is being refreshed or ... | 40,621 | [
{
"from": "human",
"value": "I am trying to create an upload control for ASP.NET MVC with jQuery progress bar. In ASP.NET the implementation works no problems, but in MVC the problem is that the server doesn't respond to my callbacks until the file is uploaded.\nThe upload control is based on html file uplo... |
I've got a few Unix shell scripts where I need to check that certain environment variables are set before I start doing stuff, so I do this sort of thing:
if [ -z "$STATE" ]; then
echo "Need to set STATE"
exit 1
fi
if [ -z "$DEST" ]; then
echo "Need to set DEST"
exit 1
fi
which is a lot of typing. I... | You can certainly streamline the checks for multiple environment variables in your Unix shell scripts by using a function or a loop. Here are a couple of approaches you can consider:
### Option 1: Using a Function
You can define a function that checks if each required environment variable is set:
```bash
check_env_v... | 48,132 | [
{
"from": "human",
"value": "I've got a few Unix shell scripts where I need to check that certain environment variables are set before I start doing stuff, so I do this sort of thing:\nif [ -z \"$STATE\" ]; then\n echo \"Need to set STATE\"\n exit 1\nfi \n\nif [ -z \"$DEST\" ]; then\n echo \"Need ... |
Does anybody know if there is a color theme like the TextMate Dawn theme, for Emacs ? I simply don't like the way the fonts look on my dark emacs theme and I am not sure if it's emacs's fault or just the theme.
Here's a comparison:
http://mixandgo.com/emacs_textmate.png
Thanks,
Cezar
| Yes, there are several Emacs themes that can provide a similar look and feel to the TextMate Dawn theme. Here are a few suggestions you can try:
1. **Dawn Theme**: Some Emacs themes are directly inspired by TextMate themes. You might find a package that specifically replicates the Dawn theme. You can search for `dawn-... | 46,150 | [
{
"from": "human",
"value": "Does anybody know if there is a color theme like the TextMate Dawn theme, for Emacs ? I simply don't like the way the fonts look on my dark emacs theme and I am not sure if it's emacs's fault or just the theme.\nHere's a comparison:\nhttp://mixandgo.com/emacs_textmate.png\nThank... |
Microsoft Visual Studio (2005 and 2008) seems to have fun shuffling the Project IDs (GUIDs) around each time we do a little change in a solution. We found that this little detail leads to frustration each time someone has to merge branches in Source control...
We though about coding a little tool to sort those Project ... | Unfortunately, there isn’t a built-in feature in Visual Studio 2005 or 2008 that automatically maintains consistent GUIDs (Project IDs) across solution files and project files. Visual Studio generates GUIDs for projects when they are created, and these can change when projects are modified or if they are reloaded in ce... | 46,170 | [
{
"from": "human",
"value": "Microsoft Visual Studio (2005 and 2008) seems to have fun shuffling the Project IDs (GUIDs) around each time we do a little change in a solution. We found that this little detail leads to frustration each time someone has to merge branches in Source control...\nWe though about c... |
If I have two UIColors, what's the best way to draw an even gradient between them over an arbitrarily-sized area?
I am guessing you would create a UIView subclass and use the CG drawing methods in the drawRect method. I just don't know which ones, or if there are any pitfalls to watch out for, like performance. Has any... | Creating a gradient between two `UIColor` instances in a UIView subclass is a common task in iOS development. The most efficient way to achieve this is by using Core Graphics to draw a linear gradient in the `drawRect(_:)` method. Here's a step-by-step guide on how to implement this.
### Step 1: Subclass UIView
Creat... | 40,595 | [
{
"from": "human",
"value": "If I have two UIColors, what's the best way to draw an even gradient between them over an arbitrarily-sized area?\nI am guessing you would create a UIView subclass and use the CG drawing methods in the drawRect method. I just don't know which ones, or if there are any pitfalls t... |
I need to play .vox files on my web page. Does anyone have any tips on how to play .vox files using the Silverlight Mediaplayer control?
| Playing .vox files directly using the Silverlight Media Player control can be a bit challenging, as Silverlight primarily supports common formats like MP3 and WMV. However, if you still want to attempt playing .vox files, here are some general tips:
1. **Convert .vox to Supported Format**: The best way to handle .vox ... | 38,541 | [
{
"from": "human",
"value": "I need to play .vox files on my web page. Does anyone have any tips on how to play .vox files using the Silverlight Mediaplayer control?\n"
},
{
"from": "gpt",
"value": "Playing .vox files directly using the Silverlight Media Player control can be a bit challenging,... |
I have a table which has roughly 10 cells, 4 different types. I subclassed UITextViewCell because I wanted to have an IBOutlet to a label and to a UITextField. Not sure if that was the best way of handling it, but it works thus far. Next, I had a cell for gender, so I figured instead of subclassing UITableViewCell, I t... | Your current approach demonstrates an effort to manage different types of cells within a `UITableView`, but there are more efficient and organized ways to handle complex cell designs without the need to create multiple subclasses for each type of cell.
### Concerns with Your Current Approach:
1. **Subclassing**: While... | 47,228 | [
{
"from": "human",
"value": "I have a table which has roughly 10 cells, 4 different types. I subclassed UITextViewCell because I wanted to have an IBOutlet to a label and to a UITextField. Not sure if that was the best way of handling it, but it works thus far. Next, I had a cell for gender, so I figured in... |
According to Apple's description, the aurioTouch sample app is suppose to "get the audio input and copy it to the output", which I think means that the app will playback/thru any sound the iPhone's mike picks up through the iPhone's speakers.
When I loaded the app onto my iPhone (updated to 2.2), however, the playthru ... | It sounds like you've already done some troubleshooting with the aurioTouch app, but there are a few additional steps you can take to try and resolve the issue with the audio playback:
1. **Restart the App**: Sometimes, simply quitting the app completely and then reopening it can fix issues. Make sure to fully close i... | 48,875 | [
{
"from": "human",
"value": "According to Apple's description, the aurioTouch sample app is suppose to \"get the audio input and copy it to the output\", which I think means that the app will playback/thru any sound the iPhone's mike picks up through the iPhone's speakers.\nWhen I loaded the app onto my iPh... |
What is the JSON (JavaScript Object Notation) format?
| JSON (JavaScript Object Notation) is a lightweight data interchange format that is easy for humans to read and write and easy for machines to parse and generate. It is often used to transmit data between a server and a web application as text.
### Key Features of JSON:
1. **Text-Based Format**: JSON is a text format ... | 45,750 | [
{
"from": "human",
"value": "What is the JSON (JavaScript Object Notation) format?\n"
},
{
"from": "gpt",
"value": "JSON (JavaScript Object Notation) is a lightweight data interchange format that is easy for humans to read and write and easy for machines to parse and generate. It is often used t... |
I'm writing small and very DRY framework, which heavily relies on metadata. I'd like to know if there is a way to obtain method parameter names, i.e. given some method
public void a(int myIntParam, String theString) { ... }
get the strings "myIntParam" and "theString".
I know I could annotate parameters, but that woul... | In Java, obtaining the names of method parameters at runtime can be done using reflection, but there are a few caveats. By default, the Java compiler does not retain the names of method parameters in the compiled bytecode unless you enable a specific flag. Here’s how you can achieve this:
1. **Compile with the `-param... | 47,850 | [
{
"from": "human",
"value": "I'm writing small and very DRY framework, which heavily relies on metadata. I'd like to know if there is a way to obtain method parameter names, i.e. given some method\npublic void a(int myIntParam, String theString) { ... }\n\nget the strings \"myIntParam\" and \"theString\".\n... |
In python, is there a difference between calling clear() and assigning {} to a dictionary? If yes, what is it?
Example:d = {"stuff":"things"}
d.clear() #this way
d = {} #vs this way
| Yes, there is a significant difference between using `clear()` and assigning `{}` to a dictionary in Python. Here's a breakdown of the differences:
### `d.clear()`
- The `clear()` method modifies the existing dictionary in place, removing all its items.
- The original dictionary `d` still exists, and any references to... | 48,155 | [
{
"from": "human",
"value": "In python, is there a difference between calling clear() and assigning {} to a dictionary? If yes, what is it?\nExample:d = {\"stuff\":\"things\"}\nd.clear() #this way\nd = {} #vs this way\n\n"
},
{
"from": "gpt",
"value": "Yes, there is a significant differen... |
I have a table that represents a series of matches between ids from another table as follows:
CREATE TABLE #matches (
asid1 int,
asid2 int
)
insert into #matches values (1,2)
insert into #matches values (1,3)
insert into #matches values (3,1)
insert into #matches values (3,4)
insert into #matches values (7,6)
inse... | You can indeed use a recursive Common Table Expression (CTE) to find connected components in your match table. This will allow you to traverse through the relationships and find all matches that are linked directly or indirectly.
Here's a SQL solution using a recursive CTE to achieve the desired output:
```sql
WITH R... | 47,624 | [
{
"from": "human",
"value": "I have a table that represents a series of matches between ids from another table as follows:\nCREATE TABLE #matches (\n asid1 int,\n asid2 int\n)\n\ninsert into #matches values (1,2)\ninsert into #matches values (1,3)\ninsert into #matches values (3,1)\ninsert into #matches v... |
The project I am working on were are trying to come up with a solution for having the database and code be agile and be able to be built and deployed together.
Since the application is a combination of code plus the database schema, and database code tables, you can not truly have a full build of the application unless... | Based on your requirements and constraints, it sounds like you're aiming to achieve a synchronized agile development process that effectively integrates database changes with code changes in a legacy application. Here are some strategies and best practices to address your challenges:
### 1. Version Control for Databas... | 44,923 | [
{
"from": "human",
"value": "The project I am working on were are trying to come up with a solution for having the database and code be agile and be able to be built and deployed together.\nSince the application is a combination of code plus the database schema, and database code tables, you can not truly h... |
We have a client/server application that consists of multiple EXEs. The data access layer is on the same physical tier as the client in a library shared by our EXE modules. ODBC and OleDB connection pools are managed per-process; are there techniques for sharing DB connections across processes (other than moving the da... | Sharing database connections across processes in a client/server application can be challenging, especially when each process maintains its own ODBC or OleDB connection pools. However, there are a few techniques that can be explored to share database connections without moving the data access layer to a middle tier:
#... | 45,397 | [
{
"from": "human",
"value": "We have a client/server application that consists of multiple EXEs. The data access layer is on the same physical tier as the client in a library shared by our EXE modules. ODBC and OleDB connection pools are managed per-process; are there techniques for sharing DB connections a... |
I would like to use Exchange e-mail groups as an authentication scheme for an internal app. IE, if a user is in a certain mailing group, they are allowed in.
Any pointers on where to look for information with talking with Exchange from .NET?
EDIT: Exchange 2003.
| To authenticate users against Exchange 2003 email groups in your internal application, you can use the Exchange Web Services (EWS) API or the Active Directory Services Interface (ADSI) to query group membership. Since Exchange 2003 primarily utilizes Active Directory for authentication and group management, interacting... | 41,712 | [
{
"from": "human",
"value": "I would like to use Exchange e-mail groups as an authentication scheme for an internal app. IE, if a user is in a certain mailing group, they are allowed in.\nAny pointers on where to look for information with talking with Exchange from .NET?\nEDIT: Exchange 2003.\n"
},
{
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.