instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I am very new to creating webservers - and I have had several goes at trying to understand them and write a quick webserver, but it's never quite 'clicked'. At the moment I am under the impression that REST would be most suitable for my purposes (I will explain later).
Can anyone either show me a basic code example in... | Creating a basic web server using Java with Apache Tomcat and implementing RESTful services can seem daunting at first, but I'll guide you through a simple example to help clarify things. We'll create a REST API that will authenticate a client and allow them to add data to a database if they're authenticated.
### Prer... | 12,923 | [
{
"from": "human",
"value": "I am very new to creating webservers - and I have had several goes at trying to understand them and write a quick webserver, but it's never quite 'clicked'. At the moment I am under the impression that REST would be most suitable for my purposes (I will explain later).\nCan any... |
How do I set the background colour of items in a list box dynamically? i.e. there is some property on my business object that I'm binding too, so based on some business rules I want the background colour to be different?
<ListBox Background="Red">
<ListBox.ItemContainerStyle>
<Style TargetType="... | Yes, the limitation mentioned about Silverlight impacts your approach. In Silverlight, you cannot use implicit styles to set properties dynamically based on data. Instead, you need to create explicit styles and bind the property you want to change to a property on your business object.
To change the background color o... | 22,298 | [
{
"from": "human",
"value": "How do I set the background colour of items in a list box dynamically? i.e. there is some property on my business object that I'm binding too, so based on some business rules I want the background colour to be different?\n <ListBox Background=\"Red\">\n <ListBox.Item... |
We have a highly specialized DAL which sits over our DB. Our apps need to use this DAL to correctly operate against this DB.
The generated DAL (which sits on some custom base classes) has various 'Rec' classes (Table1Rec, Table2Rec) each of which represents the record structure of a given table.
Here is a sample Pseudo... | Your current design effectively encapsulates the logic for managing nullability within your `Rec` classes, which is great for local use. However, when you expose these classes over a web service, you lose the ability to maintain that logic since the client does not have the same implementation of the classes, and you c... | 23,456 | [
{
"from": "human",
"value": "We have a highly specialized DAL which sits over our DB. Our apps need to use this DAL to correctly operate against this DB.\nThe generated DAL (which sits on some custom base classes) has various 'Rec' classes (Table1Rec, Table2Rec) each of which represents the record structure... |
I recently asked a question about Oracle Encryption. Along the way to finding a solution for myself I decided to move the encryption (well, obfuscation) to the application side for certain tasks.
My problem is that the database is already encrypting data a certain way and I need Java code to duplicate that functiona... | To replicate Oracle's `dbms_obfuscation_toolkit.DESEncrypt` functionality in Java, you need to ensure that you are using the same key size, padding, and mode of operation as Oracle’s implementation. Below are the steps you can take to achieve that.
### Step 1: Understand Oracle's Encryption
The `dbms_obfuscation_tool... | 9,001 | [
{
"from": "human",
"value": "I recently asked a question about Oracle Encryption. Along the way to finding a solution for myself I decided to move the encryption (well, obfuscation) to the application side for certain tasks. \nMy problem is that the database is already encrypting data a certain way and I ... |
I have a listbox containing and image and a button. By default the button is hidden. I want to make the button visible whenever I hover over an item in the listbox.
The XAML I am using is below. Thanks
<Window.Resources>
<Style TargetType="{x:Type ListBox}">
<Setter Property="ItemTemplate">
... | To achieve the desired behavior of making the button visible when you hover over an item in the ListBox, you can use a `Trigger` in the `DataTemplate`. The `Trigger` will change the visibility of the button based on the `IsMouseOver` property of the parent container (which in this case is the `Border`).
Here is your m... | 26,026 | [
{
"from": "human",
"value": "I have a listbox containing and image and a button. By default the button is hidden. I want to make the button visible whenever I hover over an item in the listbox.\nThe XAML I am using is below. Thanks\n<Window.Resources>\n <Style TargetType=\"{x:Type ListBox}\">\n <S... |
I am attempting to send an email using VB.NET.
There are two requirements:
The email be saved in their "Sent Items" folder in Outlook (their only email client).
A PDF (generated on the fly) is attached to the email.
I am currently creating a new MailMessage & sending via a SmtpClient, but I believe that this sends fr... | Yes, it is possible to send an email via Outlook and save it in the "Sent Items" folder using VB.NET. You will need to use the Outlook Interop library, which allows you to interact with Outlook installed on the user's machine.
Here’s a step-by-step guide to create and send an email with an attachment using the Outlook... | 23,330 | [
{
"from": "human",
"value": "I am attempting to send an email using VB.NET.\nThere are two requirements:\n\nThe email be saved in their \"Sent Items\" folder in Outlook (their only email client).\nA PDF (generated on the fly) is attached to the email.\n\nI am currently creating a new MailMessage & sending v... |
I am still new to sharepoint and would like to know if it is possible to make a query that works across several lists. My list looks like this
Customers (id, name and so forth)
Orders ( id, order number, customer and some additional info)
OrderItems (id, name, price, description and so on)
I would like to create a view... | In SharePoint, creating views that span multiple lists directly is not supported in the same way you might achieve with a traditional relational database using SQL. However, you can implement a similar approach using several techniques, including the following:
### 1. **Lookup Columns**:
You can use **lookup columns**... | 25,163 | [
{
"from": "human",
"value": "I am still new to sharepoint and would like to know if it is possible to make a query that works across several lists. My list looks like this\nCustomers (id, name and so forth)\nOrders ( id, order number, customer and some additional info)\nOrderItems (id, name, price, descript... |
On our new platform we are utilizing JSF. Our WebTrends tags are not reflecting the proper page title on this platform. It currently is displaying the name of the users previous page instead of the current page.
We are making use of the JSF Navigation rule in which we have some "< redirect />" tags.
Has anyone experi... | It sounds like you're experiencing an issue with how the JSF navigation rules are managing page titles when using redirects. This can be a common challenge when working with JSF, particularly if WebTrends (or other analytics tools) is capturing the wrong title due to how navigation is processed.
### Possible Reasons f... | 22,206 | [
{
"from": "human",
"value": "On our new platform we are utilizing JSF. Our WebTrends tags are not reflecting the proper page title on this platform. It currently is displaying the name of the users previous page instead of the current page.\nWe are making use of the JSF Navigation rule in which we have so... |
What is the best way for converting phone numbers into international format (E.164) using Java?
Given a 'phone number' and a country id (let's say an ISO country code), I would like to convert it into a standard E.164 international format phone number.
I am sure I can do it by hand quite easily - but I would not be sur... | To convert phone numbers into the international E.164 format in Java, one of the best libraries you can use is the **libphonenumber** library developed by Google. This library is highly reliable and widely used for parsing, formatting, and validating phone numbers around the world.
### Steps to Use libphonenumber for ... | 22,138 | [
{
"from": "human",
"value": "What is the best way for converting phone numbers into international format (E.164) using Java?\nGiven a 'phone number' and a country id (let's say an ISO country code), I would like to convert it into a standard E.164 international format phone number.\nI am sure I can do it by... |
I have a SQL Server 2005 database that is suffering from lock starvation because of some poorly behaving applications running cursors through sp_prepexec. I imagine that one of the applications running a cursor has "forgotten" to close it. I would like to deny access to sp_prepexec for specific users to prevent the l... | To effectively deny access to `sp_prepexec` for specific users in SQL Server, you'll need to consider a couple of things. Given that you are on SQL Server 2005, here's the approach you can take:
1. **Use a Role**: Instead of denying permissions directly to the user, create a database role in the production database an... | 25,784 | [
{
"from": "human",
"value": "I have a SQL Server 2005 database that is suffering from lock starvation because of some poorly behaving applications running cursors through sp_prepexec. I imagine that one of the applications running a cursor has \"forgotten\" to close it. I would like to deny access to sp_p... |
I wonder if anyone can think of a good technique to enable any arbitrary section of an aspx page (say, the contents within a specified DIV tag) to be able to be called and displayed in an ajax modal popup? (So, only a certain section of the page would be displayed)
For example:
1) You have a large application with many... | This is a common requirement in web applications, and while it can seem complex at first, it is definitely achievable using AJAX along with ASP.NET features. Below, I've outlined a general approach you could take to implement this functionality:
### Overview
1. **AJAX Call:** Trigger an AJAX call when an entity is ho... | 18,013 | [
{
"from": "human",
"value": "I wonder if anyone can think of a good technique to enable any arbitrary section of an aspx page (say, the contents within a specified DIV tag) to be able to be called and displayed in an ajax modal popup? (So, only a certain section of the page would be displayed)\nFor example:... |
I want yo use the EXSLT - DYN:EVALUATE in a style sheet. I have added the names pace but I don't know where the .xsl file I need to import is. I don't believe I have XALAN installed to point the import to. How would I install this? Once installed and I point it to the .xsl will it pick up the function and apply it? I a... | To use the EXSLT `dyn:evaluate` function in your XSLT transformations, you typically need to use an XSLT processor that supports EXSLT extensions, such as Apache Xalan. Below are the steps you can follow to install Xalan on a Windows machine and use it with your XSLT stylesheet.
### Step 1: Install Apache Xalan
1. **... | 24,130 | [
{
"from": "human",
"value": "I want yo use the EXSLT - DYN:EVALUATE in a style sheet. I have added the names pace but I don't know where the .xsl file I need to import is. I don't believe I have XALAN installed to point the import to. How would I install this? Once installed and I point it to the .xsl will ... |
I work with the Windows registry editor (regedit.exe) on a near-daily basis, and occasionally find myself wishing it had more features.
For example, it'd be nice if it had:
a way to import and export favorites.
an advanced search feature that lists all the keys it found, rather than a simple Find feature. It would be... | There are several third-party tools available that offer enhanced features for working with the Windows Registry compared to the built-in Registry Editor (regedit.exe). Here are some reliable options that you might find helpful:
1. **RegScanner**:
- **Description**: This is a lightweight tool from NirSoft that allo... | 25,842 | [
{
"from": "human",
"value": "I work with the Windows registry editor (regedit.exe) on a near-daily basis, and occasionally find myself wishing it had more features.\nFor example, it'd be nice if it had:\n\na way to import and export favorites. \nan advanced search feature that lists all the keys it found, r... |
I work a lot with serial communications with a variety of devices, and so I often have to analyze hex dumps in log files. Currently, I do this manually by looking at the dumps, looking at the protocol spec, and writing down the results. However, this is tedious and error-prone, especially whem messages contain hundre... | It sounds like you're looking for a way to automate the parsing and analysis of hex dumps based on a specified protocol format. While there are some tools and libraries that might help you, here are a few options to consider:
### 1. **Wireshark**:
Wireshark is a widely used network protocol analyzer that can decode a ... | 22,649 | [
{
"from": "human",
"value": "I work a lot with serial communications with a variety of devices, and so I often have to analyze hex dumps in log files. Currently, I do this manually by looking at the dumps, looking at the protocol spec, and writing down the results. However, this is tedious and error-prone... |
I want to test ASP.NET application using NUnit, but it seems WebConfigurationManager.ConnectionStrings collection is empty when running from NUnit GUI.
Could you tell me how to initialize this collection (probably in [SetUp] function of [TestFixture])? Should I copy Web.config somethere?
Thank you!
| When running NUnit tests, especially for ASP.NET applications, you may encounter issues like the `WebConfigurationManager.ConnectionStrings` collection being empty. This often happens because the test runner does not automatically read the web application’s configuration file (`Web.config`).
Here's how you can set thi... | 22,813 | [
{
"from": "human",
"value": "I want to test ASP.NET application using NUnit, but it seems WebConfigurationManager.ConnectionStrings collection is empty when running from NUnit GUI.\nCould you tell me how to initialize this collection (probably in [SetUp] function of [TestFixture])? Should I copy Web.config ... |
I will choose Java as an example, most people know it, though every other OO language was working as well.
Java, like many other languages, has interface inheritance and implementation inheritance. E.g. a Java class can inherit from another one and every method that has an implementation there (assuming the parent is n... | You've raised a fundamental question in object-oriented design about the balance between code reuse and the pitfalls of implementation inheritance. Indeed, many of the complexities of inheritance, especially the fragile base class problem, lead to a careful reconsideration of how we architect systems. Here are some con... | 15,353 | [
{
"from": "human",
"value": "I will choose Java as an example, most people know it, though every other OO language was working as well.\nJava, like many other languages, has interface inheritance and implementation inheritance. E.g. a Java class can inherit from another one and every method that has an impl... |
I'm new to .Net and do not understand the difference. Can someone point me in the right direction?
| Welcome to the .NET ecosystem! Understanding the differences within .NET can be a bit overwhelming at first, but I’ll break it down for you.
### Key Components of .NET
1. **.NET Framework**:
- **What it is**: The original version of .NET that primarily targets Windows platforms.
- **Usage**: Mainly used for bui... | 21,937 | [
{
"from": "human",
"value": "I'm new to .Net and do not understand the difference. Can someone point me in the right direction?\n"
},
{
"from": "gpt",
"value": "Welcome to the .NET ecosystem! Understanding the differences within .NET can be a bit overwhelming at first, but I’ll break it down for... |
If I'm writing an application that wants to communicate some information through the use of color, how can I change the background and foreground colors of a given widget? I would like to know how to do this in glade if it's possible, as well as programmatically (to a computed color).
I want to know how to do this to ... | To change the background and foreground colors of a widget in a GTK application (using Glade for the UI design) and programmatically, you can follow these methods:
### Using Glade
1. **Open your `.glade` file**: In Glade, load the interface you are designing.
2. **Select the Widget**: Click on the widget (e.g., an H... | 15,077 | [
{
"from": "human",
"value": "If I'm writing an application that wants to communicate some information through the use of color, how can I change the background and foreground colors of a given widget? I would like to know how to do this in glade if it's possible, as well as programmatically (to a computed ... |
Right now I have the following in my .vimrc:
au BufWritePost *.c,*.cpp,*.h !ctags -R
There are a few problems with this:
It's slow -- regenerates tags for files that haven't changed since the last tag generation.
I have to push the enter button again after writing the file because of an inevitable "press Enter or typ... | You can optimize the way you generate tags in Vim by making a few adjustments to your configuration. Here are a couple of suggestions to help you avoid the performance issues and the inconvenience of needing to press Enter multiple times:
### 1. Generate Tags Only for Changed Files
Instead of regenerating tags for al... | 21,206 | [
{
"from": "human",
"value": "Right now I have the following in my .vimrc:\nau BufWritePost *.c,*.cpp,*.h !ctags -R\n\nThere are a few problems with this:\n\nIt's slow -- regenerates tags for files that haven't changed since the last tag generation.\nI have to push the enter button again after writing the fi... |
Spring security has a nice feature, it remembers the url of request resource and redirect users to that resource after authentication is successful. But I want users always redirected to some other page, just after user logs in. How is it done?
| In Spring Security, if you want to redirect users to a specific page after they successfully log in, regardless of the originally requested URL, you can accomplish this by customizing the login success handler.
Here’s how you can do it:
### Step 1: Implement a Custom Authentication Success Handler
Create a class th... | 23,149 | [
{
"from": "human",
"value": "Spring security has a nice feature, it remembers the url of request resource and redirect users to that resource after authentication is successful. But I want users always redirected to some other page, just after user logs in. How is it done? \n"
},
{
"from": "gpt",
... |
I am running the free version of Helicon ISAPI Rewrite on IIS and have several sites running through the same set of rewrite rules. Up 'til now this has been fine as all the rules have applied to all the sites. I have recently added a new site which I don't want to run through all the rules. Is there any way to make re... | To achieve what you're looking for in Helicon ISAPI Rewrite, you want to ensure that requests to `mysite.com` are processed by their specific rules and then prevent any further rules from being applied to them.
Your approach is close, but it seems like the condition you've set might not be applying correctly due to th... | 22,768 | [
{
"from": "human",
"value": "I am running the free version of Helicon ISAPI Rewrite on IIS and have several sites running through the same set of rewrite rules. Up 'til now this has been fine as all the rules have applied to all the sites. I have recently added a new site which I don't want to run through a... |
I have some custom SharePoint site definitions that are deployed via SharePoint wsp solution packages. They appear to work fine. I can deploy them fine via the stsadm command line, and my C# code running in some features can also deploy sites based on them. My webtemp.*.xml files appear to be correctly placed in th... | It sounds like you experienced a temporary issue that resolved itself, which can sometimes occur in SharePoint due to caching. Here are some common reasons why custom site definitions may not immediately appear in the Central Administration site creation page and some steps to troubleshoot such issues in the future:
1... | 25,836 | [
{
"from": "human",
"value": "I have some custom SharePoint site definitions that are deployed via SharePoint wsp solution packages. They appear to work fine. I can deploy them fine via the stsadm command line, and my C# code running in some features can also deploy sites based on them. My webtemp.*.xml ... |
I understand that Parrot is a virtual machine, but I feel like I'm not completely grasping the idea behind it.
As I understand, it's a virtual machine that's being made to handle multiple languages. Is this correct?
What are the advantages of using a virtual machine instead of just an interpreter?
What specificall... | Yes, you're correct that Parrot is a virtual machine designed to execute code written in multiple programming languages. It was particularly aimed at supporting languages that are part of the Perl 6 (now known as Raku) ecosystem but was intended to be language-agnostic.
### Advantages of Using a Virtual Machine vs. an... | 24,192 | [
{
"from": "human",
"value": "I understand that Parrot is a virtual machine, but I feel like I'm not completely grasping the idea behind it.\nAs I understand, it's a virtual machine that's being made to handle multiple languages. Is this correct? \nWhat are the advantages of using a virtual machine instead... |
I am trying to hide some divs before the user prints this giant form, then display the divs again afterward. Thus I want to ignore the rest of the page, and only print the form itself.
Sure I could open a separate page when the user clicks the print button. The only thing is that the form is really long and it would be... | You can achieve the functionality of hiding specific divs before printing and then displaying them again afterward by using the `window.onbeforeprint` and `window.onafterprint` events in JavaScript. This method allows you to manipulate the visibility of your elements without navigating away from the current page.
Here... | 24,726 | [
{
"from": "human",
"value": "I am trying to hide some divs before the user prints this giant form, then display the divs again afterward. Thus I want to ignore the rest of the page, and only print the form itself.\nSure I could open a separate page when the user clicks the print button. The only thing is th... |
At work we write a small to moderate amount of scripts to aid us in normal development. We have some people that are more comfortable in python, some in perl, some in php, etc...
Sometimes I think it is best to let people work in a language they are most comfortable with. This can mean that sometimes people can do a ... | The decision to standardize on a single programming language versus allowing team members to choose their preferred language for scripting can have significant implications for your development processes and team dynamics. Here are some considerations for both approaches:
### Pros of Standardizing
1. **Collaboration*... | 24,088 | [
{
"from": "human",
"value": "At work we write a small to moderate amount of scripts to aid us in normal development. We have some people that are more comfortable in python, some in perl, some in php, etc...\nSometimes I think it is best to let people work in a language they are most comfortable with. Thi... |
I have a scenario where I would like to animate a WPF control right before it is removed from the visual/logical trees. The control is custom, and the control style, including animations would be supplied by a designer (i.e. I don't know the details of what they will be at the time of writing the control code). I wou... | Yes, you can achieve the desired behavior in WPF by using routed events in combination with animation. The goal is to allow designers to trigger animations right before the control is removed from the visual/logical trees without relying on a dependency property or risking memory leaks. Instead, you can handle the anim... | 24,775 | [
{
"from": "human",
"value": "I have a scenario where I would like to animate a WPF control right before it is removed from the visual/logical trees. The control is custom, and the control style, including animations would be supplied by a designer (i.e. I don't know the details of what they will be at the ... |
I know that ES_NUMBER exists to limit CreateWindowEx to numeric input only, is there a similar mechanism for limiting it to only alphanumeric (a-z,0-9) input? Or another way to do something similar. I know I can check after the fact, but I would like to limit it as the user types.
| In Windows API programming, particularly when working with a `CreateWindowEx` function to create input controls (like an Edit control), there's no built-in style similar to `ES_NUMBER` that limits input to only alphanumeric characters directly. However, you can achieve the desired effect by subclassing the Edit control... | 23,059 | [
{
"from": "human",
"value": "I know that ES_NUMBER exists to limit CreateWindowEx to numeric input only, is there a similar mechanism for limiting it to only alphanumeric (a-z,0-9) input? Or another way to do something similar. I know I can check after the fact, but I would like to limit it as the user t... |
Ruby on Rails does not do multithreaded request-responses very well, or at least, ActiveRecord doesn't.
The notion of only one request-response active at the same time can be a hassle when creating web applications which fork off a shell-command that takes long to finish.
What I'd like are some of your views on these k... | Ruby on Rails is traditionally built on a single-threaded request-response model, largely because of how ActiveRecord and the underlying Ruby interpreter (MRI) manage threads and concurrency. This can create challenges in situations where long-running tasks, such as shell commands or background processing, can block re... | 21,876 | [
{
"from": "human",
"value": "Ruby on Rails does not do multithreaded request-responses very well, or at least, ActiveRecord doesn't.\nThe notion of only one request-response active at the same time can be a hassle when creating web applications which fork off a shell-command that takes long to finish.\nWhat... |
The .NET web system I'm working on allows the end user to input HTML formatted text in some situations. In some of those places, we want to leave all the tags, but strip off any trailing break tags (but leave any breaks inside the body of the text.)
What's the best way to do this? (I can think of ways to do this, but... | To achieve the goal of stripping trailing `<br>` tags from HTML-formatted text while preserving all other tags (and any breaks that occur inside the content), you can use a combination of regular expressions and HTML parsing. However, since regular expressions can be tricky with HTML due to its complexity, using an HTM... | 22,064 | [
{
"from": "human",
"value": "The .NET web system I'm working on allows the end user to input HTML formatted text in some situations. In some of those places, we want to leave all the tags, but strip off any trailing break tags (but leave any breaks inside the body of the text.)\nWhat's the best way to do t... |
VBA solutions can vary widely in size.
I would like to add user help documentation to all solutions but the level of effort to create and deploy the help needs to match the size of the solution.
| Creating user help documentation for VBA solutions while matching the level of effort to the size of the solution is a smart approach. Here are some strategies you can adopt for different sizes of VBA projects, ranging from small to large:
### Small Projects
For small VBA solutions (simple macros, short scripts), cons... | 20,817 | [
{
"from": "human",
"value": "VBA solutions can vary widely in size. \nI would like to add user help documentation to all solutions but the level of effort to create and deploy the help needs to match the size of the solution.\n"
},
{
"from": "gpt",
"value": "Creating user help documentation for... |
I deployed an MDE file on the terminal server and when I double clicked the MDE i have the following error. " There isn't enough memory to perform this operation. Close unneeded programs and try again.
I never had any issues on local machine.
I tried de-compiling and compacting and again compiling. I can open other fo... | The error message you're encountering, "There isn't enough memory to perform this operation," can be particularly frustrating, especially when the MDE (compiled Access database) works fine on a local machine but encounters issues on a terminal server. Here are several steps and considerations to troubleshoot and resolv... | 22,531 | [
{
"from": "human",
"value": "I deployed an MDE file on the terminal server and when I double clicked the MDE i have the following error. \" There isn't enough memory to perform this operation. Close unneeded programs and try again.\nI never had any issues on local machine. \nI tried de-compiling and compact... |
I have a problem perplexing me to no end. When I run the following query against an access database:
SELECT *
FROM PreferredSpacer INNER JOIN SpacerThickness ON PreferredSpacer.SpacerTypeID = SpacerThickness.SpacerTypeID
ORDER BY PreferredSpacer.UnitTypeID DESC
(UnitTypeID field is a text type)
The results do not co... | The issue you're experiencing with the sorting of the `UnitTypeID` field in your query is likely related to how the `ORDER BY` clause is being processed in conjunction with the `JOIN`. When performing a join, the resulting dataset may introduce additional rows that could cause unexpected sorting behavior, particularly ... | 24,850 | [
{
"from": "human",
"value": "I have a problem perplexing me to no end. When I run the following query against an access database:\nSELECT *\nFROM PreferredSpacer INNER JOIN SpacerThickness ON PreferredSpacer.SpacerTypeID = SpacerThickness.SpacerTypeID\nORDER BY PreferredSpacer.UnitTypeID DESC\n\n(UnitType... |
I'm working on a small app where I can generate a list of barcodes. I have the correct fonts installed on my computer. Right now I am printing them directly to a webpage and it works properly in Chrome and IE 7, but not Firefox. Does anyone know what Firefox would be doing differently than IE and Chrome?
Here is my cod... | The issue you're encountering with Firefox likely stems from how it handles font rendering compared to Chrome and IE. Here are a few suggestions to troubleshoot and potentially resolve the problem:
### 1. Font Availability
Ensure that the barcode font is properly installed and recognized by Firefox. Sometimes, fonts m... | 24,773 | [
{
"from": "human",
"value": "I'm working on a small app where I can generate a list of barcodes. I have the correct fonts installed on my computer. Right now I am printing them directly to a webpage and it works properly in Chrome and IE 7, but not Firefox. Does anyone know what Firefox would be doing diffe... |
Way back when I was working in an Oracle shop I took the CONNECT_BY for granted. Now I'm stuck working with SQL Server 2005 and have some nasty object hierarchies. Specifically, we have a self referencing table where all child records have a column with their parent's id. Currently we have a view that maps children ... | Retrieving hierarchical data in SQL Server 2005 can be a bit challenging since it does not have built-in support for recursive queries like Oracle's `CONNECT BY` clause. However, you can still work with self-referencing tables and retrieve hierarchical data using Common Table Expressions (CTEs) with recursion, which wa... | 24,678 | [
{
"from": "human",
"value": "Way back when I was working in an Oracle shop I took the CONNECT_BY for granted. Now I'm stuck working with SQL Server 2005 and have some nasty object hierarchies. Specifically, we have a self referencing table where all child records have a column with their parent's id. Cur... |
I am intercepting Win32 API calls a native dll or exe is doing from C# using some kind of hooking. In this particular case I am interested in DrawText() in user32.dll. It is declared like this in Win32 API:
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
The LPRECT struct has the followi... | It looks like you're doing a good job setting up the P/Invoke declaration and the structure for the `RECT`. However, there are a few things to double-check that might help you resolve the issue with the `DrawText` function returning 0 for the `RECT` members.
Here are some suggestions to troubleshoot and potentially fi... | 19,634 | [
{
"from": "human",
"value": "I am intercepting Win32 API calls a native dll or exe is doing from C# using some kind of hooking. In this particular case I am interested in DrawText() in user32.dll. It is declared like this in Win32 API:\nINT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT... |
I'm working on an iPhone game that takes place on the ocean surface. Can someone recommend some sample code or tutorials for implementing waves or ripples in OpenGL?
As I write this, iPhone only supports OpenGL ES 1.1, so there is no support for shaders or other fancy effects.
I don't need anything too fancy. I don't... | Creating a simple wave effect on the ocean surface in OpenGL ES 1.1 can be accomplished using basic techniques without the need for shaders. Since you're looking for something visually appealing but not overly taxing on the device, we can use a combination of vertex displacement and texture mapping. Below is a straight... | 17,044 | [
{
"from": "human",
"value": "I'm working on an iPhone game that takes place on the ocean surface. Can someone recommend some sample code or tutorials for implementing waves or ripples in OpenGL?\nAs I write this, iPhone only supports OpenGL ES 1.1, so there is no support for shaders or other fancy effects.... |
We've been using trac and svn internally with fairly good results. Now we'd like to open up parts of our system to external vendors - eg. we'd like to create an area on the twiki for our external designer to upload images, document things, and so forth. We need to be able to restrict his access to only that part of the... | It sounds like you're looking for a collaborative platform that allows for controlled access for external vendors while still supporting your internal team. Here are several recommendations to consider, balancing project management, version control, and collaborative documentation:
### 1. **GitHub or GitLab**
- **Acce... | 24,682 | [
{
"from": "human",
"value": "We've been using trac and svn internally with fairly good results. Now we'd like to open up parts of our system to external vendors - eg. we'd like to create an area on the twiki for our external designer to upload images, document things, and so forth. We need to be able to res... |
I have a sorted collection of objects (it can be either SortedList or SortedDictionary, I will use it mainly for reading so add performance is not that important). How can I get the i-th value?
So e.g. when I have numbers 1, 2, 3, 4, 5 in the collection and I want the median (so 3 in this example), how can I do it?
| If you have a sorted collection of objects in C#, such as a `SortedList` or `SortedDictionary`, you can easily access the i-th value using the `Keys` or `Values` properties. Since these collections maintain sorted order, accessing the i-th element is straightforward.
Here’s how you can do it:
### Using `SortedList`
... | 23,480 | [
{
"from": "human",
"value": "I have a sorted collection of objects (it can be either SortedList or SortedDictionary, I will use it mainly for reading so add performance is not that important). How can I get the i-th value?\nSo e.g. when I have numbers 1, 2, 3, 4, 5 in the collection and I want the median (s... |
Many database systems don't allow comments or descriptions of tables and fields, so how do you go about documenting the purpose of a table/field apart from the obvious of having good naming conventions?
(Let's assume for now that "excellent" table and field names are not enough to document the full meaning of every tab... | Documenting the purpose of tables and fields in a database is essential for maintaining clarity and ensuring that team members can understand the structure and relationships within the data. Below are several approaches, along with their pros and cons, as well as thoughts on how this might be improved in a perfect worl... | 20,442 | [
{
"from": "human",
"value": "Many database systems don't allow comments or descriptions of tables and fields, so how do you go about documenting the purpose of a table/field apart from the obvious of having good naming conventions?\n(Let's assume for now that \"excellent\" table and field names are not enou... |
I've got a model in CakePHP that doesn't have a table, called Upload. I've got a validation in this Model for a field called source_id.
I've got a form that builds a nice looking $this-data, giving me a well formated set, including:
$this->data['Upload']['source_id']
However, the validation rule I have set doesn't see... | In CakePHP, models typically correspond to database tables, and validations are often tied to those tables. However, you can still create models that don't have an associated database table and perform validations on them. In your case, it looks like you've correctly set up the validation rules in your `Upload` model. ... | 25,143 | [
{
"from": "human",
"value": "I've got a model in CakePHP that doesn't have a table, called Upload. I've got a validation in this Model for a field called source_id.\nI've got a form that builds a nice looking $this-data, giving me a well formated set, including:\n$this->data['Upload']['source_id']\n\nHoweve... |
I'm using window.onback = history.forward(); to prevent users from resubmitting data. I know it's a hack and I don't like it either, but that's not what this question is about. The problem is that the code prevents other pages from going back to the page with the code. Let me clarify.
PageA.aspx has the JavaScript code... | The issue you are experiencing stems from how you're implementing the `onback` event. The property `window.onback` is not a standard JavaScript event handler, and in fact, the correct way to prevent the back navigation would be to use `window.onbeforeunload`, but that doesn't prevent the back button itself, merely warn... | 24,821 | [
{
"from": "human",
"value": "I'm using window.onback = history.forward(); to prevent users from resubmitting data. I know it's a hack and I don't like it either, but that's not what this question is about. The problem is that the code prevents other pages from going back to the page with the code. Let me cl... |
At the moment I pull data from remote MS SQL Server databases using custom-built JDBC connectors. This works fine but doesn't feel like the way to do it.
I feel I should be able to put a JDBC connection string into tnsnames on the server and have it "just work". I've looked around a little for this functionality but it... | You're touching on an interesting topic regarding connectivity between different database systems, particularly between MS SQL Server and Oracle databases. Your understanding of the available options, such as Generic Connectivity and Oracle Gateways, is correct. Here are some insights into why JDBC-based linking is not... | 20,584 | [
{
"from": "human",
"value": "At the moment I pull data from remote MS SQL Server databases using custom-built JDBC connectors. This works fine but doesn't feel like the way to do it.\nI feel I should be able to put a JDBC connection string into tnsnames on the server and have it \"just work\". I've looked a... |
I have a table that has a column with a default value:
create table t (
value varchar(50) default ('something')
)
I'm using a stored procedure to insert values into this table:
create procedure t_insert (
@value varchar(50) = null
)
as
insert into t (value) values (@value)
The question is, how do I get it to... | To achieve the desired functionality of using the default value when the `@value` parameter is `NULL` without duplicating the default value in multiple places, you can use the following approach. Instead of trying to use `DEFAULT` in your `INSERT` statement, which is not directly supported in the way you're attempting,... | 24,458 | [
{
"from": "human",
"value": "I have a table that has a column with a default value:\ncreate table t (\n value varchar(50) default ('something')\n)\n\nI'm using a stored procedure to insert values into this table:\ncreate procedure t_insert (\n @value varchar(50) = null\n)\nas \ninsert into t (value) v... |
Someone is trying to sell Lisp to me, as a super powerful language that can do everything ever, and then some.
Is there a practical code example of Lisp's power?(Preferably alongside equivalent logic coded in a regular language.)
| Lisp is known for its powerful features, such as its ability to handle symbolic computation, code as data (homoiconicity), and support for creating domain-specific languages (DSLs). Below, I'll provide a practical example showcasing some of these strengths using a simple task: creating a small program to calculate the ... | 16,756 | [
{
"from": "human",
"value": "Someone is trying to sell Lisp to me, as a super powerful language that can do everything ever, and then some.\nIs there a practical code example of Lisp's power?(Preferably alongside equivalent logic coded in a regular language.)\n"
},
{
"from": "gpt",
"value": "Lis... |
I am building up a view with various text and image elements.
I want to display some text in the view with a blurry copy of the text behind it, but not just a text shadow.
How do I apply Gaussian blurred text onto a UIImage or layer?
| To create a Gaussian blurred text effect in a `UIImage` or layer in an iOS app, you can follow these steps:
1. **Create the Text**: Render the text as an image.
2. **Apply Gaussian Blur**: Use Core Graphics to apply a Gaussian blur to that image.
3. **Overlay the Original Text**: Finally, overlay the original text on ... | 23,523 | [
{
"from": "human",
"value": "I am building up a view with various text and image elements.\nI want to display some text in the view with a blurry copy of the text behind it, but not just a text shadow.\nHow do I apply Gaussian blurred text onto a UIImage or layer?\n"
},
{
"from": "gpt",
"value":... |
I have a page with a tab control and each control has almost 15 controls. In total there are 10 tabs and about 150 controls in a page (controls like drop down list, textbox, radiobutton, listbox only).
My requirement is that there is a button (submit) at the bottom of the page. I need to check using JavaScript that at ... | To achieve the requirement of checking if at least 3 options are selected from various controls on your ASPX page using JavaScript, you can implement a straightforward approach. Below is a simple JavaScript function that can be triggered when the submit button is clicked. This function will traverse through all relevan... | 21,056 | [
{
"from": "human",
"value": "I have a page with a tab control and each control has almost 15 controls. In total there are 10 tabs and about 150 controls in a page (controls like drop down list, textbox, radiobutton, listbox only).\nMy requirement is that there is a button (submit) at the bottom of the page.... |
Is there a way to generate a hash of a string so that the hash itself would be of specific length? I've got a function that generates 41-byte hashes (SHA-1), but I need it to be 33-bytes max (because of certain hardware limitations). If I truncate the 41-byte hash to 33, I'd probably (certainly!) lost the uniqueness.
O... | If you've decided to use MD5 for generating hashes that are within the 33-byte maximum limit, it's important to remember that MD5 produces a 16-byte (128-bit) hash. This should suit your needs since it's well under your size limit and is relatively fast for generating hashes.
Here's a simple implementation of the MD5 ... | 25,614 | [
{
"from": "human",
"value": "Is there a way to generate a hash of a string so that the hash itself would be of specific length? I've got a function that generates 41-byte hashes (SHA-1), but I need it to be 33-bytes max (because of certain hardware limitations). If I truncate the 41-byte hash to 33, I'd pro... |
When I try to install a new instance of SQL Server 2008 Express on a development machine with SQL 2005 Express already up and running, the install validation fails because the "SQL 2005 Express tools" are installed and I'm told to remove them.
What exactly does that mean?
After reading this article:
http://www.asql.bi... | It looks like you've encountered a common issue when trying to install a newer version of SQL Server (in this case, SQL Server 2008 Express) while older versions and their components are still installed on your machine. Here's a breakdown of the problem and the resolution based on your steps:
### Explanation of the Pr... | 25,136 | [
{
"from": "human",
"value": "When I try to install a new instance of SQL Server 2008 Express on a development machine with SQL 2005 Express already up and running, the install validation fails because the \"SQL 2005 Express tools\" are installed and I'm told to remove them.\nWhat exactly does that mean? \nA... |
I'm writing a script to remove some build artifacts older than 1 week.
The files have names in the form artifact-1.1-200810391018.exe.
How do I go about removing only the files that are greater than 1 week old, excluding the time in hours and minutes at the end of the date-time-stamp?
Currently it is removing all of t... | Your script has a couple of issues that may lead to unexpected behavior, such as removing all files. Let's break down what needs to be fixed and improve your script.
### Key Issues:
1. **Incorrect Loop Variable**: You defined `home` in the outer loop but used `location` in the echo statement and in the `NIGHTLY_LOCAT... | 25,683 | [
{
"from": "human",
"value": "I'm writing a script to remove some build artifacts older than 1 week. \nThe files have names in the form artifact-1.1-200810391018.exe.\nHow do I go about removing only the files that are greater than 1 week old, excluding the time in hours and minutes at the end of the date-ti... |
I'm using an XYPlot in JFreeChart. All the lines on it are XYSeries objects. Both axes are NumberAxis objects. The Y-Axis range is from 0-1, with ticks every .1. Along with displaying the numbers though, I'd like to display text on the Y-Axis, like High/Medium/Low. High would cover .7-1, etc. What is the best way to go... | To add text labels such as "High", "Medium", and "Low" to the Y-Axis of an XYPlot in JFreeChart while still showing numeric ticks, you can achieve this by using a custom `NumberAxis` and overriding the `tickLabel` generation. Here's how to do it:
1. **Create a Custom Tick Unit**: You can create a custom `TickUnit` tha... | 20,841 | [
{
"from": "human",
"value": "I'm using an XYPlot in JFreeChart. All the lines on it are XYSeries objects. Both axes are NumberAxis objects. The Y-Axis range is from 0-1, with ticks every .1. Along with displaying the numbers though, I'd like to display text on the Y-Axis, like High/Medium/Low. High would co... |
I am working on a web application that was recently converted from Visual Studio 2003 to Visual Studio 2008. The application contained some web services that were written using the .NET 1.1 Framework and Web Service Enhancements 2.0. They were converted to the .NET 3.5 framework using the VS 2008 Conversion Wizard To... | The error message you're seeing (`System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction`) typically indicates a mismatch between the expected SOAPAction in the request and the SOAPAction that the web service is set up to handle. This can happen due to differences betw... | 16,716 | [
{
"from": "human",
"value": "I am working on a web application that was recently converted from Visual Studio 2003 to Visual Studio 2008. The application contained some web services that were written using the .NET 1.1 Framework and Web Service Enhancements 2.0. They were converted to the .NET 3.5 framewo... |
C# MDI application with separate GUI threads for each child in MDI is that possible ?
For example if one of the child forms is blocked by some synchronous request it freezes the entire container ( MDI Parent ) and the other windows open also become in accessible.
In general , is it possible to have more than one GUI t... | In .NET Windows Forms applications, each form (including MDI child forms) is designed to operate on a single UI thread. This thread is associated with the main application window and is responsible for handling all UI interactions. As a result, if a child form blocks the UI thread with synchronous calls, the entire app... | 22,520 | [
{
"from": "human",
"value": "C# MDI application with separate GUI threads for each child in MDI is that possible ?\nFor example if one of the child forms is blocked by some synchronous request it freezes the entire container ( MDI Parent ) and the other windows open also become in accessible.\nIn general ,... |
I know there is a standard behind all C compiler implementations, so there should be no hidden features. Despite that, I am sure all C developers have hidden/secret tricks they use all the time.
| You're right that there is a standard for the C programming language (ANSI C, also known as C89/C90, and later versions like C99, C11, and C18) that all compliant C compilers aim to follow. However, every language and compiler has its nuances and tricks that experienced developers often leverage for efficiency, readabi... | 21,230 | [
{
"from": "human",
"value": "I know there is a standard behind all C compiler implementations, so there should be no hidden features. Despite that, I am sure all C developers have hidden/secret tricks they use all the time.\n"
},
{
"from": "gpt",
"value": "You're right that there is a standard f... |
I'm trying to serialize objects from a database that have been retrieved with Hibernate, and I'm only interested in the objects' actual data in its entirety (cycles included).
Now I've been working with XStream, which seems powerful. The problem with XStream is that it looks all too blindly on the information. It recog... | When dealing with Hibernate entities and serialization, especially with collections and avoiding metadata serialization (like those found in `PersistentCollection`), there are a few strategies you can employ.
### 1. **Using DTOs (Data Transfer Objects)**
One of the best practices is to use DTOs that represent the dat... | 21,604 | [
{
"from": "human",
"value": "I'm trying to serialize objects from a database that have been retrieved with Hibernate, and I'm only interested in the objects' actual data in its entirety (cycles included).\nNow I've been working with XStream, which seems powerful. The problem with XStream is that it looks al... |
Please share you experiences regarding how you localized your WPF applications to support multiple languages and any resources that helped you in it?
Thanks for your feedbacks.
| Localizing WPF (Windows Presentation Foundation) applications can significantly enhance user experience by allowing users to interact with the application in their preferred language. Here’s an overview of the process I followed, along with resources that were helpful:
### Steps for Localizing WPF Applications
1. **U... | 16,604 | [
{
"from": "human",
"value": "Please share you experiences regarding how you localized your WPF applications to support multiple languages and any resources that helped you in it?\nThanks for your feedbacks.\n"
},
{
"from": "gpt",
"value": "Localizing WPF (Windows Presentation Foundation) applica... |
I'm writing a simulator in Python, and am curious about options and opinions regarding basic 2D animations. By animation, I'm referring to rendering on the fly, not displaying prerendered images.
I'm currently using matplotlib (Wxagg backend), and it's possible that I'll be able to continue using it, but I suspect it w... | Given your requirements and the context you've provided, there are several options for creating 2D animations in Python that should fit well within the parameters you've described. Here are a few libraries to consider:
### 1. **Pygame**
- **Cross-platform**: Yes, works on Windows, macOS, and Linux.
- **Complexity**: R... | 17,949 | [
{
"from": "human",
"value": "I'm writing a simulator in Python, and am curious about options and opinions regarding basic 2D animations. By animation, I'm referring to rendering on the fly, not displaying prerendered images.\nI'm currently using matplotlib (Wxagg backend), and it's possible that I'll be abl... |
Question
Is there a way to have a method that will always run anytime that test assembly is run through MSTest?
Similar to how the [TestInitialize] and [ClassInitialize] attributes work, but for the entire assembly. I do not want to have to add code to every test class's [ClassInitialize] method.
Reasoning
Some of my ... | MSTest does not directly provide a built-in way to run a method at the assembly level before any tests are executed, like you can with `[TestInitialize]` or `[ClassInitialize]`. However, you can achieve similar functionality by leveraging the `AssemblyInitialize` attribute. This attribute allows you to execute code onc... | 24,115 | [
{
"from": "human",
"value": "Question\nIs there a way to have a method that will always run anytime that test assembly is run through MSTest?\nSimilar to how the [TestInitialize] and [ClassInitialize] attributes work, but for the entire assembly. I do not want to have to add code to every test class's [Cla... |
Is there support in Ruby for (for lack of a better word) non-escaped (verbatim) strings?
Like in C#:
@"c:\Program Files\"
...or in Tcl:
{c:\Program Files\}
| In Ruby, you can achieve a similar effect to non-escaped (or verbatim) strings by using a combination of different types of string literals. Here are some of the most common methods:
1. **Single-quoted strings**: In Ruby, you can use single quotes to create a string where escape sequences are not processed (with the e... | 24,664 | [
{
"from": "human",
"value": "Is there support in Ruby for (for lack of a better word) non-escaped (verbatim) strings?\nLike in C#:\n@\"c:\\Program Files\\\"\n\n...or in Tcl:\n{c:\\Program Files\\}\n\n"
},
{
"from": "gpt",
"value": "In Ruby, you can achieve a similar effect to non-escaped (or ver... |
In .NET is there a way to enable Assembly.Load tracing? I know while running under the debugger it gives you a nice message like "Loaded 'assembly X'" but I want to get a log of the assembly loads of my running application outside the debugger, preferably intermingled with my Debug/Trace log messages.
I'm tracing out ... | Yes, in .NET, you can enable assembly loading tracing by using the `AppDomain.AssemblyLoad` event to get notifications whenever an assembly is loaded into your application. By subscribing to this event, you can log the details of each assembly load and interleave it with your own debugging or tracing messages.
Here’s ... | 22,486 | [
{
"from": "human",
"value": "In .NET is there a way to enable Assembly.Load tracing? I know while running under the debugger it gives you a nice message like \"Loaded 'assembly X'\" but I want to get a log of the assembly loads of my running application outside the debugger, preferably intermingled with my ... |
I have an issue with Visual Studio 2005 w/ TFS where, from time to time, the Solution Explorer will stop responding to interaction. Instead it does the beep, like I'm trying to click on a parent window with a modal dialog visible, but there isn't one. The only thing I've found to do so far, is to restart VS, but that... | It's not uncommon for older versions of Visual Studio, like 2005, to exhibit various issues due to their age and the complexity of the environment. Here are several suggestions that might help you mitigate the problem without needing to restart Visual Studio every time:
1. **Check for Updates**: Ensure that you have t... | 23,342 | [
{
"from": "human",
"value": "I have an issue with Visual Studio 2005 w/ TFS where, from time to time, the Solution Explorer will stop responding to interaction. Instead it does the beep, like I'm trying to click on a parent window with a modal dialog visible, but there isn't one. The only thing I've found... |
It's my understanding that a corelet is a Motorola-ism, but does anyone know what the difference is? Do corelets have certain abilities that midlets don't?
| Yes, you're correct that "corelet" is a term that originated from Motorola, particularly in the context of mobile applications. To clarify the difference between corelets and midlets:
1. **Definition**:
- **Midlets**: These are Java applications specifically designed to run on mobile devices that support the Java M... | 26,274 | [
{
"from": "human",
"value": "It's my understanding that a corelet is a Motorola-ism, but does anyone know what the difference is? Do corelets have certain abilities that midlets don't?\n"
},
{
"from": "gpt",
"value": "Yes, you're correct that \"corelet\" is a term that originated from Motorola,... |
I've noticed that when generating a new C++ project using MS Visual Studio 2008, the Release build contains debugging symbols - specifically the following settings are enabled:
The C++/General/Debug Information Format is set to Program Database.
The Linker/Debugging/Generate Debug Info setting is set to Yes.
I have n... | Leaving the debugging symbols enabled in a Release build of your C++ project in MS Visual Studio 2008 does have both advantages and disadvantages. Here’s a breakdown of what to consider:
### Advantages:
1. **Easier Troubleshooting**: If an issue arises in the Release version of your application, having debugging symbo... | 24,642 | [
{
"from": "human",
"value": "I've noticed that when generating a new C++ project using MS Visual Studio 2008, the Release build contains debugging symbols - specifically the following settings are enabled:\n\nThe C++/General/Debug Information Format is set to Program Database.\nThe Linker/Debugging/Generate... |
Given a table or a temp table, I'd like to run a procedure that will output a SQL script (i.e. a bunch of INSERT statements) that would populate the table. Is this possible in MS SQL Server 2000?
| Yes, it is possible to generate SQL INSERT statements to populate a table or a temporary table in SQL Server 2000. While SQL Server does not provide a built-in command for this purpose directly, you can achieve it using a stored procedure or dynamic SQL.
Here’s a basic example of how you might create a stored procedur... | 23,475 | [
{
"from": "human",
"value": "Given a table or a temp table, I'd like to run a procedure that will output a SQL script (i.e. a bunch of INSERT statements) that would populate the table. Is this possible in MS SQL Server 2000?\n"
},
{
"from": "gpt",
"value": "Yes, it is possible to generate SQL I... |
What is the SQL command to copy a table from one database to another database?
I am using MySQL and I have two databases x and y. Suppose I have a table in x called a and I need to copy that table to y database.
Sorry if the question is too novice.
Thanks.
| No problem at all! Copying a table from one database to another in MySQL can be done using the `CREATE TABLE ... AS SELECT ...` statement. Here's how you can do it:
Assuming you want to copy the table `a` from database `x` to database `y`, you can use the following SQL command:
```sql
CREATE TABLE y.a AS SELECT * FRO... | 18,222 | [
{
"from": "human",
"value": "What is the SQL command to copy a table from one database to another database?\nI am using MySQL and I have two databases x and y. Suppose I have a table in x called a and I need to copy that table to y database.\nSorry if the question is too novice.\nThanks.\n"
},
{
"fr... |
I'm trying to come up with a Java regex that will match a filename only if it has a valid extension. For example it should match "foo.bar" and "foo.b", but neither "foo." nor "foo".
I've written the following test program
public static void main(String[] args) {
Pattern fileExtensionPattern = Pattern.compile("\\.\\w+... | The issue you're experiencing stems from how you're using the `matches()` method in your regex. The `matches()` method checks if the entire string matches the regex pattern. In your case, the regex pattern `\\.\\w+\\z` is looking for a string that ends with a dot followed by one or more word characters (`\\w+`), but si... | 23,518 | [
{
"from": "human",
"value": "I'm trying to come up with a Java regex that will match a filename only if it has a valid extension. For example it should match \"foo.bar\" and \"foo.b\", but neither \"foo.\" nor \"foo\".\nI've written the following test program\npublic static void main(String[] args) {\n Pat... |
Ok, so I'm building bread crumbs and depending on the value of the breadcrumb an image will be the seperator. So "HOME" will have one image and "SEARCH" will have another.
I know I can do this programatically (at least I ASSUME) but is there an easier way to do this? Can I link an image to a node based on the value of... | Yes, you can achieve this in a couple of ways, depending on the technologies and frameworks you are using to build your breadcrumbs. If you're working in a web context, you have several options to associate different images with breadcrumb values without the need for extensive programming.
### Using PathSeparatorTempl... | 23,706 | [
{
"from": "human",
"value": "Ok, so I'm building bread crumbs and depending on the value of the breadcrumb an image will be the seperator. So \"HOME\" will have one image and \"SEARCH\" will have another. \nI know I can do this programatically (at least I ASSUME) but is there an easier way to do this? Can I... |
I'm using a column of checkboxes in a YUI DataTable, I works fine. But I haven't found a way to put a name and value attribute so I can use when the form is submitted.
Thanks in advance.
| To add a name and value attribute to checkboxes in a YUI DataTable, you can achieve this by customizing the cell's renderer function to generate checkboxes with the required attributes.
Here's a basic example of how to implement this:
1. Create your DataTable.
2. Define a custom formatter for the column containing th... | 21,773 | [
{
"from": "human",
"value": "I'm using a column of checkboxes in a YUI DataTable, I works fine. But I haven't found a way to put a name and value attribute so I can use when the form is submitted.\nThanks in advance.\n"
},
{
"from": "gpt",
"value": "To add a name and value attribute to checkboxe... |
How can I display a tooltip over a button using Windows Forms?
| In Windows Forms, you can display a tooltip over a button (or any control) using the `ToolTip` class. This class provides a simple way to show brief informational messages when the user hovers over a control.
Here's how you can implement a tooltip for a button in Windows Forms:
1. **Add a ToolTip control to your form... | 22,369 | [
{
"from": "human",
"value": "How can I display a tooltip over a button using Windows Forms?\n"
},
{
"from": "gpt",
"value": "In Windows Forms, you can display a tooltip over a button (or any control) using the `ToolTip` class. This class provides a simple way to show brief informational messages... |
I'd like to be able to run my aliases from my .bashrc in the "Run Application" dialog that comes up when you hit Alt+F2 in Ubuntu/Gnome.
Does anyone know how to do this?
| To be able to run your Bash aliases from the "Run Application" dialog in Ubuntu/GNOME, you need to convert those aliases into executable commands that can be recognized by the system.
Bash aliases are specific to your interactive shell environment and are not available to the GNOME run dialog by default. Here’s a meth... | 24,593 | [
{
"from": "human",
"value": "I'd like to be able to run my aliases from my .bashrc in the \"Run Application\" dialog that comes up when you hit Alt+F2 in Ubuntu/Gnome.\nDoes anyone know how to do this?\n"
},
{
"from": "gpt",
"value": "To be able to run your Bash aliases from the \"Run Applicatio... |
Jeffrey Richter is looking for some input on how people are using his PowerThreading library. If anyone out there is using this, what parts of it are you using? He is looking to clean up the library and wants to know what classes people are using.
http://www.wintellect.com/PowerThreading.aspx
EDIT: See http://tech.grou... | If you’re using Jeffrey Richter's PowerThreading library, it would be helpful for him to know which specific classes or features you are utilizing most. Here are some common areas where developers typically find value in the library:
1. **ThreadPool**: Many users take advantage of the improved ThreadPool implementatio... | 27,260 | [
{
"from": "human",
"value": "Jeffrey Richter is looking for some input on how people are using his PowerThreading library. If anyone out there is using this, what parts of it are you using? He is looking to clean up the library and wants to know what classes people are using.\nhttp://www.wintellect.com/Powe... |
Is it possible to use request.setAttribute on a JSP page and then on HTML Submit get the same request attribute in the Servlet?
| In Java Servlet and JSP, the `request.setAttribute()` method is used to store an attribute in the request scope, which is available for the duration of that request. However, when you perform an HTML form submission, the request context is typically a new request, and the attributes set in the previous request are not ... | 23,811 | [
{
"from": "human",
"value": "Is it possible to use request.setAttribute on a JSP page and then on HTML Submit get the same request attribute in the Servlet?\n"
},
{
"from": "gpt",
"value": "In Java Servlet and JSP, the `request.setAttribute()` method is used to store an attribute in the request ... |
I am not really familiar with Maven program but I've been using Eclipse for quite a while for Unit testing, code coverage, javadoc generation, code style checking, etc. Probably, the only main thing that I didn't really like about Eclipse is the "compilation errors" that it generates when you are running Eclipse and An... | Maven and Ant are both build tools for Java projects, but they operate quite differently, and your experience with one may not directly translate to the other.
In general, Maven manages project builds through a standard lifecycle and conventions, while Ant is more flexible but requires you to define a specific build p... | 25,278 | [
{
"from": "human",
"value": "I am not really familiar with Maven program but I've been using Eclipse for quite a while for Unit testing, code coverage, javadoc generation, code style checking, etc. Probably, the only main thing that I didn't really like about Eclipse is the \"compilation errors\" that it ge... |
I'm profiling a ASP.NET web application. I believe it is very database connection intensive (excessive use of the ADO.NET connection pool). How to I tell w/out debugging how many times it is going to the pool and on average how many connections are available in the pool? Are there counters that will give me this info i... | Yes, you can use Windows Performance Monitor (PerfMon) to analyze ADO.NET connection pool usage in your ASP.NET application without needing to debug the application directly. Here are some of the key performance counters you can look at:
1. **.NET Data Provider for SqlServer** (for SQL Server databases)
- **NumberO... | 22,208 | [
{
"from": "human",
"value": "I'm profiling a ASP.NET web application. I believe it is very database connection intensive (excessive use of the ADO.NET connection pool). How to I tell w/out debugging how many times it is going to the pool and on average how many connections are available in the pool? Are the... |
Does anyone have links to tutorials regarding the new IModelBinder in asp.net mvc beta?
I can't get my head around it properly, so much has changed.
Thanks
| As of my last knowledge update in October 2023, ASP.NET MVC had undergone several changes, and the introduction of IModelBinder was indeed one of them. While I can't provide direct links, I can guide you on where to find tutorials and resources related to the new IModelBinder in ASP.NET MVC.
### 1. Official Documentat... | 23,847 | [
{
"from": "human",
"value": "Does anyone have links to tutorials regarding the new IModelBinder in asp.net mvc beta?\nI can't get my head around it properly, so much has changed.\nThanks\n"
},
{
"from": "gpt",
"value": "As of my last knowledge update in October 2023, ASP.NET MVC had undergone se... |
I've written code for communication between my phone and comp thru TCP sockets. When I type out the code line by line in the interactive console it works fine. However, when i try running the script directly through filebrowser.py it just wont work. I'm using Nokia N95. Is there anyway I can run this script directly wi... | To run your TCP socket script directly on your Nokia N95 or any other device, instead of using `filebrowser.py`, you can try the following approaches:
1. **Use a different Python interpreter**: Ensure that you are using the correct interpreter that supports your script and can access necessary libraries. If you have m... | 20,416 | [
{
"from": "human",
"value": "I've written code for communication between my phone and comp thru TCP sockets. When I type out the code line by line in the interactive console it works fine. However, when i try running the script directly through filebrowser.py it just wont work. I'm using Nokia N95. Is there... |
I have a subclass "s" of UIView. I want to put some buttons and labels on s. How do I associate my UIView subclass with a nib file?
| To associate your `UIView` subclass with a Nib (or XIB) file, you can follow these steps in your iOS project:
1. **Create a Nib/XIB File:**
- In Xcode, go to `File` > `New` > `File...`.
- Choose `User Interface` from the options on the left and then select `View`.
- Name your XIB file (for example, `MyCustomV... | 24,595 | [
{
"from": "human",
"value": "I have a subclass \"s\" of UIView. I want to put some buttons and labels on s. How do I associate my UIView subclass with a nib file?\n"
},
{
"from": "gpt",
"value": "To associate your `UIView` subclass with a Nib (or XIB) file, you can follow these steps in your i... |
I'm trying to configure Windows Powershell to work with Visual Studio. Nothing fancy, just get things set so I can cl & nmake. I think all I need to do is edit the path setting(but I don't know how to set that in WPSH).
| To configure Windows PowerShell to work with Visual Studio by adjusting the PATH environment variable, you can follow these steps:
1. **Open PowerShell**:
Launch Windows PowerShell. You can do this by searching for "PowerShell" in the Start menu.
2. **Check Current PATH**:
To see the current PATH variable, you ... | 24,169 | [
{
"from": "human",
"value": "I'm trying to configure Windows Powershell to work with Visual Studio. Nothing fancy, just get things set so I can cl & nmake. I think all I need to do is edit the path setting(but I don't know how to set that in WPSH).\n"
},
{
"from": "gpt",
"value": "To configure W... |
I just finished a test as part of a job interview, and one question stumped me, even using Google for reference. I'd like to see what the StackOverflow crew can do with it:
The memset_16aligned function requires a 16-byte aligned pointer passed to it, or it will crash.
a) How would you allocate 1024 bytes of memory, a... | To allocate memory aligned to a 16-byte boundary, you can use the `posix_memalign` function in C, which allows you to specify the alignment. After allocating the memory, you can cast the pointer to the correct type and use it with your `memset_16aligned` function. Finally, you should free the memory using `free`.
Here... | 25,710 | [
{
"from": "human",
"value": "I just finished a test as part of a job interview, and one question stumped me, even using Google for reference. I'd like to see what the StackOverflow crew can do with it:\n\nThe memset_16aligned function requires a 16-byte aligned pointer passed to it, or it will crash.\na) Ho... |
I'd like something like
int minIndex = list.FindMin(delegate (MyClass a, MyClass b) {returns a.CompareTo(b);});
Is there a builtin way to do this in .NET?
| In .NET, you can find the index of the minimum element in a list using LINQ, which provides a convenient way to work with collections. However, there isn't a built-in method that directly replicates the behavior of the code snippet you provided. That said, you can accomplish this using the `Select`, `OrderBy`, and `Fir... | 25,353 | [
{
"from": "human",
"value": "I'd like something like\nint minIndex = list.FindMin(delegate (MyClass a, MyClass b) {returns a.CompareTo(b);});\n\nIs there a builtin way to do this in .NET?\n"
},
{
"from": "gpt",
"value": "In .NET, you can find the index of the minimum element in a list using LINQ... |
Is there a ZeroConf client extension for Firefox/XULRunner to be used in a zeroConf environment based on either mDNS or SLP?
I know of an extension already that's being developed by the ActiveState Open Komodo folks but it requires PyXPCOM support to be baked into the XULRunner runtime in order to access the Apple Bonj... | As of my last knowledge update in October 2023, there isn't a widely adopted or specifically recognized ZeroConf client extension for Firefox/XULRunner that directly supports mDNS or SLP without relying on PyXPCOM. The situation with Firefox extensions has evolved significantly over the years, especially as Mozilla tra... | 24,420 | [
{
"from": "human",
"value": "Is there a ZeroConf client extension for Firefox/XULRunner to be used in a zeroConf environment based on either mDNS or SLP?\nI know of an extension already that's being developed by the ActiveState Open Komodo folks but it requires PyXPCOM support to be baked into the XULRunner... |
Perl 6 seems to have an explosion of equality operators. What is =:=? What's the difference between leg and cmp? Or eqv and ===?
Does anyone have a good summary?
| Perl 6, now known as Raku, does indeed have a variety of equality operators, each serving a specific purpose. Here’s a concise summary of the most commonly used equality operators and their distinctions:
### 1. `===`
- **Type:** Smart equality operator
- **Usage:** `===` checks if two values are equal **and** of the s... | 25,352 | [
{
"from": "human",
"value": "Perl 6 seems to have an explosion of equality operators. What is =:=? What's the difference between leg and cmp? Or eqv and ===?\nDoes anyone have a good summary?\n"
},
{
"from": "gpt",
"value": "Perl 6, now known as Raku, does indeed have a variety of equality opera... |
Does anybody know a way to recursively remove all files in a working copy that are not under version control? (I need this to get more reliable results in my automatic build VMware.)
| To recursively remove all files in a working copy that are not under version control, you can use a combination of version control commands and a shell command. Here's how you can do it for a few popular version control systems:
### For Git:
You can use the `git clean` command to remove untracked files from your work... | 26,058 | [
{
"from": "human",
"value": "Does anybody know a way to recursively remove all files in a working copy that are not under version control? (I need this to get more reliable results in my automatic build VMware.)\n"
},
{
"from": "gpt",
"value": "To recursively remove all files in a working copy t... |
I'm building a code in which I'd like to be able to generate an event when the user changes the focus of the cursor from an Entry widget to anywhere, for example another entry widget, a button...
So far i only came out with the idea to bind to TAB and mouse click, although if i bind the mouse click to the Entry widget ... | To handle focus changes in a Tkinter application, you can use the `FocusIn` and `FocusOut` events provided by Tkinter. These events are triggered when a widget gains or loses focus, respectively.
Here's an example of how to detect when an `Entry` widget loses focus, regardless of whether the focus goes to another `Ent... | 22,972 | [
{
"from": "human",
"value": "I'm building a code in which I'd like to be able to generate an event when the user changes the focus of the cursor from an Entry widget to anywhere, for example another entry widget, a button...\nSo far i only came out with the idea to bind to TAB and mouse click, although if i... |
Can anyone recommend a good (AS3) logging API for Flash/AIR/Flex? I need something to capture and record mouse and keyboard events in addition to coded events. Preferably something well documented/supported. Thanks in advance.
| There are several logging APIs available for ActionScript 3 (AS3) that can be used with Flash, AIR, and Flex. Here are a few options that you can consider:
1. **AS3Logger**:
- **Overview**: AS3Logger is a simple and easy-to-use logging library for ActionScript 3.
- **Features**: It supports different log levels ... | 23,479 | [
{
"from": "human",
"value": "Can anyone recommend a good (AS3) logging API for Flash/AIR/Flex? I need something to capture and record mouse and keyboard events in addition to coded events. Preferably something well documented/supported. Thanks in advance.\n"
},
{
"from": "gpt",
"value": "There... |
private IEnumerable<string> Tables
{
get
{
yield return "Foo";
yield return "Bar";
}
}
Let's say I want iterate on those and write something like processing #n of #m.
Is there a way I can find out the value of m without iterating before my main iteration?
I hope I made myself clear.
| In your scenario, you're defining a property that uses `yield return` to lazily produce a sequence of table names. While it's possible to iterate over the sequence to count the elements, you want to avoid that to determine the total count (`m`) while still being able to process each item.
You can achieve this by using... | 24,183 | [
{
"from": "human",
"value": "private IEnumerable<string> Tables\n{\n get\n {\n yield return \"Foo\";\n yield return \"Bar\";\n }\n}\n\nLet's say I want iterate on those and write something like processing #n of #m. \nIs there a way I can find out the value of m without iterating befor... |
I need to know what is code compiled unit in .net. It s located in this
path C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\App_folders
I need to know why its created ccu file also an complied file with application extension dll.
Do this take any reference from here.
Thanks
| In the .NET Framework, particularly in the context of ASP.NET applications, a **compiled unit** refers to a unit of code that has been compiled into an intermediate language (IL) that the .NET runtime can understand. When you develop ASP.NET applications, the source code (like `.aspx`, `.ascx`, etc.) is compiled into .... | 23,908 | [
{
"from": "human",
"value": "I need to know what is code compiled unit in .net. It s located in this \npath C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\Temporary ASP.NET Files\\App_folders\nI need to know why its created ccu file also an complied file with application extension dll.\nDo this take any... |
Do you know of well designed open source applications that are instructive to analyse?
Specifically, I'm interested in practical applications object-relational mapping in C++ based programs, where there is a good separation between a domain model and persistence/serialization functionality.
| Certainly! There are several well-designed open source applications in C++ that use object-relational mapping (ORM) concepts and demonstrate a good separation between domain models and persistence/serialization functionalities. Here are a few that you might find instructive to analyze:
1. **Drogon**:
- **Descriptio... | 23,543 | [
{
"from": "human",
"value": "Do you know of well designed open source applications that are instructive to analyse?\nSpecifically, I'm interested in practical applications object-relational mapping in C++ based programs, where there is a good separation between a domain model and persistence/serialization f... |
"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil." (Donald Knuth). My SQL tables are unlikely to contain more than a few thousand rows each (and those are the big ones!). SQL Server Database Engine Tuning Advisor dismisses the amount of data as irrele... | Donald Knuth's quote highlights a well-known principle in software development and optimization—that developers should be wary of premature optimization. However, the decision to create indexes in a SQL database is a nuanced one, and it can still be relevant even when dealing with smaller datasets.
In your case, since... | 26,659 | [
{
"from": "human",
"value": "\"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil.\" (Donald Knuth). My SQL tables are unlikely to contain more than a few thousand rows each (and those are the big ones!). SQL Server Database Engine Tuning Adv... |
To save some typing and clarify my code, is there a standard version of the following method?
public static boolean bothNullOrEqual(Object x, Object y) {
return ( x == null ? y == null : x.equals(y) );
}
| Yes, the method you provided can be simplified using `Objects.equals` from the `java.util.Objects` class, which handles null checks internally. Here is the equivalent method using `Objects.equals`:
```java
import java.util.Objects;
public static boolean bothNullOrEqual(Object x, Object y) {
return Objects.equals(... | 28,418 | [
{
"from": "human",
"value": "To save some typing and clarify my code, is there a standard version of the following method?\npublic static boolean bothNullOrEqual(Object x, Object y) {\n return ( x == null ? y == null : x.equals(y) );\n}\n\n"
},
{
"from": "gpt",
"value": "Yes, the method you pro... |
Which is your favorite way to go with strings in C++? A C-style array of chars? Or wchar_t? CString, std::basic_string, std::string, BSTR or CComBSTR?
Certainly each of these has its own area of application, but anyway, which is your favorite and why?
| As an AI language model, I don't have personal preferences or feelings, but I can certainly discuss the strengths and typical use cases for various string types in C++.
1. **C-style arrays of chars**: These are the most basic form of string representation in C and C++. They are simple and have low overhead, but they l... | 13,789 | [
{
"from": "human",
"value": "Which is your favorite way to go with strings in C++? A C-style array of chars? Or wchar_t? CString, std::basic_string, std::string, BSTR or CComBSTR?\nCertainly each of these has its own area of application, but anyway, which is your favorite and why?\n"
},
{
"from": "g... |
When you double click on a class (in 'solution explorer')... if that class happens to be an .asmx.cs webservice... then you get this...
To add components to your class, drag
them from the Toolbox and use
the Properties window to set their
properties. To create methods and
events for your class, click here
to... | In Visual Studio, if you find yourself frequently encountering the design view for .asmx web services and would prefer to always go straight to code view, there isn't a direct option to set the default view to code instead of design view. However, you can adopt a couple of workarounds to avoid the design view altogethe... | 21,642 | [
{
"from": "human",
"value": "When you double click on a class (in 'solution explorer')... if that class happens to be an .asmx.cs webservice... then you get this...\n\nTo add components to your class, drag\n them from the Toolbox and use\n the Properties window to set their\n properties. To create method... |
I have a file with fields separated by pipe characters and I want to print only the second field. This attempt fails:
$ cat file | awk -F| '{print $2}'
awk: syntax error near line 1
awk: bailing out near line 1
bash: {print $2}: command not found
Is there a way to do this?
| The issue you're encountering is due to the use of the pipe (`|`) character as the field separator in the `awk` command. In most shells, the pipe character is also used for piping the output of one command to another, which can lead to syntax errors.
To use the pipe character as a field separator, you need to escape i... | 27,381 | [
{
"from": "human",
"value": "I have a file with fields separated by pipe characters and I want to print only the second field. This attempt fails:\n$ cat file | awk -F| '{print $2}'\nawk: syntax error near line 1\nawk: bailing out near line 1\nbash: {print $2}: command not found\n\nIs there a way to do thi... |
I am developing a TCP/IP client that has to deal with a proprietary binary protocol. I was considering using user-defined types to represent the protocol headers, and using CopyMemory to shuffle data to and from the UDT and a byte array. However, it appears that VB6 adds padding bytes to align user-defined types. Is th... | In VB6, user-defined types (UDTs) do indeed have padding added to them automatically to align data according to the platform's natural alignment requirements. Unfortunately, there is no built-in way to control this padding behavior through compiler directives like `#pragma pack` in C/C++.
However, you can work around ... | 24,914 | [
{
"from": "human",
"value": "I am developing a TCP/IP client that has to deal with a proprietary binary protocol. I was considering using user-defined types to represent the protocol headers, and using CopyMemory to shuffle data to and from the UDT and a byte array. However, it appears that VB6 adds padding... |
I work on a lot of Asian Language localization projects, and am looking for a powerful text editor with the following features:
1) Unicode support
2) Find in Files
3) Replace in Files
4) Regular expressions
5) Multiline find/replace
6) Built-in diff
I am currently using NotePad++, but it doesn't really support unicode ... | For working with Asian language localization projects, you need a text editor that not only supports Unicode but also has robust search and replace functionality. Here are some editors that meet your criteria:
1. **Sublime Text**:
- **Unicode support**: Yes
- **Find in Files**: Yes
- **Replace in Files**: Yes... | 23,928 | [
{
"from": "human",
"value": "I work on a lot of Asian Language localization projects, and am looking for a powerful text editor with the following features:\n1) Unicode support\n2) Find in Files\n3) Replace in Files\n4) Regular expressions\n5) Multiline find/replace\n6) Built-in diff\nI am currently using N... |
PNG images appear "fuzzy" in flash CS3. They are very blocky and appear unanti-aliased (if that is a word) Does anyone have a fix for this? Is there some setting I'm missing?
| The "fuzzy" or blocky appearance of PNG images in Adobe Flash CS3 can be caused by several factors, typically related to the way Flash handles image rendering and anti-aliasing. Here are some steps you can take to fix this issue:
1. **Check Image Resolution**: Make sure that your PNG images are at the appropriate reso... | 25,151 | [
{
"from": "human",
"value": "PNG images appear \"fuzzy\" in flash CS3. They are very blocky and appear unanti-aliased (if that is a word) Does anyone have a fix for this? Is there some setting I'm missing? \n"
},
{
"from": "gpt",
"value": "The \"fuzzy\" or blocky appearance of PNG images in Adob... |
What exactly do I need to get started with Entity Framework in VS.net 2008?
I am downloading SP1 for vs.net 2008 as I type this, anything else I am missing?
From what I understand I will have to create some XML and then use a .exe tool to spit out the code?
| To get started with Entity Framework (EF) in Visual Studio .NET 2008, you'll need to follow a few steps. Here’s a checklist to help you set everything up:
### 1. **Visual Studio .NET 2008 SP1**
- You already mentioned that you are downloading Service Pack 1 (SP1) for Visual Studio .NET 2008. This is essential, as E... | 21,988 | [
{
"from": "human",
"value": "What exactly do I need to get started with Entity Framework in VS.net 2008?\nI am downloading SP1 for vs.net 2008 as I type this, anything else I am missing?\nFrom what I understand I will have to create some XML and then use a .exe tool to spit out the code?\n"
},
{
"fr... |
Every time I need to do something N times inside an algorithm using C# I write this code
for (int i = 0; i < N; i++)
{
...
}
Studying Ruby I have learned about method times() which can be used with the same semantics like this
N.times do
...
end
Code fragment in C# looks more complex and we should declare use... | In C#, you can achieve a more elegant solution for executing a block of code N times without the need to explicitly declare a loop variable using the `Enumerable.Range` method combined with a `foreach` loop. This approach is not only concise but also leverages LINQ, which was introduced in .NET 3.5.
Here’s how you can... | 25,916 | [
{
"from": "human",
"value": "Every time I need to do something N times inside an algorithm using C# I write this code\nfor (int i = 0; i < N; i++)\n{\n ...\n}\n\nStudying Ruby I have learned about method times() which can be used with the same semantics like this\nN.times do\n ...\nend\n\nCode fragmen... |
I'm having trouble trying to map nested conditions onto an intuitive interface.
eg. How would you represent ((Condition1 AND Condition2) OR (Condition1 AND Condition5)) AND Condition4
| Mapping nested conditions onto an intuitive interface can be quite challenging, especially when dealing with logical operations like AND and OR. Here are some approaches to help you represent your expression visually or conceptually:
### 1. **Use a Flowchart**
You can represent the nested conditions using a flowchart.... | 23,326 | [
{
"from": "human",
"value": "I'm having trouble trying to map nested conditions onto an intuitive interface.\neg. How would you represent ((Condition1 AND Condition2) OR (Condition1 AND Condition5)) AND Condition4\n"
},
{
"from": "gpt",
"value": "Mapping nested conditions onto an intuitive inte... |
I've exposed several web services in our product using Java and WS-Security. One of our customers wants to consume the web service using ColdFusion. Does ColdFusion support WS-Security? Can I get around it by writing a Java client and using that in ColdFusion?
(I don't know much about ColdFusion).
| ColdFusion does support web services, but its support for WS-Security is limited compared to some other programming environments. This means that working with WS-Security directly from ColdFusion might be challenging.
### Direct WS-Security Support in ColdFusion
ColdFusion (CFML) does not natively provide extensive s... | 24,152 | [
{
"from": "human",
"value": "I've exposed several web services in our product using Java and WS-Security. One of our customers wants to consume the web service using ColdFusion. Does ColdFusion support WS-Security? Can I get around it by writing a Java client and using that in ColdFusion?\n(I don't know muc... |
In python, if I say
print 'h'
I get the letter h and a newline. If I say
print 'h',
I get the letter h and no newline. If I say
print 'h',
print 'm',
I get the letter h, a space, and the letter m. How can I prevent Python from printing the space?
The print statements are different iterations of the same loop so ... | In Python 2, the behavior of the `print` statement can be controlled using a trailing comma, which prevents the automatic newline and adds a space instead. However, if you want to print multiple items without adding a space in between, you can use a few different approaches.
1. **Using `sys.stdout.write`:**
You can... | 26,675 | [
{
"from": "human",
"value": "In python, if I say\nprint 'h'\n\nI get the letter h and a newline. If I say \nprint 'h',\n\nI get the letter h and no newline. If I say\nprint 'h',\nprint 'm',\n\nI get the letter h, a space, and the letter m. How can I prevent Python from printing the space?\nThe print stat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.