instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I need to have the output of a PHP snippet in a Plone site. It was delivered to be a small library that has a display() function, in PHP, that outputs a line of text. But I need to put it in a Plone site. Do you have any recommendations?
I was thinking a long the lines of having a display.php that just runs display() a... | Integrating PHP directly into a Plone site can be a bit challenging since Plone is built on Python and typically does not run PHP code natively. However, your approach of having a separate PHP script that can be called to retrieve content and display it in Plone is a viable solution. Below are the steps and options for... | 49,372 | [
{
"from": "human",
"value": "I need to have the output of a PHP snippet in a Plone site. It was delivered to be a small library that has a display() function, in PHP, that outputs a line of text. But I need to put it in a Plone site. Do you have any recommendations?\nI was thinking a long the lines of havin... |
I have been looking at using TDD and implementing proper testing (only just started to learn how much better it makes your life) in any of my projects that I create in the future. So for the last couple of days I have been floating around on SO trying to learn about how to design your application for testability, but ... | You're on the right track with both concepts: using interfaces for testability and leveraging dependency injection (DI). Let’s break these down further to clarify how they can improve your ability to write tests for your applications.
### 1. Interfaces
Using interfaces is a common practice in test-driven development ... | 43,938 | [
{
"from": "human",
"value": "I have been looking at using TDD and implementing proper testing (only just started to learn how much better it makes your life) in any of my projects that I create in the future. So for the last couple of days I have been floating around on SO trying to learn about how to desi... |
What are the different types of encapsulation?
Am I right in thinking this basically refers to central OO concepts such as Abstraction, Polymorphism and Inheritance?
My understanding of encapsulation is that it is a method of hiding data / functionality, but I never really considered Polymorphism or Inheritance a form ... | You're on the right track regarding your understanding of encapsulation, and it's great that you're considering how it relates to other core concepts in object-oriented programming (OOP). Let’s clarify and expand on your thoughts about encapsulation, its types, and how it interacts with abstraction, polymorphism, and i... | 48,042 | [
{
"from": "human",
"value": "What are the different types of encapsulation?\nAm I right in thinking this basically refers to central OO concepts such as Abstraction, Polymorphism and Inheritance?\nMy understanding of encapsulation is that it is a method of hiding data / functionality, but I never really con... |
I'm looking for a tool that will generate an assembly/project dependency diagram in Visio (or as close as possible) to assist me with breaking up some of our system into more manageable trunks.
The ability to include/exclude non-project dependencies is a must (i.e. include/exclude System. assemblies).
| Creating a project or assembly dependency diagram can indeed help in visualizing and breaking down systems into more manageable parts. Here are a few tools and methods you can consider for generating such diagrams, specifically with the functionality to include/exclude non-project dependencies like System assemblies:
... | 49,819 | [
{
"from": "human",
"value": "I'm looking for a tool that will generate an assembly/project dependency diagram in Visio (or as close as possible) to assist me with breaking up some of our system into more manageable trunks.\nThe ability to include/exclude non-project dependencies is a must (i.e. include/excl... |
I am developing some ajax stuff on asp.net mvc framework beta.
but,I got exception as following.
Anyone has problem like me?
Sys.ArgumentUndefinedException: Value cannot be undefined.
and my source code is like this.
<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
<script src="../../... | It looks like you're encountering a `Sys.ArgumentUndefinedException` when trying to use Microsoft Ajax along with jQuery in your ASP.NET MVC application. This exception is typically thrown when a function that expects a certain argument does not receive it, or when an expected object is not defined.
Let's look at your... | 47,020 | [
{
"from": "human",
"value": "I am developing some ajax stuff on asp.net mvc framework beta.\nbut,I got exception as following.\nAnyone has problem like me?\nSys.ArgumentUndefinedException: Value cannot be undefined.\nand my source code is like this. \n<asp:Content ID=\"indexContent\" ContentPlaceHolderID=\"... |
Is there any possiblity to read a .config file in a dll assembly? At the moment I use OpenExeConfiguration on a Assembly.Location Property which seems to work. But I want to create separate .config files for different usages like ConfigModuleA.config, ConfigModuleB.config etc.
Any idea?
| Yes, you can definitely read custom `.config` files in a DLL assembly, but you'll need to manage the loading of the configuration files manually since the default behavior of the .NET configuration system is to use the application-level configuration file (like `App.config` or `Web.config`).
Here’s a step-by-step appr... | 49,271 | [
{
"from": "human",
"value": "Is there any possiblity to read a .config file in a dll assembly? At the moment I use OpenExeConfiguration on a Assembly.Location Property which seems to work. But I want to create separate .config files for different usages like ConfigModuleA.config, ConfigModuleB.config etc. \... |
I'm working on a project for OSX where the user can pick a collection of documents (from any application) which I need to generate PDF's from. The standard Macintosh Print dialog has a PDF button which has a number of PDF-related commands including "Save as PDF...". However, I need to generate the PDF file without req... | To achieve your goal of converting various document types to PDF programmatically in macOS without user interaction, you can use the following strategies to simulate the user interaction you've described. However, it should be noted that this approach may not work flawlessly with every application due to differences in... | 47,523 | [
{
"from": "human",
"value": "I'm working on a project for OSX where the user can pick a collection of documents (from any application) which I need to generate PDF's from. The standard Macintosh Print dialog has a PDF button which has a number of PDF-related commands including \"Save as PDF...\". However, ... |
Say we are traversing a graph and want to quickly determine if a node has been seen before or not. We have a few set preconditions.
Nodes have been marked with integers values 1..N
Graph is implemented with nodes having an adjacency list
Every integer value from 1..N occurs in the graph, which is of size N
Any ideas ... | Yes, it is possible to create a purely functional data structure that satisfies your requirements without using hash tables or arrays. One approach to achieving this is by utilizing a balanced binary tree or a set implemented using a functional data structure like a tree.
### Functional Set Representation
We can repre... | 44,399 | [
{
"from": "human",
"value": "Say we are traversing a graph and want to quickly determine if a node has been seen before or not. We have a few set preconditions.\n\nNodes have been marked with integers values 1..N\nGraph is implemented with nodes having an adjacency list\nEvery integer value from 1..N occurs... |
Is there any way to trap an error and exit gracefully from Perl? I am working on a script which might fail due to a SIG event from the OS or other applications running on my server. I wish to trap this event, display the error and exit after closing all files and other attributes I have open during the execution of the... | In Perl, you can handle errors gracefully and ensure that resources are cleaned up using the `eval` block for error trapping and an `END` block for cleanup. Additionally, you can use signal handlers to manage interruptions (like `SIGINT`, `SIGTERM`, etc.) from the operating system or other applications.
Here's a templ... | 42,964 | [
{
"from": "human",
"value": "Is there any way to trap an error and exit gracefully from Perl? I am working on a script which might fail due to a SIG event from the OS or other applications running on my server. I wish to trap this event, display the error and exit after closing all files and other attribute... |
We have a problem with the Euro character when saving and retrieving it from a Oracle 10g using the Oracle 10.2.0.3 JDBC driver. The problem only occurs during a JUnit test running under Linux. The Euro characters returned from database after saving are total screwed up. Oracle has been configured to use character set ... | The issues you're experiencing with the Euro character (€) in your Oracle 10g database, particularly when running JUnit tests under Linux, could be related to a few factors. Let's explore some possibilities and solutions.
### 1. Character Set Configuration
The character set you mentioned, **WE8MSWIN1252**, is a singl... | 49,078 | [
{
"from": "human",
"value": "We have a problem with the Euro character when saving and retrieving it from a Oracle 10g using the Oracle 10.2.0.3 JDBC driver. The problem only occurs during a JUnit test running under Linux. The Euro characters returned from database after saving are total screwed up. Oracle ... |
Are there any command line interfaces to the DHCP settings in Mac OS X? I have found that inside System Profiler, the Network tab provides a lot of useful information, but I have not found any documentation about any command line equivalents.
| Yes, macOS provides command-line tools that allow you to interact with and configure DHCP settings. The primary command-line tool for network configuration on macOS is `networksetup`. You can use this tool to manage network interfaces, including obtaining and releasing DHCP leases.
Here are some commonly used commands... | 44,348 | [
{
"from": "human",
"value": "Are there any command line interfaces to the DHCP settings in Mac OS X? I have found that inside System Profiler, the Network tab provides a lot of useful information, but I have not found any documentation about any command line equivalents.\n"
},
{
"from": "gpt",
"... |
Is there any reasonable method to allow users of a webapp to download large files? I'm looking for something other than the browser's built-in download dialog - the requirements are that the user initiates the download from the browser and then some other application takes over, downloads the file in background and doe... | Yes, there are several reasonable methods to allow users to download large files from a web application while meeting your requirements. Below are a few potential approaches:
### 1. **Download Manager Integration**
One of the most straightforward ways to handle large file downloads is to integrate a third-party downlo... | 44,693 | [
{
"from": "human",
"value": "Is there any reasonable method to allow users of a webapp to download large files? I'm looking for something other than the browser's built-in download dialog - the requirements are that the user initiates the download from the browser and then some other application takes over,... |
Is there a way for me to delete items from calendar by using iCalendar import?
I know that there is a METHOD:CANCEL, however when I tried it, it didn't do anything to the calendar event.
Here is what is in my iCalendar file. When I try to import it to Outlook, it just adds these events.
BEGIN:VCALENDAR
VERSION:2.0
PROD... | To successfully delete or cancel calendar events using the iCalendar format, it’s important to ensure that the events are recognized as cancellations by the calendar application (like Outlook) you are using. In your example, you are correctly using `METHOD:CANCEL`, but there are a few details to keep in mind:
1. **UID... | 48,338 | [
{
"from": "human",
"value": "Is there a way for me to delete items from calendar by using iCalendar import?\nI know that there is a METHOD:CANCEL, however when I tried it, it didn't do anything to the calendar event.\nHere is what is in my iCalendar file. When I try to import it to Outlook, it just adds the... |
I am developing a web-app using zend framework. I like how all the autoloading works however I don't really like the way Zend_Controller names the controllers by default. I am looking for a way to enable zend_controller to understand my controller class named Controller_User stored in {$app}/Controller/User.php . Is th... | Certainly! In Zend Framework, the default naming convention for controllers is based on the class name and its file structure. By default, it expects the controller class names to end with `Controller`, and the corresponding file structure should match the lowercase format of the class name.
To allow the `Zend_Control... | 49,843 | [
{
"from": "human",
"value": "I am developing a web-app using zend framework. I like how all the autoloading works however I don't really like the way Zend_Controller names the controllers by default. I am looking for a way to enable zend_controller to understand my controller class named Controller_User sto... |
Are there any libraries or resources available for parsing/reading an archived eventlogs?
| Yes, there are several libraries and resources available for parsing and reading archived event logs, depending on the format of the event logs and the programming language you are using. Here are some options:
### For Windows Event Logs (EVTX files)
1. **EVTX**:
- **Python Library**: `evtx` is a Python library th... | 46,079 | [
{
"from": "human",
"value": "Are there any libraries or resources available for parsing/reading an archived eventlogs?\n"
},
{
"from": "gpt",
"value": "Yes, there are several libraries and resources available for parsing and reading archived event logs, depending on the format of the event logs ... |
I have PDF documents from a scanner. This PDF contain forms filled out and signed by staff for a days work. I want to place a bar code or standard area for OCR text on every form type so the batch scan can be programatically broken apart into separate PDF document based on form type.
I would like to do this in Micro... | To achieve the task of processing scanned PDF documents, breaking them apart based on form types, and incorporating barcodes or OCR text areas using .NET 2.0, you have a few options available to you, both in the form of third-party libraries and open-source solutions.
### Open Source Solutions
1. **iTextSharp**: This... | 48,054 | [
{
"from": "human",
"value": "I have PDF documents from a scanner. This PDF contain forms filled out and signed by staff for a days work. I want to place a bar code or standard area for OCR text on every form type so the batch scan can be programatically broken apart into separate PDF document based on form... |
Does anyone know a way to find out programatically which physical disk holds a given partition?
Manually, I can find this info using Start->Run->diskmgmt.msc , where I can see that (on my computer) that partitions C: and D: are on disk 1, E: & F: on disk 0.
This is for optimizing some file crunching operations by doing... | To find out programmatically which physical disk holds a given partition in a Windows environment, you can use a few different approaches, such as using PowerShell or Windows Management Instrumentation (WMI). Below are examples of how you can do this.
### Using PowerShell
You can use PowerShell's `Get-Partition` and ... | 47,638 | [
{
"from": "human",
"value": "Does anyone know a way to find out programatically which physical disk holds a given partition?\nManually, I can find this info using Start->Run->diskmgmt.msc , where I can see that (on my computer) that partitions C: and D: are on disk 1, E: & F: on disk 0.\nThis is for optimiz... |
So I was making a class the other day and used Eclipse's method to create the equals method when I realized that it generated the following working code:
class Test {
private int privateInt;
[...]
public boolean equals(Object obj) {
[...]
Test t = (Test) obj;
if ( t.privateInt == privateInt ) {
[.... | In Java, when one class wants to access the private fields of another class, it must do so through public methods (like getters and setters) or through other means allowed by the Java language. However, in this case, the situation you are observing is due to the way Java handles class members in the context of the same... | 49,781 | [
{
"from": "human",
"value": "So I was making a class the other day and used Eclipse's method to create the equals method when I realized that it generated the following working code:\nclass Test {\n private int privateInt;\n [...]\n public boolean equals(Object obj) {\n [...]\n Test t = (Test) obj;... |
If I have a point, and a road network, how do I find the nearest point ON the road? i.e. this is like snapping the point to a line/road.
I am using ArcGis server 9.3 with Java 5 and Oracle 10g. I am using the ST functions and NetworkAnalyst via the java api.
Thanks.
| To find the nearest point on a road (line) from a given point using ArcGIS Server 9.3 with the Java API and Oracle 10g, you can follow these steps:
### Steps to Snap the Point to the Road Network
1. **Setup Your Environment**: Ensure you have access to the ArcGIS Java API and have the necessary libraries included in ... | 48,924 | [
{
"from": "human",
"value": "If I have a point, and a road network, how do I find the nearest point ON the road? i.e. this is like snapping the point to a line/road.\nI am using ArcGis server 9.3 with Java 5 and Oracle 10g. I am using the ST functions and NetworkAnalyst via the java api.\nThanks.\n"
},
... |
Is there a way to add an attribute to an xml node (which I have the xpath of) using nant?
Tried xmlpoke but it looks like it can only update existing attributes.
thanks.
| In NAnt, you can use the `xmlpoke` task to update existing attributes of an XML node, but if you want to add a new attribute to an XML node based on its XPath, you might have to use a combination of NAnt tasks or resort to a custom script.
While `xmlpoke` does not support adding new attributes directly, you can achiev... | 43,764 | [
{
"from": "human",
"value": "Is there a way to add an attribute to an xml node (which I have the xpath of) using nant?\nTried xmlpoke but it looks like it can only update existing attributes.\nthanks.\n"
},
{
"from": "gpt",
"value": "In NAnt, you can use the `xmlpoke` task to update existing att... |
This is probably a beginner question, but how do you set a recordset to a string variable?
Here is my code:
Function getOffice (strname, uname)
strEmail = uname
WScript.Echo "email: " & strEmail
Dim objRoot : Set objRoot = GetObject("LDAP://RootDSE")
Dim objDomain : Set objDomain = GetObject("LDAP://" & objRoot.Ge... | The error you're encountering indicates that the recordset is either empty (no records were found) or it hasn't moved past the beginning (BOF) or the end (EOF) of the recordset. This is why you're seeing the "either BOF or EOF is True" error message.
Here's how you can modify your function to check if the recordset co... | 47,907 | [
{
"from": "human",
"value": "This is probably a beginner question, but how do you set a recordset to a string variable? \nHere is my code: \nFunction getOffice (strname, uname) \n\nstrEmail = uname\nWScript.Echo \"email: \" & strEmail \nDim objRoot : Set objRoot = GetObject(\"LDAP://RootDSE\")\nDim objDomai... |
I want to know if I'm missing something.
Here's how I would do it:
For SPFolder I would change the associtaed item's permissions (SPFolder.Item).
So I suppose managing SPFolder permissions boils down to managing SPListItem permissions.
For SPListItem I would frist break role inheritance with SPListItem.BreakRoleInherit... | You're on the right track with managing permissions for `SPFolder` and `SPListItem` in SharePoint. Here’s a breakdown of the concepts and some additional considerations regarding permissions management:
### Key Points on Managing Permissions
1. **Role Assignments**:
- As you noted, the primary way to manage item-l... | 49,294 | [
{
"from": "human",
"value": "I want to know if I'm missing something.\nHere's how I would do it:\nFor SPFolder I would change the associtaed item's permissions (SPFolder.Item).\nSo I suppose managing SPFolder permissions boils down to managing SPListItem permissions.\nFor SPListItem I would frist break role... |
On my Joomla site, I've added some fairly straight-forward RewriteRules to my .htaccess file. They're all one-to-one rules like this, since I'm changing the file structure of the site and don't want to break my old links.
RewriteRule ^content/view/54/48/$ /courses [R]
These are in addition to the existing rules that c... | When dealing with `RewriteRule` in an `.htaccess` file, the order of the rules is crucial, especially when you have existing rules for a CMS like Joomla. Let's break down what you might need to do to ensure your custom rewrite rules work properly alongside the existing Joomla rules.
### Your RewriteRule
Your current r... | 48,911 | [
{
"from": "human",
"value": "On my Joomla site, I've added some fairly straight-forward RewriteRules to my .htaccess file. They're all one-to-one rules like this, since I'm changing the file structure of the site and don't want to break my old links.\nRewriteRule ^content/view/54/48/$ /courses [R]\n\nThese ... |
We have built a custom socket server in ruby and packaged it as a gem. Since this is an internal project we can not simply publish it to RubyForge or GitHub. I tried to setup our own gem server but gem would not authenticate over https. Our other deployment is all for standard rails applications that use capistrano a... | If you're looking for a cleaner approach to managing your custom Ruby gem and its deployment, here are several strategies you could consider:
1. **Local Gem Repository**:
Set up a local gem server using a tool like `geminabox` or `RubyGems.org`. These tools allow you to host your own gem repository, and you can pus... | 47,917 | [
{
"from": "human",
"value": "We have built a custom socket server in ruby and packaged it as a gem. Since this is an internal project we can not simply publish it to RubyForge or GitHub. I tried to setup our own gem server but gem would not authenticate over https. Our other deployment is all for standard... |
Does anyone have a suggestions as to the best way to allow users to select which columns appear in a datagrid? I would like them to be able to set this up. It would be stored with the user in a profile and loaded each time the user loads the grid. I was thinking about something with ASP.NET personalization.
| Allowing users to customize which columns appear in a DataGrid is a great way to enhance user experience. Here are some suggestions on how to implement this functionality using ASP.NET:
### 1. **User Interface for Column Selection**
- **Checkbox List or Multi-Select Dropdown**: Create a UI component that lists all ... | 46,011 | [
{
"from": "human",
"value": "Does anyone have a suggestions as to the best way to allow users to select which columns appear in a datagrid? I would like them to be able to set this up. It would be stored with the user in a profile and loaded each time the user loads the grid. I was thinking about somethi... |
Namely, how does the following code:
var sup = new Array(5);
sup[0] = 'z3ero';
sup[1] = 'o3ne';
sup[4] = 'f3our';
document.write(sup.length + "<br />");
output '5' for the length, when all you've done is set various elements?
My 'problem' with this code is that I don't understand how length changes without calling a g... | In JavaScript, arrays are a specialized type of object that include a few extra features for handling ordered collections of values. One of these features is the built-in `length` property, which automatically tracks the number of elements in the array.
### How Array Length Works
1. **Initialization**: When you creat... | 45,390 | [
{
"from": "human",
"value": "Namely, how does the following code:\nvar sup = new Array(5);\nsup[0] = 'z3ero';\nsup[1] = 'o3ne';\nsup[4] = 'f3our';\ndocument.write(sup.length + \"<br />\");\n\noutput '5' for the length, when all you've done is set various elements?\nMy 'problem' with this code is that I don'... |
I programmed a bluetooth Television-Remote control for cellphones in J2ME using javax.microedition.lcdui.* (Gauge, List, ChoiseGroup) GUI-Elements.
I want the cellphone to have real-time interaction with my Television, I would like to find way to send user inputs performed with the GUI-Elements immediately (like chang... | To achieve real-time interaction with GUI elements like `Gauge`, `List`, and `ChoiceGroup` in J2ME while utilizing the `Canvas` class for detecting key events, you'll need to implement a workaround, since `Canvas` doesn't directly support MIDP GUI elements.
### Approach to Handle Key Events with MIDP GUI Elements
1. ... | 47,583 | [
{
"from": "human",
"value": "I programmed a bluetooth Television-Remote control for cellphones in J2ME using javax.microedition.lcdui.* (Gauge, List, ChoiseGroup) GUI-Elements. \nI want the cellphone to have real-time interaction with my Television, I would like to find way to send user inputs performed wit... |
I am working on a course leaflet system for the college I work at, leaflets are stored in a database with primary key course_code. I would like the leaflets ideally to get indexed by google how would I achieve this assuming i develop the system in asp.net 2.0.
I understand part of getting it indexed is to pass the var... | To ensure that your course leaflet system in ASP.NET 2.0 is indexed effectively by Google, you’ll need to take a few steps to optimize the way your URLs are structured and how you present your content. Here are some specific steps you can take:
### 1. Use Clean and Descriptive URLs
Instead of using query strings (lik... | 44,115 | [
{
"from": "human",
"value": "I am working on a course leaflet system for the college I work at, leaflets are stored in a database with primary key course_code. I would like the leaflets ideally to get indexed by google how would I achieve this assuming i develop the system in asp.net 2.0. \nI understand par... |
Imagine a .NET application designed using a Layered architecture.
Is it possible to use something like the trusted subsystem pattern when deploying all layers of an application to the same machine?
Is this design insecure by default?
| The Trusted Subsystem Pattern is commonly used in application design to manage permissions and security within a layered architecture. It involves granting specific access rights to a subsystem or service rather than directly to individual users or components. This approach can help to centralize access control, reduce... | 44,640 | [
{
"from": "human",
"value": "Imagine a .NET application designed using a Layered architecture.\nIs it possible to use something like the trusted subsystem pattern when deploying all layers of an application to the same machine?\nIs this design insecure by default?\n"
},
{
"from": "gpt",
"value":... |
I'd like to know if there's a better approach to this problem. I want to resize a label (vertically) to accomodate certain amount of text. My label has a fixed width (about 60 chars wide before it must wrap), about 495 pixels. The font is also a fixed size (12points afaik), but the text is not.
What I want to do is in... | Your approach to resizing the label based on the number of lines is valid and can certainly work. However, there are more efficient and accurate ways to determine the required height of a label that takes into account both new lines and text wrapping, especially if you're dealing with variable-length strings and want t... | 49,504 | [
{
"from": "human",
"value": "I'd like to know if there's a better approach to this problem. I want to resize a label (vertically) to accomodate certain amount of text. My label has a fixed width (about 60 chars wide before it must wrap), about 495 pixels. The font is also a fixed size (12points afaik), but ... |
I'm trying to figure out how to use NHibernate configuration with mapping to update table schemas, rather than dropping and recreating them.
Currently I'm using the NHibernate.Tool.hbm2ddl.SchemaExport obj with FluentNHibernate to generate the database schema for a mysql database. While I can't say it's a huge problem... | Using NHibernate with FluentNHibernate for schema management can sometimes lead to the issue you're facing where the database tables are dropped and recreated. However, there are alternative ways to achieve schema updates without losing your existing data.
### Option 1: Use `SchemaUpdate` Instead of `SchemaExport`
In... | 46,594 | [
{
"from": "human",
"value": "I'm trying to figure out how to use NHibernate configuration with mapping to update table schemas, rather than dropping and recreating them.\nCurrently I'm using the NHibernate.Tool.hbm2ddl.SchemaExport obj with FluentNHibernate to generate the database schema for a mysql databa... |
When I was at university a lecturer said how some people managed to code using sequence diagrams, this to me seems a good way of programming but of course the devil is in the details. I have a few questions.
Does this actually happen or was I
misinterpreting what he said?
Has
anyone here actually done this?
Is it mo... | Your lecturer's mention of using sequence diagrams as a basis for coding likely refers to a practice in software development known as model-driven development or model-driven architecture (MDA). In this approach, high-level models like sequence diagrams can help guide the design and implementation of software systems. ... | 48,640 | [
{
"from": "human",
"value": "When I was at university a lecturer said how some people managed to code using sequence diagrams, this to me seems a good way of programming but of course the devil is in the details. I have a few questions.\n\nDoes this actually happen or was I\nmisinterpreting what he said?\n... |
This UpdatePanel is contained by an UserControl. When the LinkButton is pressed arow should be added in another GridView. When an user is logged in this control is working well.
The problems appears when an user is not logged in and try to push that button. No event triggers.
Someone suggested me to give a permission f... | Based on the provided code and the behavior you're describing, it sounds like the issue is related to event handling when the user is not logged in. In ASP.NET, the `LinkButton` click event may not trigger if the user does not have permission to access the control or if the control is not rendered properly in the absen... | 45,334 | [
{
"from": "human",
"value": "This UpdatePanel is contained by an UserControl. When the LinkButton is pressed arow should be added in another GridView. When an user is logged in this control is working well.\nThe problems appears when an user is not logged in and try to push that button. No event triggers.\n... |
I am working on a project that I want to implement AJAX, and I have decided on jQuery as a JavaScript Library. Here is the HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
... | The issue you're encountering with the response being rendered as a single line with HTML tags visible suggests that the HTML content you're returning from the server is not being properly rendered as HTML in the client's browser. This commonly happens when you set the content incorrectly or when you try to append raw ... | 46,240 | [
{
"from": "human",
"value": "I am working on a project that I want to implement AJAX, and I have decided on jQuery as a JavaScript Library. Here is the HTML:\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://... |
I've been thinking of rolling my own code for enabling my Delphi application to update seamlessly as I'll be going for "release often, release early" mentality furthermore. There are various Delphi solutions (both freeware and paid) out there and I'd like to ask if you've been using any of them or simply went on with y... | Implementing an auto-update mechanism for your Delphi application is a great way to support a "release often, release early" approach. There are several strategies you can consider, ranging from using existing libraries to rolling your own solution. Here are some thoughts on both options:
### Existing Solutions
1. **... | 47,294 | [
{
"from": "human",
"value": "I've been thinking of rolling my own code for enabling my Delphi application to update seamlessly as I'll be going for \"release often, release early\" mentality furthermore. There are various Delphi solutions (both freeware and paid) out there and I'd like to ask if you've been... |
Problem: There are a bunch of .lnk files on the C drive that point to the J: drive, but the J: drive is gone, and the P: drive has replaced it. Various tricks have been done to get the .lnk files to still work anyway, but it's getting annoying, and it's time to just fix the things.
Using Ruby, Python, WSH.JScript or Pe... | Certainly! You can use Python to achieve this task efficiently by utilizing the `pywin32` library, which allows you to manipulate Windows shortcuts (.lnk files) easily. Below is a script that will recursively search for all .lnk files in a given directory and update their target paths from `J:` to `P:`.
### Step 1: In... | 48,582 | [
{
"from": "human",
"value": "Problem: There are a bunch of .lnk files on the C drive that point to the J: drive, but the J: drive is gone, and the P: drive has replaced it. Various tricks have been done to get the .lnk files to still work anyway, but it's getting annoying, and it's time to just fix the thin... |
Firstly, let me set out what I'd like to do. Assume I have three types of EntityObject, MetaData, Data1 and Data2. MetaData is, as one would expect, has a reference to one instance each of Data1 and Data2. Now, for each MetaData, I can calculate a value.
So far so simple. Now, I would like the user to play around with ... | The issue you are encountering arises from the way Entity Framework (EF) handles object tracking and relationships between entities. When you create an instance of `MetaData` and associate it with existing `Data1` and `Data2` instances without saving it to the database, EF doesn't recognize the relationships properly b... | 49,810 | [
{
"from": "human",
"value": "Firstly, let me set out what I'd like to do. Assume I have three types of EntityObject, MetaData, Data1 and Data2. MetaData is, as one would expect, has a reference to one instance each of Data1 and Data2. Now, for each MetaData, I can calculate a value.\nSo far so simple. Now, ... |
I'm an OK C/C++ programmer. I find Haskell very intriguing. But it seems to me, that although it's relatively easy to write clean Haskell code, as it mimics math (which I'm very comfortable with) pretty well, it's very hard to write clean code in Haskell that runs fast.
A faster version of quicksort of Haskell is very ... | Your observations about Haskell and performance are valid and reflect some of the challenges that many Haskell programmers face when trying to write efficient code. Here are some key points to consider:
### 1. **Laziness and Evaluation Strategy**:
Haskell uses lazy evaluation, which means that expressions are not eval... | 48,326 | [
{
"from": "human",
"value": "I'm an OK C/C++ programmer. I find Haskell very intriguing. But it seems to me, that although it's relatively easy to write clean Haskell code, as it mimics math (which I'm very comfortable with) pretty well, it's very hard to write clean code in Haskell that runs fast.\nA faste... |
I'm writing a simple program to help generate orders for a game I'm a member of. It falls into the catergory of programmes I don't actually need. But now I've started I want it to work. It all pretty much runs smoothly but I can't figure out how to stop a type-error ocurring about half way through. Here's the code;
sta... | The `TypeError` you're encountering is due to the fact that the `raw_input` function (which you are using to get the `level` input) returns a string by default. When you attempt to perform arithmetic operations involving the variable `level`, which is a string, you get a TypeError because Python cannot add an integer a... | 46,992 | [
{
"from": "human",
"value": "I'm writing a simple program to help generate orders for a game I'm a member of. It falls into the catergory of programmes I don't actually need. But now I've started I want it to work. It all pretty much runs smoothly but I can't figure out how to stop a type-error ocurring abo... |
We are building an application on an embedded platform that needs a reasonably high performance database (very low select speeds on tables with > 500,000 entries).
The database needs to be able to :
Store atomic commit information in NVRAM so that such information is preserved if power fails before the commit finishe... | Given your requirements and constraints, you're on the right path considering both a "roll-your-own" solution and SQLite. Let's explore these options in more detail, including some potential alternatives and pointers for implementation.
### Option 1: Rolling Your Own Database
Building your own database can provide cu... | 45,072 | [
{
"from": "human",
"value": "We are building an application on an embedded platform that needs a reasonably high performance database (very low select speeds on tables with > 500,000 entries).\n\nThe database needs to be able to :\n Store atomic commit information in NVRAM so that such information is preser... |
I'm programming in PHP and would like to create web pages which have email addresses that are easily read by humans but not easily harvested by spammers. The email addresses are coming from user input, and I think I can identify an address by using a regular expression, but I'm not clear exactly how I should replace t... | You're on the right track with your idea of obfuscating email addresses to prevent spam bots from harvesting them. The approach you described using HTML span tags can indeed help, but here’s a more robust method that also ensures that the original email addresses are displayed correctly to users while remaining less re... | 48,160 | [
{
"from": "human",
"value": "I'm programming in PHP and would like to create web pages which have email addresses that are easily read by humans but not easily harvested by spammers. The email addresses are coming from user input, and I think I can identify an address by using a regular expression, but I'm... |
Which is the best PHP library for openID integration?
| There are several PHP libraries available for OpenID integration, each with its own features and advantages. Here are some of the most popular and well-regarded libraries:
1. **OpenID Connect PHP Libraries**:
- **PHP OpenID Connect Client**: This is a simple and easy-to-use library for OpenID Connect, which is an a... | 49,383 | [
{
"from": "human",
"value": "Which is the best PHP library for openID integration?\n"
},
{
"from": "gpt",
"value": "There are several PHP libraries available for OpenID integration, each with its own features and advantages. Here are some of the most popular and well-regarded libraries:\n\n1. **... |
Is there any simple way to access the DataContext in a linq2sql entity class.
I'm trying to create something like EntitySet but I cannot figure out how the EntitySet has access to the context that created the entity object in the first place.
I want to have a regular linq2sql entity class with a way for the class to ac... | In LINQ to SQL, entities are typically designed to work within the context of a `DataContext`, but they don't inherently have a direct reference to that context after they've been created. However, you can implement a design pattern that allows an entity to access its associated `DataContext`.
### Approaches to Access... | 45,828 | [
{
"from": "human",
"value": "Is there any simple way to access the DataContext in a linq2sql entity class.\nI'm trying to create something like EntitySet but I cannot figure out how the EntitySet has access to the context that created the entity object in the first place.\nI want to have a regular linq2sql ... |
I am using CODBCRecordset (a class found on CodeProject) to find a single record in a table with 39 columns. If no record is found then the call to CRecordset::Open is fine. If a record matches the conditions then I get an Out of Memory exception when CRecordset::Open is called. I am selecting all the columns in the qu... | The Out of Memory exception you are encountering when trying to retrieve a record with a LONGTEXT column in your query is likely due to the way the CRecordset class handles large field types in combination with the MySQL ODBC driver. Here are some steps to diagnose and potentially resolve the issue:
1. **Check Driver ... | 49,138 | [
{
"from": "human",
"value": "I am using CODBCRecordset (a class found on CodeProject) to find a single record in a table with 39 columns. If no record is found then the call to CRecordset::Open is fine. If a record matches the conditions then I get an Out of Memory exception when CRecordset::Open is called.... |
I am new to php.
I made a member registration on login page and adm too. So inside admin I wanted to get the list of the members and delete the members I dont want. So I took the a code from a sample code for phone book from http://localhost/xamp and editted it to my requirement I am able to retrieve the members but u... | To resolve the issue with deleting members from your database and to help you understand the existing code, let’s break it down step by step. Additionally, I'll provide guidance on how to add approved and disapproved radio buttons for each member.
### Fixing the Delete Functionality
1. **Identify the Delete Action**:... | 44,401 | [
{
"from": "human",
"value": "I am new to php.\nI made a member registration on login page and adm too. So inside admin I wanted to get the list of the members and delete the members I dont want. So I took the a code from a sample code for phone book from http://localhost/xamp and editted it to my requireme... |
I'm currently using jQuery and am looking for a way to slide an image left as a new image slides left into its place.
Specifically, I have a static image of an iphone. When I click a link, I need the current image displaying on the iphone's image viewer to slide out to the left as the new image slides in from the righ... | To create a sliding image transition where the current image slides out to the left while a new image slides in from the right, you can use jQuery's `animate` function to create custom animations. While jQuery doesn't have built-in `slideLeft` and `slideRight` functions, you can achieve this effect by manipulating the ... | 49,451 | [
{
"from": "human",
"value": "I'm currently using jQuery and am looking for a way to slide an image left as a new image slides left into its place.\nSpecifically, I have a static image of an iphone. When I click a link, I need the current image displaying on the iphone's image viewer to slide out to the lef... |
I'm wondering where I find the source to show how the operator ** is implemented in Python. Can someone point me in the right direction?
| In Python, the `**` operator is used for exponentiation (raising a number to the power of another). If you're looking to find the source code for the implementation of this operator, you can look at the CPython source code, which is the standard implementation of Python.
### Finding the Implementation
1. **CPython So... | 43,266 | [
{
"from": "human",
"value": "I'm wondering where I find the source to show how the operator ** is implemented in Python. Can someone point me in the right direction? \n"
},
{
"from": "gpt",
"value": "In Python, the `**` operator is used for exponentiation (raising a number to the power of anot... |
I have some numeric code that I need to convert to C or C++. I tried using f2c, but it won't work on the Fortran code. f2c complains because the code uses C style preprocessor directives (#include).
The code's readme states that it is Fortran77, that works with the fort77 linker, that would expand those includes.
Does... | If you are working with Fortran code that includes C-style preprocessor directives (`#include`), and the `f2c` tool does not handle those properly, you have a couple of options to proceed with the conversion process:
### 1. Create a Simple Preprocessor
You can indeed write a simple preprocessor in C/C++ or Python tha... | 49,209 | [
{
"from": "human",
"value": "I have some numeric code that I need to convert to C or C++. I tried using f2c, but it won't work on the Fortran code. f2c complains because the code uses C style preprocessor directives (#include). \nThe code's readme states that it is Fortran77, that works with the fort77 link... |
Assume your .NET-based development team is already using the following set of tools in its processes:
Subversion / TortoiseSVN / VisualSVN (source control)
NUnit (unit testing)
An open source Wiki
A proprietary bug-tracking system that is paid for
You are happy with Subversion and NUnit, but dislike the Wiki and bug-... | When considering the adoption of Visual Studio Team Services (VSTS), now known as Azure DevOps, it's important to evaluate both the features it offers and the potential integration benefits that can come from using a more unified platform. Here’s a compelling argument for adopting Azure DevOps, especially given your cu... | 48,626 | [
{
"from": "human",
"value": "Assume your .NET-based development team is already using the following set of tools in its processes:\n\nSubversion / TortoiseSVN / VisualSVN (source control)\nNUnit (unit testing)\nAn open source Wiki\nA proprietary bug-tracking system that is paid for\n\nYou are happy with Sub... |
I'm trying to figure out if I should start using more of internal access modifier.
I know that if we use internal and set the assembly variable InternalsVisibleTo, we can test functions that we don't want to declare public from the testing project.
This makes me think that I should just always use internal because at l... | Using the `internal` access modifier in your C# projects comes with both benefits and drawbacks, and the choice between `internal` and `private` can affect code maintainability, encapsulation, and the design of your application. Here are some considerations:
### Benefits of `internal`
1. **Testing Flexibility**: By ma... | 48,855 | [
{
"from": "human",
"value": "I'm trying to figure out if I should start using more of internal access modifier.\nI know that if we use internal and set the assembly variable InternalsVisibleTo, we can test functions that we don't want to declare public from the testing project.\nThis makes me think that I s... |
Is there an openID implementation in Java? I would like to use this in a tomcat application.
| Yes, there are several OpenID implementations in Java that you can use in a Tomcat application. Here are a few popular options:
1. **Apache Shiro**: Apache Shiro is a powerful and flexible security framework that supports various authentication protocols, including OpenID. You can integrate Shiro into your web applica... | 47,737 | [
{
"from": "human",
"value": "Is there an openID implementation in Java? I would like to use this in a tomcat application.\n"
},
{
"from": "gpt",
"value": "Yes, there are several OpenID implementations in Java that you can use in a Tomcat application. Here are a few popular options:\n\n1. **Apac... |
I am trying to make a Kiosk application more accessible by increasing the size of fonts.
No problem on the main Form.
I'm having a problem replacing MessageBoxes (for which I believe there is no way to increase the font size) with small forms with the same message.
This is where I'm running into the problem. The main F... | It looks like you're on the right track, but there are a couple of issues causing the problems you're facing. Let's go through them and see how to solve the issues:
### Problem 1: Accessing a Non-Static Member
The error message "An object reference is required for the nonstatic field, method, or property" indicates th... | 46,624 | [
{
"from": "human",
"value": "I am trying to make a Kiosk application more accessible by increasing the size of fonts.\nNo problem on the main Form.\nI'm having a problem replacing MessageBoxes (for which I believe there is no way to increase the font size) with small forms with the same message.\nThis is wh... |
In my Spring app, I'd like to use FreeMarker to generate the text of emails that will be sent by my application. The generated text will never be returned to the view so I don't need to configure a FreeMarker view resolver. The documentation seems to indicate that I should configure a FreeMarkerConfigurationFactoryBean... | To generate the text from a FreeMarker template in your Spring application without using a view resolver, you can utilize the `FreeMarkerConfigurer` class, which can be configured as a bean similarly to the `FreeMarkerConfigurationFactoryBean`. This will allow you to access the FreeMarker template engine for rendering ... | 24,561 | [
{
"from": "human",
"value": "In my Spring app, I'd like to use FreeMarker to generate the text of emails that will be sent by my application. The generated text will never be returned to the view so I don't need to configure a FreeMarker view resolver. The documentation seems to indicate that I should confi... |
How do we filter an xml document based on another xml document. I have to remove all the elements which are not there in the lookup xml. Both the input xml and lookup xml has the same root elements, we are using XSLT 1.0.
Ex Input
<Root>
<E1 a="1">V1</E1>
<E2>V2</E2>
<E3>V3</E3>
<E5>
<SE51>SEV1</... | To filter an XML document based on another XML document in XSLT 1.0, you can create a stylesheet that matches the elements of the input XML and checks if they exist in the lookup XML. If the element exists in the lookup XML, it will be included in the output; if it doesn't exist, it will be excluded.
Here is an exampl... | 41,659 | [
{
"from": "human",
"value": "How do we filter an xml document based on another xml document. I have to remove all the elements which are not there in the lookup xml. Both the input xml and lookup xml has the same root elements, we are using XSLT 1.0.\nEx Input\n<Root>\n <E1 a=\"1\">V1</E1>\n <E2>V2</E... |
I've been lead to believe, without research, that server controls are forfeited in the MVC model. I am both very curious to know if this is true, and if so, how would one achieve something equivalent to a Repeater control, or any other view whose exact structure depends on the content of the model?
| In the Model-View-Controller (MVC) architectural pattern, the concept of "server controls" as found in Web Forms (like the Repeater control, GridView, etc.) does indeed change. MVC emphasizes a more lightweight and flexible approach to building web applications without the heavy reliance on server-side controls. In MVC... | 45,085 | [
{
"from": "human",
"value": "I've been lead to believe, without research, that server controls are forfeited in the MVC model. I am both very curious to know if this is true, and if so, how would one achieve something equivalent to a Repeater control, or any other view whose exact structure depends on the ... |
I have an old C++ COM component which has to stay in Visual Studio 6.0 format. I can't for the life of me figure out how to debug the code in the actual COM component.
I'm able to build it in debug mode, add breakpoints and attach it to the dllhost.exe process, but the Visual Studio environment will only show me the d... | To debug a COM component under IIS using Visual Studio 6.0, you'll want to set up IIS to run in "single process" mode (also known as "out-of-process" mode) so that it can debug your code directly. Here’s how you can do that:
### Step 1: Change the IIS Settings
1. **Open the Registry Editor**:
- Press `Win + R`, ty... | 49,085 | [
{
"from": "human",
"value": "I have an old C++ COM component which has to stay in Visual Studio 6.0 format. I can't for the life of me figure out how to debug the code in the actual COM component.\nI'm able to build it in debug mode, add breakpoints and attach it to the dllhost.exe process, but the Visual ... |
How does one copy resource files (config/data/image) files to an applictions home directory on the iPhone.
A related question Loading Data Files on iPhone?, received an answer "just add them to your project; Xcode will copy them to the .app bundle when it builds your application".
How does one do this? (If this is a si... | To copy resource files (like configuration, data, or image files) into your application's home directory on an iPhone, you need to follow these steps:
### Step 1: Add Files to Your Xcode Project
1. **Open your Xcode project**.
2. **Drag and drop** the files you want to include (e.g., images, configuration files, etc.... | 48,919 | [
{
"from": "human",
"value": "How does one copy resource files (config/data/image) files to an applictions home directory on the iPhone.\nA related question Loading Data Files on iPhone?, received an answer \"just add them to your project; Xcode will copy them to the .app bundle when it builds your applicati... |
I have a problem with Gridview sorting that is similar to others but I'm binding to a collection object as opposed to a data table.
The existing business rules and data access layers of an application follow the pattern of having an object and, if you need a collection of objects of that type, to have another class inh... | Handling sorting in a GridView when binding to a custom collection rather than a DataTable can indeed be challenging, especially when you have inherited a structure that does not support sorting natively.
Given that your custom collection does not provide sorting capabilities through `SortProperty`, `SortDirection`, ... | 36,337 | [
{
"from": "human",
"value": "I have a problem with Gridview sorting that is similar to others but I'm binding to a collection object as opposed to a data table.\nThe existing business rules and data access layers of an application follow the pattern of having an object and, if you need a collection of objec... |
I am using Python to read in data in a user-unfriendly format and transform it into an easier-to-read format. The records I am outputting are usually going to be just a last name, first name, and room code. I
I would like to output a series of pages, each containing a contiguous subset of the total records, divided i... | Given your constraints and the fact that you now have access to a word processor on the target machine, your approach of measuring your specific layout (characters per line and lines per column) is a good one. Here’s a step-by-step process you can follow to achieve your goal of formatting the records appropriately.
##... | 45,581 | [
{
"from": "human",
"value": "I am using Python to read in data in a user-unfriendly format and transform it into an easier-to-read format. The records I am outputting are usually going to be just a last name, first name, and room code. I\nI would like to output a series of pages, each containing a contigu... |
I have a simple report that I want to export to a CSV file. There is only the detail line that is grouped by one field, no group header, and a group footer for totals. The problem is when I export to CSV format, the total row for a group is listed in front of every record?
If I export to Excel and then save as a CSV ... | Hi Bob,
It sounds like you're encountering a couple of common issues when exporting to CSV. Here are some suggestions to help you address both problems you've mentioned:
### 1. Issue with Group Total Rows Appearing Multiple Times
The problem where the total row for a group is duplicated in front of every record when... | 46,737 | [
{
"from": "human",
"value": "I have a simple report that I want to export to a CSV file. There is only the detail line that is grouped by one field, no group header, and a group footer for totals. The problem is when I export to CSV format, the total row for a group is listed in front of every record?\nIf... |
I created a separate assembly to contain common extension methods, the extension methods uses classes from System.Web.dll (and others).
When I then create a new project (Console Application) that references the Utilities.dll assembly that contains the extension methods, I do not need to add a reference to System.Web.dl... | The issue you're encountering is related to how the C# compiler resolves type dependencies, especially with generics and constraints. Let's break down why this happens.
### Understanding the Problem
1. **Extension Methods and References**: When you create an extension method in a separate assembly (like `Utilities.dl... | 49,092 | [
{
"from": "human",
"value": "I created a separate assembly to contain common extension methods, the extension methods uses classes from System.Web.dll (and others).\nWhen I then create a new project (Console Application) that references the Utilities.dll assembly that contains the extension methods, I do no... |
Using jQuery, how do I delete all rows in a table except the first? This is my first attempt at using index selectors. If I understand the examples correctly, the following should work:
$(some table selector).remove("tr:gt(0)");
which I would read as "Wrap some table in a jQuery object, then remove all 'tr' elements... | It looks like you're very close! The syntax you provided is almost correct, but there's a small issue with how you're using the `.remove()` method in jQuery. The selector needs to be provided in a different way.
When you want to remove rows from a table except the first one, you can use a combination of jQuery selecto... | 48,432 | [
{
"from": "human",
"value": "Using jQuery, how do I delete all rows in a table except the first? This is my first attempt at using index selectors. If I understand the examples correctly, the following should work:\n$(some table selector).remove(\"tr:gt(0)\");\n\nwhich I would read as \"Wrap some table in... |
I wish to execute a javascript function after asp.net postback with out using ajax.
I've tried the following in my even method with no luck:
Page.ClientScript.RegisterStartupScript(GetType(), "ShowPopup", "showCheckOutPopIn('Livraison',556);");
| In ASP.NET Web Forms, if you want to execute a JavaScript function after a postback without using AJAX, using `Page.ClientScript.RegisterStartupScript` is generally the right approach. However, there are a few points to consider to ensure it works correctly.
1. **Ensure the Function Exists**: Make sure that the JavaSc... | 49,467 | [
{
"from": "human",
"value": "I wish to execute a javascript function after asp.net postback with out using ajax.\nI've tried the following in my even method with no luck:\nPage.ClientScript.RegisterStartupScript(GetType(), \"ShowPopup\", \"showCheckOutPopIn('Livraison',556);\");\n\n"
},
{
"from": "g... |
I would like to use SQL Reporting Services 2008 to generate my reports, but I want to use my own UI for specifying the report type, columns, parameters and everything. I want to be able to take these criteria, and then kick off an asynchronous request to SSRS and have the report emailed to me. Is this possible? I do... | Using SQL Server Reporting Services (SSRS) 2008 to generate reports with a custom UI and to send the reports via email is definitely possible, but there are some important considerations to keep in mind regarding your specific requirements.
### 1. Custom UI for Report Criteria
You can create a custom user interface to... | 46,804 | [
{
"from": "human",
"value": "I would like to use SQL Reporting Services 2008 to generate my reports, but I want to use my own UI for specifying the report type, columns, parameters and everything. I want to be able to take these criteria, and then kick off an asynchronous request to SSRS and have the repor... |
I've created a table in Microsoft Sql CE that I'm using to hold some data. I've generated an ORM via SqlMetal and I've pulled the datasource into my WPF project.
I want to create a simple WPF form that can be used to edit a record in the table via the ORM-generated classes. I want this form to support typical OK/Canc... | It's great to hear that you're diving into WPF and ORM with SQL Server! You are correct that managing OK/Cancel semantics is important when editing data. In your current approach, since changes are automatically reflected in the `OrmGeneratedClass`, you need a strategy to manage both "commit" (OK) and "revert" (Cancel)... | 43,559 | [
{
"from": "human",
"value": "I've created a table in Microsoft Sql CE that I'm using to hold some data. I've generated an ORM via SqlMetal and I've pulled the datasource into my WPF project.\nI want to create a simple WPF form that can be used to edit a record in the table via the ORM-generated classes. I... |
I'm trying to consolidate some build information by using a common makefile. My problem is that I want to use that makefile from different subdirectory levels, which makes the working directory value (pwd) unpredictable. For example:
# Makefile.common
TOP := $(shell pwd)
COMPONENT_DIR := $(TOP)/component
COMPONENT_INC ... | To make your `Makefile.common` refer to its own directory instead of relying on the `pwd` command, you can use the special variable `CURDIR`, which contains the path of the current working directory when `make` is invoked. However, `CURDIR` will also refer to the directory where you invoke `make`, which may not be the ... | 49,598 | [
{
"from": "human",
"value": "I'm trying to consolidate some build information by using a common makefile. My problem is that I want to use that makefile from different subdirectory levels, which makes the working directory value (pwd) unpredictable. For example:\n# Makefile.common\nTOP := $(shell pwd)\nCOMP... |
I have been bitten by a poorly architected solution. It is not thread safe!
I have several shared classes and members in the solution, and during development all was cool...
BizTalk has sunk my battle ship.
We are using a custom BizTalk Adapter to call my assemblies. The Adapter is calling my code and running thi... | Using a separate `AppDomain` for each instance of your `Loader` class can indeed help with isolating shared state and ensuring that concurrent executions do not interfere with each other. However, managing `AppDomain`s comes with some complexity, particularly around the lifetime and communication between the main appli... | 46,134 | [
{
"from": "human",
"value": "I have been bitten by a poorly architected solution. It is not thread safe! \nI have several shared classes and members in the solution, and during development all was cool...\nBizTalk has sunk my battle ship. \nWe are using a custom BizTalk Adapter to call my assemblies. Th... |
Is there a way to be sure that a page is coming from cache on a production server and on the development server as well?
The solution shouldn't involve caching middleware because not every project uses them. Though the solution itself might be a middleware.
Just checking if the data is stale is not a very safe testing ... | To ensure that a page is coming from cache on both production and development servers without relying solely on caching middleware, you can implement a simple solution using HTTP headers or response body indicators. This method can be applied regardless of the caching mechanism in use and will provide a clear signal wh... | 44,812 | [
{
"from": "human",
"value": "Is there a way to be sure that a page is coming from cache on a production server and on the development server as well?\nThe solution shouldn't involve caching middleware because not every project uses them. Though the solution itself might be a middleware.\nJust checking if th... |
I don't know why this method returns a blank string:
- (NSString *)installedGitLocation {
NSString *launchPath = @"/usr/bin/which";
// Set up the task
NSTask *task = [[NSTask alloc] init];
[task setLaunchPath:launchPath];
NSArray *args = [NSArray arrayWithObject:@"git"];
[task setArguments:args... | The issue you're encountering is indeed related to the environment in which the `NSTask` is being executed. When you run a shell command in the terminal, it inherits the environment variables, including the `$PATH` variable, which tells the shell where to look for executables. However, when you create an `NSTask`, it d... | 48,897 | [
{
"from": "human",
"value": "I don't know why this method returns a blank string:\n- (NSString *)installedGitLocation {\n NSString *launchPath = @\"/usr/bin/which\";\n\n // Set up the task\n NSTask *task = [[NSTask alloc] init];\n [task setLaunchPath:launchPath];\n NSArray *args = [NSArray ar... |
I am having some problems with events being raised from the non-UI thread, in that i dont wish to have to handle the If me.invokerequired on every event handler added to the thread in Form1.
I am sure i have read somewhere how to use a delegate event (on SO) but i am unable to find it.
Public Class Form1
Private W... | To avoid cross-thread exceptions when raising events from a non-UI thread in a Windows Forms application, you can use a delegate to marshal the calls back to the UI thread. This way, you won't have to check `InvokeRequired` in each event handler. Below, I've modified your example to demonstrate how to do this using the... | 47,144 | [
{
"from": "human",
"value": "I am having some problems with events being raised from the non-UI thread, in that i dont wish to have to handle the If me.invokerequired on every event handler added to the thread in Form1.\nI am sure i have read somewhere how to use a delegate event (on SO) but i am unable to ... |
As a background, I am a developer of an opensource project, a c++ library called openframeworks, that is a wrapper for different libraries, like opengl, quicktime, freeImage, etc. In the next release, we've added a c++ library called POCO, which is similar to boost in some ways in that it's an alternative for java fou... | Hi Zach,
It sounds like you've run into a couple of issues related to how Visual Studio handles object files and linking, especially when using Link-Time Code Generation (LTCG, enabled with the `/GL` option). LTCG is a feature that allows the compiler to optimize the program at link time, leading to potentially smalle... | 46,670 | [
{
"from": "human",
"value": "As a background, I am a developer of an opensource project, a c++ library called openframeworks, that is a wrapper for different libraries, like opengl, quicktime, freeImage, etc. In the next release, we've added a c++ library called POCO, which is similar to boost in some ways... |
Ok, bear with me guys and girls as I'm learning. Here's my question.
I can't figure out why I can't override a method from a parent class. Here's the code from the base class (yes, I pilfered the java code from an OOP book and am trying to rewrite it in C#).
using System;
public class MoodyObject
{
protected Str... | It's great to see that you're diving into object-oriented programming and working with inheritance in C#. You've encountered a common issue that can arise when dealing with method overriding and access modifiers.
Let's summarize what happened and clarify some points:
1. **Understanding Method Overriding**: In C#, to ... | 46,013 | [
{
"from": "human",
"value": "Ok, bear with me guys and girls as I'm learning. Here's my question.\nI can't figure out why I can't override a method from a parent class. Here's the code from the base class (yes, I pilfered the java code from an OOP book and am trying to rewrite it in C#).\nusing System;\n\... |
I have an EXE loaded into a byte array, and I am trying to load it into an assembly object using Assembly.Load. I am getting errors trying to load.
Here is the code that is causing the exception:
Assembly a = Assembly.Load(bin);
bin is my byte array, loaded from the EXE.
Here is the exception I am getting:
Could not... | The error message you're encountering, specifically "An attempt was made to load a program with an incorrect format," often occurs due to issues related to the architecture of the executable you're trying to load, or it may be due to the way you're attempting to load the assembly.
Here are a few things to consider and... | 48,570 | [
{
"from": "human",
"value": "I have an EXE loaded into a byte array, and I am trying to load it into an assembly object using Assembly.Load. I am getting errors trying to load.\nHere is the code that is causing the exception:\nAssembly a = Assembly.Load(bin);\n\nbin is my byte array, loaded from the EXE.\n... |
What ports or modes of communication do you need to open up for SQL Server 2005 Transactional Replication? Main and slave are geographically separated.
| To configure SQL Server 2005 Transactional Replication between geographically separated servers (main and slave), you need to ensure that certain ports are open for communication between the Publisher, Distributor, and Subscriber. Here are the essential ports and protocols you should consider:
1. **SQL Server Default ... | 47,787 | [
{
"from": "human",
"value": "What ports or modes of communication do you need to open up for SQL Server 2005 Transactional Replication? Main and slave are geographically separated.\n"
},
{
"from": "gpt",
"value": "To configure SQL Server 2005 Transactional Replication between geographically sep... |
I created a simple dialog-based application, and in the default CDialog added three buttons (by drag-and-dropping them) using the Visual Studio editor.
The default OK and Cancel buttons are there too.
I want to set the focus to button 1 when I click button 3.
I set the property Flat to true in the properties for muy b... | It seems you are trying to programmatically set the focus to a button in a dialog-based application, but you are facing issues with the button's appearance and caret visibility when setting focus this way.
When you set the focus to a button that has the "Flat" style enabled, it may not visually indicate the focus with... | 47,494 | [
{
"from": "human",
"value": "I created a simple dialog-based application, and in the default CDialog added three buttons (by drag-and-dropping them) using the Visual Studio editor. \nThe default OK and Cancel buttons are there too.\nI want to set the focus to button 1 when I click button 3.\nI set the prope... |
I was wondering why shared_ptr doesn't have an implicit constructor. The fact it doesn't is alluded to here: Getting a boost::shared_ptr for this
(I figured out the reason but thought it would be a fun question to post anyway.)
#include <boost/shared_ptr.hpp>
#include <iostream>
using namespace boost;
using namespace ... | The reason that `boost::shared_ptr` (and C++11's `std::shared_ptr`) does not have an implicit constructor that accepts a raw pointer (like `int*` in your example) is primarily to avoid potential issues with ownership semantics and resource management.
### Key Reasons:
1. **Ownership Semantics**: `shared_ptr` is desig... | 49,997 | [
{
"from": "human",
"value": "I was wondering why shared_ptr doesn't have an implicit constructor. The fact it doesn't is alluded to here: Getting a boost::shared_ptr for this\n(I figured out the reason but thought it would be a fun question to post anyway.)\n#include <boost/shared_ptr.hpp>\n#include <iostre... |
I have an app that is written in Swing, awt.
I want to prevent users from pasting values into the textfields.
is there any way to do this without using action listeners?
| Yes, you can prevent users from pasting values into text fields in a Swing application without using action listeners by overriding the `processKeyEvent` method or by setting a custom `KeyListener` that ignores the paste command (typically Ctrl+V or Command+V).
However, a more straightforward approach in Swing is to u... | 45,011 | [
{
"from": "human",
"value": "I have an app that is written in Swing, awt.\nI want to prevent users from pasting values into the textfields.\nis there any way to do this without using action listeners?\n"
},
{
"from": "gpt",
"value": "Yes, you can prevent users from pasting values into text field... |
I'm looking for suggestions on how to inject runtime dependencies into JPA entities retrieved from Hibernate. My problem is essentially this:
I have a number of different subclasses of a Transaction object. Each Transaction subclass has different behavior when it is executed, and requires a different set of dependencie... | Your problem of injecting runtime dependencies into JPA entities managed by Hibernate is a common challenge, particularly when trying to keep your design clean and maintainable. Here are a few suggestions to improve your design while maintaining type safety and dependency injection, with an emphasis on reducing the unr... | 46,043 | [
{
"from": "human",
"value": "I'm looking for suggestions on how to inject runtime dependencies into JPA entities retrieved from Hibernate. My problem is essentially this:\nI have a number of different subclasses of a Transaction object. Each Transaction subclass has different behavior when it is executed, a... |
By means of a regular expression and Greasemonkey I have an array of results that looks like:
choice1, choice2, choice3, choice3, choice1, etc..
My question is how do I tally up the choices so I know how many times choice1 is in the array, choice2 is in the array, etc. if I do not know exactly how many choices there ar... | To tally the choices from an array in JavaScript and store the results using Greasemonkey, you can follow these steps:
1. **Parse the choices** from the input string (assuming you've already done this and have an array).
2. **Create an object to keep track** of the counts for each unique choice.
3. **Update the counts... | 41,248 | [
{
"from": "human",
"value": "By means of a regular expression and Greasemonkey I have an array of results that looks like:\nchoice1, choice2, choice3, choice3, choice1, etc..\nMy question is how do I tally up the choices so I know how many times choice1 is in the array, choice2 is in the array, etc. if I do... |
I have a report with a lot of formulas that translate the word "TRUE" into an "X" and "FALSE" into a blank space.
I use these to put an "X" in a checkbox.
Sometimes there is text after my checkbox. To avoid slight shifts to the left and right, I print the "X" and the " " in a fixed width font. It is very tedious to m... | In most reporting tools and spreadsheet applications, you typically cannot specify a font directly within a formula. Formatting options, such as font type and size, are usually set at the cell or field level rather than within the formula itself. However, there are some workarounds that can help you achieve your goal w... | 49,982 | [
{
"from": "human",
"value": "I have a report with a lot of formulas that translate the word \"TRUE\" into an \"X\" and \"FALSE\" into a blank space.\nI use these to put an \"X\" in a checkbox.\nSometimes there is text after my checkbox. To avoid slight shifts to the left and right, I print the \"X\" and th... |
Not many are aware of this feature, but Python's functions (and methods) can have attributes. Behold:
>>> def foo(x):
... pass
...
>>> foo.score = 10
>>> dir(foo)
['__call__', '__class__', '__delattr__', '__dict__', '__doc__', '__get__', '__getattribute__', '__hash__', '__init__', '__module__', '__name__', '__... | Defining custom attributes on functions in Python can be a powerful feature, but it comes with both advantages and potential pitfalls. Here’s a look at some possible uses and abuses of this feature.
### Possible Uses
1. **Stateful Functions**:
- Functions can maintain state across calls without using global variab... | 48,468 | [
{
"from": "human",
"value": "Not many are aware of this feature, but Python's functions (and methods) can have attributes. Behold:\n>>> def foo(x):\n... pass\n... \n>>> foo.score = 10\n>>> dir(foo)\n['__call__', '__class__', '__delattr__', '__dict__', '__doc__', '__get__', '__getattribute__', '__has... |
In WinForms, is there a way to specify initial starting locations of MDI Child windows in a somewhat intelligent manner?
I can apply a manual position, or have it center parent, but neither of these options take much thought into existing windows.
I'd like to know if there is built in way to do a "smart arrangement", o... | In WinForms, there isn't a built-in feature to automatically arrange MDI child windows in a "smart" manner, such as avoiding overlaps or optimizing their layout based on existing windows. However, you can implement this functionality yourself.
### Implementing Smart Arrangement
You can create a method to intelligentl... | 47,423 | [
{
"from": "human",
"value": "In WinForms, is there a way to specify initial starting locations of MDI Child windows in a somewhat intelligent manner?\nI can apply a manual position, or have it center parent, but neither of these options take much thought into existing windows.\nI'd like to know if there is ... |
I am creating a basic image browsing application using Silverlight. Depending on the user's connection speed, some images may take time to appear once they click on the thumb nail. I would like to show a progress bar while it is being downloaded. I have this part done.
However, if the image is already in the cache (... | In a Silverlight application, you can manage image caching to avoid showing the progress bar unnecessarily when an image is already in the cache. While Silverlight doesn't provide a direct way to check if an image is in the cache before loading it, you can use the `WebClient` class to handle downloading and manage cach... | 46,850 | [
{
"from": "human",
"value": "I am creating a basic image browsing application using Silverlight. Depending on the user's connection speed, some images may take time to appear once they click on the thumb nail. I would like to show a progress bar while it is being downloaded. I have this part done.\nHowev... |
This is a follow-up to my question yesterday:
CMS kindly provided this example of using bitwise operators to add two numbers in C:
#include<stdio.h>
int add(int x, int y) {
int a, b;
do {
a = x & y;
b = x ^ y;
x = a << 1;
y = b;
} while (a);
return b;
}
int main( void )... | The issue you are experiencing with the Python code entering an infinite loop during subtraction is due to the way Python handles negative integers compared to C.
### Explanation
In C, integer overflow can occur, and negative integers are represented using two's complement representation, which allows for bitwise ope... | 49,457 | [
{
"from": "human",
"value": "This is a follow-up to my question yesterday:\nCMS kindly provided this example of using bitwise operators to add two numbers in C:\n#include<stdio.h>\n\nint add(int x, int y) {\n int a, b;\n do {\n a = x & y;\n b = x ^ y;\n x = a << 1;\n y = b;... |
For a project I am doing I need to manually create a .net project. I am currently using a StreamWriter to create the .sln, .csproj and base (empty for now) class. I am also generating the AssemblyInfo.cs class. I have copied exactly the files and folder structure VS.Net creates when you create an empty windows class li... | When you manually create a Visual Studio solution and project files, there are several important factors to consider beyond just the file structure and basic content. If you are having trouble opening the .sln file or compiling the project, here are some common areas that could be causing issues:
1. **File Paths and N... | 46,766 | [
{
"from": "human",
"value": "For a project I am doing I need to manually create a .net project. I am currently using a StreamWriter to create the .sln, .csproj and base (empty for now) class. I am also generating the AssemblyInfo.cs class. I have copied exactly the files and folder structure VS.Net creates ... |
I have a DLL written in C++ that needs to be used by an application in C#. It works great under Vista x86, but under x64 it fails to load. So I build an x64 version of the DLL and I detect whether the OS is x86 or x64 and use the appropriate interop call to the appropriate DLL. This works fine under Vista x86, but unde... | The "side-by-side" error you are encountering when trying to load your x64 DLL in a C# application on a 64-bit version of Vista typically indicates that there is an issue related to the dependencies of your DLL. In particular, this error often stems from the following issues:
1. **Missing Dependencies**: The x64 DLL m... | 47,586 | [
{
"from": "human",
"value": "I have a DLL written in C++ that needs to be used by an application in C#. It works great under Vista x86, but under x64 it fails to load. So I build an x64 version of the DLL and I detect whether the OS is x86 or x64 and use the appropriate interop call to the appropriate DLL. ... |
Possible Duplicate:
c# - How do I round a decimal value to 2 decimal places (for output on a page)
I want to truncate the decimals like below
i.e.
2.22939393 -> 2.229
2.22977777 -> 2.229
| To truncate a decimal value to three decimal places in C#, you can use a combination of simple arithmetic and type casting. Here's a method to achieve that:
```csharp
public static decimal TruncateDecimal(decimal value, int decimalPlaces)
{
decimal multiplier = (decimal)Math.Pow(10, decimalPlaces);
return Math... | 46,720 | [
{
"from": "human",
"value": "\nPossible Duplicate:\nc# - How do I round a decimal value to 2 decimal places (for output on a page) \n\nI want to truncate the decimals like below\ni.e.\n\n2.22939393 -> 2.229\n2.22977777 -> 2.229\n\n"
},
{
"from": "gpt",
"value": "To truncate a decimal value to th... |
What is the canonical way of making your sprites respond to mouse clicks in PyGame ?
Here's something simple, in my event loop:
for event in pygame.event.get():
if event.type == pygame.QUIT:
exit_game()
[...]
elif ( event.type == pygame.MOUSEBUTTONDOWN and
pygame.mouse.get_pressed()[0]... | Your approach to handling mouse clicks in Pygame is a common and valid method. However, let's dive deeper into your questions and offer some enhancements and clarifications:
### 1. Is this the best way of responding to mouse clicks?
Your current implementation is straightforward and works well for basic scenarios. Ho... | 47,052 | [
{
"from": "human",
"value": "What is the canonical way of making your sprites respond to mouse clicks in PyGame ? \nHere's something simple, in my event loop:\nfor event in pygame.event.get():\n if event.type == pygame.QUIT:\n exit_game()\n [...]\n elif ( event.type == pygame.MOUSEBUTTONDOW... |
I've seen a good bit of setuptools bashing on the internets lately. Most recently, I read James Bennett's On packaging post on why no one should be using setuptools. From my time in #python on Freenode, I know that there are a few souls there who absolutely detest it. I would count myself among them, but I do actually ... | It's great that you're considering improving your Python packaging workflow! Let's clarify your questions and provide some guidance on transitioning from setuptools and easy_install to using pip and modern Python packaging practices.
### 1. Moving Away from easy_install and egg Format
**Dependencies Declaration:**
If... | 45,235 | [
{
"from": "human",
"value": "I've seen a good bit of setuptools bashing on the internets lately. Most recently, I read James Bennett's On packaging post on why no one should be using setuptools. From my time in #python on Freenode, I know that there are a few souls there who absolutely detest it. I would co... |
Open Source projects that ship with unit tests based on NUnit also usually ship the NUnit runners and accompanying binaries. For NUnit 2.4.8, distributing its bin directory verbatim with the actual project amounts to 46 files and a blank addins directory. What would be the minimum set of files needed if all one wanted ... | To distribute the minimum set of files needed for running unit tests using NUnit 2.4.8 with both the GUI and console runners, you would want to include only the essential binaries and configuration files required to run tests without the additional features such as mocking or tests for the NUnit framework itself.
Her... | 45,564 | [
{
"from": "human",
"value": "Open Source projects that ship with unit tests based on NUnit also usually ship the NUnit runners and accompanying binaries. For NUnit 2.4.8, distributing its bin directory verbatim with the actual project amounts to 46 files and a blank addins directory. What would be the minim... |
I am writing a tinyurl clone to learn turbogears. I am wondering how do i redirect my browser to the external website (say www.yahoo.com) from my cherrypy/turbogears app?
I googled about it, but could not find much useful info.
| To redirect a browser to an external website in a TurboGears application, you can use CherryPy's built-in response handling capabilities. Specifically, you would want to set the response status to a redirect and provide the location of the external URL.
Here's a basic example to illustrate how to perform a redirect in... | 48,089 | [
{
"from": "human",
"value": "I am writing a tinyurl clone to learn turbogears. I am wondering how do i redirect my browser to the external website (say www.yahoo.com) from my cherrypy/turbogears app?\nI googled about it, but could not find much useful info.\n"
},
{
"from": "gpt",
"value": "To re... |
I have below a list of text, it is from a popular online game called EVE Online and this basically gets mailed to you when you kill a person in-game. I'm building a tool to parse these using PHP to extract all relevant information. I will need all pieces of information shown and i'm writting classes to nicely break it ... | To parse the structured text data from the EVE Online kill mail efficiently, I recommend a step-by-step approach that involves breaking down the parsing into logical sections and utilizing regular expressions where applicable. Here's a possible approach using PHP:
### Step 1: Read and Split the Data
Instead of collaps... | 42,486 | [
{
"from": "human",
"value": "I have below a list of text, it is from a popular online game called EVE Online and this basically gets mailed to you when you kill a person in-game. I'm building a tool to parse these using PHP to extract all relevant information. I will need all pieces of information shown and... |
I am trying to copy website data to XL 2003
I was told about using "send keys" but it doesn't work.
Please could someone help me.
Sub CopyInternetDoc()
Dim IntApp As Object
Set IntApp = CreateObject("InternetExplorer.Application")
With IntApp
' Change file name to suit
.Visible = True
.Navigate "http://test/"
... | Copying data from a webpage to Excel using VBA can be accomplished without relying on the `SendKeys` method, which is often unreliable. Instead, you can use the Internet Explorer object model to directly access the HTML elements of the webpage and extract data programmatically.
Here's an example that shows how to copy... | 49,366 | [
{
"from": "human",
"value": "I am trying to copy website data to XL 2003 \nI was told about using \"send keys\" but it doesn't work.\nPlease could someone help me.\nSub CopyInternetDoc()\n\nDim IntApp As Object\nSet IntApp = CreateObject(\"InternetExplorer.Application\")\nWith IntApp\n' Change file na... |
I'm working with a VB Script file written by someone else that uses Windows Management Instrumentation (WMI) calls to check on the status of several Windows Services. This script runs every few minutes on set schedule. I need to upgrade/replace the .exe for those services.
I stop the VB Script, stop the services, and... | To force WMI (specifically the WMI service process, `wmiprvse.exe`) to release its handle on service executable files without rebooting the system, you can take a few different approaches. Keep in mind that WMI may hold onto handles due to a variety of factors, including the way services are being queried or due to out... | 49,544 | [
{
"from": "human",
"value": "I'm working with a VB Script file written by someone else that uses Windows Management Instrumentation (WMI) calls to check on the status of several Windows Services. This script runs every few minutes on set schedule. I need to upgrade/replace the .exe for those services.\nI ... |
I have a webservice in java that receives a list of information to be inserted or updated in a database. I don't know which one is to insert or update.
Which one is the best approach to abtain better performance results:
Iterate over the list(a object list, with the table pk on it), try to insert the entry on Database... | When designing a web service for a scenario where you need to either insert or update records in a large database, you have several considerations to keep in mind, especially since performance is your primary goal. Here’s an analysis of the two approaches you mentioned, as well as an alternative approach that may yield... | 47,750 | [
{
"from": "human",
"value": "I have a webservice in java that receives a list of information to be inserted or updated in a database. I don't know which one is to insert or update.\nWhich one is the best approach to abtain better performance results:\n\nIterate over the list(a object list, with the table pk... |
I have a java class file with a main method. In Windows, I would like to be able to drag files onto a desktop icon/short/etc that would call supply the filenames to my main method. Basically, I want to allow users to drag-and-drop files at program execution instead of having type them on the command line.
Any thoughts?... | To achieve drag-and-drop functionality for a Java application on Windows, you can use a simple approach that involves creating a shortcut to your Java program and leveraging a batch file. Below are the steps to implement this:
### 1. Prepare Your Java Application
Ensure your Java application is set up correctly. The m... | 49,568 | [
{
"from": "human",
"value": "I have a java class file with a main method. In Windows, I would like to be able to drag files onto a desktop icon/short/etc that would call supply the filenames to my main method. Basically, I want to allow users to drag-and-drop files at program execution instead of having typ... |
I am working on an application that allows users to input Japanese language characters. I am trying to come up with a way to determine whether the user's input is a Japanese kana (hiragana, katakana, or kanji).
There are certain fields in the application where entering Latin text would be inappropriate and I need a way... | To achieve your goal of validating Japanese characters (hiragana, katakana, and kanji) while restricting Latin input in your application, you can utilize Unicode ranges that correspond to these character sets. Below is a general overview of how you might implement this validation in your application using regular expre... | 49,192 | [
{
"from": "human",
"value": "I am working on an application that allows users to input Japanese language characters. I am trying to come up with a way to determine whether the user's input is a Japanese kana (hiragana, katakana, or kanji).\nThere are certain fields in the application where entering Latin te... |
I want to move about 800gb of data from an NTFS storage device to a FAT32 device (both are external hard drives), on a Windows System.
What is the best way to achieve this?
Simply using cut-paste?
Using the command prompt ? (move)
Writing a batch file to copy a small chunks of data on a given interval ?
Use some speci... | When transferring a large amount of data (800 GB in your case) from an NTFS external hard drive to a FAT32 external hard drive on a Windows system, there are several considerations and methods you can use. Here are the best practices, pros, and cons of different methods:
### Considerations
1. **File Size Limitations:*... | 44,911 | [
{
"from": "human",
"value": "I want to move about 800gb of data from an NTFS storage device to a FAT32 device (both are external hard drives), on a Windows System.\nWhat is the best way to achieve this?\n\nSimply using cut-paste?\nUsing the command prompt ? (move)\nWriting a batch file to copy a small chunk... |
In Windows for ASP, you can get it perfmon, but...
How to get "requests per second" for Apache in Linux?
| To monitor the "requests per second" for an Apache web server in Linux, you can use several methods. Below are some common approaches:
### 1. Using `mod_status`
Apache has a module called `mod_status` that provides information about server activity and performance.
**Step 1: Enable `mod_status`**
You need to enable... | 48,834 | [
{
"from": "human",
"value": "In Windows for ASP, you can get it perfmon, but...\nHow to get \"requests per second\" for Apache in Linux?\n"
},
{
"from": "gpt",
"value": "To monitor the \"requests per second\" for an Apache web server in Linux, you can use several methods. Below are some common a... |
I have checked the whole site and googled on the net but was unable to find a simple solution to this problem.
I have a datatable which has about 20 columns and 10K rows. I need to remove the duplicate rows in this datatable based on 4 key columns. Doesn't .Net have a function which does this? The function closest to w... | You can achieve the removal of duplicate rows based on specific key columns in a DataTable using LINQ in C#. Since you're dealing with a DataTable created from a CSV file, you can first convert the DataTable to a collection of objects, perform the grouping to find duplicates based on the specified key columns, and then... | 46,491 | [
{
"from": "human",
"value": "I have checked the whole site and googled on the net but was unable to find a simple solution to this problem.\nI have a datatable which has about 20 columns and 10K rows. I need to remove the duplicate rows in this datatable based on 4 key columns. Doesn't .Net have a function ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.