instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I would like to know How to create a fps-game with SDL lib?
Are there any books that explain with examples?
| Creating a first-person shooter (FPS) game using the Simple DirectMedia Layer (SDL) library is an exciting project! SDL is a versatile library that provides low-level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. Here are some steps you can follow to get started, along with ... | 44,398 | [
{
"from": "human",
"value": "I would like to know How to create a fps-game with SDL lib? \nAre there any books that explain with examples? \n"
},
{
"from": "gpt",
"value": "Creating a first-person shooter (FPS) game using the Simple DirectMedia Layer (SDL) library is an exciting project! SDL is ... |
I've worked on a couple of projects where we spent a great deal of time discussing and writing elaborate coding standards covering everything from syntax layout to actual best practices. However, I have also found that these are rarely followed to the full extent. Many developers seem to hesitate to reject a code revie... | Coding standards are an essential part of maintaining a codebase, especially in collaborative environments. Here’s how many organizations approach coding standards, the challenges they face, and the perceived benefits:
### 1. **Coding Standards Existence and Content**
Most organizations do have coding standards that c... | 48,559 | [
{
"from": "human",
"value": "I've worked on a couple of projects where we spent a great deal of time discussing and writing elaborate coding standards covering everything from syntax layout to actual best practices. However, I have also found that these are rarely followed to the full extent. Many developer... |
I don't even know if I'm using the correct terms but here goes:
Is there a way to map the tables and their relations in a SQL Server to domain (C# code) automatically, by means of a tool or something?
I've used the nhibernate plugin, but it creates a file in .cs and another in xml, that has the mapping, but I want that... | You're looking for a way to map SQL Server tables to C# domain classes with their relationships expressed as properties in a single C# file, preferably using an automated tool. There are several approaches you can consider, including Entity Framework (EF) or some other ORM (Object-Relational Mapping) solutions. Here ar... | 43,886 | [
{
"from": "human",
"value": "I don't even know if I'm using the correct terms but here goes:\nIs there a way to map the tables and their relations in a SQL Server to domain (C# code) automatically, by means of a tool or something?\nI've used the nhibernate plugin, but it creates a file in .cs and another in... |
I need to check all of my asp code to prevent SQL injection.
Should I check the session object, too?
How might a session be hijacked?
Thank you!!
| Yes, when you're checking your ASP code for vulnerabilities to SQL injection, it's also important to consider the session management aspects of your application. Although the session object itself is not directly subject to SQL injection attacks, weaknesses in session management can lead to session hijacking, which can... | 46,986 | [
{
"from": "human",
"value": "I need to check all of my asp code to prevent SQL injection.\nShould I check the session object, too?\nHow might a session be hijacked?\nThank you!!\n"
},
{
"from": "gpt",
"value": "Yes, when you're checking your ASP code for vulnerabilities to SQL injection, it's al... |
I've been exploring the details of Django for about a week now and like what I see. However I've come upon some.. negativity in relation to fine-grained control of permissions to the CRUD interface.
What I'm writing is an Intranet client management web-app. The organisation is about 6 tiers, and I need to restrict acce... | Django's built-in authentication and permission system provides a robust foundation for managing access control, and it can be extended to meet your specific requirements, including fine-grained control over permissions in the admin interface. Based on your use case, here's how you can approach it:
### Customizing Per... | 40,733 | [
{
"from": "human",
"value": "I've been exploring the details of Django for about a week now and like what I see. However I've come upon some.. negativity in relation to fine-grained control of permissions to the CRUD interface.\nWhat I'm writing is an Intranet client management web-app. The organisation is ... |
I have an external DLL whose source code is C#. From the documentation for the DLL, I determined that it writes its debug messages to the console using Console.WriteLine.
I'd like to use this DLL within a WinForms application. However, what I have discovered is that I cannot see the debug messages emitted by the DLL si... | Yes, you can capture the output of the `Console.WriteLine` calls from a DLL used in a WinForms application, even though a WinForms application does not have a console by default. Here’s how you can achieve this:
### Method 1: Redirect Console Output to a TextWriter
You can redirect the standard output (stdout) to a `... | 47,492 | [
{
"from": "human",
"value": "I have an external DLL whose source code is C#. From the documentation for the DLL, I determined that it writes its debug messages to the console using Console.WriteLine.\nI'd like to use this DLL within a WinForms application. However, what I have discovered is that I cannot se... |
I'm trying to see if anyone knows how to cluster some Lat/Long results, using a database, to reduce the number of results sent over the wire to the application.
There are a number of resources about how to cluster, either on the client side OR in the server (application) side .. but not in the database side :(
This is ... | Clustering geographical coordinates (latitude and longitude) within a database can be achieved using SQL, especially if you're using a system like SQL Server 2008, which provides spatial features. Here's a general approach to achieve clustering of geographic points within a specified radius (e.g., 1 mile or 1 km) using... | 47,571 | [
{
"from": "human",
"value": "I'm trying to see if anyone knows how to cluster some Lat/Long results, using a database, to reduce the number of results sent over the wire to the application.\nThere are a number of resources about how to cluster, either on the client side OR in the server (application) side .... |
Just playing with dom4j, excellent. I was a PHP developer for a year and half, just got a new job and started playing around with Jython now I have spare time, its a great language. Was thinking about trying to add a element in between element, example below:
<div id="content">
<p>Some text in here</p>
<!--New... | Yes, you can use the DOM manipulation capabilities provided by libraries like dom4j or others that work with the XML/HTML structure directly. In your case, since you're using Jython, you can utilize libraries such as `xml.etree.ElementTree` or `lxml` for XML/HTML manipulations, as these libraries allow for modifying th... | 41,274 | [
{
"from": "human",
"value": "Just playing with dom4j, excellent. I was a PHP developer for a year and half, just got a new job and started playing around with Jython now I have spare time, its a great language. Was thinking about trying to add a element in between element, example below:\n<div id=\"content... |
I learned that by trying to use the tablesorter plug in from jquery the table needs to use the < thead> and
< tbody> tags. I am using an html table, and I use the runat="server" attribute because I need to bind data to the table on the server side. but by using the runat= server attribute the code is rendered in a dif... | When using ASP.NET Web Forms (which is what you're doing with the `runat="server"` attribute), the rendering of server controls can sometimes differ from standard HTML. If you want to ensure that your table includes the `<thead>` and `<tbody>` tags, you can define the table structure using server-side controls like `Gr... | 47,440 | [
{
"from": "human",
"value": "I learned that by trying to use the tablesorter plug in from jquery the table needs to use the < thead> and\n< tbody> tags. I am using an html table, and I use the runat=\"server\" attribute because I need to bind data to the table on the server side. but by using the runat= se... |
I'm working on an extension (BHO) for Internet Explorer, and having trouble attaching a .NET delegate to the mshtml objects to catch DOM events.
I've tried using the events published by the IHTMLElementEvents2_Event, ... interfaces, and that works, but only if I specify the correct type for the DOM element whose events... | Attaching event handlers to DOM elements in Internet Explorer (IE) using .NET can be challenging, especially when you're trying to handle a wide range of events without needing to specify the types of each DOM element. Here are some strategies you can consider to simplify the process:
### 1. Use Event Delegation
Inst... | 46,717 | [
{
"from": "human",
"value": "I'm working on an extension (BHO) for Internet Explorer, and having trouble attaching a .NET delegate to the mshtml objects to catch DOM events.\nI've tried using the events published by the IHTMLElementEvents2_Event, ... interfaces, and that works, but only if I specify the cor... |
In my Rails app, I have a form which redirects through a foreign service, Amazon FPS. The form POSTs to an action in my app which redirects to Amazon, who collect information and then redirect back to my app.
I'm testing this workflow with Webrat. Obviously I can't test Amazon, so I want to check that the redirection... | To achieve the desired behavior of testing the redirection to an external service (like Amazon FPS) without actually following through to that external domain, you can use a combination of Webrat's built-in features and some custom stubbing. Here's a way to simulate the redirection and test your workflow without hittin... | 47,884 | [
{
"from": "human",
"value": "In my Rails app, I have a form which redirects through a foreign service, Amazon FPS. The form POSTs to an action in my app which redirects to Amazon, who collect information and then redirect back to my app.\nI'm testing this workflow with Webrat. Obviously I can't test Amazo... |
Our application uses ODBC to communicate with a database (Both DB2 and Oracle, if it makes a difference), and delegates business logic to Java by way of JNI (So it uses Java and C).
What I'd like to know is what tools / software / libraries are needed to allow the business logic (Java/JDBC) and the application framewor... | To implement a two-phase commit protocol (2PC) in a system where you have both C (with ODBC for database communication) and Java (using JDBC for business logic), you need to manage distributed transactions carefully, ensuring that both the database operations and the Java components can participate in a coordinated tra... | 48,766 | [
{
"from": "human",
"value": "Our application uses ODBC to communicate with a database (Both DB2 and Oracle, if it makes a difference), and delegates business logic to Java by way of JNI (So it uses Java and C).\nWhat I'd like to know is what tools / software / libraries are needed to allow the business logi... |
I'm working with a Java program that has multiple components (with Eclipse & Ant at the moment).
Is there some way to start multiple programs with one launch configuration? I have an Ant target that does the job (launches multiple programs) but there are things I would like to do:
I would like to debug the programs ... | Launching multiple Java programs with separate console outputs and debugging capabilities in Eclipse can be a bit tricky, as Eclipse doesn't natively support running multiple launch configurations in one go with separate consoles. However, there are a few approaches you can take to achieve your goals.
### Approach 1: ... | 48,895 | [
{
"from": "human",
"value": "I'm working with a Java program that has multiple components (with Eclipse & Ant at the moment). \nIs there some way to start multiple programs with one launch configuration? I have an Ant target that does the job (launches multiple programs) but there are things I would like to... |
What is the Entity Framework pipeline like?
What gets translated to SQL, Expression Trees or ESQL, or both?
Is ESQL something an Entity Framework provider needs to implement or translate, or that the framework takes care of?
| The Entity Framework (EF) pipeline is a series of stages that an operation goes through from the moment a request is made to retrieve or manipulate data until the final SQL commands are sent to the database. Here’s a general overview of the EF pipeline:
### EF Pipeline Overview
1. **Query Creation**: When you write a... | 48,166 | [
{
"from": "human",
"value": "What is the Entity Framework pipeline like?\nWhat gets translated to SQL, Expression Trees or ESQL, or both?\nIs ESQL something an Entity Framework provider needs to implement or translate, or that the framework takes care of?\n"
},
{
"from": "gpt",
"value": "The Ent... |
Is there a way to configure the directory where all the configuration files are stored by IntelliJ IDEA (version 8.0.1)?
By default, these files are stored in %home%\.IntelliJIdea80... (or .IdeaIC12 etc.), but I want to define another location...
| In IntelliJ IDEA, particularly in version 8.0.1, there isn't a built-in way to change the default directory for configuration files directly from the IDE. However, you can manually set the configuration directory by using system properties when starting the IDE.
Here’s how you can change the configuration directory:
... | 49,278 | [
{
"from": "human",
"value": "Is there a way to configure the directory where all the configuration files are stored by IntelliJ IDEA (version 8.0.1)?\nBy default, these files are stored in %home%\\.IntelliJIdea80... (or .IdeaIC12 etc.), but I want to define another location...\n"
},
{
"from": "gpt",... |
I want to connect to DB using the iSeries Client Access driver. I use the following connection string:
DRIVER=Client Access ODBC Driver (32-bit);QUERYTIMEOUT=0;PKG=QGPL/DEFAULT(IBM),2,0,1,0,512;LANGUAGEID=ENU;DFTPKGLIB=QGPL;DBQ=QGPL
XXXXXXXX;SYSTEM=XXX.XXXXXXX.XXX;Signon=2
I get an exception when connecting:
ERROR [28... | The error message you are encountering indicates that the credentials (User ID and password) required to connect to the database are not being supplied correctly. In your connection string, there are no User ID or password parameters specified, which is likely causing the issue. Additionally, if you want the applicatio... | 48,358 | [
{
"from": "human",
"value": "I want to connect to DB using the iSeries Client Access driver. I use the following connection string:\nDRIVER=Client Access ODBC Driver (32-bit);QUERYTIMEOUT=0;PKG=QGPL/DEFAULT(IBM),2,0,1,0,512;LANGUAGEID=ENU;DFTPKGLIB=QGPL;DBQ=QGPL \nXXXXXXXX;SYSTEM=XXX.XXXXXXX.XXX;Signon=2\nI... |
I'm trying to digitally sign a PDF file using THIS project as an example.
When it executes st.Close(); I am getting the infamous "Object reference not set to instance of an object".
I have no idea of why this is happening, st is an instance of an object and it is used above. This exception is happening inside .Close() ... | The issue you're facing where `st.Close()` results in an "Object reference not set to an instance of an object" exception typically indicates that something within the `st` object (which is an instance of `PdfStamper`) is null or not initialized correctly.
Here are a few potential causes and steps you can take to trou... | 48,779 | [
{
"from": "human",
"value": "I'm trying to digitally sign a PDF file using THIS project as an example.\nWhen it executes st.Close(); I am getting the infamous \"Object reference not set to instance of an object\".\nI have no idea of why this is happening, st is an instance of an object and it is used above.... |
I have a bunch of objects in my application (Organisations, Individuals, Orders, etC) and I need a nice clean way to decide which users can and can't view/edit these objects. User have a range of permissions such as 'Can edit own contacts' and 'Can view team's contacts' and can also be members of groups such as 'Accoun... | Moving security and permission logic out of your application’s core business logic and into dedicated classes (like `OrganisationSecurity`, `OrderSecurity`, etc.) is a good design decision for several reasons:
1. **Separation of Concerns**: This helps you adhere to the Single Responsibility Principle. Each security cl... | 46,014 | [
{
"from": "human",
"value": "I have a bunch of objects in my application (Organisations, Individuals, Orders, etC) and I need a nice clean way to decide which users can and can't view/edit these objects. User have a range of permissions such as 'Can edit own contacts' and 'Can view team's contacts' and can ... |
I'm looking for something containing similar functions to Matlab’s financial and financial derivatives toolbox but don’t have the cash to spend on matlab. I would appreciate any info on free or open source libraries or programs that will let me easily calculate interest rates, risk etc.
| There are several free or open-source alternatives to MATLAB that can help you perform financial calculations, including those related to interest rates and risk management. Here are a few options:
### 1. **Python with Libraries**
Python is a powerful programming language that has a wide array of libraries suitable fo... | 47,536 | [
{
"from": "human",
"value": "I'm looking for something containing similar functions to Matlab’s financial and financial derivatives toolbox but don’t have the cash to spend on matlab. I would appreciate any info on free or open source libraries or programs that will let me easily calculate interest rates, r... |
I come from classes object orientation languages and recently I have been learning those fancy dynamic languages (JavaScript, Python and Lua) and I want some tips about how to use OO in those languages. It would be useful to know the pitfalls and the shortcomings of such approach and the advantages compared to traditio... | Transitioning from traditional class-based object-oriented programming (OOP) languages to dynamic, prototype-based languages like JavaScript and Lua can be both exciting and challenging. Here’s a breakdown of the strengths, weaknesses, and peculiarities of using object-oriented programming in these dynamic environments... | 48,061 | [
{
"from": "human",
"value": "I come from classes object orientation languages and recently I have been learning those fancy dynamic languages (JavaScript, Python and Lua) and I want some tips about how to use OO in those languages. It would be useful to know the pitfalls and the shortcomings of such approac... |
Has anyone ever had code in Python, that turned out not to perform fast enough?
I mean, you were forced to choose another language because of it?
We are investigating using Python for a couple of larger projects, and my feeling is that in most cases, Python is plenty fast enough for most scenarios (compared to say, Jav... | Yes, there have been various instances where developers initially chose Python for a project but later switched to a different language due to performance issues. While Python is often praised for its ease of use, readability, and rich ecosystem of libraries, it does have limitations when it comes to raw performance, e... | 48,789 | [
{
"from": "human",
"value": "Has anyone ever had code in Python, that turned out not to perform fast enough?\nI mean, you were forced to choose another language because of it?\nWe are investigating using Python for a couple of larger projects, and my feeling is that in most cases, Python is plenty fast enou... |
Failed to create component 'User Control 1'. the error message follows:
'System.NullReferenceException : Object reference not set to an instance of an object.
at System.ComponentModel.ReflectPropertyDescriptor.SetValue(Object Component, Object Value)
.............. etc..........
What should I do to fix this erro... | The error message you're encountering indicates that a `NullReferenceException` is occurring when trying to set a value on a property of a component in a user control. This generally means that the code is trying to access an object that hasn't been instantiated (i.e., it is `null`). Here are several steps you can take... | 45,171 | [
{
"from": "human",
"value": "Failed to create component 'User Control 1'. the error message follows:\n\n'System.NullReferenceException : Object reference not set to an instance of an object.\n at System.ComponentModel.ReflectPropertyDescriptor.SetValue(Object Component, Object Value)\n .............. etc... |
What is a simple way of downloading a file from a URL path?
| A simple way to download a file from a URL in Python is to use the built-in `urllib` library or the `requests` library. Here are examples using both methods:
### Using `urllib`:
```python
import urllib.request
url = 'http://example.com/file.txt' # Replace with your URL
filename = 'downloaded_file.txt' # Desired na... | 49,894 | [
{
"from": "human",
"value": "What is a simple way of downloading a file from a URL path?\n"
},
{
"from": "gpt",
"value": "A simple way to download a file from a URL in Python is to use the built-in `urllib` library or the `requests` library. Here are examples using both methods:\n\n### Using `ur... |
I have a Maven pom that uses <packaging>war</packaging>. But actually, I don't want build the war-file, I just want all the dependent jars collected and a full deployment directory created.
So I'm running the war:exploded goal to generate the deploy directory:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
... | To avoid building a WAR file while still using `<packaging>war</packaging>` in your Maven project, you have a couple of options:
### Option 1: Use the `maven-war-plugin` with the `skip` configuration
You can configure the `maven-war-plugin` to skip the WAR file generation entirely by using the `skip` property. Add thi... | 45,401 | [
{
"from": "human",
"value": "I have a Maven pom that uses <packaging>war</packaging>. But actually, I don't want build the war-file, I just want all the dependent jars collected and a full deployment directory created.\nSo I'm running the war:exploded goal to generate the deploy directory:\n<plugin>\n <... |
Given an array of items, each of which has a value and cost, what's the best algorithm determine the items required to reach a minimum value at the minimum cost? eg:
Item: Value -> Cost
-------------------
A 20 -> 11
B 7 -> 5
C 1 -> 2
MinValue = 30
naive solution: A + B + C + C + C. Value: 30, Cost... | The problem you've described is a variation of the "Knapsack problem" or the "Unbounded Knapsack problem," where you want to select items to reach a minimum value while minimizing the total cost. Since items can be used multiple times, this is specifically similar to the unbounded version.
Here's a dynamic programming... | 49,140 | [
{
"from": "human",
"value": "Given an array of items, each of which has a value and cost, what's the best algorithm determine the items required to reach a minimum value at the minimum cost? eg:\nItem: Value -> Cost\n-------------------\nA 20 -> 11\nB 7 -> 5\nC 1 -> 2\n\nMinValue = 30\nn... |
I have an application where I would like to have mixed Java and Scala source (actually its migrating a java app to scala - but a bit at a time).
I can make this work in IDEs just fine, very nice. But I am not sure how to do this with maven - scalac can compile java and scala intertwined, but how to I set up maven for ... | To set up a mixed Java and Scala project with Maven, you'll want to use the Scala Maven Plugin which allows you to compile both Java and Scala source files. Here’s how you can configure your Maven project to support mixed source files.
### Project Structure
You can keep your Java and Scala source files in separate fo... | 40,474 | [
{
"from": "human",
"value": "I have an application where I would like to have mixed Java and Scala source (actually its migrating a java app to scala - but a bit at a time). \nI can make this work in IDEs just fine, very nice. But I am not sure how to do this with maven - scalac can compile java and scala i... |
Today I ran into a problem were I needed to remote-debug a program. The program was launched from another system, so I really don't have an opportunity to interact with it on the command line. I could change its source easily though.
What I needed to happen was for the program to start normally, and then wait for me ... | To allow a .NET/C# program to wait for a debugger to attach before proceeding, you can use the `Debugger` class from the `System.Diagnostics` namespace. Specifically, you can call `Debugger.Launch()` or `Debugger.Break()`, which will effectively pause the program and allow you to attach a debugger.
Here's how you can ... | 49,442 | [
{
"from": "human",
"value": "Today I ran into a problem were I needed to remote-debug a program. The program was launched from another system, so I really don't have an opportunity to interact with it on the command line. I could change its source easily though.\nWhat I needed to happen was for the progra... |
I'm using VS 2008 to create a C++ DLL (not managed) project and I need convert a char* to a long long type. Is there an easy way to do it?
Thanks in advance :)
| Yes, you can easily convert a `char*` to a `long long` in C++ by using the `std::strtoll` function, which is part of the C standard library. This function converts a string to a long long integer and handles various bases (like decimal, hexadecimal, etc.). Here’s how you can do it:
```cpp
#include <cstdlib> // For str... | 47,971 | [
{
"from": "human",
"value": "I'm using VS 2008 to create a C++ DLL (not managed) project and I need convert a char* to a long long type. Is there an easy way to do it?\nThanks in advance :)\n"
},
{
"from": "gpt",
"value": "Yes, you can easily convert a `char*` to a `long long` in C++ by using th... |
Is there a way to do gradients in css/html/javascript only that will work across all the major browsers? (MS IE 5+, Firefox, Opera, Safari)?
Edit: I would like to do this for backgrounds (header, main panel, side panels). Also, would like to have vertical line gradients as well.
Edit: after reading the responses, let's... | Yes, you can achieve cross-browser gradients using CSS, but support varies by browser and version, especially with older versions of Internet Explorer. Below, I will provide methods for both CSS and JavaScript to create gradients that work across major browsers.
### CSS Gradients
CSS gradients are widely supported in... | 46,436 | [
{
"from": "human",
"value": "Is there a way to do gradients in css/html/javascript only that will work across all the major browsers? (MS IE 5+, Firefox, Opera, Safari)?\nEdit: I would like to do this for backgrounds (header, main panel, side panels). Also, would like to have vertical line gradients as well... |
I have a function which launches a javascript window, like this
function genericPop(strLink, strName, iWidth, iHeight) {
var parameterList = "location=0,directories=0,status=0,menubar=0,resizable=no, scrollbars=no,toolbar=0,maximize=0,width=" + iWidth + ", height=" + iHeight;
var new_window=... | Refactoring your existing JavaScript function to use a DHTML modal pop-up instead of a new window can indeed be done in a way that maintains the function signature and avoids any changes to your current HTML or CSS. The following example demonstrates how you can implement a simple modal pop-up.
### Step 1: Create the... | 45,269 | [
{
"from": "human",
"value": "I have a function which launches a javascript window, like this\n function genericPop(strLink, strName, iWidth, iHeight) {\n var parameterList = \"location=0,directories=0,status=0,menubar=0,resizable=no, scrollbars=no,toolbar=0,maximize=0,width=\" + iWidth + \", h... |
I don't want to discuss the merits of this approach, just if it is possible. I believe the answer to be "no". But maybe someone will surprise me!
Imagine you have a core widget class. It has a method calculateHeight(), that returns a height. The height is too big - this result in buttons (say) that are too big. You can... | Based on the constraints you've outlined (you cannot change the factory class, and you want to avoid copy-pasting its implementation), there are a few potential approaches you might consider. However, it's essential to note that none of these might be as straightforward as monkey patching in dynamically typed languages... | 47,670 | [
{
"from": "human",
"value": "I don't want to discuss the merits of this approach, just if it is possible. I believe the answer to be \"no\". But maybe someone will surprise me!\nImagine you have a core widget class. It has a method calculateHeight(), that returns a height. The height is too big - this resul... |
I want to know how to simply publish over http = much like Mercurial's hg serve! On the Windows/work box do this:
git serve
and then on the Linux box SIMPLY go:
git clone http://project project
finished.
| To serve a Git repository over HTTP in a manner similar to how Mercurial's `hg serve` works, you can use Python's built-in HTTP server or the built-in functionality of Git itself. Here’s how you can achieve this on a Windows machine and clone it from a Linux box.
### Step 1: Setup a Git Repository
First, ensure you h... | 48,554 | [
{
"from": "human",
"value": "I want to know how to simply publish over http = much like Mercurial's hg serve! On the Windows/work box do this:\ngit serve \n\nand then on the Linux box SIMPLY go:\ngit clone http://project project \n\nfinished. \n"
},
{
"from": "gpt",
"value": "To serve a Git repo... |
Looking for advice (perhaps best practice).
We have a MS Word document (Office 2007) that we are extracting text from a cell.
We can use the following:
string text = wordTable.cell(tablerow.index, 1).Range.Text;
The text is extracted; however we seem to get extra characters trailing, for example \r\a.
Now we could add... | Your instinct to encapsulate the text-cleaning logic in a dedicated method is a good one. This approach adheres to best practices in software development, such as the Single Responsibility Principle and code maintainability. Here’s how you could structure your solution along with some additional recommendations:
### S... | 49,706 | [
{
"from": "human",
"value": "Looking for advice (perhaps best practice).\nWe have a MS Word document (Office 2007) that we are extracting text from a cell.\nWe can use the following:\nstring text = wordTable.cell(tablerow.index, 1).Range.Text;\n\nThe text is extracted; however we seem to get extra character... |
I have a website where all requests are redirected silently (via .htaccess) to index.php and then PHP is used to show the correct page (by parsing the REQUEST_URI).
I was wondering if it's possible to submit POST data to a fake address too?
I've currently got my form like so...
<form action="/send-mail" method="post">
... | To preserve POST data when using URL rewriting in `.htaccess`, you need to ensure that your rewriting rules don’t interfere with how POST requests are processed. When you rewrite a request to a different path (like from `/send-mail` to `index.php?send-mail`), Apache handles the request and passes the request body (the ... | 49,619 | [
{
"from": "human",
"value": "I have a website where all requests are redirected silently (via .htaccess) to index.php and then PHP is used to show the correct page (by parsing the REQUEST_URI).\nI was wondering if it's possible to submit POST data to a fake address too?\nI've currently got my form like so..... |
I have been trying for quite a while to figure out how to encrypt Application blocks that are stored in an external file called dev_entlib.config
I can see in entlib (4.1) that it's possible to use the default protection providers to encrypt the blocks but, I really need to deploy this Application on different servers ... | It sounds like you have taken many of the correct steps to set up a custom RSA Protected Configuration Provider and export/import your key container between servers. However, there are a few potential areas where things might be going wrong. Below are some troubleshooting steps and considerations that might help you re... | 47,278 | [
{
"from": "human",
"value": "I have been trying for quite a while to figure out how to encrypt Application blocks that are stored in an external file called dev_entlib.config\nI can see in entlib (4.1) that it's possible to use the default protection providers to encrypt the blocks but, I really need to dep... |
What is the easiest free method of encrypting my web traffic? I'd like to be able to log in to sites on my web server without sending my password in plaintext.
Edit: My web server is running on the LAMP stack , although it is a shared host so I don't have root.
| If you're looking to encrypt your web traffic to ensure your login credentials and other sensitive data are not sent in plaintext, using HTTPS (HTTP over SSL/TLS) is the most effective and widely adopted method. Here are the steps you can follow to enable HTTPS on your LAMP stack server, even on a shared host:
### 1. ... | 47,957 | [
{
"from": "human",
"value": "What is the easiest free method of encrypting my web traffic? I'd like to be able to log in to sites on my web server without sending my password in plaintext.\nEdit: My web server is running on the LAMP stack , although it is a shared host so I don't have root.\n"
},
{
... |
I'm working on an embedded device that does not support unaligned memory accesses.
For a video decoder I have to process pixels (one byte per pixel) in 8x8 pixel blocks. The device has some SIMD processing capabilities that allow me to work on 4 bytes in parallel.
The problem is, that the 8x8 pixel blocks aren't guara... | Given the constraints of your embedded device and the need for high performance, here are a few considerations that can guide your approach. Your initial ideas are valid, and I'll expand upon them while offering additional strategies that might also be effective.
### 1. **Alignment Handling with Scratch Memory**
Using... | 49,996 | [
{
"from": "human",
"value": "I'm working on an embedded device that does not support unaligned memory accesses. \nFor a video decoder I have to process pixels (one byte per pixel) in 8x8 pixel blocks. The device has some SIMD processing capabilities that allow me to work on 4 bytes in parallel.\nThe problem... |
I'm just playing around and I'm trying to grab information from websites. Unfortunately, with the following code:
import sys
import socket
import re
from urlparse import urlsplit
url = urlsplit(sys.argv[1])
sock = socket.socket()
sock.connect((url[0] + '://' + url[1],80))
path = url[2]
if not path:
path = '/'
p... | The issue you're encountering is related to how you're parsing the URL and attempting to connect to it. The `urlsplit` function breaks the URL into components, but you are not using them correctly when attempting to connect to the socket.
Here is a corrected version of your code. The main changes include:
1. Properly ... | 47,808 | [
{
"from": "human",
"value": "I'm just playing around and I'm trying to grab information from websites. Unfortunately, with the following code:\nimport sys\nimport socket\nimport re\nfrom urlparse import urlsplit\n\nurl = urlsplit(sys.argv[1])\n\n\nsock = socket.socket()\nsock.connect((url[0] + '://' + url[1... |
class Ball:
a = []
def __init__(self):
pass
def add(self,thing):
self.a.append(thing)
def size(self):
print len(self.a)
for i in range(3):
foo = Ball()
foo.add(1)
foo.add(2)
foo.size()
I would expect a return of :
2
2
2
But I get :
2
4
6
Why is this? I've found that by doing a=[] in th... | The behavior you're observing is due to how class variables and instance variables work in Python.
In your `Ball` class, `a` is defined as a class variable. This means that all instances of the `Ball` class share the same list `a`. When you create a new instance of `Ball`, it does not create a new list `a`; instead, i... | 49,911 | [
{
"from": "human",
"value": "class Ball:\n a = []\n def __init__(self):\n pass\n\n def add(self,thing):\n self.a.append(thing)\n\n def size(self):\n print len(self.a)\n\nfor i in range(3):\n foo = Ball()\n foo.add(1)\n foo.add(2)\n foo.size()\n\nI would expect a return of :\n2\n2\n2\n\nBut ... |
We offer a number of online services. We are required to develop a system which provides a quick/simple experience for users if they are transferred from one service (on domain1.com) to another service (on domain2.com).
Is there a safe and secure way to log a user in automatically once he has been transferred to the ne... | Your proposed solution has some security considerations that need to be addressed before it could be considered safe and secure. Here’s a breakdown of your approach and some suggestions:
### Security Concerns with Your Proposal:
1. **Hash Exposure**: If the hash is exposed (e.g., via logs, in URLs, etc.), it could pot... | 47,203 | [
{
"from": "human",
"value": "We offer a number of online services. We are required to develop a system which provides a quick/simple experience for users if they are transferred from one service (on domain1.com) to another service (on domain2.com).\nIs there a safe and secure way to log a user in automatica... |
What is the optimum number of projects in a Visual Studio 2008 solution?
We have one Visual Studio 2008 solution that is around 50 projects right now. It will likely continue to grow as the bulk of the projects within the solution consist of plugin assemblies for the main application.
If it seems like "too many projec... | The optimum number of projects in a Visual Studio solution can vary widely depending on multiple factors, including the complexity of your projects, team size, and the specific workflow your team follows. While there is no universally "correct" number of projects, here are some guidelines to help you decide how to stru... | 48,069 | [
{
"from": "human",
"value": "What is the optimum number of projects in a Visual Studio 2008 solution?\nWe have one Visual Studio 2008 solution that is around 50 projects right now. It will likely continue to grow as the bulk of the projects within the solution consist of plugin assemblies for the main appl... |
I would like to draw lines (of arbitrary position and length) onto a surface in pygame, which itself is an image loaded from a file on disk.
Can anyone point me to some example code that does this?
| Certainly! You can draw lines onto a surface in Pygame by using the `pygame.draw.line` function. Below is an example of how to load an image, then draw lines of arbitrary position and length on top of that image.
Make sure you have Pygame installed. You can install it via pip if you haven't done so already:
```bash
p... | 48,670 | [
{
"from": "human",
"value": "I would like to draw lines (of arbitrary position and length) onto a surface in pygame, which itself is an image loaded from a file on disk.\nCan anyone point me to some example code that does this?\n"
},
{
"from": "gpt",
"value": "Certainly! You can draw lines onto ... |
In the RowDataBound OnClick event handler, its printing 'Hi' when I click on any row. But I want it to only print 'Hi' when I click on the 15th row. How can I implement this?
My code:
protected void dtvExDetails_RowDataBound1(object sender, GridViewRowEventArgs e)
{
if (e.Row.DataItemIndex == -1)
return;
... | To ensure that the message "Hi" is only printed when the 15th row is clicked, you'll need to modify your `onclick` event assignment in the `RowDataBound` method and handle the row selection in the `SelectedIndexChanged` event.
Currently, you are adding the `onclick` event for the 15th row, but to achieve the desired f... | 48,438 | [
{
"from": "human",
"value": "In the RowDataBound OnClick event handler, its printing 'Hi' when I click on any row. But I want it to only print 'Hi' when I click on the 15th row. How can I implement this?\nMy code:\nprotected void dtvExDetails_RowDataBound1(object sender, GridViewRowEventArgs e)\n{\n\n if... |
I often hear the terms 'statically linked' and 'dynamically linked', often in reference to code written in C, C++ or C#. What are they, what exactly are they talking about, and what are they linking?
| In the context of programming languages like C, C++, and C#, the terms "statically linked" and "dynamically linked" refer to how a program connects to libraries or external modules that contain code and resources needed for the program to function. Here's a breakdown of each term:
### Statically Linked
- **Definition... | 46,029 | [
{
"from": "human",
"value": "I often hear the terms 'statically linked' and 'dynamically linked', often in reference to code written in C, C++ or C#. What are they, what exactly are they talking about, and what are they linking?\n"
},
{
"from": "gpt",
"value": "In the context of programming lang... |
I've seen quite a few developer job postings recently that include a sentence that reads more or less like this: "Must have experience with N-Tier architecture", or "Must be able to develop N-Tier apps".
This leads me to ask, what is N-Tier architecture? How does one gain experience with it?
| N-Tier architecture, also known as multi-tier architecture, is a software design pattern that separates an application into distinct layers or tiers, each of which has its own responsibility. This architecture is particularly common in enterprise applications and web services because it allows for better separation of ... | 49,880 | [
{
"from": "human",
"value": "I've seen quite a few developer job postings recently that include a sentence that reads more or less like this: \"Must have experience with N-Tier architecture\", or \"Must be able to develop N-Tier apps\".\nThis leads me to ask, what is N-Tier architecture? How does one gain e... |
I would like to know what kinds of builds (i.e for example and learning) does one have.
I currently set up nightly build triggered on changes..
Should I have a different server for ci builds or different config blocks???
Please give ideas or samples on how you maintain CI and nightly build in config
| In a Continuous Integration (CI) and Continuous Deployment (CD) environment, it's common to have different types of builds, each serving a unique purpose. Here are a few examples:
### Types of Builds
1. **CI Builds**: These are triggered on every code change (usually on merges or pull requests). They are designed to v... | 49,031 | [
{
"from": "human",
"value": "I would like to know what kinds of builds (i.e for example and learning) does one have.\nI currently set up nightly build triggered on changes..\nShould I have a different server for ci builds or different config blocks???\nPlease give ideas or samples on how you maintain CI and... |
Strangest thing happened today with my ASP.NET MVC project. I built the installer project this afternoon, and all of a sudden, there were all these new dependencies! Yuck.
Microsoft.SqlServer.BatchParser.dll
Microsoft.SqlServer.ConnectionInfo.dll
Microsoft.SqlServer.Dmf.dll
Microsoft.SqlServer.Management.Sdk.Sfc.dll
... | The sudden appearance of new dependencies in your ASP.NET MVC project could be attributed to several factors. Here are some possibilities that you can investigate:
1. **NuGet Package Updates**: If you updated any NuGet packages in your project, especially if they have dependencies on SQL Server libraries or testing fr... | 48,148 | [
{
"from": "human",
"value": "Strangest thing happened today with my ASP.NET MVC project. I built the installer project this afternoon, and all of a sudden, there were all these new dependencies! Yuck.\nMicrosoft.SqlServer.BatchParser.dll\nMicrosoft.SqlServer.ConnectionInfo.dll\nMicrosoft.SqlServer.Dmf.dll... |
Does anyone have any good suggestions for creating a Pipe object in Java which is both an InputStream and and OutputStream since Java does not have multiple inheritance and both of the streams are abstract classes instead of interfaces?
The underlying need is to have a single object that can be passed to things which n... | Creating a custom `Pipe` object in Java that serves as both an `InputStream` and an `OutputStream` can be accomplished by creating a new class that extends both of these abstract classes. However, since Java does not support multiple inheritance, you can't extend both `InputStream` and `OutputStream` directly.
Instead... | 45,170 | [
{
"from": "human",
"value": "Does anyone have any good suggestions for creating a Pipe object in Java which is both an InputStream and and OutputStream since Java does not have multiple inheritance and both of the streams are abstract classes instead of interfaces?\nThe underlying need is to have a single o... |
Please pardon my lack of Photoshop skills, but I'm curious what type of strategy Apps like Facebook and AP Mobile News are using for the 'label slider' in their applications. Here's a quick snippet outlining what I'm talking about as I'm sure the name I'm labeling the utility as is being butchered: http://dl-client.get... | You're on the right track with your understanding of how the label slider (often referred to as a "label carousel" or "scrollable label") works. Implementing this feature in an application involves several key components, and I'll break down the general strategy to help you get started.
### 1. **User Interface Setup**... | 45,960 | [
{
"from": "human",
"value": "Please pardon my lack of Photoshop skills, but I'm curious what type of strategy Apps like Facebook and AP Mobile News are using for the 'label slider' in their applications. Here's a quick snippet outlining what I'm talking about as I'm sure the name I'm labeling the utility as... |
I need a high performance framework in native C++ for SQL.
I need it to be able to use MySQL, Oracle and Microsoft SQL Server and provide abstraction
from the lower level problems/idiosyncrasies found in every different syntax required for by DBMS from different vendors. Something like LINQ for C# and VB .Net.
| Creating a high-performance C++ framework for SQL that abstracts the differences between various database management systems (DBMS) such as MySQL, Oracle, and Microsoft SQL Server is a complex task, but several libraries and frameworks can help you achieve this goal. Below are some suggestions that can help you get sta... | 44,639 | [
{
"from": "human",
"value": "I need a high performance framework in native C++ for SQL.\nI need it to be able to use MySQL, Oracle and Microsoft SQL Server and provide abstraction\nfrom the lower level problems/idiosyncrasies found in every different syntax required for by DBMS from different vendors. Somet... |
I have a class that contains a list of objects. What's the best way to run some code in the class when the list is modified?
class MyManagerClass
{
ArrayList list = new ArrayList(); // will likely be a different collection class
private OnItemAddedToList(object o)
{
// how to call this?
}
p... | In order to run some code when the list is modified in your `MyManagerClass`, you have a few options. The most straightforward way is to create wrapper methods for adding and removing items from the list. In these methods, you can invoke the `OnItemAddedToList` and `OnItemRemovedFromList` methods.
Here’s how you could... | 47,877 | [
{
"from": "human",
"value": "I have a class that contains a list of objects. What's the best way to run some code in the class when the list is modified?\nclass MyManagerClass\n{\n ArrayList list = new ArrayList(); // will likely be a different collection class\n private OnItemAddedToList(object o)\n ... |
The concept of a coroutine sounds very interesting, but I don't know, if it makes sense in a real productive environment? What are use cases for coroutines, where the coroutine implementation is more elegant, simpler or more efficient than other methods?
| Coroutines are a powerful programming construct that enable cooperative multitasking, allowing you to write asynchronous code in a more sequential and readable fashion. They are particularly useful in scenarios where you need to manage concurrency without the overhead and complexity of traditional threading or callback... | 47,972 | [
{
"from": "human",
"value": "The concept of a coroutine sounds very interesting, but I don't know, if it makes sense in a real productive environment? What are use cases for coroutines, where the coroutine implementation is more elegant, simpler or more efficient than other methods?\n"
},
{
"from": ... |
Opinions: I want to disallow direct invocation of certain scripts, that have functionality accessible from a menu, via Web at the OS level (Linux).
I was hoping to call a authorize.pl script that checks the session validity, checks user privileges etc. Then it will redirect to the target script.
Does this get arou... | Your approach to controlling access to certain scripts via an `authorize.pl` script is a common practice in web application security. However, there are several considerations to keep in mind regarding permissions, security practices, and effective implementation.
### Concept Overview
1. **Authorization Script**: You... | 47,623 | [
{
"from": "human",
"value": "Opinions: I want to disallow direct invocation of certain scripts, that have functionality accessible from a menu, via Web at the OS level (Linux). \nI was hoping to call a authorize.pl script that checks the session validity, checks user privileges etc. Then it will redirect ... |
I have the following problem: Multithreaded WPF application, Model View Presenter Implementation. Presenters and Views that belong together are created on a separate thread and get a separate Dispatcher. Now someone calls from another thread a method on the Presenter. I am intercepting the call, and now begins the prob... | In your scenario, where you have a multithreaded WPF application with a Model-View-Presenter (MVP) pattern and different threads for Presenters and their corresponding Views, the challenge is to ensure that method calls to the Presenter are executed on the correct thread without cluttering the code with thread handling... | 48,458 | [
{
"from": "human",
"value": "I have the following problem: Multithreaded WPF application, Model View Presenter Implementation. Presenters and Views that belong together are created on a separate thread and get a separate Dispatcher. Now someone calls from another thread a method on the Presenter. I am inter... |
How to display unicode characters (e.g. japanese) in the title of a JFrame in java swing in a Windows XP m/c without the Japanese language pack? It looks like setting the title text to Japanese unicode characters and the font to MS Mincho is not enough. While this is all you need to do to display unicode characters in ... | To display Unicode characters, such as Japanese characters, in the title of a JFrame in Java Swing on a Windows XP machine without the Japanese language pack, you need to ensure a few things are correctly set up. Here are some steps you can follow to properly display the characters:
1. **Use Unicode Strings**: Ensure ... | 47,831 | [
{
"from": "human",
"value": "How to display unicode characters (e.g. japanese) in the title of a JFrame in java swing in a Windows XP m/c without the Japanese language pack? It looks like setting the title text to Japanese unicode characters and the font to MS Mincho is not enough. While this is all you nee... |
I've got about 100 unit tests and with a coverage of %20, which I'm trying to increase the coverage and also this is a project in development so keep adding new tests.
Currently running my tests after every build is not feasible they takes about 2 moments.
Test Includes:
File read from the test folders (data-driven... | Increasing your test coverage and improving the efficiency of your testing process is indeed a challenging task, especially when dealing with a large, highly coupled codebase. Below are several strategies you could consider to help you manage and improve your testing process without disrupting your development flow:
#... | 45,230 | [
{
"from": "human",
"value": "I've got about 100 unit tests and with a coverage of %20, which I'm trying to increase the coverage and also this is a project in development so keep adding new tests. \nCurrently running my tests after every build is not feasible they takes about 2 moments. \nTest Includes:\n\... |
I have a table with a credit and debit column.
I need to get the highest balance out of that, and I think a stored procedure is the way to do it, but I have no idea how.
I need to start with the first row, add the debits, subtract the credits and store the value A.
Second row is A+debit-credit=B; A = max(A,B)
Repeat la... | You can achieve this using a stored procedure in a SQL database, where you iterate through each row of your table, calculate the balance, and keep track of the maximum balance encountered. Here’s a simple example of how you might do this in SQL Server.
Assuming your table is named `Transactions`, with columns `Debit` ... | 47,253 | [
{
"from": "human",
"value": "I have a table with a credit and debit column.\nI need to get the highest balance out of that, and I think a stored procedure is the way to do it, but I have no idea how.\nI need to start with the first row, add the debits, subtract the credits and store the value A.\nSecond row... |
My program has to read files that use various encodings. They may be ANSI, UTF-8 or UTF-16 (big or little endian).
When the BOM (Byte Order Mark) is there, I have no problem. I know if the file is UTF-8 or UTF-16 BE or LE.
I wanted to assume when there was no BOM that the file was ANSI. But I have found that the files... | It looks like you've already made significant progress in finding a solution for detecting file encodings in Delphi 2009. However, let me summarize and expand on your findings for clarity and completeness.
### Overview
When dealing with files that may have different encodings, especially without a BOM, the challenge ... | 46,433 | [
{
"from": "human",
"value": "My program has to read files that use various encodings. They may be ANSI, UTF-8 or UTF-16 (big or little endian). \nWhen the BOM (Byte Order Mark) is there, I have no problem. I know if the file is UTF-8 or UTF-16 BE or LE.\nI wanted to assume when there was no BOM that the fil... |
Something really weird is going on with Xcode and an iPhone project I'm working on, when I'm building for the simulator, the project has 2 active executables (MyApp - iPhone Simulator (2.0) and MyApp - iPhone Simulator (2.1)) Almost all of the time, I want to use the the 2.1 active executable, but Xcode will occasiona... | It sounds like you're experiencing a frustrating issue with Xcode and the active scheme for your iPhone project. Here are some steps you can take to troubleshoot and hopefully resolve this issue:
### 1. **Check Your Scheme Settings:**
- Go to **Product > Scheme > Manage Schemes...**.
- Verify that the correct sc... | 47,528 | [
{
"from": "human",
"value": "Something really weird is going on with Xcode and an iPhone project I'm working on, when I'm building for the simulator, the project has 2 active executables (MyApp - iPhone Simulator (2.0) and MyApp - iPhone Simulator (2.1)) Almost all of the time, I want to use the the 2.1 ac... |
I'm in the midst of writing a 3d engine and I've come across the LookAt algorithm described in the DirectX documentation:
zaxis = normal(At - Eye)
xaxis = normal(cross(Up, zaxis))
yaxis = cross(zaxis, xaxis)
xaxis.x yaxis.x zaxis.x 0
xaxis.y yaxis.y zaxis.y 0... | The LookAt algorithm you are referring to is used to create a view matrix that transforms world coordinates into camera (view) coordinates. Let's break down the translation component of the matrix and explain why it is computed that way.
### Understanding the View Matrix
The view matrix is responsible for transformin... | 44,875 | [
{
"from": "human",
"value": "I'm in the midst of writing a 3d engine and I've come across the LookAt algorithm described in the DirectX documentation:\nzaxis = normal(At - Eye)\nxaxis = normal(cross(Up, zaxis))\nyaxis = cross(zaxis, xaxis)\n\n xaxis.x yaxis.x zaxis.x 0\n xaxis.y... |
As the title states when would you recommend the use of the mediator design pattern and where do you see it used incorrectly?
| The Mediator design pattern is a behavioral design pattern that promotes loose coupling between components by introducing a mediator object that handles the communication and control of the interactions between them. Here are some recommendations on when to use the Mediator pattern, as well as common scenarios where it... | 46,863 | [
{
"from": "human",
"value": "As the title states when would you recommend the use of the mediator design pattern and where do you see it used incorrectly?\n"
},
{
"from": "gpt",
"value": "The Mediator design pattern is a behavioral design pattern that promotes loose coupling between components b... |
Remote Debugging for .NET WPF Application via Visual Studio 2008 Remote Debugger can this be done ? I see native only in the options ? Any help please...
| Yes, you can remote debug a .NET WPF application using Visual Studio 2008, although the process may vary slightly based on the specifics of your setup. Visual Studio 2008 supports remote debugging for managed code, but there are a few things to ensure and set up before you can proceed:
### Setting Up Remote Debugging
... | 48,734 | [
{
"from": "human",
"value": "Remote Debugging for .NET WPF Application via Visual Studio 2008 Remote Debugger can this be done ? I see native only in the options ? Any help please...\n"
},
{
"from": "gpt",
"value": "Yes, you can remote debug a .NET WPF application using Visual Studio 2008, altho... |
Given a string S, what is the best algorithm to find a substring which repeats maximum number of times.
For example, in "assdssfssd", it is "ss" which repeats maximum number of times.
| To find the substring that repeats the maximum number of times in a given string \( S \), we can use the **Suffix Array** combined with the **Longest Common Prefix (LCP) array**. This approach is efficient and works well for this type of problem.
### Steps of the Algorithm
1. **Construct the Suffix Array**:
A suff... | 49,299 | [
{
"from": "human",
"value": "Given a string S, what is the best algorithm to find a substring which repeats maximum number of times.\nFor example, in \"assdssfssd\", it is \"ss\" which repeats maximum number of times.\n"
},
{
"from": "gpt",
"value": "To find the substring that repeats the maximu... |
I am trying to test a stress test a web service using JMeter but the requests keep stopping after around 4 hours.
I submit 10 requests per second from JMeter. The web service is still functioning properly after JMeter completes.
I am using only 1 soap request and I do not specify to rad the soap response.
Why JMeter g... | When performing stress testing with JMeter, there are several reasons why your test might stop after a certain period, even if the web service is still functioning properly. Here are some common factors to consider:
1. **JMeter Configuration**: JMeter may have configurations that limit the duration of the test. Check ... | 44,675 | [
{
"from": "human",
"value": "I am trying to test a stress test a web service using JMeter but the requests keep stopping after around 4 hours.\nI submit 10 requests per second from JMeter. The web service is still functioning properly after JMeter completes. \nI am using only 1 soap request and I do not spe... |
In a project we have text files looking like this:
mv A, R3
mv R2, B
mv R1, R3
mv B, R4
add A, R1
add B, R1
add R1, R2
add R3, R3
add R21, X
add R12, Y
mv X, R2
I need to replace the strings according to the following, but I am looking
for a more general solution.
R1 => R2
R2 => R3
R3 => R1
R12 => R21
R21 => R12
I... | Certainly! To achieve a similar string replacement functionality in Java as demonstrated in your Perl script, we can create a simple Java application that reads the contents of text files, performs the specified replacements using a mapping, and then writes the modified content back to the original file. Below is a Jav... | 47,585 | [
{
"from": "human",
"value": "In a project we have text files looking like this:\nmv A, R3\nmv R2, B\nmv R1, R3\nmv B, R4\nadd A, R1\nadd B, R1\nadd R1, R2\nadd R3, R3\nadd R21, X\nadd R12, Y\nmv X, R2\n\nI need to replace the strings according to the following, but I am looking\nfor a more general solution.... |
If I were looking to create my own language are there any tools that would help me along? I have heard of yacc but I'm wondering how I would implement features that I want in the language.
| Creating your own programming language can be an exciting and challenging project! There are several tools and resources available to help you design and implement your language. Here's a list of helpful tools and methodologies, along with some key considerations for implementing features:
### Tools for Creating a Pro... | 45,582 | [
{
"from": "human",
"value": "If I were looking to create my own language are there any tools that would help me along? I have heard of yacc but I'm wondering how I would implement features that I want in the language.\n"
},
{
"from": "gpt",
"value": "Creating your own programming language can be... |
Lately I have seen a lot of blog posts concerning how to build loosely coupled applications. Which patterns do you use most when creating loosely coupled applications? Dependency Injection? Inversion of Control?
| Building loosely coupled applications is essential for enhancing maintainability, testability, and scalability. There are several design patterns and principles that you can use to achieve loose coupling in your application architecture. Here are some of the most commonly used patterns:
### 1. Dependency Injection (DI... | 48,580 | [
{
"from": "human",
"value": "Lately I have seen a lot of blog posts concerning how to build loosely coupled applications. Which patterns do you use most when creating loosely coupled applications? Dependency Injection? Inversion of Control?\n"
},
{
"from": "gpt",
"value": "Building loosely coupl... |
I am making some plots in Perl using GD::Graph and some of the data is outside the area I would like to display, but instead of being truncated off the chart outside the graphing area, it is being drawn over the title, legend, and axis labels. Does anyone know how to stop this from happening?
| When using `GD::Graph`, it's important to ensure that your graph's data points do not overflow into areas reserved for titles, legends, and axis labels. If you have data points that extend beyond the displayable area of the graph, you can adjust the padding and margins to create space for these elements. Here are some ... | 44,610 | [
{
"from": "human",
"value": "I am making some plots in Perl using GD::Graph and some of the data is outside the area I would like to display, but instead of being truncated off the chart outside the graphing area, it is being drawn over the title, legend, and axis labels. Does anyone know how to stop this ... |
I have been learning more and more javascript; it's a necessity at my job. We have a web application that uses a lot of javascript and I will be doing more and more every day. I have read bits and pieces about design patterns, but was wondering if someone could just give me a cut and dry example and definition. Are the... | Great to hear that you're diving deeper into JavaScript! Design patterns are indeed useful concepts in software development that can help you write cleaner, more maintainable, and more efficient code. They're not just high-level abstractions; they are practical solutions to common problems you may encounter in software... | 49,045 | [
{
"from": "human",
"value": "I have been learning more and more javascript; it's a necessity at my job. We have a web application that uses a lot of javascript and I will be doing more and more every day. I have read bits and pieces about design patterns, but was wondering if someone could just give me a cu... |
I'm trying to embed an xsl into a XML file. The reason for doing this is to create a single file that could be moved to different computers, this would prevent the need to move the xsl file.
The xsl file is creating a table and grabbing a test step from the xml and whether it passed or failed, pretty simple.
The iss... | Embedding an XSLT stylesheet with JavaScript into an XML document can be tricky, especially when using Internet Explorer (IE) to render it. The problem you're encountering, where the JavaScript code is being displayed as text rather than being executed, is likely due to the placement of the `<xsl:stylesheet>` element a... | 46,188 | [
{
"from": "human",
"value": "I'm trying to embed an xsl into a XML file. The reason for doing this is to create a single file that could be moved to different computers, this would prevent the need to move the xsl file. \nThe xsl file is creating a table and grabbing a test step from the xml and whether i... |
So I am sold on the concept of attempting to collect data automatically from a program - i.e., popping up a dialog box that asks the user to send the report when something goes wrong.
I'm working in MS Visual Studio C#.
From an implementation point of view, does it make sense to put a try/catch loop in my main program.... | Your approach of using a try/catch block in the `Program.cs` file around the `Application.Run` call is a valid and common practice, especially for applications that need to catch unhandled exceptions at a global level. This way, you can catch any unhandled exceptions that might occur in your application, pop up a dialo... | 49,475 | [
{
"from": "human",
"value": "So I am sold on the concept of attempting to collect data automatically from a program - i.e., popping up a dialog box that asks the user to send the report when something goes wrong.\nI'm working in MS Visual Studio C#.\nFrom an implementation point of view, does it make sense ... |
I'm just starting to take an interest in visualization and I'd like to know where I can get my hands on some data, preferably real world, to see what queries and graphics I can draw from it. Its more of a personal exercise to create some pretty looking representations of that data.
After seeing this I wondered where th... | It's great that you're diving into data visualization! There are numerous resources where you can find real-world data for your projects. Here are some suggestions:
### Data Sources:
1. **Kaggle**: A platform that hosts datasets for data science competitions and projects. You can find a wide variety of datasets on di... | 48,066 | [
{
"from": "human",
"value": "I'm just starting to take an interest in visualization and I'd like to know where I can get my hands on some data, preferably real world, to see what queries and graphics I can draw from it. Its more of a personal exercise to create some pretty looking representations of that da... |
I'm working on a toolkit (sort of a live-CD Lisp-in-a-Box) for people new to Common Lisp, and I want to make sure it is broadly satisfying. What is attractive to you about Lisp? What do/did/would you need to get you started and keep you interested?
What I have so far: SBCL 10.22, Emacs 22.3, SLIME, and LTK bundled t... | That sounds like a fantastic initiative! Lisp is a powerful language, and having an accessible toolkit can really help newcomers get started. Here are some thoughts on what might be attractive about Lisp and what could enhance your toolkit for beginners:
### Attractiveness of Lisp
1. **Homoiconicity**: Lisp's code-as-... | 46,062 | [
{
"from": "human",
"value": "I'm working on a toolkit (sort of a live-CD Lisp-in-a-Box) for people new to Common Lisp, and I want to make sure it is broadly satisfying. What is attractive to you about Lisp? What do/did/would you need to get you started and keep you interested?\nWhat I have so far: SBCL 1... |
Does dot net have an interface like IEnumerable with a count property? I know about interfaces such as IList and ICollection which do offer a Count property but it seems like these interfaces were designed for mutable data structures first and use as a read only interface seems like an afterthought - the presence of an... | In .NET, there isn't an interface that combines the functionality of `IEnumerable<T>` with a `Count` property that is explicitly designed for read-only collections. However, the closest existing interface that meets your requirements is `IReadOnlyCollection<T>`, which is part of the `System.Collections.Generic` namespa... | 49,384 | [
{
"from": "human",
"value": "Does dot net have an interface like IEnumerable with a count property? I know about interfaces such as IList and ICollection which do offer a Count property but it seems like these interfaces were designed for mutable data structures first and use as a read only interface seems ... |
I have an object with a NameValueCollection property which I'm managing with Linq2SQL. I was going to serialise it to an XML column (xelement) in the DB. My problem is I don't really have a hook to convert it to XML on save with Linq2SQL. I believe I can use the OnLoaded partial method to control the deserialisation... | To manage the serialization and deserialization of an `NameValueCollection` property using LINQ to SQL while storing it as an XML column (e.g., `XElement`) in the database, you can indeed utilize the partial class feature of LINQ to SQL. Here's a general approach you can follow:
### Step 1: Create the Partial Class
F... | 49,351 | [
{
"from": "human",
"value": "I have an object with a NameValueCollection property which I'm managing with Linq2SQL. I was going to serialise it to an XML column (xelement) in the DB. My problem is I don't really have a hook to convert it to XML on save with Linq2SQL. I believe I can use the OnLoaded part... |
I came across a problem in my current application that required fiddling with the query string in a base Page class (which all my pages inherit from) to solve the problem. Since some of my pages use the query string I was wondering if there is any class that provides clean and simple query string manipulation.
Example ... | For clean and simple query string manipulation in ASP.NET, you can create a utility class that encapsulates the logic for managing the query string. This way, you can easily modify the query string in one place and reuse it throughout your application.
Here’s a sample utility class to help with query string manipulati... | 49,786 | [
{
"from": "human",
"value": "I came across a problem in my current application that required fiddling with the query string in a base Page class (which all my pages inherit from) to solve the problem. Since some of my pages use the query string I was wondering if there is any class that provides clean and s... |
We use SQL Server 2000/2005 and Vault or SVN on most of our projects. I haven't found a decent solution for capturing database schema/proc changes in either source control system.
Our current solution is quite cumbersome and difficult to enforce (script out the object you change and commit it to the database).
We have ... | Tracking database schema changes in a source control system can be a challenge, especially when relying on manual processes. However, there are a number of tools and techniques that can help streamline this process without requiring extensive custom development. Below are some recommendations that might fit your needs,... | 46,661 | [
{
"from": "human",
"value": "We use SQL Server 2000/2005 and Vault or SVN on most of our projects. I haven't found a decent solution for capturing database schema/proc changes in either source control system.\nOur current solution is quite cumbersome and difficult to enforce (script out the object you chang... |
I have, for my game, a Packet class, which represents network packet and consists basically of an array of data, and some pure virtual functions
I would then like to have classes deriving from Packet, for example: StatePacket, PauseRequestPacket, etc. Each one of these sub-classes would implement the virtual functions,... | Your questions touch on important aspects of object-oriented design, particularly regarding polymorphism and serialization. Let's tackle each issue step-by-step.
### 1. Copyable and Assignable Abstract Class Without Slicing
To allow the `Packet` class to be copyable and assignable while avoiding slicing, you can use ... | 45,212 | [
{
"from": "human",
"value": "I have, for my game, a Packet class, which represents network packet and consists basically of an array of data, and some pure virtual functions\nI would then like to have classes deriving from Packet, for example: StatePacket, PauseRequestPacket, etc. Each one of these sub-clas... |
we have SAP Business One - Fourth Shift Edition running here at a small manufacturing company. The consulting company that has come in to do the installation/implementation uses the "sa" id/pass to initially connect to the database to get the list of companies. From then on, I have to assume that its the sa id/pass t... | Using the "sa" (system administrator) account for database connections, especially in a production environment, is generally not recommended due to security risks. Here are some best practices and considerations for setting up database connections in SAP Business One (Fourth Shift Edition) or any SQL Server-based appli... | 49,265 | [
{
"from": "human",
"value": "we have SAP Business One - Fourth Shift Edition running here at a small manufacturing company. The consulting company that has come in to do the installation/implementation uses the \"sa\" id/pass to initially connect to the database to get the list of companies. From then on,... |
What is the difference between the scalar and list contexts in Perl and does this have any parallel in other languages such as Java or Javascript?
| In Perl, the difference between scalar and list contexts is fundamental to understanding how the language operates when dealing with variables and subroutines.
### Scalar Context
In scalar context, Perl expects a single value. This could be a number, a string, or a reference. For instance, when you assign a value to a... | 48,142 | [
{
"from": "human",
"value": "What is the difference between the scalar and list contexts in Perl and does this have any parallel in other languages such as Java or Javascript? \n"
},
{
"from": "gpt",
"value": "In Perl, the difference between scalar and list contexts is fundamental to understandi... |
I would like to display certain meta data fields in the edit form based on the value of a fields.
Example: Users upload a document to the Doclib to be approved by there manager. They are allowed to change the meta data Name,Case No, Location until the item is approved by the manager. Once the item is approved I would ... | To achieve the requirement of setting certain metadata fields to read-only based on the approval status of a document in a SharePoint document library, you have the right idea by using XSLT to conditionally render the fields based on the `ModerationStatus`. However, the `ModerationStatus` field is indeed represented as... | 44,672 | [
{
"from": "human",
"value": "I would like to display certain meta data fields in the edit form based on the value of a fields. \nExample: Users upload a document to the Doclib to be approved by there manager. They are allowed to change the meta data Name,Case No, Location until the item is approved by the m... |
I have 3 web projects in a Visual studio solution.I want to create a single web setup project which should install all 3 web projects in their virtual directories.So how to create a single web setup project which supports multiple web application installation?
| Creating a single setup project that installs multiple web applications into their respective virtual directories can be accomplished in Visual Studio using a Web Setup Project. However, it is important to note that Web Setup Projects are not natively supported in Visual Studio 2012 and later, as they were part of the ... | 46,375 | [
{
"from": "human",
"value": "I have 3 web projects in a Visual studio solution.I want to create a single web setup project which should install all 3 web projects in their virtual directories.So how to create a single web setup project which supports multiple web application installation?\n"
},
{
"f... |
Is it possible to obfuscate a .NET web application? I tried to use the Dotofuscator tool that comes with Visual Studio 2005 and I was able to obfuscate the dlls of a precompiled web site, but when I deployed the soultion to an IIS server, I could not the pages of the application.
So the question would be: was any of yo... | Yes, it is possible to obfuscate a .NET web application, but there are specific considerations you need to take into account to ensure that the application continues to function correctly after obfuscation.
Here are some key points to help you successfully obfuscate your .NET web application:
1. **Obfuscate Only Asse... | 49,447 | [
{
"from": "human",
"value": "Is it possible to obfuscate a .NET web application? I tried to use the Dotofuscator tool that comes with Visual Studio 2005 and I was able to obfuscate the dlls of a precompiled web site, but when I deployed the soultion to an IIS server, I could not the pages of the application... |
Here's what I got so far (that doesn't work). At this point I thought my target was Ansi encoded, but I really don't want to have to know at this point. My browser seems to be able to determine what encoding to use, How can I?
static void GetUrl(Uri uri, string localFileName)
{
HttpWebRequest request = (HttpWebRequ... | Your updated implementation of the `GetUrl` method looks good and is on the right track for handling different encodings. However, there are a few improvements and best practices that can be applied to enhance the robustness and readability of your code.
1. **Character Set Parsing**: Use `Encoding.UTF8` as a fallback ... | 49,539 | [
{
"from": "human",
"value": "Here's what I got so far (that doesn't work). At this point I thought my target was Ansi encoded, but I really don't want to have to know at this point. My browser seems to be able to determine what encoding to use, How can I?\nstatic void GetUrl(Uri uri, string localFileName)\n... |
I am trying to measure the throughput of a webservice.
In order to do that, I have written a small tool that continuously sends requests and reads responses from a number of threads.
The contents of the inner loop of each thread looks like this:
public void PerformRequest()
{
WebRequest webRequest = WebRequest.Create... | It sounds like you're hitting some limits related to how .NET manages connections and threads. Here are several suggestions and considerations to help you troubleshoot and potentially improve the throughput of your web service requests:
1. **ServicePointManager.DefaultConnectionLimit**: You've already mentioned that y... | 49,492 | [
{
"from": "human",
"value": "I am trying to measure the throughput of a webservice.\nIn order to do that, I have written a small tool that continuously sends requests and reads responses from a number of threads.\nThe contents of the inner loop of each thread looks like this:\npublic void PerformRequest()\n... |
I need some help calculating Pi. I am trying to write a python program that will calculate Pi to X digits. I have tried several from the python mailing list, and it is to slow for my use.
I have read about the Gauss-Legendre Algorithm, and I have tried porting it to Python with no success.
I am reading from Here, and ... | The issue you're encountering with your implementation of the Gauss-Legendre Algorithm is likely due to the use of floating-point arithmetic, which limits precision when calculating Pi to many digits. Python's built-in `float` type may not provide the necessary precision for high-accuracy calculations.
To calculate Pi... | 44,650 | [
{
"from": "human",
"value": "I need some help calculating Pi. I am trying to write a python program that will calculate Pi to X digits. I have tried several from the python mailing list, and it is to slow for my use. \nI have read about the Gauss-Legendre Algorithm, and I have tried porting it to Python wit... |
It seems that there're 6 variations to CBC-MAC algorithm. I've been trying to match the MAC algorithm on the PINPad 1000SE [which per manual is ISO 9797-1 Algorithm 1].
I got an excellent start from here.
And I coded the algorithm as below:
public static byte[] CalculateMAC(this IPinPad pinpad, byte[] message, byte[] ... | It looks like you're working on implementing the CBC-MAC algorithm according to the ISO 9797-1 Algorithm 1 specification, and you're encountering some difficulties achieving the correct MAC output. I can help guide you through the logic of your implementation and suggest some changes.
### Key Points to Consider:
1. *... | 45,453 | [
{
"from": "human",
"value": "It seems that there're 6 variations to CBC-MAC algorithm. I've been trying to match the MAC algorithm on the PINPad 1000SE [which per manual is ISO 9797-1 Algorithm 1].\nI got an excellent start from here.\nAnd I coded the algorithm as below:\npublic static byte[] CalculateMAC(... |
I'm looking for a simple way to put up musical "tunes" on a website.
So here's an analogy to explain my question:
Let's say I want to put up a couple of big triangles as a picture on my web page. I can either draw a bitmap and save as GIF/JPG/PNG, put it up somewhere on the internet, and link to it with an element. Th... | Yes, you can create and publish simple musical tunes in a more space-efficient format than traditional audio files like MP3 or WAV. Here are a few options that allow you to create music using code or more lightweight formats:
### 1. **MIDI Files:**
MIDI (Musical Instrument Digital Interface) files contain instructions... | 44,865 | [
{
"from": "human",
"value": "I'm looking for a simple way to put up musical \"tunes\" on a website.\nSo here's an analogy to explain my question:\nLet's say I want to put up a couple of big triangles as a picture on my web page. I can either draw a bitmap and save as GIF/JPG/PNG, put it up somewhere on the ... |
I have done this on Websphere (re: title of this topic) using wsdl2java for generating wsdl to java mapping xml file.
My endpoint is a generic stateless EJB. The code in EJB is generated by traversing the each wsdl and getting the wsdl operation and stuck it in the generated remote EJB interface.
Each EJB method impl i... | To achieve a similar setup in Sun Application Server (also known as GlassFish) as you've done in WebSphere, you can use the `wscompile` tool, which is designed to generate the necessary artifacts from WSDL files, including EJB stubs and deployment descriptors. Here’s a step-by-step guide to help you through the process... | 45,058 | [
{
"from": "human",
"value": "I have done this on Websphere (re: title of this topic) using wsdl2java for generating wsdl to java mapping xml file.\nMy endpoint is a generic stateless EJB. The code in EJB is generated by traversing the each wsdl and getting the wsdl operation and stuck it in the generated re... |
I am working in a .NET environment where the system occasionally generates log entries for a customer. Messages are then appended to a customer log which can be reviewed at a later time.
For example, if a customer is subscribing to a new service, or a customer has a failed payment attempt, these messages gets appended ... | To effectively localize log messages in a .NET environment, you can leverage the built-in localization features provided by .NET. Here’s a step-by-step approach to implement a localization strategy for your customer logs:
### Step 1: Resource Files
1. **Create Resource Files**:
- Create separate `.resx` files for... | 44,443 | [
{
"from": "human",
"value": "I am working in a .NET environment where the system occasionally generates log entries for a customer. Messages are then appended to a customer log which can be reviewed at a later time.\nFor example, if a customer is subscribing to a new service, or a customer has a failed paym... |
How to Creat Charts with the Google Chart API in asp.net?
| Creating charts using the Google Charts API in an ASP.NET application involves a few steps. Below, I’ll guide you through the process of setting up a simple ASP.NET application that uses Google Charts to display data.
### Step 1: Set Up Your ASP.NET Project
1. **Create a New ASP.NET Project**
- Open Visual Studio.... | 43,673 | [
{
"from": "human",
"value": "How to Creat Charts with the Google Chart API in asp.net?\n"
},
{
"from": "gpt",
"value": "Creating charts using the Google Charts API in an ASP.NET application involves a few steps. Below, I’ll guide you through the process of setting up a simple ASP.NET applicatio... |
In my C# winforms app, I have a datagrid. When the datagrid reloads, I want to set the scrollbar back to where the user had it set. How can I do this?
EDIT: I'm using the old winforms DataGrid control, not the newer DataGridView
| To preserve the scroll position of an old WinForms `DataGrid` when reloading its data, you need to save the current scroll position before the data reload and then restore it afterward. Since the `DataGrid` control does not expose a direct method to get or set the scroll position, you can use the `Control` class and `S... | 49,863 | [
{
"from": "human",
"value": "In my C# winforms app, I have a datagrid. When the datagrid reloads, I want to set the scrollbar back to where the user had it set. How can I do this?\nEDIT: I'm using the old winforms DataGrid control, not the newer DataGridView\n"
},
{
"from": "gpt",
"value": "T... |
Given the following input:
known longitudes/latitudes of 1..n locations
known distance between locations 1..n and another location "m"
How can I calculate the longitude/latitude of the location "m"?
| To calculate the longitude and latitude of an unknown location "m" based on known locations (1 to n) and the distances from these known locations to "m", you can use a technique called trilateration. Here are the steps you can follow:
### Step 1: Gather Your Data
- Let’s denote the known locations as \( P_1, P_2, \ldo... | 48,598 | [
{
"from": "human",
"value": "Given the following input:\n\nknown longitudes/latitudes of 1..n locations\nknown distance between locations 1..n and another location \"m\"\n\nHow can I calculate the longitude/latitude of the location \"m\"?\n"
},
{
"from": "gpt",
"value": "To calculate the longitu... |
I have been doing two projects on Rails which have worked out quite nicely but have in the process reinvented the wheel, running (and hot) water and painkillers which are as I have learned subsequently already present in the framework.
So basically, what is the best way to properly get know all the clever parts in the ... | It's great that you've already done some Rails projects, and it's a common experience for many developers to reinvent the wheel before discovering the built-in functionalities of the framework. Here are several strategies to familiarize yourself with Rails' features and avoid building things from scratch when there's a... | 47,257 | [
{
"from": "human",
"value": "I have been doing two projects on Rails which have worked out quite nicely but have in the process reinvented the wheel, running (and hot) water and painkillers which are as I have learned subsequently already present in the framework.\nSo basically, what is the best way to prop... |
I would like to log changes made to all fields in a table to another table. This will be used to keep a history of all the changes made to that table (Your basic change log table).
What is the best way to do it in SQL Server 2005?
I am going to assume the logic will be placed in some Triggers.
What is a good way to loo... | To log changes made to all fields in a table using triggers in SQL Server 2005, you can indeed use `INSERTED` and `DELETED` tables within a trigger to compare the old and new values. Although SQL Server does not have built-in dynamic querying capabilities to loop through all columns of a table without hardcoding, we ca... | 48,384 | [
{
"from": "human",
"value": "I would like to log changes made to all fields in a table to another table. This will be used to keep a history of all the changes made to that table (Your basic change log table).\nWhat is the best way to do it in SQL Server 2005?\nI am going to assume the logic will be placed ... |
I've been banging my head against the wall with this one, may be someone can shed some light as of to what may be causing this behavior.
I have an asp.net (2.0) app that as some point does:
using(TransactionScope scope = new TransactionScope(...))
{
//... do a bunch of some queries
InsertOrder();
InsertOrderDetails();... | It sounds like you are experiencing a common issue with transaction isolation levels and how data visibility works in a transaction when using MySQL with the .NET connector. Here are a few things to check and consider to troubleshoot the issue:
1. **Transaction Isolation Level**: MySQL defaults to `REPEATABLE READ` is... | 48,289 | [
{
"from": "human",
"value": "I've been banging my head against the wall with this one, may be someone can shed some light as of to what may be causing this behavior.\nI have an asp.net (2.0) app that as some point does:\nusing(TransactionScope scope = new TransactionScope(...))\n{\n//... do a bunch of some ... |
Whats the other option we can use for multiple inheritance other than implementing interface
| In object-oriented programming, multiple inheritance can lead to complexities such as the "diamond problem," where a class inherits from two classes that inherit from a common superclass. While some languages like C++ allow multiple inheritance directly, others like Java do not, opting instead for interfaces.
If you'r... | 48,827 | [
{
"from": "human",
"value": "Whats the other option we can use for multiple inheritance other than implementing interface \n"
},
{
"from": "gpt",
"value": "In object-oriented programming, multiple inheritance can lead to complexities such as the \"diamond problem,\" where a class inherits from t... |
Does anyone know of a way to monitor table record changes in a SQL Server (2005 or 2008) database from a .Net application? It needs to be able to support multiple clients at a time. Each client will "subscribe" when it starts, and "unsubscribe" when it exits. Multiple users could be accessing the system at once and ... | To achieve real-time monitoring of table record changes in a SQL Server (2005 or 2008) database from a .NET application, there are several approaches you can take. The challenge you're facing is to detect changes efficiently without polling the database frequently. Below are some methods you might consider:
### 1. SQL... | 45,094 | [
{
"from": "human",
"value": "Does anyone know of a way to monitor table record changes in a SQL Server (2005 or 2008) database from a .Net application? It needs to be able to support multiple clients at a time. Each client will \"subscribe\" when it starts, and \"unsubscribe\" when it exits. Multiple use... |
I made an html file called test.html then I navigated to it as "http://site.com/test.html?test1=a" but the textbox stayed blank. Why is this?
Super simple code
<html>
<head>
<title>Test</title>
</head>
<body >
<input type=text name="test1">
</body>
</html>
| The behavior you're experiencing is due to how HTML forms work and the fact that you're using a standard text input without any JavaScript to pre-fill it.
In your HTML code, you have created a text input but did not include any mechanism to populate it with the query parameter value (`test1=a`) from the URL. Here's ho... | 49,783 | [
{
"from": "human",
"value": "I made an html file called test.html then I navigated to it as \"http://site.com/test.html?test1=a\" but the textbox stayed blank. Why is this? \nSuper simple code\n<html>\n<head>\n<title>Test</title>\n</head>\n<body >\n <input type=text name=\"test1\">\n</body>\n</html>\n\n"
... |
I'll soon be working on a large c# project and would like to build in multi-language support from the start. I've had a play around and can get it working using a separate resource file for each language, then use a resource manager to load up the strings.
Are there any other good approaches that I could look into?
| When building multi-language support into a C# project, using resource files is indeed a common and effective approach. However, there are several other strategies and best practices you might consider for managing localization and internationalization (L10n/I18n) in your application. Here are some approaches and consi... | 46,767 | [
{
"from": "human",
"value": "I'll soon be working on a large c# project and would like to build in multi-language support from the start. I've had a play around and can get it working using a separate resource file for each language, then use a resource manager to load up the strings.\nAre there any other g... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.