instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
How do you go about checking that an IIS website is successfully using Kerberos and not falling back on NTLM?
To check if an IIS (Internet Information Services) website is successfully using Kerberos authentication instead of falling back on NTLM, you can follow these steps: ### Prerequisites: 1. **Ensure that Kerberos is correctly configured** in your Active Directory environment. 2. **Check that the Service Principal Names ...
43,416
[ { "from": "human", "value": "How do you go about checking that an IIS website is successfully using Kerberos and not falling back on NTLM?\n" }, { "from": "gpt", "value": "To check if an IIS (Internet Information Services) website is successfully using Kerberos authentication instead of falling ...
I have 5 HP Compaq t5530 Thin Clients with Windows CE 6.0 installed in 'em. I have a Windows 2003 server. Those 6 PCs should be used for browsing. And a user can browse for an hour and be able to extend time. I need to develop a simple client-server program to control the internet usability. What would be a suggested r...
Creating a simple client-server program for managing internet usability for your HP Compaq t5530 thin clients running Windows CE 6.0 involves several steps. Below is a suggested route to achieve this: ### Step 1: Define Requirements 1. **User Authentication**: Users need to log in to start their session. 2. **Session ...
40,521
[ { "from": "human", "value": "I have 5 HP Compaq t5530 Thin Clients with Windows CE 6.0 installed in 'em. I have a Windows 2003 server. Those 6 PCs should be used for browsing. And a user can browse for an hour and be able to extend time. I need to develop a simple client-server program to control the intern...
From what I gather, Google Chrome can run browser plugins written using NPAPI. I've written one that does its job just fine in Firefox, but makes Chrome crash and burn as soon as you embed it on a page. I don't even have to call any of my methods, embedding is enough to cause a crash. How do I debug this? I tried att...
Debugging NPAPI plugins can be quite challenging, especially when it comes to Google Chrome, since Chrome has limited support for NPAPI and has removed it entirely from version 45 onwards. However, if you are still trying to work with Chrome versions that support NPAPI (or perhaps if you're working in a special context...
49,565
[ { "from": "human", "value": "From what I gather, Google Chrome can run browser plugins written using NPAPI. \nI've written one that does its job just fine in Firefox, but makes Chrome crash and burn as soon as you embed it on a page. I don't even have to call any of my methods, embedding is enough to cause ...
I've been doing quite a bit of debugging of managed applications lately using both Visual Studio and WinDbg, and as such I'm often ask to assist colleagues in debugging situations. On several occasions I have found people aho just insert break points here and there and hope for the best. In my experience that is rarely...
Your structured approach to debugging is commendable and will certainly help in identifying issues more effectively. Here are some additional tips and best practices that can complement your method and enhance your debugging experience: 1. **Use Version Control**: Always ensure that you have version control in place, ...
48,202
[ { "from": "human", "value": "I've been doing quite a bit of debugging of managed applications lately using both Visual Studio and WinDbg, and as such I'm often ask to assist colleagues in debugging situations. On several occasions I have found people aho just insert break points here and there and hope for ...
Good morning, I am the developer of a medium sized PDA application that will be used out on the streets. The PDA will contain some vaguely sensitive data (names and addresses, etc). The encryption on the mobile database is already handled, however if someone got hold of the PDA whilst it was logged in they could happil...
To address your requirement of locking the PDA application after a period of inactivity, you can indeed extend the functionality to handle a wider range of events beyond just button clicks. Since you are working with Windows Forms in the Compact Framework, you have a couple of options to achieve this. ### Solution Ove...
45,838
[ { "from": "human", "value": "Good morning,\nI am the developer of a medium sized PDA application that will be used out on the streets. The PDA will contain some vaguely sensitive data (names and addresses, etc). The encryption on the mobile database is already handled, however if someone got hold of the PDA...
I've been sharing image lists across multiple forms in Delphi for years now. I have a TImageList on the main form of my app and then I have other forms that have components where I set the Images property to the image list from the main form (e.g. MyMainForm.MyImageList) at design time. The problem I'm having is that r...
The issue you're experiencing with the `Images` property of your components getting cleared randomly could be related to several factors, especially given your setup. Here are a few potential causes and solutions to investigate: ### 1. **Autosave Project Features** Since you mentioned enabling the Autosave Project des...
48,099
[ { "from": "human", "value": "I've been sharing image lists across multiple forms in Delphi for years now. I have a TImageList on the main form of my app and then I have other forms that have components where I set the Images property to the image list from the main form (e.g. MyMainForm.MyImageList) at desi...
I have an interesting situation where I need to deploy an ASP.NET MVC app to a (pseudo-boss's) local desktop machine so they can run it locally for data entry purposes. What would be the best way to get the app running on a vista machine without Visual Studio installed? Ideally, It would be a one click that started ...
Deploying an ASP.NET MVC application to a local machine without Visual Studio can be a bit tricky, especially when dealing with a non-technical user. However, there are several approaches you can take to achieve this, focusing on simplicity and ease of use. ### Option 1: Use the ASP.NET Development Server (Cassini) 1....
47,698
[ { "from": "human", "value": "I have an interesting situation where I need to deploy an ASP.NET MVC app to a (pseudo-boss's) local desktop machine so they can run it locally for data entry purposes. What would be the best way to get the app running on a vista machine without Visual Studio installed? \nIdea...
My application pops a form as a child of the main form. On the form is User Control with a Panel where Graphics are rendered. When executed from Visual Studio in debug mode the drawing is often rendered as expected, imagine a simply XY graph. If the panel's graphic aren't drawn then adding two or three break points to ...
The behavior you are observing in your application could be attributed to several factors related to the timing of the rendering process and how the Windows Forms application handles painting and layout. Here are some insights and potential solutions to ensure that your graphics are rendered consistently: ### 1. **Dou...
45,879
[ { "from": "human", "value": "My application pops a form as a child of the main form. On the form is\nUser Control with a Panel where Graphics are rendered. When executed\nfrom Visual Studio in debug mode the drawing is often rendered as expected,\nimagine a simply XY graph. If the panel's graphic aren't dra...
Hosting a WCF Service Host in a Windows Service really seems to be quite a simple way to go to communicate with a running Windows Service...if you're running 3.0/3.5. What the easiest way to get the same sorts of things out of the 2.0 Framework if that's what you're stuck with?
If you are limited to .NET Framework 2.0 and cannot use WCF (Windows Communication Foundation), you can still create a Windows Service that communicates with clients using other techniques. Here are some options: ### 1. **HTTP Listener**: You can use the `HttpListener` class in .NET Framework 2.0 to create a simple HT...
49,893
[ { "from": "human", "value": "Hosting a WCF Service Host in a Windows Service really seems to be quite a simple way to go to communicate with a running Windows Service...if you're running 3.0/3.5.\nWhat the easiest way to get the same sorts of things out of the 2.0 Framework if that's what you're stuck with?...
I'm not sure if this a settings problem or an HTML problem, but on a page layout I'm working on, Firefox does not render the stylesheet immediately. Meaning for maybe half a second I can see the unstyled page, then the stylesheet kicks in and it renders as I expect. All my stylesheets are in external css files loaded i...
The issue you're experiencing is commonly referred to as "FOUC" or "Flash of Unstyled Content." This happens when the browser displays the unstyled content before the external stylesheets are fully loaded. While this is particularly noticeable in Firefox for you, it can occur in any browser under certain conditions. H...
47,952
[ { "from": "human", "value": "I'm not sure if this a settings problem or an HTML problem, but on a page layout I'm working on, Firefox does not render the stylesheet immediately. Meaning for maybe half a second I can see the unstyled page, then the stylesheet kicks in and it renders as I expect.\nAll my styl...
Suppose I have this interface public interface IFoo { ///<summary> /// Foo method ///</summary> void Foo(); ///<summary> /// Bar method ///</summary> void Bar(); ///<summary> /// Situation normal ///</summary> void Snafu(); } And this class public class Foo : IFoo { ...
Yes, there are several approaches and tools that can help you automate the process of inheriting XML comments from an interface or base class in C#. ### 1. Visual Studio / Rider Features **In Visual Studio**, starting with Visual Studio 2019, there is built-in support for copying XML comments when implementing membe...
45,407
[ { "from": "human", "value": "Suppose I have this interface\npublic interface IFoo\n{\n ///<summary>\n /// Foo method\n ///</summary>\n void Foo();\n\n ///<summary>\n /// Bar method\n ///</summary>\n void Bar();\n\n ///<summary>\n /// Situation normal\n ///</summary>\n voi...
When selecting a block of text (possibly spanning across many DOM nodes), is it possible to extract the selected text and nodes using Javascript? Imagine this HTML code: <h1>Hello World</h1><p>Hi <b>there!</b></p> If the user initiated a mouseDown event starting at "World..." and then a mouseUp even right after "there...
Yes, you can extract the selected text and the corresponding DOM nodes using JavaScript. The Selection API provides a way to get the selected text and the range of selected nodes in the DOM. You can utilize `window.getSelection()` to achieve this. Here’s a function that retrieves the selected text and the nodes involv...
49,617
[ { "from": "human", "value": "When selecting a block of text (possibly spanning across many DOM nodes), is it possible to extract the selected text and nodes using Javascript?\nImagine this HTML code:\n<h1>Hello World</h1><p>Hi <b>there!</b></p>\n\nIf the user initiated a mouseDown event starting at \"World....
I am doing something like this: #include <signal.h> class myClass { public: void myFunction () { signal(SIGIO,myHandler); } void myHandler (int signum) { /** * Handling code */ } } I am working on Ubuntu, using gcc. But it won't compile. It is complaining w...
The issue you are encountering is related to the fact that member functions in C++ have a different calling convention compared to regular functions (free functions). In C++, member functions have an implicit `this` pointer as their first argument, which changes the function signature. The `signal` function expects a ...
47,147
[ { "from": "human", "value": "I am doing something like this:\n#include <signal.h>\n\nclass myClass {\npublic: \n void myFunction () \n {\n signal(SIGIO,myHandler);\n }\n\n void myHandler (int signum)\n {\n /**\n * Handling code\n */\n }\n\n}\n\nI am working on U...
Our 32-Bit application launches Windows LNK files (Shell Links) via ShellExecute. When it tries to "launch" a link to a 64-Bit binary (such as the "Internet Explorer (64-Bit)" shortcut in Start Menu) it always ends up launching the 32-Bit binary. Internally, ShellExecute incorrectly resolves the link target: There's a ...
In a 32-bit application running on a 64-bit version of Windows, shell links (LNK files) that point to 64-bit applications will typically resolve to the 32-bit version of the application due to how Windows handles file system redirection and shortcuts. This can lead to confusion when attempting to launch a 64-bit applic...
48,851
[ { "from": "human", "value": "Our 32-Bit application launches Windows LNK files (Shell Links) via ShellExecute. When it tries to \"launch\" a link to a 64-Bit binary (such as the \"Internet Explorer (64-Bit)\" shortcut in Start Menu) it always ends up launching the 32-Bit binary. Internally, ShellExecute inc...
I'm wanting to use google maps and see a million ways to do it on the web. Some are javascript methods and some are asp.net server components with which I have hit and miss luck. What's the easiest and most reliable way using c# and asp.net? I have my location data including geocodes in a database. I want to provide us...
Certainly! You can achieve this by using the Google Maps JavaScript API in combination with ASP.NET. Below is a step-by-step guide to implement a solution that allows users to look up locations and display them on a Google Map with markers. ### Step 1: Set Up Your Google Maps API Key 1. Go to the Google Cloud Console...
46,486
[ { "from": "human", "value": "I'm wanting to use google maps and see a million ways to do it on the web. Some are javascript methods and some are asp.net server components with which I have hit and miss luck. What's the easiest and most reliable way using c# and asp.net?\nI have my location data including ge...
ok, ive a class and i pass an object as property. the object that i pass is a List<X> in my class im trying to access the Object index by reflection BUT I CAN'T!!! Example: this class works i just wrote down the part i want to show you and i need help. class MyClass { private object _recordSet; public object R...
To access elements within a list or any collection via reflection, you'll need to use the appropriate methods to retrieve the values since you cannot directly use an indexer like `_dataSource[cont]` when `_dataSource` is of type `object`. Instead, you can use reflection to invoke the `Get` method of the collection to r...
45,493
[ { "from": "human", "value": "ok, ive a class and i pass an object as property.\nthe object that i pass is a List<X>\nin my class im trying to access the Object index by reflection BUT I CAN'T!!! \nExample:\nthis class works i just wrote down the part i want to show you and i need help.\nclass MyClass\n{\n ...
I have a WebBrowser control which is being instantiated dynamically from a background STA thread because the parent thread is a BackgroundWorker and has lots of other things to do. The problem is that the Navigated event never fires, unless I pop a MessageBox.Show() in the method that told it to .Navigate(). I shall ...
The issue you're facing with the `WebBrowser` control not firing the `Navigated` event when instantiated from a background STA thread can be attributed to how the Windows Forms controls handle their message loops and threading. The `WebBrowser` control, like many other Windows Forms controls, needs to run on the main U...
47,273
[ { "from": "human", "value": "I have a WebBrowser control which is being instantiated dynamically from a background STA thread because the parent thread is a BackgroundWorker and has lots of other things to do.\nThe problem is that the Navigated event never fires, unless I pop a MessageBox.Show() in the meth...
I am trying to write an rspec test for a controller that accesses a model Group. @request.env['HTTP_REFERER'] = group_url(@mock_group) ### Line 49 I get this: NoMethodError in 'ActsController responding to create should redirect to :back' You have a nil object when you didn't expect it! The error occurred while eva...
It looks like you're encountering an issue with the `group_url(@mock_group)` method call in your RSpec test. The error message indicates that there is a problem related to URL generation, specifically that the `@url` variable is `nil` when it is expected to have a value. Here are some steps and suggestions to help you...
49,877
[ { "from": "human", "value": "I am trying to write an rspec test for a controller that accesses a\nmodel Group.\n\n@request.env['HTTP_REFERER'] = group_url(@mock_group) ### Line 49\n\nI get this:\n\nNoMethodError in 'ActsController responding to create should redirect to :back'\nYou have a nil object when y...
I'm not familiar with shell scripting, so I'm not sure how to do it or if it is possible. If you can give me links or advice, that would be great. What I want to do is: Create a file, simple text file EX: param1 (RANDOMVALUE) Where randomvalue is a random number generated. run a program with that file we just creat...
Sure! You can achieve this in `tcsh` by creating a simple shell script. Below are the steps and a sample script that you can use to perform the tasks you described. ### Step-by-Step Guide 1. **Create a script file**: You can create a script file using a text editor. For example, you could use `nano` or `vi`: ```sh...
49,646
[ { "from": "human", "value": "I'm not familiar with shell scripting, so I'm not sure how to do it or if it is possible. If you can give me links or advice, that would be great.\nWhat I want to do is:\n\nCreate a file, simple text file\nEX:\nparam1 (RANDOMVALUE)\nWhere randomvalue is a random number generat...
looking tutorials for integrating OpenId feature in .net
Integrating OpenID authentication in a .NET application can significantly enhance user management by allowing users to log in using their existing credentials from a trusted provider. Here’s a general guide to help you get started: ### 1. Choose an OpenID Provider Choose the OpenID provider that you want to integrate ...
47,213
[ { "from": "human", "value": "looking tutorials for integrating OpenId feature in .net \n" }, { "from": "gpt", "value": "Integrating OpenID authentication in a .NET application can significantly enhance user management by allowing users to log in using their existing credentials from a trusted pr...
I have made a toolbar that I want to enable from a systray application written in C#, the actual toolbar enabling is done from a C++ part using [DLLImport]. Current I use: SHLoadInProc(__uuidof(MyBandLoader)) but this fails on vista (SHLoadInProc is not implemented any more), and on Windows XP SP2 with IE6 (the quick ...
Enabling a toolbar from a systray application in C# while relying on a C++ DLL can be challenging, especially across different Windows versions like XP and Vista. Here’s a more detailed breakdown of your options, given the issues you've encountered. ### Approach Overview 1. **Using SHLoadInProc**: - As you mention...
47,219
[ { "from": "human", "value": "I have made a toolbar that I want to enable from a systray application written in C#, the actual toolbar enabling is done from a C++ part using [DLLImport].\nCurrent I use:\nSHLoadInProc(__uuidof(MyBandLoader))\n\nbut this fails on vista (SHLoadInProc is not implemented any more...
Are there any issues with changing elements which will appear on a web page within a thread. I am from a windows programming background and obviously if a thread needs to change the GUI in some way you have to delegate it to the GUI thread. Basically my page uses 3 sql queries which can be run concurrently to obtain th...
In web development, especially when working with asynchronous operations like SQL queries, you need to be careful about how you manipulate the UI and interact with the thread. Here are several considerations and potential issues related to your approach of using threads to handle SQL queries in a web application contex...
47,111
[ { "from": "human", "value": "Are there any issues with changing elements which will appear on a web page within a thread. I am from a windows programming background and obviously if a thread needs to change the GUI in some way you have to delegate it to the GUI thread.\nBasically my page uses 3 sql queries ...
I need a reasonably smart algorithm to come up with "nice" grid lines for a graph (chart). For example, assume a bar chart with values of 10, 30, 72 and 60. You know: Min value: 10 Max value: 72 Range: 62 The first question is: what do you start from? In this case, 0 would be the intuitive value but this won't hold u...
Creating a "nice" set of grid lines for a graph requires some considerations of the data range, desired aesthetics, and practical constraints. Here’s an algorithm that captures your requirements effectively: ### Steps to Generate Nice Grid Lines 1. **Define Boundaries**: - Determine the minimum (`min_value`) and m...
46,671
[ { "from": "human", "value": "I need a reasonably smart algorithm to come up with \"nice\" grid lines for a graph (chart).\nFor example, assume a bar chart with values of 10, 30, 72 and 60. You know:\nMin value: 10\nMax value: 72\nRange: 62\nThe first question is: what do you start from? In this case, 0 wo...
In Eclipse RCP way of doing things, where should I keep my model objects? And when they are loaded or changed, how should they talk to the views? I am attempting to port my existing application to Eclipse RCP. It could be viewed as an IDE-like application: I open a file, which contains links to source files. The source...
When developing an Eclipse RCP application, organizing your model objects and managing their interactions with views is crucial for maintainability and scalability. Here are some guidelines on how to effectively manage model objects and their communication with views: ### 1. Model Storage Instead of a singleton manag...
45,255
[ { "from": "human", "value": "In Eclipse RCP way of doing things, where should I keep my model objects? And when they are loaded or changed, how should they talk to the views?\nI am attempting to port my existing application to Eclipse RCP. It could be viewed as an IDE-like application: I open a file, which ...
I have a DataGridColumn with an ItemRenderer that extends the Box component. The default display is a Text component. When the user clicks on the text component, I change the State to add a PopUpMenuButton child, and make the Text component invisible. This works fine. However, I only want to allow one PopUpMenuButton t...
To achieve the functionality of having only one `PopUpMenuButton` visible at a time in your `DataGridColumn`, you can utilize the `DataGrid`'s `dataProvider` and `listData` properties to keep track of which item renderer is currently in the "editing" state. Here’s a step-by-step approach to accomplish this: 1. **Trac...
48,869
[ { "from": "human", "value": "I have a DataGridColumn with an ItemRenderer that extends the Box component. The default display is a Text component. When the user clicks on the text component, I change the State to add a PopUpMenuButton child, and make the Text component invisible. This works fine. However, I...
I have followed the blog post written by Steve Sanderson at blog.codeville.net/2008/10/14/partial-requests-in-aspnet-mvc. It all work fine when follow it exactly but I was hoping that someone may have looked at it and be able to assist me in adapting it slightly. I basically have this "partial request" calling from one...
To help you troubleshoot the issue you're facing, let's clarify what you're trying to accomplish and how to adjust your code accordingly. From your description, it seems like you're trying to execute a partial request to get some data from another controller, and then use that data to populate a dropdown list. The err...
48,962
[ { "from": "human", "value": "I have followed the blog post written by Steve Sanderson at blog.codeville.net/2008/10/14/partial-requests-in-aspnet-mvc. It all work fine when follow it exactly but I was hoping that someone may have looked at it and be able to assist me in adapting it slightly.\nI basically ha...
I have a TextCtrl in my wxPython program and I'd like to set its width to exactly 3 characters. However, the only way to set its size manually accepts only numbers of pixels. Is there any way to specify characters instead of pixels?
In wxPython, setting the size of a `TextCtrl` in terms of characters instead of pixels is not directly supported. However, you can calculate the pixel width of a character by using the font metrics of the current font and then set the size in pixels based on that. Here is how you can achieve this: 1. Retrieve the cur...
49,571
[ { "from": "human", "value": "I have a TextCtrl in my wxPython program and I'd like to set its width to exactly 3 characters. However, the only way to set its size manually accepts only numbers of pixels. Is there any way to specify characters instead of pixels?\n" }, { "from": "gpt", "value": ...
is it possible to develop DLL for both win32 console and MFC GUI. If yes please explain. What i want to do is to create dll that contains certain API's for both win32 console and MFC GUI.
Yes, it is indeed possible to develop a Dynamic Link Library (DLL) that can be used by both Win32 console applications and MFC (Microsoft Foundation Class) GUI applications. The DLL can contain a set of APIs (functions) that can be called from both types of applications. Below are the steps and considerations to achiev...
49,816
[ { "from": "human", "value": "is it possible to develop DLL for both win32 console and MFC GUI. If yes please explain.\nWhat i want to do is to create dll that contains certain API's for both win32 console and MFC GUI.\n" }, { "from": "gpt", "value": "Yes, it is indeed possible to develop a Dynam...
My ASP.NET application needs a number of supporting services to run periodically in the background. For example: I need to query the database (or cache) every 1-5 minutes, identify overdue work items and notify users by email I need to generate nightly reports that are then emailed to subscribers Plus other system/non...
When implementing background services in an ASP.NET application, you generally have a few options, each with its own advantages and disadvantages. Let's explore the choices you've mentioned, focusing on best practices for long-term maintainability and reliability. ### Options for Implementing Background Services: 1. ...
46,549
[ { "from": "human", "value": "My ASP.NET application needs a number of supporting services to run periodically in the background. For example:\n\nI need to query the database (or cache) every 1-5 minutes, identify overdue work items and notify users by email\nI need to generate nightly reports that are then ...
Is there a full featured, job scheduling package available for PHP? I'm looking for the PHP equivalent to Java's Quartz. I'm fine having things triggered externally from cron to drive the system. The functionality I'd be looking for: Ability to register task (class/method) to be called at given intervals. Ability to s...
Yes, there are several PHP packages that can help you achieve job scheduling functionality similar to Java's Quartz. While PHP doesn't have a direct equivalent to Quartz with all its features, there are tools and libraries that can fulfill many of your requirements. Here are a few options that you might find useful: #...
48,207
[ { "from": "human", "value": "Is there a full featured, job scheduling package available for PHP? I'm looking for the PHP equivalent to Java's Quartz. I'm fine having things triggered externally from cron to drive the system. The functionality I'd be looking for:\n\nAbility to register task (class/method) to...
I need to create feature which will iterate through all subsites of site collection and add some sample content to each of them (sample content=new pages,images,documents,possibly some lists). There is solution that uses recursion to loop through sites (it can be found here). So i'm asking: Did any of you implemented...
Creating a feature to iterate through all subsites of a SharePoint site collection and add sample content can be achieved using either the SharePoint Client Object Model (CSOM) or the Server Object Model, depending on your environment (SharePoint Online or SharePoint On-Premises). Since you're considering a recursive a...
49,567
[ { "from": "human", "value": "I need to create feature which will iterate through all subsites of site collection and add some sample content to each of them (sample content=new pages,images,documents,possibly some lists). There is solution that uses recursion to loop through sites (it can be found here). \n...
I asked about setting up an in-memory dataset with TClientDataset, and was told I had to use the "Create Data Set" command in the form designer. That works just fine until I try to create a master-detail database relation. If I have a field def of type ftDataSet, then running the Create Data Set command (or calling t...
The issue you're encountering with `TClientDataset` and the "Invalid Field Type" error when trying to set up master-detail relationships typically arises from the way the field definitions are managed in a `TClientDataset`. `TClientDataset` does indeed support master-detail relationships, but you cannot create a fiel...
43,753
[ { "from": "human", "value": "I asked about setting up an in-memory dataset with TClientDataset, and was told I had to use the \"Create Data Set\" command in the form designer. That works just fine until I try to create a master-detail database relation. If I have a field def of type ftDataSet, then runnin...
$rowfetch =~ s/['-]//g; #All chars inside the [ ] will be filtered out. $rowfetch =~ m/(\w+), ?(.)/; printf $fh lc($2.$1); I got help building this regular expression yesterday, but I don't fully understand it.It takes a name like Parisi, Kenneth and prints out kparisiKnowns:s/ = substitutem/ = matchI trie...
Let's break down the code you provided step by step to clarify its functionality and how regular expressions work in this context. ### The Code Breakdown 1. **Removing Unwanted Characters:** ```perl $rowfetch =~ s/['-]//g; # All chars inside the [ ] will be filtered out. ``` - This line uses a substitutio...
47,625
[ { "from": "human", "value": " $rowfetch =~ s/['-]//g; #All chars inside the [ ] will be filtered out.\n $rowfetch =~ m/(\\w+), ?(.)/;\n printf $fh lc($2.$1);\n\nI got help building this regular expression yesterday, but I don't fully understand it.It takes a name like Parisi, Kenneth and prints out...
I want to read an XML file into a char *buffer using C. What is the best way to do this? How should I get started?
Reading an XML file into a `char *buffer` in C can be accomplished using standard file I/O functions. Below, I'll guide you through the steps to achieve this. ### Steps to Read an XML File into a char * Buffer 1. **Open the XML File**: Use `fopen()` to open the file in read mode. 2. **Determine the Size of the File**...
47,706
[ { "from": "human", "value": "I want to read an XML file into a char *buffer using C.\nWhat is the best way to do this?\nHow should I get started?\n" }, { "from": "gpt", "value": "Reading an XML file into a `char *buffer` in C can be accomplished using standard file I/O functions. Below, I'll gui...
As the question states, i am a C#/Java programmer who is interested in (re)learning C++. As you know C#/Java have a somewhat strict project file structure (especially Java). I find this structure to be very helpful and was wondering if it is a) good practice to do a similar structure in a C++, b) if so, what is the bes...
It's great that you're interested in (re)learning C++! Having a well-structured project layout is beneficial for maintaining readability, manageability, and scalability in your codebase, just like in C# or Java. ### A) Is it Good Practice? Yes, it is considered good practice to maintain a structured project file layo...
44,743
[ { "from": "human", "value": "As the question states, i am a C#/Java programmer who is interested in (re)learning C++. As you know C#/Java have a somewhat strict project file structure (especially Java). I find this structure to be very helpful and was wondering if it is a) good practice to do a similar stru...
While displaying a pop-up window above a wysiwyg editor, the caret (cursor in text area) is still visible under the pop-up window. Any ideas?
When displaying a pop-up window above a WYSIWYG (What You See Is What You Get) editor, if the caret is still visible under the pop-up window, it can lead to a confusing user experience. This can happen due to the way elements are layered on the webpage. Here are some solutions to address this issue: 1. **Z-Index Adjus...
49,006
[ { "from": "human", "value": "While displaying a pop-up window above a wysiwyg editor, the caret (cursor in text area) is still visible under the pop-up window. Any ideas?\n" }, { "from": "gpt", "value": "When displaying a pop-up window above a WYSIWYG (What You See Is What You Get) editor, if th...
In this question, I asked about breaking a dataset into subsets, and got a good response. Now I have the opposite problem. I've got two different datasets, representing objects of two different subclasses of a common ancestor, and I need to have the same TDBLookupComboBox search both of them at the same time, using t...
To create a TDBLookupComboBox that searches across two different datasets simultaneously, you'll need to combine the data from both datasets into a single dataset or data structure that the combo box can work with. Here are several approaches to achieve this: ### 1. Using a Union Query (If using a database) If you're ...
49,464
[ { "from": "human", "value": "In this question, I asked about breaking a dataset into subsets, and got a good response. Now I have the opposite problem. I've got two different datasets, representing objects of two different subclasses of a common ancestor, and I need to have the same TDBLookupComboBox sear...
How do I setup an Ant task to generate a Findbugs report when the source folder has many jars in it? I'm looking for a worked example of the ant task required to output the fancy HTML from a folder containing multiple jars
To set up an Apache Ant task that generates a FindBugs report from a folder containing multiple JAR files, you will need to follow a structured approach. Below, I'll provide a step-by-step example that includes the necessary Ant tasks. ### Step 1: Ensure Required Tools are Available 1. **Apache Ant**: Make sure you ha...
45,748
[ { "from": "human", "value": "How do I setup an Ant task to generate a Findbugs report when the source folder has many jars in it?\nI'm looking for a worked example of the ant task required to output the fancy HTML from a folder containing multiple jars\n" }, { "from": "gpt", "value": "To set up ...
I have a database which gets updated with 200-1000 new rows per day. Now, I'd like to have an SQL-statement which returns the data day-by-day, hour-by-hour so I can give a rough estimate for the current trend, i.e. how many rows will be added to the database today, just by taking a quick look at those historical graphs...
To achieve your goal of retrieving data from your database in a day-by-day, hour-by-hour fashion, you will want to use SQL to summarize the number of rows added each hour for the past 10 days, including the current day. Assuming you have a table called `your_table` with a timestamp column named `created_at` that recor...
48,170
[ { "from": "human", "value": "I have a database which gets updated with 200-1000 new rows per day. Now, I'd like to have an SQL-statement which returns the data day-by-day, hour-by-hour so I can give a rough estimate for the current trend, i.e. how many rows will be added to the database today, just by takin...
I've built a nice website system that caters to the needs of a small niche market. I've been selling these websites over the last year by deploying copies of the software using Capistrano to my web server. It occurs to me that the only difference in these websites is the database, the CSS file, and a small set of image...
You are facing a common challenge in multi-tenant application architecture, and there are valid considerations for both approaches you've mentioned. Let's break down the pros and cons of each, and I'll provide some recommendations. ### Multiple Databases Approach **Pros:** - **Isolation**: Each client’s data is compl...
49,453
[ { "from": "human", "value": "I've built a nice website system that caters to the needs of a small niche market. I've been selling these websites over the last year by deploying copies of the software using Capistrano to my web server.\nIt occurs to me that the only difference in these websites is the databa...
I'm currently writing a program to generate really enormous (65536x65536 pixels and above) Mandelbrot images, and I'd like to devise a spectrum and coloring scheme that does them justice. The wikipedia featured mandelbrot image seems like an excellent example, especially how the palette remains varied at all zoom level...
To create visually striking and varied Mandelbrot images, especially at high resolutions and deep zoom levels, a carefully designed color palette is essential. Here are some strategies you can use to devise a spectrum and coloring scheme that maintains visual interest across various levels of zoom: ### 1. **Smooth Col...
46,906
[ { "from": "human", "value": "I'm currently writing a program to generate really enormous (65536x65536 pixels and above) Mandelbrot images, and I'd like to devise a spectrum and coloring scheme that does them justice. The wikipedia featured mandelbrot image seems like an excellent example, especially how the...
Assuming that writing nhibernate mapping files is not a big issue....or polluting your domain objects with attributes is not a big issue either.... what are the pros and cons? is there any fundamental technical issues? What tends to influence peoples choice? not quite sure what all the tradeoffs are.
When considering using NHibernate with either mapping files or attributes for mapping domain objects to a database, there are several pros and cons associated with each approach. The choice between them can be influenced by various factors including project requirements, team preferences, and maintainability. ### Pros...
48,290
[ { "from": "human", "value": "Assuming that writing nhibernate mapping files is not a big issue....or polluting your domain objects with attributes is not a big issue either....\nwhat are the pros and cons?\nis there any fundamental technical issues? What tends to influence peoples choice?\nnot quite sure w...
How do I enable multi-select in a WPF ListView by dragging? Setting the SelectionMode property to Extended does allow multi-select using Shift and Ctrl, but not by clicking and dragging. Setting the SelectionMode property to Multiple gives a sticky selection which isn't what I want.
To enable multi-select in a WPF `ListView` by dragging, you will have to implement some additional logic because the default behavior of WPF's `ListView` does not support selection via dragging out of the box, even when using `SelectionMode` set to `Extended`. Here's how you can implement drag selection in a `ListView...
42,011
[ { "from": "human", "value": "How do I enable multi-select in a WPF ListView by dragging? \nSetting the SelectionMode property to Extended does allow multi-select using Shift and Ctrl, but not by clicking and dragging. Setting the SelectionMode property to Multiple gives a sticky selection which isn't what I...
I read some information about Java layout managers and the recommendation was MigLayout. My problem is, that I didn't found any tutorial or easy step-by-step documentation. So I want to know how this all works, but I don't know how.
MigLayout is indeed a powerful and flexible layout manager for Java Swing, and it is often recommended because of its ease of use and the ability to create complex layouts with relatively simple code. Below, I'll provide an overview of how to use MigLayout along with some basic examples to help you get started. ### St...
46,618
[ { "from": "human", "value": "I read some information about Java layout managers and the recommendation was MigLayout.\nMy problem is, that I didn't found any tutorial or easy step-by-step documentation.\nSo I want to know how this all works, but I don't know how.\n" }, { "from": "gpt", "value": ...
I have an IIS located on serverA I have userA at locationA who has opened a content management system site, hosted on serverA. One of the features of the system is that it allows the user to move a file to LocationB, all within the same network. Now when this move occurs and due to bandwidth restrictions, would this fi...
In a typical scenario where a user at LocationA interacts with a web application hosted on serverA (IIS), and the application has a feature that allows moving a file to LocationB, the process usually involves the following steps: 1. **Upload to ServerA**: When the user initiates a move operation, the file is generally...
41,957
[ { "from": "human", "value": "I have an IIS located on serverA\nI have userA at locationA who has opened a content management system site, hosted on serverA.\nOne of the features of the system is that it allows the user to move a file to LocationB, all within the same network. Now when this move occurs and d...
In .NET is it possible to convert a raw HTTP request to HTTPWebRequest object? I'm sure .NET internally doing it. Any idea which part of the .NET is actually handling this? Can I call it or is there any external library which allows raw HTTP connections?
In .NET, converting a raw HTTP request to an `HttpWebRequest` object directly is not a supported operation. `HttpWebRequest` is an abstraction that handles the creation and sending of HTTP requests, along with managing responses, but it does not expose a way to construct an instance from raw HTTP request data. .NET's ...
49,652
[ { "from": "human", "value": "In .NET is it possible to convert a raw HTTP request to HTTPWebRequest object?\nI'm sure .NET internally doing it. Any idea which part of the .NET is actually handling this? Can I call it or is there any external library which allows raw HTTP connections?\n" }, { "from":...
Microsoft recently announced that they were endorsing jQuery as an "officially" supported JavaScript library. I certainly wouldn't argue that jQuery is a fantastic framework to work with. In fact, I just bought the book. But I'm curious to know why. Specifically, I'm interested to know whether or not we web developer...
The endorsement of jQuery by Microsoft marked a significant point in the evolution of JavaScript libraries and frameworks, but it's important to understand the context and implications of such endorsements. ### Why jQuery? 1. **Ease of Use**: jQuery was designed to simplify the client-side scripting of HTML. Its synt...
47,857
[ { "from": "human", "value": "Microsoft recently announced that they were endorsing jQuery as an \"officially\" supported JavaScript library.\nI certainly wouldn't argue that jQuery is a fantastic framework to work with. In fact, I just bought the book. But I'm curious to know why.\nSpecifically, I'm inter...
I've recently been exposed to the fluent interface in nUnit and I love it; however, I am using msTest. Does anyone know if there is a fluent interface that is either testing framework agnostic or for msTest?
In MSTest, there isn't a built-in fluent interface like you might find in NUnit or other testing frameworks. However, you can create a fluent interface for your tests using custom extension methods or helper classes. This approach allows you to create a more readable and expressive syntax in your unit tests. Here's an...
48,361
[ { "from": "human", "value": "I've recently been exposed to the fluent interface in nUnit and I love it; however, I am using msTest. \nDoes anyone know if there is a fluent interface that is either testing framework agnostic or for msTest? \n" }, { "from": "gpt", "value": "In MSTest, there isn't ...
I need to use one of my VB.NET projects in a C++ project. The interface between the two will be for the C++ code to instantiate and call methods on one of the .NET assembly objects. Both compile to DLLs (and then the C++ DLL is loaded from the NTVDM as a VDD, but that's probably not relevant.) If possible I would like ...
To enable a C++ application to interact with a VB.NET project without using COM or touching the registry, you can utilize a technique that involves using C++/CLI as a bridge between native C++ and .NET assemblies. C++/CLI allows you to call .NET code directly from C++ and vice versa. Here’s a step-by-step guide on how ...
49,685
[ { "from": "human", "value": "I need to use one of my VB.NET projects in a C++ project. The interface between the two will be for the C++ code to instantiate and call methods on one of the .NET assembly objects.\nBoth compile to DLLs (and then the C++ DLL is loaded from the NTVDM as a VDD, but that's probabl...
I'm starting my adventure with Ruby on Rails and as IDE I choose Netbeans. It has bundled server Webrick and it had worked good. But after some changes in my first application it gives me internal error 500 - but nothing shows in console. And older actions give the same result. How can I find where the problem is? I wo...
When you encounter a 500 Internal Server Error in a Ruby on Rails application, it can be frustrating, especially if no errors are being displayed in the console. Here are some steps you can follow to diagnose and resolve the issue: ### 1. Check the Logs The first step in diagnosing a Rails application is to check the...
45,478
[ { "from": "human", "value": "I'm starting my adventure with Ruby on Rails and as IDE I choose Netbeans. It has bundled server Webrick and it had worked good. But after some changes in my first application it gives me internal error 500 - but nothing shows in console. And older actions give the same result.\...
Premise I believe that there is a way to objectively define "Good" and "Bad" Object-Oriented design techniques and that, as a community we can determine what these are. This is an academic exercise. If done with seriousness and resolve, I believe it can be of great benefit to the community as a whole. The community w...
### Good Principle: Separation of Concerns #### Short Description Separation of Concerns (SoC) is a design principle for separating a computer program into distinct sections, such that each section addresses a separate concern. In Object-Oriented Programming (OOP), this often translates into designing classes that enc...
49,512
[ { "from": "human", "value": "Premise\nI believe that there is a way to objectively define \"Good\" and \"Bad\" Object-Oriented design techniques and that, as a community we can determine what these are. This is an academic exercise. If done with seriousness and resolve, I believe it can be of great benefi...
Because of some non standard table creation options I am forced to use the sql dump instead of the standard schema.rb (i.e. I have uncommented this line in the environment.rb config.active_record.schema_format = :sql). I have noticed that when I use the sql dump that my fixtures do not seem to be loaded into the databa...
When you switch to using SQL schema dumps (by setting `config.active_record.schema_format = :sql`), Rails will generate a raw SQL file for your database schema instead of the usual Ruby-based `schema.rb` file. This SQL file contains the commands necessary to recreate the database schema, but it does not include any fix...
49,562
[ { "from": "human", "value": "Because of some non standard table creation options I am forced to use the sql dump instead of the standard schema.rb (i.e. I have uncommented this line in the environment.rb config.active_record.schema_format = :sql). I have noticed that when I use the sql dump that my fixtures...
I'm developing a web application that is targeted at IE and during testing would like to log in as a number of different users and test their interactions with each other. At present I have to log in and out to switch users; Opening another window just overrides the cookies/session. Is there any way to get IE to run co...
To test your web application in Internet Explorer (IE) with different user accounts without having to log out and log back in each time, you have a few options to create separate sessions. Here are some suggestions: ### 1. Use Multiple User Accounts in Windows You can create multiple user accounts in Windows and swit...
48,145
[ { "from": "human", "value": "I'm developing a web application that is targeted at IE and during testing would like to log in as a number of different users and test their interactions with each other.\nAt present I have to log in and out to switch users; Opening another window just overrides the cookies/ses...
In the past, I have used XSD.exe to create c# classes from an xsd. Today, I added an XSD to VS.NET 2008 SP1 and it automatically generated a dataset from my xsd, slick but I don't want a dataset. Is there a way to have vs.net automatically execute xsd.exe each time I modify my xsd.
Yes, you can automate the process of generating C# classes from an XSD file using `xsd.exe` in Visual Studio. While Visual Studio doesn’t have built-in support to automatically run external tools like `xsd.exe` each time you modify an XSD file, you can set up a post-build event or use a custom build action. Here’s how ...
49,649
[ { "from": "human", "value": "In the past, I have used XSD.exe to create c# classes from an xsd. Today, I added an XSD to VS.NET 2008 SP1 and it automatically generated a dataset from my xsd, slick but I don't want a dataset. Is there a way to have vs.net automatically execute xsd.exe each time I modify my...
Previously our SharePoint server was 32-bit and we used the web capture web part to display a bugzilla search results page. Since we've migrated to a 64-bit server the webpart no longer works. We're running the same versions of everything, the only change was moving from a Windows Server 2003 32-bit box to a Windows Se...
The issue you're experiencing with the Web Capture web part after migrating from a 32-bit to a 64-bit SharePoint server could indeed be related to the architecture difference. Here are some troubleshooting steps and potential solutions you can consider: ### 1. Ensure Compatibility - **Web Part Compatibility**: Ensure ...
46,060
[ { "from": "human", "value": "Previously our SharePoint server was 32-bit and we used the web capture web part to display a bugzilla search results page. Since we've migrated to a 64-bit server the webpart no longer works. We're running the same versions of everything, the only change was moving from a Windo...
The kind of functions are of the sort of: (defun display-all () "Display all items in the database." (dolist (item *database*) (format t "~{~a:~10t~a~%~}~%" item))) (defun prompt-read (prompt) (format *query-io* "~a: " prompt) (force-output *query-io*) (read-line *query-io*)) (defun prompt-for-item () ...
It looks like you're working with Common Lisp and are interested in using the Ltk (Lisp Binding for Tk) library, particularly for handling text widgets. Below, I'll provide a simple example that demonstrates how to create a text widget using Ltk, allowing users to display text or enter data. ### Example of Using a Tex...
46,969
[ { "from": "human", "value": "The kind of functions are of the sort of:\n(defun display-all ()\n \"Display all items in the database.\"\n (dolist (item *database*)\n (format t \"~{~a:~10t~a~%~}~%\" item)))\n\n(defun prompt-read (prompt)\n (format *query-io* \"~a: \" prompt)\n (force-output *query-io*)...
Button class: class SubmitButton extends JButton implements ActionListener { public SubmitButton(String title){ super(title); .... Where I declare it: SubmitButton submit = new SubmitButton("Submit"); submit.setBounds(530+150, 200, 100, 25); How does super(title) set the String title to the title ...
In Java, when you call `super(title)` in a constructor of a subclass, you are invoking the constructor of the superclass (in this case, `JButton`) with the specified parameters. This is a key feature of object-oriented programming in Java, which allows you to build upon existing classes. ### How `super(title)` works: ...
49,553
[ { "from": "human", "value": "Button class:\nclass SubmitButton extends JButton implements ActionListener {\n public SubmitButton(String title){\n super(title);\n ....\n\nWhere I declare it:\nSubmitButton submit = new SubmitButton(\"Submit\");\nsubmit.setBounds(530+150, 200, 100, 25);\n\nHow...
I am currently using TcpListener to address incoming connections, each of which are given a thread for handling the communication and then shutdown that single connection. Code looks as follows: TcpListener listener = new TcpListener(IPAddress.Any, Port); System.Console.WriteLine("Server Initialized, listening for inco...
To stop a `TcpListener` that is blocking on `AcceptTcpClient`, you will need a strategy to exit the blocking call. Simply setting the `listen` variable to `false` will not be sufficient because `AcceptTcpClient` will continue blocking until a client connects. One common method to achieve this is to use a `Cancellatio...
45,433
[ { "from": "human", "value": "I am currently using TcpListener to address incoming connections, each of which are given a thread for handling the communication and then shutdown that single connection. Code looks as follows:\nTcpListener listener = new TcpListener(IPAddress.Any, Port);\nSystem.Console.WriteL...
With code like the following, sometimes the child controls correctly finish their animation and sometimes they stop at random places in the middle. Why don't they work correctly? var t:Tween; t = new Tween(child1,"x",Elastic.easeOut,0,100,2,true); t = new Tween(child1,"y", Elastic.easeOut,0,100,2,true); t = new Tween(...
The issue you're experiencing with the animations of the child controls not completing properly is likely due to how you're handling the `Tween` objects. In the code provided, you are creating multiple `Tween` objects but overwriting the variable `t` with each new `Tween`. This means that only the last `Tween` created ...
48,321
[ { "from": "human", "value": "With code like the following, sometimes the child controls correctly finish their animation and sometimes they stop at random places in the middle. Why don't they work correctly?\nvar t:Tween;\nt = new Tween(child1,\"x\",Elastic.easeOut,0,100,2,true);\nt = new Tween(child1,\"y\...
I want to create a lst file from a sql script Here is my code: BEGIN DECLARE loc_bia_foracid GAM.foracid%TYPE; loc_fba_foracid GAM.foracid%TYPE; out_spool VARCHAR2(32000); BEGIN loc_bia_foracid:= '&loc_bia_foracid'; loc_fba_foracid:= '&loc_fba_foracid'; out_spool := out_spool || '|' || loc_bia_foracid; out_spool := ou...
In Oracle PL/SQL, the maximum size of a VARCHAR2 variable is 32,767 bytes in PL/SQL contexts, but for SQL contexts (like when you’re using it in SQL*Plus or a similar tool), the limit is 32,000 bytes. If you want to handle strings that exceed these limits in PL/SQL, you can use the `CLOB` data type, which can hold much...
48,462
[ { "from": "human", "value": "I want to create a lst file from a sql script\nHere is my code:\nBEGIN\nDECLARE\nloc_bia_foracid GAM.foracid%TYPE;\nloc_fba_foracid GAM.foracid%TYPE;\nout_spool VARCHAR2(32000);\nBEGIN\nloc_bia_foracid:= '&loc_bia_foracid';\nloc_fba_foracid:= '&loc_fba_foracid';\n\nout_spool := ...
We are working on an inquiry management system using J2EE. We're looking at a feature, allowing users to send inquiries to particular mail-id and entering into the database. Catch is to automatically allocate it to some categories.
Creating an inquiry management system in J2EE that automatically categorizes inquiries based on the email content can be a multifaceted task. Here’s a high-level approach to designing and implementing this feature: ### 1. **System Architecture Overview** **Components**: - **Frontend**: User Interface (HTML/CSS/JavaSc...
47,118
[ { "from": "human", "value": "We are working on an inquiry management system using J2EE. We're looking at a feature, allowing users to send inquiries to particular mail-id and entering into the database. Catch is to automatically allocate it to some categories. \n" }, { "from": "gpt", "value": "C...
I am looking for a program to make mockup screenshots with. I first found out I could do it with Visual Basic (uglier names I have yet to hear a programming language being called) from joelonsoftware.com. I don't want to start learning VB now, especially since I am still in the process of learning Java. I then found mo...
If you're looking for free or low-cost alternatives to create mockup screenshots, there are several options you can consider that don't require a lot of upfront investment. Here are some suggestions: 1. **Figma**: Figma is a web-based design tool that allows for collaborative design and prototyping. It has a free tier...
49,528
[ { "from": "human", "value": "I am looking for a program to make mockup screenshots with. I first found out I could do it with Visual Basic (uglier names I have yet to hear a programming language being called) from joelonsoftware.com. I don't want to start learning VB now, especially since I am still in the ...
can anyone think of a better way to do this? [AcceptVerbs(HttpVerbs.Post)] public ActionResult SaveAction() { NameValueDeserializer value = new NameValueDeserializer(); // selected messages MemberMessageSaveAction[] messages = (MemberMessageSaveAction[])value.Deserialize(Request.For...
The provided code is a controller action method that handles the processing of member messages based on user actions (like marking messages as read/unread, deleting them, moving them to folders, or exporting them). Here are some suggestions to improve the readability, maintainability, and performance of the code: 1. *...
44,119
[ { "from": "human", "value": "can anyone think of a better way to do this?\n [AcceptVerbs(HttpVerbs.Post)]\n public ActionResult SaveAction()\n {\n NameValueDeserializer value = new NameValueDeserializer();\n\n // selected messages\n MemberMessageSaveAction[] messages = (MemberM...
How can I programatically get the path to MSBuild from a machine where my .exe is running? I can get the .NET version from the Environment but is there a way of getting the correct folder for a .NET version?
To programmatically determine the path to MSBuild on a machine where your executable is running, you can use the registry to find the installation path based on the installed .NET SDK versions. Here's how you can achieve this in C#: 1. **Access the Registry**: MSBuild is typically installed with the .NET SDK. The regi...
49,798
[ { "from": "human", "value": "How can I programatically get the path to MSBuild from a machine where my .exe is running?\nI can get the .NET version from the Environment but is there a way of getting the correct folder for a .NET version?\n" }, { "from": "gpt", "value": "To programmatically deter...
I have an access database with many tables. I am looking for a field which may or may not exist in one or many of the tables. How do I check if it exists or not? (without querying each table of course)
To check if a specific field exists in any of the tables within an Access database without querying each table individually, you can utilize VBA (Visual Basic for Applications) to automate the process. Here's a step-by-step guide on how to do this: 1. **Open the Database**: Open your Access database. 2. **Open the VB...
48,595
[ { "from": "human", "value": "I have an access database with many tables. I am looking for a field which may or may not exist in one or many of the tables. How do I check if it exists or not? (without querying each table of course)\n" }, { "from": "gpt", "value": "To check if a specific field exi...
I want to call a method when a button is in the mouse down state (IsPressed) and call another method when it is released. I can't seem to figure out a simple way to do this. Thanks!
To handle button press and release events in a straightforward manner, you can typically use the `MouseDown` and `MouseUp` events in most UI frameworks. The approach varies depending on which technology or framework you're using (like WPF, WinForms, or others). Here’s a simple example in both WPF and WinForms. ### WPF...
49,735
[ { "from": "human", "value": "I want to call a method when a button is in the mouse down state (IsPressed) and call another method when it is released. I can't seem to figure out a simple way to do this.\nThanks!\n" }, { "from": "gpt", "value": "To handle button press and release events in a str...
I'm using an hierarchical FSM for an embedded C++ application interface. I'd like to use small functions to determine whether certain inter-state events can be triggered, as well as use them to effect changes in the database: however, making a new class with different event functions for each state is daunting, as well...
Given your constraints in using a hierarchical FSM for your embedded C++ application without heavy libraries, you can consider a few different approaches that allow you to manage your event handling functions efficiently without needing to create a separate class for each state. ### 1. **Function Pointers or `std::fun...
46,306
[ { "from": "human", "value": "I'm using an hierarchical FSM for an embedded C++ application interface. I'd like to use small functions to determine whether certain inter-state events can be triggered, as well as use them to effect changes in the database: however, making a new class with different event func...
I'm working on a site with multiple subdomains, some of which should get their own session. I think I've got it worked out, but have noticed something about cookie handling that I don't understand. I don't see anything in the docs that explains it, so thought I would see if anyone here has some light to shed on the qu...
The behavior you're encountering with cookie handling in PHP is indeed related to how domain specifications for cookies work. Let's clarify a few things about cookie domains: 1. **Cookie Domain Basics**: When you set a cookie in PHP and specify a domain, you can either: - Set it to a specific domain (e.g., `subdoma...
42,133
[ { "from": "human", "value": "I'm working on a site with multiple subdomains, some of which should get their own session.\nI think I've got it worked out, but have noticed something about cookie handling that I don't understand. I don't see anything in the docs that explains it, so thought I would see if an...
I'm stuck with the following: I have an Access2003 report "rptInvoices". Group levels are on CustomerID and PackingListID. What I like to achieve is that every 2nd (or 3rd etc.) page of an invoice starts with a blank section (of say 9cm) at the top of the page. For this I would use an empty PageHeader section. If the...
In Microsoft Access, you can achieve the desired outcome of hiding the Page Header on certain pages of your report, specifically when there is a Group Header present, by using VBA code. Here’s a method you can try: ### Steps to Hide Page Header Based on Group Header 1. **Open Your Report in Design View:** - Open y...
48,856
[ { "from": "human", "value": "I'm stuck with the following:\nI have an Access2003 report \"rptInvoices\". \nGroup levels are on CustomerID and PackingListID. \nWhat I like to achieve is that every 2nd (or 3rd etc.) page of an invoice starts with a blank section (of say 9cm) at the top of the page. For this I...
I have been noticing some very strange usage of O(1) in discussion of algorithms involving hashing and types of search, often in the context of using a dictionary type provided by the language system, or using dictionary or hash-array types used using array-index notation. Basically, O(1) means bounded by a constant ti...
Your observations about the casual use of O(1) in discussions around hashing and collections are quite insightful and highlight an important nuance in algorithm analysis. Here’s an exploration of the concepts you mentioned and some perspectives on why this casualness occurs and is often accepted: ### 1. **Understandin...
46,847
[ { "from": "human", "value": "I have been noticing some very strange usage of O(1) in discussion of algorithms involving hashing and types of search, often in the context of using a dictionary type provided by the language system, or using dictionary or hash-array types used using array-index notation.\nBasi...
I am trying to use a Generic Linked List to hold some WorkFlow steps in my application. Here is how I'm persisting it to my database. OrderID  WorkFlowStepID  ParentWorkFlowStepID 178373    1                         NULL 178373    2                         1 178373    3                         2 I get this dataset bac...
In a LinkedList in C#, the `Find()` method is used to find a node that contains a specified value, which is typically the value of the type you are storing in the list. In your case, since you are storing `WorkFlowStep` objects, you will need to provide a `WorkFlowStep` object or a function that matches the type of `Wo...
46,581
[ { "from": "human", "value": "I am trying to use a Generic Linked List to hold some WorkFlow steps in my application. Here is how I'm persisting it to my database.\nOrderID  WorkFlowStepID  ParentWorkFlowStepID\n178373    1                         NULL\n178373    2                         1\n178373    3    ...
My webapp will need to use multiple database shards, and occasionally need to query these shards in parallel. Are there any web scripting languages that have mature, stable support for parallel non blocking database access? If so, can you point me in the right direction? Free open source is preferred, but I mostly w...
For your requirement of parallel non-blocking database access in a web application, several languages and frameworks offer robust solutions. Here are a few popular choices that can effectively handle concurrent database queries while being open-source: ### 1. **Node.js** - **Description**: Node.js is a JavaScript runt...
48,651
[ { "from": "human", "value": "My webapp will need to use multiple database shards, and occasionally need to query these shards in parallel. Are there any web scripting languages that have mature, stable support for parallel non blocking database access? If so, can you point me in the right direction? Free...
For some reason I can't use runat="server" as an attribute for the input tag in order for the jQuery to display the image button and work. Is something wrong without runat="server"? It works fine. And I want the format to be "yyyy/mm/dd" and also I need it for the server because this is where I check to see if the date...
The issue you are encountering with the `runat="server"` attribute is quite common when working with ASP.NET Web Forms. The `runat="server"` attribute makes an element a server control, which allows you to access it in your server-side code (e.g., C# or VB.NET). However, when you use jQuery or other client-side librari...
47,334
[ { "from": "human", "value": "For some reason I can't use runat=\"server\" as an attribute for the input tag in order for the jQuery to display the image button and work. Is something wrong without runat=\"server\"? It works fine. And I want the format to be \"yyyy/mm/dd\" and also I need it for the server b...
I have a program where I generate bitstreams, of about 80 to 150 bits or so, which I would like to compress, because I'm going to turn them into some kind of ASCII string so people can transmit them around. Does anyone know of a good, free bit-aware compressor that might work on such a stream? My main problem with the ...
For your use case of compressing bitstreams effectively while treating them as bits rather than bytes, you might want to consider a few specialized compression libraries and techniques: 1. **Bit-Packing**: Before applying compression, you can manually pack your bits into a more compact representation. For example, you...
48,775
[ { "from": "human", "value": "I have a program where I generate bitstreams, of about 80 to 150 bits or so, which I would like to compress, because I'm going to turn them into some kind of ASCII string so people can transmit them around.\nDoes anyone know of a good, free bit-aware compressor that might work o...
Hi I'm trying to use mono-service2 to run a stock Windows Service Project from visual studio. I'm running this on debian with mono 2.0 and compiling with. gmcs *.cs -pkg:dotnet I try and start with this (I've tried with -d set to the dir with the app and -n,-m set) mono-service2 -l:service.lock --debug Program.exe Th...
It looks like you're on the right track to run your Windows Service project on Debian using Mono, but you've encountered a common issue regarding the `LD_LIBRARY_PATH` environment variable, which is essential for locating shared libraries like `libMonoPosixHelper.so`. Here's a consolidated guide to help you set up and...
46,353
[ { "from": "human", "value": "Hi I'm trying to use mono-service2 to run a stock Windows Service Project from visual studio. I'm running this on debian with mono 2.0 and compiling with.\ngmcs *.cs -pkg:dotnet\n\nI try and start with this (I've tried with -d set to the dir with the app and -n,-m set)\nmono-ser...
Can I convert a bitmap to PNG in memory (i.e. without writing to a file) using only the Platform SDK? (i.e. no libpng, etc.). I also want to be able to define a transparent color (not alpha channel) for this image. The GdiPlus solution seems to be limited to images of width divisible by 4. Anything else fails during th...
To convert a bitmap to PNG in memory while allowing you to specify a transparent color, you can indeed leverage the GDI+ library. However, as you noted, GDI+ has limitations concerning image widths, specifically that they must be a multiple of four when saving to certain formats like PNG. This limitation arises from ho...
49,844
[ { "from": "human", "value": "Can I convert a bitmap to PNG in memory (i.e. without writing to a file) using only the Platform SDK? (i.e. no libpng, etc.).\nI also want to be able to define a transparent color (not alpha channel) for this image.\nThe GdiPlus solution seems to be limited to images of width di...
How can I set parent-child relation on same table? Id int, title string, ParentId int ---> this is refer to Id
To set a parent-child relationship in the same table, you can use a technique known as a self-referencing relationship or a recursive relationship. In your case, you want the `ParentId` to reference the `Id` of the same table. Below is an example of how you can implement this in SQL, along with explanations. ### Table...
49,914
[ { "from": "human", "value": "How can I set parent-child relation on same table?\nId int, \ntitle string, \nParentId int ---> this is refer to Id\n\n" }, { "from": "gpt", "value": "To set a parent-child relationship in the same table, you can use a technique known as a self-referencing relations...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>YUI Calendar Control Example</title> <link rel="stylesheet" type="text/css" href="yui/build/calendar/assets/skins/sam/calendar.css...
It looks like there are a few issues with your JavaScript code and structure that might be preventing the calendar from appearing when you click the icon. Let's address those issues step-by-step: 1. **Variable Declaration**: You're using `Var` instead of `var`. JavaScript is case-sensitive, and variable declarations s...
49,005
[ { "from": "human", "value": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\n\"http://www.w3.org/TR/html4/strict.dtd\">\n<html lang=\"en\">\n<head>\n<meta http-equiv=\"content-type\" content=\"text/html;\ncharset=utf-8\">\n<title>YUI Calendar Control Example</title>\n<link rel=\"stylesheet\"\ntype=\"te...
I know how to connect to web server using an iPhone but now I have to connect the iPhone to a web service. I don't know how to do it and there is no demo or class available online. Does anyone have any ideas?
Connecting an iPhone to a web service typically involves making HTTP requests to the service's API (Application Programming Interface). Here's a step-by-step guide on how to do it using Swift, which is the primary programming language for iOS development. ### Prerequisites 1. **Xcode Installed**: You need to have Xcod...
45,696
[ { "from": "human", "value": "I know how to connect to web server using an iPhone but now I have to connect the iPhone to a web service. I don't know how to do it and there is no demo or class available online.\nDoes anyone have any ideas?\n" }, { "from": "gpt", "value": "Connecting an iPhone to ...
I'm searching an example of an activex that contain a WPF control. I'm able to see the control during registration of activex in the test activex container but when I instantiate it i cannot see WPF but what is coded inside OnDraw. Any hint or example?
Creating an ActiveX control that hosts a WPF control can be a bit challenging due to the differences between the technologies. However, it is certainly possible. Below, I provide a simple example of how to create an ActiveX control that can host a WPF control. ### Steps to Create an ActiveX Control with WPF: 1. **Cre...
39,825
[ { "from": "human", "value": "I'm searching an example of an activex that contain a WPF control.\nI'm able to see the control during registration of activex in the test activex container but when I instantiate it i cannot see WPF but what is coded inside OnDraw.\nAny hint or example?\n" }, { "from": ...
I know M is a new language from Microsoft that's targeted as a modeling solution but I'm still a bit fuzzy on usage / rationale / advantages. That's why I'm looking for interesting things that people have done with M, so I can understand it better.
M is a modeling language developed by Microsoft, primarily associated with the Domain-Specific Language (DSL) tools and the "Oslo" initiative. It provides a framework for creating models that can represent complex systems or domains in a structured manner. Here are some insights into its usage, rationale, and advantage...
49,962
[ { "from": "human", "value": "I know M is a new language from Microsoft that's targeted as a modeling solution but I'm still a bit fuzzy on usage / rationale / advantages. That's why I'm looking for interesting things that people have done with M, so I can understand it better.\n" }, { "from": "gpt",...
My website runs on a single server. I am caching a DataTable. Each session has a refernce to it's own DataView referring to that DataTable. What I am worried about is when I need to make changes to the underlying datatable will they propagate to each of the sessions references to it. Or is there a better way to handle ...
When working with a cached DataTable in a single-server application, it's important to understand how DataViews and caching work in .NET. Here are some key points regarding your setup and how to manage it effectively: ### Behavior of DataTables and DataViews 1. **DataTable Reference**: When you cache a DataTable and ...
49,515
[ { "from": "human", "value": "My website runs on a single server. I am caching a DataTable. Each session has a refernce to it's own DataView referring to that DataTable. What I am worried about is when I need to make changes to the underlying datatable will they propagate to each of the sessions references t...
I'm trying to write some C# code that calls a method from an unmanaged DLL. The prototype for the function in the dll is: extern "C" __declspec(dllexport) char *foo(void); In C#, I first used: [DllImport(_dllLocation)] public static extern string foo(); It seems to work on the surface, but I'm getting memory corrupt...
You're on the right track with using `System.IntPtr` for the return type of the `foo` function in your DLL. The reason you're experiencing memory corruption errors is that the string returned by the unmanaged code needs to be marshaled correctly to a managed string type in C#. The unmanaged string is likely allocated w...
48,727
[ { "from": "human", "value": "I'm trying to write some C# code that calls a method from an unmanaged DLL. The prototype for the function in the dll is:\nextern \"C\" __declspec(dllexport) char *foo(void);\n\nIn C#, I first used:\n[DllImport(_dllLocation)]\npublic static extern string foo();\n\nIt seems to w...
I'm needing to add functionality similar to Gmail where the checkboxes on a list of items is remembered across multiple pages of results and when going away and coming back to the result. What I'm trying to figure out is the best way of doing this. I'm using PHP and likely jQuery. My first thought is to add an onClick ...
The functionality you're aiming for, where checkboxes retain their state across multiple pages and visits, is indeed a common requirement in modern web applications. The approach you've outlined is fundamentally sound, but there are optimizations and best practices you can implement to make it more efficient and user-f...
45,779
[ { "from": "human", "value": "I'm needing to add functionality similar to Gmail where the checkboxes on a list of items is remembered across multiple pages of results and when going away and coming back to the result. What I'm trying to figure out is the best way of doing this. I'm using PHP and likely jQuer...
This database will store a list of children. But the problem is, they will have their weight measured once a day. How can I store the changes so I can easily query their actual weight and the weight variation over one day, one week and one month?
To effectively store the weight measurements of children along with their variation over time, you'll need to design a database schema that allows for efficient querying of their current weight as well as historical data. Here’s a suggested approach using a relational database schema: ### Database Schema 1. **Childre...
46,876
[ { "from": "human", "value": "This database will store a list of children. But the problem is, they will have their weight measured once a day. How can I store the changes so I can easily query their actual weight and the weight variation over one day, one week and one month?\n" }, { "from": "gpt", ...
I’m looking for some links to further info on how EE handles Member Groups in relation to the MSM. In my case, I have two membership sites. Generally speaking, the two sites serve the same overall group of people, so the fact that the MSM shares the member database works in my favor. What I’m unclear about is how to ma...
Managing multiple membership levels across two sites using ExpressionEngine (EE) and the Member Site Manager (MSM) can indeed be complex, especially when handling varying access levels. Here's a breakdown of how to approach your situation, along with some helpful resources. ### Understanding Member Groups and Access L...
49,068
[ { "from": "human", "value": "I’m looking for some links to further info on how EE handles Member Groups in relation to the MSM.\nIn my case, I have two membership sites. Generally speaking, the two sites serve the same overall group of people, so the fact that the MSM shares the member database works in my ...
I am using UINavigationController to push and pop a view. I used [[self navigationController] pushViewController:myView animated:YES] to push in a view. Then I clicked the top-left back button to go back, I am getting error: *** -[NSCFDictionary superview]: unrecognized selector sent to instance 0x1451a0 *** Terminati...
The error message you're encountering (`unrecognized selector sent to instance 0x1451a0`) typically indicates that an object is being sent a message that it cannot respond to, in this case, the `superview` selector being sent to an instance of `NSCFDictionary`. This suggests that somewhere in your code, an object (most...
45,812
[ { "from": "human", "value": "I am using UINavigationController to push and pop a view. \nI used [[self navigationController] pushViewController:myView animated:YES] to push in a view. Then I clicked the top-left back button to go back, I am getting error:\n*** -[NSCFDictionary superview]: unrecognized selec...
I have a legacy MS Access 2007 table that contains 52 fields (1 field for each week of the year) representing historical sales data (plus one field for the year actually). I would like to convert this database into a more conventional Time/Value listing. Does anyone knows how to do that without writing queries with 52+...
Converting a wide table format like the one you described (with 52 fields representing weeks) into a more conventional time/value format (like a normalized table) can be done without writing queries with 52+ explicit parameters by utilizing a combination of SQL and programming techniques. Since you mentioned that you'r...
44,015
[ { "from": "human", "value": "I have a legacy MS Access 2007 table that contains 52 fields (1 field for each week of the year) representing historical sales data (plus one field for the year actually). I would like to convert this database into a more conventional Time/Value listing.\nDoes anyone knows how t...
I was just reading this thread and it occurred to me that there is one seemingly-valid use of that pattern the OP is asking about. I know I've used it before to implement dynamic creation of objects. As far as I know, there is no better solution in C++, but I was wondering if any gurus out there know of a better way....
The situation you're describing is quite common in C++ programming, especially when dealing with dynamic object creation and polymorphism. Let's break down the main challenges and potential solutions: ### 1. Dynamic Creation of Objects Based on Configuration When you need to instantiate different subclasses based on ...
41,756
[ { "from": "human", "value": "I was just reading this thread and it occurred to me that there is one seemingly-valid use of that pattern the OP is asking about. I know I've used it before to implement dynamic creation of objects. As far as I know, there is no better solution in C++, but I was wondering if ...
Does anyone know how to set up a default querystring to an asp.net webform which is set up as a start up page?
Setting up a default query string for an ASP.NET Web Form that is set as a startup page can be accomplished in several ways, depending on how your application is structured. Here is a straightforward approach to achieve this: ### Method 1: Modify the URL in the `Page_Load` Event You can modify the URL to include the ...
47,190
[ { "from": "human", "value": "Does anyone know how to set up a default querystring to an asp.net webform which is set up as a start up page?\n" }, { "from": "gpt", "value": "Setting up a default query string for an ASP.NET Web Form that is set as a startup page can be accomplished in several ways...
Using the Access Database Synchronizer has anyone been able to synchronize with an mdb stored in a network location? It doesn't even work if i map a network drive to my local c: i.e. c:\test.mdb works but z:\test.mdb doesn't. I simply get a System.Data.SqlServerCe.SqlCeException "Failure to open SQL Server with given c...
When trying to synchronize an Access database (MDB) stored in a network location using the Access Database Synchronizer, there are a few considerations and steps you should take to troubleshoot the issue. Here are some suggestions: 1. **Check Network Path**: Ensure that the network path to the database file is correct...
49,146
[ { "from": "human", "value": "Using the Access Database Synchronizer has anyone been able to synchronize with an mdb stored in a network location?\nIt doesn't even work if i map a network drive to my local c: i.e. c:\\test.mdb works but z:\\test.mdb doesn't.\nI simply get a System.Data.SqlServerCe.SqlCeExcep...
I have a site that will ultimately support 4 languages and 2 countries (US & Canada, English and Spanish) I'm wondering what's the best way to set up the directory structure? Right now, I have a root site called site.com: This will take you to a page where you choose your country and language. Ideally, I want to have ...
Your approach to structuring the URLs for your multilingual site looks well thought out, but let's examine the implications of both directory structures and the benefits of each to help you determine the best practice. ### Option 1: Country and Language as Separate Directories ``` site.com/ca/en/ (Canada English) site...
46,460
[ { "from": "human", "value": "I have a site that will ultimately support 4 languages and 2 countries (US & Canada, English and Spanish)\nI'm wondering what's the best way to set up the directory structure?\nRight now, I have a root site called site.com: \nThis will take you to a page where you choose your co...
I'm a C# developer. I develop both Windows & Web Applications. I would like to build an Winforms application that has a role-based system. All users must in role/group(s). Then we assign permissions like "View, Add, Update,.." to role/group. The role/group is dynamic, so we let users to define it. Is there any framewor...
Building a role-based access control (RBAC) system in a WinForms application can be achieved using various frameworks and libraries, along with a solid architecture. Below are some frameworks, tools, and sample project ideas to help you implement a dynamic role/group-based permission system in your WinForms application...
46,216
[ { "from": "human", "value": "I'm a C# developer. I develop both Windows & Web Applications. I would like to build an Winforms application that has a role-based system. All users must in role/group(s). Then we assign permissions like \"View, Add, Update,..\" to role/group. The role/group is dynamic, so we le...
I want to select about 4-5 rows from a table, then form a space separated string. All of this is to be done in a stored procedure (SQL server 2005). Is this possible? I will then use this space-separated string and save it to another table. Update SELECT * FROM Users WHERE userID < 10 output: john jake blah sam So, p...
Yes, it is possible to achieve this in a stored procedure in SQL Server 2005. You can use a combination of a cursor (to iterate through the selected rows) and a temporary string variable to concatenate the values into a space-separated string. Finally, you can insert that string into another table. Here’s how you can ...
44,464
[ { "from": "human", "value": "I want to select about 4-5 rows from a table, then form a space separated string.\nAll of this is to be done in a stored procedure (SQL server 2005).\nIs this possible?\nI will then use this space-separated string and save it to another table.\nUpdate\nSELECT *\nFROM Users\nWHER...
I have sit up remote debugging on a Window 2003 server accessed through the Internet. I have VS 2008 SP1 installed on my XP dev box. I launched the site on the remote server and attached to all the w3wp.exe processes on the remote server. I noticed that the .dll did not load the symbols file. When I try to load the cor...
Debugging remotely can be tricky, especially with mismatches in symbol files. Let's address your questions step by step. ### 1. Loading the .pdb File To ensure that the correct .pdb file is loaded, follow these steps: - **Ensure Matching Assemblies**: Make sure that the assembly (.dll) on the remote server is exactl...
48,325
[ { "from": "human", "value": "I have sit up remote debugging on a Window 2003 server accessed through the Internet. I have VS 2008 SP1 installed on my XP dev box.\nI launched the site on the remote server and attached to all the w3wp.exe processes on the remote server. I noticed that the .dll did not load th...
I am developing sharepoint (MOSS) project in Virtual PC. Unfortunately virtual PC can utilize only one core of my quad core machine. Are there any tips & tricks which can speed my development process?
Developing on a single-core Virtual PC can be limiting, especially with resource-intensive applications like SharePoint (MOSS). Here are several tips and tricks to help speed up your development process: 1. **Optimize Virtual Machine Settings:** - **Increase Memory Allocation**: Ensure your virtual machine has adeq...
47,037
[ { "from": "human", "value": "I am developing sharepoint (MOSS) project in Virtual PC. Unfortunately virtual PC can utilize only one core of my quad core machine. Are there any tips & tricks which can speed my development process?\n" }, { "from": "gpt", "value": "Developing on a single-core Virtu...
I have a particular PHP page that, for various reasons, needs to save ~200 fields to a database. These are 200 separate insert and/or update statements. Now the obvious thing to do is reduce this number but, like I said, for reasons I won't bother going into I can't do this. I wasn't expecting this problem. Selects ...
Certainly! Managing a large number of database operations like 200 separate insert/update statements efficiently in PHP and MySQL can be challenging. Here are several strategies you might consider to enhance performance while working within the constraints you’ve mentioned: ### 1. **Batch Processing** Instead of exec...
42,271
[ { "from": "human", "value": "I have a particular PHP page that, for various reasons, needs to save ~200 fields to a database. These are 200 separate insert and/or update statements. Now the obvious thing to do is reduce this number but, like I said, for reasons I won't bother going into I can't do this.\n...
So: I have the following function, adapted from a formula found online, which takes two lat/lon coordinates and finds the distance between them in miles (along a spherical Earth): public static double distance (double lat1, double lon1, double lat2, double lon2) { double theta = toRadians(lon1-lon2); la...
To compute the new latitude and longitude from a given starting point, heading, and distance on the surface of the Earth (assuming a spherical Earth), you can use the following formulas derived from spherical trigonometry. Here's how you can implement the function: 1. **Convert the heading from degrees to radians.** ...
49,842
[ { "from": "human", "value": "So: I have the following function, adapted from a formula found online, which takes two lat/lon coordinates and finds the distance between them in miles (along a spherical Earth):\npublic static double distance (double lat1, double lon1, double lat2, double lon2) {\n doub...
I'm looking at developing a simple validation framework for WPF (the IDataErrorInfo method doesn't provide enough info for my needs), and am wondering if there is a way to be notified when a Property is going to validate? Please note that I need to know any time it is going to attempt validation rather than only when t...
Creating a validation framework in WPF that goes beyond the capabilities of `IDataErrorInfo` requires a bit more structure, especially if you want to include more detailed validation information. Here's an approach you can consider: ### Custom Validation Framework Instead of relying solely on `IDataErrorInfo`, you ca...
45,777
[ { "from": "human", "value": "I'm looking at developing a simple validation framework for WPF (the IDataErrorInfo method doesn't provide enough info for my needs), and am wondering if there is a way to be notified when a Property is going to validate? Please note that I need to know any time it is going to a...
I want to convert the Rijndaemanaged() encrpted value to a string. Will ToBase64String() suffice? It says its only for 8-bit arrays, but AES is 128 bit right? Update For the encrption, I am using the code from http://msdn.microsoft.com/en-us/library/system.security.cryptography.rijndaelmanaged.aspx
Yes, using `Convert.ToBase64String()` is appropriate for converting the byte array produced by the `RijndaelManaged` encryption into a string. While AES (which Rijndael is a variant of) operates on 128-bit blocks (16 bytes), the output of the encryption process will typically be in the form of a byte array. You can the...
41,990
[ { "from": "human", "value": "I want to convert the Rijndaemanaged() encrpted value to a string.\nWill ToBase64String() suffice? It says its only for 8-bit arrays, but AES is 128 bit right?\nUpdate\nFor the encrption, I am using the code from http://msdn.microsoft.com/en-us/library/system.security.cryptogra...