instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
This is a somewhat bizarre question. My objectives are to understand the language design decision and to identify the possibilities of reflection in C++. Why C++ language committee did not go towards implementing reflection in the language? Is reflection too difficult in a language that does not run on a virtual machi...
Your question about reflection in C++ is a fascinating and complex topic. Let's break it down into several parts to cover the main points you're interested in: why C++ has not traditionally included reflection, the challenges associated with implementing reflection in a non-virtual machine (VM) language, and the potent...
43,977
[ { "from": "human", "value": "This is a somewhat bizarre question. My objectives are to understand the language design decision and to identify the possibilities of reflection in C++.\n\nWhy C++ language committee did not go towards implementing reflection in the language? Is reflection too difficult in a la...
I have a JSP page which contains an HTML <select> populated with all countries loaded from a database. Say for example, on "create user" all the country values are loaded in the select menu and I select 5 countries. Those 5 values are loaded into database for that particular user. Now when I click on "modify user" for ...
To accomplish the requirement of having a select menu in a JSP page that highlights or selects previously selected countries when modifying a user, you can follow these steps: 1. **Load the Countries into the `<select>` element**: Make sure your JSP page retrieves the list of countries from the database and populates ...
46,639
[ { "from": "human", "value": "I have a JSP page which contains an HTML <select> populated with all countries loaded from a database. Say for example, on \"create user\" all the country values are loaded in the select menu and I select 5 countries. Those 5 values are loaded into database for that particular u...
I am trying to load an xml file that is stored as a resource in my C# project so I can perform various LINQ queries. However at runtime an "Illegal characters in path" exception is thrown. This is how I am loading the file: XDocument doc = XDocument.Load(MyProject.Properties.Resources.XMLFile);
The error "Illegal characters in path" occurs because `MyProject.Properties.Resources.XMLFile` represents the contents of the resource rather than a file path. The `XDocument.Load` method expects a file path or a stream, not the content of a resource directly. To load an XML file from embedded resources in your C# pro...
45,763
[ { "from": "human", "value": "I am trying to load an xml file that is stored as a resource in my C# project so I can perform various LINQ queries. However at runtime an \"Illegal characters in path\" exception is thrown. This is how I am loading the file:\nXDocument doc = XDocument.Load(MyProject.Propertie...
I am using Django and the Google Web Toolkit (GWT) for my current project. I would like to pass a ModelForm instance to GWT via an Http response so that I can "chop" it up and render it as I please. My goal is to keep the form in sync with changes to my models.py file, yet increase control I have over the look of the f...
Passing a Django `ModelForm` instance to GWT (Google Web Toolkit) as JSON for rendering can be challenging due to serialization limitations. However, there are alternative approaches that you can consider: ### Option 1: Serialize Form Fields Manually Instead of trying to serialize the `ModelForm` directly, you can ma...
46,403
[ { "from": "human", "value": "I am using Django and the Google Web Toolkit (GWT) for my current project. I would like to pass a ModelForm instance to GWT via an Http response so that I can \"chop\" it up and render it as I please. My goal is to keep the form in sync with changes to my models.py file, yet inc...
I need to create a custom control to display bmp images with alpha channel. The background can be painted in different colors and the images have shadows so I need to truly "paint" the alpha channel. Does anybody know how to do it? I also want if possible to create a mask using the alpha channel information to know whe...
To correctly display a BMP image with an alpha channel and avoid issues such as white edges where the image should be transparent, you indeed need to pre-multiply the pixel colors by their alpha values. Here's how you can handle this efficiently. ### Pre-Multiplying the Alpha Values You should load your 32-bit bitmap...
46,668
[ { "from": "human", "value": "I need to create a custom control to display bmp images with alpha channel. The background can be painted in different colors and the images have shadows so I need to truly \"paint\" the alpha channel.\nDoes anybody know how to do it?\nI also want if possible to create a mask us...
I'm having some problems with my WCF server and client connections. If I use my service and client normally, meaning my client connects and disconnects thru normal operations (myclient.Close()) everything works fine. But in the instance that I have the server running and I use the visual studio "Stop" button to exit m...
The issue you’re encountering with WCF (Windows Communication Foundation) when using the "Stop" button in Visual Studio is a known challenge related to how WCF manages connections and handles abrupt client disconnections. Here are some recommendations to help address and mitigate these problems: ### 1. Implement a Pro...
47,520
[ { "from": "human", "value": "I'm having some problems with my WCF server and client connections.\nIf I use my service and client normally, meaning my client connects and disconnects thru normal operations (myclient.Close()) everything works fine. But in the instance that I have the server running and I use...
Short version How do i use an API call when i cannot guarantee that the window handle will remain valid? i can guarantee that i'm holding a reference to my form (so the form is not being disposed). That doesn't guarantee that the form's handle will stay valid all that time. How can a form's window handle become inva...
To manage the usage of window handles (HWND) in a WinForms application where you cannot guarantee the handle will remain valid, you can use a few strategies to mitigate potential issues. Here are some approaches to consider: ### 1. **Use Event Handlers for Handle Changes:** While WinForms does not provide direct metho...
44,376
[ { "from": "human", "value": "Short version\nHow do i use an API call when i cannot guarantee that the window \nhandle will remain valid? \ni can guarantee that i'm holding a reference to my form (so the form is not being disposed). That doesn't guarantee that the form's handle will stay valid all that time....
I am trying to write a simple AI for a "Get four" game. The basic game principles are done, so I can throw in coins of different color, and they stack on each other and fill a 2D Array and so on and so forth. until now this is what the method looks like: public int insert(int x, int color) //0 = empty, 1=player1 2=pla...
Certainly! To evaluate the state of a "Get Four" game (similar to Connect Four), you'll want to assess the game board and count potential winning combinations (pairs, triplets, and quads) for each player in various directions (horizontal, vertical, and diagonal). Here’s a general outline of how you can approach this: ...
43,464
[ { "from": "human", "value": "I am trying to write a simple AI for a \"Get four\" game.\nThe basic game principles are done, so I can throw in coins of different color, and they stack on each other and fill a 2D Array and so on and so forth.\nuntil now this is what the method looks like:\npublic int insert(i...
I'm thinking about using BlogEngine.NET to launch my blog. I'm a C# programmer and was wondering was BlogEngine.NET has in the belly. Does it scale well? Is it caching properly? Is it memory intensive? Can you easily add/remove functionality? I also accept any hosting recommendation :)
BlogEngine.NET is a popular open-source blogging platform built on ASP.NET, which makes it a good choice for developers familiar with C#. Here’s a breakdown of some of the aspects you mentioned: ### Performance and Scalability 1. **Scalability**: BlogEngine.NET can handle moderate traffic reasonably well. For smaller ...
44,264
[ { "from": "human", "value": "I'm thinking about using BlogEngine.NET to launch my blog. I'm a C# programmer and was wondering was BlogEngine.NET has in the belly.\nDoes it scale well? Is it caching properly? Is it memory intensive? Can you easily add/remove functionality?\nI also accept any hosting recommen...
I am developing an Eclipse plug-in that fits a client-server model. Its a commercial project so we cannot re-distribute the JDBC drivers for the various databases we support with the plug-in. So I developed a preference page to allow the user locate the jars and have a simple discovery mechanism that iterates through t...
It seems you've made significant progress in working around the issues related to JDBC driver loading in your Eclipse plug-in that uses Hibernate. Let's break down your solution and highlight some important points along the way. ### Issue with Class.forName() and ClassLoader Initially, you encountered a `ClassNotFoun...
49,850
[ { "from": "human", "value": "I am developing an Eclipse plug-in that fits a client-server model. Its a commercial project so we cannot re-distribute the JDBC drivers for the various databases we support with the plug-in.\nSo I developed a preference page to allow the user locate the jars and have a simple d...
I'd like to learn how FireFox works behind the scenes. I'd like to understand the source code and the different components but the code-base is rather large and I'm not sure where to start. I'm wondering if there is some sort of walk though written up by anybody either from the firefox team or from outside the communi...
Understanding how Firefox works behind the scenes is a great endeavor, and indeed, the Firefox codebase can be quite large and complex. Here are some resources and suggestions to help you get started on your journey: ### 1. **Mozilla Developer Network (MDN)** While MDN is primarily focused on web technologies, it does...
49,509
[ { "from": "human", "value": "I'd like to learn how FireFox works behind the scenes. I'd like to understand the source code and the different components but the code-base is rather large and I'm not sure where to start. \nI'm wondering if there is some sort of walk though written up by anybody either from th...
I have to choose a technology to connect my Application/Presentation Layer (Java Based) with the Service Layer (Java Based). Basically looking up appropriate Spring Service from the Business Delegate Object. There are so many options out there that it is confusing me. Here are the options I've narrowed down to but not ...
When choosing a technology to connect your Application/Presentation Layer to your Service Layer, there are several factors to consider, including your current architecture, potential future scalability, ease of implementation, maintenance, and the learning curve for your team. Here's a brief overview of the options you...
47,497
[ { "from": "human", "value": "I have to choose a technology to connect my Application/Presentation Layer (Java Based) with the Service Layer (Java Based). Basically looking up appropriate Spring Service from the Business Delegate Object.\nThere are so many options out there that it is confusing me. Here are ...
What methods are available for determining the optimum stack size for embedded/memory constrained system? If it's too big then memory is wasted that could be used elsewhere. However, if it is too small then we get this website's namesake... To try to jump start things: Jack Ganssle states in The Art of Designing Embedd...
Determining the optimum stack size for an embedded or memory-constrained system is indeed a challenge, but there are more systematic methods than simply "picking a size at random." Here are several approaches that can be used to determine an appropriate stack size for your application, particularly in the context of an...
49,673
[ { "from": "human", "value": "What methods are available for determining the optimum stack size for embedded/memory constrained system? If it's too big then memory is wasted that could be used elsewhere. However, if it is too small then we get this website's namesake...\nTo try to jump start things: Jack Gan...
Whats the simplest way to get a barebones linux server installed? barebones = just enough to get ssh and package manager. Current I've been using CentOS with server install and removing any packages that I know i do not want installed. But is there a better way? I just want a simple ssh shell + package management to st...
For a barebones Linux server installation with SSH and a package manager, you have several options. Below are a few approaches that can help you achieve your goal more simply than using a full server installation and then removing packages. ### 1. Use Minimal Installations Many distributions offer minimal installatio...
48,929
[ { "from": "human", "value": "Whats the simplest way to get a barebones linux server installed?\nbarebones = just enough to get ssh and package manager.\nCurrent I've been using CentOS with server install and removing any packages that I know i do not want installed.\nBut is there a better way? I just want a...
How do I track or get notified whenever a record is inserted or updated in a DB? I would like to notify an external application of the changes in near real time whenever such changes in DB occur. Are there DBMS independent and application programming language independent ways of doing this? If not, then is it possible ...
To track or get notified whenever a record is inserted or updated in a database without continuous polling, you generally have a few approaches to consider. Here are some strategies, along with specific solutions for MS Access and MS SQL Server: ### General Strategies: 1. **Database Triggers**: - Most relational ...
47,476
[ { "from": "human", "value": "How do I track or get notified whenever a record is inserted or updated in a DB? I would like to notify an external application of the changes in near real time whenever such changes in DB occur. Are there DBMS independent and application programming language independent ways of...
I'm using a SqlDataSource to populate my GridView, because the two seem to be so tightly coupled together. Since this grid shows results of a search, I have a dynamic sql string being written in my codebehind that references parameters I pass in, such as below: sdsResults.SelectParameters.Add("CodeID", TypeCode.String,...
In ASP.NET, when using `SqlDataSource`, the `SelectParameters.Add` method does expect parameters to be typed according to `TypeCode`, and unfortunately, there isn't a direct way to specify a non-Unicode parameter type like `varchar`. However, you can work around this limitation by utilizing the `SqlCommand` directly or...
47,636
[ { "from": "human", "value": "I'm using a SqlDataSource to populate my GridView, because the two seem to be so tightly coupled together. Since this grid shows results of a search, I have a dynamic sql string being written in my codebehind that references parameters I pass in, such as below:\nsdsResults.Selec...
I use codeigniter as my main install on the main domain. I have created a subdomain and a folder called live e.g. live.domain.com maps to public/live . However in public I use codeigniter. I now have the dynamic codeigniter url: http://domain.com/api/ which I want to map to my subdomain: https://live.domain.com So go...
To achieve the desired behavior where requests to `https://live.domain.com/api/functionname` are handled by `http://domain.com/api/functionname`, while keeping the original URL in the browser, you can use a reverse proxy setup with Apache's `mod_proxy` module. Here's how you can modify your `.htaccess` file for the `l...
49,007
[ { "from": "human", "value": "I use codeigniter as my main install on the main domain. I have created a subdomain and a folder called live e.g. live.domain.com maps to public/live . However in public I use codeigniter.\nI now have the dynamic codeigniter url: \nhttp://domain.com/api/\nwhich I want to map to ...
I am looking for an efficient means to partially check the integrity of "large" data sets over a slow transfer medium. This seems like a common problem as file sizes grow out of proportion to transfer rates. For example, for concrete numbers, a terabyte of data over USB2. Checking that this data is still valid by rea...
To ensure the integrity of large data sets during transfer over a slow medium, while balancing efficiency, storage space, and validation accuracy, consider the following strategies and approaches: ### 1. Random Sampling for Validation Instead of reading the entire dataset, you can take random samples of chunks of dat...
49,794
[ { "from": "human", "value": "I am looking for an efficient means to partially check the integrity of \"large\" data sets over a slow transfer medium. This seems like a common problem as file sizes grow out of proportion to transfer rates. \nFor example, for concrete numbers, a terabyte of data over USB2. C...
How do I handle the scenario where I making a synchronous request to the server using XMLHttpRequest and the server is not available? xmlhttp.open("POST","Page.aspx",false); xmlhttp.send(null); Right now this scenario results into a JavaScript error: "The system cannot locate the resource specified"
When you make a synchronous request using `XMLHttpRequest` and the server is not available, or the resource cannot be found, it's important to handle the potential errors gracefully to avoid unhandled exceptions that could disrupt your application's flow. Here's how you can handle such scenarios effectively: 1. **Use...
48,564
[ { "from": "human", "value": "How do I handle the scenario where I making a synchronous request to the server using XMLHttpRequest and the server is not available?\nxmlhttp.open(\"POST\",\"Page.aspx\",false);\nxmlhttp.send(null);\n\nRight now this scenario results into a JavaScript error:\n\"The system canno...
In datejs, if i set the dateElementOrder to the pt-PT localized version of "dmy" or "ymd" instead of "mdy" the following tests on the "Partial" test fixture start to fail: 1/2008; 1 2008; 1-2008; 2008/1; 2008 1; 2008-1 What do i need to do to make it work?
To make your tests pass when using the Portuguese (pt-PT) localized version of "dmy" or "ymd" with Datejs, you need to ensure that the parsing logic accommodates the expected date formats in those orders. Here's what you can do: 1. **Understand the Date Formats**: When you set the `dateElementOrder` to "dmy" or "ymd"...
49,725
[ { "from": "human", "value": "In datejs, if i set the dateElementOrder to the pt-PT localized version of \"dmy\" or \"ymd\" instead of \"mdy\" the following tests on the \"Partial\" test fixture start to fail:\n1/2008; 1 2008; 1-2008; 2008/1; 2008 1; 2008-1\nWhat do i need to do to make it work?\n" }, { ...
How can I find all the users who are all having access to a shared mail box? We use a shared mail box in our application, this would be useful to know. A simple solution will be more useful. Code to do this in C# is also ok. Tools from microsoft will also be useful.
To find all users who have access to a shared mailbox in Microsoft Exchange, you can use a few different methods. Here’s a simple approach using PowerShell, as well as an example using C# with the Exchange Web Services (EWS) Managed API. ### Method 1: Using PowerShell If you have administrative access to the Exchange...
48,417
[ { "from": "human", "value": "How can I find all the users who are all having access to a shared mail box?\nWe use a shared mail box in our application, this would be useful to know.\nA simple solution will be more useful.\nCode to do this in C# is also ok.\nTools from microsoft will also be useful.\n" }, ...
My company currently evaluates the development of a Java FAT client. It should support a dynamic GUI and has as much logic as possible on the server side. Hence the idea came up to send the screen as XML to the FAT client, show it to the user and send the entered data similar to "html form" back in a structure like: <f...
Your project sounds intriguing and has several challenges to consider when designing a dynamic Java FAT client that communicates with a server using XML for UI representation. Here are some potential libraries and technologies, along with their pros and cons, to assist you in your development: ### 1. **Thinlet** - **P...
49,714
[ { "from": "human", "value": "My company currently evaluates the development of a Java FAT client. It should support a dynamic GUI and has as much logic as possible on the server side. Hence the idea came up to send the screen as XML to the FAT client, show it to the user and send the entered data similar to...
I'm trying to POST to the HTTP gateway of an SMS provider (Sybase 365) using CURL from a Linux shell script. I need to pass the following data (note the [ ] and LF characters) [MSISDN] List=+12345678 [MESSAGE] Text=Hello [END] If I submit a file using the -F parameter, CURL removes the LF e.g. curl -F @myfile "http://...
To maintain the line breaks in your data while using `curl`, you should use the `--data-binary` option instead of `-F`. The `-F` option is used for sending form data and treats the content differently, which is likely why you're losing the line breaks. Here’s how you can format your `curl` command using `--data-binary...
49,198
[ { "from": "human", "value": "I'm trying to POST to the HTTP gateway of an SMS provider (Sybase 365) using CURL from a Linux shell script.\nI need to pass the following data (note the [ ] and LF characters)\n[MSISDN]\nList=+12345678\n[MESSAGE]\nText=Hello\n[END]\n\nIf I submit a file using the -F parameter, ...
I'm currently designing a database schema that's used to store recipes. In this database there are different types of entities that I want to be able to tag (ingredients, recipe issuers, recipes, etc). So a tag has multiple n:m relations. If I use the "three table design", this would result in tables (cross table) for...
Your approach to simplifying the tagging system in your recipe database by using a single table for all entities (with a unique ID for each entity type) is indeed a valid and often-used design pattern, especially when you want to allow flexible tagging across various entity types without creating numerous cross tables....
48,273
[ { "from": "human", "value": "I'm currently designing a database schema that's used to store recipes. In this database there are different types of entities that I want to be able to tag (ingredients, recipe issuers, recipes, etc). So a tag has multiple n:m relations. If I use the \"three table design\", th...
SQL Server 2005 introduced Database Mail for sending e-mail messages from the SQL Server Database Engine in a robust fashion. Database Mail comes with a number of interesting views like sysmail_allitems, sysmail_sentitems, sysmail_faileditems, sysmail_unsentitems, sysmail_mailattachments and sysmail_event_log. Is there...
As of my last knowledge update in October 2023, there are several options for building a user-friendly front-end for monitoring SQL Server Database Mail. However, specific stand-alone solutions might be limited, especially those specifically designed for SQL Server 2005 and built in ASP.NET. Here are a few options that...
44,590
[ { "from": "human", "value": "SQL Server 2005 introduced Database Mail for sending e-mail messages from the SQL Server Database Engine in a robust fashion. Database Mail comes with a number of interesting views like sysmail_allitems, sysmail_sentitems, sysmail_faileditems, sysmail_unsentitems, sysmail_mailat...
I need to quickly build a parser for a very simplified version of a html-like markup language in Java. In python, I would use pyparsing library to do this. Is there something similar for Java? Please, don't suggest libraries already out there for html parsing, my application is a school assignment which will demonstrat...
If you are looking for a library in Java that allows you to create a parser similar to Python's `pyparsing`, you might want to consider using **ANTLR (ANother Tool for Language Recognition)** or **JavaCC (Java Compiler Compiler)**. Both libraries are capable of generating parsers from a grammar definition, making them ...
45,160
[ { "from": "human", "value": "I need to quickly build a parser for a very simplified version of a html-like markup language in Java. In python, I would use pyparsing library to do this. Is there something similar for Java? Please, don't suggest libraries already out there for html parsing, my application is ...
Please bear with me: this isn't a language debate or a flame. It's a real request for opinions. Occasionally, I have to help educate a traditional text coder in how to think in LabVIEW (LV). Often during this process, I get to hear about how LV sucks. Rarely is this insight accompanied by rational observations other...
Your request is very reasonable, and it’s important to understand the perspective of those transitioning from traditional text-based programming languages to LabVIEW (LV). Here are some detailed observations that developers often cite as challenges when working with LabVIEW, especially if they're more accustomed to tex...
46,003
[ { "from": "human", "value": "Please bear with me: this isn't a language debate or a flame. It's a real request for opinions.\nOccasionally, I have to help educate a traditional text coder in how to think in LabVIEW (LV). Often during this process, I get to hear about how LV sucks. Rarely is this insight ...
I have a control that is basically functioning as a client-side timer countdown control. I want to fire a server-side event when the count down has reached a certain time. Does anyone have an idea how this could be done? So, when timer counts down to 0, a server-side event is fired.
To fire a server-side event when a client-side countdown timer reaches zero, you can use a combination of JavaScript, AJAX, and server-side processing. Here's a general approach you can follow, using JavaScript for the countdown and AJAX to send a request to the server when the timer reaches zero. ### Step-by-Step Gui...
42,058
[ { "from": "human", "value": "I have a control that is basically functioning as a client-side timer countdown control.\nI want to fire a server-side event when the count down has reached a certain time.\nDoes anyone have an idea how this could be done?\nSo, when timer counts down to 0, a server-side event is...
Why does the following code print ‘read(): Resource temporarily unavailable’ 80% of the time? That is the EAGAIN code, which is the same as WOULD BLOCK which means there is no data waiting to be read, but select is returning 1 saying there is data (tested in Linux): #include <time.h> #include <unistd.h> #include <stdio...
The issue you're experiencing with the `read()` call returning `EAGAIN` (or `Resource temporarily unavailable`) in this code is related to how you're using the `select()` function and the characteristics of the device you're interacting with (in this case, `/dev/lp0`, which is a parallel port device). Here's a breakdow...
49,472
[ { "from": "human", "value": "Why does the following code print ‘read(): Resource temporarily unavailable’ 80% of the time? That is the EAGAIN code, which is the same as WOULD BLOCK which means there is no data waiting to be read, but select is returning 1 saying there is data (tested in Linux):\n#include <t...
Can we have a SQL query which will basically help in viewing table and index sizes in SQl Server. How SQL server maintains memory usage for tables/indexes?
Certainly! In SQL Server, you can use a combination of system views and built-in functions to gather information about table and index sizes. Here’s a query that retrieves the size of tables and their associated indexes in a SQL Server database. ### SQL Query to View Table and Index Sizes ```sql USE YourDatabaseName;...
49,554
[ { "from": "human", "value": "Can we have a SQL query which will basically help in viewing table and index sizes in SQl Server.\nHow SQL server maintains memory usage for tables/indexes?\n" }, { "from": "gpt", "value": "Certainly! In SQL Server, you can use a combination of system views and buil...
Description | A Java program to read a text file and print each of the unique words in alphabetical order together with the number of times the word occurs in the text. The program should declare a variable of type Map<String, Integer> to store the words and corresponding frequency of occurrence. Which concrete type, ...
Certainly! To implement a Java program that reads a text file and counts the frequency of unique words, we need to utilize a `Map` to store the words and their respective frequencies. In this case, a `TreeMap<String, Integer>` would be the most appropriate choice, as it keeps the keys (words) sorted in natural order (a...
49,760
[ { "from": "human", "value": "Description | A Java program to read a text file and print each of the unique words in alphabetical order together with the number of times the word occurs in the text. \nThe program should declare a variable of type Map<String, Integer> to store the words and corresponding freq...
In my asp.net mvc page I create a link that renders as followed: http://localhost:3035/Formula/OverView?colorId=349405&paintCode=744&name=BRILLANT%20SILVER&formulaId=570230 According to the W3C validator, this is not correct and it errors after the first ampersand. It complains about the & not being encoded and the ent...
You’ve raised an important point regarding the correct encoding of URLs and query strings in HTML. Here's a breakdown of how you should approach encoding in this context: ### Understanding Query Strings When constructing a URL, query strings are made up of key-value pairs separated by `&`. For example, in the URL: `...
48,831
[ { "from": "human", "value": "In my asp.net mvc page I create a link that renders as followed:\nhttp://localhost:3035/Formula/OverView?colorId=349405&paintCode=744&name=BRILLANT%20SILVER&formulaId=570230\nAccording to the W3C validator, this is not correct and it errors after the first ampersand. It complain...
I have an ATL control that I want to be Unicode-aware. I added a message handler for WM_UNICHAR: MESSAGE_HANDLER( WM_UNICHAR, OnUniChar ) But, for some reason, the OnUniChar handler is never called. According to the documentation, the handler should first be called with "UNICODE_NOCHAR", on which the handler should re...
To make your ATL control Unicode-aware and ensure that the `WM_UNICHAR` message is handled correctly, there are a few steps and considerations to keep in mind. 1. **Ensure Unicode Support in the Control**: Make sure that your ATL control is properly set up to support Unicode. This usually involves using the `WCHAR`...
49,849
[ { "from": "human", "value": "I have an ATL control that I want to be Unicode-aware. I added a message handler for WM_UNICHAR:\nMESSAGE_HANDLER( WM_UNICHAR, OnUniChar )\n\nBut, for some reason, the OnUniChar handler is never called.\nAccording to the documentation, the handler should first be called with \"U...
I'm setting up CruiseControl.NET and during the build I want to modify my version.txt file and have it checked in. When I do this, CruiseControl.NET doesn't know this checkin was done by the build and so the next time it checks sources, it sees there were modifications and rebuilds again (I have IfModificationExists s...
To handle the scenario where you're modifying a version.txt file during a build in CruiseControl.NET (CCNet) and want to avoid retriggering builds due to subsequent check-ins, you can utilize the following strategies: ### 1. **Using the `BeforeBuild` Task** Modify the `version.txt` file as part of the `BeforeBuild` st...
45,676
[ { "from": "human", "value": "I'm setting up CruiseControl.NET and during the build I want to modify my version.txt file and have it checked in. When I do this, CruiseControl.NET doesn't know this checkin was done by the build and so the next time it checks sources, it sees there were modifications and rebu...
How can I constrain a vertical WPF StackPanel's width to the most narrow item it contains. The StackPanel's width must not be greater than the width of any other child element.
In WPF, if you want to constrain the width of a vertical `StackPanel` to be no greater than the width of its narrowest child element, you can achieve this by using a combination of layout properties and possibly a few additional helper elements. However, `StackPanel` itself doesn't directly provide a property to constr...
48,803
[ { "from": "human", "value": "How can I constrain a vertical WPF StackPanel's width to the most narrow item it contains. The StackPanel's width must not be greater than the width of any other child element.\n" }, { "from": "gpt", "value": "In WPF, if you want to constrain the width of a vertical ...
How can I convert PDF files to HTML with Python? I was thinking something alone the lines of what Google does (or seems to do) to index PDF files. My final goal is to setup Apache to show the HTML for the PDF files, so anything leading me in that direction would also be appreciated.
Converting PDF files to HTML using Python can be achieved through various libraries. Here are some of the popular options along with step-by-step instructions: ### 1. **Using `pdf2htmlEX`** This tool is a great choice for converting PDF files to HTML while preserving the layout. #### Installation You might need to in...
48,353
[ { "from": "human", "value": "How can I convert PDF files to HTML with Python?\nI was thinking something alone the lines of what Google does (or seems to do) to index PDF files.\nMy final goal is to setup Apache to show the HTML for the PDF files, so anything leading me in that direction would also be apprec...
I'm having an issue with a project I am working on at the moment that is making use of the Validation plugin for jQuery, when the validation error appears I am dynamically applying an anchor tag to it with an onclick. And its this onclick thats the problem... The first time the validation error appears I have to click ...
It seems like you're experiencing an issue where the `onclick` event for the dynamically created anchor tag isn't firing on the first click. This is a common issue when dealing with dynamically generated elements in jQuery and can be attributed to several factors. Here are a few suggestions to help resolve the problem:...
46,582
[ { "from": "human", "value": "I'm having an issue with a project I am working on at the moment that is making use of the Validation plugin for jQuery, when the validation error appears I am dynamically applying an anchor tag to it with an onclick. And its this onclick thats the problem...\nThe first time the...
thank you. here is the correct question: { "VID":"60", "name":"\u4f1a\u9634", "requireLevel":"20", "levelMax":"5", "venationRequirement":"0", "description":"\u6c14\u6d77\u4e0a\u9650\u63d0\u9ad8[Affect1]\u70b9", "cost":{"1":"240","2":"360","3":"400","4":"600","5":"720"}, "difficult":{"1":...
It looks like you're trying to parse a JSON response in PHP and then use JavaScript to handle that response. However, using `eval()` for parsing JSON is not recommended due to security risks and potential errors. Instead, you should use `JSON.parse()` in JavaScript, which is specifically designed for this purpose. Her...
49,311
[ { "from": "human", "value": "thank you. here is the correct question:\n{\n \"VID\":\"60\",\n \"name\":\"\\u4f1a\\u9634\",\n \"requireLevel\":\"20\",\n \"levelMax\":\"5\",\n \"venationRequirement\":\"0\",\n \"description\":\"\\u6c14\\u6d77\\u4e0a\\u9650\\u63d0\\u9ad8[Affect1]\\u70b9\",\n ...
I'm searching for a document (not printed) that explains in details, but still simply, the subject of character encoding.
Character encoding is a fundamental concept in computer science and information technology that determines how characters are represented in binary format. Here’s a simple yet detailed overview of the subject: ### What is Character Encoding? Character encoding is the process of assigning numerical values (binary code...
46,469
[ { "from": "human", "value": "I'm searching for a document (not printed) that explains in details, but still simply, the subject of character encoding.\n" }, { "from": "gpt", "value": "Character encoding is a fundamental concept in computer science and information technology that determines how c...
I'm trying to find an zip compression and encryption component with encryption suitable for use by the US Federal Government, so I can't use Zip 2.0 encryption, it has to be AES or the like. I've already found SharpZipLib (can't do AES encyrption), and Chilkat (can do AES encryption, but costs money). Am I missing an...
If you are looking for a .NET library that supports ZIP compression with AES encryption and is suitable for use by the US Federal Government, you have several options. Here are a few libraries that you may consider: 1. **DotNetZip**: - DotNetZip is an open-source library that supports ZIP file creation, manipulatio...
47,080
[ { "from": "human", "value": "I'm trying to find an zip compression and encryption component with encryption suitable for use by the US Federal Government, so I can't use Zip 2.0 encryption, it has to be AES or the like. I've already found SharpZipLib (can't do AES encyrption), and Chilkat (can do AES encry...
The question has been asked: No PHP for large projects? Why not? It's a recurring theme and PHP developers--with some cause--are forced to defend PHP. All of these questions are valid and there have been some responses but this got me thinking. Based on the principle that you can write good code in any language and b...
Writing a large, complex, scalable, secure, and robust PHP application requires a combination of good software architecture, proper use of modern PHP features, and adherence to best practices. Here are some guidelines and technical strategies to help you achieve this: ### 1. **Architecture and Design Patterns** - **M...
48,010
[ { "from": "human", "value": "The question has been asked: No PHP for large projects? Why not? It's a recurring theme and PHP developers--with some cause--are forced to defend PHP.\nAll of these questions are valid and there have been some responses but this got me thinking. Based on the principle that you...
I am about to define an interface in my application that plug-in writers can implement to provide user-defined "export" capabilities. It'll look something like this: public interface IFooExporter { void ExportFoo(Foo foo, string path); } However, I need to let the plug-in writers know (explicitly, not just in docu...
Using `DirectoryInfo` instead of a `string` for the folder parameter in your `IFooExporter` interface is indeed a good solution for explicitly indicating that the argument represents a directory rather than a file path. Here are some advantages and considerations regarding this approach: ### Advantages of Using `Direc...
46,841
[ { "from": "human", "value": "I am about to define an interface in my application that plug-in writers can implement to provide user-defined \"export\" capabilities. It'll look something like this:\npublic interface IFooExporter\n{\n void ExportFoo(Foo foo, string path);\n}\n\nHowever, I need to let the p...
I have an intel assembly assignment. I need to write a calculator which uses 2 stacks. For example, i have an expression like 23+4/2^4$ .So that $ indicates the end of expression. What I will do is to have two stacks, one for numbers, one for operators and push and pop them according to the operator precedence. What I ...
Using two stacks in assembly language (specifically Intel x86 assembly) can be achieved by managing the stack pointer (`ESP`) manually to differentiate between the two stacks. Essentially, you'll have to allocate space for both stacks in memory and maintain two separate pointers to them. Here is a step-by-step guide on...
45,785
[ { "from": "human", "value": "I have an intel assembly assignment. I need to write a calculator which uses 2 stacks. For example, i have an expression like 23+4/2^4$ .So that $ indicates the end of expression. What I will do is to have two stacks, one for numbers, one for operators and push and pop them acco...
I have a window (derived from JFrame) and I want to disable the close button during certain operations which are not interruptible. I know I can make the button not do anything (or call a handler in a WindowListener) by calling setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); but I would like to make it clear vi...
To visually indicate that the close button is disabled during certain operations, you can customize the JFrame's close button by using a combination of `setDefaultCloseOperation` and modifying the appearance of the close button. While the button itself cannot be directly disabled, you can achieve a similar effect by ch...
46,370
[ { "from": "human", "value": "I have a window (derived from JFrame) and I want to disable the close button during certain operations which are not interruptible. I know I can make the button not do anything (or call a handler in a WindowListener) by calling\nsetDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLO...
I'm interested in the programming challenge presented by the game Bejewelled. It seems like a simple game but programmatically it's more complex that it looks. In my search for hints on how the board is evaluated, I came across this QUIZ put on by the good folks at Simple-Talk. They have posted the winning answer, bu...
Sure! Let's break down the provided SQL solution for detecting matches in a game like Bejeweled. The goal is to identify groups of three or more adjacent matching jewels on a grid. ### Step-by-Step Breakdown 1. **Match Definition**: The game looks for matches either horizontally or vertically. The `matches` table ...
48,631
[ { "from": "human", "value": "I'm interested in the programming challenge presented by the game Bejewelled. It seems like a simple game but programmatically it's more complex that it looks.\nIn my search for hints on how the board is evaluated, I came across this QUIZ put on by the good folks at Simple-Talk...
My university refused to allow us to access out mail via POP or IMAP etc so I want to write a GTK based C app that sits in my notifcation area and does the job of a mail client notifier. Because I can't use anything like POP or IMAP, what would be a good way to do it? I guess I could scrape the HTML and look for a tag...
Creating a GTK-based C application that acts as a mail notifier for your university email can be a good way to get notifications about unread messages without having direct access via POP or IMAP. Since you're restricted to using the web interface, scraping the HTML is indeed one possible approach. Here's a general out...
45,447
[ { "from": "human", "value": "My university refused to allow us to access out mail via POP or IMAP etc so I want to write a GTK based C app that sits in my notifcation area and does the job of a mail client notifier. Because I can't use anything like POP or IMAP, what would be a good way to do it? I guess I...
In my application data is stored in a .config file,(in XML format). User is able to set date on which he wants mail (like reminder through mail). So there should be a scheduler which will execute daily to send mails on target date to users. As there is no database interaction how is it possible to run scheduler? I am t...
To implement a scheduling system that sends emails based on user-defined dates stored in a `.config` XML file without a database, you can follow these general steps: ### 1. Structure of the XML Configuration File First, ensure your XML configuration file is structured in a way that makes it easy to read and process. ...
49,324
[ { "from": "human", "value": "In my application data is stored in a .config file,(in XML format). User is able to set date on which he wants mail (like reminder through mail). So there should be a scheduler which will execute daily to send mails on target date to users. As there is no database interaction ho...
This is also a question that I asked in a comment in one of Miško Hevery's google talks that was dealing with dependency injection but it got buried in the comments. I wonder how can the factory / builder step of wiring the dependencies together can work in C++. I.e. we have a class A that depends on B. The builder wil...
The challenge you are facing in C++ regarding memory management and dependency injection is quite common. In C++, you have to be explicit about ownership and the lifecycle of objects, as there's no built-in garbage collection as in some other languages. Here are a few strategies you could consider when implementing a f...
47,637
[ { "from": "human", "value": "This is also a question that I asked in a comment in one of Miško Hevery's google talks that was dealing with dependency injection but it got buried in the comments.\nI wonder how can the factory / builder step of wiring the dependencies together can work in C++.\nI.e. we have a...
I have a Master Detail relationship configured. The hbm file is below. When I run some code like this Favourite favourite = favourites.Find(f => f.Id== id); user.Favourites.Remove(favourite); m_UserRepository.Save(ref user); I get the error message NHibernate.Exceptions.GenericADOException: could not delete collection...
The error message you're encountering indicates that NHibernate is trying to update the `Favourites` collection when you remove an item from it. Specifically, it seems like NHibernate is attempting to perform an update that is trying to set the `UserId` column of the `Favourite` table to `NULL`, which is not allowed be...
49,405
[ { "from": "human", "value": "I have a Master Detail relationship configured. The hbm file is below. When I run some code like this\nFavourite favourite = favourites.Find(f => f.Id== id);\nuser.Favourites.Remove(favourite);\nm_UserRepository.Save(ref user);\n\nI get the error message\nNHibernate.Exceptions.G...
I'm trying to control the titles of my xterm windows and my cleverness has finally outpaced my knowledge. :-) I have three functions: one which sets the title of the window; one which takes a passed command, calls the title function, and executes the command; and one which resumes a job after using jobs to determine t...
It seems that the issue arises because the `run` function is substituting the command that was executed in place of a meaningful title when the job is resumed. What we want to do is capture the original command that was passed to the `run` function so that we can use it to set the title correctly when resuming the job....
49,875
[ { "from": "human", "value": "I'm trying to control the titles of my xterm windows and my cleverness has finally outpaced my knowledge. :-)\nI have three functions: one which sets the title of the window; one which takes a passed command, calls the title function, and executes the command; and one which res...
The mod_perl2 and Perl 5.10 two are playing nicely together, but I can't seem to find any positive information about Devel::Cover working with mod_perl2 under Win32. I'm currently using ActiveState's Perl 5.10, but I would be open to switching to Strawberry Perl if it meant this combination could work. Also, Devel::Co...
Getting `Devel::Cover` to work with `mod_perl2` under Win32 can be a bit challenging, especially since the compatibility of these components can vary based on the Perl distribution and the specific modules involved. Here's a general approach you could take to get `Devel::Cover` working with `mod_perl2`: ### Considerat...
49,767
[ { "from": "human", "value": "The mod_perl2 and Perl 5.10 two are playing nicely together, but I can't seem to find any positive information about Devel::Cover working with mod_perl2 under Win32. I'm currently using ActiveState's Perl 5.10, but I would be open to switching to Strawberry Perl if it meant thi...
How do you transfer a worksheet from one excel app(1) to another(2) if you have two excel apps open using VBA? The problem is, the programmer uses JavaScript, and when you click on the button that transfers the web data to a xl workbook, it opens a new Excel app. I know part of the code would be: Workbooks.Add ActiveSh...
Transferring a worksheet from one Excel application instance to another using VBA can be a bit tricky, especially when dealing with multiple instances of Excel. Below is a step-by-step guide on how you can achieve this. ### Step-by-Step Guide 1. **Create a New Workbook in App (2)**: When you have your new Excel appli...
49,375
[ { "from": "human", "value": "How do you transfer a worksheet from one excel app(1) to another(2) if you have two excel apps open using VBA?\nThe problem is, the programmer uses JavaScript, and when you click on the button that transfers the web data to a xl workbook, it opens a new Excel app.\nI know part o...
I'm writing a PHP application with testability in mind, so my classes always ask in their constructors for the "collaborator objects" they depend on, in respect to the Dependency Injection pattern. That way, I'm able to pass in mocks or test implementations in my unit tests. What I want to achieve though, is to be able...
Your approach of using null values in the constructor to trigger the fallback mechanism for creating default implementations of dependencies is a valid solution and aligns well with the principles of Dependency Injection. It keeps your classes flexible and testable while also providing a way to fall back on defaults wh...
47,968
[ { "from": "human", "value": "I'm writing a PHP application with testability in mind, so my classes always ask in their constructors for the \"collaborator objects\" they depend on, in respect to the Dependency Injection pattern.\nThat way, I'm able to pass in mocks or test implementations in my unit tests.\...
I am having a problem with binding values in my ActionScript components. I basically want to set the value of a a variable in my component to a value in the model, and have the component variable automatically update when the model value is updated. I think that I just don't fully understand how data binding works in F...
In ActionScript and Flex, data binding works differently in MXML versus ActionScript-only components. To achieve data binding, you have to ensure that the properties you're trying to bind to are set up correctly and that the classes involved in data binding notify the binding system when their values change. Here are ...
48,701
[ { "from": "human", "value": "I am having a problem with binding values in my ActionScript components. I basically want to set the value of a a variable in my component to a value in the model, and have the component variable automatically update when the model value is updated. I think that I just don't ful...
I have a program in Perl I'm working on where I would need multiple keys, and a way of giving each key multiple values and follow that by being able to both read them in and write them out to an external file depending on if the key matches what the person enters into standard input. I've looked across several sites an...
Absolutely! You can use hashes of arrays in Perl to achieve what you described. This will allow you to have multiple values for each key. Additionally, I will provide a simple example of how to read from and write to an external file with this structure. Here’s a basic outline of how you can set this up: 1. **Create ...
46,832
[ { "from": "human", "value": "I have a program in Perl I'm working on where I would need multiple keys, and a way of giving each key multiple values and follow that by being able to both read them in and write them out to an external file depending on if the key matches what the person enters into standard i...
I'm trying to insert a column into an existing DataSet using C#. As an example I have a DataSet defined as follows: DataSet ds = new DataSet(); ds.Tables.Add(new DataTable()); ds.Tables[0].Columns.Add("column_1", typeof(string)); ds.Tables[0].Columns.Add("column_2", typeof(int)); ds.Tables[0].Columns.Add("column_4", ty...
In ADO.NET, a `DataTable` does not provide a direct method to insert a column at a specific position within the `Columns` collection, but you can achieve this by using a couple of methods. While there is no built-in `InsertAfter` method, you can manipulate the `Columns` collection by creating a new column and then movi...
45,658
[ { "from": "human", "value": "I'm trying to insert a column into an existing DataSet using C#.\nAs an example I have a DataSet defined as follows:\nDataSet ds = new DataSet();\nds.Tables.Add(new DataTable());\nds.Tables[0].Columns.Add(\"column_1\", typeof(string));\nds.Tables[0].Columns.Add(\"column_2\", typ...
My application is developped in C++ using Qt and is using signals and slots. Let's say I have the following classes (pseudo-C++ code) : class Ball { Color m_Color; int m_Size; }; class Player { public: setBall(Ball* pBall) { if (pBall != m_pBall) { Ball* pPreviousBall = m_pB...
The issue you are encountering is quite common when implementing undo/redo functionality, especially when managing resources such as objects (like balls) that can be deleted and may have shared ownership across different entities (like players). Here’s a potential solution that balances the need for tracking states whi...
46,455
[ { "from": "human", "value": "My application is developped in C++ using Qt and is using signals and slots.\nLet's say I have the following classes (pseudo-C++ code) :\nclass Ball\n{\n Color m_Color;\n int m_Size;\n};\n\nclass Player\n{\npublic:\n setBall(Ball* pBall)\n {\n if (pBall != m_p...
I'm using HTTPService with a POST operation to submit a Base64 encoded file (taken from bitmap data within the app) but I could really do with getting some idea of the progress of the POST operation (e.g. like the FileReference.upload()). I don't think this is possible, but it would be awesome if it is (via any means, ...
In the context of making HTTP requests and managing progress in Flash or ActionScript, the HTTPService class does not provide built-in support for progress tracking during POST operations. However, you can achieve a similar functionality by using `URLLoader` in combination with `URLRequest`. The `URLLoader` class allow...
49,625
[ { "from": "human", "value": "I'm using HTTPService with a POST operation to submit a Base64 encoded file (taken from bitmap data within the app) but I could really do with getting some idea of the progress of the POST operation (e.g. like the FileReference.upload()).\nI don't think this is possible, but it ...
I have a table with 7M records I want to trim down to 10k for dev. I tried a delete, but the whole world was nearly overpowered by the transaction log size, so I truncated the table. Now I wish to insert 10k records from the original table, into my dev table, but it has a identity column, and many, many other columns,...
It sounds like you’re encountering a common issue where SSIS packages do not automatically refresh their metadata to include new database objects like views or tables. Here are some steps you can take to resolve this and insert your 10,000 records successfully: ### Steps to Refresh SSIS Package Metadata 1. **Reopen t...
49,766
[ { "from": "human", "value": "I have a table with 7M records I want to trim down to 10k for dev. I tried a delete, but the whole world was nearly overpowered by the transaction log size, so I truncated the table.\nNow I wish to insert 10k records from the original table, into my dev table, but it has a iden...
At home, I use CTRL+SHIFT+B or F7 or whatever key sequence initiates the build for my build tool. At work, this doesn't quite cut it. At my first job (an internship) we used a product called Visual Build, which I have come to like very much. It's the best build tool I've ever worked with. The down side here is that ...
It sounds like you're looking for a build tool that combines the best of both worlds: the ease of use and flexibility of a GUI with the power of scripting capabilities. Here are a few options to consider that meet your criteria: ### 1. **Jenkins with GUI Plugins** While Jenkins is primarily known as a continuous integ...
48,149
[ { "from": "human", "value": "At home, I use CTRL+SHIFT+B or F7 or whatever key sequence initiates the build for my build tool. At work, this doesn't quite cut it.\nAt my first job (an internship) we used a product called Visual Build, which I have come to like very much. It's the best build tool I've ever...
I was wondering whether the object to test should be a field and thus set up during a SetUp method (ie. JUnit, nUnit, MS Test, …). Consider the following examples (this is C♯ with MsTest, but the idea should be similar for any other language and testing framework): public class SomeStuff { public string Value { get...
When deciding whether to use a setup method or to instantiate objects directly within each test method, there are several factors to consider. Both approaches have their pros and cons, and the choice depends on the specific context of your testing needs. Here’s a breakdown of each approach and some best practices to co...
49,226
[ { "from": "human", "value": "I was wondering whether the object to test should be a field and thus set up during a SetUp method (ie. JUnit, nUnit, MS Test, …).\nConsider the following examples (this is C♯ with MsTest, but the idea should be similar for any other language and testing framework):\npublic clas...
I am trying to print a pdf report and it is not printing and giving this error. Error Type: ComReport (0x800A01AD) ActiveX component can't create object I have registered the ComReport.dll with my OS. This works fine on our developemtn and production server but is not working locally on my machine. And I need for it ...
The error you are encountering, `ComReport (0x800A01AD) ActiveX component can't create object`, indicates that there is a problem with creating an instance of the `ComReport` ActiveX component on your local machine. Since it works on your development and production servers, the issue is likely related to your local env...
49,983
[ { "from": "human", "value": "I am trying to print a pdf report and it is not printing and giving this error. \nError Type:\nComReport (0x800A01AD)\nActiveX component can't create object\nI have registered the ComReport.dll with my OS.\nThis works fine on our developemtn and production server but is not work...
I have a bunch of tables in a sql server database (all with a certain prefix, e.g. ABC_table1), and I want to move ALL tables with this prefix to another database. Is there a way in which this can be done? I am using SQL Server 2k5. Thanks
Yes, you can move tables with a specific prefix from one SQL Server database to another, but keep in mind that SQL Server 2005 does not have native functionality for this operation. You will have to script it out. Below is a general approach you can take using Transact-SQL (T-SQL): ### Steps to Move Tables: 1. **Iden...
49,771
[ { "from": "human", "value": "I have a bunch of tables in a sql server database (all with a certain prefix, e.g. ABC_table1), and I want to move ALL tables with this prefix to another database.\nIs there a way in which this can be done?\nI am using SQL Server 2k5.\nThanks\n" }, { "from": "gpt", "...
We have to accept large file uploads (video content) and want to do that in a way that works well across all standards-compliant browsers and plug-ins. Our current setup looks like this: SWFUpload input type="file" for graceful degradation On the server-side, we have nginx and the upload module streaming the uploaded...
Given the issues you are experiencing with Flash-based uploads, it's advisable to move towards modern HTML5 solutions for file uploads, as Flash is being phased out and support for it is being deprecated in many browsers. Fortunately, there are several approaches and libraries you can consider that provide a robust sol...
46,147
[ { "from": "human", "value": "We have to accept large file uploads (video content) and want to do that in a way that works well across all standards-compliant browsers and plug-ins. Our current setup looks like this:\n\nSWFUpload\ninput type=\"file\" for graceful degradation\n\nOn the server-side, we have ng...
I am using ASP.NET membership for the authentication of my web app. This worked great for me. I now have to implement password expiration. If the password has expired the user should be redirected to ChangePassword screen and should not be allowed access to any other part of the application without changing the passwor...
Implementing password expiration in an ASP.NET web application using membership can indeed be approached in several ways. Instead of placing the password expiration check in every `aspx` page's `OnInit` event, which can be cumbersome and error-prone, you might consider the following alternatives that centralize the log...
46,094
[ { "from": "human", "value": "I am using ASP.NET membership for the authentication of my web app. This worked great for me. I now have to implement password expiration.\nIf the password has expired the user should be redirected to ChangePassword screen and should not be allowed access to any other part of th...
I've been working with Microsoft SQL Server with many years now but have only just recently started to use MySQL with my web applications, and I'm hungry for knowledge. To continue with the long line of "hidden feature" questions, I would like to know any hidden or handy features of MySQL which will hopefully improve m...
Certainly! MySQL has a variety of features that may not be immediately obvious, especially if you're coming from a SQL Server background. Here are some handy features and tips that can enhance your experience with MySQL: 1. **Data Types**: - MySQL has a variety of data types, including `ENUM` and `SET`, which can b...
45,692
[ { "from": "human", "value": "I've been working with Microsoft SQL Server with many years now but have only just recently started to use MySQL with my web applications, and I'm hungry for knowledge.\nTo continue with the long line of \"hidden feature\" questions, I would like to know any hidden or handy feat...
Setup is following: Drupal project, one svn repo with trunk/qa/production-ready branches, vhosts for every branch, post-commit hook that copies files from repository to docroots. Problem is following: Drupal website often relies not only on source code but on DB data too (node types, their settings, etc.). I'm looking...
You're encountering a common challenge in Drupal development: keeping your database schema and content in sync with your code. Fortunately, there are tools and practices that can help you achieve version-controlled database changes in a manner similar to fixtures in unit tests. Here are some options to consider: ### ...
48,932
[ { "from": "human", "value": "Setup is following:\nDrupal project, one svn repo with trunk/qa/production-ready branches, vhosts for every branch, post-commit hook that copies files from repository to docroots.\nProblem is following: Drupal website often relies not only on source code but on DB data too (node...
I have plsql procedure which accepts certain parameters e.g. v_name, v_country, v_type. I wish to have a cursor with a select statement like this: select column from table1 t1, table2 t2 where t1.name = v_name and t1.country = v_country and t1.id = t2.id and t2.type = v_type If certain parameters are empty can I only ...
Yes, you can conditionally construct the SQL query in PL/SQL based on whether the parameters are empty or not. One common approach to achieve this is to use dynamic SQL with the `EXECUTE IMMEDIATE` statement. However, a simpler approach, which maintains the query in a more straightforward way, is to use a static cursor...
48,725
[ { "from": "human", "value": "I have plsql procedure which accepts certain parameters e.g. v_name, v_country, v_type.\nI wish to have a cursor with a select statement like this:\nselect column from table1 t1, table2 t2\nwhere t1.name = v_name\nand t1.country = v_country\nand t1.id = t2.id\nand t2.type = v_ty...
How would one go about adding a submenu item to the windows explorer context menu (like for example 7-Zip does) for a Java application?
Adding a submenu item to the Windows Explorer context menu for a Java application involves modifying the Windows Registry. This can be done programmatically using Java, but it requires running with elevated permissions because modifying the registry is a sensitive operation. Here's a step-by-step guide on how you can ...
48,752
[ { "from": "human", "value": "How would one go about adding a submenu item to the windows explorer context menu (like for example 7-Zip does) for a Java application?\n" }, { "from": "gpt", "value": "Adding a submenu item to the Windows Explorer context menu for a Java application involves modifyi...
I am trying to create a serial port in VB.net using code only. Because I am creating a class library I cannot use the built-in component. I have tried instantiating a new SeialPort() object, but that does not seem to be enough. I'm sure there is something simple I am missing and any help would be greatly appreciated! T...
In VB.NET, when you're working with the `SerialPort` class to handle serial communication, you'll need to ensure that you're properly subscribing to the `DataReceived` event. This event is crucial for reading incoming data from the serial port asynchronously. Here’s a step-by-step guide on how to set up the `SerialPor...
45,626
[ { "from": "human", "value": "I am trying to create a serial port in VB.net using code only. Because I am creating a class library I cannot use the built-in component. I have tried instantiating a new SeialPort() object, but that does not seem to be enough. I'm sure there is something simple I am missing and...
I am using a ASP/.Net webpage and i want to upload a pdf file into a SQL Database as a binary I am uping the build in upload control, can you please suggest a way of doing this. I also need to no how to read the pdf back and display it in a web browser. I will be using linq to upload and query my sql database.
To upload a PDF file to a SQL database and read it back using ASP.NET with LINQ, you can follow these steps: ### Step 1: Setting Up Your SQL Database Make sure you have a SQL Server table to store your PDF files. Below is an example of a simple table structure: ```sql CREATE TABLE PdfFiles ( Id INT PRIMARY KEY I...
41,065
[ { "from": "human", "value": "I am using a ASP/.Net webpage and i want to upload a pdf file into a SQL Database as a binary I am uping the build in upload control, can you please suggest a way of doing this. I also need to no how to read the pdf back and display it in a web browser. I will be using linq t...
i need a Regular Expression to convert a a string to a link.i wrote something but it doesnt work in asp.net.i couldnt solve and i am new in Regular Expression.This function converts (bkz: string) to (bkz: show.aspx?td=string) Dim pattern As String = "&lt;bkz[a-z0-9$-$&-&.-.ö-öı-ış-şç-çğ-ğü-ü\s]+)&gt;" Dim regex As New ...
To create a Regular Expression (Regex) that matches the string pattern you described and converts `(bkz: string)` to `(bkz: show.aspx?td=string)`, you need to ensure that the pattern correctly identifies the substring you want to replace while accounting for special characters and formatting. ### Issues with the Curr...
49,391
[ { "from": "human", "value": "i need a Regular Expression to convert a a string to a link.i wrote something but it doesnt work in asp.net.i couldnt solve and i am new in Regular Expression.This function converts (bkz: string) to (bkz: show.aspx?td=string)\nDim pattern As String = \"&lt;bkz[a-z0-9$-$&-&.-.ö-ö...
I want to programmatically invoke an event handler for a control. For example: DateTimePicker dtpLastConsummated; I want to trigger the TextChanged event handler for the dtpLastConsummated, how can i do it? In other languages I would call something akin to: dtpLastConsummated.TextChanged(this, new EventArgs()); but i...
You're correct in that directly invoking events in .NET can be a bit tricky due to the way events are implemented. In .NET, events can have multiple subscribers, and they are generally raised through protected methods named `OnEventName`, which are invoked whenever the event occurs. Your `FireEvent` utility function i...
46,388
[ { "from": "human", "value": "I want to programmatically invoke an event handler for a control. For example:\nDateTimePicker dtpLastConsummated;\n\nI want to trigger the TextChanged event handler for the dtpLastConsummated, how can i do it?\nIn other languages I would call something akin to:\ndtpLastConsumma...
I'm using AS3 (Flash) to read SVG files and display them. The problem is correctly displaying a linear/radial gradient. Following is an example of a simple linear gradient from Red to Blue, in SVG. <linearGradient id="GRADIENT_1" gradientUnits="userSpaceOnUse" x1="107.3938" y1="515.5684" x2="105.2488" y2="428.8614" gra...
To create a proper gradient matrix for use in ActionScript 3 (AS3) using the SVG linear gradient data, we need to derive the necessary parameters from the SVG values provided. Let's break down the steps to calculate the width, height, rotation angle, translation x, and translation y. ### Step 1: Calculate the Width an...
47,456
[ { "from": "human", "value": "I'm using AS3 (Flash) to read SVG files and display them.\nThe problem is correctly displaying a linear/radial gradient.\nFollowing is an example of a simple linear gradient from Red to Blue, in SVG.\n<linearGradient id=\"GRADIENT_1\" gradientUnits=\"userSpaceOnUse\"\nx1=\"107.3...
I'd like to gather metrics on specific routines of my code to see where I can best optimize. Let's take a simple example and say that I have a "Class" database with multiple "Students." Let's say the current code calls the database for every student instead of grabbing them all at once in a batch. I'd like to see how l...
Your current approach to measuring the execution time of specific routines using `DateTime` objects is a valid way to profile code performance, especially for simple scenarios. However, there are more sophisticated and flexible approaches to gathering metrics that can provide you with deeper insights and better analysi...
49,131
[ { "from": "human", "value": "I'd like to gather metrics on specific routines of my code to see where I can best optimize. Let's take a simple example and say that I have a \"Class\" database with multiple \"Students.\" Let's say the current code calls the database for every student instead of grabbing them ...
I really want to know if I'm missing anything obvious in the software I'm developing. What User Interface features that you consider important are often missing in most software?
When developing software, it's easy to overlook certain user interface (UI) features that can significantly enhance usability and overall user experience. Here are some important UI features that are often missing in many applications: 1. **Consistent Navigation**: Clear and consistent navigation throughout the applic...
48,746
[ { "from": "human", "value": "I really want to know if I'm missing anything obvious in the software I'm developing.\nWhat User Interface features that you consider important are often missing in most software?\n" }, { "from": "gpt", "value": "When developing software, it's easy to overlook certai...
I have a Delphi 2009 program that handles a lot of data and needs to be as fast as possible and not use too much memory. What small simple changes have you made to your Delphi code that had the biggest impact on the performance of your program by noticeably reducing execution time or memory use? Thanks everyone for al...
Optimizing Delphi code for performance and memory usage can yield significant improvements. Here are several small, simple changes you might consider to enhance the speed and efficiency of your Delphi 2009 application: ### 1. Use Local Variables Accessing local variables is faster than accessing global or instance var...
46,786
[ { "from": "human", "value": "I have a Delphi 2009 program that handles a lot of data and needs to be as fast as possible and not use too much memory.\nWhat small simple changes have you made to your Delphi code that had the biggest impact on the performance of your program by noticeably reducing execution t...
I have a form that will multiple Panel controls stacked on top of each other, each one being shown/hidden based on other selected options on the form. This has been a real pain to manage in the form designer as the panels don't behave like a full TabControl. However, it doesn't look like you can use a TabControl withou...
If you're looking to manage multiple panels in a Windows Forms application but find that handling multiple Panel controls can be cumbersome, you do have a couple of alternatives that can simplify your layout and logic without the need for traditional tabs. ### Options for TabControl-like Behavior Without Tabs 1. **Ta...
49,336
[ { "from": "human", "value": "I have a form that will multiple Panel controls stacked on top of each other, each one being shown/hidden based on other selected options on the form. This has been a real pain to manage in the form designer as the panels don't behave like a full TabControl. However, it doesn't ...
I am getting this error when I am running my eclipselink project. [EL Warning]: 2008.12.05 11:47:08.056--java.lang.NoClassDefFoundError: org/jboss/resource/adapter/jdbc/ValidConnectionChecker was thrown on attempt of PersistenceLoadProcessor to load class com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker. T...
The error you're encountering indicates that your EclipseLink setup is trying to load a class from the JBoss resource adapter (specifically `org.jboss.resource.adapter.jdbc.ValidConnectionChecker`), but it cannot find it. This issue typically arises when your EclipseLink configuration is set to use a JBoss-specific con...
41,380
[ { "from": "human", "value": "I am getting this error when I am running my eclipselink project.\n\n[EL Warning]: 2008.12.05 11:47:08.056--java.lang.NoClassDefFoundError: org/jboss/resource/adapter/jdbc/ValidConnectionChecker was thrown on attempt of PersistenceLoadProcessor to load class com.mysql.jdbc.integ...
My application will read xml from urlconnection. The xml encoding is ISO-8859-1, it contains é character. I use xerces saxparser to parse received xml content. However, é can not be parsed correctly while running application under lunix OS. Everything works fine in Windows. Could you guys please give me some hints? Tha...
The issue you're encountering is likely related to how character encodings are handled differently on Windows and Linux systems. The fact that the XML is encoded in ISO-8859-1 but isn't being parsed correctly in Linux suggests that the encoding might not be correctly specified or managed during the parsing process. He...
49,428
[ { "from": "human", "value": "My application will read xml from urlconnection. The xml encoding is ISO-8859-1, it contains é character. I use xerces saxparser to parse received xml content. However, é can not be parsed correctly while running application under lunix OS. Everything works fine in Windows. Coul...
is there any support in Mac OS X for signing data using smartcards? I have looked through the system headers and found only vauge references to smart card support (in SecKeychain.h), which didn't really take me anywhere. If there's no built-in support, which are my options (ie. what free/non-free libraries exist that c...
Yes, macOS has support for smart card integration, primarily through its Keychain framework. However, the implementation can sometimes be less direct than expected, especially if you're looking to perform cryptographic operations like signing directly with a smart card. ### Built-in Support 1. **Keychain Services**: m...
49,591
[ { "from": "human", "value": "is there any support in Mac OS X for signing data using smartcards? I have looked through the system headers and found only vauge references to smart card support (in SecKeychain.h), which didn't really take me anywhere.\nIf there's no built-in support, which are my options (ie....
I need help with the best practice to localize asp mvc apps, I saw Oxite having a base method named Localize in the BaseController, but is the Localization a task for the view or the Controller? Or should I use resx files / or use db tables?
Localizing ASP.NET MVC applications is an important aspect of making your app accessible to users in different languages and cultures. The approach you take can depend on your specific requirements and preferences. Here are some best practices and options to consider: ### Best Practices for Localization 1. **Use Reso...
47,592
[ { "from": "human", "value": "I need help with the best practice to localize asp mvc apps,\nI saw Oxite having a base method named Localize in the BaseController, but is the Localization a task for the view or the Controller?\nOr should I use resx files / or use db tables?\n" }, { "from": "gpt", ...
I'm trying to create a script to update a password in a non-interactive way. It's working on my laptop but fails on my server. Both are running the same configuration, using Etch. This is the script: #!/usr/bin/expect -f # Change user passwd set timeout 30 strace 4 set password [lindex $argv 1] set old_password [lindex...
It appears that the issue with your Expect script is related to timing and how the `passwd` command interacts with the terminal environment on your server. There are several potential reasons for this inconsistency between your laptop and server: 1. **Environment Differences**: There may be differences in the versions...
48,423
[ { "from": "human", "value": "I'm trying to create a script to update a password in a\nnon-interactive way. It's working on my laptop but fails on my server.\nBoth are running the same configuration, using Etch.\nThis is the script:\n#!/usr/bin/expect -f\n# Change user passwd\nset timeout 30\nstrace 4\nset p...
I am building web client for CodeCentral web service from CodeGear web site. I need to restrict number of items return by Search operation of CodeGear web service, say it, 10 per page. This way I can minimize loading of my web page. I just don't know how to do it. Any ideas?
To implement pagination in your web client for the CodeCentral web service, you will need to utilize any query parameters that the web service provides for limiting the number of results returned by the Search operation. Typically, web services support pagination through parameters like `limit` and `offset` (or `page`)...
49,950
[ { "from": "human", "value": "I am building web client for CodeCentral web service from CodeGear web site.\nI need to restrict number of items return by Search operation of CodeGear web service, say it, 10 per page. This way I can minimize loading of my web page.\nI just don't know how to do it. Any ideas?\n...
i'm currently working on a project where i have to deal with sql server 2008 geography types. As big parts of the projects uses NHibernate as ORM i wonder how much work it will be to use/extend NHibernate.Spatial with this type (as far as i can see Nh Spatial only supports the geometry type yet). Btw. are there any oth...
Working with SQL Server 2008 geography types in NHibernate can be challenging, especially since NHibernate.Spatial primarily focuses on the geometry type. However, it is possible to extend NHibernate to support geography types, though this may require a significant amount of custom implementation. ### Steps to Extend ...
48,254
[ { "from": "human", "value": "i'm currently working on a project where i have to deal with sql server 2008 geography types.\nAs big parts of the projects uses NHibernate as ORM i wonder how much work it will be to use/extend NHibernate.Spatial with this type (as far as i can see Nh Spatial only supports the ...
I am using Winforms Reporting Services (RDLC) to generate a report that has a subreport. My problem is the subreport isn't being filtered by the parent ID. A simple example of the data model might be a Department which contains Employees. In the report I want to show all Departments and have a subreport to show the E...
To properly link a subreport to its parent report in RDLC while filtering based on the parent report's data, you need to ensure that you are passing the correct parameters from the parent report to the subreport and that the subreport is set up to filter its data based on those parameters. Here's how to do that step by...
49,854
[ { "from": "human", "value": "I am using Winforms Reporting Services (RDLC) to generate a report that has a subreport.\nMy problem is the subreport isn't being filtered by the parent ID. \nA simple example of the data model might be a Department which contains Employees.\nIn the report I want to show all De...
I am trying to establish the best practice for handling the creation of child objects when the parent object is incomplete or doesn't yet exist in a web application. I want to handle this in a stateless way so in memory objects are out. For example, say we have a bug tracking application. A Bug has a title and a descri...
Handling the creation of child objects (like attachments) when the parent object (like a bug) doesn't yet exist requires careful consideration of how to manage these relationships in a stateless manner. Here are some best practices you might consider: ### 1. **Temporary Storage for Attachments:** Use a temporary stora...
47,406
[ { "from": "human", "value": "I am trying to establish the best practice for handling the creation of child objects when the parent object is incomplete or doesn't yet exist in a web application. I want to handle this in a stateless way so in memory objects are out.\nFor example, say we have a bug tracking a...
I have a JFrame. This JFrame contains a JButton. I click the JButton and 10 JTextFields are created. the problem: I cannot see them until "I force a repaint()" by resizing the window. Only then do I see the JTextFields created. CODE: JPanel points = new JPanel(); //Creating the JTextFields: for (int i=0; i<10; i++) { ...
It's great to hear that you've resolved your issue! In Swing, when you dynamically add components (like your `JTextFields`) to a `JPanel`, it's important to inform the layout manager to re-layout the components. This is where the `validate()` method comes in handy. When you call `points.validate()`, it forces the layo...
47,878
[ { "from": "human", "value": "I have a JFrame. This JFrame contains a JButton. I click the JButton and 10 JTextFields are created.\nthe problem:\nI cannot see them until \"I force a repaint()\" by resizing the window. Only then do I see the JTextFields created.\nCODE:\nJPanel points = new JPanel();\n\n//Crea...
I've got a XAML FlowDocument containing a table with a lot of rows, spanning multiple pages, and I'm converting this FlowDocument to XPS. Now I'm looking for a way to repeat the header of the table on each page. I see two possible approaches: Get the table to automagically print the header on each page. Somehow by pr...
When working with a `FlowDocument` in WPF and trying to create a paginated table where the header repeats on each page when converting to XPS, you'll need to use a combination of techniques, as WPF doesn't automatically repeat table headers on multiple pages. Here's a general approach to achieve what you want: ### Ap...
45,584
[ { "from": "human", "value": "I've got a XAML FlowDocument containing a table with a lot of rows, spanning multiple pages, and I'm converting this FlowDocument to XPS.\nNow I'm looking for a way to repeat the header of the table on each page.\nI see two possible approaches: \n\nGet the table to automagically...
I am looking at embedding perl 5.10 in a large C++ application compiled with VC++ 6.0. This leads to two questions. 1) Is it a bad idea to simply use Strawberry Perl as a dependency rather than compile my own perl with VC++ 6.0? Would Strawberry even work given the compiler mismatch? I presume Strawberry is compiled...
Embedding Perl in a C++ application can be a powerful way to extend functionality, but doing so with a mix of different compilers (like VC++ 6.0 and MinGW) introduces several challenges. Let's address your questions: ### 1. Using Strawberry Perl as a Dependency Using Strawberry Perl as a dependency is generally more ...
48,190
[ { "from": "human", "value": "I am looking at embedding perl 5.10 in a large C++ application compiled with VC++ 6.0. This leads to two questions.\n1) Is it a bad idea to simply use Strawberry Perl as a dependency rather than compile my own perl with VC++ 6.0? Would Strawberry even work given the compiler m...
If I make changes in the trunk to 3 different files, say revisions 40, 45, and 47 respectively, where none of those files have changed since revision 15, how can I merge those revisions into the branch (made at revision 30 and unchanged since) so that I get just the changes between rev 15 and rev 40, 45, and 47 for eac...
To merge only the specific changes from revisions 40, 45, and 47 of the trunk into your branch (which was created at revision 30), you can follow these steps in a version control system like Subversion (SVN). The objective is to apply only the changes made to the specific files in the trunk from the revisions you are i...
49,898
[ { "from": "human", "value": "If I make changes in the trunk to 3 different files, say revisions 40, 45, and 47 respectively, where none of those files have changed since revision 15, how can I merge those revisions into the branch (made at revision 30 and unchanged since) so that I get just the changes betw...
I wish to build a compiler (GCC port) for Linux, so that the built GCC runs on Windows and creates executables for an embedded platform. Is the above possible?
Yes, building a GCC (GNU Compiler Collection) port for Linux that can compile code for Windows and target an embedded platform is indeed possible. This process typically involves cross-compilation, where you build a compiler that produces executables for a different platform than the one on which the compiler itself is...
43,808
[ { "from": "human", "value": "I wish to build a compiler (GCC port) for Linux, so that the built GCC runs on Windows and creates executables for an embedded platform.\nIs the above possible?\n" }, { "from": "gpt", "value": "Yes, building a GCC (GNU Compiler Collection) port for Linux that can com...
It certainly looks like a bug, but I only have the trial version so it may have been fixed. ITestInterface = interface ['{9445CED8-4DBA-4EDB-9897-60980B438BE4}'] procedure Foo1; procedure Foo2; end; TTest = class(TInterfacedObject, ITestInterface) end; The above will rightly not compile. but the following does...
The behavior you're observing in Delphi (or any Pascal-like language) regarding interfaces and generics can indeed be a bit confusing at first, especially with regards to how interfaces and generics are handled in terms of compilation and instantiation. ### Explanation 1. **Non-Generic Interface**: In the first ex...
43,129
[ { "from": "human", "value": "It certainly looks like a bug, but I only have the trial version so it may have been fixed.\nITestInterface = interface\n ['{9445CED8-4DBA-4EDB-9897-60980B438BE4}']\n procedure Foo1;\n procedure Foo2;\nend;\n\nTTest = class(TInterfacedObject, ITestInterface)\n\nend;\n\nThe ab...
I'm running the following code that errors when I try to commit my changes using Cayenne as my ORM. The code is pasted below and errors out on the context.commitChanges();line. The output messages are pasted below the code. Any help on figuring this out would be appreciated. import org.apache.cayenne.access.DataCo...
It looks like you're experiencing a `NullPointerException` when trying to commit changes to your database using Apache Cayenne. This often happens due to issues with the object you're trying to persist or a misconfiguration in your ORM setup. Here are some potential areas to investigate: ### 1. **Check Object Configur...
49,991
[ { "from": "human", "value": "I'm running the following code that errors when I try to commit my changes using Cayenne as my ORM. The code is pasted below and errors out on the context.commitChanges();line. The output messages are pasted below the code. Any help on figuring this out would be appreciated...
Is there an easy or straightforward way in Java to output the results of a DB Query to a file (either csv, tab, etc). Perhaps even in Hibernate? I know that a query results can be dumped to a flat file on the DB Server. I am looking for a way that an application can run a query and get those results into a file. I re...
To output the results of a database query to a file using Java, especially if you're working with Hibernate, there is no built-in feature in Hibernate itself that directly supports writing query results to a file. However, you can achieve this through a combination of standard Java I/O and JDBC (or Hibernate). Here's a...
44,940
[ { "from": "human", "value": "Is there an easy or straightforward way in Java to output the results of a DB Query to a file (either csv, tab, etc). Perhaps even in Hibernate?\nI know that a query results can be dumped to a flat file on the DB Server. I am looking for a way that an application can run a que...
What are some good links for diving into Haskell and functional programming in general?
Diving into Haskell and functional programming can be a rewarding journey! Here are some valuable resources, including tutorials, books, and online courses that can help you get started: ### Online Tutorials and Resources 1. **Haskell Official Documentation**: - [Haskell.org](https://www.haskell.org/documentation/)...
49,661
[ { "from": "human", "value": "What are some good links for diving into Haskell and functional programming in general?\n" }, { "from": "gpt", "value": "Diving into Haskell and functional programming can be a rewarding journey! Here are some valuable resources, including tutorials, books, and onlin...
I downloaded the Guidance Automation Toolkit for VS 2008 and in the middle of the install there was an error forcing it to close. Now whenever i re-run the GuidanceAutomationToolkitForVS2008.msi it tells me that the toolkit is already installed and I need to remove it before installing that one. I have no prior install...
If you're encountering an issue where the Guidance Automation Toolkit (GAT) appears to be partially installed but isn't showing up in the "Add or Remove Programs" list, you can manually clean up the installation using the Windows Registry and some other methods. Here’s a step-by-step guide to help you remove any remnan...
47,515
[ { "from": "human", "value": "I downloaded the Guidance Automation Toolkit for VS 2008 and in the middle of the install there was an error forcing it to close. Now whenever i re-run the GuidanceAutomationToolkitForVS2008.msi it tells me that the toolkit is already installed and I need to remove it before ins...
I've created a simple HttpModule to log the uses of my existing webservice. There's a dll containing a single class public class TrackingModule : System.Web.IHttpModule { public TrackingModule(){} public void Init(System.Web.HttpApplication context) { context.BeginRequest+=new EventHandler(context...
It sounds like you've encountered an issue related to how the IIS application settings and HTTP modules work when dealing with virtual directories. Here are several factors to consider and possible solutions to troubleshoot the issue further: 1. **IIS Application Configuration**: Ensure that the subfolder containing y...
49,642
[ { "from": "human", "value": "I've created a simple HttpModule to log the uses of my existing webservice. There's a dll containing a single class \npublic class TrackingModule : System.Web.IHttpModule\n{\n public TrackingModule(){}\n\n public void Init(System.Web.HttpApplication context)\n {\n ...
I have a simple problem when querying the SQL Server 2005 database. I have tables called Customer and Products (1->M). One customer has most 2 products. Instead of output as CustomerName, ProductName ... I like to output as CustomerName, Product1Name, Product2Name ... Could anybody help me? Thanks!
Certainly! You can achieve this by using a combination of SQL `JOIN` and conditional aggregation (using `CASE` statements or `MAX` with a `GROUP BY`). Below is a way to structure your SQL query to get the desired output format with `CustomerName`, `Product1Name`, and `Product2Name`. Assuming you have two tables define...
44,540
[ { "from": "human", "value": "I have a simple problem when querying the SQL Server 2005 database. I have tables called Customer and Products (1->M). One customer has most 2 products. Instead of output as\nCustomerName, ProductName ...\nI like to output as \nCustomerName, Product1Name, Product2Name ...\nCould...
When I inserted text from one SQL Server VARCHAR(MAX) field in one database to another, I get question mark symbols - "?" - in the target database (in addition to line feeds) whenever there are line feeds in the source database. Text in the target database looks like this: Line one.? ? Line two.? ? Any ideas about what...
The issue you're experiencing with the appearance of question mark symbols (`?`) when transferring text from a `VARCHAR(MAX)` field in one SQL Server database to another is likely related to character encoding and how line breaks are handled during the transfer. Here are some steps you can take to troubleshoot and fix...
46,086
[ { "from": "human", "value": "When I inserted text from one SQL Server VARCHAR(MAX) field in one database to another, I get question mark symbols - \"?\" - in the target database (in addition to line feeds) whenever there are line feeds in the source database.\nText in the target database looks like this:\nL...